Odd behaviour in output after frame-accurate trim

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
Schmengie
Posts: 25
Joined: Wed Jan 17, 2018 8:39 am

Odd behaviour in output after frame-accurate trim

Post by Schmengie »

Description of problem or question
This actually concerns the same source as that in my previous issue. In spite of frame-accurate trimming during Blu-ray rip (AnyDVD HD was used again), output file retains two or three seconds' worth of audio after the trim point, where the video seems to either stall at the last frame for the same two or three seconds, or display frames that also occur after the trim point. In simpler terms, trimming by frame number is behaving somewhat similarly to how it does in MKVToolNix, which does no re-encoding and thus must rely on key frames.

I am not sure if this is a problem specific to this source or not, but I can say that it is working as expected with different sources, DVD and BD.

If it's important, this is a TV series, and there is a small portion that I am cutting out of each episode around the middle. Thus, for each episode, I make two output files, which I then merge together via MKVToolNix. The issue occurs in the two separate output files, as well as the merged file.

Steps to reproduce the problem (If Applicable)
I've prepared an abridged version of the source by doing a rip via MKVToolNix GUI with assistance from AnyDVD HD. It can be downloaded here:
https://1drv.ms/u/s!Aqbbpq4RDc1zhYpW0wf-J4HR55MSAA
  • Choose "Shakugan_No_Shana-1-TS.mkv" as source.
  • Configure settings as normal.
  • Switch Range mode to Frames and enter range: 0 to 19683.
  • (Optional) Add to Queue.
  • (Optional) Enter another range: 19784 to 35147
  • (Optional) Add to Queue
  • Start Encode
  • (Optional) Merge output files via the Append files feature in MKVToolNix
HandBrake version (e.g., 1.0.0)
Nightly 20180126214425-21d0e57-master (2018012701) - 64bit

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

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

Code: Select all

HandBrake Nightly 20180126214425-21d0e57-master (2018012701) - 64bit
OS: Microsoft Windows NT 10.0.16299.0 - 64bit
CPU: AMD A10-7850K Radeon R7, 12 Compute Cores 4C+8G
Ram: 7106 MB, 
GPU Information:
  AMD Radeon(TM) R7 Graphics - 22.19.677.257
Screen: 1920x1080
Temp Dir: C:\Users\schme\AppData\Local\Temp\
Install Dir: C:\Program Files\HandBrake Nightly
Data Dir: C:\Users\schme\AppData\Roaming\HandBrake Team\HandBrake\1.1.0.0

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


# Starting Encode ...

