HandBrake / HandBrake

HandBrake's main development repository
https://handbrake.fr
Other
17.77k stars 1.34k forks source link

Subtitles utterly broken (handbrake 1.4.2) #4029

Closed Sargastic closed 1 year ago

Sargastic commented 2 years ago

Problem Description

When requesting subtitles (whatever type), the resulting file displays « unsynchronized » subtitles, completely out of phase with the actors' speaking. The subtitles are displayed almost without pause. If you jump somewhere in the movie, the subtitles are initially properly synched but, as previously written, are displayed without regard to the actors' (not) speaking. So they get desynch'd pretty fast.

This problem arises with handbrake 1.4.2, but not 1.3.3, on several machines.

Activity Log, Crash Log or any other details

Activity Log for 1.4.2
----------------------
[18:34:45] gtkgui: HandBrake 1.4.2 (2021121600) - Linux x86_64 - https://handbrake.fr
[18:34:45] Compile-time hardening features are enabled
[18:34:45] hb_init: starting libhb thread
[18:34:45] hb_init: starting libhb thread
[18:34:45] hb_init: starting libhb thread
[18:34:58] CPU: Intel(R) Core(TM) i5-4210M CPU @ 2.60GHz
[18:34:58]  - Intel microarchitecture Haswell
[18:34:58]  - logical processor count: 4
[18:34:58] hb_scan: path=/dev/sr0, title_index=0
disc.c:333: failed opening UDF image /dev/sr0
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(/dev/sr0/) failed
[18:34:58] bd: not a bd - trying as a stream/file instead
libdvdread: Could not open /dev/sr0 with libdvdcss.
libdvdread: Can't open /dev/sr0 for reading
libdvdnav: vm: failed to open/read the DVD
[18:34:59] dvd: not a dvd - trying as a stream/file instead
[18:34:59] hb_stream_open: open /dev/sr0 failed
[18:34:59] scan: unrecognized file type
[18:34:59] libhb: scan thread found 0 valid title(s)
[18:35:16] CPU: Intel(R) Core(TM) i5-4210M CPU @ 2.60GHz
[18:35:16]  - Intel microarchitecture Haswell
[18:35:16]  - logical processor count: 4
[18:35:16] hb_scan: path=/dev/sr0, title_index=0
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((null)) failed
[18:35:16] bd: not a bd - trying as a stream/file instead
[18:35:16] dvd: Region mask 0xff
[18:35:16] dvd: Warning, DVD device has no region set
[18:35:17] scan: DVD has 6 title(s)
[18:35:17] scan: scanning title 1
[18:35:17] scan: duration is 01:54:36 (6876800 ms)
[18:35:17] pgc_id: 1, pgn: 1: pgc: 0x7f5bcc061a20
[18:35:17] scan: checking audio 1
[18:35:17] scan: id=0x80bd, lang=Francais (AC3), 3cc=fra ext=0
[18:35:17] scan: checking audio 2
[18:35:17] scan: id=0x81bd, lang=English (AC3), 3cc=eng ext=0
[18:35:17] scan: checking subtitle 1
[18:35:17] scan: id=0x20bd, lang=Francais (Wide Screen) [VOBSUB], 3cc=fra ext=0
[18:35:17] scan: checking subtitle 2
[18:35:17] scan: id=0x21bd, lang=Nederlands (Wide Screen) [VOBSUB], 3cc=nld ext=0
[18:35:17] scan: title 1 has 14 chapters
[18:35:17] scan: chap 1, 552640 ms
[18:35:17] scan: chap 2, 574680 ms
[18:35:17] scan: chap 3, 664920 ms
[18:35:17] scan: chap 4, 566680 ms
[18:35:17] scan: chap 5, 394240 ms
[18:35:17] scan: chap 6, 596160 ms
[18:35:17] scan: chap 7, 584600 ms
[18:35:17] scan: chap 8, 428360 ms
[18:35:17] scan: chap 9, 787720 ms
[18:35:17] scan: chap 10, 426040 ms
[18:35:17] scan: chap 11, 750120 ms
[18:35:17] scan: chap 12, 542520 ms
[18:35:17] scan: chap 13, 7120 ms
[18:35:17] scan: chap 14, 1000 ms
[18:35:17] scan: aspect = 16:9
[18:35:17] scan: scanning title 2
[18:35:17] scan: duration is 00:05:13 (313000 ms)
[18:35:17] pgc_id: 1, pgn: 1: pgc: 0x7f5bcc063370
[18:35:17] scan: checking audio 1
[18:35:17] scan: id=0x80bd, lang=English (AC3), 3cc=eng ext=0
[18:35:17] scan: checking subtitle 1
[18:35:17] scan: id=0x20bd, lang=Francais (4:3) [VOBSUB], 3cc=fra ext=0
[18:35:17] scan: checking subtitle 2
[18:35:17] scan: id=0x21bd, lang=Nederlands (4:3) [VOBSUB], 3cc=nld ext=0
[18:35:17] scan: title 2 has 3 chapters
[18:35:17] scan: chap 1, 1000 ms
[18:35:17] scan: chap 2, 311000 ms
[18:35:17] scan: chap 3, 1000 ms
[18:35:17] scan: aspect = 4:3
[18:35:17] scan: scanning title 3
[18:35:21] scan: duration is 00:00:33 (33040 ms)
[18:35:21] pgc_id: 1, pgn: 1: pgc: 0x7f5bcc063a10
[18:35:21] scan: checking audio 1
[18:35:21] scan: id=0x80bd, lang=Unknown (AC3), 3cc=und ext=0
[18:35:21] scan: title 3 has 3 chapters
[18:35:21] scan: chap 1, 21040 ms
[18:35:21] scan: chap 2, 11000 ms
[18:35:21] scan: chap 3, 1000 ms
[18:35:21] scan: aspect = 16:9
[18:35:21] scan: scanning title 4
[18:35:21] scan: duration is 00:00:41 (41040 ms)
[18:35:21] pgc_id: 2, pgn: 1: pgc: 0x7f5bcc074c20
[18:35:21] scan: checking audio 1
[18:35:21] scan: id=0x80bd, lang=Unknown (AC3), 3cc=und ext=0
[18:35:21] scan: title 4 has 4 chapters
[18:35:21] scan: chap 1, 9000 ms
[18:35:21] scan: chap 2, 21040 ms
[18:35:21] scan: chap 3, 10000 ms
[18:35:21] scan: chap 4, 1000 ms
[18:35:21] scan: aspect = 16:9
[18:35:21] scan: scanning title 5
[18:35:21] scan: duration is 00:03:23 (203000 ms)
[18:35:21] pgc_id: 3, pgn: 1: pgc: 0x7f5bcc065310
[18:35:21] scan: checking audio 1
[18:35:21] scan: id=0x80bd, lang=Unknown (AC3), 3cc=und ext=0
[18:35:21] scan: title 5 has 2 chapters
[18:35:21] scan: chap 1, 202000 ms
[18:35:21] scan: chap 2, 1000 ms
[18:35:21] scan: aspect = 16:9
[18:35:21] scan: scanning title 6
[18:35:22] scan: duration is 00:00:30 (30440 ms)
[18:35:22] pgc_id: 1, pgn: 1: pgc: 0x7f5bcc065fd0
[18:35:22] scan: checking audio 1
[18:35:22] scan: id=0x80bd, lang=Unknown (AC3), 3cc=und ext=0
[18:35:22] scan: title 6 has 2 chapters
[18:35:22] scan: chap 1, 29440 ms
[18:35:22] scan: chap 2, 1000 ms
[18:35:22] scan: aspect = 16:9
[18:35:24] scan: decoding previews for title 1
[18:35:24] scan: title angle(s) 1
[18:35:24] scan: audio 0x80bd: ac3, rate=48000Hz, bitrate=192000 Francais (AC3) (2.0 ch) (192 kbps)
[18:35:24] scan: audio 0x81bd: ac3, rate=48000Hz, bitrate=192000 English (AC3) (2.0 ch) (192 kbps)
[18:35:28] scan: 10 previews, 720x576, 25.000 fps, autocrop = 12/12/0/0, aspect 16:9, PAR 64:45, color profile: 5-1-6
[18:35:28] scan: decoding previews for title 2
[18:35:28] scan: title angle(s) 1
[18:35:28] scan: audio 0x80bd: ac3, rate=48000Hz, bitrate=192000 English (AC3) (2.0 ch) (192 kbps)
[18:35:29] scan: 10 previews, 720x576, 25.000 fps, autocrop = 78/78/10/8, aspect 4:3, PAR 16:15, color profile: 5-1-6
[18:35:29] scan: decoding previews for title 3
[18:35:29] scan: title angle(s) 1
[18:35:30] scan: audio 0x80bd: ac3, rate=48000Hz, bitrate=192000 Unknown (AC3) (2.0 ch) (192 kbps)
[18:35:31] scan: 10 previews, 720x576, 25.000 fps, autocrop = 14/14/2/0, aspect 16:9, PAR 64:45, color profile: 5-1-6
[18:35:31] scan: decoding previews for title 4
[18:35:31] scan: title angle(s) 1
[18:35:31] scan: audio 0x80bd: ac3, rate=48000Hz, bitrate=192000 Unknown (AC3) (2.0 ch) (192 kbps)
[18:35:32] scan: 10 previews, 720x576, 25.000 fps, autocrop = 14/14/2/0, aspect 16:9, PAR 64:45, color profile: 5-1-6
[18:35:32] scan: decoding previews for title 5
[18:35:32] scan: title angle(s) 1
[18:35:32] scan: audio 0x80bd: ac3, rate=48000Hz, bitrate=192000 Unknown (AC3) (2.0 ch) (192 kbps)
[18:35:34] scan: 10 previews, 720x576, 25.000 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 64:45, color profile: 5-1-6
[18:35:34] scan: decoding previews for title 6
[18:35:34] scan: title angle(s) 1
[18:35:34] scan: audio 0x80bd: ac3, rate=48000Hz, bitrate=224000 Unknown (AC3) (2.0 ch) (224 kbps)
[18:35:36] scan: 10 previews, 720x576, 25.000 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 64:45, color profile: 5-1-6
[18:35:36] libhb: scan thread found 6 valid title(s)
[18:35:36] decomb: deinterlaced 1 | blended 0 | unfiltered 0 | total 1
[18:35:36] decomb: deinterlaced 1 | blended 0 | unfiltered 0 | total 1
[swscaler @ 0x55d41f8d1630] Warning: data is not aligned! This can lead to a speed loss
[18:35:40] decomb: deinterlaced 1 | blended 0 | unfiltered 0 | total 1
[18:35:40] decomb: deinterlaced 1 | blended 0 | unfiltered 0 | total 1
[18:35:51] gtkgui: Preset: /General/Fast 1080p30
[18:35:51] Starting work at: Thu Dec 16 18:35:51 2021

