Transcoding closed captions to subtitles does not display properly when using handbrake 1.4.2

HandBrake for Mac 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
classicsandwich
Posts: 2
Joined: Sat Nov 20, 2021 1:14 am

Transcoding closed captions to subtitles does not display properly when using handbrake 1.4.2

Post by classicsandwich »

Description of problem or question:
I am using Mac OS 10.12.6 and have been using Handbrake 1.3.3 successfully to transcode EyeTV recordings.

I recently tried Handbrake 1.4.2 on the same system and it does not work similarly to Handbrake 1.3.3 in one way.

When using Handbrake 1.3.3 and viewing the output file on the computer using VLC or on my television's built-in media player, the subtitles generated from the closed captions in the recording are displayed when expected and for the expected amount of time.

When I tried using Handbrake 1.4.2, the closed caption subtitles are flashed very quickly, much too quickly to read before disappearing, again on both VLC and my TV's media player. I have provided the logs for the conversion of same sample file with the 2 different versions of handbrake below. This seems like a bug, but I am not sure if it may be caused by a setting in the new handbrake version that I could adjust.

Thanks for your ideas and input regarding fixing this issue.

Steps to reproduce the problem (If Applicable):
Use Handbrake to encode an EyeTV recording as described above.

HandBrake version:
1.3.3 vs 1.4.2

Operating system and version:
Mac OS 10.12.6

HandBrake Activity Logs

Activity Log from the working v1.3.3

Code: Select all

HandBrake Activity Log for Session: 2021-11-20T00:48:16Z
Handbrake Version: 1.3.3 (2020061300)
133 Clip.mkv
Preset: H.265 MKV 1080p30
[19:48:16] macgui: QueueCore scanning specifically for title: 1
[19:48:16] CPU: Intel(R) Core(TM) i5-3470S CPU @ 2.90GHz
[19:48:16]  - Intel microarchitecture Ivy Bridge
[19:48:16]  - logical processor count: 4
[19:48:16] hb_scan: path=/Users/Shared/EyeTV Archive/507 An Introduction to Engineering and a Glob of Hair Gel - Clip.eyetv/0000000027487d20.mpg, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
disc.c:323: failed opening UDF image /Users/Shared/EyeTV Archive/133 - Clip.eyetv/0000000027487d20.mpg
disc.c:424: error opening file BDMV/index.bdmv
disc.c:424: error opening file BDMV/BACKUP/index.bdmv
bluray.c:2585: nav_get_title_list(/Users/Shared/EyeTV Archive/133 - Clip.eyetv/0000000027487d20.mpg/) failed
[19:48:16] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 6.0.1
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed
libdvdread: Can't open file VIDEO_TS.IFO.
libdvdnav: vm: failed to read VIDEO_TS.IFO
[19:48:16] dvd: not a dvd - trying as a stream/file instead
[19:48:16] file is MPEG Transport Stream with 188 byte packets offset 0 bytes
[19:48:16] Found the following PIDS
[19:48:16]     Video PIDS : 
[19:48:16]       0x31 type MPEG2 (0x2) (PCR)
[19:48:16]     Audio PIDS : 
[19:48:16]       0x34 type AC3 (0x81)
[19:48:16]       0x35 type AC3 (0x81)
[19:48:16]     Subtitle PIDS : 
[19:48:16]     Other PIDS : 
[19:48:16] stream id 0x34 (type 0x81 substream 0x0) audio 0x34
[19:48:16] stream id 0x35 (type 0x81 substream 0x0) audio 0x35
[19:48:16] scan: decoding previews for title 1
[19:48:16] file is MPEG Transport Stream with 188 byte packets offset 0 bytes
[19:48:16] scan: audio 0x35: ac3, rate=48000Hz, bitrate=192000 español (AC3) (2.0 ch) (192 kbps)
[19:48:16] scan: audio 0x34: ac3, rate=48000Hz, bitrate=384000 English (AC3) (5.1 ch) (384 kbps)
[19:48:16] stream: 9 good frames, 0 errors (0%)
[19:48:16] scan: 10 previews, 1920x1080, 29.970 fps, autocrop = 2/0/0/0, aspect 16:9, PAR 1:1
[19:48:16] libhb: scan thread found 1 valid title(s)
[19:48:16] macgui: QueueCore scan done
[19:48:16] macgui: QueueCore started encoding 133 Clip.mkv
[19:48:16] macgui: QueueCore with preset H.265 MKV 1080p30
[19:48:16] Starting work at: Fri Nov 19 19:48:16 2021

