Black screen at beginning stripped -> out of sync audio?

General questions or discussion about HandBrake, Video and/or audio transcoding, trends etc.
Post Reply
BlackWolf
Posts: 14
Joined: Fri Jan 09, 2009 10:06 pm

Black screen at beginning stripped -> out of sync audio?

Post by BlackWolf »

hi,
I'm having a really strange issue with handbrake currently. I tried to convert an .avi file (xvid, ac3). It works, but when watching the created file (.mp4, h264, ac3) I noticed that the audio was out of sync with the video. I looked at the source and the created video and noticed, that the source video has like 2 seconds of just black at the very beginning. the video handbrake created does not have that black screen - and that's what causes the audio to be out of sync, because the audio handbrake creates HAS that 2 second "nothing" at the beginning.

Now for the strange thing: I tried to simply delete the black screens at the beginning of the source file with virtualdub. The length of the video vdub created was 2 seconds shorter than the original video, but I couldn't notice any difference in the video stream. the audio began 2 seconds later (so without 2 seconds of nothing at the beginning), but the video was still the same. 2 seconds black, then it started - and that even though I cut out the black screens in vdub! it doesn't matter how often I repeat that operation. the audio gets shortened by 2 seconds, and even though I cut out the blackness in the video when I watch the video there it is.

any ideas on how to solve this? could this be a broken header or something special with the avi file? is there maybe any option in handbrake to deal with this kind of video?

thanks!

PS: I will give you a activity log, but unfortunatly I had another video in my queue so it deleted the log - will post it asap.
edit:

Code: Select all

### Windows GUI 0.9.3 2008112300 
### Running: Microsoft Windows NT 6.1.7000.0 
###
### CPU: Intel(R) Core(TM)2 Duo CPU     E8500  @ 3.16GHz 
### Ram: 4093 MB 
### Screen: 1680x1050 
### Temp Dir: C:\Users\BlackWolf\AppData\Local\Temp\ 
### Install Dir: C:\Program Files (x86)\HandBrake 
### Data Dir: C:\Users\BlackWolf\AppData\Roaming\HandBrake\HandBrake\0.9.3.0 
#########################################

### CLI Query:  -i "C:\Users\BlackWolf\Videos\test.avi" -t 1 -c 1 -o "C:\Users\BlackWolf\Videos\bwabb.mp4" -f mp4 --decomb  -P  --detelecine -e x264 -q 0.6 -a 1 -E ac3 -B 192 -R 48 -6 6ch -D 1 -A English -x level=30:ref=3:mixed-refs=1:bframes=6:weightb=1:direct=auto:no-fast-pskip=1:me=umh:subq=9:analyse=all:deblock=0,0:b-pyramid=1 -v 
#########################################
[17:37:57] hb_init: checking cpu count
[17:37:57] hb_init: starting libhb thread
HandBrake 0.9.3 (2008112300) - http://handbrake.fr/
2 CPUs detected
Opening C:\Users\BlackWolf\Videos\test.avi...
[17:37:57] hb_scan: path=C:\Users\BlackWolf\Videos\test.avi, title_index=1
[17:37:57] scan: trying to open with libdvdread
[17:37:57] dvd: not a dvd - trying as a stream/file instead
Input #0, avi, from 'C:\Users\BlackWolf\Videos\test.avi':
  Duration: 01:28:50.36, start: 0.000000, bitrate: 2199 kb/s
    Stream #0.0: Video: mpeg4, yuv420p, 720x392 [PAR 1:1 DAR 90:49], 23.98 tb(r)
    Stream #0.1: Audio: ac3, 48000 Hz, 5:1, s16, 448 kb/s