[04:32:42] hb_init: starting libhb thread
[04:32:42] 1 job(s) to process
[04:32:42] json job:
{
  "Audio": {
    "AudioList": [
      {
        "DRC": 0.0,
        "Encoder": 1125984256,
        "Gain": 0.0,
        "Mixdown": -1,
        "NormalizeMixLevel": false,
        "Samplerate": 0,
        "Track": 0,
        "DitherMethod": 0
      },
      {
        "DRC": 0.0,
        "Encoder": 1125984256,
        "Gain": 0.0,
        "Mixdown": -1,
        "NormalizeMixLevel": false,
        "Samplerate": 0,
        "Track": 1,
        "DitherMethod": 0
      }
    ],
    "CopyMask": [
      1073807360,
      1073743872,
      1074003968,
      1073750016,
      1090519040,
      1074790400,
      1074266112,
      1107296256
    ],
    "FallbackEncoder": 2097152
  },
  "Destination": {
    "ChapterList": [
      {
        "Name": "Chapter 1"
      },
      {
        "Name": "Chapter 2"
      },
      {
        "Name": "Chapter 3"
      },
      {
        "Name": "Chapter 4"
      },
      {
        "Name": "Chapter 5"
      }
    ],
    "ChapterMarkers": true,
    "AlignAVStart": false,
    "File": "E:\\Rips\\Shakugan_No_Shana-1-TS-2.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": "0",
          "crop-left": "0",
          "crop-right": "0",
          "crop-top": "0",
          "height": "1080",
          "width": "1920"
        }
      },
      {
        "ID": 6,
        "Settings": {
          "mode": "0"
        }
      }
    ]
  },
  "PAR": {
    "Num": 1,
    "Den": 1
  },
  "Metadata": {},
  "SequenceID": 0,
  "Source": {
    "Angle": 1,
    "Range": {
      "Type": "frame",
      "Start": 19784,
      "End": 35147
    },
    "Title": 1,
    "Path": "E:\\Rips\\Shakugan_No_Shana-1-TS.mkv"
  },
  "Subtitle": {
    "Search": {
      "Burn": false,
      "Default": false,
      "Enable": false,
      "Forced": false
    },
    "SubtitleList": [
      {
        "Burn": false,
        "Default": false,
        "Forced": false,
        "ID": 1,
        "Offset": 0,
        "Track": 0
      },
      {
        "Burn": false,
        "Default": false,
        "Forced": false,
        "ID": 2,
        "Offset": 0,
        "Track": 1
      }
    ]
  },
  "Video": {
    "Encoder": 16384,
    "Level": "auto",
    "TwoPass": false,
    "Turbo": false,
    "ColorMatrixCode": 0,
    "Options": "",
    "Preset": "fast",
    "Profile": "auto",
    "Quality": 20.0,
    "HWDecode": false,
    "QSV": {
      "Decode": false,
      "AsyncDepth": 0
    }
  }
}
[04:32:42] CPU:
[04:32:42]  - logical processor count: 4
[04:32:42] Intel Quick Sync Video support: no
[04:32:42] hb_scan: path=E:\Rips\Shakugan_No_Shana-1-TS.mkv, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
src/libbluray/disc/disc.c:323: failed opening UDF image E:\Rips\Shakugan_No_Shana-1-TS.mkv
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
[04:32: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
[04:32:42] dvd: not a dvd - trying as a stream/file instead
Input #0, matroska,webm, from 'E:\Rips\Shakugan_No_Shana-1-TS.mkv':
  Duration: 00:24:42.02, start: 0.000000, bitrate: N/A
    Chapter #0:0: start 0.000000, end 106.064000
    Metadata:
      title           : Chapter 1
    Chapter #0:1: start 106.064000, end 821.028000
    Metadata:
      title           : Chapter 2
    Chapter #0:2: start 821.028000, end 1376.041000
    Metadata:
      title           : Chapter 3
    Chapter #0:3: start 1376.041000, end 1466.006000
    Metadata:
      title           : Chapter 4
    Chapter #0:4: start 1466.006000, end 1482.024000
    Metadata:
      title           : Chapter 5
    Stream #0:0: Video: h264 (High)
      yuv420p, tv, bt709/bt709/bt709
      1920x1080 [PAR 1:1 DAR 16:9], PAR 1:1 DAR 16:9
      23.98 fps, 1k tbn (default)
    Metadata:
      BPS             : 14934067
      BPS-eng         : 14934067
      DURATION        : 00:24:42.023000000
      DURATION-eng    : 00:24:42.023000000
      NUMBER_OF_FRAMES: 35533
      NUMBER_OF_FRAMES-eng: 35533
      NUMBER_OF_BYTES : 2766578886
      NUMBER_OF_BYTES-eng: 2766578886
      _STATISTICS_WRITING_APP: mkvmerge v20.0.0 ('I Am The Sun') 64-bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v20.0.0 ('I Am The Sun') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2018-02-11 10:12:14
      _STATISTICS_WRITING_DATE_UTC-eng: 2018-02-11 10:12:14
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:1(eng): Audio: truehd
      48000 Hz, stereo, s32 (default)
    Metadata:
      BPS             : 798580
      BPS-eng         : 798580
      DURATION        : 00:24:42.024000000
      DURATION-eng    : 00:24:42.024000000
      NUMBER_OF_FRAMES: 1778427
      NUMBER_OF_FRAMES-eng: 1778427
      NUMBER_OF_BYTES : 147939466
      NUMBER_OF_BYTES-eng: 147939466
      _STATISTICS_WRITING_APP: mkvmerge v20.0.0 ('I Am The Sun') 64-bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v20.0.0 ('I Am The Sun') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2018-02-11 10:12:14
      _STATISTICS_WRITING_DATE_UTC-eng: 2018-02-11 10:12:14
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:2(jpn): Audio: truehd
      48000 Hz, stereo, s32
    Metadata:
      BPS             : 845925
      BPS-eng         : 845925
      DURATION        : 00:24:42.024000000
      DURATION-eng    : 00:24:42.024000000
      NUMBER_OF_FRAMES: 1778427
      NUMBER_OF_FRAMES-eng: 1778427
      NUMBER_OF_BYTES : 156710222
      NUMBER_OF_BYTES-eng: 156710222
      _STATISTICS_WRITING_APP: mkvmerge v20.0.0 ('I Am The Sun') 64-bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v20.0.0 ('I Am The Sun') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2018-02-11 10:12:14
      _STATISTICS_WRITING_DATE_UTC-eng: 2018-02-11 10:12:14
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:3(eng): Subtitle: hdmv_pgs_subtitle (default)
    Metadata:
      BPS             : 34449
      BPS-eng         : 34449
      DURATION        : 00:24:37.560000000
      DURATION-eng    : 00:24:37.560000000
      NUMBER_OF_FRAMES: 607
      NUMBER_OF_FRAMES-eng: 607
      NUMBER_OF_BYTES : 6362583
      NUMBER_OF_BYTES-eng: 6362583
      _STATISTICS_WRITING_APP: mkvmerge v20.0.0 ('I Am The Sun') 64-bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v20.0.0 ('I Am The Sun') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2018-02-11 10:12:14
      _STATISTICS_WRITING_DATE_UTC-eng: 2018-02-11 10:12:14
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:4(eng): Subtitle: hdmv_pgs_subtitle
    Metadata:
      title           : English signs
      BPS             : 4330
      BPS-eng         : 4330
      DURATION        : 00:24:04.109000000
      DURATION-eng    : 00:24:04.109000000
      NUMBER_OF_FRAMES: 58
      NUMBER_OF_FRAMES-eng: 58
      NUMBER_OF_BYTES : 781734
      NUMBER_OF_BYTES-eng: 781734
      _STATISTICS_WRITING_APP: mkvmerge v20.0.0 ('I Am The Sun') 64-bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v20.0.0 ('I Am The Sun') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2018-02-11 10:12:14
      _STATISTICS_WRITING_DATE_UTC-eng: 2018-02-11 10:12:14
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
[04:32:43] scan: decoding previews for title 1
[04:32:43] scan: audio 0x1: truehd, rate=48000Hz, bitrate=1 English (TrueHD) (2.0 ch)
[04:32:43] scan: audio 0x2: truehd, rate=48000Hz, bitrate=1 ??? (TrueHD) (2.0 ch)
[04:32:43] scan: 10 previews, 1920x1080, 23.976 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[04:32:43] scan: supported video decoders: avcodec qsv
[04:32:43] libhb: scan thread found 1 valid title(s)
[04:32:43] starting job
[04:32:43] decomb filter thread started for segment 1
[04:32:43] decomb filter thread started for segment 2
[04:32:43] decomb filter thread started for segment 0
[04:32:43] decomb filter thread started for segment 3
[04:32:43] decomb check thread started for segment 0
[04:32:43] decomb check thread started for segment 1
[04:32:43] decomb check thread started for segment 2
[04:32:43] decomb check thread started for segment 3
[04:32:43] mask filter thread started for segment 0
[04:32:43] mask filter thread started for segment 1
[04:32:43] mask filter thread started for segment 2
[04:32:43] mask filter thread started for segment 3
[04:32:43] mask erode thread started for segment 0
[04:32:43] mask erode thread started for segment 1
[04:32:43] Auto Passthru: allowed codecs are AAC, AC3, E-AC3, TrueHD, DTS, DTS-HD, MP3, FLAC
[04:32:43] Auto Passthru: fallback is FLAC 24-bit
[04:32:43] mask erode thread started for segment 2
[04:32:43] Auto Passthru: using TrueHD Passthru for track 1
[04:32:43] Auto Passthru: using TrueHD Passthru for track 2
[04:32:43] mask erode thread started for segment 3
[04:32:43] mask dilate thread started for segment 0
[04:32:43] mask dilate thread started for segment 1
[04:32:43] mask dilate thread started for segment 2
[04:32:43] mask dilate thread started for segment 3
[04:32:43] yadif thread started for segment 0
[04:32:43] yadif thread started for segment 1
[04:32:43] yadif thread started for segment 2
[04:32:43] job configuration:
[04:32:43]  * source
[04:32:43]    + E:\Rips\Shakugan_No_Shana-1-TS.mkv
[04:32:43]    + title 1, frames 19783 to 35146
[04:32:43] yadif thread started for segment 3
[04:32:43]    + container: matroska,webm
[04:32:43]  * destination
[04:32:43]    + E:\Rips\Shakugan_No_Shana-1-TS-2.mkv
[04:32:43]    + container: Matroska (libavformat)
[04:32:43]      + chapter markers
[04:32:43]  * video track
[04:32:43]    + decoder: h264
[04:32:43]    + filters
[04:32:43]      + 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)
[04:32:43]      + Decomb (mode=39)
[04:32:43]      + Framerate Shaper (mode=0)
[04:32:43]        + frame rate: same as source (around 23.976 fps)
[04:32:43]      + Crop and Scale (width=1920:height=1080:crop-top=0:crop-bottom=0:crop-left=0:crop-right=0)
[04:32:43]        + source: 1920 * 1080, crop (0/0/0/0): 1920 * 1080, scale: 1920 * 1080
[04:32:43]    + Output geometry
[04:32:43]      + storage dimensions: 1920 x 1080
[04:32:43]      + pixel aspect ratio: 1 : 1
[04:32:43]      + display dimensions: 1920 x 1080
[04:32:43]    + encoder: H.265 12-bit (libx265)
[04:32:43]      + preset:  fast
[04:32:43]      + profile: auto
[04:32:43]      + quality: 20.00 (RF)
[04:32:43]  * subtitle track 1, English [PGS] (track 0, id 0x3, Picture) -> Passthrough
[04:32:43]  * subtitle track 2, English [PGS] (track 1, id 0x4, Picture) -> Passthrough
[04:32:43]  * audio track 1
[04:32:43]    + decoder: English (TrueHD) (2.0 ch) (track 1, id 0x1)
[04:32:43]      + samplerate: 48000 Hz
[04:32:43]    + TrueHD Passthru
[04:32:43]  * audio track 2
[04:32:43]    + decoder: ??? (TrueHD) (2.0 ch) (track 2, id 0x2)
[04:32:43]      + samplerate: 48000 Hz
[04:32:43]    + TrueHD Passthru
[04:32:43] sync: expecting 15364 video frames
x265 [info]: HEVC encoder version 2.6
x265 [info]: build info [Windows][GCC 7.1.0][64 bit] 12bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX XOP FMA4 FMA3 BMI1
x265 [info]: Main 12 profile, Level-4 (Main tier)
x265 [info]: Thread pool created using 4 threads
x265 [info]: Slices                              : 1
x265 [info]: frame threads / pool features       : 2 / wpp(17 rows)
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : hex / 57 / 2 / 2
x265 [info]: Keyframe min / max / scenecut / bias: 24 / 240 / 40 / 5.00
x265 [info]: Lookahead / bframes / badapt        : 15 / 4 / 0
x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
x265 [info]: References / ref-limit  cu / depth  : 3 / on / on
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 1 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : CRF-20.0 / 0.60
x265 [info]: tools: rd=2 psy-rd=2.00 rskip signhide tmvp fast-intra
x265 [info]: tools: strong-intra-smoothing lslices=6 deblock sao
[04:35:15] sync: first pts video is 0
[04:35:15] sync: first pts audio 0x1 is 22614
[04:35:15] sync: first pts audio 0x2 is 22614
[04:35:55] sync: first pts subtitle 0x3 is 1054854
[05:22:20] sync: first pts subtitle 0x4 is 49583304
[05:22:32] sync: "Chapter 4" (4) at frame 13210 time 49583283
[05:29:39] sync: reached video frame 15364, exiting early
[05:29:39] sync: reached audio 0x1 pts 57822864, exiting early
[05:29:39] sync: reached audio 0x2 pts 57822864, exiting early
[05:29:45] reader: done. 1 scr changes
[05:29:58] work: average encoding speed for job is 4.702342 fps
[05:29:58] comb detect: heavy 86 | light 540 | uncombed 14738 | total 15364
[05:29:58] decomb: deinterlaced 86 | blended 540 | unfiltered 14738 | total 15364
[05:29:58] vfr: lost time: 0 (0 frames)
[05:29:58] vfr: gained time: 0 (0 frames) (0 not accounted for)
[05:29:58] truehd-decoder done: 1778427 frames, 0 decoder errors
[05:29:58] truehd-decoder done: 1778427 frames, 0 decoder errors
[05:29:58] h264-decoder done: 35533 frames, 0 decoder errors
[05:29:58] sync: got 15364 frames, 15364 expected
[05:29:58] sync: framerate min 23.981 fps, max 23.981 fps, avg 23.976 fps
x265 [info]: frame I:    190, Avg QP:15.20  kb/s: 9664.73
x265 [info]: frame P:   3110, Avg QP:15.93  kb/s: 4790.19
x265 [info]: frame B:  12064, Avg QP:21.46  kb/s: 1275.51
x265 [info]: Weighted P-Frames: Y:8.0% UV:5.6%
x265 [info]: consecutive B-frames: 6.8% 1.1% 1.4% 1.4% 89.4%
encoded 15364 frames in 3434.77s (4.47 fps), 2090.70 kb/s, Avg QP:20.26
[05:29:58] mux: track 0, 15364 frames, 167528692 bytes, 2085.77 kbps, fifo 1024
[05:29:58] mux: track 1, 770670 frames, 63330246 bytes, 788.48 kbps, fifo 65536
[05:29:58] mux: track 2, 770670 frames, 67337736 bytes, 838.37 kbps, fifo 65536
[05:29:58] mux: track 3, 261 frames, 2697452 bytes, 33.58 kbps, fifo 64
[05:29:58] mux: track 4, 30 frames, 369751 bytes, 4.60 kbps, fifo 16
[05:29:58] libhb: work result = 0

