Handbrake desyncs audio with video

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
InSayne
Posts: 1
Joined: Fri Apr 21, 2017 5:31 pm

Handbrake desyncs audio with video

Post by InSayne »

Please detail your question or problem in as much detail as possible:
I use Dxtory to record videos, and convert them witrh handbrake because I don't remember why, but using the raw video (recorded with the lagarith lossless codec) didn't work really well in premiere pro. It worked perfectly before I reset my computer and reinstalled everything. Now this time, I get 1 problems, but the most is the sound desync. What I get is , the converted video works perfectly, but 2 seconds after the beginning of the video i can hear that the sound "rewinds" to the beginning and thus creates a 2 second desync.
I also get sometimes some weird video effects at the beginning, where the image is like decolored and stuff like that, but that's not important for now and I think it's due to the size of my files.
By the way, my files are very heavy (5 seconds weigh 500 Mo)
Oh, and the encoding usually stops half way (40-50%) and immediately says "queue finished", i guess the problem comes from here
Tell us about your environment. What version of HandBrake? What version of Windows are you running. etc.
Handbrake version 1.0.7 - 64 bit, windows 8.1 64 bit, all the folders including the videos, the program and the destination folders are on the same SSD.
Yes I did try nightly things. Yes I did reinstall. Yes I rebooted my computer. Yes I tried with an other codec, but the only one that really works is the Lagarith and it's the only one that causes problem. Yes I tried using other drives as source/destination.
If there was any exception or error displayed, please copy it and paste it here:

Please include the scan or encode log:

Code: Select all

 HandBrake 1.0.7 (2017040900) - 64bit
OS: Microsoft Windows NT 6.3.9600.0 - 64bit
CPU: Intel(R) Core(TM) i7-5820K CPU @ 3.30GHz
Ram: 16279 MB, 
GPU Information:
  AMD Radeon R9 200 Series - 22.19.156.1
Screen: 1920x1080
Temp Dir: C:\Users\Alexis\AppData\Local\Temp\
Install Dir: C:\Program Files\HandBrake
Data Dir: C:\Users\Alexis\AppData\Roaming\HandBrake Team\HandBrake\1.0.7.0

-------------------------------------------


# Starting Encode ...

