Stutter in mkv encoded video

Archive of historical bug reports.
Please use the GitHub link above to report issues.
Forum rules
*******************************
Please be aware we are now using GitHub for issue tracking and feature requests.
- This section of the forum is now closed to new topics.

*******************************
Post Reply
berumsey
Posts: 1
Joined: Fri Jan 20, 2017 3:20 am

Stutter in mkv encoded video

Post by berumsey »

Please describe the problem in as much detail as possible:
This problem is very easy to reproduce, and I have tried to eliminate as many variables as possible. When encoding to mkv the resulting file has a "glitch". If played in power dvd 16 it plays at about half framerate "12 fps". If I drag the timeline cursor to anything but 0 second mark it plays fine. Example: start playing - stutters, drag to 55 seconds - smooth, drag back to 0 seconds - stutters. If I set referenced frames to 1, it's good. If I encode to mp4 it's also good. I even ran the encode to mp4 and used mkvtoolnix to mux it into mkv with subtitle track and chapters, and it plays fine. Vlc doesn't seem to have the same issue, but has no atmos support. I prefer the mkv container because of the chapter and subtitle support.

UPDATE:
With further testing the culprit is aac audio conversion. If I select only a passthrough for dolby, convert to mp3, ac3, or flac it's good! Bitrate had no effect, and it only affects the mkv container. So to sum up: mkv video encoded slower than utrafast setting plus dts to aac conversion equals glitchy framerates. Also, there is no problem with 0.10.2.7268 - 64bit!

UPDATE 2:
I have switched to h.265 and it works fine, but h.264 is definitely having issues.

What are the steps to reproduce this problem:
Encode 1080p video to mkv, codec h.264, framerate constant same as source, encoder preset slower "anything slower than ultrafast setting", constant quality 20, one dolby audio track converted to aac (avcodec)

What version of HandBrake you are running:
1.0.1

What operating system and version and you running (e.g. OSX 10.11, Windows 7, Ubuntu 14):
Windows 10, and Ubuntu 16 - both have same result

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.1 (2016122900) - 64bit
OS: Microsoft Windows NT 10.0.14393.0 - 64bit
CPU: Intel(R) Xeon(R) CPU           X5690  @ 3.47GHz
Ram: 24567 MB, 
GPU Information:
  NVIDIA GeForce GTX TITAN - 21.21.13.7633
  NVIDIA GeForce GTX 960 - 21.21.13.7633
  NVIDIA GeForce GTX 760 - 21.21.13.7633
Screen: 1920x1080
Temp Dir: C:\Users\berum\AppData\Local\Temp\
Install Dir: C:\Program Files\Handbrake
Data Dir: C:\Users\berum\AppData\Roaming\HandBrake Team\HandBrake\1.0.1.0

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


# Starting Encode ...