# Encode Completed ...
[code][/i]
Deleted User 13735

Re: Odd behaviour in output after frame-accurate trim

Post by Deleted User 13735 »

In simpler terms, trimming by frame number is behaving somewhat similarly to how it does in MKVToolNix, which does no re-encoding and thus must rely on key frames.
Frame-accurate muxing can be done in VideoRedo.
Schmengie
Posts: 25
Joined: Wed Jan 17, 2018 8:39 am

Re: Odd behaviour in output after frame-accurate trim

Post by Schmengie »

VideoReDo would be awesome, but it strips subtitle tracks. I actually made an inquiry about that with them and they told me that it's possible to add the feature, but that there's not enough demand for vobsubs and PGS subs in MKV's to justify the work load required.

HandBrake is fine, especially since I shifted my focus from lossless rips to something more compressed (hence the use of x265 for H.264 sources); it's just having trouble with this particular source. Seems to work just fine with others.
Schmengie
Posts: 25
Joined: Wed Jan 17, 2018 8:39 am

Re: Odd behaviour in output after frame-accurate trim

Post by Schmengie »

Any other thoughts?
Deleted User 11865

Re: Odd behaviour in output after frame-accurate trim

Post by Deleted User 11865 »

Maybe the TrueHD frames are pretty long? Can't remember its duration off the top of my head. HandBrake can't split audio frames either, and there's no guarantee that each video frame and audio frame will end with the exact same timestamp.
Schmengie
Posts: 25
Joined: Wed Jan 17, 2018 8:39 am

