Audio desync with PCM source

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
Deleted User 13735

Audio desync with PCM source

Post by Deleted User 13735 »

Description of problem or question:

A recent round of tests indicates that audio from PCM sources may lead the video stream by >=42 to <=47 milliseconds in the encode. This desync is not apparent with compressed audio sources, including AAC and AC3.

Complete discussion at:
https://www.vegascreativesoftware.info/ ... s--111194/



Steps to reproduce the problem (If Applicable):

Encode a video stream with uncompressed audio to a complementary format in Handbrake.


HandBrake version (e.g., 1.0.0):

HandBrake 1.0.3 (2017022500) - 64bit
OS: Microsoft Windows NT 6.1.7601 Service Pack 1 - 64bit
CPU: Intel(R) Core(TM) i7-6850K CPU @ 3.60GHz
Ram: 16294 MB,
GPU Information:
Radeon (TM) RX 480 Graphics - 21.19.407.0
Screen: 1920x1080
Temp Dir: C:\Users\John\AppData\Local\Temp\
Install Dir: C:\Program Files\HandBrake


Operating system and version (e.g., Ubuntu 16.04 LTS, macOS 10.13 High Sierra, Windows 10 Creators Update):




HandBrake Activity Log ***required*** (see How-to get an activity log)

Code: Select all

HandBrake 1.0.3 (2017022500) - 64bit
OS: Microsoft Windows NT 6.1.7601 Service Pack 1 - 64bit
CPU: Intel(R) Core(TM) i7-6850K CPU @ 3.60GHz
Ram: 16294 MB, 
GPU Information:
  Radeon (TM) RX 480 Graphics - 21.19.407.0
Screen: 1920x1080
Temp Dir: C:\Users\John\AppData\Local\Temp\
Install Dir: C:\Program Files\HandBrake
Data Dir: C:\Users\John\AppData\Roaming\HandBrake Team\HandBrake\1.0.3.0

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


# Starting Encode ...

