Silence added to middle of music videos for 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
V1de0Luvr
Posts: 11
Joined: Thu Jan 07, 2010 4:52 pm

Silence added to middle of music videos for sync?

Post by V1de0Luvr »

I am new to Handbrake and it looks like it can do exactly what I need, but there are problems with adding silence to audio, supposedly to keep sync. Since this is a music video, I cannot have random silence being added. I am encoding to MKV with passthru AC3. If I manually demux the original AC3 from the MPG and remux with the MKV, all is well - no sync problems and no random silent spots. I assume Handbrake is adding silence, not x264. I believe the following line from the log is the source of the problem:

[11:39:15] sync: adding 116 ms of silence to audio 0 start 11995484, next 11985044

Is there anyway to stop Handbrake 0.9.4 from adding silence? Thanks!

Code: Select all

### CLI Query:  -i "C:\Temp\Katharine McPhee - Had it All (Live on Regis and Kelly 01-06-2010) 720p.mpg" -t 1 -c 1 -o "C:\Temp\Katharine McPhee - Had it All (Live on Regis and Kelly 01-06-2010) 720p.mkv" -f mkv --crop 0:0:0:0 --strict-anamorphic  -e x264 -q 21 -r 29.97 -a 1 -E ac3 -6 auto -R Auto -B 32 -D 0.0 --subtitle scan -x ref=2:bframes=2:subq=6:mixed-refs=0:weightb=0:8x8dct=0:trellis=0 -v 2 ### User Query: True #########################################
[11:34:10] hb_init: checking cpu count
[11:34:10] hb_init: starting libhb thread
HandBrake 0.9.4 (2009112300) - MinGW i386 - http://handbrake.fr
2 CPUs detected
Opening C:\Temp\Katharine McPhee - Had it All (Live on Regis and Kelly 01-06-2010) 720p.mpg...
[11:34:10] hb_scan: path=C:\Temp\Katharine McPhee - Had it All (Live on Regis and Kelly 01-06-2010) 720p.mpg, title_index=1
[11:34:10] scan: trying to open with libdvdread
libdvdnav: Using dvdnav version 4.1.3
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.
libdvdnav: vm: failed to read VIDEO_TS.IFO
[11:34:10] dvd: not a dvd - trying as a stream/file instead
[11:34:10] file is MPEG Program Stream
[11:34:10] add_audio_to_title: added AC3 audio stream 0x80bd
[11:34:10] scan: decoding previews for title 1
[11:34:11] scan: audio 0x80bd: AC-3, rate=48000Hz, bitrate=384000 Unknown (AC3) (5.1 ch)
Scanning title 1...
Scanning title 1...
[11:34:11] scan: 10 previews, 1280x720, 59.940 fps, autocrop = 14/0/0/2, aspect 16:9, PAR 1:1
[11:34:11] scan: title (0) job->width:1280, job->height:704
[11:34:11] libhb: scan thread found 1 valid title(s)
+ title 1:
  + vts 0, ttn 0, cells 0->0 (0 blocks)
  + angle(s) 0
  + duration: 00:02:40
  + size: 1280x720, pixel aspect: 1/1, display aspect: 1.78, 59.940 fps
  + autocrop: 14/0/0/2
  + chapters:
    + 1: cells 0->0, 0 blocks, duration 00:02:40
  + audio tracks:
    + 1, Unknown (AC3) (5.1 ch) (iso639-2: und), 48000Hz, 384000bps
  + subtitle tracks:
    + 1, Closed Captions (iso639-2: und) (Text)