Re: Odd behaviour in output after frame-accurate trim

Post by Schmengie »

Ohhh. Interesting.

Is it possible that Handbrake will one day be able to split audio frames?
Deleted User 11865

Re: Odd behaviour in output after frame-accurate trim

Post by Deleted User 11865 »

Not without re-encoding.
Schmengie
Posts: 25
Joined: Wed Jan 17, 2018 8:39 am

Re: Odd behaviour in output after frame-accurate trim

Post by Schmengie »

Ohh, wait.

Is that to say that if I re-encode to FLAC or something, it'll work?
Deleted User 11865

Re: Odd behaviour in output after frame-accurate trim

Post by Deleted User 11865 »

Not sure, you'd have to try. Unfortunately I'm not the expert when it comes to this code, John is.
Schmengie
Posts: 25
Joined: Wed Jan 17, 2018 8:39 am

Re: Odd behaviour in output after frame-accurate trim

Post by Schmengie »

Well. Tried ripping/converting a portion of the source with FLAC Passthru set as audio output, but the resulting tracks are silent.

Not sure what to make of that. Any ideas?

Code: Select all

HandBrake Nightly 20180126214425-21d0e57-master (2018012701) - 64bit
OS: Microsoft Windows NT 10.0.16299.0 - 64bit
CPU: AMD A10-7850K Radeon R7, 12 Compute Cores 4C+8G
Ram: 7106 MB, 
GPU Information:
  AMD Radeon(TM) R7 Graphics - 22.19.677.257