[18:35:51] 1 job(s) to process
[18:35:51] json job:
{
    "Audio": {
        "AudioList": [
            {
                "Bitrate": 160,
                "CompressionLevel": -1.0,
                "DRC": 0.0,
                "DitherMethod": "auto",
                "Encoder": "fdk_aac",
                "Gain": 0.0,
                "Mixdown": "stereo",
                "NormalizeMixLevel": false,
                "PresetEncoder": "fdk_aac",
                "Quality": -3.0,
                "Samplerate": 0,
                "Track": 0
            }
        ],
        "CopyMask": [
            "copy:aac"
        ],
        "FallbackEncoder": "fdk_aac"
    },
    "Destination": {
        "AlignAVStart": true,
        "ChapterList": [
            {
                "Duration": {
                    "Hours": 0,
                    "Minutes": 0,
                    "Seconds": 1,
                    "Ticks": 90000
                },
                "Name": "Chapter 1"
            },
            {
                "Duration": {
                    "Hours": 0,
                    "Minutes": 5,
                    "Seconds": 11,
                    "Ticks": 27990000
                },
                "Name": "Chapter 2"
            },
            {
                "Duration": {
                    "Hours": 0,
                    "Minutes": 0,
                    "Seconds": 1,
                    "Ticks": 90000
                },
                "Name": "Chapter 3"
            }
        ],
        "ChapterMarkers": true,
        "File": "Redacted.mp4",
        "InlineParameterSets": false,
        "Mp4Options": {
            "IpodAtom": false,
            "Mp4Optimize": false
        },
        "Mux": "m4v"
    },
    "Filters": {
        "FilterList": [
            {
                "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": 4,
                "Settings": {
                    "mode": "7"
                }
            },
            {
                "ID": 6,
                "Settings": {
                    "mode": 2,
                    "rate": "27000000/900000"
                }
            },
            {
                "ID": 13,
                "Settings": {
                    "crop-bottom": 78,
                    "crop-left": 10,
                    "crop-right": 8,
                    "crop-top": 78,
                    "height": 420,
                    "width": 702
                }
            }
        ]
    },
    "Metadata": {
        "Name": "Redacted"
    },
    "PAR": {
        "Den": 15,
        "Num": 16
    },
    "SequenceID": 0,
    "Source": {
        "Angle": 0,
        "Path": "/dev/sr0",
        "Range": {
            "End": 3,
            "Start": 1,
            "Type": "chapter"
        },
        "Title": 2
    },
    "Subtitle": {
        "Search": {
            "Burn": true,
            "Default": false,
            "Enable": false,
            "Forced": true
        },
        "SubtitleList": [
            {
                "Burn": false,
                "Default": false,
                "Forced": false,
                "Offset": 0,
                "Track": 0
            }
        ]
    },
    "Video": {
        "ColorInputFormat": 0,
        "ColorMatrix": 6,
        "ColorOutputFormat": 0,
        "ColorPrimaries": 5,
        "ColorRange": 1,
        "ColorTransfer": 1,
        "Encoder": "x264",
        "Level": "4.0",
        "Options": "",
        "Preset": "fast",
        "Profile": "main",
        "QSV": {
            "AdapterIndex": 0,
            "AsyncDepth": 0,
            "Decode": false
        },
        "Quality": 22.0,
        "Tune": "",
        "Turbo": false,
        "TwoPass": false
    }
}
[18:35:51] CPU: Intel(R) Core(TM) i5-4210M CPU @ 2.60GHz
[18:35:51]  - Intel microarchitecture Haswell
[18:35:51]  - logical processor count: 4
[18:35:51] hb_scan: path=/dev/sr0, title_index=2
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((null)) failed
[18:35:51] bd: not a bd - trying as a stream/file instead
[18:35:51] dvd: Region mask 0xff
[18:35:51] dvd: Warning, DVD device has no region set
[18:35:51] scan: DVD has 6 title(s)
[18:35:51] scan: scanning title 2
[18:35:52] scan: duration is 00:05:13 (313000 ms)
[18:35:52] pgc_id: 1, pgn: 1: pgc: 0x7f5bb001f190
[18:35:52] scan: checking audio 1
[18:35:52] scan: id=0x80bd, lang=English (AC3), 3cc=eng ext=0
[18:35:52] scan: checking subtitle 1
[18:35:52] scan: id=0x20bd, lang=Francais (4:3) [VOBSUB], 3cc=fra ext=0
[18:35:52] scan: checking subtitle 2
[18:35:52] scan: id=0x21bd, lang=Nederlands (4:3) [VOBSUB], 3cc=nld ext=0
[18:35:52] scan: title 2 has 3 chapters
[18:35:52] scan: chap 1, 1000 ms
[18:35:52] scan: chap 2, 311000 ms
[18:35:52] scan: chap 3, 1000 ms
[18:35:52] scan: aspect = 4:3
[18:35:52] scan: decoding previews for title 2
[18:35:52] scan: title angle(s) 1
[18:35:52] scan: audio 0x80bd: ac3, rate=48000Hz, bitrate=192000 English (AC3) (2.0 ch) (192 kbps)
[18:35:54] scan: 10 previews, 720x576, 25.000 fps, autocrop = 78/78/10/8, aspect 4:3, PAR 16:15, color profile: 5-1-6
[18:35:54] libhb: scan thread found 1 valid title(s)
[18:35:54] Starting Task: Encoding Pass
[18:35:54] job configuration:
[18:35:54]  * source
[18:35:54]    + /dev/sr0
[18:35:54]    + title 2, chapter(s) 1 to 3
[18:35:54]  * destination
[18:35:54]    + Redacted.mp4
[18:35:54]    + container: MPEG-4 (libavformat)
[18:35:54]      + align initial A/V stream timestamps
[18:35:54]      + chapter markers
[18:35:54]  * video track
[18:35:54]    + decoder: mpeg2video 8-bit (yuv420p)
[18:35:54]      + bitrate 200 kbps
[18:35:54]    + filters
[18:35:54]      + 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)
[18:35:54]      + Decomb (mode=39)
[18:35:54]      + Framerate Shaper (mode=2:rate=27000000/900000)
[18:35:54]        + frame rate: 25.000 fps -> peak rate limited to 30.000 fps
[18:35:54]      + Crop and Scale (width=702:height=420:crop-top=78:crop-bottom=78:crop-left=10:crop-right=8)
[18:35:54]        + source: 720 * 576, crop (78/78/10/8): 702 * 420, scale: 702 * 420
[18:35:54]    + Output geometry
[18:35:54]      + storage dimensions: 702 x 420
[18:35:54]      + pixel aspect ratio: 16 : 15
[18:35:54]      + display dimensions: 748 x 420
[18:35:54]    + encoder: H.264 (libx264)
[18:35:54]      + preset:  fast
[18:35:54]      + profile: main
[18:35:54]      + level:   4.0
[18:35:54]      + quality: 22.00 (RF)
[18:35:54]      + color profile: 5-1-6
[18:35:54]  * subtitle track 1, Francais (4:3) [VOBSUB] (track 0, id 0x20bd, Picture) -> Passthrough
[18:35:54]  * audio track 1
[18:35:54]    + decoder: English (AC3) (2.0 ch) (192 kbps) (track 1, id 0x80bd)
[18:35:54]      + bitrate: 192 kbps, samplerate: 48000 Hz
[18:35:54]    + mixdown: Stereo
[18:35:54]    + encoder: AAC (libfdk_aac)
[18:35:54]      + bitrate: 160 kbps, samplerate: 48000 Hz
[18:35:54] dvd: Region mask 0xff
[18:35:54] dvd: Warning, DVD device has no region set
[18:35:55] sync: expecting 7825 video frames
[18:35:55] encx264: encoding at constant RF 22.000000
[18:35:55] encx264: unparsed options: level=4.0:ref=2:8x8dct=0:weightp=1:subme=6:vbv-bufsize=25000:vbv-maxrate=20000:rc-lookahead=30
x264 [info]: using SAR=16/15
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x264 [info]: profile Main, level 4.0, 4:2:0, 8-bit
[18:35:55] [warning] decavsub: track 1, invalid PTS
[18:35:55] sync: first pts video is 0
[18:35:55] sync: "Chapter 1" (1) at frame 25 time 0
[18:35:55] sync: first pts audio 0x80bd is 0
[18:35:55] sync: "Chapter 2" (2) at frame 26 time 3600
[18:35:55] 0.080000s: Film -> Video
[18:35:57] [warning] decavsub: track 1, invalid PTS
[18:35:57] sync: first pts subtitle 0x20bd is 183600
[18:35:57] [warning] decavsub: track 1, invalid PTS
[18:35:58] [warning] decavsub: track 1, invalid PTS
[18:35:59] [warning] decavsub: track 1, invalid PTS
[18:36:00] [warning] decavsub: track 1, invalid PTS
[18:36:02] [warning] decavsub: track 1, invalid PTS
[18:36:03] [warning] decavsub: track 1, invalid PTS
[18:36:04] [warning] decavsub: track 1, invalid PTS
[18:36:05] [warning] decavsub: track 1, invalid PTS
[18:36:06] [warning] decavsub: track 1, invalid PTS
[18:36:08] [warning] decavsub: track 1, invalid PTS
[18:36:09] [warning] decavsub: track 1, invalid PTS
[18:36:10] [warning] decavsub: track 1, invalid PTS
[18:36:11] [warning] decavsub: track 1, invalid PTS
[18:36:12] [warning] decavsub: track 1, invalid PTS
[18:36:14] [warning] decavsub: track 1, invalid PTS
[18:36:14] [warning] decavsub: track 1, invalid PTS
[18:36:16] [warning] decavsub: track 1, invalid PTS
[18:36:17] [warning] decavsub: track 1, invalid PTS
[18:36:18] [warning] decavsub: track 1, invalid PTS
[18:36:19] [warning] decavsub: track 1, invalid PTS
[18:36:20] [warning] decavsub: track 1, invalid PTS
[18:36:21] [warning] decavsub: track 1, invalid PTS
[18:36:21] [warning] decavsub: track 1, invalid PTS
[18:36:23] [warning] decavsub: track 1, invalid PTS
[18:36:24] [warning] decavsub: track 1, invalid PTS
[18:36:25] [warning] decavsub: track 1, invalid PTS
[18:36:26] [warning] decavsub: track 1, invalid PTS
[18:36:27] [warning] decavsub: track 1, invalid PTS
[18:36:28] [warning] decavsub: track 1, invalid PTS
[18:36:29] [warning] decavsub: track 1, invalid PTS
[18:36:30] [warning] decavsub: track 1, invalid PTS
[18:36:31] [warning] decavsub: track 1, invalid PTS
[18:36:32] [warning] decavsub: track 1, invalid PTS
[18:36:33] [warning] decavsub: track 1, invalid PTS
[18:36:34] [warning] decavsub: track 1, invalid PTS
[18:36:35] [warning] decavsub: track 1, invalid PTS
[18:36:36] [warning] decavsub: track 1, invalid PTS
[18:36:37] [warning] decavsub: track 1, invalid PTS
[18:36:38] [warning] decavsub: track 1, invalid PTS
[18:36:39] [warning] decavsub: track 1, invalid PTS
[18:36:41] [warning] decavsub: track 1, invalid PTS
[18:36:42] [warning] decavsub: track 1, invalid PTS
[18:36:43] [warning] decavsub: track 1, invalid PTS
[18:36:44] [warning] decavsub: track 1, invalid PTS
[18:36:45] [warning] decavsub: track 1, invalid PTS
[18:36:46] [warning] decavsub: track 1, invalid PTS
[18:36:47] [warning] decavsub: track 1, invalid PTS
[18:36:48] [warning] decavsub: track 1, invalid PTS
[18:36:48] [warning] decavsub: track 1, invalid PTS
[18:36:50] [warning] decavsub: track 1, invalid PTS
[18:36:51] [warning] decavsub: track 1, invalid PTS
[18:36:52] [warning] decavsub: track 1, invalid PTS
[18:36:53] [warning] decavsub: track 1, invalid PTS
[18:36:54] [warning] decavsub: track 1, invalid PTS
[18:36:56] [warning] decavsub: track 1, invalid PTS
[18:36:56] [warning] decavsub: track 1, invalid PTS
[18:36:57] [warning] decavsub: track 1, invalid PTS
[18:37:00] [warning] decavsub: track 1, invalid PTS
[18:37:01] [warning] decavsub: track 1, invalid PTS
[18:37:02] [warning] decavsub: track 1, invalid PTS
[18:37:04] [warning] decavsub: track 1, invalid PTS
[18:37:11] [warning] decavsub: track 1, invalid PTS
[18:37:13] [warning] decavsub: track 1, invalid PTS
[18:37:14] [warning] decavsub: track 1, invalid PTS
[18:37:16] [warning] decavsub: track 1, invalid PTS
[18:37:18] [warning] decavsub: track 1, invalid PTS
[18:37:19] [warning] decavsub: track 1, invalid PTS
[18:37:27] reader: done. 3 scr changes
[18:37:27] 311.040009s: Video -> Film
[18:37:27] sync: "Chapter 3" (3) at frame 7801 time 27993600
[18:37:29] work: average encoding speed for job is 83.946007 fps
[18:37:29] comb detect: heavy 3884 | light 871 | uncombed 3022 | total 7777
[18:37:29] decomb: deinterlaced 3884 | blended 871 | unfiltered 3022 | total 7777
[18:37:29] vfr: 7777 frames output, 0 dropped and 0 duped for CFR/PFR
[18:37:29] vfr: lost time: 0 (0 frames)
[18:37:29] vfr: gained time: 0 (0 frames) (0 not accounted for)
[18:37:29] ac3-decoder done: 9718 frames, 0 decoder errors
[18:37:29] mpeg2video-decoder done: 7777 frames, 0 decoder errors
[18:37:29] sync: got 7801 frames, 7825 expected
[18:37:29] sync: framerate min 25.000 fps, max 25.000 fps, avg 25.077 fps
[libfdk_aac @ 0x7f5bbc08bec0] Ignoring attempt to flush encoder that doesn't support it
x264 [info]: frame I:82    Avg QP:20.00  size: 21996
x264 [info]: frame P:2184  Avg QP:22.84  size:  7608
x264 [info]: frame B:5511  Avg QP:25.29  size:  1658
x264 [info]: consecutive B-frames:  4.6%  2.1%  2.0% 91.3%
x264 [info]: mb I  I16..4: 28.4%  0.0% 71.6%
x264 [info]: mb P  I16..4:  5.0%  0.0%  6.7%  P16..4: 43.6% 18.9% 10.8%  0.0%  0.0%    skip:14.9%
x264 [info]: mb B  I16..4:  2.9%  0.0%  1.2%  B16..8: 18.9%  5.2%  0.3%  direct: 8.0%  skip:63.5%  L0:43.3% L1:45.4% BI:11.3%
x264 [info]: coded y,uvDC,uvAC intra: 50.7% 60.3% 18.1% inter: 13.5% 21.1% 0.2%
x264 [info]: i16 v,h,dc,p: 46% 24% 16% 14%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 36% 20% 15%  5%  5%  5%  5%  5%  4%
x264 [info]: i8c dc,h,v,p: 53% 22% 21%  4%
x264 [info]: Weighted P-Frames: Y:14.3% UV:3.5%
x264 [info]: ref P L0: 56.9% 43.1%
x264 [info]: ref B L0: 73.8% 26.2%
x264 [info]: ref B L1: 92.6%  7.4%
x264 [info]: kb/s:708.64
[18:37:29] mux: track 0, 7777 frames, 27553065 bytes, 708.49 kbps, fifo 4096
[18:37:29] mux: track 1, 14580 frames, 6220801 bytes, 159.96 kbps, fifo 8192
[18:37:29] mux: track 2, 72 frames, 273680 bytes, 7.04 kbps, fifo 32
[18:37:29] Finished work at: Thu Dec 16 18:37:29 2021