Invalid sample rate 0, using input rate 48000
Subtitle Scan Enabled - enabling subtitles if found for foreign language segments
[11:34:11] 2 job(s) to process
[11:34:11] starting job
[11:34:11] job configuration:
[11:34:11]  * source
[11:34:11]    + C:\Temp\Katharine McPhee - Had it All (Live on Regis and Kelly 01-06-2010) 720p.mpg
[11:34:11]    + title 1, chapter(s) 1 to 1
[11:34:11]  * destination
[11:34:11]    + C:\Temp\Katharine McPhee - Had it All (Live on Regis and Kelly 01-06-2010) 720p.mkv
[11:34:11]    + container: Matroska (.mkv)
[11:34:11]  * video track
[11:34:11]    + decoder: mpeg2
[11:34:11]      + bitrate 38810 kbps
[11:34:11]    + frame rate: 59.940 fps -> constant 29.970 fps
[11:34:11]    + strict anamorphic
[11:34:11]      + modulus: 0
[11:34:11]      + storage dimensions: 1280 * 720 -> 1280 * 720, crop 0/0/0/0
[11:34:11]      + pixel aspect ratio: 1 / 1
[11:34:11]      + display dimensions: 1280 * 720
libdvdnav: Using dvdnav version 4.1.3
[11:34:11] sync: expecting 9689 video frames
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.
libdvdnav: vm: failed to read VIDEO_TS.IFO
[11:34:11] dvd: not a dvd - trying as a stream/file instead
[11:34:26] reader: done. 21 scr changes
[11:34:26] sync: got 0 frames, 9689 expected
[11:34:26] work: average encoding speed for job is 0.000000 fps
[11:34:26] mpeg2 done: 0 frames
[11:34:26] render: 0 frames output, 0 dropped and 0 duped for CFR/PFR
[11:34:26] render: lost time: 0 (0 frames)
[11:34:26] render: gained time: 0 (0 frames) (0 not accounted for)
[11:34:26] starting job
[11:34:26] job configuration:
[11:34:26]  * source
[11:34:26]    + C:\Temp\Katharine McPhee - Had it All (Live on Regis and Kelly 01-06-2010) 720p.mpg
[11:34:26]    + title 1, chapter(s) 1 to 1
[11:34:26]  * destination
[11:34:26]    + C:\Temp\Katharine McPhee - Had it All (Live on Regis and Kelly 01-06-2010) 720p.mkv
[11:34:26]    + container: Matroska (.mkv)
[11:34:26]  * video track
[11:34:26]    + decoder: mpeg2
[11:34:26]      + bitrate 38810 kbps
[11:34:26]    + frame rate: 59.940 fps -> constant 29.970 fps
[11:34:26]    + strict anamorphic
[11:34:26]      + modulus: 0
[11:34:26]      + storage dimensions: 1280 * 720 -> 1280 * 720, crop 0/0/0/0
[11:34:26]      + pixel aspect ratio: 1 / 1
[11:34:26]      + display dimensions: 1280 * 720
[11:34:26]    + encoder: x264
[11:34:26]      + options: ref=2:bframes=2:subq=6:mixed-refs=0:weightb=0:8x8dct=0:trellis=0
[11:34:26]      + quality: 21.00 (RF)
[11:34:26]  * audio track 0
[11:34:26]    + decoder: Unknown (AC3) (5.1 ch) (track 1, id 80bd)
[11:34:26]      + bitrate: 384 kbps, samplerate: 48000 Hz
[11:34:26]    + AC3 passthrough
libdvdnav: Using dvdnav version 4.1.3
[11:34:26] encx264: keyint-min: 30, keyint-max: 300
[11:34:26] encx264: encoding with stored aspect 1/1
[11:34:26] encx264: Encoding at constant RF 21.000000
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.1 Cache64
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.
libdvdnav: vm: failed to read VIDEO_TS.IFO
[11:34:26] dvd: not a dvd - trying as a stream/file instead
[11:34:26] reader: first SCR 222479242 id 224 DTS 222502140
[11:34:26] mpeg2: "" (1) at frame 0 time 3780
x264 [info]: profile Main, level 3.1
No accelerated IMDCT transform found
[11:34:26] sync: expecting 9689 video frames
[ac3 @ 0x411aff0]No channel layout specified. The encoder will guess the layout, but it might be incorrect.
[11:34:26] sync: first pts is 3780
[11:34:26] output track 0: ac3 in sync after skipping 569 bytes
[11:34:50] output track 0: ac3 in sync after skipping 3072 bytes
[11:34:50] sync: adding 93 ms of silence to audio 0  start 1163287, next 1154880
[11:34:48] output track 0: ac3 in sync after skipping 3072 bytes
[11:34:48] sync: adding 74 ms of silence to audio 0  start 2146298, next 2139607
[11:36:04] output track 0: ac3 in sync after skipping 1536 bytes
[11:36:06] sync: video time didn't advance - dropped 1 frames (delta 4 ms, current 4974252, next 4975422, dur 1170)
[11:36:27] output track 0: ac3 in sync after skipping 3072 bytes
[11:36:27] sync: adding 126 ms of silence to audio 0  start 5817211, next 5805847
[11:37:57] output track 0: ac3 in sync after skipping 3072 bytes
[11:37:58] sync: video time didn't advance - dropped 1 frames (delta 3 ms, current 9031805, next 9032980, dur 1175)
[11:38:26] output track 0: ac3 in sync after skipping 3072 bytes
[11:38:26] sync: adding 83 ms of silence to audio 0  start 10121684, next 10114171
[11:38:26] sync: audio 0 time went backwards 0 ms, dropped 1 frames (next 10122811, current 10122811)
[11:38:27] sync: video time didn't advance - dropped 1 frames (delta 4 ms, current 10133834, next 10135004, dur 1170)
[11:38:32] output track 0: ac3 in sync after skipping 1536 bytes
[11:39:15] output track 0: ac3 in sync after skipping 1536 bytes
[11:39:15] sync: adding 116 ms of silence to audio 0  start 11995484, next 11985044
[11:39:25] output track 0: ac3 in sync after skipping 3072 bytes
[11:39:26] sync: video time didn't advance - dropped 1 frames (delta 5 ms, current 12376785, next 12377847, dur 1062)
[11:39:51] output track 0: ac3 in sync after skipping 1536 bytes
[11:39:51] sync: adding 83 ms of silence to audio 0  start 13339319, next 13331804
[11:40:25] reader: done. 21 scr changes
[11:40:27] sync: got 9713 frames, 9689 expected
[11:40:27] work: average encoding speed for job is 26.865911 fps
[11:40:35] mux: track 0, 4860 frames, 80028828 bytes, 3948.09 kbps, fifo 64
[11:40:35] mux: track 1, 5064 frames, 7778304 bytes, 383.73 kbps, fifo 128
[11:40:35] mpeg2 done: 9718 frames
[11:40:35] render: 4860 frames output, 4853 dropped and 0 duped for CFR/PFR
[11:40:35] render: lost time: 0 (0 frames)
[11:40:35] render: gained time: 0 (0 frames) (0 not accounted for)
x264 [info]: frame I:31    Avg QP:18.49  size: 76851  PSNR Mean Y:46.39 U:48.58 V:49.87 Avg:47.11 Global:46.97
x264 [info]: frame P:2476  Avg QP:21.86  size: 23577  PSNR Mean Y:43.59 U:46.13 V:47.35 Avg:44.37 Global:44.23
x264 [info]: frame B:2353  Avg QP:23.64  size:  8190  PSNR Mean Y:42.82 U:45.07 V:46.80 Avg:43.57 Global:43.42
x264 [info]: consecutive B-frames: 16.8% 40.3% 42.9%
x264 [info]: mb I  I16..4: 31.3%  0.0% 68.7%
x264 [info]: mb P  I16..4: 11.1%  0.0%  4.6%  P16..4: 58.6% 14.6%  5.9%  0.0%  0.0%    skip: 5.2%
x264 [info]: mb B  I16..4:  8.0%  0.0%  0.3%  B16..8: 36.7%  1.1%  0.6%  direct:20.0%  skip:33.3%  L0:34.1% L1:51.5% BI:14.5%
x264 [info]: coded y,uvDC,uvAC intra: 24.0% 80.6% 32.2% inter: 15.8% 48.8% 6.9%
x264 [info]: i16 v,h,dc,p: 39% 31% 19% 11%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 23% 23%  4%  6%  6%  6%  5%  4%
x264 [info]: Weighted P-Frames: Y:6.8%
x264 [info]: ref P L0: 65.1%  9.9% 25.0%
x264 [info]: SSIM Mean Y:0.9832416
x264 [info]: PSNR Mean Y:43.237 U:45.632 V:47.099 Avg:44.000 Global:43.834 kb/s:3948.16
[11:40:35] deca52: 5046 frames decoded, 2 crc errors, 25145 bytes dropped
[11:40:35] libhb: work result = 0