[19:48:16] 1 job(s) to process
[19:48:16] Starting Task: Encoding Pass
[19:48:16] [ass] Shaper: FriBidi 1.0.7 (SIMPLE) HarfBuzz-ng 2.6.4 (COMPLEX)
[19:48:16] [ass] Using font provider coretext
[19:48:16] work: only 1 chapter, disabling chapter markers
[19:48:16] job configuration:
[19:48:16]  * source
[19:48:16]    + /Users/Shared/EyeTV Archive/133 - Clip.eyetv/0000000027487d20.mpg
[19:48:16]    + title 1, chapter(s) 1 to 1
[19:48:16]  * destination
[19:48:16]    + /Volumes/iMac22/bc-media/Movies/ new/133 Clip.mkv
[19:48:16]    + container: Matroska (libavformat)
[19:48:16]  * video track
[19:48:16]    + decoder: mpeg2video
[19:48:16]      + bitrate 200 kbps
[19:48:16]    + filters
[19:48:16]      + Comb Detect (mode=3:spatial-metric=2:motion-thresh=1:spatial-thresh=1:filter-mode=2:block-thresh=40:block-width=16:block-height=16)
[19:48:16]      + Decomb (mode=39)
[19:48:16]      + Framerate Shaper (mode=2:rate=27000000/900000)
[19:48:16]        + frame rate: 29.970 fps -> peak rate limited to 30.000 fps
[19:48:16]      + Subtitle renderer ()
[19:48:16]      + Crop and Scale (width=1920:height=1078:crop-top=2:crop-bottom=0:crop-left=0:crop-right=0)
[19:48:16]        + source: 1920 * 1080, crop (2/0/0/0): 1920 * 1078, scale: 1920 * 1078
[19:48:16]    + Output geometry
[19:48:16]      + storage dimensions: 1920 x 1078
[19:48:16]      + pixel aspect ratio: 1 : 1
[19:48:16]      + display dimensions: 1920 x 1078
[19:48:16]    + encoder: H.265 (libx265)
[19:48:16]      + preset:  slow
[19:48:16]      + options: strong-intra-smoothing=0:rect=0:aq-mode=1
[19:48:16]      + profile: main
[19:48:16]      + level:   auto
[19:48:16]      + quality: 22.00 (RF)
[19:48:16]      + color profile: 1-1-1
[19:48:16]  * subtitle track 1, English, Closed Caption [CC608] (track 0, id 0xfe000000, Text) -> Render/Burn-in
[19:48:16]  * audio track 1
[19:48:16]    + decoder: English (AC3) (5.1 ch) (384 kbps) (track 1, id 0x34)
[19:48:16]      + bitrate: 384 kbps, samplerate: 48000 Hz
[19:48:16]    + mixdown: Stereo
[19:48:16]    + dither: triangular
[19:48:16]    + encoder: AAC (Apple AudioToolbox)
[19:48:16]      + bitrate: 160 kbps, samplerate: 48000 Hz
[19:48:16] file is MPEG Transport Stream with 188 byte packets offset 0 bytes
[19:48:16] sync: expecting 1035 video frames
x265 [info]: HEVC encoder version 3.2.1+1-b5c86a64bbbe
x265 [info]: build info [Mac OS X][clang 11.0.3][64 bit] 8bit+10bit+12bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
x265 [info]: Main 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         : star / 57 / 3 / 3
x265 [info]: Keyframe min / max / scenecut / bias: 30 / 300 / 40 / 5.00
x265 [info]: Lookahead / bframes / badapt        : 25 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
x265 [info]: References / ref-limit  cu / depth  : 4 / on / on
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 1 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : CRF-22.0 / 0.60
x265 [info]: tools: limit-modes rd=4 psy-rd=2.00 rdoq=2 psy-rdoq=1.00 rskip
x265 [info]: tools: signhide tmvp lslices=4 deblock sao
[19:48:17] sync: first pts audio 0x34 is 0
[19:48:17] sync: first pts video is 47016
[19:48:17] sync: first pts subtitle 0xfe000000 is 71040
[19:48:17] [ass] fontselect: (monospace, 400, 0) -> /System/Library/Fonts/Courier.dfont, -1, Courier
[19:51:12] hb_ts_stream_decode - eof
[19:51:12] hb_ts_stream_decode - eof
[19:51:12] reader: done. 1 scr changes
[19:51:42] work: average encoding speed for job is 5.474250 fps
[19:51:42] comb detect: heavy 700 | light 167 | uncombed 166 | total 1033
[19:51:42] decomb: deinterlaced 700 | blended 167 | unfiltered 166 | total 1033
[19:51:42] vfr: 1033 frames output, 0 dropped and 0 duped for CFR/PFR
[19:51:42] vfr: lost time: 0 (0 frames)
[19:51:42] vfr: gained time: 0 (0 frames) (0 not accounted for)
[19:51:43] stream: 1033 good frames, 0 errors (0%)
[19:51:43] ac3-decoder done: 1070 frames, 0 decoder errors
[19:51:43] mpeg2video-decoder done: 1033 frames, 0 decoder errors
[19:51:43] sync: got 1033 frames, 1035 expected
[19:51:43] sync: framerate min 29.970 fps, max 29.970 fps, avg 29.970 fps
x265 [info]: frame I:      4, Avg QP:19.88  kb/s: 16754.87
x265 [info]: frame P:    257, Avg QP:21.41  kb/s: 5859.55 
x265 [info]: frame B:    772, Avg QP:26.20  kb/s: 838.19  
x265 [info]: Weighted P-Frames: Y:0.0% UV:0.0%
x265 [info]: consecutive B-frames: 1.9% 0.0% 36.8% 23.0% 38.3% 