Screen: 1920x1080
Temp Dir: C:\Users\schme\AppData\Local\Temp\
Install Dir: C:\Program Files\HandBrake Nightly
Data Dir: C:\Users\schme\AppData\Roaming\HandBrake Team\HandBrake\1.1.0.0

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


# Starting Encode ...

[01:42:07] hb_init: starting libhb thread
[01:42:07] 1 job(s) to process
[01:42:07] json job:
{
  "Audio": {
    "AudioList": [
      {
        "DRC": 0.0,
        "Encoder": 2097152,
        "Gain": 0.0,
        "Mixdown": -1,
        "NormalizeMixLevel": false,
        "Samplerate": 0,
        "Track": 1,
        "DitherMethod": 0
      },
      {
        "DRC": 0.0,
        "Encoder": 2097152,
        "Gain": 0.0,
        "Mixdown": -1,
        "NormalizeMixLevel": false,
        "Samplerate": 0,
        "Track": 3,
        "DitherMethod": 0
      }
    ],
    "CopyMask": [
      1073807360,
      1073743872,
      1074003968,
      1073750016,
      1090519040,
      1074790400,
      1074266112,
      1107296256
    ],
    "FallbackEncoder": 2097152
  },
  "Destination": {
    "ChapterList": [
      {
        "Name": "Chapter 1"
      },
      {
        "Name": "Chapter 2"
      },
      {
        "Name": "Chapter 3"
      },
      {
        "Name": "Chapter 4"
      },
      {
        "Name": "Chapter 5"
      },
      {
        "Name": "Chapter 6"
      },
      {
        "Name": "Chapter 7"
      },
      {
        "Name": "Chapter 8"
      },
      {
        "Name": "Chapter 9"
      },
      {
        "Name": "Chapter 10"
      },
      {
        "Name": "Chapter 11"
      },
      {
        "Name": "Chapter 12"
      },
      {
        "Name": "Chapter 13"
      },
      {
        "Name": "Chapter 14"
      },
      {
        "Name": "Chapter 15"
      },
      {
        "Name": "Chapter 16"
      },
      {
        "Name": "Chapter 17"
      },
      {
        "Name": "Chapter 18"
      },
      {
        "Name": "Chapter 19"
      },
      {
        "Name": "Chapter 20"
      },
      {
        "Name": "Chapter 21"
      },
      {
        "Name": "Chapter 22"
      },
      {
        "Name": "Chapter 23"
      },
      {
        "Name": "Chapter 24"
      },
      {
        "Name": "Chapter 25"
      },
      {
        "Name": "Chapter 26"
      },
      {
        "Name": "Chapter 27"
      },
      {
        "Name": "Chapter 28"
      },
      {
        "Name": "Chapter 29"
      },
      {
        "Name": "Chapter 30"
      },
      {
        "Name": "Chapter 31"
      },
      {
        "Name": "Chapter 32"
      },
      {
        "Name": "Chapter 33"
      },
      {
        "Name": "Chapter 34"
      },
      {
        "Name": "Chapter 35"
      },
      {
        "Name": "Chapter 36"
      },
      {
        "Name": "Chapter 37"
      },
      {
        "Name": "Chapter 38"
      },
      {
        "Name": "Chapter 39"
      },
      {
        "Name": "Chapter 40"
      },
      {
        "Name": "Chapter 41"
      },
      {
        "Name": "Chapter 42"
      },
      {
        "Name": "Chapter 43"
      },
      {
        "Name": "Chapter 44"
      },
      {
        "Name": "Chapter 45"
      },
      {
        "Name": "Chapter 46"
      }
    ],
    "ChapterMarkers": true,
    "AlignAVStart": false,
    "File": "E:\\Videos\\Shakugan_No_Shana-1-1.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": "0",
          "crop-left": "0",
          "crop-right": "0",
          "crop-top": "0",
          "height": "1080",
          "width": "1920"
        }
      },
      {
        "ID": 6,
        "Settings": {
          "mode": "0"
        }
      }
    ]
  },
  "PAR": {
    "Num": 1,
    "Den": 1
  },
  "Metadata": {},
  "SequenceID": 0,
  "Source": {
    "Angle": 1,
    "Range": {
      "Type": "frame",
      "Start": 0,
      "End": 19683
    },
    "Title": 7,
    "Path": "D:\\"
  },
  "Subtitle": {
    "Search": {
      "Burn": false,
      "Default": false,
      "Enable": false,
      "Forced": false
    },
    "SubtitleList": [
      {
        "Burn": false,
        "Default": false,
        "Forced": false,
        "ID": 1,
        "Offset": 0,
        "Track": 0
      },
      {
        "Burn": false,
        "Default": false,
        "Forced": false,
        "ID": 2,
        "Offset": 0,
        "Track": 1
      }
    ]
  },
  "Video": {
    "Encoder": 16384,
    "Level": "auto",
    "TwoPass": false,
    "Turbo": false,
    "ColorMatrixCode": 0,
    "Options": "",
    "Preset": "fast",
    "Profile": "auto",
    "Quality": 20.0,
    "HWDecode": false,
    "QSV": {
      "Decode": false,
      "AsyncDepth": 0
    }
  }
}
[01:42:07] CPU:
[01:42:07]  - logical processor count: 4
[01:42:07] Intel Quick Sync Video support: no
[01:42:07] hb_scan: path=D:\, title_index=7
[01:42:07] scan: BD has 37 title(s)
[01:42:07] bd: scanning title 7
[01:42:07] bd: playlist 00008.MPLS
[01:42:07] bd: duration is 03:42:18 (13338700 ms)
[01:42:07] bd: video id=0x1011, stream type=H.264, format 1080p
[01:42:07] bd: aspect = 16:9
[01:42:07] bd: audio id=0x761100, lang=English (AC3), 3cc=eng
[01:42:07] bd: audio id=0x721100, lang=English (TrueHD), 3cc=eng
[01:42:07] bd: audio id=0x761101, lang=??? (AC3), 3cc=jpn
[01:42:07] bd: audio id=0x721101, lang=??? (TrueHD), 3cc=jpn
[01:42:07] bd: subtitle id=0x1200, lang=English [PGS], 3cc=eng
[01:42:07] bd: subtitle id=0x1201, lang=English [PGS], 3cc=eng
[01:42:07] bd: chap 1 packet=768, 106064 ms
[01:42:07] bd: chap 2 packet=413573184, 714964 ms
[01:42:07] bd: chap 3 packet=2118742080, 555012 ms
[01:42:07] bd: chap 4 packet=3405572928, 89964 ms
[01:42:07] bd: chap 5 packet=3653356416, 16016 ms
[01:42:07] bd: chap 6 packet=3684200448, 106022 ms
[01:42:07] bd: chap 7 packet=4097382528, 765973 ms
[01:42:07] bd: chap 8 packet=5716840704, 503961 ms
[01:42:07] bd: chap 9 packet=6745593408, 90048 ms
[01:42:07] bd: chap 10 packet=6992003712, 16016 ms
[01:42:07] bd: chap 11 packet=7022228736, 106022 ms
[01:42:07] bd: chap 12 packet=7435601856, 626959 ms
[01:42:07] bd: chap 13 packet=8626984896, 642975 ms
[01:42:07] bd: chap 14 packet=9984321984, 90048 ms
[01:42:07] bd: chap 15 packet=10233260544, 16016 ms
[01:42:07] bd: chap 16 packet=10265522688, 106064 ms
[01:42:07] bd: chap 17 packet=10678900224, 610943 ms
[01:42:07] bd: chap 18 packet=11867944704, 658991 ms
[01:42:07] bd: chap 19 packet=13344900288, 90006 ms
[01:42:07] bd: chap 20 packet=13591675968, 16016 ms
[01:42:07] bd: chap 21 packet=13624004352, 106022 ms
[01:42:07] bd: chap 22 packet=14037383424, 527026 ms
[01:42:07] bd: chap 23 packet=15115238208, 742908 ms
[01:42:07] bd: chap 24 packet=16676200704, 90048 ms
[01:42:07] bd: chap 25 packet=16921084224, 16016 ms
[01:42:07] bd: chap 26 packet=16948276224, 106022 ms
[01:42:07] bd: chap 27 packet=17361462336, 598014 ms
[01:42:07] bd: chap 28 packet=18605602752, 671921 ms
[01:42:07] bd: chap 29 packet=20085565632, 90048 ms
[01:42:07] bd: chap 30 packet=20332080384, 16016 ms
[01:42:07] bd: chap 31 packet=20359522560, 106064 ms
[01:42:07] bd: chap 32 packet=20773096320, 611944 ms
[01:42:07] bd: chap 33 packet=21984596352, 657948 ms
[01:42:07] bd: chap 34 packet=23248607232, 90048 ms
[01:42:07] bd: chap 35 packet=23493688704, 16016 ms
[01:42:07] bd: chap 36 packet=23522846208, 106022 ms
[01:42:07] bd: chap 37 packet=23936033664, 515014 ms
[01:42:07] bd: chap 38 packet=25153280064, 754920 ms
[01:42:07] bd: chap 39 packet=26879626752, 90048 ms
[01:42:07] bd: chap 40 packet=27125937216, 16016 ms
[01:42:07] bd: chap 41 packet=27166280448, 106022 ms
[01:42:07] bd: chap 42 packet=27579654336, 619952 ms
[01:42:07] bd: chap 43 packet=28733428416, 649982 ms
[01:42:07] bd: chap 44 packet=30461829120, 90048 ms
[01:42:07] bd: chap 45 packet=30710921472, 16016 ms
[01:42:07] bd: chap 46 packet=30737590272, 500 ms
[01:42:07] bd: title 7 has 46 chapters
[01:42:07] scan: decoding previews for title 7
[01:42:07] scan: title angle(s) 1
[01:42:07] scan: audio 0x761100: ac3, rate=48000Hz, bitrate=192000 English (AC3) (2.0 ch)
[01:42:07] scan: audio 0x761101: ac3, rate=48000Hz, bitrate=192000 ??? (AC3) (2.0 ch)
[01:42:07] scan: audio 0x721100: truehd, rate=48000Hz, bitrate=200000 English (TrueHD) (2.0 ch)
[01:42:07] scan: audio 0x721101: truehd, rate=48000Hz, bitrate=200000 ??? (TrueHD) (2.0 ch)
[01:42:08] scan: 10 previews, 1920x1080, 23.976 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[01:42:08] scan: supported video decoders: avcodec qsv
[01:42:08] stream: 4 good frames, 0 errors (0%)
[01:42:08] libhb: scan thread found 1 valid title(s)
[01:42:09] starting job
[01:42:09] decomb filter thread started for segment 0
[01:42:09] decomb check thread started for segment 0
[01:42:09] decomb filter thread started for segment 2
[01:42:09] decomb filter thread started for segment 3
[01:42:09] decomb filter thread started for segment 1
[01:42:09] decomb check thread started for segment 1
[01:42:09] decomb check thread started for segment 2
[01:42:09] decomb check thread started for segment 3
[01:42:09] mask filter thread started for segment 0
[01:42:09] mask filter thread started for segment 1
[01:42:09] mask filter thread started for segment 2
[01:42:09] mask filter thread started for segment 3
[01:42:09] mask erode thread started for segment 0
[01:42:09] mask erode thread started for segment 1
[01:42:09] mask erode thread started for segment 2
[01:42:09] mask erode thread started for segment 3
[01:42:09] mask dilate thread started for segment 0
[01:42:09] work: mixdown not specified, track 1 setting mixdown Stereo
[01:42:09] work: compression level not specified, track 1 setting compression level 5.00
[01:42:09] work: track 1, dithering not supported by codec
[01:42:09] work: mixdown not specified, track 2 setting mixdown Stereo
[01:42:09] work: compression level not specified, track 2 setting compression level 5.00
[01:42:09] work: track 2, dithering not supported by codec
[01:42:09] mask dilate thread started for segment 1
[01:42:09] mask dilate thread started for segment 2
[01:42:09] mask dilate thread started for segment 3
[01:42:09] yadif thread started for segment 0
[01:42:09] yadif thread started for segment 1
[01:42:09] yadif thread started for segment 2
[01:42:09] yadif thread started for segment 3
[01:42:09] job configuration:
[01:42:09]  * source
[01:42:09]    + D:\
[01:42:09]    + title 7, frames 0 to 19682
[01:42:09]  * destination
[01:42:09]    + E:\Videos\Shakugan_No_Shana-1-1.mkv
[01:42:09]    + container: Matroska (libavformat)
[01:42:09]      + chapter markers
[01:42:09]  * video track
[01:42:09]    + decoder: h264
[01:42:09]      + bitrate 200 kbps
[01:42:09]    + filters
[01:42:09]      + 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)
[01:42:09]      + Decomb (mode=39)
[01:42:09]      + Framerate Shaper (mode=0)
[01:42:09]        + frame rate: same as source (around 23.976 fps)
[01:42:09]      + Crop and Scale (width=1920:height=1080:crop-top=0:crop-bottom=0:crop-left=0:crop-right=0)
[01:42:09]        + source: 1920 * 1080, crop (0/0/0/0): 1920 * 1080, scale: 1920 * 1080
[01:42:09]    + Output geometry
[01:42:09]      + storage dimensions: 1920 x 1080
[01:42:09]      + pixel aspect ratio: 1 : 1
[01:42:09]      + display dimensions: 1920 x 1080
[01:42:09]    + encoder: H.265 12-bit (libx265)
[01:42:09]      + preset:  fast
[01:42:09]      + profile: auto
[01:42:09]      + quality: 20.00 (RF)
[01:42:09]  * subtitle track 1, English [PGS] (track 0, id 0x1200, Picture) -> Passthrough
[01:42:09]  * subtitle track 2, English [PGS] (track 1, id 0x1201, Picture) -> Passthrough
[01:42:09]  * audio track 1
[01:42:09]    + decoder: English (TrueHD) (2.0 ch) (track 2, id 0x721100)
[01:42:09]      + bitrate: 200 kbps, samplerate: 48000 Hz
[01:42:09]    + mixdown: Stereo
[01:42:09]    + encoder: FLAC 24-bit (libavcodec)
[01:42:09]      + samplerate: 48000 Hz
[01:42:09]      + compression level: 5.00
[01:42:09]  * audio track 2
[01:42:09]    + decoder: ??? (TrueHD) (2.0 ch) (track 4, id 0x721101)
[01:42:09]      + bitrate: 200 kbps, samplerate: 48000 Hz
[01:42:09]    + mixdown: Stereo
[01:42:09]    + encoder: FLAC 24-bit (libavcodec)
[01:42:09]      + samplerate: 48000 Hz
[01:42:09]      + compression level: 5.00
[01:42:09] sync: expecting 19683 video frames
x265 [info]: HEVC encoder version 2.6
x265 [info]: build info [Windows][GCC 7.1.0][64 bit] 12bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX XOP FMA4 FMA3 BMI1
x265 [info]: Main 12 profile, Level-4 (Main tier)
x265 [info]: Thread pool created using 4 threads
x265 [info]: Slices                              : 1
x265 [info]: frame threads / pool features       : 2 / wpp(17 rows)
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : hex / 57 / 2 / 2
x265 [info]: Keyframe min / max / scenecut / bias: 24 / 240 / 40 / 5.00
x265 [info]: Lookahead / bframes / badapt        : 15 / 4 / 0
x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
x265 [info]: References / ref-limit  cu / depth  : 3 / on / on
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 1 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : CRF-20.0 / 0.60
x265 [info]: tools: rd=2 psy-rd=2.00 rskip signhide tmvp fast-intra
x265 [info]: tools: strong-intra-smoothing lslices=6 deblock sao
[01:42:09] sync: first pts audio 0x721100 is 0
[01:42:09] sync: first pts audio 0x721101 is 0
[01:42:09] sync: first pts video is 0
[01:42:09] sync: "Chapter 1" (1) at frame 1 time 0
[01:42:10] sync: first pts subtitle 0x1200 is 213963
[01:44:49] sync: first pts subtitle 0x1201 is 1884382
[01:57:32] sync: "Chapter 2" (2) at frame 2544 time 9545786
[03:09:40] sync: reached video frame 19683, exiting early
[03:09:40] sync: reached audio 0x721101 pts 74029800, exiting early
[03:09:40] sync: reached audio 0x721100 pts 74029875, exiting early
[03:10:14] work: average encoding speed for job is 3.746437 fps
[03:10:15] comb detect: heavy 29 | light 886 | uncombed 18768 | total 19683
[03:10:15] decomb: deinterlaced 29 | blended 886 | unfiltered 18768 | total 19683
[03:10:15] vfr: lost time: 0 (0 frames)
[03:10:15] vfr: gained time: 0 (0 frames) (0 not accounted for)
[03:10:15] stream: 23039 good frames, 0 errors (0%)
[03:10:15] truehd-decoder done: 1152811 frames, 0 decoder errors
[03:10:15] truehd-decoder done: 1152810 frames, 0 decoder errors
[03:10:15] h264-decoder done: 23034 frames, 0 decoder errors
[03:10:15] sync: got 19683 frames, 19683 expected
[03:10:15] sync: framerate min 23.981 fps, max 23.981 fps, avg 23.976 fps
x265 [info]: frame I:    257, Avg QP:15.19  kb/s: 10770.94
x265 [info]: frame P:   3991, Avg QP:16.57  kb/s: 4637.58
x265 [info]: frame B:  15435, Avg QP:22.72  kb/s: 1205.11
x265 [info]: Weighted P-Frames: Y:7.1% UV:5.2%
x265 [info]: consecutive B-frames: 7.1% 1.3% 1.5% 1.2% 88.9%
encoded 19683 frames in 5286.06s (3.72 fps), 2025.99 kb/s, Avg QP:21.37
[03:10:15] mux: track 0, 19683 frames, 207982310 bytes, 2022.75 kbps, fifo 1024
[03:10:15] mux: track 1, 8569 frames, 78693147 bytes, 765.34 kbps, fifo 512
[03:10:15] mux: track 2, 8569 frames, 82578628 bytes, 803.13 kbps, fifo 512
[03:10:15] mux: track 3, 339 frames, 3592576 bytes, 34.94 kbps, fifo 64
[03:10:15] mux: track 4, 28 frames, 411983 bytes, 4.01 kbps, fifo 16
[03:10:15] libhb: work result = 0