Rip done!
HandBrake has exited.
Last edited by Anonymous on Thu Jan 07, 2010 5:52 pm, edited 1 time in total.
Reason: Please enclose Activity Logs in [code] blocks
V1de0Luvr
Posts: 11
Joined: Thu Jan 07, 2010 4:52 pm

Re: Silence added to middle of music videos for sync?

Post by V1de0Luvr »

Well it has been a while with no replies - does nobody else really have issues with pass-through AC3?? Everything I try to encode with original AC3 gets trashed with silent spots thrown in by Handbrake. It seems to do OK if I let Handbrake re-encode the audio, but that is not my aim.
please_help
Posts: 29
Joined: Sun Jan 10, 2010 6:33 pm

Re: Silence added to middle of music videos for sync?

Post by please_help »

I just thought I’d reply, but sorry I don’t have a solution.

I’ve encoded with passthru AC3 numerous times and I haven’t had any problems with out of sync audio. I’ve only got a problem with VFR and choosing an ‘Ultimate Profile’ (so I’ve deleted all my encodes and I’m waiting for some help).

I might get shot down for this, but maybe it’s a frame rate versus audio issue?
V1de0Luvr
Posts: 11
Joined: Thu Jan 07, 2010 4:52 pm

Re: Silence added to middle of music videos for sync?