encoded 1033 frames in 206.10s (5.01 fps), 2149.09 kb/s, Avg QP:24.98
[19:51:43] mux: track 0, 1033 frames, 9263414 bytes, 2117.25 kbps, fifo 2048
[19:51:43] mux: track 1, 1608 frames, 640073 bytes, 146.30 kbps, fifo 2048
[19:51:43] Finished work at: Fri Nov 19 19:51:43 2021

[19:51:43] libhb: work result = 0
[19:51:43] macgui: QueueCore work done
Activity Log from the malfunctioning v1.4.2

Code: Select all

HandBrake Activity Log for Session: 2021-11-20T00:52:40Z
Handbrake Version: 1.4.2 (2021100300)
142 Clip.mkv
Preset: H.265 MKV 1080p30
[19:52:40] macgui: fr.handbrake.HandBrakeXPCService scanning specifically for title: 1
[19:52:40] CPU: Intel(R) Core(TM) i5-3470S CPU @ 2.90GHz
[19:52:40]  - Intel microarchitecture Ivy Bridge
[19:52:40]  - logical processor count: 4
[19:52:40] hb_scan: path=/Users/Shared/EyeTV Archive/142- Clip.eyetv/0000000027487d20.mpg, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
disc.c:333: failed opening UDF image /Users/Shared/EyeTV Archive/142 - Clip.eyetv/0000000027487d20.mpg
disc.c:437: error opening file BDMV/index.bdmv
disc.c:437: error opening file BDMV/BACKUP/index.bdmv
bluray.c:2646: nav_get_title_list(/Users/Shared/EyeTV Archive/142 - Clip.eyetv/0000000027487d20.mpg/) failed
[19:52:40] bd: not a bd - trying as a stream/file instead
libdvdread: DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdnav: vm: vm: failed to read VIDEO_TS.IFO
[19:52:40] dvd: not a dvd - trying as a stream/file instead
[19:52:40] file is MPEG Transport Stream with 188 byte packets offset 0 bytes
[19:52:40] Found the following PIDS
[19:52:40]     Video PIDS : 
[19:52:40]       0x31 type MPEG2 (0x2) (PCR)
[19:52:40]     Audio PIDS : 
[19:52:40]       0x34 type AC3 (0x81)
[19:52:40]       0x35 type AC3 (0x81)
[19:52:40]     Subtitle PIDS : 
[19:52:40]     Other PIDS : 
[19:52:40] stream id 0x34 (type 0x81 substream 0x0) audio 0x34
[19:52:40] stream id 0x35 (type 0x81 substream 0x0) audio 0x35
[19:52:40] scan: decoding previews for title 1
[19:52:40] file is MPEG Transport Stream with 188 byte packets offset 0 bytes
[19:52:40] scan: audio 0x35: ac3, rate=48000Hz, bitrate=192000 español (AC3) (2.0 ch) (192 kbps)
[19:52:40] scan: audio 0x34: ac3, rate=48000Hz, bitrate=384000 English (AC3) (5.1 ch) (384 kbps)
[19:52:40] stream: 9 good frames, 0 errors (0%)
[19:52:40] scan: 10 previews, 1920x1080, 29.970 fps, autocrop = 2/0/0/0, aspect 16:9, PAR 1:1, color profile: 1-1-1
[19:52:40] libhb: scan thread found 1 valid title(s)
[19:52:40] macgui: fr.handbrake.HandBrakeXPCService scan done
[19:52:40] macgui: fr.handbrake.HandBrakeXPCService started encoding 142 Clip.mkv
[19:52:40] macgui: fr.handbrake.HandBrakeXPCService with preset H.265 MKV 1080p30
[19:52:40] Starting work at: Fri Nov 19 19:52:40 2021