[18:37:29] libhb: work result = 0
[19:06:17] CPU: Intel(R) Core(TM) i5-4210M CPU @ 2.60GHz
[19:06:17]  - Intel microarchitecture Haswell
[19:06:17]  - logical processor count: 4
[19:06:17] hb_scan: path=/dev/null, title_index=0
udfread ERROR: ECMA 167 Volume Recognition failed
disc.c:333: failed opening UDF image /dev/null
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(/dev/null/) failed
[19:06:17] 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:06:17] dvd: not a dvd - trying as a stream/file instead
[19:06:17] hb_stream_open: open /dev/null failed
[19:06:17] scan: unrecognized file type
[19:06:17] libhb: scan thread found 0 valid title(s)

Activity Log for 1.3.3 (same CD/same chapter as previous Activity log)
------------------------
[18:58:23] gtkgui: HandBrake 1.3.3 (2021121600) - Linux x86_64 - https://handbrake.fr
[18:58:23] hb_init: starting libhb thread
[18:58:23] hb_init: starting libhb thread
[18:58:23] hb_init: starting libhb thread
[18:58:26] gtkgui: Failed to read presets file, trying backup (presets.42.0.0.json)...
[18:58:32] CPU: Intel(R) Core(TM) i5-4210M CPU @ 2.60GHz
[18:58:32]  - Intel microarchitecture Haswell
[18:58:32]  - logical processor count: 4
[18:58:32] hb_scan: path=/dev/sr0, title_index=0
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((null)) failed
[18:58:32] bd: not a bd - trying as a stream/file instead
[18:58:32] dvd: Region mask 0xff
[18:58:32] dvd: Warning, DVD device has no region set
[18:58:32] scan: DVD has 6 title(s)
[18:58:32] scan: scanning title 1
[18:58:33] scan: duration is 01:54:36 (6876800 ms)
[18:58:33] pgc_id: 1, pgn: 1: pgc: 0x7f5fd0037550
[18:58:33] scan: checking audio 1
[18:58:33] scan: id=0x80bd, lang=Francais (AC3), 3cc=fra ext=0
[18:58:33] scan: checking audio 2
[18:58:33] scan: id=0x81bd, lang=English (AC3), 3cc=eng ext=0
[18:58:33] scan: checking subtitle 1
[18:58:33] scan: id=0x20bd, lang=Francais (Wide Screen) [VOBSUB], 3cc=fra ext=0
[18:58:33] scan: checking subtitle 2
[18:58:33] scan: id=0x21bd, lang=Nederlands (Wide Screen) [VOBSUB], 3cc=nld ext=0
[18:58:33] scan: title 1 has 14 chapters
[18:58:33] scan: chap 1, 552640 ms
[18:58:33] scan: chap 2, 574680 ms
[18:58:33] scan: chap 3, 664920 ms
[18:58:33] scan: chap 4, 566680 ms
[18:58:33] scan: chap 5, 394240 ms
[18:58:33] scan: chap 6, 596160 ms
[18:58:33] scan: chap 7, 584600 ms
[18:58:33] scan: chap 8, 428360 ms
[18:58:33] scan: chap 9, 787720 ms
[18:58:33] scan: chap 10, 426040 ms
[18:58:33] scan: chap 11, 750120 ms
[18:58:33] scan: chap 12, 542520 ms
[18:58:33] scan: chap 13, 7120 ms
[18:58:33] scan: chap 14, 1000 ms
[18:58:33] scan: aspect = 16:9
[18:58:33] scan: scanning title 2
[18:58:33] scan: duration is 00:05:13 (313000 ms)
[18:58:33] pgc_id: 1, pgn: 1: pgc: 0x7f5fd00387d0
[18:58:33] scan: checking audio 1
[18:58:33] scan: id=0x80bd, lang=English (AC3), 3cc=eng ext=0
[18:58:33] scan: checking subtitle 1
[18:58:33] scan: id=0x20bd, lang=Francais (4:3) [VOBSUB], 3cc=fra ext=0
[18:58:33] scan: checking subtitle 2
[18:58:33] scan: id=0x21bd, lang=Nederlands (4:3) [VOBSUB], 3cc=nld ext=0
[18:58:33] scan: title 2 has 3 chapters
[18:58:33] scan: chap 1, 1000 ms
[18:58:33] scan: chap 2, 311000 ms
[18:58:33] scan: chap 3, 1000 ms
[18:58:33] scan: aspect = 4:3
[18:58:33] scan: scanning title 3
[18:58:33] scan: duration is 00:00:33 (33040 ms)
[18:58:33] pgc_id: 1, pgn: 1: pgc: 0x7f5fd003d050
[18:58:33] scan: checking audio 1
[18:58:33] scan: id=0x80bd, lang=Unknown (AC3), 3cc=und ext=0
[18:58:33] scan: title 3 has 3 chapters
[18:58:33] scan: chap 1, 21040 ms
[18:58:33] scan: chap 2, 11000 ms
[18:58:33] scan: chap 3, 1000 ms
[18:58:33] scan: aspect = 16:9
[18:58:33] scan: scanning title 4
[18:58:33] scan: duration is 00:00:41 (41040 ms)
[18:58:33] pgc_id: 2, pgn: 1: pgc: 0x7f5fd004a510
[18:58:33] scan: checking audio 1
[18:58:33] scan: id=0x80bd, lang=Unknown (AC3), 3cc=und ext=0
[18:58:33] scan: title 4 has 4 chapters
[18:58:33] scan: chap 1, 9000 ms
[18:58:33] scan: chap 2, 21040 ms
[18:58:33] scan: chap 3, 10000 ms
[18:58:33] scan: chap 4, 1000 ms
[18:58:33] scan: aspect = 16:9
[18:58:33] scan: scanning title 5
[18:58:33] scan: duration is 00:03:23 (203000 ms)
[18:58:33] pgc_id: 3, pgn: 1: pgc: 0x7f5fd003a840
[18:58:33] scan: checking audio 1
[18:58:33] scan: id=0x80bd, lang=Unknown (AC3), 3cc=und ext=0
[18:58:33] scan: title 5 has 2 chapters
[18:58:33] scan: chap 1, 202000 ms
[18:58:33] scan: chap 2, 1000 ms
[18:58:33] scan: aspect = 16:9
[18:58:33] scan: scanning title 6
[18:58:33] scan: duration is 00:00:30 (30440 ms)
[18:58:33] pgc_id: 1, pgn: 1: pgc: 0x7f5fd003b480
[18:58:33] scan: checking audio 1
[18:58:33] scan: id=0x80bd, lang=Unknown (AC3), 3cc=und ext=0
[18:58:33] scan: title 6 has 2 chapters
[18:58:33] scan: chap 1, 29440 ms
[18:58:33] scan: chap 2, 1000 ms
[18:58:33] scan: aspect = 16:9
[18:58:35] scan: decoding previews for title 1
[18:58:35] scan: title angle(s) 1
[18:58:35] scan: audio 0x80bd: ac3, rate=48000Hz, bitrate=192000 Francais (AC3) (2.0 ch) (192 kbps)
[18:58:35] scan: audio 0x81bd: ac3, rate=48000Hz, bitrate=192000 English (AC3) (2.0 ch) (192 kbps)
[18:58:39] scan: 10 previews, 720x576, 25.000 fps, autocrop = 12/12/0/0, aspect 16:9, PAR 64:45
[18:58:39] scan: decoding previews for title 2
[18:58:39] scan: title angle(s) 1
[18:58:39] scan: audio 0x80bd: ac3, rate=48000Hz, bitrate=192000 English (AC3) (2.0 ch) (192 kbps)
[18:58:41] scan: 10 previews, 720x576, 25.000 fps, autocrop = 78/78/10/8, aspect 4:3, PAR 16:15
[18:58:41] scan: decoding previews for title 3
[18:58:41] scan: title angle(s) 1
[18:58:41] scan: audio 0x80bd: ac3, rate=48000Hz, bitrate=192000 Unknown (AC3) (2.0 ch) (192 kbps)
[18:58:42] scan: 10 previews, 720x576, 25.000 fps, autocrop = 14/14/2/0, aspect 16:9, PAR 64:45
[18:58:42] scan: decoding previews for title 4
[18:58:42] scan: title angle(s) 1
[18:58:42] scan: audio 0x80bd: ac3, rate=48000Hz, bitrate=192000 Unknown (AC3) (2.0 ch) (192 kbps)
[18:58:43] scan: 10 previews, 720x576, 25.000 fps, autocrop = 14/14/2/0, aspect 16:9, PAR 64:45
[18:58:43] scan: decoding previews for title 5
[18:58:43] scan: title angle(s) 1
[18:58:44] scan: audio 0x80bd: ac3, rate=48000Hz, bitrate=192000 Unknown (AC3) (2.0 ch) (192 kbps)
[18:58:45] scan: 10 previews, 720x576, 25.000 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 64:45
[18:58:45] scan: decoding previews for title 6
[18:58:45] scan: title angle(s) 1
[18:58:46] scan: audio 0x80bd: ac3, rate=48000Hz, bitrate=224000 Unknown (AC3) (2.0 ch) (224 kbps)
[18:58:47] scan: 10 previews, 720x576, 25.000 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 64:45
[18:58:47] libhb: scan thread found 6 valid title(s)
[swscaler @ 0x5647c364f810] Warning: data is not aligned! This can lead to a speed loss
[19:02:43] gtkgui: Preset: /General/Fast 1080p30
[19:02:43] Starting work at: Thu Dec 16 19:02:43 2021