[19:29:07] hb_init: starting libhb thread
[19:29:07] 1 job(s) to process
[19:29:07] json job:
{
  "Audio": {
    "AudioList": [
      {
        "Bitrate": 160,
        "DRC": 0.0,
        "Encoder": 65536,
        "Gain": 0.0,
        "Mixdown": 4,
        "NormalizeMixLevel": false,
        "Samplerate": 0,
        "Track": 0,
        "DitherMethod": 0
      }
    ],
    "CopyMask": [
      1073807360,
      1073743872,
      1074003968,
      1073750016,
      1090519040,
      1074790400,
      1074266112,
      1107296256
    ],
    "FallbackEncoder": 2048
  },
  "Destination": {
    "ChapterList": [
      {
        "Name": "Chapter 1"
      }
    ],
    "ChapterMarkers": true,
    "File": "C:\\VIDEOS\\CONVERTI\\League Of Legends 2017-04-21 19-24-26-532-1.m4v",
    "Mp4Options": {
      "IpodAtom": false,
      "Mp4Optimize": false
    },
    "Mux": 131072
  },
  "Filters": {
    "FilterList": [
      {
        "ID": 4,
        "Settings": {
          "mode": "7"
        }
      },
      {
        "ID": 3,
        "Settings": {
          "block-height": "16",
          "block-thresh": "40",
          "block-width": "16",
          "filter-mode": "2",
          "mode": "3",
          "motion-thresh": "1",
          "spatial-metric": "2",
          "spatial-thresh": "1"
        }
      },
      {
        "ID": 11,
        "Settings": {
          "crop-bottom": "0",
          "crop-left": "0",
          "crop-right": "0",
          "crop-top": "0",
          "height": "1080",
          "width": "1920"
        }
      },
      {
        "ID": 6,
        "Settings": {
          "mode": "1",
          "rate": "27000000/450000"
        }
      }
    ]
  },
  "PAR": {
    "Num": 1,
    "Den": 1
  },
  "Metadata": {},
  "SequenceID": 0,
  "Source": {
    "Angle": 1,
    "Range": {
      "Type": "chapter",
      "Start": 1,
      "End": 1
    },
    "Title": 1,
    "Path": "C:\\VIDEOS\\League of Legends 2017-04-21 19-24-26-532.avi"
  },
  "Subtitle": {
    "Search": {
      "Burn": true,
      "Default": false,
      "Enable": true,
      "Forced": true
    },
    "SubtitleList": []
  },
  "Video": {
    "Encoder": 65536,
    "Level": "4.0",
    "TwoPass": false,
    "Turbo": false,
    "ColorMatrixCode": 0,
    "Options": "",
    "Preset": "fast",
    "Profile": "main",
    "Quality": 0.0,
    "OpenCL": false,
    "HWDecode": false,
    "QSV": {
      "Decode": false,
      "AsyncDepth": 0
    }
  }
}
[19:29:07] CPU: Intel(R) Core(TM) i7-5820K CPU @ 3.30GHz
[19:29:07]  - Intel microarchitecture Haswell
[19:29:07]  - logical processor count: 12
[19:29:07] Intel Quick Sync Video support: no
[19:29:07] hb_scan: path=C:\VIDEOS\League of Legends 2017-04-21 19-24-26-532.avi, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
src/libbluray/disc/disc.c:274: failed opening UDF image C:\VIDEOS\League of Legends 2017-04-21 19-24-26-532.avi
src/libbluray/disc/disc.c:352: error opening file BDMV\index.bdmv
src/libbluray/disc/disc.c:352: error opening file BDMV\BACKUP\index.bdmv
[19:29:07] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 5.0.1
libdvdread: Encrypted DVD support unavailable.
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed
libdvdread: Can't open file VIDEO_TS.IFO.
libdvdnav: vm: failed to read VIDEO_TS.IFO
[19:29:07] dvd: not a dvd - trying as a stream/file instead
[avi @ 0000001d21b4a080] Broken AVI index.
Input #0, avi, from 'C:\VIDEOS\League of Legends 2017-04-21 19-24-26-532.avi':
  Metadata:
    encoder         : DxtoryCore ver2.0.0.142
    ISRC            : Video:Lagarith Lossless Codec Audio:Haut-parleurs (Corsair Vengeance 1500)
  Duration: 00:00:33.73, start: 0.000000, bitrate: 396171 kb/s
    Stream #0:0: Video: lagarith [LAGS / 0x5347414C]
      rgb24, 1920x1080
      36.92 fps, 60 tbn
    Stream #0:1: Audio: mp3 [U[0][0][0] / 0x0055]
      48000 Hz, 2 channels, s16p, 192 kb/s