[19:52:40] 1 job(s) to process
[19:52:40] Starting Task: Encoding Pass
[19:52:40] [ass] libass API version: 0x1501000
[19:52:40] [ass] libass source: tarball: 0.15.1
[19:52:40] [ass] Shaper: FriBidi 1.0.10 (SIMPLE) HarfBuzz-ng 2.8.1 (COMPLEX)
[19:52:40] [ass] Using font provider coretext
[19:52:40] work: only 1 chapter, disabling chapter markers
[19:52:40] job configuration:
[19:52:40]  * source
[19:52:40]    + /Users/Shared/EyeTV Archive/142 - Clip.eyetv/0000000027487d20.mpg
[19:52:40]    + title 1, chapter(s) 1 to 1
[19:52:40]  * destination
[19:52:40]    + /Volumes/iMac22/bc-media/Movies/ new/142 - Clip.mkv
[19:52:40]    + container: Matroska (libavformat)
[19:52:40]  * video track
[19:52:40]    + decoder: mpeg2video 8-bit (yuv420p)
[19:52:40]      + bitrate 200 kbps
[19:52:40]    + filters
[19:52:40]      + Comb Detect (mode=3:spatial-metric=2:motion-thresh=1:spatial-thresh=1:filter-mode=2:block-thresh=40:block-width=16:block-height=16)
[19:52:40]      + Decomb (mode=39)
[19:52:40]      + Framerate Shaper (mode=2:rate=27000000/900000)
[19:52:40]        + frame rate: 29.970 fps -> peak rate limited to 30.000 fps
[19:52:40]      + Subtitle renderer ()
[19:52:40]      + Crop and Scale (width=1920:height=1078:crop-top=2:crop-bottom=0:crop-left=0:crop-right=0)
[19:52:40]        + source: 1920 * 1080, crop (2/0/0/0): 1920 * 1078, scale: 1920 * 1078
[19:52:40]    + Output geometry
[19:52:40]      + storage dimensions: 1920 x 1078
[19:52:40]      + pixel aspect ratio: 1 : 1
[19:52:40]      + display dimensions: 1920 x 1078
[19:52:40]    + encoder: H.265 (libx265)
[19:52:40]      + preset:  slow
[19:52:40]      + options: strong-intra-smoothing=0:rect=0:aq-mode=1
[19:52:40]      + profile: main
[19:52:40]      + level:   auto
[19:52:40]      + quality: 22.00 (RF)
[19:52:40]      + color profile: 1-1-1
[19:52:40]  * subtitle track 1, English, Closed Caption [CC608] (track 0, id 0xfe000000, Text) -> Render/Burn-in
[19:52:40]  * audio track 1
[19:52:40]    + decoder: English (AC3) (5.1 ch) (384 kbps) (track 1, id 0x34)
[19:52:40]      + bitrate: 384 kbps, samplerate: 48000 Hz
[19:52:40]    + mixdown: Stereo
[19:52:40]    + encoder: AAC (Apple AudioToolbox)
[19:52:40]      + bitrate: 160 kbps, samplerate: 48000 Hz
[19:52:40] file is MPEG Transport Stream with 188 byte packets offset 0 bytes
[19:52:40] sync: expecting 1035 video frames
x265 [info]: HEVC encoder version 3.5+1-f0c1022b6
x265 [info]: build info [Mac OS X][clang 13.0.0][64 bit] 8bit+10bit+12bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
x265 [info]: Main 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         : star / 57 / 3 / 3
x265 [info]: Keyframe min / max / scenecut / bias  : 30 / 300 / 40 / 5.00 
x265 [info]: Lookahead / bframes / badapt        : 25 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
x265 [info]: References / ref-limit  cu / depth  : 4 / on / on
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 1 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : CRF-22.0 / 0.60
x265 [info]: tools: limit-modes rd=4 psy-rd=2.00 rdoq=2 psy-rdoq=1.00
x265 [info]: tools: rskip mode=1 signhide tmvp lslices=4 deblock sao
[19:52:40] sync: first pts audio 0x34 is 0
[19:52:40] sync: first pts video is 47016
[19:52:40] sync: first pts subtitle 0xfe000000 is 47016
[19:52:44] [ass] fontselect: (monospace, 400, 0) -> /System/Library/Fonts/Courier.dfont, -1, Courier
[19:55:39] hb_ts_stream_decode - eof
[19:55:39] hb_ts_stream_decode - eof
[19:55:39] reader: done. 1 scr changes
[19:56:09] work: average encoding speed for job is 5.386065 fps
[19:56:09] comb detect: heavy 700 | light 167 | uncombed 166 | total 1033
[19:56:09] decomb: deinterlaced 700 | blended 167 | unfiltered 166 | total 1033
[19:56:09] vfr: 1033 frames output, 0 dropped and 0 duped for CFR/PFR
[19:56:09] vfr: lost time: 0 (0 frames)
[19:56:09] vfr: gained time: 0 (0 frames) (0 not accounted for)
[19:56:09] stream: 1033 good frames, 0 errors (0%)
[19:56:09] ac3-decoder done: 1070 frames, 0 decoder errors
[19:56:09] mpeg2video-decoder done: 1033 frames, 0 decoder errors
[19:56:09] sync: got 1033 frames, 1035 expected
[19:56:09] sync: framerate min 29.970 fps, max 29.970 fps, avg 29.970 fps
x265 [info]: frame I:     12, Avg QP:19.72  kb/s: 16475.02
x265 [info]: frame P:    266, Avg QP:21.42  kb/s: 5485.40 
x265 [info]: frame B:    755, Avg QP:26.11  kb/s: 826.83  
x265 [info]: Weighted P-Frames: Y:0.0% UV:0.0%
x265 [info]: consecutive B-frames: 6.5% 1.4% 39.2% 19.8% 33.1% 