[14:35:10] hb_init: starting libhb thread
[14:35:10] 1 job(s) to process
[14:35:10] json job:
{
  "Audio": {
    "AudioList": [
      {
        "Bitrate": 320,
        "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": 65536
  },
  "Destination": {
    "ChapterList": [
      {
        "Name": "Chapter 1"
      }
    ],
    "ChapterMarkers": true,
    "File": "D:\\_Photos\\2018\\2018-04-21 Audio Sync\\Sony RX10-III\\C0003-1.mp4",
    "Mp4Options": {
      "IpodAtom": false,
      "Mp4Optimize": true
    },
    "Mux": 131072
  },
  "Filters": {
    "FilterList": [
      {
        "ID": 11,
        "Settings": {
          "crop-bottom": "0",
          "crop-left": "0",
          "crop-right": "0",
          "crop-top": "0",
          "height": "2160",
          "width": "3840"
        }
      },
      {
        "ID": 6,
        "Settings": {
          "mode": "1"
        }
      }
    ]
  },
  "PAR": {
    "Num": 1,
    "Den": 1
  },
  "Metadata": {},
  "SequenceID": 0,
  "Source": {
    "Angle": 1,
    "Range": {
      "Type": "chapter",
      "Start": 1,
      "End": 1
    },
    "Title": 1,
    "Path": "D:\\_Photos\\2018\\2018-04-21 Audio Sync\\Sony RX10-III\\C0003.MP4"
  },
  "Subtitle": {
    "Search": {
      "Burn": true,
      "Default": false,
      "Enable": true,
      "Forced": true
    },
    "SubtitleList": []
  },
  "Video": {
    "Encoder": 65536,
    "Level": "4.1",
    "TwoPass": false,
    "Turbo": false,
    "ColorMatrixCode": 0,
    "Options": "ref=5:bframes=5",
    "Preset": "slow",
    "Profile": "high",
    "Quality": 18.0,
    "OpenCL": false,
    "HWDecode": false,
    "QSV": {
      "Decode": false,
      "AsyncDepth": 0
    }
  }
}
[14:35:10] CPU: Intel(R) Core(TM) i7-6850K CPU @ 3.60GHz
[14:35:10]  - Intel microarchitecture Broadwell
[14:35:10]  - logical processor count: 12
[14:35:10] Intel Quick Sync Video support: no
[14:35:10] hb_scan: path=D:\_Photos\2018\2018-04-21 Audio Sync\Sony RX10-III\C0003.MP4, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
src/libbluray/disc/disc.c:274: failed opening UDF image D:\_Photos\2018\2018-04-21 Audio Sync\Sony RX10-III\C0003.MP4
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
[14:35:10] 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
[14:35:10] dvd: not a dvd - trying as a stream/file instead
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D:\_Photos\2018\2018-04-21 Audio Sync\Sony RX10-III\C0003.MP4':
  Metadata:
    major_brand     : XAVC
    minor_version   : 16785407
    compatible_brands: XAVCmp42iso2
    creation_time   : 2016-03-03 00:24:39
  Duration: 00:00:27.09, start: 0.000000, bitrate: 60222 kb/s
    Stream #0:0(und): Video: h264 (High) [avc1 / 0x31637661]
      yuv420p, tv, bt709/bt709/iec61966-2-4
      3840x2160 [PAR 1:1 DAR 16:9], 58586 kb/s
      29.97 fps, 30k tbn (default)
    Metadata:
      creation_time   : 2016-03-03 00:24:39
      handler_name    : Video Media Handler
      encoder         : AVC Coding
    Stream #0:1(und): Audio: pcm_s16be [twos / 0x736F7774]
      48000 Hz, 2 channels, s16, 1536 kb/s (default)
    Metadata:
      creation_time   : 2016-03-03 00:24:39
      handler_name    : Sound Media Handler
    Stream #0:2(und): Data: rtmd / 0x646D7472, 245 kb/s (default)
    Metadata:
      creation_time   : 2016-03-03 00:24:39
      handler_name    : Non-Real Time Metadata
[14:35:10] scan: decoding previews for title 1
[14:35:11] scan: audio 0x1: pcm_s16be, rate=48000Hz, bitrate=1536000 Unknown (pcm_s16be) (2.0 ch)
[14:35:12] scan: 10 previews, 3840x2160, 29.970 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[14:35:12] scan: supported video decoders: avcodec qsv
[14:35:12] libhb: scan thread found 1 valid title(s)
[14:35:13] Skipping subtitle scan.  No suitable subtitle tracks.
[14:35:13] starting job
[14:35:13] work: track 1, dithering not supported by codec
[14:35:13] work: only 1 chapter, disabling chapter markers
[14:35:13] job configuration:
[14:35:13]  * source
[14:35:13]    + D:\_Photos\2018\2018-04-21 Audio Sync\Sony RX10-III\C0003.MP4
[14:35:13]    + title 1, chapter(s) 1 to 1
[14:35:13]    + container: mov,mp4,m4a,3gp,3g2,mj2
[14:35:13]    + data rate: 60222 kbps
[14:35:13]  * destination
[14:35:13]    + D:\_Photos\2018\2018-04-21 Audio Sync\Sony RX10-III\C0003-1.mp4
[14:35:13]    + container: MPEG-4 (libavformat)
[14:35:13]      + optimized for HTTP streaming (fast start)
[14:35:13]  * video track
[14:35:13]    + decoder: h264
[14:35:13]      + bitrate 58586 kbps
[14:35:13]    + filters
[14:35:13]      + Framerate Shaper (mode=1)
[14:35:13]        + frame rate: 29.970 fps -> constant 29.970 fps
[14:35:13]      + Crop and Scale (width=3840:height=2160:crop-top=0:crop-bottom=0:crop-left=0:crop-right=0)
[14:35:13]        + source: 3840 * 2160, crop (0/0/0/0): 3840 * 2160, scale: 3840 * 2160
[14:35:13]    + Output geometry
[14:35:13]      + storage dimensions: 3840 x 2160
[14:35:13]      + pixel aspect ratio: 1 : 1
[14:35:13]      + display dimensions: 3840 x 2160
[14:35:13]    + encoder: H.264 (libx264)
[14:35:13]      + preset:  slow
[14:35:13]      + options: ref=5:bframes=5
[14:35:13]      + profile: high
[14:35:13]      + level:   4.1
[14:35:13]      + quality: 18.00 (RF)
[14:35:13]  * audio track 1
[14:35:13]    + decoder: Unknown (pcm_s16be) (2.0 ch) (track 1, id 0x1)
[14:35:13]      + bitrate: 1536 kbps, samplerate: 48000 Hz
[14:35:13]    + mixdown: Stereo
[14:35:13]    + encoder: AAC (libavcodec)
[14:35:13]      + bitrate: 320 kbps, samplerate: 48000 Hz
[14:35:13] sync: expecting 811 video frames
[14:35:13] encx264: min-keyint: 30, keyint: 300
[14:35:13] encx264: encoding at constant RF 18.000000
[14:35:13] apply_h264_level [warning]: frame size (3840x2160, 32400 macroblocks) too high for level 4.1 (max. 8192 macroblocks)
[14:35:13] encx264: unparsed options: ref=1:level=4.1:bframes=0:me=umh:vbv-maxrate=62500:subme=8:vbv-bufsize=78125:rc-lookahead=50
x264 [info]: using SAR=1/1
x264 [warning]: frame MB size (240x135) > level limit (8192)
x264 [warning]: MB rate (971028) > level limit (245760)
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
x264 [info]: profile High, level 4.1
[14:35:13] sync: first pts video is 0
[14:35:13] sync: first pts audio 0x1 is 0
[14:35:13] sync: "Chapter 1" (1) at frame 3 time 6006
[14:36:19] reader: done. 1 scr changes
[14:36:34] work: average encoding speed for job is 11.250915 fps
[14:36:34] vfr: 810 frames output, 0 dropped and 0 duped for CFR/PFR
[14:36:34] vfr: lost time: 0 (0 frames)
[14:36:34] vfr: gained time: 0 (0 frames) (0 not accounted for)
[14:36:34] pcm_s16be-decoder done: 1296 frames, 0 decoder errors
[14:36:34] h264-decoder done: 810 frames, 0 decoder errors
[14:36:34] sync: got 810 frames, 811 expected
[14:36:34] sync: framerate min 29.970 fps, max 29.970 fps, avg 29.970 fps
x264 [info]: frame I:208   Avg QP:18.24  size:446060
x264 [info]: frame P:602   Avg QP:19.96  size:202202
x264 [info]: mb I  I16..4: 26.7% 66.8%  6.5%
x264 [info]: mb P  I16..4: 11.1% 10.2%  1.0%  P16..4: 56.8% 12.5%  3.8%  0.0%  0.0%    skip: 4.6%
x264 [info]: 8x8 transform intra:58.5% inter:81.4%
x264 [info]: coded y,uvDC,uvAC intra: 81.4% 82.9% 43.6% inter: 40.1% 53.1% 3.3%
x264 [info]: i16 v,h,dc,p: 17% 13% 44% 26%
x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu:  9%  7% 11% 12% 13% 13% 12% 12% 12%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 12%  8% 10% 11% 13% 13% 11% 11% 12%
x264 [info]: i8c dc,h,v,p: 45% 28% 18%  9%
x264 [info]: Weighted P-Frames: Y:3.3% UV:1.2%
x264 [info]: kb/s:63493.91
[14:36:35] mux: track 0, 810 frames, 214505162 bytes, 63415.30 kbps, fifo 64
[14:36:35] mux: track 1, 1267 frames, 1082267 bytes, 319.96 kbps, fifo 512
[14:36:35] libhb: work result = 0

# Encode Completed ...


# Encode Stopped
rollin_eng
Veteran User
Posts: 4858
Joined: Wed May 04, 2011 11:06 pm

Re: Audio desync with PCM source

Post by rollin_eng »

Have you tried the latest version and/or a nightly?
Deleted User 13735

Re: Audio desync with PCM source

Post by Deleted User 13735 »

Yes.

Code: Select all

  HandBrake 1.1.0 (2018040700) - 64bit
OS: Microsoft Windows NT 6.1.7601 Service Pack 1 - 64bit
CPU: Intel(R) Core(TM) i7-6850K CPU @ 3.60GHz
Ram: 16294 MB, 
GPU Information:
  Radeon (TM) RX 480 Graphics - 21.19.407.0
Screen: 1920x1080
Temp Dir: C:\Users\John\AppData\Local\Temp\
Install Dir: C:\Program Files\HandBrake
Data Dir: C:\Users\John\AppData\Roaming\HandBrake Team\HandBrake\1.1.0.0

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


# Starting Encode ...

[15:00:42] hb_init: starting libhb thread
[15:00:42] 1 job(s) to process
[15:00:42] json job:
{
  "Audio": {
    "AudioList": [
      {
        "Bitrate": 320,
        "DRC": 0.0,
        "Encoder": 65536,
        "Gain": 0.0,
        "Mixdown": 4,
        "NormalizeMixLevel": false,
        "Samplerate": 48000,
        "Track": 0,
        "DitherMethod": 0
      }
    ],
    "CopyMask": [
      1073807360,
      1073743872,
      1074003968,
      1073750016,
      1090519040,
      1074790400,
      1074266112,
      1107296256
    ],
    "FallbackEncoder": 65536
  },
  "Destination": {
    "ChapterList": [
      {
        "Name": "Chapter 1"
      }
    ],
    "ChapterMarkers": true,
    "AlignAVStart": false,
    "File": "E:\\C0003-HB 1.1.0.mp4",
    "Mp4Options": {
      "IpodAtom": false,
      "Mp4Optimize": true
    },
    "Mux": 131072
  },
  "Filters": {
    "FilterList": [
      {
        "ID": 11,
        "Settings": {
          "crop-bottom": "0",
          "crop-left": "0",
          "crop-right": "0",
          "crop-top": "0",
          "height": "2160",
          "width": "3840"
        }
      },
      {
        "ID": 6,
        "Settings": {
          "mode": "1"
        }
      }
    ]
  },
  "PAR": {
    "Num": 1,
    "Den": 1
  },
  "Metadata": {},
  "SequenceID": 0,
  "Source": {
    "Angle": 1,
    "Range": {
      "Type": "chapter",
      "Start": 1,
      "End": 1
    },
    "Title": 1,
    "Path": "D:\\_Photos\\2018\\2018-04-21 Audio Sync\\Sony RX10-III\\C0003.MP4"
  },
  "Subtitle": {
    "Search": {
      "Burn": true,
      "Default": false,
      "Enable": true,
      "Forced": true
    },
    "SubtitleList": []
  },
  "Video": {
    "Encoder": 65536,
    "Level": "4.1",
    "TwoPass": false,
    "Turbo": false,
    "ColorMatrixCode": 0,
    "Options": "ref=5:bframes=5",
    "Preset": "slow",
    "Profile": "high",
    "Quality": 18.0,
    "HWDecode": false,
    "QSV": {
      "Decode": false,
      "AsyncDepth": 0
    }
  }
}
[15:00:42] CPU: Intel(R) Core(TM) i7-6850K CPU @ 3.60GHz
[15:00:42]  - Intel microarchitecture Broadwell
[15:00:42]  - logical processor count: 12
[15:00:42] Intel Quick Sync Video support: no
[15:00:42] hb_scan: path=D:\_Photos\2018\2018-04-21 Audio Sync\Sony RX10-III\C0003.MP4, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
src/libbluray/disc/disc.c:323: failed opening UDF image D:\_Photos\2018\2018-04-21 Audio Sync\Sony RX10-III\C0003.MP4
src/libbluray/disc/disc.c:424: error opening file BDMV\index.bdmv
src/libbluray/disc/disc.c:424: error opening file BDMV\BACKUP\index.bdmv
[15:00:42] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 5.0.3
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
[15:00:42] dvd: not a dvd - trying as a stream/file instead
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D:\_Photos\2018\2018-04-21 Audio Sync\Sony RX10-III\C0003.MP4':
  Metadata:
    major_brand     : XAVC
    minor_version   : 16785407
    compatible_brands: XAVCmp42iso2
    creation_time   : 2016-03-03 00:24:39
  Duration: 00:00:27.09, start: 0.000000, bitrate: 60222 kb/s
    Stream #0:0(und): Video: h264 (High) [avc1 / 0x31637661]
      yuv420p, tv, bt709/bt709/iec61966-2-4
      3840x2160 [PAR 1:1 DAR 16:9], 58586 kb/s
      29.97 fps, 30k tbn (default)
    Metadata:
      creation_time   : 2016-03-03 00:24:39
      handler_name    : Video Media Handler
      encoder         : AVC Coding
    Stream #0:1(und): Audio: pcm_s16be [twos / 0x736F7774]
      48000 Hz, 2 channels, s16, 1536 kb/s (default)
    Metadata:
      creation_time   : 2016-03-03 00:24:39
      handler_name    : Sound Media Handler
    Stream #0:2(und): Data: rtmd / 0x646D7472, 245 kb/s (default)
    Metadata:
      creation_time   : 2016-03-03 00:24:39
      handler_name    : Non-Real Time Metadata
[15:00:42] scan: decoding previews for title 1
[15:00:43] scan: audio 0x1: pcm_s16be, rate=48000Hz, bitrate=1536000 Unknown (pcm_s16be) (2.0 ch)
[15:00:44] scan: 10 previews, 3840x2160, 29.970 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[15:00:44] scan: supported video decoders: avcodec qsv
[15:00:44] libhb: scan thread found 1 valid title(s)
[15:00:45] Skipping subtitle scan.  No suitable subtitle tracks.
[15:00:45] starting job
[15:00:45] work: track 1, dithering not supported by codec
[15:00:45] work: only 1 chapter, disabling chapter markers
[15:00:45] job configuration:
[15:00:45]  * source
[15:00:45]    + D:\_Photos\2018\2018-04-21 Audio Sync\Sony RX10-III\C0003.MP4
[15:00:45]    + title 1, chapter(s) 1 to 1
[15:00:45]    + container: mov,mp4,m4a,3gp,3g2,mj2
[15:00:45]    + data rate: 60222 kbps
[15:00:45]  * destination
[15:00:45]    + E:\C0003-HB 1.1.0.mp4
[15:00:45]    + container: MPEG-4 (libavformat)
[15:00:45]      + optimized for HTTP streaming (fast start)
[15:00:45]  * video track
[15:00:45]    + decoder: h264
[15:00:45]      + bitrate 58586 kbps
[15:00:45]    + filters
[15:00:45]      + Framerate Shaper (mode=1)
[15:00:45]        + frame rate: 29.970 fps -> constant 29.970 fps
[15:00:45]      + Crop and Scale (width=3840:height=2160:crop-top=0:crop-bottom=0:crop-left=0:crop-right=0)
[15:00:45]        + source: 3840 * 2160, crop (0/0/0/0): 3840 * 2160, scale: 3840 * 2160
[15:00:45]    + Output geometry
[15:00:45]      + storage dimensions: 3840 x 2160
[15:00:45]      + pixel aspect ratio: 1 : 1
[15:00:45]      + display dimensions: 3840 x 2160
[15:00:45]    + encoder: H.264 (libx264)
[15:00:45]      + preset:  slow
[15:00:45]      + options: ref=5:bframes=5
[15:00:45]      + profile: high
[15:00:45]      + level:   4.1
[15:00:45]      + quality: 18.00 (RF)
[15:00:45]  * audio track 1
[15:00:45]    + decoder: Unknown (pcm_s16be) (2.0 ch) (track 1, id 0x1)
[15:00:45]      + bitrate: 1536 kbps, samplerate: 48000 Hz
[15:00:45]    + mixdown: Stereo
[15:00:45]    + encoder: AAC (libavcodec)
[15:00:45]      + bitrate: 320 kbps, samplerate: 48000 Hz
[15:00:45] sync: expecting 811 video frames
[15:00:45] encx264: min-keyint: 30, keyint: 300
[15:00:45] encx264: encoding at constant RF 18.000000
[15:00:45] apply_h264_level [warning]: frame size (3840x2160, 32400 macroblocks) too high for level 4.1 (max. 8192 macroblocks)
[15:00:45] encx264: unparsed options: ref=1:bframes=0:level=4.1:subme=8:trellis=2:vbv-bufsize=78125:vbv-maxrate=62500:rc-lookahead=50
x264 [info]: using SAR=1/1
x264 [warning]: frame MB size (240x135) > level limit (8192)
x264 [warning]: MB rate (971028) > level limit (245760)
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x264 [info]: profile High, level 4.1
[15:00:45] sync: first pts video is 0
[15:00:45] sync: first pts audio 0x1 is 0
[15:00:45] sync: "Chapter 1" (1) at frame 3 time 6006
[15:02:19] reader: done. 1 scr changes
[15:02:41] work: average encoding speed for job is 7.929032 fps
[15:02:41] vfr: 810 frames output, 0 dropped and 0 duped for CFR/PFR
[15:02:41] vfr: lost time: 0 (0 frames)
[15:02:41] vfr: gained time: 0 (0 frames) (0 not accounted for)
[15:02:42] pcm_s16be-decoder done: 1296 frames, 0 decoder errors
[15:02:42] h264-decoder done: 810 frames, 0 decoder errors
[15:02:42] sync: got 810 frames, 811 expected
[15:02:42] sync: framerate min 29.970 fps, max 29.970 fps, avg 29.970 fps
x264 [info]: frame I:209   Avg QP:18.31  size:440543
x264 [info]: frame P:601   Avg QP:20.05  size:203518
x264 [info]: mb I  I16..4: 26.0% 69.3%  4.7%
x264 [info]: mb P  I16..4: 11.3%  9.0%  1.0%  P16..4: 59.6% 11.5%  3.1%  0.0%  0.0%    skip: 4.6%
x264 [info]: 8x8 transform intra:59.0% inter:82.8%
x264 [info]: coded y,uvDC,uvAC intra: 81.4% 82.5% 42.9% inter: 42.1% 52.0% 3.2%
x264 [info]: i16 v,h,dc,p: 17% 13% 45% 25%
x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 10%  7% 12% 11% 12% 12% 11% 12% 12%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 13%  9% 13% 10% 12% 12% 10% 10% 11%
x264 [info]: i8c dc,h,v,p: 45% 28% 18%  8%
x264 [info]: Weighted P-Frames: Y:3.3% UV:1.2%
x264 [info]: kb/s:63458.77
[15:02:42] mux: track 0, 810 frames, 214386434 bytes, 63380.20 kbps, fifo 64
[15:02:42] mux: track 1, 1267 frames, 1082267 bytes, 319.96 kbps, fifo 512
[15:02:42] libhb: work result = 0

# Encode Completed ...  
Deleted User 13735

Re: Audio desync with PCM source

Post by Deleted User 13735 »

Also verified in 0.9.9 and 0.10.5
User avatar
BradleyS
Moderator
Posts: 1860
Joined: Thu Aug 09, 2007 12:16 pm

Re: Audio desync with PCM source

Post by BradleyS »

Hopefully John will have some time to look at this one. Will be easier to track if you will create an issue on GitHub.

Desync aside, the log indicates level 4.1 isn’t valid for the frame size.
jadennis
Posts: 7
Joined: Fri Feb 03, 2017 12:46 am

Re: Audio desync with PCM source

Post by jadennis »

@BradleyS
Sorry for the confusion and distraction with levels. When Musicvid asked for my logs, I just zipped the whole folder. That UHD file was not part of the original test cases.

Here is the Mediainfo report for the source video for a 35 second project that I did last night:

Code: Select all

General
Complete name                            : D:\_Photos\2018\2018-04-21 Audio Sync\MVI_4980.MOV
Format                                   : MPEG-4
Format profile                           : QuickTime
Codec ID                                 : qt   2007.09 (qt  /CAEP)
File size                                : 113 MiB
Duration                                 : 36 s 36 ms
Overall bit rate                         : 26.2 Mb/s
Encoded date                             : UTC 2018-04-22 00:10:02
Tagged date                              : UTC 2018-04-23 04:33:46
Copyright                                : 2014
com.apple.quicktime.make                 : Canon
com.apple.quicktime.model                : Canon PowerShot G15
com.apple.quicktime.author               : John Dennis

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Baseline@L4.1
Format settings, CABAC                   : No
Format settings, ReFrames                : 1 frame
Format settings, GOP                     : M=1, N=15
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 36 s 36 ms
Bit rate                                 : 24.7 Mb/s
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 29.970 (30000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.893
Stream size                              : 106 MiB (94%)
Language                                 : English
Encoded date                             : UTC 2018-04-22 00:10:02
Tagged date                              : UTC 2018-04-23 04:33:46
Color range                              : Full
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709

Audio
ID                                       : 2
Format                                   : PCM
Format settings, Endianness              : Little
Format settings, Sign                    : Signed
Codec ID                                 : sowt
Duration                                 : 36 s 36 ms
Bit rate mode                            : Constant
Bit rate                                 : 1 536 kb/s
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 kHz
Bit depth                                : 16 bits
Stream size                              : 6.60 MiB (6%)
Language                                 : English
Encoded date                             : UTC 2018-04-22 00:10:02
Tagged date                              : UTC 2018-04-23 04:33:46
... and the Mediainfo Report for the file rendered in Handbrake:

Code: Select all

General
Complete name                            : D:\_Photos\2018\2018-04-21 Audio Sync\MVI 4980-HB.mp4
Format                                   : MPEG-4
Format profile                           : Base Media / Version 2
Codec ID                                 : mp42 (isom/iso2/avc1/mp41)
File size                                : 24.5 MiB
Duration                                 : 36 s 54 ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 5 697 kb/s
Encoded date                             : UTC 2018-04-23 07:09:56
Tagged date                              : UTC 2018-04-23 07:09:56
Writing application                      : HandBrake 1.1.0 2018040700

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4.1
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 5 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 36 s 36 ms
Bit rate                                 : 5 373 kb/s
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 29.970 (30000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.195
Stream size                              : 23.1 MiB (94%)
Writing library                          : x264 core 155 r2893 [Censored]
Encoding settings                        : cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=8 / psy=1 / psy_rd=1.00:0.00 
						/ mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 
						/ chroma_qp_offset=-2 / threads=18 / lookahead_threads=3 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 
						/ bluray_compat=0 / constrained_intra=0 / bframes=5 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=3 
						/ weightb=1 / open_gop=0 / weightp=2 / keyint=300 / keyint_min=30 / scenecut=40 / intra_refresh=0 
						/ rc_lookahead=50 / rc=crf / mbtree=1 / crf=18.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 
						/ vbv_maxrate=62500 / vbv_bufsize=78125 / crf_max=0.0 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00
Encoded date                             : UTC 2018-04-23 07:09:56
Tagged date                              : UTC 2018-04-23 07:09:56
Color range                              : Limited
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709

Audio
ID                                       : 2
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Codec ID                                 : 40
Duration                                 : 36 s 54 ms
Bit rate mode                            : Variable
Bit rate                                 : 320 kb/s
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 spf)
Compression mode                         : Lossy
Stream size                              : 1.38 MiB (6%)
Title                                    : Stereo / Stereo
Language                                 : English
Default                                  : Yes
Alternate group                          : 1
Encoded date                             : UTC 2018-04-23 07:09:56
Tagged date                              : UTC 2018-04-23 07:09:56
Here are the Handbrake logs:

Code: Select all

HandBrake 1.1.0 (2018040700) - 64bit
OS: Microsoft Windows NT 6.1.7601 Service Pack 1 - 64bit
CPU: Intel(R) Core(TM) i7-6850K CPU @ 3.60GHz
Ram: 16294 MB, 
GPU Information:
  Radeon (TM) RX 480 Graphics - 21.19.407.0
Screen: 1920x1080
Temp Dir: C:\Users\John\AppData\Local\Temp\
Install Dir: C:\Program Files\HandBrake
Data Dir: C:\Users\John\AppData\Roaming\HandBrake Team\HandBrake\1.1.0.0

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


# Starting Encode ...

[00:09:55] hb_init: starting libhb thread
[00:09:55] 1 job(s) to process
[00:09:55] json job:
{
  "Audio": {
    "AudioList": [
      {
        "Bitrate": 320,
        "DRC": 0.0,
        "Encoder": 65536,
        "Gain": 0.0,
        "Mixdown": 4,
        "NormalizeMixLevel": false,
        "Samplerate": 48000,
        "Track": 0,
        "DitherMethod": 0
      }
    ],
    "CopyMask": [
      1073807360,
      1073743872,
      1074003968,
      1073750016,
      1090519040,
      1074790400,
      1074266112,
      1107296256
    ],
    "FallbackEncoder": 65536
  },
  "Destination": {
    "ChapterList": [
      {
        "Name": "Chapter 1"
      }
    ],
    "ChapterMarkers": true,
    "AlignAVStart": false,
    "File": "D:\\_Photos\\2018\\2018-04-21 Audio Sync\\MVI 4980-HB.mp4",
    "Mp4Options": {
      "IpodAtom": false,
      "Mp4Optimize": true
    },
    "Mux": 131072
  },
  "Filters": {
    "FilterList": [
      {
        "ID": 11,
        "Settings": {
          "crop-bottom": "0",
          "crop-left": "0",
          "crop-right": "0",
          "crop-top": "0",
          "height": "720",
          "width": "1280"
        }
      },
      {
        "ID": 6,
        "Settings": {
          "mode": "1"
        }
      }
    ]
  },
  "PAR": {
    "Num": 1,
    "Den": 1
  },
  "Metadata": {},
  "SequenceID": 0,
  "Source": {
    "Angle": 1,
    "Range": {
      "Type": "chapter",
      "Start": 1,
      "End": 1
    },
    "Title": 1,
    "Path": "D:\\_Photos\\2018\\2018-04-21 Audio Sync\\MVI_4980.MOV"
  },
  "Subtitle": {
    "Search": {
      "Burn": true,
      "Default": false,
      "Enable": true,
      "Forced": true
    },
    "SubtitleList": []
  },
  "Video": {
    "Encoder": 65536,
    "Level": "4.1",
    "TwoPass": false,
    "Turbo": false,
    "ColorMatrixCode": 0,
    "Options": "ref=5:bframes=5",
    "Preset": "slow",
    "Profile": "high",
    "Quality": 18.0,
    "HWDecode": false,
    "QSV": {
      "Decode": false,
      "AsyncDepth": 0
    }
  }
}
[00:09:55] CPU: Intel(R) Core(TM) i7-6850K CPU @ 3.60GHz
[00:09:55]  - Intel microarchitecture Broadwell
[00:09:55]  - logical processor count: 12
[00:09:55] Intel Quick Sync Video support: no
[00:09:55] hb_scan: path=D:\_Photos\2018\2018-04-21 Audio Sync\MVI_4980.MOV, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
src/libbluray/disc/disc.c:323: failed opening UDF image D:\_Photos\2018\2018-04-21 Audio Sync\MVI_4980.MOV
src/libbluray/disc/disc.c:424: error opening file BDMV\index.bdmv
src/libbluray/disc/disc.c:424: error opening file BDMV\BACKUP\index.bdmv
[00:09:55] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 5.0.3
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
[00:09:55] dvd: not a dvd - trying as a stream/file instead
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D:\_Photos\2018\2018-04-21 Audio Sync\MVI_4980.MOV':
  Metadata:
    major_brand     : qt
    minor_version   : 537331968
    compatible_brands: qt  CAEP
    creation_time   : 2018-04-22 00:10:02
  Duration: 00:00:36.03, start: 0.000000, bitrate: 26236 kb/s
    Stream #0:0(eng): Video: h264 (Constrained Baseline) [avc1 / 0x31637661]
      yuvj420p, pc, bt709/bt709/bt709
      1280x720, 24671 kb/s
      29.97 fps, 30k tbn (default)
    Metadata:
      creation_time   : 2018-04-22 00:10:02
    Stream #0:1(eng): Audio: pcm_s16le [sowt / 0x74776F73]
      48000 Hz, stereo, s16, 1536 kb/s (default)
    Metadata:
      creation_time   : 2018-04-22 00:10:02
[00:09:55] scan: decoding previews for title 1
[00:09:55] scan: audio 0x1: pcm_s16le, rate=48000Hz, bitrate=1536000 English (pcm_s16le) (2.0 ch)
[00:09:56] scan: 10 previews, 1280x720, 29.970 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[00:09:56] scan: supported video decoders: avcodec qsv
[00:09:56] libhb: scan thread found 1 valid title(s)
[00:09:56] Skipping subtitle scan.  No suitable subtitle tracks.
[00:09:56] starting job
[00:09:56] work: track 1, dithering not supported by codec
[00:09:56] work: only 1 chapter, disabling chapter markers
[00:09:56] job configuration:
[00:09:56]  * source
[00:09:56]    + D:\_Photos\2018\2018-04-21 Audio Sync\MVI_4980.MOV
[00:09:56]    + title 1, chapter(s) 1 to 1
[00:09:56]    + container: mov,mp4,m4a,3gp,3g2,mj2
[00:09:56]    + data rate: 26236 kbps
[00:09:56]  * destination
[00:09:56]    + D:\_Photos\2018\2018-04-21 Audio Sync\MVI 4980-HB.mp4
[00:09:56]    + container: MPEG-4 (libavformat)
[00:09:56]      + optimized for HTTP streaming (fast start)
[00:09:56]  * video track
[00:09:56]    + decoder: h264
[00:09:56]      + bitrate 24671 kbps
[00:09:56]    + filters
[00:09:56]      + Framerate Shaper (mode=1)
[00:09:56]        + frame rate: 29.970 fps -> constant 29.970 fps
[00:09:56]      + Crop and Scale (width=1280:height=720:crop-top=0:crop-bottom=0:crop-left=0:crop-right=0)
[00:09:56]        + source: 1280 * 720, crop (0/0/0/0): 1280 * 720, scale: 1280 * 720
[00:09:56]    + Output geometry
[00:09:56]      + storage dimensions: 1280 x 720
[00:09:56]      + pixel aspect ratio: 1 : 1
[00:09:56]      + display dimensions: 1280 x 720
[00:09:56]    + encoder: H.264 (libx264)
[00:09:56]      + preset:  slow
[00:09:56]      + options: ref=5:bframes=5
[00:09:56]      + profile: high
[00:09:56]      + level:   4.1
[00:09:56]      + quality: 18.00 (RF)
[00:09:56]  * audio track 1
[00:09:56]    + decoder: English (pcm_s16le) (2.0 ch) (track 1, id 0x1)
[00:09:56]      + bitrate: 1536 kbps, samplerate: 48000 Hz
[00:09:56]    + mixdown: Stereo
[00:09:56]    + encoder: AAC (libavcodec)
[00:09:56]      + bitrate: 320 kbps, samplerate: 48000 Hz
[00:09:56] sync: expecting 1080 video frames
[00:09:56] encx264: min-keyint: 30, keyint: 300
[00:09:56] encx264: encoding at constant RF 18.000000
[00:09:56] encx264: unparsed options: ref=5:bframes=5:level=4.1:direct=auto:subme=8:trellis=2:vbv-bufsize=78125:vbv-maxrate=62500:rc-lookahead=50
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x264 [info]: profile High, level 4.1
[00:09:56] sync: first pts video is 0
[00:09:56] sync: "Chapter 1" (1) at frame 1 time 0
[00:09:56] sync: first pts audio 0x1 is 0
[00:10:10] reader: done. 1 scr changes
[00:10:12] work: average encoding speed for job is 74.542480 fps
[00:10:12] vfr: 1080 frames output, 0 dropped and 0 duped for CFR/PFR
[00:10:12] vfr: lost time: 0 (0 frames)
[00:10:12] vfr: gained time: 0 (0 frames) (0 not accounted for)
[00:10:12] pcm_s16le-decoder done: 1728 frames, 0 decoder errors
[00:10:12] h264-decoder done: 1080 frames, 0 decoder errors
[00:10:12] sync: got 1080 frames, 1080 expected
[00:10:12] sync: framerate min 29.970 fps, max 29.970 fps, avg 29.970 fps
x264 [info]: frame I:4     Avg QP:16.82  size:263184
x264 [info]: frame P:203   Avg QP:19.17  size: 86097
x264 [info]: frame B:873   Avg QP:22.49  size:  6496
x264 [info]: consecutive B-frames:  2.4%  0.0%  0.0%  4.1%  4.6% 88.9%
x264 [info]: mb I  I16..4: 22.2% 33.2% 44.6%
x264 [info]: mb P  I16..4:  1.4%  1.9%  0.4%  P16..4: 49.4% 24.1% 19.1%  0.0%  0.0%    skip: 3.8%
x264 [info]: mb B  I16..4:  0.3%  0.4%  0.1%  B16..8: 29.5%  3.1%  0.9%  direct: 7.7%  skip:58.1%  L0:51.8% L1:37.0% BI:11.2%
x264 [info]: 8x8 transform intra:46.0% inter:35.3%
x264 [info]: direct mvs  spatial:99.0% temporal:1.0%
x264 [info]: coded y,uvDC,uvAC intra: 71.4% 72.0% 30.6% inter: 22.4% 22.8% 1.5%
x264 [info]: i16 v,h,dc,p: 14% 29% 29% 28%
x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 12% 21% 22%  6%  7%  6%  9%  7% 11%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 25% 14%  6%  7%  6%  8%  7% 10%
x264 [info]: i8c dc,h,v,p: 47% 31% 16%  5%
x264 [info]: Weighted P-Frames: Y:0.5% UV:0.0%
x264 [info]: ref P L0: 27.1%  6.1% 33.9%  7.5% 23.8%  1.6%
x264 [info]: ref B L0: 59.4% 26.9%  7.5%  6.2%
x264 [info]: ref B L1: 93.9%  6.1%
x264 [info]: kb/s:5372.74
[00:10:12] mux: track 0, 1080 frames, 24201328 bytes, 5367.73 kbps, fifo 512
[00:10:12] mux: track 1, 1690 frames, 1443327 bytes, 320.12 kbps, fifo 1024
[00:10:12] libhb: work result = 0

# Encode Completed ...

Code: Select all

HandBrake 1.1.0 (2018040700) - 64bit
OS: Microsoft Windows NT 6.1.7601 Service Pack 1 - 64bit
CPU: Intel(R) Core(TM) i7-6850K CPU @ 3.60GHz
Ram: 16294 MB, 
GPU Information:
  Radeon (TM) RX 480 Graphics - 21.19.407.0
Screen: 1920x1080
Temp Dir: C:\Users\John\AppData\Local\Temp\
Install Dir: C:\Program Files\HandBrake
Data Dir: C:\Users\John\AppData\Roaming\HandBrake Team\HandBrake\1.1.0.0

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


# Starting Encode ...

[00:09:55] hb_init: starting libhb thread
[00:09:55] 1 job(s) to process
[00:09:55] json job:
{
  "Audio": {
    "AudioList": [
      {
        "Bitrate": 320,
        "DRC": 0.0,
        "Encoder": 65536,
        "Gain": 0.0,
        "Mixdown": 4,
        "NormalizeMixLevel": false,
        "Samplerate": 48000,
        "Track": 0,
        "DitherMethod": 0
      }
    ],
    "CopyMask": [
      1073807360,
      1073743872,
      1074003968,
      1073750016,
      1090519040,
      1074790400,
      1074266112,
      1107296256
    ],
    "FallbackEncoder": 65536
  },
  "Destination": {
    "ChapterList": [
      {
        "Name": "Chapter 1"
      }
    ],
    "ChapterMarkers": true,
    "AlignAVStart": false,
    "File": "D:\\_Photos\\2018\\2018-04-21 Audio Sync\\MVI 4980-HB.mp4",
    "Mp4Options": {
      "IpodAtom": false,
      "Mp4Optimize": true
    },
    "Mux": 131072
  },
  "Filters": {
    "FilterList": [
      {
        "ID": 11,
        "Settings": {
          "crop-bottom": "0",
          "crop-left": "0",
          "crop-right": "0",
          "crop-top": "0",
          "height": "720",
          "width": "1280"
        }
      },
      {
        "ID": 6,
        "Settings": {
          "mode": "1"
        }
      }
    ]
  },
  "PAR": {
    "Num": 1,
    "Den": 1
  },
  "Metadata": {},
  "SequenceID": 0,
  "Source": {
    "Angle": 1,
    "Range": {
      "Type": "chapter",
      "Start": 1,
      "End": 1
    },
    "Title": 1,
    "Path": "D:\\_Photos\\2018\\2018-04-21 Audio Sync\\MVI_4980.MOV"
  },
  "Subtitle": {
    "Search": {
      "Burn": true,
      "Default": false,
      "Enable": true,
      "Forced": true
    },
    "SubtitleList": []
  },
  "Video": {
    "Encoder": 65536,
    "Level": "4.1",
    "TwoPass": false,
    "Turbo": false,
    "ColorMatrixCode": 0,
    "Options": "ref=5:bframes=5",
    "Preset": "slow",
    "Profile": "high",
    "Quality": 18.0,
    "HWDecode": false,
    "QSV": {
      "Decode": false,
      "AsyncDepth": 0
    }
  }
}
[00:09:55] CPU: Intel(R) Core(TM) i7-6850K CPU @ 3.60GHz
[00:09:55]  - Intel microarchitecture Broadwell
[00:09:55]  - logical processor count: 12
[00:09:55] Intel Quick Sync Video support: no
[00:09:55] hb_scan: path=D:\_Photos\2018\2018-04-21 Audio Sync\MVI_4980.MOV, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
src/libbluray/disc/disc.c:323: failed opening UDF image D:\_Photos\2018\2018-04-21 Audio Sync\MVI_4980.MOV
src/libbluray/disc/disc.c:424: error opening file BDMV\index.bdmv
src/libbluray/disc/disc.c:424: error opening file BDMV\BACKUP\index.bdmv
[00:09:55] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 5.0.3
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
[00:09:55] dvd: not a dvd - trying as a stream/file instead
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D:\_Photos\2018\2018-04-21 Audio Sync\MVI_4980.MOV':
  Metadata:
    major_brand     : qt
    minor_version   : 537331968
    compatible_brands: qt  CAEP
    creation_time   : 2018-04-22 00:10:02
  Duration: 00:00:36.03, start: 0.000000, bitrate: 26236 kb/s
    Stream #0:0(eng): Video: h264 (Constrained Baseline) [avc1 / 0x31637661]
      yuvj420p, pc, bt709/bt709/bt709
      1280x720, 24671 kb/s
      29.97 fps, 30k tbn (default)
    Metadata:
      creation_time   : 2018-04-22 00:10:02
    Stream #0:1(eng): Audio: pcm_s16le [sowt / 0x74776F73]
      48000 Hz, stereo, s16, 1536 kb/s (default)
    Metadata:
      creation_time   : 2018-04-22 00:10:02
[00:09:55] scan: decoding previews for title 1
[00:09:55] scan: audio 0x1: pcm_s16le, rate=48000Hz, bitrate=1536000 English (pcm_s16le) (2.0 ch)
[00:09:56] scan: 10 previews, 1280x720, 29.970 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[00:09:56] scan: supported video decoders: avcodec qsv
[00:09:56] libhb: scan thread found 1 valid title(s)
[00:09:56] Skipping subtitle scan.  No suitable subtitle tracks.
[00:09:56] starting job
[00:09:56] work: track 1, dithering not supported by codec
[00:09:56] work: only 1 chapter, disabling chapter markers
[00:09:56] job configuration:
[00:09:56]  * source
[00:09:56]    + D:\_Photos\2018\2018-04-21 Audio Sync\MVI_4980.MOV
[00:09:56]    + title 1, chapter(s) 1 to 1
[00:09:56]    + container: mov,mp4,m4a,3gp,3g2,mj2
[00:09:56]    + data rate: 26236 kbps
[00:09:56]  * destination
[00:09:56]    + D:\_Photos\2018\2018-04-21 Audio Sync\MVI 4980-HB.mp4
[00:09:56]    + container: MPEG-4 (libavformat)
[00:09:56]      + optimized for HTTP streaming (fast start)
[00:09:56]  * video track
[00:09:56]    + decoder: h264
[00:09:56]      + bitrate 24671 kbps
[00:09:56]    + filters
[00:09:56]      + Framerate Shaper (mode=1)
[00:09:56]        + frame rate: 29.970 fps -> constant 29.970 fps
[00:09:56]      + Crop and Scale (width=1280:height=720:crop-top=0:crop-bottom=0:crop-left=0:crop-right=0)
[00:09:56]        + source: 1280 * 720, crop (0/0/0/0): 1280 * 720, scale: 1280 * 720
[00:09:56]    + Output geometry
[00:09:56]      + storage dimensions: 1280 x 720
[00:09:56]      + pixel aspect ratio: 1 : 1
[00:09:56]      + display dimensions: 1280 x 720
[00:09:56]    + encoder: H.264 (libx264)
[00:09:56]      + preset:  slow
[00:09:56]      + options: ref=5:bframes=5
[00:09:56]      + profile: high
[00:09:56]      + level:   4.1
[00:09:56]      + quality: 18.00 (RF)
[00:09:56]  * audio track 1
[00:09:56]    + decoder: English (pcm_s16le) (2.0 ch) (track 1, id 0x1)
[00:09:56]      + bitrate: 1536 kbps, samplerate: 48000 Hz
[00:09:56]    + mixdown: Stereo
[00:09:56]    + encoder: AAC (libavcodec)
[00:09:56]      + bitrate: 320 kbps, samplerate: 48000 Hz
[00:09:56] sync: expecting 1080 video frames
[00:09:56] encx264: min-keyint: 30, keyint: 300
[00:09:56] encx264: encoding at constant RF 18.000000
[00:09:56] encx264: unparsed options: ref=5:bframes=5:level=4.1:direct=auto:subme=8:trellis=2:vbv-bufsize=78125:vbv-maxrate=62500:rc-lookahead=50
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x264 [info]: profile High, level 4.1
[00:09:56] sync: first pts video is 0
[00:09:56] sync: "Chapter 1" (1) at frame 1 time 0
[00:09:56] sync: first pts audio 0x1 is 0
[00:10:10] reader: done. 1 scr changes
[00:10:12] work: average encoding speed for job is 74.542480 fps
[00:10:12] vfr: 1080 frames output, 0 dropped and 0 duped for CFR/PFR
[00:10:12] vfr: lost time: 0 (0 frames)
[00:10:12] vfr: gained time: 0 (0 frames) (0 not accounted for)
[00:10:12] pcm_s16le-decoder done: 1728 frames, 0 decoder errors
[00:10:12] h264-decoder done: 1080 frames, 0 decoder errors
[00:10:12] sync: got 1080 frames, 1080 expected
[00:10:12] sync: framerate min 29.970 fps, max 29.970 fps, avg 29.970 fps
x264 [info]: frame I:4     Avg QP:16.82  size:263184
x264 [info]: frame P:203   Avg QP:19.17  size: 86097
x264 [info]: frame B:873   Avg QP:22.49  size:  6496
x264 [info]: consecutive B-frames:  2.4%  0.0%  0.0%  4.1%  4.6% 88.9%
x264 [info]: mb I  I16..4: 22.2% 33.2% 44.6%
x264 [info]: mb P  I16..4:  1.4%  1.9%  0.4%  P16..4: 49.4% 24.1% 19.1%  0.0%  0.0%    skip: 3.8%
x264 [info]: mb B  I16..4:  0.3%  0.4%  0.1%  B16..8: 29.5%  3.1%  0.9%  direct: 7.7%  skip:58.1%  L0:51.8% L1:37.0% BI:11.2%
x264 [info]: 8x8 transform intra:46.0% inter:35.3%
x264 [info]: direct mvs  spatial:99.0% temporal:1.0%
x264 [info]: coded y,uvDC,uvAC intra: 71.4% 72.0% 30.6% inter: 22.4% 22.8% 1.5%
x264 [info]: i16 v,h,dc,p: 14% 29% 29% 28%
x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 12% 21% 22%  6%  7%  6%  9%  7% 11%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 25% 14%  6%  7%  6%  8%  7% 10%
x264 [info]: i8c dc,h,v,p: 47% 31% 16%  5%
x264 [info]: Weighted P-Frames: Y:0.5% UV:0.0%
x264 [info]: ref P L0: 27.1%  6.1% 33.9%  7.5% 23.8%  1.6%
x264 [info]: ref B L0: 59.4% 26.9%  7.5%  6.2%
x264 [info]: ref B L1: 93.9%  6.1%
x264 [info]: kb/s:5372.74
[00:10:12] mux: track 0, 1080 frames, 24201328 bytes, 5367.73 kbps, fifo 512
[00:10:12] mux: track 1, 1690 frames, 1443327 bytes, 320.12 kbps, fifo 1024
[00:10:12] libhb: work result = 0

# Encode Completed ...
I have Vegas Pro 12-13-14 projects that I can use to verify any fix. Please advise.
User avatar
BradleyS
Moderator
Posts: 1860
Joined: Thu Aug 09, 2007 12:16 pm

Re: Audio desync with PCM source

Post by BradleyS »

Thanks for the logs. I've asked another developer who works on our sync code to take a look.
Deleted User 13735

Re: Audio desync with PCM source

Post by Deleted User 13735 »

Although Youtube does its own processing, this test offers a fair approximation of what is going on. I treat it as more of an annoyance than a bug. I will elevate it to Github, however.

https://www.youtube.com/watch?v=AhsiQfEfpA0&t=48s
jadennis
Posts: 7
Joined: Fri Feb 03, 2017 12:46 am

Re: Audio desync with PCM source

Post by jadennis »

"I treat it as more of an annoyance than a bug."

My interpretation of this behavior is slightly different.

If the audio lags the video by a frame or two, it's an annoyance.

If the audio leads the video by a frame or two, it's a bug.
Deleted User 13735

Re: Audio desync with PCM source

Post by Deleted User 13735 »

Can't escape that logic.
Post Reply