Post by V1de0Luvr »

Thanks for the reply. Now that you mention it, I am reducing the frame rate of 720p video to 29.97. I will test again with 1080i video where the frame rate is already 29.97. My initial testing was probably just with 720p and reduced frame rate.

To clarify, my problem is not with sync. My problem is that Handbrake inserts silence, supposedly to keep sync. However, when I manually mux the original AC3 with the new MKV, sync is perfect. So, there is no good reason for Handbrake to insert these silent spots.
please_help
Posts: 29
Joined: Sun Jan 10, 2010 6:33 pm

Re: Silence added to middle of music videos for sync?

Post by please_help »

Sorry for my inaccurate reply. I should have said “I haven’t detected any silence being added to my rips”. But I have just noticed in a recent log that there appeared to be a read error so HandBrake fixed the problem by adding silence. I guess if you've changed the frame rate then HandBrake's trying to fix the problem?

Code: Select all

[17:36:11] mpeg2: "Chapter 16" (16) at frame 159051 time 572588993
[17:41:32] hb_demux_ps: not a PS packet (bdd09c29)
...lots of "not a PS packet"...
[17:41:32] hb_demux_ps: not a PS packet (f44f4a9d)
[17:41:32] output track 2: ac3 in sync after skipping 576 bytes
[17:41:33] sync: adding 235 ms of silence to audio 2  start 601517873, next 601496640
[17:41:33] output track 1: ac3 in sync after skipping 448 bytes
[17:41:33] output track 0: ac3 in sync after skipping 448 bytes
[17:41:33] sync: adding 267 ms of silence to audio 0  start 601520753, next 601496640
[17:41:33] sync: adding 267 ms of silence to audio 1  start 601520753, next 601496640
[17:44:48] mpeg2: "Chapter 17" (17) at frame 171201 time 616357793
V1de0Luvr
Posts: 11
Joined: Thu Jan 07, 2010 4:52 pm

Re: Silence added to middle of music videos for sync?

Post by V1de0Luvr »

I upgraded to svn3036 and tested with 1080i video - and still get random silence added to pass-through AC3. So the problem is not related to reducing the frame rate. If I manually mux the original AC3 with the new MKV, all is fine. If I encode using the "just mux" option of StaxRip, all is fine. If I encode to AAC audio with Handbrake, all is fine. Sure looks like a bug in Handbrake pass-through AC3 to me.
V1de0Luvr
Posts: 11
Joined: Thu Jan 07, 2010 4:52 pm

Re: Silence added to middle of music videos for sync?

Post by V1de0Luvr »

Still more testing with svn3036 shows the problem is NOT just with pass-through AC3. I encoded a 720p source with AAC audio and got silence inserted at 3 spots in a 2 minute 27 second clip. I tested with the original frame rate of 59.94 and reducing to 29.97 with the same results except that more silent spots were added to the 59.94 version!

Is it really just me having this problem? I can upload more logs if anyone cares...
V1de0Luvr
Posts: 11
Joined: Thu Jan 07, 2010 4:52 pm

Re: Silence added to middle of music videos for sync?

Post by V1de0Luvr »

Still no useful replies...Here is a new summary of the problem. I capture HDTV using a Hauppauge card. Handbrake cannot handle AC3 audio from these captures. MP2 audio from analog captures works fine, but Handbrake inserts silence into all AC3 audio I ever tried. It does not matter if I must mux pass-through audio or transcode to AAC. Handbrake always inserts silence to supposedly maintain sync. If I manually mux the original audio there is no problem. If I encode with StaxRip there is no problem. Only Handbrake has this problem.
mduell
Veteran User
Posts: 8198
Joined: Sat Apr 21, 2007 8:54 pm

Re: Silence added to middle of music videos for sync?

Post by mduell »

I have the same issue with TiVo HD recordings, and in mine the audio also goes out of sync by the end of the show.
V1de0Luvr
Posts: 11
Joined: Thu Jan 07, 2010 4:52 pm

Re: Silence added to middle of music videos for sync?