[17:37:58] scan: decoding previews for title 1
[17:37:58] scan: audio 0x1: AC-3, rate=48000Hz, bitrate=448000 Unknown (AC3) (5.1 ch)
[17:37:58] scan: 10 previews, 720x392, 23.976 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[17:37:58] scan: title (0) job->width:720, job->height:384
[17:37:58] libhb: scan thread found 1 valid title(s)
+ title 1:
  + vts 0, ttn 0, cells 0->0 (0 blocks)
  + duration: 01:28:50
  + size: 720x392, aspect: 1.84, 23.976 fps
  + autocrop: 0/0/0/0
  + chapters:
    + 1: cells 0->0, 0 blocks, duration 01:28:50
  + audio tracks:
    + 1, Unknown (AC3) (5.1 ch), 48000Hz, 448000bps
  + subtitle tracks:
[17:37:58] 1 job(s) to process
[17:37:58] starting job
[17:37:58] job configuration:
[17:37:58]  * source
[17:37:58]    + C:\Users\BlackWolf\Videos\test.avi
[17:37:58]    + title 1, chapter(s) 1 to 1
[17:37:58]    + container: avi
[17:37:58]    + data rate: 2199 kbps
[17:37:58]  * destination
[17:37:58]    + C:\Users\BlackWolf\Videos\bwabb.mp4
[17:37:58]    + container: MPEG-4 (.mp4 and .m4v)
[17:37:58]  * video track
[17:37:58]    + decoder: mpeg4
[17:37:58]    + frame rate: 23.976 fps -> variable fps
[17:37:58]    + loose anamorphic
[17:37:58]      + storage dimensions: 720 * 392 -> 720 * 384, crop 0/0/0/0
[17:37:58]      + pixel aspect ratio: 47 / 48
[17:37:58]      + display dimensions: 705 * 384
[17:37:58]    + filters
[17:37:58]      + Detelecine (pullup) (default settings)
[17:37:58]      + Deinterlaces selectively with yadif/mcdeint and lowpass5 blending (default settings)
[17:37:58]    + encoder: x264
[17:37:58]      + options: level=30:ref=3:mixed-refs=1:bframes=6:weightb=1:direct=auto:no-fast-pskip=1:me=umh:subq=9:analyse=all:deblock=0,0:b-pyramid=1
[17:37:58]      + quality: 0.60
[17:37:58]  * audio track 0
[17:37:58]    + name: English
[17:37:58]    + decoder: Unknown (AC3) (5.1 ch) (track 1, id 1)
[17:37:58]      + bitrate: 448 kbps, samplerate: 48000 Hz
[17:37:58]    + AC3 passthrough
[17:37:58] dvd: not a dvd - trying as a stream/file instead
[17:37:58] yadif thread started for segment 0
[17:37:58] yadif thread started for segment 1
[17:37:58] decomb thread started for segment 1
[17:37:58] decomb thread started for segment 0
[17:37:58] reader: first SCR 0
[17:37:58] encx264: keyint-min: 24, keyint-max: 240
[17:37:58] encx264: encoding with stored aspect 47/48
[17:37:58] encx264: Encoding at constant RF 20.399999
x264 [info]: using SAR=47/48
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 PHADD SSE4.1 Cache64
x264 [info]: profile Main, level 3.0
No accelerated IMDCT transform found
[17:37:58] sync: expecting 127824 video frames
[17:37:58] sync: adding 79 ms of silence to audio 0  start 7110, next 0
[18:41:04] reader: done. 1 scr changes
[18:41:12] sync: got 127511 frames, 127824 expected
[18:41:12] work: average encoding speed for job is 33.607449 fps
[18:41:13] mpeg4-decoder done: 127512 frames, 0 decoder errors, 0 drops
[18:41:13] render: lost time: 653146 (174 frames)
[18:41:13] render: gained time: 653146 (678 frames) (0 not accounted for)
[18:41:13] render: average dropped frame duration: 3753
x264 [info]: slice I:1338  Avg QP:16.37  size: 34508  PSNR Mean Y:47.50 U:50.94 V:50.99 Avg:48.11 Global:46.69
x264 [info]: slice P:39964 Avg QP:18.71  size:  6982  PSNR Mean Y:43.46 U:46.66 V:46.61 Avg:44.11 Global:43.21
x264 [info]: slice B:86082 Avg QP:18.64  size:  1140  PSNR Mean Y:44.25 U:47.24 V:47.24 Avg:44.84 Global:43.85
x264 [info]: consecutive B-frames:  9.8% 11.9%  8.5% 13.3% 18.6% 27.1% 10.9%
x264 [info]: mb I  I16..4: 35.1%  0.0% 64.9%
x264 [info]: mb P  I16..4:  2.9%  0.0%  2.9%  P16..4: 40.9% 10.5%  9.5%  0.8%  0.8%    skip:31.6%
x264 [info]: mb B  I16..4:  0.1%  0.0%  0.2%  B16..8: 19.3%  0.8%  1.3%  direct: 1.8%  skip:76.6%  L0:36.9% L1:59.2% BI: 3.9%
x264 [info]: direct mvs  spatial:99.9%  temporal:0.1%
x264 [info]: ref P L0  72.9% 15.7% 11.4%
x264 [info]: ref B L0  87.2% 12.8%
x264 [info]: ref B L1  91.1%  8.9%
x264 [info]: SSIM Mean Y:0.9885537
x264 [info]: PSNR Mean Y:44.036 U:47.097 V:47.083 Avg:44.643 Global:43.661 kb/s:637.37
[18:41:13] decomb: yadif deinterlaced 76 | blend deinterlaced 1898 | unfiltered 125362 | total 127336
[18:41:13] libhb: work result = 0
Rip done!

 ############ End of Log ############## 