[19:29:07] scan: decoding previews for title 1
[avi @ 0000001d21b4ab20] Broken AVI index.
[19:29:07] scan: audio 0x1: mp3, rate=48000Hz, bitrate=192000 Unknown (MP3) (2.0 ch)
[19:29:09] scan: 10 previews, 1920x1080, 60.000 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[19:29:10] libhb: scan thread found 1 valid title(s)
[19:29:10] Skipping subtitle scan.  No suitable subtitle tracks.
[19:29:10] starting job
[19:29:10] decomb filter thread started for segment 0
[19:29:10] decomb filter thread started for segment 1
[19:29:10] decomb filter thread started for segment 2
[19:29:10] decomb check thread started for segment 0
[19:29:10] decomb filter thread started for segment 4
[19:29:10] decomb filter thread started for segment 5
[19:29:10] decomb check thread started for segment 9
[19:29:10] decomb filter thread started for segment 7
[19:29:10] decomb filter thread started for segment 8
[19:29:10] decomb filter thread started for segment 9
[19:29:10] decomb filter thread started for segment 10
[19:29:10] decomb filter thread started for segment 11
[19:29:10] mask erode thread started for segment 2
[19:29:10] decomb check thread started for segment 1
[19:29:10] decomb check thread started for segment 2
[19:29:10] mask erode thread started for segment 10
[19:29:10] decomb check thread started for segment 4
[19:29:10] mask dilate thread started for segment 2
[19:29:10] decomb check thread started for segment 6
[19:29:10] decomb check thread started for segment 7
[19:29:10] decomb check thread started for segment 8
[19:29:10] decomb filter thread started for segment 6
[19:29:10] decomb check thread started for segment 10
[19:29:10] decomb check thread started for segment 11
[19:29:10] mask filter thread started for segment 0
[19:29:10] mask filter thread started for segment 1
[19:29:10] mask filter thread started for segment 2
[19:29:10] mask filter thread started for segment 3
[19:29:10] mask filter thread started for segment 4
[19:29:10] mask filter thread started for segment 5
[19:29:10] mask filter thread started for segment 6
[19:29:10] mask filter thread started for segment 7
[19:29:10] mask filter thread started for segment 8
[19:29:10] mask filter thread started for segment 9
[19:29:10] mask filter thread started for segment 10
[19:29:10] work: track 1, dithering not supported by codec
[19:29:10] mask filter thread started for segment 11
[19:29:10] mask erode thread started for segment 0
[19:29:10] work: only 1 chapter, disabling chapter markers
[19:29:10] job configuration:
[19:29:10]  * source
[19:29:10]    + C:\VIDEOS\League of Legends 2017-04-21 19-24-26-532.avi
[19:29:10]    + title 1, chapter(s) 1 to 1
[19:29:10]    + container: avi
[19:29:10]    + data rate: 396171 kbps
[19:29:10] mask erode thread started for segment 1
[19:29:10]  * destination
[19:29:10]    + C:\VIDEOS\CONVERTI\League Of Legends 2017-04-21 19-24-26-532-1.m4v
[19:29:10]    + container: MPEG-4 (libavformat)
[19:29:10]  * video track
[19:29:10]    + decoder: lagarith
[19:29:10]    + filters
[19:29:10] decomb filter thread started for segment 3
[19:29:10]      + Comb Detect (mode=3:spatial-metric=2:motion-thresh=1:spatial-thresh=1:filter-mode=2:block-thresh=40:block-width=16:block-height=16)
[19:29:10]      + Decomb (mode=39)
[19:29:10] mask erode thread started for segment 3
[19:29:10]      + Framerate Shaper (mode=1:rate=27000000/450000)
[19:29:10]        + frame rate: 60.000 fps -> constant 60.000 fps
[19:29:10]      + Crop and Scale (width=1920:height=1080:crop-top=0:crop-bottom=0:crop-left=0:crop-right=0)
[19:29:10]        + source: 1920 * 1080, crop (0/0/0/0): 1920 * 1080, scale: 1920 * 1080
[19:29:10]    + Output geometry
[19:29:10]      + storage dimensions: 1920 x 1080
[19:29:10] mask erode thread started for segment 4
[19:29:10]      + pixel aspect ratio: 1 : 1
[19:29:10]      + display dimensions: 1920 x 1080
[19:29:10]    + encoder: H.264 (libx264)
[19:29:10]      + preset:  fast
[19:29:10]      + profile: main
[19:29:10]      + level:   4.0
[19:29:10] mask erode thread started for segment 5
[19:29:10]      + quality: 0.00 (RF)
[19:29:10]  * audio track 1
[19:29:10]    + decoder: Unknown (MP3) (2.0 ch) (track 1, id 0x1)
[19:29:10]      + bitrate: 192 kbps, samplerate: 48000 Hz
[19:29:10]    + mixdown: Stereo
[19:29:10]    + encoder: AAC (libavcodec)
[19:29:10]      + bitrate: 160 kbps, samplerate: 48000 Hz
[19:29:10] mask erode thread started for segment 6
[19:29:10] mask erode thread started for segment 7
[19:29:10] mask erode thread started for segment 8
[19:29:10] mask erode thread started for segment 9
[19:29:10] decomb check thread started for segment 3
[19:29:10] mask erode thread started for segment 11
[19:29:10] mask dilate thread started for segment 0
[19:29:10] mask dilate thread started for segment 1
[19:29:10] decomb check thread started for segment 5
[19:29:10] mask dilate thread started for segment 3
[19:29:10] mask dilate thread started for segment 4
[19:29:10] mask dilate thread started for segment 5
[19:29:10] mask dilate thread started for segment 6
[19:29:10] mask dilate thread started for segment 7
[19:29:10] mask dilate thread started for segment 8
[19:29:10] mask dilate thread started for segment 9
[19:29:10] mask dilate thread started for segment 10
[19:29:10] mask dilate thread started for segment 11
[19:29:10] yadif thread started for segment 0
[19:29:10] yadif thread started for segment 1
[19:29:10] yadif thread started for segment 2
[19:29:10] yadif thread started for segment 3
[19:29:10] yadif thread started for segment 4
[19:29:10] yadif thread started for segment 5
[19:29:10] yadif thread started for segment 6
[19:29:10] yadif thread started for segment 7
[19:29:10] yadif thread started for segment 8
[19:29:10] yadif thread started for segment 9
[19:29:10] yadif thread started for segment 10
[19:29:10] yadif thread started for segment 11
[avi @ 0000001d21b495e0] Broken AVI index.
[19:29:10] sync: expecting 2023 video frames
[19:29:10] encx264: min-keyint: 60, keyint: 600
[19:29:10] encx264: encoding at constant RF 0.000000
[19:29:10] apply_h264_profile [warning]: lossless requires high444 profile, disabling
[19:29:10] apply_h264_level [warning]: framerate (60.000) too high for level 4.0 at 1920x1080 (max. 30.118)
[19:29:10] encx264: unparsed options: vbv-bufsize=25000:level=4.0:8x8dct=0:ref=2:weightp=1:vbv-maxrate=20000:subme=6:rc-lookahead=30
x264 [info]: using SAR=1/1
x264 [warning]: MB rate (489600) > level limit (245760)
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
x264 [info]: profile Main, level 4.0
[19:29:10] sync: first pts video is 0
[19:29:10] sync: "Chapter 1" (1) at frame 1 time 0
[19:29:10] sync: first pts audio 0x1 is 0
[19:29:53] reader: done. 1 scr changes
[19:29:56] work: average encoding speed for job is 23.511154 fps
[19:29:56] comb detect: heavy 54 | light 355 | uncombed 660 | total 1069
[19:29:56] decomb: deinterlaced 54 | blended 355 | unfiltered 660 | total 1069
[19:29:56] vfr: 2024 frames output, 0 dropped and 955 duped for CFR/PFR
[19:29:56] vfr: lost time: 0 (0 frames)
[19:29:56] vfr: gained time: 0 (0 frames) (0 not accounted for)
[19:29:56] mp3-decoder done: 1449 frames, 0 decoder errors
[19:29:56] lagarith-decoder done: 1069 frames, 0 decoder errors
[19:29:56] sync: got 1069 frames, 2023 expected
[19:29:56] sync: framerate min 20.000 fps, max 60.000 fps, avg 31.690 fps
x264 [info]: frame I:18    Avg QP:14.78  size:221682
x264 [info]: frame P:581   Avg QP:15.78  size: 91171
x264 [info]: frame B:1425  Avg QP:17.06  size: 14225
x264 [info]: consecutive B-frames:  1.6% 11.5%  6.5% 80.4%
x264 [info]: mb I  I16..4: 22.1%  0.0% 77.9%
x264 [info]: mb P  I16..4:  8.9%  0.0% 21.5%  P16..4: 24.4% 14.0%  8.2%  0.0%  0.0%    skip:22.9%
x264 [info]: mb B  I16..4:  1.9%  0.0%  1.8%  B16..8: 10.7%  5.0%  0.8%  direct: 6.9%  skip:72.9%  L0:41.9% L1:49.9% BI: 8.2%
x264 [info]: coded y,uvDC,uvAC intra: 59.5% 88.3% 63.4% inter: 8.8% 17.7% 4.3%
x264 [info]: i16 v,h,dc,p: 27% 24% 15% 35%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 23% 16%  7%  7%  6%  7%  5%  5%
x264 [info]: i8c dc,h,v,p: 45% 23% 17% 14%
x264 [info]: Weighted P-Frames: Y:0.3% UV:0.2%
x264 [info]: ref P L0: 83.1% 16.9%
x264 [info]: ref B L0: 85.5% 14.5%
x264 [info]: ref B L1: 99.4%  0.6%
x264 [info]: kb/s:18315.80
[19:29:56] mux: track 0, 2024 frames, 77230984 bytes, 17754.25 kbps, fifo 512
[19:29:56] mux: track 1, 1632 frames, 699762 bytes, 160.86 kbps, fifo 512
[19:29:57] libhb: work result = 0

# Encode Completed ...
User avatar
BradleyS
Moderator
Posts: 1860
Joined: Thu Aug 09, 2007 12:16 pm

Re: Handbrake desyncs audio with video

Post by BradleyS »

Code: Select all

[avi @ 0000001d21b4a080] Broken AVI index.
I notice this in the log a couple times.

Also, hopefully you are aware that encoding at RF 0 is not recommended; it's x264's lossless mode. Generally we don't recommend exceeding RF 15 except in special circumstances.

Can you provide a small sample that reproduces the problem for us to test?
Deleted User 13735

Re: Handbrake desyncs audio with video

Post by Deleted User 13735 »


[19:29:56] sync: got 1069 frames, 2023 expected
It looks like audio bits are being misreported.
Try something other than Lagarith in Dxtory, and also try OBS.
Post Reply