Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#1032972: handbrake: debian version of handbrake does NOT handle subtitles correctly

32 views
Skip to first unread message

js

unread,
Mar 14, 2023, 7:50:03 PM3/14/23
to
Package: handbrake
Version: 1.6.1+ds1-1
Severity: important

Dear Maintainer,

===================================================================================================

* What led up to the situation?

Tried to convert 2 different DVDs, both NTSC, into m4v (or mp4)
including subtitles.

In both cases, using many different options for handbrake (H264,
H265, different audio encoders, etc), was easily able add subtitles
(as well as burn-in). HOWEVER: the subtitles NEVER worked correctly:
- there are places where characters speak and no subtitles appear at
all
- also places where characters speak at length and a subtitle pops
up for only a second
- parts where there is lenghty narration, but no character speaks, and no
subtitle appears ever

NOTE: in both DVDs, playing the DVD directly results in subtitles
working perfectly. The DVDs have subtitles working but the debian
package of handbrake does not work.

* What exactly did you do (or not do) that was effective (or ineffective)?

I contacted handbrake.fr and they recommended using their nightly
snapshot as they claim debian is using a version of ffmpeg that
breaks subtitles.

Entire thread is at: https://forum.handbrake.fr/viewtopic.php?p=202972#p202972

Using the nightly snapshot from handbrake.fr worked perfectly and
produced an m4v file with subtitles that match exactly the
characters.

* What outcome did you expect instead?

I expected the debian packaged handbrake to work exactly as the one
from the upstream source but it does not. Failure to generate all
subtitles and insert them at the correct spot in the video is a major
failure that makes this packaged version of handbrake unusable for
videos with subtitles.

I recommend adding a test case of ripping a DVD with subtitles AND
verifying that the subtitles really match the speech.

===================================================================================================


-- System Information:
Debian Release: bookworm/sid
APT prefers testing-security

APT policy: (500, 'testing-security'), (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 6.1.0-1-amd64 (SMP w/6 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_FIRMWARE_WORKAROUND, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to C.UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages handbrake depends on:
ii libass9 1:0.17.0-2
ii libavcodec-extra59 [libavcodec59] 7:5.1.2-3
ii libavfilter-extra8 [libavfilter8] 7:5.1.2-3
ii libavformat59 7:5.1.2-3
ii libavutil57 7:5.1.2-3
ii libbluray2 1:1.3.4-1
ii libc6 2.36-8
ii libcairo2 1.16.0-7
ii libdvdnav4 6.1.1-1
ii libdvdread8 6.1.3-1
ii libgdk-pixbuf-2.0-0 2.42.10+dfsg-1+b1
ii libglib2.0-0 2.74.5-1
ii libgstreamer-plugins-base1.0-0 1.22.0-3
ii libgstreamer1.0-0 1.22.0-2
ii libgtk-3-0 3.24.36-4
ii libgudev-1.0-0 237-2
ii libjansson4 2.14-2
ii libpango-1.0-0 1.50.12+ds-1
ii libswresample4 7:5.1.2-3
ii libswscale6 7:5.1.2-3
ii libtheora0 1.1.1+dfsg.1-16.1
ii libturbojpeg0 1:2.1.5-2
ii libva-drm2 2.17.0-1
ii libva2 2.17.0-1
ii libvorbis0a 1.3.7-1
ii libvorbisenc2 1.3.7-1
ii libvpl2 2023.1.1-1
ii libx264-164 2:0.164.3095+gitbaee400-2+b1
ii libx265-199 3.5-2+b1
ii libxml2 2.9.14+dfsg-1.1+b3

Versions of packages handbrake recommends:
ii gstreamer1.0-alsa 1.22.0-3
ii gstreamer1.0-libav 1.22.0-2
ii gstreamer1.0-pulseaudio 1.22.0-4
ii gstreamer1.0-x 1.22.0-3

handbrake suggests no packages.

-- no debconf information

cyba...@web.de

unread,
Jan 27, 2024, 7:40:04 AM1/27/24
to
On Wed, 22 Nov 2023 16:04:21 +0100 michael spreng <deb...@m.spreng.ch>
wrote:
> I stumbled on this issue as well. It looks to me like this patch:
> https://github.com/HandBrake/HandBrake/blob/master/contrib/ffmpeg/A07-dvdsubdec-use-pts-of-initial-packet.patch
> is particularly important for how handbrake handles dvd sub titles.
>
> My understanding is: dvd subtitles are large (being images) and will
> usually exceed a packet in the stream. ffmpeg only returns the pts with
> the first invocation (packet), where no complete subtitle results. The
> second invocation (packet), which usually completes the subtitle and
> results in a complete subtitle returned, does not contain the pts anymore.
>
> The above mentioned patch to ffmpeg changes ffmpeg to remember the pts.
> But handbrake can remember the pts just as well. So see the attached
> patch which does exactly that: if the subtitle is incomplete, it saves
> the pts to the handbrake subtitle context, and retrieves it if there is
> no pts on a completed subtitle ready for output.
>
> I am unsure how to proceed from here. Is that fix acceptable? Where
> would I submit it?
I tried this patch out and it works. Subtitles are with right timings.

Moritz Mühlenhoff

unread,
Jan 29, 2024, 5:00:06 PM1/29/24
to
Hi Michael,
thanks for looking into this!

michael spreng wrote:
> The above mentioned patch to ffmpeg changes ffmpeg to remember the pts. But
> handbrake can remember the pts just as well. So see the attached patch which
> does exactly that: if the subtitle is incomplete, it saves the pts to the
> handbrake subtitle context, and retrieves it if there is no pts on a
> completed subtitle ready for output.
>
> I am unsure how to proceed from here. Is that fix acceptable? Where would I
> submit it?

Can you please send/propose this upstream, they are in a much better position
to assess this approach.

Either by making a pull request https://github.com/HandBrake/HandBrake or
by opening an issue there.

Cheers,
Moritz

michael spreng

unread,
Jan 30, 2024, 2:40:05 AM1/30/24
to

Hi Moritz

On 29/01/2024 22:48, Moritz Mühlenhoff wrote:
Can you please send/propose this upstream, they are in a much better position
to assess this approach.

Either by making a pull request https://github.com/HandBrake/HandBrake or
by opening an issue there.

It has been reported here: https://github.com/HandBrake/HandBrake/issues/4029

In short: HandBrake developers insist that handbrake is buildt with their heavily patched version of ffmpeg (they prefer ffmpeg handling the pts). The Debian package gets branded as unsupported. FFmpeg on the other hand does not accept that "convenience" patch (reasoning "That makes no sense": https://trac.ffmpeg.org/ticket/10681). And Debian seems to be caught in the middle of the hardened positions between those two projects.

So sorry, someone has already tried that, and unfortunately for human reasons that has failed. Debian has may sympathy, being the anonymous bystander caught in the proverbial crossfire.

Thank you for your efforts to resolve this,

Michael

0 new messages