oh and btw since I already got a thread opened: is there any way to give an audio stream with "unknown" language a name? I tried -A "English" but vlc still doesn't show a name for the stream. when I encode a dvd handbrake automatically adds the name.
refulgentis
Bright Spark User
Posts: 342
Joined: Mon Apr 14, 2008 5:08 am

Re: Black screen at beginning stripped -> out of sync audio?

Post by refulgentis »

BlackWolf wrote:hi,
I'm having a really strange issue with handbrake currently. I tried to convert an .avi file (xvid, ac3). It works, but when watching the created file (.mp4, h264, ac3) I noticed that the audio was out of sync with the video. I looked at the source and the created video and noticed, that the source video has like 2 seconds of just black at the very beginning. the video handbrake created does not have that black screen - and that's what causes the audio to be out of sync, because the audio handbrake creates HAS that 2 second "nothing" at the beginning.

Now for the strange thing: I tried to simply delete the black screens at the beginning of the source file with virtualdub. The length of the video vdub created was 2 seconds shorter than the original video, but I couldn't notice any difference in the video stream. the audio began 2 seconds later (so without 2 seconds of nothing at the beginning), but the video was still the same. 2 seconds black, then it started - and that even though I cut out the black screens in vdub! it doesn't matter how often I repeat that operation. the audio gets shortened by 2 seconds, and even though I cut out the blackness in the video when I watch the video there it is.

any ideas on how to solve this? could this be a broken header or something special with the avi file? is there maybe any option in handbrake to deal with this kind of video?

thanks!

PS: I will give you a activity log, but unfortunatly I had another video in my queue so it deleted the log - will post it asap.
edit:

Code: Select all

### Windows GUI 0.9.3 2008112300 
### Running: Microsoft Windows NT 6.1.7000.0 
###
### CPU: Intel(R) Core(TM)2 Duo CPU     E8500  @ 3.16GHz 
### Ram: 4093 MB 
### Screen: 1680x1050 
### Temp Dir: C:\Users\BlackWolf\AppData\Local\Temp\ 
### Install Dir: C:\Program Files (x86)\HandBrake 
### Data Dir: C:\Users\BlackWolf\AppData\Roaming\HandBrake\HandBrake\0.9.3.0 
#########################################

