dvr-ms transcoding out of sync

HandBrake for Windows support
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
deltatux
Posts: 7
Joined: Fri Jul 10, 2009 11:02 pm

dvr-ms transcoding out of sync

Post by deltatux »

Handbrake is the only program that can transcode large DVR-MS (4+GB) but I'm having issues with the A/V sync.

I've tried ffmpeg, xvid and x264 and nothing mitigates the issue.

Here's the log

Code: Select all

### Windows GUI 0.9.3 2008112300 
### Running: Microsoft Windows NT 6.0.6002 Service Pack 2 
###
### CPU: AMD Phenom(tm) II X4 810 Processor 
### Ram: 4094 MB 
### Screen: 1680x1050 
### Temp Dir: C:\Users\adrien\AppData\Local\Temp\ 
### Install Dir: C:\Program Files (x86)\HandBrake 
### Data Dir: C:\Users\adrien\AppData\Roaming\HandBrake\HandBrake\0.9.3.0 
#########################################

[15:55:47] hb_init: checking cpu count
[15:55:47] hb_init: starting libhb thread
HandBrake 0.9.3 (2008112300) - http://handbrake.fr/
4 CPUs detected
Forcing 4 CPUs
Opening C:\Users\adrien\Princess Protection Program_TFC_2009_06_26_20_00_03 - DVRMS.dvr-ms...
[15:55:47] hb_scan: path=C:\Users\adrien\Princess Protection Program_TFC_2009_06_26_20_00_03 - DVRMS.dvr-ms, title_index=1
[15:55:47] scan: trying to open with libdvdread
[15:55:47] dvd: not a dvd - trying as a stream/file instead
Input #0, asf, from 'C:\Users\adrien\Princess Protection Program_TFC_2009_06_26_20_00_03 - DVRMS.dvr-ms':
  Duration: 01:29:49.06, start: 0.002000, bitrate: 7983 kb/s
    Stream #0.0: Audio: mp2, 48000 Hz, stereo, s16, 384 kb/s
    Stream #0.1: Invalid Codec type -1
    Stream #0.2: Video: mpeg2video, yuv420p, 720x480 [PAR 8:9 DAR 4:3], 12000 kb/s, 29.97 tb(r)
[15:55:47] scan: decoding previews for title 1
[15:55:48] scan: 10 previews, 720x480, 29.970 fps, autocrop = 2/0/0/0, aspect 4:3, PAR 8:9
[15:55:48] scan: title (0) job->width:640, job->height:480
[15:55:48] libhb: scan thread found 1 valid title(s)
+ title 1:
  + vts 0, ttn 0, cells 0->0 (0 blocks)
  + duration: 01:29:49
  + size: 720x480, aspect: 1.33, 29.970 fps
  + autocrop: 2/0/0/0
  + chapters:
    + 1: cells 0->0, 0 blocks, duration 01:29:49
  + audio tracks:
    + 1, Unknown (MP3)
  + subtitle tracks:
Invalid sample rate 0, using input rate 48000
[15:55:48] 1 job(s) to process
[15:55:48] starting job
[15:55:48] work: sanitizing track 0 mixdown Dolby Pro Logic II to Stereo
[15:55:48] job configuration:
[15:55:48]  * source
[15:55:48]    + C:\Users\adrien\Princess Protection Program_TFC_2009_06_26_20_00_03 - DVRMS.dvr-ms
[15:55:48]    + title 1, chapter(s) 1 to 1
[15:55:48]    + container: asf
[15:55:48]    + data rate: 7983 kbps
[15:55:48]  * destination
[15:55:48]    + D:\Media\Convert\Converted\Princess Protection Program.mp4
[15:55:48]    + container: MPEG-4 (.mp4 and .m4v)
[15:55:48]  * video track
[15:55:48]    + decoder: mpeg2video
[15:55:48]      + bitrate 12000 kbps
[15:55:48]    + frame rate: 29.970 fps -> variable fps
[15:55:48]    + dimensions: 720 * 480 -> 720 * 480, crop 2/0/0/0
[15:55:48]    + filters
[15:55:48]      + Detelecine (pullup) (default settings)
[15:55:48]      + Deinterlaces selectively with yadif/mcdeint and lowpass5 blending (default settings)
[15:55:48]      + Deinterlace (ffmpeg or yadif/mcdeint) (0)
[15:55:48]      + Deblock (pp7) (6)
[15:55:48]      + Denoise (hqdn3d) (3:2:2:3)
[15:55:48]    + encoder: FFmpeg
[15:55:48]      + bitrate: 2000 kbps, pass: 0
[15:55:48]  * audio track 0
[15:55:48]    + decoder: Unknown (MP3) (track 1, id 0)
[15:55:48]    + mixdown: Stereo
[15:55:48]    + encoder: faac
[15:55:48]      + bitrate: 128 kbps, samplerate: 48000 Hz
[15:55:48] yadif thread started for segment 0
[15:55:48] yadif thread started for segment 1
[15:55:48] yadif thread started for segment 2
[15:55:48] yadif thread started for segment 3
[15:55:48] decomb thread started for segment 0
[15:55:48] decomb thread started for segment 1
[15:55:48] decomb thread started for segment 2
[15:55:48] decomb thread started for segment 3
[15:55:48] Yadif Deinterlace thread started for segment 0
[15:55:48] Yadif Deinterlace thread started for segment 1
[15:55:48] Yadif Deinterlace thread started for segment 2
[15:55:48] Yadif Deinterlace thread started for segment 3
[15:55:48] sync: expecting 161540 video frames
[15:55:48] dvd: not a dvd - trying as a stream/file instead
[15:55:48] reader: first SCR 9270
[15:55:48] sync: adding 1576 ms of silence to audio 0  start 141840, next 0
[15:55:48] sync: first pts is 51120
[18:49:56] reader: done. 1 scr changes
[mpeg2video @ 0x2180e00]ac-tex damaged at 25 27
[mpeg2video @ 0x2180e00]Warning MVs not available
[18:50:14] sync: got 161488 frames, 161540 expected
[18:50:14] work: average encoding speed for job is 15.428756 fps
[18:50:14] sync: got 161488 frames, 161540 expected
[18:50:14] work: average encoding speed for job is 15.428756 fps
[18:51:10] mpeg2video-decoder done: 161489 frames, 0 decoder errors, 0 drops
[18:51:10] render: lost time: 3553560 (1183 frames)
[18:51:10] render: gained time: 3553560 (4696 frames) (0 not accounted for)
[18:51:10] render: average dropped frame duration: 3003
[18:51:10] mp3-decoder done: 0 frames, 0 decoder errors, 0 drops
[18:51:10] decomb: yadif deinterlaced 50523 | blend deinterlaced 5580 | unfiltered 104201 | total 160304
[18:51:10] libhb: work result = 0
Rip done!

 ############ End of Log ############## 
I also have a small 2 minute clip (shrunk and truncated to 512 kbps mp4 128 kbps AAC file):
Clip (Princess Protection Program, a Disney Channel Original Movie)

deltatux
User avatar
JohnAStebbins
HandBrake Team
Posts: 5723
Joined: Sat Feb 09, 2008 7:21 pm

Re: dvr-ms transcoding out of sync

Post by JohnAStebbins »

This line looks suspicious.

Code: Select all

[15:55:48] sync: adding 1576 ms of silence to audio 0  start 141840, next 0
You might want to try the recently posted snapshot to see if it does any better.
http://forum.handbrake.fr/viewtopic.php?f=6&t=11201

It would have been more helpful to post a small clip of the source rather than the resulting output. Then someone could have tested it for you with more recent code. And if it exposes a bug, we could track it down more easily.
deltatux
Posts: 7
Joined: Fri Jul 10, 2009 11:02 pm

Re: dvr-ms transcoding out of sync

Post by deltatux »

JohnAStebbins wrote:This line looks suspicious.

Code: Select all

[15:55:48] sync: adding 1576 ms of silence to audio 0  start 141840, next 0
You might want to try the recently posted snapshot to see if it does any better.
http://forum.handbrake.fr/viewtopic.php?f=6&t=11201

It would have been more helpful to post a small clip of the source rather than the resulting output. Then someone could have tested it for you with more recent code. And if it exposes a bug, we could track it down more easily.

The movie file is way too big and there's no way of clipping a dvr-ms without transcoding it first.

Right now I'm reconverting it w/ the latest SVN release.

Thanks,
deltatux
deltatux
Posts: 7
Joined: Fri Jul 10, 2009 11:02 pm

Re: dvr-ms transcoding out of sync

Post by deltatux »

ok, so I did try redoing the transcoding, but there still seems to be about a 0.5 second lag in the audio/video sync ... better than before, but still quite annoying. It's as if I was standing far away and the sound takes time to travel to me.

Here's the latest log:

Code: Select all