[19:02:43] 1 job(s) to process
[19:02:43] json job:
{
    "Audio": {
        "AudioList": [
            {
                "Bitrate": 160,
                "CompressionLevel": -1.0,
                "DRC": 0.0,
                "DitherMethod": "auto",
                "Encoder": "fdk_aac",
                "Gain": 0.0,
                "Mixdown": "stereo",
                "NormalizeMixLevel": false,
                "PresetEncoder": "fdk_aac",
                "Quality": -3.0,
                "Samplerate": 0,
                "Track": 0
            }
        ],
        "CopyMask": [
            "copy:aac"
        ],
        "FallbackEncoder": "fdk_aac"
    },
    "Destination": {
        "AlignAVStart": true,
        "ChapterList": [
            {
                "Duration": {
                    "Hours": 0,
                    "Minutes": 0,
                    "Seconds": 1,
                    "Ticks": 90000
                },
                "Name": "Chapter 1"
            },
            {
                "Duration": {
                    "Hours": 0,
                    "Minutes": 5,
                    "Seconds": 11,
                    "Ticks": 27990000
                },
                "Name": "Chapter 2"
            },
            {
                "Duration": {
                    "Hours": 0,
                    "Minutes": 0,
                    "Seconds": 1,
                    "Ticks": 90000
                },
                "Name": "Chapter 3"
            }
        ],
        "ChapterMarkers": true,
        "File": "Redacted.mp4",
        "InlineParameterSets": false,
        "Mp4Options": {
            "IpodAtom": false,
            "Mp4Optimize": false
        },
        "Mux": "m4v"
    },
    "Filters": {
        "FilterList": [
            {
                "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": 4,
                "Settings": {
                    "mode": "7"
                }
            },
            {
                "ID": 6,
                "Settings": {
                    "mode": 2,
                    "rate": "27000000/900000"
                }
            },
            {
                "ID": 12,
                "Settings": {
                    "crop-bottom": 78,
                    "crop-left": 10,
                    "crop-right": 8,
                    "crop-top": 78,
                    "height": 420,
                    "width": 702
                }
            }
        ]
    },
    "Metadata": {
        "Name": "Redacted"
    },
    "PAR": {
        "Den": 15,
        "Num": 16
    },
    "SequenceID": 0,
    "Source": {
        "Angle": 0,
        "Path": "/dev/sr0",
        "Range": {
            "End": 3,
            "Start": 1,
            "Type": "chapter"
        },
        "Title": 2
    },
    "Subtitle": {
        "Search": {
            "Burn": true,
            "Default": false,
            "Enable": false,
            "Forced": true
        },
        "SubtitleList": [
            {
                "Burn": false,
                "Default": false,
                "Forced": false,
                "Offset": 0,
                "Track": 0
            },
            {
                "Burn": false,
                "Default": false,
                "Forced": false,
                "Offset": 0,
                "Track": 1
            }
        ]
    },
    "Video": {
        "ColorFormat": 0,
        "ColorMatrix": 6,
        "ColorPrimaries": 5,
        "ColorRange": 1,
        "ColorTransfer": 1,
        "Encoder": "x264",
        "Level": "4.0",
        "Options": "",
        "Preset": "fast",
        "Profile": "main",
        "QSV": {
            "AsyncDepth": 4,
            "Decode": false
        },
        "Quality": 22.0,
        "Tune": "",
        "Turbo": false,
        "TwoPass": false
    }
}
[19:02:43] CPU: Intel(R) Core(TM) i5-4210M CPU @ 2.60GHz
[19:02:43]  - Intel microarchitecture Haswell
[19:02:43]  - logical processor count: 4
[19:02:43] hb_scan: path=/dev/sr0, title_index=2
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((null)) failed
[19:02:46] bd: not a bd - trying as a stream/file instead
[19:02:46] dvd: Region mask 0xff
[19:02:46] dvd: Warning, DVD device has no region set
[19:02:46] scan: DVD has 6 title(s)
[19:02:46] scan: scanning title 2
[19:02:47] scan: duration is 00:05:13 (313000 ms)
[19:02:47] pgc_id: 1, pgn: 1: pgc: 0x7f5fc801cb20
[19:02:47] scan: checking audio 1
[19:02:47] scan: id=0x80bd, lang=English (AC3), 3cc=eng ext=0
[19:02:47] scan: checking subtitle 1
[19:02:47] scan: id=0x20bd, lang=Francais (4:3) [VOBSUB], 3cc=fra ext=0
[19:02:47] scan: checking subtitle 2
[19:02:47] scan: id=0x21bd, lang=Nederlands (4:3) [VOBSUB], 3cc=nld ext=0
[19:02:47] scan: title 2 has 3 chapters
[19:02:47] scan: chap 1, 1000 ms
[19:02:47] scan: chap 2, 311000 ms
[19:02:47] scan: chap 3, 1000 ms
[19:02:47] scan: aspect = 4:3
[19:02:47] scan: decoding previews for title 2
[19:02:47] scan: title angle(s) 1
[19:02:47] scan: audio 0x80bd: ac3, rate=48000Hz, bitrate=192000 English (AC3) (2.0 ch) (192 kbps)
[19:02:48] scan: 10 previews, 720x576, 25.000 fps, autocrop = 78/78/10/8, aspect 4:3, PAR 16:15
[19:02:48] libhb: scan thread found 1 valid title(s)
[19:02:48] Starting Task: Encoding Pass
[19:02:48] job configuration:
[19:02:48]  * source
[19:02:48]    + /dev/sr0
[19:02:48]    + title 2, chapter(s) 1 to 3
[19:02:48]  * destination
[19:02:48]    + Redacted.mp4
[19:02:48]    + container: MPEG-4 (libavformat)
[19:02:48]      + align initial A/V stream timestamps
[19:02:48]      + chapter markers
[19:02:48]  * video track
[19:02:48]    + decoder: mpeg2video
[19:02:48]      + bitrate 200 kbps
[19:02:48]    + filters
[19:02:48]      + 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:02:48]      + Decomb (mode=39)
[19:02:48]      + Framerate Shaper (mode=2:rate=27000000/900000)
[19:02:48]        + frame rate: 25.000 fps -> peak rate limited to 30.000 fps
[19:02:48]      + Crop and Scale (width=702:height=420:crop-top=78:crop-bottom=78:crop-left=10:crop-right=8)
[19:02:48]        + source: 720 * 576, crop (78/78/10/8): 702 * 420, scale: 702 * 420
[19:02:48]    + Output geometry
[19:02:48]      + storage dimensions: 702 x 420
[19:02:48]      + pixel aspect ratio: 16 : 15
[19:02:48]      + display dimensions: 748 x 420
[19:02:48]    + encoder: H.264 (libx264)
[19:02:48]      + preset:  fast
[19:02:48]      + profile: main
[19:02:48]      + level:   4.0
[19:02:48]      + quality: 22.00 (RF)
[19:02:48]      + color profile: 5-1-6
[19:02:48]  * subtitle track 1, Francais (4:3) [VOBSUB] (track 0, id 0x20bd, Picture) -> Passthrough
[19:02:48]  * subtitle track 2, Nederlands (4:3) [VOBSUB] (track 1, id 0x21bd, Picture) -> Passthrough
[19:02:48]  * audio track 1
[19:02:48]    + decoder: English (AC3) (2.0 ch) (192 kbps) (track 1, id 0x80bd)
[19:02:48]      + bitrate: 192 kbps, samplerate: 48000 Hz
[19:02:48]    + mixdown: Stereo
[19:02:48]    + dither: triangular
[19:02:48]    + encoder: AAC (libfdk_aac)
[19:02:48]      + bitrate: 160 kbps, samplerate: 48000 Hz
[19:02:48] dvd: Region mask 0xff
[19:02:48] dvd: Warning, DVD device has no region set
[19:02:49] sync: expecting 7825 video frames
[19:02:49] encx264: encoding at constant RF 22.000000
[19:02:49] encx264: unparsed options: level=4.0:ref=2:8x8dct=0:weightp=1:subme=6:vbv-bufsize=25000:vbv-maxrate=20000:rc-lookahead=30
x264 [info]: using SAR=16/15
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x264 [info]: profile Main, level 4.0, 4:2:0, 8-bit
[19:02:50] sync: first pts video is 0
[19:02:50] sync: "Chapter 1" (1) at frame 1 time 0
[19:02:50] sync: first pts audio 0x80bd is 0
[19:02:50] sync: "Chapter 2" (2) at frame 2 time 3600
[19:02:50] sync: first pts subtitle 0x21bd is 122400
[19:02:50] sync: first pts subtitle 0x20bd is 136800
[19:04:37] reader: done. 3 scr changes
[19:04:37] 311.040009s: Video -> Film
[19:04:37] sync: "Chapter 3" (3) at frame 7777 time 27993600
[19:04:38] work: average encoding speed for job is 72.068024 fps
[19:04:39] comb detect: heavy 3884 | light 871 | uncombed 3022 | total 7777
[19:04:39] decomb: deinterlaced 3884 | blended 871 | unfiltered 3022 | total 7777
[19:04:39] vfr: 7777 frames output, 0 dropped and 0 duped for CFR/PFR
[19:04:39] vfr: lost time: 0 (0 frames)
[19:04:39] vfr: gained time: 0 (0 frames) (0 not accounted for)
[19:04:39] ac3-decoder done: 9718 frames, 0 decoder errors
[19:04:39] mpeg2video-decoder done: 7777 frames, 0 decoder errors
[19:04:39] sync: got 7777 frames, 7825 expected
[19:04:39] sync: framerate min 25.000 fps, max 25.000 fps, avg 25.000 fps
[libfdk_aac @ 0x7f5fd02cc3e0] Ignoring attempt to flush encoder that doesn't support it
x264 [info]: frame I:82    Avg QP:20.00  size: 21996
x264 [info]: frame P:2184  Avg QP:22.84  size:  7608
x264 [info]: frame B:5511  Avg QP:25.29  size:  1658
x264 [info]: consecutive B-frames:  4.6%  2.1%  2.0% 91.3%
x264 [info]: mb I  I16..4: 28.4%  0.0% 71.6%
x264 [info]: mb P  I16..4:  5.0%  0.0%  6.7%  P16..4: 43.6% 18.9% 10.8%  0.0%  0.0%    skip:14.9%
x264 [info]: mb B  I16..4:  2.9%  0.0%  1.2%  B16..8: 18.9%  5.2%  0.3%  direct: 8.0%  skip:63.5%  L0:43.3% L1:45.4% BI:11.3%
x264 [info]: coded y,uvDC,uvAC intra: 50.7% 60.3% 18.1% inter: 13.5% 21.1% 0.2%
x264 [info]: i16 v,h,dc,p: 46% 24% 16% 14%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 36% 20% 15%  5%  5%  5%  5%  5%  4%
x264 [info]: i8c dc,h,v,p: 53% 22% 21%  4%
x264 [info]: Weighted P-Frames: Y:14.3% UV:3.5%
x264 [info]: ref P L0: 56.9% 43.1%
x264 [info]: ref B L0: 73.8% 26.2%
x264 [info]: ref B L1: 92.6%  7.4%
x264 [info]: kb/s:708.64
[19:04:39] mux: track 0, 7777 frames, 27553065 bytes, 708.49 kbps, fifo 4096
[19:04:39] mux: track 1, 14580 frames, 6220801 bytes, 159.96 kbps, fifo 8192
[19:04:39] mux: track 2, 78 frames, 288972 bytes, 7.43 kbps, fifo 64
[19:04:39] mux: track 3, 63 frames, 262160 bytes, 6.74 kbps, fifo 32
[19:04:39] Finished work at: Thu Dec 16 19:04:39 2021