encoded 1033 frames in 208.90s (4.94 fps), 2208.20 kb/s, Avg QP:24.83
[19:56:09] mux: track 0, 1033 frames, 9518098 bytes, 2175.46 kbps, fifo 2048
[19:56:09] mux: track 1, 1608 frames, 640073 bytes, 146.30 kbps, fifo 2048
[19:56:09] Finished work at: Fri Nov 19 19:56:09 2021

[19:56:09] libhb: work result = 0
[19:56:10] macgui: fr.handbrake.HandBrakeXPCService work done
Woodstock
Veteran User
Posts: 4614
Joined: Tue Aug 27, 2013 6:39 am

Re: Transcoding closed captions to subtitles does not display properly when using handbrake 1.4.2

Post by Woodstock »

Since you've asked handbrake to burn the subtitles in in both cases, the viewing app does not matter; they're part of the video.

There seems to be a difference in how parts of the CC track are interpreted.

This would appear to apply, even though you're burning in instead of passing through: https://github.com/HandBrake/HandBrake/issues/3764

If you could try the encode with a current nightly build, you could confirm that.
classicsandwich
Posts: 2
Joined: Sat Nov 20, 2021 1:14 am

Re: Transcoding closed captions to subtitles does not display properly when using handbrake 1.4.2

Post by classicsandwich »

Thanks for the feedback. I tried to use HandBrake-20211118215516-d7940f556-master.dmg
but it will not run on MacOS 10.12. I guess the best option for me is to stick with version 1.3.3.
Woodstock
Veteran User
Posts: 4614
Joined: Tue Aug 27, 2013 6:39 am

Re: Transcoding closed captions to subtitles does not display properly when using handbrake 1.4.2

Post by Woodstock »

Actually, I jumped the gun on this - #3764 is still open, and the nightly does not have a fix for it yet. I seem to recall from a different issue was a change upstream to the subtitle rendering code.

The current work-around is to use ccextractor to pull the CC out into an SRT file, which can then be processed by handbrake as part of the encode.

But, using 1.3.3 would be simpler!
Post Reply