### CLI Query:  -i "C:\Users\adrien\Princess Protection Program_TFC_2009_06_26_20_00_03 - DVRMS.dvr-ms" -t 1 -c 1 -o "D:\Media\Convert\Converted\Princess Protection Program.mp4" -f mp4 -w 720 --loose-anamorphic  --detelecine="On" --deinterlace="slower" --denoise="medium" -e x264 -b 1800 -a 1 -E faac -6 dpl2 -R 48 -B 128 -D 0 -x ref=6:mixed-refs=1:bframes=9:weightb=1:b-pyramid=1:b-adapt=2:me=tesa:subq=9:analyse=all:8x8dct=1:direct=auto:merange=32:trellis=2:deblock=-2,-1 -v 1

#########################################

[20:03:23] hb_init: checking cpu count
[20:03:23] hb_init: starting libhb thread
HandBrake svn2592 (2009062101) - MinGW i386 - http://handbrake.fr
4 CPUs detected
Opening C:\Users\adrien\Princess Protection Program_TFC_2009_06_26_20_00_03 - DVRMS.dvr-ms...
[20:03:23] hb_scan: path=C:\Users\adrien\Princess Protection Program_TFC_2009_06_26_20_00_03 - DVRMS.dvr-ms, title_index=1
[20:03:23] scan: trying to open with libdvdread
libdvdread: Encrypted DVD support unavailable.
libdvdnav:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdnav:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed
libdvdread: Can't open file VIDEO_TS.IFO.
ERROR: dvd: ifoOpen failed
Input #0, asf, from 'C:\Users\adrien\Princess Protection Program_TFC_2009_06_26_20_00_03 - DVRMS.dvr-ms':
  Duration: 01:29:49.06, start: 0.002000, bitrate: 7983 kb/s
    Stream #0.0: Audio: mp2, 48000 Hz, stereo, s16, 384 kb/s
    Stream #0.1: Invalid Codec type -1
    Stream #0.2: Video: mpeg2video, yuv420p, 720x480 [PAR 8:9 DAR 4:3], 12000 kb/s, 29.97 tbr, 1k tbn, 59.94 tbc
[20:03:23] scan: decoding previews for title 1
[20:03:24] scan: 10 previews, 720x480, 29.970 fps, autocrop = 2/0/0/0, aspect 4:3, PAR 8:9
[20:03:24] scan: title (0) job->width:640, job->height:480
Scanning title 1...
[20:03:24] libhb: scan thread found 1 valid title(s)
+ title 1:
  + vts 0, ttn 0, cells 0->0 (0 blocks)
  + duration: 01:29:49
  + size: 720x480, pixel aspect: 8/9, display aspect: 1.33, 29.970 fps
  + autocrop: 2/0/0/0
  + chapters:
    + 1: cells 0->0, 0 blocks, duration 01:29:49
  + audio tracks:
    + 1, Unknown (MP2)
  + subtitle tracks:
[20:03:24] 1 job(s) to process
[20:03:24] starting job
[20:03:24] work: sanitizing track 0 mixdown Dolby Pro Logic II to Stereo
[20:03:24] job configuration:
[20:03:24]  * source
[20:03:24]    + C:\Users\adrien\Princess Protection Program_TFC_2009_06_26_20_00_03 - DVRMS.dvr-ms
[20:03:24]    + title 1, chapter(s) 1 to 1
[20:03:24]    + container: asf
[20:03:24]    + data rate: 7983 kbps
[20:03:24]  * destination
[20:03:24]    + D:\Media\Convert\Converted\Princess Protection Program.mp4
[20:03:24]    + container: MPEG-4 (.mp4 and .m4v)
[20:03:24]  * video track
[20:03:24]    + decoder: mpeg2video
[20:03:24]      + bitrate 12000 kbps
[20:03:24]    + frame rate: same as source (around 29.970 fps)
[20:03:24]    + loose anamorphic
[20:03:24]      + modulus: 0
[20:03:24]      + storage dimensions: 720 * 480 -> 720 * 480, crop 2/0/0/0
[20:03:24]      + pixel aspect ratio: 107 / 120
[20:03:24]      + display dimensions: 642 * 480
[20:03:24]    + filters
[20:03:24]      + Detelecine (pullup) (On)
[20:03:24]      + Deinterlace (ffmpeg or yadif/mcdeint) (0)
[20:03:24]      + Denoise (hqdn3d) (3:2:2:3)
[20:03:24]    + encoder: x264
[20:03:24]      + options: ref=6:mixed-refs=1:bframes=9:weightb=1:b-pyramid=1:b-adapt=2:me=tesa:subq=9:analyse=all:8x8dct=1:direct=auto:merange=32:trellis=2:deblock=-2,-1
[20:03:24]      + bitrate: 1800 kbps, pass: 0
[20:03:24]  * audio track 0
[20:03:24]    + decoder: Unknown (MP2) (track 1, id 0)
[20:03:24]    + mixdown: Stereo
[20:03:24]    + encoder: faac
[20:03:24]      + bitrate: 128 kbps, samplerate: 48000 Hz
libdvdread: Encrypted DVD support unavailable.
libdvdnav:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdnav:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed
libdvdread: Can't open file VIDEO_TS.IFO.
ERROR: dvd: ifoOpen failed
[20:03:24] Yadif Deinterlace thread started for segment 0
[20:03:24] Yadif Deinterlace thread started for segment 1
[20:03:24] Yadif Deinterlace thread started for segment 2
[20:03:24] Yadif Deinterlace thread started for segment 3
[20:03:24] encx264: keyint-min: 30, keyint-max: 300
[20:03:24] encx264: encoding with stored aspect 107/120
x264 [info]: using SAR=107/120
x264 [info]: using cpu capabilities: MMX2 SSE2Fast FastShuffle SSEMisalign LZCNT
x264 [info]: profile High, level 3.0
[20:03:24] sync: expecting 161540 video frames
[20:03:24] reader: first SCR 9270
[20:03:24] sync: adding 1576 ms of silence to audio 0  start 141840, next 0
[20:03:24] sync: first pts is 51120
[05:29:25] reader: done. 1 scr changes
[05:30:37] sync: got 161488 frames, 161540 expected
[05:30:37] work: average encoding speed for job is 4.745037 fps
[05:31:07] mux: track 0, 160304 frames, 1208105487 bytes, 1793.50 kbps, fifo 64
[05:31:07] mux: track 1, 252601 frames, 86199851 bytes, 127.97 kbps, fifo 1024
[05:31:07] mpeg2video-decoder done: 161489 frames, 0 decoder errors, 0 drops
[05:31:07] render: lost time: 3553560 (1183 frames)
[05:31:07] render: gained time: 3553560 (4696 frames) (0 not accounted for)
[05:31:07] render: average dropped frame duration: 3003
x264 [info]: slice I:1543  Avg QP:17.22  size: 29836  PSNR Mean Y:47.67 U:51.21 V:51.40 Avg:48.55 Global:48.14
x264 [info]: slice P:55669 Avg QP:19.27  size: 12986  PSNR Mean Y:45.09 U:49.53 V:49.86 Avg:46.13 Global:45.61
x264 [info]: slice B:103092 Avg QP:21.17  size:  4260  PSNR Mean Y:44.13 U:49.15 V:49.54 Avg:45.26 Global:44.69
x264 [info]: consecutive B-frames:  1.5% 18.3% 61.1%  5.0% 13.5%  0.6%  0.0%  0.0%  0.0%  0.0%
x264 [info]: mb I  I16..4:  3.5% 88.7%  7.8%
x264 [info]: mb P  I16..4:  0.9% 12.7%  0.7%  P16..4: 46.4% 26.4% 10.1%  0.2%  0.2%    skip: 2.4%
x264 [info]: mb B  I16..4:  0.1%  0.7%  0.0%  B16..8: 44.6%  1.7%  2.7%  direct: 9.3%  skip:40.8%  L0:33.3% L1:55.3% BI:11.4%
x264 [info]: final ratefactor: 19.68
x264 [info]: 8x8 transform  intra:88.4%  inter:68.0%
x264 [info]: direct mvs  spatial:100.0%  temporal:0.0%
x264 [info]: coded y,uvDC,uvAC intra:89.0% 89.4% 42.3% inter:33.2% 37.7% 1.0%
x264 [info]: ref P L0  60.2% 21.8%  7.3%  4.3%  3.0%  3.4%
x264 [info]: ref B L0  79.5% 15.5%  2.8%  1.5%  0.6%
x264 [info]: ref B L1  89.6% 10.4%
x264 [info]: SSIM Mean Y:0.9831727
x264 [info]: PSNR Mean Y:44.498 U:49.303 V:49.671 Avg:45.598 Global:45.011 kb/s:1806.91
[05:31:07] mp2-decoder done: 0 frames, 0 decoder errors, 0 drops
[05:31:07] libhb: work result = 0

Rip done!
HandBrake has exited.
Please help.

P.S: I thought there was a 64-bit binary for the transcoder. It seems that only the GUI for Windows is 64-bit but not the transcoder itself. It's still a 32-bit binary eh? Will that be fixed in the 0.9.4 release?

Thanks,
deltatux
Post Reply