### CLI Query:  -i "C:\Users\BlackWolf\Videos\test.avi" -t 1 -c 1 -o "C:\Users\BlackWolf\Videos\bwabb.mp4" -f mp4 --decomb  -P  --detelecine -e x264 -q 0.6 -a 1 -E ac3 -B 192 -R 48 -6 6ch -D 1 -A English -x level=30:ref=3:mixed-refs=1:bframes=6:weightb=1:direct=auto:no-fast-pskip=1:me=umh:subq=9:analyse=all:deblock=0,0:b-pyramid=1 -v 
#########################################
[17:37:57] hb_init: checking cpu count
[17:37:57] hb_init: starting libhb thread
HandBrake 0.9.3 (2008112300) - http://handbrake.fr/
2 CPUs detected
Opening C:\Users\BlackWolf\Videos\test.avi...
[17:37:57] hb_scan: path=C:\Users\BlackWolf\Videos\test.avi, title_index=1
[17:37:57] scan: trying to open with libdvdread
[17:37:57] dvd: not a dvd - trying as a stream/file instead
Input #0, avi, from 'C:\Users\BlackWolf\Videos\test.avi':
  Duration: 01:28:50.36, start: 0.000000, bitrate: 2199 kb/s
    Stream #0.0: Video: mpeg4, yuv420p, 720x392 [PAR 1:1 DAR 90:49], 23.98 tb(r)
    Stream #0.1: Audio: ac3, 48000 Hz, 5:1, s16, 448 kb/s
[17:37:58] scan: decoding previews for title 1
[17:37:58] scan: audio 0x1: AC-3, rate=48000Hz, bitrate=448000 Unknown (AC3) (5.1 ch)
[17:37:58] scan: 10 previews, 720x392, 23.976 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[17:37:58] scan: title (0) job->width:720, job->height:384
[17:37:58] libhb: scan thread found 1 valid title(s)
+ title 1:
  + vts 0, ttn 0, cells 0->0 (0 blocks)
  + duration: 01:28:50
  + size: 720x392, aspect: 1.84, 23.976 fps
  + autocrop: 0/0/0/0
  + chapters:
    + 1: cells 0->0, 0 blocks, duration 01:28:50
  + audio tracks:
    + 1, Unknown (AC3) (5.1 ch), 48000Hz, 448000bps
  + subtitle tracks:
[17:37:58] 1 job(s) to process
[17:37:58] starting job
[17:37:58] job configuration:
[17:37:58]  * source
[17:37:58]    + C:\Users\BlackWolf\Videos\test.avi
[17:37:58]    + title 1, chapter(s) 1 to 1
[17:37:58]    + container: avi
[17:37:58]    + data rate: 2199 kbps
[17:37:58]  * destination
[17:37:58]    + C:\Users\BlackWolf\Videos\bwabb.mp4
[17:37:58]    + container: MPEG-4 (.mp4 and .m4v)
[17:37:58]  * video track
[17:37:58]    + decoder: mpeg4
[17:37:58]    + frame rate: 23.976 fps -> variable fps
[17:37:58]    + loose anamorphic
[17:37:58]      + storage dimensions: 720 * 392 -> 720 * 384, crop 0/0/0/0
[17:37:58]      + pixel aspect ratio: 47 / 48
[17:37:58]      + display dimensions: 705 * 384
[17:37:58]    + filters
[17:37:58]      + Detelecine (pullup) (default settings)
[17:37:58]      + Deinterlaces selectively with yadif/mcdeint and lowpass5 blending (default settings)
[17:37:58]    + encoder: x264
[17:37:58]      + options: level=30:ref=3:mixed-refs=1:bframes=6:weightb=1:direct=auto:no-fast-pskip=1:me=umh:subq=9:analyse=all:deblock=0,0:b-pyramid=1
[17:37:58]      + quality: 0.60
[17:37:58]  * audio track 0
[17:37:58]    + name: English
[17:37:58]    + decoder: Unknown (AC3) (5.1 ch) (track 1, id 1)
[17:37:58]      + bitrate: 448 kbps, samplerate: 48000 Hz
[17:37:58]    + AC3 passthrough
[17:37:58] dvd: not a dvd - trying as a stream/file instead
[17:37:58] yadif thread started for segment 0
[17:37:58] yadif thread started for segment 1
[17:37:58] decomb thread started for segment 1
[17:37:58] decomb thread started for segment 0
[17:37:58] reader: first SCR 0
[17:37:58] encx264: keyint-min: 24, keyint-max: 240
[17:37:58] encx264: encoding with stored aspect 47/48
[17:37:58] encx264: Encoding at constant RF 20.399999
x264 [info]: using SAR=47/48
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 PHADD SSE4.1 Cache64
x264 [info]: profile Main, level 3.0
No accelerated IMDCT transform found
[17:37:58] sync: expecting 127824 video frames
[17:37:58] sync: adding 79 ms of silence to audio 0  start 7110, next 0
[18:41:04] reader: done. 1 scr changes
[18:41:12] sync: got 127511 frames, 127824 expected
[18:41:12] work: average encoding speed for job is 33.607449 fps
[18:41:13] mpeg4-decoder done: 127512 frames, 0 decoder errors, 0 drops
[18:41:13] render: lost time: 653146 (174 frames)
[18:41:13] render: gained time: 653146 (678 frames) (0 not accounted for)
[18:41:13] render: average dropped frame duration: 3753
x264 [info]: slice I:1338  Avg QP:16.37  size: 34508  PSNR Mean Y:47.50 U:50.94 V:50.99 Avg:48.11 Global:46.69
x264 [info]: slice P:39964 Avg QP:18.71  size:  6982  PSNR Mean Y:43.46 U:46.66 V:46.61 Avg:44.11 Global:43.21
x264 [info]: slice B:86082 Avg QP:18.64  size:  1140  PSNR Mean Y:44.25 U:47.24 V:47.24 Avg:44.84 Global:43.85
x264 [info]: consecutive B-frames:  9.8% 11.9%  8.5% 13.3% 18.6% 27.1% 10.9%
x264 [info]: mb I  I16..4: 35.1%  0.0% 64.9%
x264 [info]: mb P  I16..4:  2.9%  0.0%  2.9%  P16..4: 40.9% 10.5%  9.5%  0.8%  0.8%    skip:31.6%
x264 [info]: mb B  I16..4:  0.1%  0.0%  0.2%  B16..8: 19.3%  0.8%  1.3%  direct: 1.8%  skip:76.6%  L0:36.9% L1:59.2% BI: 3.9%
x264 [info]: direct mvs  spatial:99.9%  temporal:0.1%
x264 [info]: ref P L0  72.9% 15.7% 11.4%
x264 [info]: ref B L0  87.2% 12.8%
x264 [info]: ref B L1  91.1%  8.9%
x264 [info]: SSIM Mean Y:0.9885537
x264 [info]: PSNR Mean Y:44.036 U:47.097 V:47.083 Avg:44.643 Global:43.661 kb/s:637.37
[18:41:13] decomb: yadif deinterlaced 76 | blend deinterlaced 1898 | unfiltered 125362 | total 127336
[18:41:13] libhb: work result = 0
Rip done!

 ############ End of Log ############## 
oh and btw since I already got a thread opened: is there any way to give an audio stream with "unknown" language a name? I tried -A "English" but vlc still doesn't show a name for the stream. when I encode a dvd handbrake automatically adds the name.
AVI is a big bag of hurt, who knows. Nothing jumps out from your log at all, are you sure its not your playback software? I would assume its that, especially since you're doing AC3 passthrough in an MP4 -- support for it is new in VLC. Try encoding the AC3 to AAC and doing AC3 pass through, and see what the AAC track sounds like. I don't know of a utility for windows that will change the track language, it is a simple atom change, but I don't know what utilities for windows can do that.
rhester
Veteran User
Posts: 2888
Joined: Tue Apr 18, 2006 10:24 pm

Re: Black screen at beginning stripped -> out of sync audio?

Post by rhester »

refulgentis wrote:I don't know of a utility for windows that will change the track language, it is a simple atom change, but I don't know what utilities for windows can do that.
The svn head of mp4track can do it.

Rodney
Post Reply