[17:49:21] hb_init: starting libhb thread
[17:49:21] 1 job(s) to process
[17:49:21] json job:
{
  "Audio": {
    "AudioList": [
      {
        "DRC": 0.0,
        "Encoder": 1125984256,
        "Gain": 0.0,
        "Mixdown": -1,
        "NormalizeMixLevel": false,
        "Samplerate": 0,
        "Name": "Dolby HD",
        "Track": 1,
        "DitherMethod": 0
      },
      {
        "Bitrate": 1536,
        "DRC": 0.0,
        "Encoder": 65536,
        "Gain": 0.0,
        "Mixdown": 7,
        "NormalizeMixLevel": false,
        "Samplerate": 48000,
        "Name": "Surround",
        "Track": 1,
        "DitherMethod": 0
      },
      {
        "Bitrate": 192,
        "DRC": 0.0,
        "Encoder": 65536,
        "Gain": 0.0,
        "Mixdown": 4,
        "NormalizeMixLevel": false,
        "Samplerate": 48000,
        "Name": "Stereo",
        "Track": 1,
        "DitherMethod": 0
      }
    ],
    "CopyMask": [
      1073807360,
      1073743872,
      1074003968,
      1073750016,
      1090519040,
      1074790400,
      1074266112,
      1107296256
    ],
    "FallbackEncoder": 2048
  },
  "Destination": {
    "ChapterList": [],
    "ChapterMarkers": false,
    "File": "E:\\video\\Snowden-mkv-nochap-nosub.mkv",
    "Mp4Options": {
      "IpodAtom": false,
      "Mp4Optimize": false
    },
    "Mux": 2097152
  },
  "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": "140",
          "crop-left": "0",
          "crop-right": "0",
          "crop-top": "140",
          "height": "800",
          "width": "1920"
        }
      },
      {
        "ID": 6,
        "Settings": {
          "mode": "1"
        }
      }
    ]
  },
  "PAR": {
    "Num": 1,
    "Den": 1
  },
  "Metadata": {},
  "SequenceID": 0,
  "Source": {
    "Angle": 1,
    "Range": {
      "Type": "time",
      "Start": 0,
      "End": 10800000
    },
    "Title": 49,
    "Path": "E:\\Video\\Snowden.2016.1080p.BluRay.AVC.DTS-HD.MA.5.1-FGT"
  },
  "Subtitle": {
    "Search": {
      "Burn": false,
      "Default": false,
      "Enable": false,
      "Forced": false
    },
    "SubtitleList": []
  },
  "Video": {
    "Encoder": 65536,
    "Level": "4.1",
    "TwoPass": false,
    "Turbo": false,
    "ColorMatrixCode": 0,
    "Options": "",
    "Preset": "slower",
    "Profile": "main",
    "Quality": 20.0,
    "Tune": "fastdecode",
    "OpenCL": false,
    "HWDecode": false,
    "QSV": {
      "Decode": false,
      "AsyncDepth": 0
    }
  }
}
[17:49:21] CPU: Intel(R) Xeon(R) CPU           X5690  @ 3.47GHz
[17:49:21]  - logical processor count: 12
[17:49:21] OpenCL device #1: NVIDIA Corporation GeForce GTX 960
[17:49:21]  - OpenCL version: 1.2 CUDA
[17:49:21]  - driver version: 376.33
[17:49:21]  - device type:    GPU
[17:49:21]  - supported:      no
[17:49:21] OpenCL device #2: NVIDIA Corporation GeForce GTX 760
[17:49:21]  - OpenCL version: 1.2 CUDA
[17:49:21]  - driver version: 376.33
[17:49:21]  - device type:    GPU
[17:49:21]  - supported:      no
[17:49:21] OpenCL device #3: NVIDIA Corporation GeForce GTX TITAN
[17:49:21]  - OpenCL version: 1.2 CUDA
[17:49:21]  - driver version: 376.33
[17:49:21]  - device type:    GPU
[17:49:21]  - supported:      no
[17:49:21] Intel Quick Sync Video support: no
[17:49:21] hb_scan: path=E:\Video\Snowden.2016.1080p.BluRay.AVC.DTS-HD.MA.5.1-FGT, title_index=49
[17:49:22] scan: BD has 54 title(s)
[17:49:22] bd: scanning title 49
[17:49:22] bd: playlist 00800.MPLS
[17:49:22] bd: duration is 02:14:49 (8089081 ms)
[17:49:22] bd: video id=0x1011, stream type=H.264, format 1080p
[17:49:22] bd: aspect = 16:9
[17:49:22] bd: audio id=0x711100, lang=English (DTS), 3cc=eng
[17:49:22] bd: audio id=0x1100, lang=English (DTS-HD MA), 3cc=eng
[17:49:22] bd: subtitle id=0x1200, lang=English, 3cc=eng
[17:49:22] bd: subtitle id=0x1201, lang=español, 3cc=spa
[17:49:22] bd: subtitle id=0x1202, lang=Francais, 3cc=fra
[17:49:22] bd: chap 1 packet=768, 462378 ms
[17:49:22] bd: chap 2 packet=2151996480, 487612 ms
[17:49:22] bd: chap 3 packet=4341619776, 256047 ms
[17:49:22] bd: chap 4 packet=5547499584, 385968 ms
[17:49:22] bd: chap 5 packet=7233456576, 218968 ms
[17:49:22] bd: chap 6 packet=8231871168, 319235 ms
[17:49:22] bd: chap 7 packet=9698555328, 372663 ms
[17:49:22] bd: chap 8 packet=11432196096, 602893 ms
[17:49:22] bd: chap 9 packet=14042920512, 448531 ms
[17:49:22] bd: chap 10 packet=16154424768, 330246 ms
[17:49:22] bd: chap 11 packet=17702242752, 483274 ms
[17:49:22] bd: chap 12 packet=19934931072, 319652 ms
[17:49:22] bd: chap 13 packet=21358679232, 423923 ms
[17:49:22] bd: chap 14 packet=23279778624, 319319 ms
[17:49:22] bd: chap 15 packet=24753590784, 460710 ms
[17:49:22] bd: chap 16 packet=26838676800, 714714 ms
[17:49:22] bd: chap 17 packet=30107684352, 414330 ms
[17:49:22] bd: chap 18 packet=31975252224, 381881 ms
[17:49:22] bd: chap 19 packet=33684797376, 266808 ms
[17:49:22] bd: chap 20 packet=34923385152, 419669 ms
[17:49:22] bd: chap 21 packet=36839123904, 250 ms
[17:49:22] bd: title 49 has 21 chapters
[17:49:22] scan: decoding previews for title 49
[17:49:22] scan: title angle(s) 1
[17:49:22] scan: audio 0x711100: dca, rate=48000Hz, bitrate=1536000 English (DTS) (5.1 ch)
[17:49:22] scan: audio 0x1100: dca, rate=48000Hz, bitrate=1536000 English (DTS-HD MA) (5.1 ch)
[17:49:38] scan: 10 previews, 1920x1080, 23.976 fps, autocrop = 140/140/0/0, aspect 16:9, PAR 1:1
[17:49:38] scan: supported video decoders: avcodec qsv
[17:49:38] stream: 34 good frames, 0 errors (0%)
[17:49:38] libhb: scan thread found 1 valid title(s)
[17:49:38] starting job
[17:49:38] decomb filter thread started for segment 0
[17:49:38] decomb filter thread started for segment 1
[17:49:38] decomb filter thread started for segment 2
[17:49:38] decomb filter thread started for segment 3
[17:49:38] decomb filter thread started for segment 4
[17:49:38] decomb filter thread started for segment 5
[17:49:38] decomb check thread started for segment 11
[17:49:38] mask filter thread started for segment 1
[17:49:38] decomb filter thread started for segment 8
[17:49:38] decomb filter thread started for segment 9
[17:49:38] mask filter thread started for segment 10
[17:49:38] mask erode thread started for segment 1
[17:49:38] decomb check thread started for segment 0
[17:49:38] decomb check thread started for segment 1
[17:49:38] decomb check thread started for segment 2
[17:49:38] decomb check thread started for segment 3
[17:49:38] decomb check thread started for segment 4
[17:49:38] decomb check thread started for segment 5
[17:49:38] mask dilate thread started for segment 10
[17:49:38] decomb check thread started for segment 7
[17:49:38] decomb check thread started for segment 8
[17:49:38] decomb check thread started for segment 9
[17:49:38] decomb check thread started for segment 10
[17:49:38] decomb filter thread started for segment 6
[17:49:38] mask filter thread started for segment 0
[17:49:38] Auto Passthru: allowed codecs are AAC, AC3, E-AC3, TrueHD, DTS, DTS-HD, MP3, FLAC
[17:49:38] decomb filter thread started for segment 7
[17:49:38] Auto Passthru: fallback is AC3
[17:49:38] Auto Passthru: using DTS-HD Passthru for track 1
[17:49:38] work: track 2, dithering not supported by codec
[17:49:38] work: track 3, dithering not supported by codec
[17:49:38] mask filter thread started for segment 2
[17:49:38] mask filter thread started for segment 3
[17:49:38] mask filter thread started for segment 4
[17:49:38] mask filter thread started for segment 5
[17:49:38] job configuration:
[17:49:38]  * source
[17:49:38]    + E:\Video\Snowden.2016.1080p.BluRay.AVC.DTS-HD.MA.5.1-FGT
[17:49:38]    + title 49, start 00:00:0.00 stop 00:02:0.00
[17:49:38]  * destination
[17:49:38]    + E:\video\Snowden-mkv-nochap-nosub.mkv
[17:49:38] mask filter thread started for segment 6
[17:49:38]    + container: Matroska (libavformat)
[17:49:38]  * video track
[17:49:38]    + decoder: h264
[17:49:38]      + bitrate 200 kbps
[17:49:38]    + filters
[17:49:38]      + 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)
[17:49:38] mask filter thread started for segment 7
[17:49:38]      + Decomb (mode=39)
[17:49:38]      + Framerate Shaper (mode=1)
[17:49:38]        + frame rate: 23.976 fps -> constant 23.976 fps
[17:49:38] mask filter thread started for segment 8
[17:49:38]      + Crop and Scale (width=1920:height=800:crop-top=140:crop-bottom=140:crop-left=0:crop-right=0)
[17:49:38]        + source: 1920 * 1080, crop (140/140/0/0): 1920 * 800, scale: 1920 * 800
[17:49:38]    + Output geometry
[17:49:38]      + storage dimensions: 1920 x 800
[17:49:38]      + pixel aspect ratio: 1 : 1
[17:49:38]      + display dimensions: 1920 x 800
[17:49:38]    + encoder: H.264 (libx264)
[17:49:38] mask filter thread started for segment 9
[17:49:38]      + preset:  slower
[17:49:38]      + tune:    fastdecode
[17:49:38]      + profile: main
[17:49:38]      + level:   4.1
[17:49:38]      + quality: 20.00 (RF)
[17:49:38]  * audio track 1
[17:49:38]    + name: Dolby HD
[17:49:38]    + decoder: English (DTS-HD MA) (5.1 ch) (track 2, id 0x1100)
[17:49:38]      + bitrate: 1536 kbps, samplerate: 48000 Hz
[17:49:38]    + DTS-HD Passthru
[17:49:38] decomb filter thread started for segment 10
[17:49:38]  * audio track 2
[17:49:38]    + name: Surround
[17:49:38]    + decoder: English (DTS-HD MA) (5.1 ch) (track 2, id 0x1100)
[17:49:38]      + bitrate: 1536 kbps, samplerate: 48000 Hz
[17:49:38]    + mixdown: 5.1 Channels
[17:49:38]    + encoder: AAC (libavcodec)
[17:49:38]      + bitrate: 1536 kbps, samplerate: 48000 Hz
[17:49:38] mask filter thread started for segment 11
[17:49:38]  * audio track 3
[17:49:38]    + name: Stereo
[17:49:38]    + decoder: English (DTS-HD MA) (5.1 ch) (track 2, id 0x1100)
[17:49:38]      + bitrate: 1536 kbps, samplerate: 48000 Hz
[17:49:38]    + mixdown: Stereo
[17:49:38] mask erode thread started for segment 0
[17:49:38]    + encoder: AAC (libavcodec)
[17:49:38]      + bitrate: 192 kbps, samplerate: 48000 Hz
[17:49:38] decomb filter thread started for segment 11
[17:49:38] mask erode thread started for segment 2
[17:49:38] mask erode thread started for segment 3
[17:49:38] mask erode thread started for segment 4
[17:49:38] mask erode thread started for segment 5
[17:49:38] mask erode thread started for segment 6
[17:49:38] mask erode thread started for segment 7
[17:49:38] mask erode thread started for segment 8
[17:49:38] mask erode thread started for segment 9
[17:49:38] mask erode thread started for segment 10
[17:49:38] mask erode thread started for segment 11
[17:49:38] mask dilate thread started for segment 0
[17:49:38] mask dilate thread started for segment 1
[17:49:38] mask dilate thread started for segment 2
[17:49:38] mask dilate thread started for segment 3
[17:49:38] mask dilate thread started for segment 4
[17:49:38] mask dilate thread started for segment 5
[17:49:38] mask dilate thread started for segment 6
[17:49:38] mask dilate thread started for segment 7
[17:49:38] mask dilate thread started for segment 8
[17:49:38] mask dilate thread started for segment 9
[17:49:38] decomb check thread started for segment 6
[17:49:38] mask dilate thread started for segment 11
[17:49:38] yadif thread started for segment 0
[17:49:38] yadif thread started for segment 1
[17:49:38] yadif thread started for segment 2
[17:49:38] yadif thread started for segment 3
[17:49:38] yadif thread started for segment 4
[17:49:38] yadif thread started for segment 5
[17:49:38] yadif thread started for segment 6
[17:49:38] yadif thread started for segment 7
[17:49:38] yadif thread started for segment 8
[17:49:38] yadif thread started for segment 9
[17:49:38] yadif thread started for segment 10
[17:49:38] yadif thread started for segment 11
[17:49:38] sync: expecting 2901 video frames
[17:49:38] encx264: min-keyint: 24, keyint: 240
[17:49:38] encx264: encoding at constant RF 20.000000
[17:49:38] encx264: unparsed options: trellis=2:level=4.1:rc-lookahead=60:no-deblock=1:ref=5:b-adapt=2:8x8dct=0:weightb=0:vbv-bufsize=62500:direct=auto:subme=9:cabac=0:analyse=all:weightp=0:me=umh:vbv-maxrate=50000
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
x264 [info]: profile Main, level 4.1
[17:49:39] sync: first pts video is 0
[17:49:39] sync: "Chapter 1" (1) at frame 1 time 0
[17:49:39] sync: first pts audio 0x1100 is 0
[17:49:39] sync: first pts audio 0x1100 is 0
[17:49:39] sync: first pts audio 0x1100 is 0
[17:53:24] sync: reached audio 0x1100 pts 10800000, exiting early
[17:53:24] sync: reached audio 0x1100 pts 10800000, exiting early
[17:53:24] sync: reached audio 0x1100 pts 10800000, exiting early
[17:53:24] sync: reached video pts 10803292, exiting early
[17:53:43] work: average encoding speed for job is 12.840355 fps
[17:53:43] comb detect: heavy 109 | light 389 | uncombed 2380 | total 2878
[17:53:43] decomb: deinterlaced 109 | blended 389 | unfiltered 2380 | total 2878
[17:53:43] vfr: 2878 frames output, 0 dropped and 0 duped for CFR/PFR
[17:53:43] vfr: lost time: 0 (0 frames)
[17:53:43] vfr: gained time: 0 (0 frames) (0 not accounted for)
[17:53:43] stream: 4602 good frames, 0 errors (0%)
[17:53:43] dca-decoder done: 17924 frames, 0 decoder errors
[17:53:43] dca-decoder done: 17924 frames, 0 decoder errors
[17:53:43] dca-decoder done: 17924 frames, 0 decoder errors
[17:53:43] h264-decoder done: 4590 frames, 0 decoder errors
[17:53:43] sync: got 2878 frames, 2901 expected
[17:53:43] sync: framerate min 23.974 fps, max 23.981 fps, avg 23.976 fps
x264 [info]: frame I:20    Avg QP:16.19  size:144500
x264 [info]: frame P:913   Avg QP:19.78  size: 49107
x264 [info]: frame B:1945  Avg QP:20.51  size: 16708
x264 [info]: consecutive B-frames:  4.7%  7.6% 23.8% 63.9%
x264 [info]: mb I  I16..4: 54.6%  0.0% 45.4%
x264 [info]: mb P  I16..4:  8.8%  0.0%  7.3%  P16..4: 34.1% 14.1%  6.4%  0.7%  0.2%    skip:28.4%
x264 [info]: mb B  I16..4:  1.2%  0.0%  0.9%  B16..8: 31.3%  5.6%  0.8%  direct: 4.9%  skip:55.2%  L0:41.4% L1:47.3% BI:11.2%
x264 [info]: direct mvs  spatial:99.3% temporal:0.7%
x264 [info]: coded y,uvDC,uvAC intra: 52.8% 74.0% 40.6% inter: 14.3% 28.2% 3.1%
x264 [info]: i16 v,h,dc,p: 29% 19%  9% 43%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu:  8%  9%  5% 12% 18% 16% 15%  9%  8%
x264 [info]: i8c dc,h,v,p: 50% 19% 19% 12%
x264 [info]: ref P L0: 68.6% 17.6%  8.3%  5.3%  0.2%
x264 [info]: ref B L0: 82.2% 12.7%  4.1%  1.1%
x264 [info]: ref B L1: 96.0%  4.0%
x264 [info]: kb/s:5346.44
[17:53:44] mux: track 0, 2878 frames, 80220299 bytes, 5346.39 kbps, fifo 512
[17:53:44] mux: track 1, 11250 frames, 54470884 bytes, 3630.29 kbps, fifo 2048
[17:53:44] mux: track 2, 5625 frames, 12461282 bytes, 830.50 kbps, fifo 1024
[17:53:44] mux: track 3, 5625 frames, 2518829 bytes, 167.87 kbps, fifo 1024
[17:53:44] libhb: work result = 0

# Encode Completed ...

 
Post Reply