Post by V1de0Luvr »

Thanks, mduell. I was beginning to wonder if I was the only user having this issue.
Deleted User 11865

Re: Silence added to middle of music videos for sync?

Post by Deleted User 11865 »

A possible fix has been committed: http://trac.handbrake.fr/changeset/3089

It should make its way into the next snapshot when it is released.
mduell
Veteran User
Posts: 8198
Joined: Sat Apr 21, 2007 8:54 pm

Re: Silence added to middle of music videos for sync?

Post by mduell »

Indeed, 3089 resolved the issue for me.

V1de0Luvr, I sent you a PM with a download link.
V1de0Luvr
Posts: 11
Joined: Thu Jan 07, 2010 4:52 pm

Re: Silence added to middle of music videos for sync?

Post by V1de0Luvr »

YES, I did one test with SVN 3090 and did not get any silence added on AC3 passthru. Will let you know if I see the problem again. Thanks!
dquille
Posts: 7
Joined: Fri Oct 30, 2009 4:30 pm

Re: Silence added to middle of music videos for sync?

Post by dquille »

mduell, could you pm me that download link as well? I'm wondering if this fix will fix the audio sync issues I found with ac3 (and recently I found they are happening in aac as well) I brought up in this post: http://forum.handbrake.fr/viewtopic.php?f=11&t=13572.
Deleted User 11865

Re: Silence added to middle of music videos for sync?

Post by Deleted User 11865 »

dquille wrote:mduell, could you pm me that download link as well? I'm wondering if this fix will fix the audio sync issues I found with ac3 (and recently I found they are happening in aac as well) I brought up in this post: http://forum.handbrake.fr/viewtopic.php?f=11&t=13572.
It won't. It's neither the same issue (obvious from the absence of crc errors in your logs) nor the same type of source.
larsonian
Posts: 6
Joined: Fri Jun 01, 2007 10:25 pm

Re: Silence added to middle of music videos for sync?

Post by larsonian »

Would it be possible to PM me the link to this version of handbrake that fixes the "silence" in ac3 ts streams? I'm having a similar issue. Thanks!

Code: Select all

11:14:01] encx264: Encoding at constant RF 20.750000
x264 [info]: using cpu capabilities: MMX2 Cache64
[11:14:01] mpeg2: "" (1) at frame 0 time 6006
x264 [info]: profile High, level 3.1
No accelerated IMDCT transform found
No accelerated IMDCT transform found
[11:14:01] sync: expecting 74996 video frames
[ac3 @ 0x1f3bc00]No channel layout specified. The encoder will guess the layout, but it might be incorrect.
[11:14:01] sync: adding 78 ms of silence to audio 0  start 7093, next 0
[11:14:01] sync: adding 78 ms of silence to audio 1  start 7093, next 0
[11:14:01] sync: first pts is 6006
[12:04:48] output track 1: ac3 in sync after skipping 16 bytes
[12:04:48] output track 0: ac3 in sync after skipping 16 bytes
[12:05:08] 694.585754s: Video -> Film
[12:27:16] output track 1: ac3 in sync after skipping 16 bytes
[12:27:16] output track 0: ac3 in sync after skipping 16 bytes
[12:27:46] 992.683533s: Film -> Video
[12:52:53] sync: audio 0 time went backwards 0 ms, dropped 1 frames (next 118928250, current 118928250)
[12:52:53] sync: audio 1 time went backwards 0 ms, dropped 1 frames (next 118928250, current 118928250)
[12:59:14] 1403.227051s: Video -> Film
[12:59:43] sync: video time didn't advance - dropped 274 frames (delta 9124 ms, current 126608751, next 126610356, dur 1605)
[13:26:21] output track 0: ac3 in sync after skipping 16 bytes
[13:26:21] output track 1: ac3 in sync after skipping 16 bytes
[13:26:49] 1736.608887s: Film -> Video
[13:50:41] output track 0: ac3 in sync after skipping 16 bytes
[13:50:41] output track 1: ac3 in sync after skipping 16 bytes
Deleted User 11865

Re: Silence added to middle of music videos for sync?

Post by Deleted User 11865 »

The latest snapshot is newer than 3090 and includes the fix: http://forum.handbrake.fr/viewtopic.php?f=6&t=15452
larsonian
Posts: 6
Joined: Fri Jun 01, 2007 10:25 pm

Re: Silence added to middle of music videos for sync?

Post by larsonian »

Thank you for the link
Post Reply