[19:04:39] libhb: work result = 0

What Operating System are you running?

Linux Gentoo, up to date

What version of HandBrake are you running?

1.3.3 (okay), 1.4.2-r1 (broken)

Where did you download HandBrake from?

Github

sr55 commented 2 years ago

Are you using the Flatpak build or gentoo's own build?

woodstockathbf commented 2 years ago

Can't be flatpak because fdk_aac is an included encoder, so it would have to have been built from scratch.

Not to mention that in both cases, the subtitles tracks are passed through from source to destination, so the timestamps should be the untouched.

The 1.4.2 encode mentions that it cannot access the source with libdvdcss, so I wonder how or whether the source was decrypted.

Sargastic commented 2 years ago

Can't be flatpak because fdk_aac is an included encoder, so it would have to have been built from scratch.

Indeed. I'm using the Gentoo ebuilds.

The 1.4.2 encode mentions that it cannot access the source with libdvdcss, so I wonder how or whether the source was decrypted.

Is there any check I may perform to answer this question ?

sr55 commented 2 years ago

I'm afraid the build you are using is not supported by the HandBrake Team. Gentoo ebuilds use system libraries which are missing many patches which we add to these libraries, thus making the application unreliable.

You can either compile from our own source code, Use a flatpak build or ask them for support.

retiredfeline commented 2 years ago

I can confirm that I have had the same problem for a few months now, but only today decided to investigate by building from GitHub source. My platform is openSUSE Leap 15.3.

This seems to happen with older DVD releases. Two that exhibit the problem in my collection are the Almodovar film Women on the Verge of a Nervous Breakdown with English and French subtitles, and the Columbo TV series "cigar-box" boxset. 1.3.3 handles the subtitles fine, 1.4.2 does not. More recent DVDs in my collection do not have the problem.

With 1.4.2 (as provided by Packman for openSUSE 15.3) the subtitles are mostly missing, once in a while one will appear, and sometimes two subtitles will clash and appear together. The sign of trouble is a flurry of messages in the output of the form:

[warning] decavsub: track %d, invalid PTS

When I built and used 1.3.3 from the GitHub repository on the problematic DVDs, subtitles were correctly output and no warning messages appeared.

I am using HandBrakeCLI and no GUI at all. There is no problem with CSS decryption on any DVD I have.

Incidentatlly when I built and ran the latest HEAD, it segfaulted on the Almodovar DVD. But I guess that is another issue.

sr55 commented 2 years ago

openSUSE Packman releases are also not supported by the HandBrake team.

With regards to the segfault, please create a separate issue and provide a log (query if using the CLI) and if possible a cut down sample of the source.

If either can reproduce on formal builds, we'll take a look.

retiredfeline commented 2 years ago

Ok, I built the 1.4.2 release from the repository, and it segfaults. This is too hard for me. I'll just stick to my 1.3.3 build for the problematic DVDs. Thanks.

Sargastic commented 2 years ago

I'm afraid the build you are using is not supported by the HandBrake Team. Gentoo ebuilds use system libraries which are missing many patches which we add to these libraries, thus making the application unreliable.

You can either compile from our own source code, Use a flatpak build or ask them for support.

Compilation from official source code failed. Flatpak build does not find CD/DVD reader.

sr55 commented 2 years ago

Likely just flatpak permissions not being set approbatively for the app.

You don't have to create a flatpak. you can build a raw HandBrake binary and execute that. No Sandbox restrictions. https://handbrake.fr/docs/en/latest/developer/build-linux.html

jeffgazso commented 2 years ago

Gentoo ebuilds use system libraries which are missing many patches which we add to these libraries, thus making the application unreliable.