# Encode Completed ...

Deleted User 11865

Re: Odd behaviour in output after frame-accurate trim

Post by Deleted User 11865 »

Try playing the output in VLC?
Schmengie
Posts: 25
Joined: Wed Jan 17, 2018 8:39 am

Re: Odd behaviour in output after frame-accurate trim

Post by Schmengie »

I tried it in both JRiver and MPC-HC. I don't have VLC.
mduell
Veteran User
Posts: 8197
Joined: Sat Apr 21, 2007 8:54 pm

Re: Odd behaviour in output after frame-accurate trim

Post by mduell »

I hear it's free.
Schmengie
Posts: 25
Joined: Wed Jan 17, 2018 8:39 am

Re: Odd behaviour in output after frame-accurate trim

Post by Schmengie »

It is, but let me re-phrase: I don't need it. JRiver already plays and indexes everything. I have MPC-HC--which, to my knowledge, has basically the same capability as VLC--for only two reasons:
  • It has fairly robust seeking features--to include frame seeking, forwards and backwards--as well as a Go to... function that allows me to copy frame numbers to HandBrake.
  • It serves as a back-up player for testing play-back issues--though, again, I haven't run in to any instance in which MPC-HC could play something correctly where JRiver couldn't.
Schmengie
Posts: 25
Joined: Wed Jan 17, 2018 8:39 am

Re: Odd behaviour in output after frame-accurate trim

Post by Schmengie »

So I tried a different method:

I ripped the source via MakeMKV, used MKVToolNix to demux the TrueHD tracks, used the JRiver Media Center to convert them to FLAC, muxed them back in, and then used HandBrake to do the frame-accurate trimming and transcoding (with audio mode on both tracks set to Auto Passthru.

It seems to be working. No more unwanted audio data at the end. Frame-accurate is frame-accurate. Audio tracks are not silent after the fact, either.

Personally, I'm satisfied. Been trying to get this source to play nice for weeks. Still, I figured I'd bring it to your attention that there might be something off about your FLAC encoder. Using HandBrake directly to transcode the audio to FLAC (FLAC Passthru or 24-bit) results in silent audio tracks in this source and I'm not sure of why, much less of what the difference is between the encoder HandBrake uses and the one used by JRiver.
Post Reply