HandBrake icon indicating copy to clipboard operation
HandBrake copied to clipboard

Subtitles improvments

Open jstebbins opened this issue 5 years ago • 11 comments

Description of Change:

  • Adds to libhb ability to mux to external subtitle files (currently ass and sup). This is not wired to any frontend yet. UIX design work remains.
  • Many ffmpeg patches to improve decoding and encoding of TX3G subs
  • Turnes on TX3G subtitle decoding with ffmpeg. We were still using our own decoder due to missing features in ffmpeg's decoder.
  • Adds a libav subtitle encoder to the subtitles pipeline. This is currently only used for transcoding text subtitles to TX3G for mp4 container output.

Test on:

  • [ ] Windows 10+ (via MinGW)
  • [ ] macOS 10.13+
  • [x] Ubuntu Linux

jstebbins avatar Apr 05 '20 22:04 jstebbins

Impressive.

Kudos for the upstream fixes, and upstreaming HandBrake functionality to FFmpeg. Should benefit many, even those outside HandBrake's reach.

bradleysepos avatar Apr 06 '20 10:04 bradleysepos

I haven't submitted patches to ffmpeg yet. I need to run everything through FATE tests and it would be nice to get a bit more than my few test cases thrown at it first.

The patches basically bring ffmpeg up the the level our own decoder/encoder were at, plus one improvement that supports transcoding font tags from ass to tx3g. It's limited to the fonts specified in the ass style header, but it's better than "all fonts are Arial" like we had or "all fonts are Serif" like ffmpeg had.

jstebbins avatar Apr 06 '20 14:04 jstebbins

I haven't submitted patches to ffmpeg yet.

I just assumed you will eventually. 😉

The patches basically bring ffmpeg up the the level our own decoder/encoder were at...

That's what the initial read looked like to me. How long before we stop telling people HandBrake isn't an FFmpeg front end? 😝

bradleysepos avatar Apr 06 '20 14:04 bradleysepos

This worth re-visting for 1.4?

sr55 avatar Mar 31 '21 17:03 sr55

Holy cow, I forgot I even started this. I'm going to have to take some time to go over all this again.

jstebbins avatar May 09 '21 13:05 jstebbins

We should look into the ffmpeg bump before I dig back into this. I may need to adapt patches after the bump.

jstebbins avatar May 09 '21 13:05 jstebbins

Rebased on master. Did a couple quick tests of SSA to tx3g and back to SSA encoding. But more testing is needed before calling this good (like some valgrind runs).

Might want to add export to external subtitle file capability to at least the CLI since the capability in in libhb, but that can be a follow-on PR.

If anyone has good samples of tx3g that uses more style or font features, please pass them along and/or do some testing.

Thanks!

jstebbins avatar Jun 04 '21 16:06 jstebbins

Image Subtitles:

  • [x] PGS Subtitles MKV
  • [x] PGS Subtitles MP4 Burn in
  • [x] VobSub Passthru
  • [x] VobSub Burnin

Text Subtitles

  • [x] MKV, SRT
  • [x] MKV, SRT, Burnin
  • [x] MP4, SRT
  • [ ] MP4, SRT, Burnin (No Output) https://gist.github.com/sr55/3f28e6636ce5c476713bec0befc0add7

Real SRT.zip

sr55 avatar Jun 05 '21 13:06 sr55

Awesome! thanks for the testing. I'll look into that problem with burnin probably thrusday or friday. My day job has me busy this week :wink:

jstebbins avatar Jun 07 '21 13:06 jstebbins

Re-targeting for 1.6.0.

bradleysepos avatar Jan 06 '22 03:01 bradleysepos

Is there any plan to ship it in the next release ?

3z3qu13l avatar Feb 14 '24 07:02 3z3qu13l