@sr55, Can you specify which libraries have the most significant patches? Gentoo's portage build system is extremely flexible, it might be possible to create a series of USE flags downstream which will bring the builds closer to HandBrake's baseline. I'll make a note in the downstream bug as well.

sr55 commented 2 years ago

You can see the libraries we use here, and any patches are included in the directories. https://github.com/HandBrake/HandBrake/tree/master/contrib

ffmpeg is heavily patched and likely the offender in this case.

We've had little luck getting them to change it in the past. They have a requirement to manage version libraries for security purposes which is fair enough. Unfortunately, for a small project like HandBrake, it's just not possible to keep pace, or to support many different versions of ffmpeg that many distro's use.

Thus, there are really only 2 reasonable options.

  1. Build HandBrake using our source without altering it.
  2. Don't include HandBrake in the repository.

They chose the passive aggressive approach option (Flat out ignoring us telling them it wouldn't work properly)

  1. Distribute a known broken build and add a weak warning in the ebuild (that sadly, a few users just ignore and throw abuse our way anyway) https://gitweb.gentoo.org/repo/gentoo.git/tree/media-video/handbrake/handbrake-1.4.2-r1.ebuild#n147

If you are able to get it into a better state, that would be awesome.

frej commented 2 years ago

I hit this issue as a Gentoo user too, and spent some time debugging it. Applying the following patch

diff --git a/libhb/decavsub.c b/libhb/decavsub.c
index 534ab050e..2f54bfdd2 100644
--- a/libhb/decavsub.c
+++ b/libhb/decavsub.c
@@ -330,11 +330,15 @@ int decavsubWork( hb_avsub_context_t * ctx,
     }

     int has_subtitle = 0;
+    static int64_t my_pts = AV_NOPTS_VALUE;

     while (ctx->pkt->size > 0)
     {
         int usedBytes = avcodec_decode_subtitle2(ctx->context, &subtitle,
                                                  &has_subtitle, ctx->pkt );
+
+        hb_log("XXXX pksize: %d, usedBytes: %d, has_subTitle: %d, PTS: %lx", ctx->pkt->size, usedBytes, has_subtitle, subtitle.pts);
+
         if (usedBytes < 0)
         {
             hb_error("unable to decode subtitle with %d bytes.", ctx->pkt->size);
@@ -347,6 +351,8 @@ int decavsubWork( hb_avsub_context_t * ctx,
             // of bytes consumed, or an error.  If for some unforeseen reason
             // it returns 0, lets not get stuck in an infinite loop!
             usedBytes = ctx->pkt->size;
+            if (subtitle.pts != AV_NOPTS_VALUE)
+                my_pts = subtitle.pts;
         }

         if (usedBytes <= ctx->pkt->size)
@@ -430,6 +436,11 @@ int decavsubWork( hb_avsub_context_t * ctx,
         {
             duration = av_rescale(subtitle.end_display_time, 90000, 1000);
         }
+        hb_log("XXXX PTS %lx %lx", subtitle.pts, my_pts);
+
+        if (my_pts != AV_NOPTS_VALUE && subtitle.pts == AV_NOPTS_VALUE)
+            subtitle.pts = my_pts;
+
         if (subtitle.pts != AV_NOPTS_VALUE)
         {
             pts = av_rescale(subtitle.pts, 90000, AV_TIME_BASE) +

and run Handbrake on a problematic DVD. You will see that a single subtitle frame is fed into decavsubWork in multiple buffers (i.e. multiple invocations of decavsubWork). The issue is caused by ffmpeg only setting the PTS field of AVSubtitle when given the first buffer of the subtitle frame. By saving the last seen PTS and using it when avcodec_decode_subtitle2 sets has_subtitle, the subtitles start to work properly again.

I haven't had time to debug this further to figure out if the lack of a valid PTS when avcodec_decode_subtitle2 signals that a complete subtitle frame is received is a due to: A recent change in Ffmpeg; or an assumption in Handbrake that each invocation of decavsubWork should be given a buffer containing a complete frame.

I suspect that it is the latter, as Handbrake applies this patch to ffmpeg (A25-dvdsubdec-fix-processing-of-partial-packets.patch). The patch is probably no longer needed for a recent version of Ffmpeg, as the error the commit message refers to no longer occurs (as the above patch works).

From my point of view we should either report the missing PTS as a bug to Ffmpeg or do a proper job of preserving the PTS (it will have to go into the context and we need one PTS per subtitle stream). Either of those solutions would allow Handbrake to drop the A25-dvdsubdec-fix-processing-of-partial-packets.patch.

retiredfeline commented 2 years ago

Hi @frej,

Just curious so I tried your patch on 1.4.2 sources cloned from the repo, built and ran it on the Almodovar DVD I mentioned previously:

$ HandBrakeCLI-1.4.2-patched -t 0 -i /dev/sr1
[18:34:53] Compile-time hardening features are enabled
Cannot load libnvidia-encode.so.1
Cannot load libnvidia-encode.so.1
Cannot load libnvidia-encode.so.1
Cannot load libnvidia-encode.so.1
[18:34:53] hb_init: starting libhb thread
[18:34:53] thread 7fb88bcf2700 started ("libhb")
HandBrake 1.4.2 (2022010800) - Linux x86_64 - https://handbrake.fr
12 CPUs detected
Opening /dev/sr1...
[18:34:53] CPU: AMD Ryzen 5 3600 6-Core Processor              
[18:34:53]  - logical processor count: 12
[18:34:53] hb_scan: path=/dev/sr1, title_index=0
disc.c:424: error opening file BDMV/index.bdmv
disc.c:424: error opening file BDMV/BACKUP/index.bdmv
[18:34:53] bd: not a bd - trying as a stream/file instead
[18:34:53] dvd: Region mask 0xf7
Scanning title 1 of 1, 0.00 %libdvdnav: DVD Title: WOMENONTHEVERGE
libdvdnav: DVD Serial Number: 357d003d
libdvdnav: DVD Title (Alternative): 
libdvdnav: DVD disk reports itself with Region mask 0x00fe0000. Regions: 01

libdvdread: Attempting to retrieve all CSS keys
libdvdread: This can take a _long_ time, please be patient

libdvdread: Get key for /VIDEO_TS/VIDEO_TS.VOB at 0x00000149
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_01_0.VOB at 0x0000018d
Scanning title 1 of 1, 0.00 %libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_01_1.VOB at 0x00000356
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_02_0.VOB at 0x001de855
libdvdread: Elapsed time 1
libdvdread: Get key for /VIDEO_TS/VTS_02_1.VOB at 0x001de869
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_03_0.VOB at 0x001df922
Scanning title 1 of 1, 0.00 %libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_03_1.VOB at 0x001df936
libdvdread: Error cracking CSS key for /VIDEO_TS/VTS_03_1.VOB (0x001df936)!!
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_04_0.VOB at 0x001df95b
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_04_1.VOB at 0x001df96f
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_05_0.VOB at 0x001e2696
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_05_1.VOB at 0x001e26aa
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_06_0.VOB at 0x001e26e0
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_06_1.VOB at 0x001e26f4
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_07_0.VOB at 0x001e272b
Scanning title 1 of 1, 0.00 %libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_07_1.VOB at 0x001e273f
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_08_0.VOB at 0x001e278a
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_08_1.VOB at 0x001e279e
libdvdread: Elapsed time 0
libdvdread: Found 8 VTS's
libdvdread: Elapsed time 1
[18:34:54] scan: DVD has 14 title(s)
[18:34:54] scan: scanning title 1
Segmentation fault (core dumped)

This is what the 1.3.3 build output, just the lines after the scan: scanning title 1 message:

$ HandBrakeCLI-1.3.3 -t 0 -i /dev/sr1
...
[18:39:30] scan: scanning title 1
Scanning title 1 of 14, 3.57 %[18:39:31] scan: duration is 01:28:37 (5317000 ms)
[18:39:31] pgc_id: 1, pgn: 1: pgc: 0x7f654c02d840
[18:39:31] scan: checking audio 1
[18:39:31] scan: id=0x80bd, lang=español (AC3), 3cc=spa ext=0
[18:39:31] scan: checking subtitle 1
[18:39:31] scan: id=0x20bd, lang=English (Wide Screen) [VOBSUB], 3cc=eng ext=1
[18:39:31] scan: checking subtitle 2
[18:39:31] scan: id=0x21bd, lang=Francais (Wide Screen) [VOBSUB], 3cc=fra ext=1
[18:39:31] scan: title 1 has 12 chapters
[18:39:31] scan: chap 1, 453667 ms
[18:39:31] scan: chap 2, 413433 ms
[18:39:31] scan: chap 3, 392667 ms
[18:39:31] scan: chap 4, 367834 ms
[18:39:31] scan: chap 5, 368100 ms
[18:39:31] scan: chap 6, 575333 ms
[18:39:31] scan: chap 7, 570367 ms
[18:39:31] scan: chap 8, 490333 ms
[18:39:31] scan: chap 9, 507934 ms
[18:39:31] scan: chap 10, 411834 ms
[18:39:31] scan: chap 11, 282000 ms
[18:39:31] scan: chap 12, 483500 ms
[18:39:31] scan: aspect = 16:9
[18:39:31] scan: scanning title 2
[18:39:31] scan: duration is 00:00:15 (15333 ms)
[18:39:31] pgc_id: 1, pgn: 1: pgc: 0x7f654c02f430
[18:39:31] scan: checking audio 1
[18:39:31] scan: id=0x80bd, lang=English (AC3), 3cc=eng ext=0
[18:39:31] scan: title 2 has 2 chapters
[18:39:31] scan: chap 1, 14834 ms
[18:39:31] scan: chap 2, 500 ms
[18:39:31] scan: aspect = 16:9
[18:39:31] scan: scanning title 3
[18:39:31] scan: duration is 00:00:00 (500 ms)
[18:39:31] scan: ignoring title (too short)
[18:39:31] scan: scanning title 4
[18:39:31] scan: duration is 00:00:26 (26667 ms)
[18:39:31] pgc_id: 1, pgn: 1: pgc: 0x7f654c02b790
[18:39:31] scan: title 4 has 3 chapters
[18:39:31] scan: chap 1, 9500 ms
[18:39:31] scan: chap 2, 16667 ms
[18:39:31] scan: chap 3, 500 ms
[18:39:31] scan: aspect = 16:9
[18:39:31] scan: scanning title 5
Scanning title 5 of 14, 17.86 %[18:39:31] scan: duration is 00:00:01 (1000 ms)
[18:39:31] scan: ignoring title (too short)
[18:39:31] scan: scanning title 6
[18:39:31] scan: duration is 00:00:01 (1000 ms)
[18:39:31] scan: ignoring title (too short)
[18:39:31] scan: scanning title 7
[18:39:31] scan: duration is 00:00:01 (1000 ms)
[18:39:31] scan: ignoring title (too short)
[18:39:31] scan: scanning title 8
[18:39:31] scan: duration is 00:00:01 (1000 ms)
[18:39:31] scan: ignoring title (too short)
[18:39:31] scan: scanning title 9
[18:39:31] scan: duration is 00:00:01 (1000 ms)
[18:39:31] scan: ignoring title (too short)
[18:39:31] scan: scanning title 10
[18:39:31] scan: duration is 00:00:01 (1000 ms)
[18:39:31] scan: ignoring title (too short)
[18:39:31] scan: scanning title 11
[18:39:31] scan: duration is 00:00:01 (1000 ms)
[18:39:31] scan: ignoring title (too short)
[18:39:31] scan: scanning title 12
[18:39:31] scan: duration is 00:00:01 (1000 ms)
[18:39:31] scan: ignoring title (too short)
[18:39:31] scan: scanning title 13
[18:39:31] scan: duration is 00:00:01 (1000 ms)
[18:39:31] scan: ignoring title (too short)
[18:39:31] scan: scanning title 14
[18:39:31] scan: duration is 00:00:01 (1000 ms)
[18:39:31] scan: ignoring title (too short)
libdvdnav: DVD disk reports itself with Region mask 0x00fe0000. Regions: 01
Scanning title 14 of 14, 50.00 %[18:39:35] scan: decoding previews for title 1
libdvdnav: DVD disk reports itself with Region mask 0x00fe0000. Regions: 01
[18:39:35] scan: title angle(s) 1
Scanning title 1 of 3, preview 1, 51.67 %[18:39:35] scan: audio 0x80bd: ac3, rate=48000Hz, bitrate=192000 español (AC3) (2.0 ch) (192 kbps)
Scanning title 1 of 3, preview 9, 65.00 %[18:39:38] scan: 10 previews, 720x480, 23.976 fps, autocrop = 12/8/2/2, aspect 16:9, PAR 32:27
[18:39:38] scan: decoding previews for title 2
libdvdnav: DVD disk reports itself with Region mask 0x00fe0000. Regions: 01
[18:39:38] scan: title angle(s) 1
[18:39:38] scan: audio 0x80bd: ac3, rate=48000Hz, bitrate=448000 English (AC3) (5.1 ch) (448 kbps)
Scanning title 2 of 3, preview 9, 81.67 %[18:39:38] scan: 10 previews, 720x480, 29.970 fps, autocrop = 2/6/0/8, aspect 16:9, PAR 32:27
[18:39:38] scan: decoding previews for title 4
libdvdnav: DVD disk reports itself with Region mask 0x00fe0000. Regions: 01
[18:39:38] scan: title angle(s) 1
Scanning title 3 of 3, preview 10, 100.00 %[18:39:39] scan: 10 previews, 720x480, 29.970 fps, autocrop = 2/0/0/0, aspect 16:9, PAR 32:27
[18:39:39] libhb: scan thread found 3 valid title(s)
+ title 1:
  + Main Feature
  + index 1
  + duration: 01:28:37
  + size: 720x480, pixel aspect: 32/27, display aspect: 1.78, 23.976 fps
  + autocrop: 12/8/2/2
  + chapters:
    + 1: duration 00:07:34
    + 2: duration 00:06:53
    + 3: duration 00:06:33
    + 4: duration 00:06:08
    + 5: duration 00:06:08
    + 6: duration 00:09:35
    + 7: duration 00:09:30
    + 8: duration 00:08:10
    + 9: duration 00:08:28
    + 10: duration 00:06:52
    + 11: duration 00:04:42
    + 12: duration 00:08:04
  + audio tracks:
    + 1, español (AC3) (2.0 ch) (192 kbps) (iso639-2: spa), 48000Hz, 192000bps
  + subtitle tracks:
    + 1, English (Wide Screen) [VOBSUB]
    + 2, Francais (Wide Screen) [VOBSUB]
+ title 2:
  + index 2
  + duration: 00:00:15
  + size: 720x480, pixel aspect: 32/27, display aspect: 1.78, 29.970 fps
  + autocrop: 2/6/0/8
  + chapters:
    + 1: duration 00:00:15
    + 2: duration 00:00:01
  + audio tracks:
    + 1, English (AC3) (5.1 ch) (448 kbps) (iso639-2: eng), 48000Hz, 448000bps
  + subtitle tracks:
+ title 4:
  + index 4
  + duration: 00:00:26
  + size: 720x480, pixel aspect: 32/27, display aspect: 1.78, 29.970 fps
  + autocrop: 2/0/0/0
  + chapters:
    + 1: duration 00:00:10
    + 2: duration 00:00:17
    + 3: duration 00:00:01
  + audio tracks:
  + subtitle tracks:

HandBrake has exited.

So I guess a more comprehensive fix is needed. Maybe it's because there are 2 subtitle languages? Thanks for your work. I guess I'll just have to hang on to my 1.3.3 executable.

retiredfeline commented 2 years ago

Hi @frej,

Just because it only takes a moment, I decided to try the patched and compiled from source 1.4.2 executable on a more recent DVD (that I have successfully ripped with 1.4.2 from Packman, and my compiled from source 1.3.3), the Italian box set Murders at the Bar Lume. It segfaulted too.

$ HandBrakeCLI-1.4.2-patched -t 0 -i /dev/sr1
[09:48:12] Compile-time hardening features are enabled
Cannot load libnvidia-encode.so.1
Cannot load libnvidia-encode.so.1
Cannot load libnvidia-encode.so.1
Cannot load libnvidia-encode.so.1
[09:48:12] hb_init: starting libhb thread
[09:48:12] thread 7fe407284700 started ("libhb")
HandBrake 1.4.2 (2022010800) - Linux x86_64 - https://handbrake.fr
12 CPUs detected
Opening /dev/sr1...
[09:48:12] CPU: AMD Ryzen 5 3600 6-Core Processor              
[09:48:12]  - logical processor count: 12
[09:48:12] hb_scan: path=/dev/sr1, title_index=0
disc.c:424: error opening file BDMV/index.bdmv
disc.c:424: error opening file BDMV/BACKUP/index.bdmv
[09:48:12] bd: not a bd - trying as a stream/file instead
[09:48:12] dvd: Region mask 0xf7
Scanning title 1 of 1, 0.00 %libdvdnav: DVD Title: MURDERS_AT_BAR_LUME_D1
libdvdnav: DVD Serial Number: 6D4B7524APPLED_LUME_D1
libdvdnav: DVD Title (Alternative): MURDERS_AT_BAR_LUME_D1
libdvdnav: DVD disk reports itself with Region mask 0x00b70000. Regions: 04 07

libdvdread: Attempting to retrieve all CSS keys
libdvdread: This can take a _long_ time, please be patient

libdvdread: Get key for /VIDEO_TS/VIDEO_TS.VOB at 0x0000013a
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_01_0.VOB at 0x00000198
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_01_1.VOB at 0x000001e5
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_02_0.VOB at 0x000013a4
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_02_1.VOB at 0x0000165e
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_03_0.VOB at 0x001dd76d
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_03_1.VOB at 0x001dd7ba
libdvdread: Elapsed time 0
libdvdread: Found 3 VTS's
libdvdread: Elapsed time 0
[09:48:13] scan: DVD has 3 title(s)
[09:48:13] scan: scanning title 1
Segmentation fault (core dumped)

So ironically the blamed third party builds actually do better than the official source here. Anyway thanks for helping me confirm my hunch that DVD subtitle handling has been broken since 1.3.3.

sr55 commented 2 years ago

Any chance you can build with —debug=max. and run Gdb to see where it’s crashing.

retiredfeline commented 2 years ago

Sorry, I have other demands on my time and I'm only a casual user of HandBrake. I think there is a good chance it will fail with many other DVDs too. IMO it should go back to the author of the subtitle handling code that was added after 1.3.3.

Sargastic commented 2 years ago

Any chance you can build with —debug=max. and run Gdb to see where it’s crashing.

I'm gonna try doing that, since I am quite interested in the issue being solved. Will keep you posted.

retiredfeline commented 2 years ago

Just got another box set, Mission Impossible, the TV series, not the Cruise films. Results on the very first DVD of 46:

1.4.2 from Github with frej's patch: Segfaulted Distro's 1.5.1: Lots of invalid PTS messages, gave up since I know that will turn out. 1.3.3 from Github: Rip succeeded and subtitles good on playback.

I should probably check out 1.5.1 from Github and try building that with and without frej's patch.

frej commented 2 years ago

@retiredfeline, the comment at the end of my original post:

From my point of view we should either report the missing PTS as a bug to Ffmpeg or do a proper job of preserving the PTS (it will have to go into the context and we need one PTS per subtitle stream).

I don't know if you understood the implication of "we need one PTS per subtitle", but things will surely break (probably segfault) if you select more than one subtitle track.

The point of the patch is to show that on return from avcodec_decode_subtitle2(), has_subtitle == true does not necessarily imply that subtitle.pts != AV_NOPTS_VALUE and that the last seen valid PTS for the track should be used for the decoded subtitle frame. The patch is not intended to provide a full working fix for running with a recent and unpatched ffmpeg, its purpose is to show that Handbrake seems to expect a behaviour which is not / no longer exhibited by ffmpeg.

bradleysepos commented 2 years ago

Reopening and assigning John as there might be a small bug here. @jstebbins see comment https://github.com/HandBrake/HandBrake/issues/4029#issuecomment-1015531617

retiredfeline commented 2 years ago

I don't know if you understood the implication of "we need one PTS per subtitle", but things will surely break (probably segfault) if you select more than one subtitle track.

I believe you, as I have no expertise in that code, not do I wish to acquire any, but just to point out that I always selected one subtitle language, English. What I wrote was that there are two languages on that Almodovar DVD.

retiredfeline commented 2 years ago

Ok since I know nothing about HandBrake innards but I know git commands, I checked out and built 1.5.1 from Github and here are the results, along with 1.3.3 from Github, frej's patch not used.

Almodovar Women on the Verge of a Nervous Breakdown:

1.5.1: Segfaulted

...
[22:08:34] scan: DVD has 14 title(s)
[22:08:34] scan: scanning title 1
Segmentation fault (core dumped)

1.3.3: No problem

Death in Paradise, series 1, DVD 1: 1.5.1: Segfaulted

...
[22:12:19] scan: DVD has 6 title(s)
[22:12:19] scan: scanning title 1
Segmentation fault (core dumped)

1.3.3: No problem

Since Death in Paradise wasn't one of my DVDs that exhibited any problem with my distro's 1.5.1 or 1.4.2 build, I'm going to hazard a guess that you will be able to reproduce the problem with your repo on most if not all DVDs with subtitles; you don't have to use the DVDs I have. If nothing else, my amateur guess is dropping A25-dvdsubdec-fix-processing-of-partial-packets.patch will get you into a better state.

sr55 commented 2 years ago

These segfaults appear to be a different unrelated issue to what the original poster was raising. Without a gdb trace using a debug build, or a source file that can be shared that reproduces it, I don't think there is anything we can do. I don't have any DVD sources that trigger this.

Sargastic commented 2 years ago

I don't have any DVD sources that trigger this.

That is funny (somehow) because here, all DVD whatever their age trigger the subtitle problem. Could it be because their are Region 2 (or any region, for that matter), not the same as yours ?

Haprog commented 2 years ago

Thanks a lot for the tip of using version 1.3.3. I have this same problem when I'm using HandBrake 1.5.1 on Pop!_OS (handbrake package version 1.5.1+ds1-1build1 via apt from repo http://apt.pop-os.org/ubuntu jammy/universe amd64 Packages).

I installed the flatpak 1.3.3 version from GitHub releases and that seems to work flawlessly.

In my case I'm currently ripping my old Silver Fang (region 2, PAL, original uncut version, Japanese audio with Finnish and Swedish subs) 5-disc DVD box so they're easier to view via Plex (and on any of my devices) instead of having to swap discs. In this case for example with HandBrake 1.5.1 on episode 2 the subtitles start way too early, their durations were too little and some subtitle lines were completely missing from couple of parts of the episode which made it impossible to even manually sync them (I tried using multiple sync points with Subtitle Edit but it was not possible to get all the lines to sync up). Ripping with the same settings on 1.3.3 the subs were perfect without any manual editing.

Haprog commented 2 years ago

I might be able to provide a disk image (.dmg that produces the issue and can be opened with HandBrake) for debugging purposes if somebody provides me with some link or place to upload the 4.6 GB file into.

Haprog commented 2 years ago

I have a problem. I have Battlestar Galactica (2003) DVDs that don't work with 1.3.3 (it can't find any titles on the disc). 1.5.1 does find the titles but it has the subtitle issues. So I can use 1.3.3 only with some discs to get perfect output or in some cases I need to use 1.5.1 but then I can't get working subtitles.

Haprog commented 2 years ago

I did some testing with different versions of HandBrake.

For some discs, subs don't work properly when using HandBrake 1.5.1 from apt (the package I mentioned above), but all of my discs otherwise load fine with this (haven't seen "No Titles Found" issue).

From the official GitHub releases (x86_64.flatpak versions) I tested versions 1.3.3, 1.4.0, 1.4.1, 1.4.2 and 1.5.1.
On all of these official releases the subs seem to work correctly in all cases I tested, but some discs don't work at all with "No Title Found". At least on my Battlestar Galactica (2003) DVDs the season 1 disc 1 shows "No Title Found" when trying to load the disc on the 1.5.1 version from flatpak release and season 1 disc 2 loads only 2 of the 4 titles. The 1.5.1 version from apt finds all titles on both discs correctly but sadly it has the subtitle problem (maybe the apt version is using a newer version of some dependency that fixes an issue for more reliable loading of titles?). I'm trying to open/encode .dmg disk images of my DVDs exported from Disk Utility on a very old mac (my only computer that has a DVD drive).

So subtitle issue doesn't seem to happen on official flatpak releases. But the flatpak releases have an issue with loading some titles from discs (where unofficial release doesn't have this issue).

Haprog commented 2 years ago

I built HandBrake from master branch (20220911054142-91f7a1c69-master (x86_64)) for Linux on Pop!_OS 22.04 (based on Ubuntu 22.04) and on this self-built version everything seems to work correctly so far. Subtitles seem ok and it can even load the problematic titles on some disc images that the official flatpak releases couldn't.

Btw good job with the build process and developer documentation. Building was very simple and only took about 7 minutes on my laptop (after installing dependencies from apt). (I have some bad experiences from trying to build some other open source projects so this was a pleasant surprise).

sr55 commented 2 years ago

Regarding: Unable to read sources, raise a separate issue or discussion topic for that to avoid confusion here please. (Including a scan log)

I'm not surprised distro versions are not working correctly. Unfortautnly, there isn't much we can do about this.

Thanks for the feedback.

Haprog commented 2 years ago

Regarding: Unable to read sources, raise a separate issue or discussion topic for that to avoid confusion here please. (Including a scan log)

Of course. I'm happy now that I can personally avoid this issue by using a self-built version, but in case somebody else opens an issue about this (since it affects the releases) I can help provide logs and can test with new/other versions of handbrake.

I'm not surprised distro versions are not working correctly. Unfortautnly, there isn't much we can do about this.

I wonder if there still might be something we (as community/contributors) could do about it (even if not necessarily in the scope of this repository). It's unfortunate that this kind of issue causes bad reputation (unreliable behaviour) for HandBrake even if it's not the fault of HandBrake itself.

If somebody could figure out which library/dependency might be causing the issue with subtitle handling, we could try to see if manually upgrading/downgrading some related packages could alter the behaviour and possibly we might contribute a more informed bug report or fix suggestion for distro package maintainers for example.

I'm not sure if there's some easy way to check for differences in versions of dependencies for example which might give some hints. Maybe HandBrake could provide some debug information with some CLI command for example, like a list of used third party packages with location/path or version information if possible? Then those could be compared between two instances of HandBrake. Or is there something else outside HandBrake sources that might affect the functioning of main features of HandBrake and cause this sort of issues?

sr55 commented 2 years ago

https://github.com/HandBrake/HandBrake/tree/master/contrib/ffmpeg

You'll notice in our contrib folder that we patch a lot of the 3rd party libraries we use. Most of these patches are not yet available in the upstream projects. As you can probably infer from the patch list, it's not just subtitles that will have potential issues.

As such, if you link against a Distro version of ffmpeg, anything those patches fix for HandBrake, won't work in the distro versions.

Unfortunately, it's not reasonable to expect distro maintainers to maintain a custom version of ffmpeg for HandBrake. On the other hand, it's not practical for us to have patchless libraries at the current time. The only real option therefor is to simply not distribute HandBrake where packaging rules don't allow for statically linked libraries. Sadly, many maintainers think it's better to ship a broken version (or simply don't believe us that it will be broken).

HandBrake is only tested against specific versions of ffmpeg and the other libraries in the contrib folder. It's not uncommon to see breaks with specific versions of other libraries but we simply don't have the resources to test/track this.

It's one of the big reasons why we have Flatpak (and maybe #1722 App Image or #1702 Snap in the future if someone contributes patches). This makes this a complete non-issue.

Haprog commented 2 years ago

Thanks for the explanation!

Sadly, many maintainers think it's better to ship a broken version (or simply don't believe us that it will be broken).

😢

Haprog commented 2 years ago

Maybe HandBrake could try to detect when it's being used with unpatched dependencies (or detect that it's not an official build/release) and show a warning on startup about possible issues and link to official download or installation instructions and maybe an explainer like the above? This would guide users to be aware of the possible issues before running into them and get them use properly working versions (instead of giving up or thinking that HandBrake is broken). I'm not sure how feasible this is to implement though.

jupsoleil commented 2 years ago

Hi, if I install 1.5.1+ds1-1build1 from ubuntu 22.04's repositories and rip one of my DVDs, the subtitels are a total mess in the resulting m4v file. I downloaded the sources for 1.3.3 as suggested above, and with that version, the rip is perfect (subtitels are perfectly fine).

It seems you handbrake developers want us to use the flatpak, so I installed the flatpak version in ubuntu 22.04 - it is 1.5.1 (x86_64). It doesn't want to open any DVD.

Now I'm a little confused... What am I supposed to do/what am I doing wrong?

bernd886 commented 1 year ago

same error here with handbrake 1.5.1 (x86_64) from system repo of Ubuntu 22.04.1 LTS (5.15.0-53-generic)

sr55 commented 1 year ago

@bernd886 We don't maintain that version and it's considered unsupported.

Can you replicate it if you uninstall that and install instead: https://github.com/HandBrake/handbrake-snapshots/releases/tag/lin

@jupsoleil Ideally you don't really want to be reading DVD's direct with HandBrake, ever. MakeMKV is often used by folks as a first step. It was probably using libdvdcss previously on your system. flatpak builds do not include libdvdcss as per the rest of our builds and I'm guessing it may not be able to access the system version either that your ubuntu install probably had access to.

Alternatively, you can always compile from source. Builds this way are not restricted inside a flatpak container.

sr55 commented 1 year ago

Closing this once again as it appears to be a non-issue with official builds.

If that's not the case and anyone can reproduce this with an official build of HandBrake (either flatpack, or compiled from source with any OS version uninstalled), then please create a new ticket to avoid all the previous chatter. Include a log and if possible, a sample file that allows reproduction.

bernd886 commented 1 year ago

@sr55 using the lastest flatpak release, the issue does not occur. thx

another way to extract subtitles is to use MakeMKV and mkvextract

daviewales commented 3 weeks ago

Here are the instructions for compiling from source: https://handbrake.fr/docs/en/latest/developer/build-linux.html

I had subtitle sync issues with the Ubuntu repository version, and the flatpak (intentionally) doesn't include libdvdcss. But the source build works perfectly with my system libdvdcss.

Note: There was a flatpak extension developed independently to enable libdvdcss in the flatpak build. However, it was unfortunately bot-closed: https://github.com/flathub/flathub/pull/1863