Closed Sargastic closed 1 year ago
Are you using the Flatpak build or gentoo's own build?
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.
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 ?
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.
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.
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.
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.
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.
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
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.
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.
They chose the passive aggressive approach option (Flat out ignoring us telling them it wouldn't work properly)
If you are able to get it into a better state, that would be awesome.
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
.
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.
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.
Any chance you can build with —debug=max. and run Gdb to see where it’s crashing.
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.
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.
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.
@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.
Reopening and assigning John as there might be a small bug here. @jstebbins see comment https://github.com/HandBrake/HandBrake/issues/4029#issuecomment-1015531617
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.
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.
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.
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 ?
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.
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.
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.
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).
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).
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.
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?
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.
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).
😢
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.
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?
same error here with handbrake 1.5.1 (x86_64) from system repo of Ubuntu 22.04.1 LTS (5.15.0-53-generic)
@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.
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.
@sr55 using the lastest flatpak release, the issue does not occur. thx
another way to extract subtitles is to use MakeMKV and mkvextract
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
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
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