[PATCH] Basic SSA subtitle support
Forum rules
*******************************
Please be aware we are now using GitHub for issue tracking and feature requests.
- This section of the forum is now closed to new topics.
*******************************
*******************************
Please be aware we are now using GitHub for issue tracking and feature requests.
- This section of the forum is now closed to new topics.
*******************************
[PATCH] Basic SSA subtitle support
I've written an initial SSA->UTF-8 subtitle decoder. Works perfectly as-is but doesn't yet support recognition of bold, italic, and underline styling.
I've also slightly improved out-of-memory handling in the TX3G subtitle decoder.
The initial patch:
http://handbrake.fr/pastebin/pastebin.php?show=1429
I'll get an updated patch with bold/italic/underline support. Will almost certainly make the parsing code more complex. :wink:
I've also slightly improved out-of-memory handling in the TX3G subtitle decoder.
The initial patch:
http://handbrake.fr/pastebin/pastebin.php?show=1429
I'll get an updated patch with bold/italic/underline support. Will almost certainly make the parsing code more complex. :wink:
Re: [PATCH] Basic SSA subtitle support
OMG, Awesome work! Very much looking forward to when being able to render SSA to the video track, but still, this is fantastic.
Re: [PATCH] Basic SSA subtitle support
The only issue I've seen is when there are multiple subtitles appearing on screen at the same time, during opening sequences with music lyrics and dialogue, for example. This is should be expected and is just the nature of the beast, IMO. Watching the encoded video, it looks like it tries to display all subtitles, but gets behind. It will eventually sync it self up again once subtitle activity has decreased.
Re: [PATCH] Basic SSA subtitle support
All good to go and polished:
http://handbrake.fr/pastebin/pastebin.php?show=1437
Changes:
I have tested this with the following interesting subtitles:
1. aaa{\b1\i1}bbbcccdddeeefff
2. aaa{\u1\b1}bbb{\b0\be1\i1\u0}cccdddeeefff
3. aaa{\u1\b1}bbb{\i1}cccdddeeefff
4. aaa{\u1\b1}bbb{\i1\b0}cccdddeeefff
Next up: SSA burn-in support with libass
http://handbrake.fr/pastebin/pastebin.php?show=1437
Changes:
Code: Select all
SSA->UTF-8 subtitle decoder. Contributed by davidfstr.
* Also slightly improved out-of-memory handling in the TX3G subtitle decoder.
1. aaa{\b1\i1}bbbcccdddeeefff
2. aaa{\u1\b1}bbb{\b0\be1\i1\u0}cccdddeeefff
3. aaa{\u1\b1}bbb{\i1}cccdddeeefff
4. aaa{\u1\b1}bbb{\i1\b0}cccdddeeefff
Next up: SSA burn-in support with libass
Re: [PATCH] Basic SSA subtitle support
Hi David,
any substitle rendered in HB should not be input type specific. Instead it should render the plain utf text subs in the hb subtitle packets. If the markup becomes an issue we'll have to specify what the expected format is in a hb sub.
Cheers Ed.
any substitle rendered in HB should not be input type specific. Instead it should render the plain utf text subs in the hb subtitle packets. If the markup becomes an issue we'll have to specify what the expected format is in a hb sub.
Cheers Ed.
Re: [PATCH] Basic SSA subtitle support
In the case of rendered SSA subs, I wasn't going to use the UTF-8 text at all.
I was planning on modifying dec-ssa-sub to use libass to create an output packet in the PICTURESUB format when the subtitle track is configured to output to PICTURESUB. If the output format is TEXTSUB, dec-ssa-sub would use the behavior indicated in this patch.
In case I was unclear, this patch is ready for review. I will be doing SSA burn-in in a separate patch.
I was planning on modifying dec-ssa-sub to use libass to create an output packet in the PICTURESUB format when the subtitle track is configured to output to PICTURESUB. If the output format is TEXTSUB, dec-ssa-sub would use the behavior indicated in this patch.
In case I was unclear, this patch is ready for review. I will be doing SSA burn-in in a separate patch.
Re: [PATCH] Basic SSA subtitle support
Patch 1437 updated to apply cleanly to r3341: http://handbrake.fr/pastebin/pastebin.php?show=1449
- JohnAStebbins
- HandBrake Team
- Posts: 5773
- Joined: Sat Feb 09, 2008 7:21 pm
Re: [PATCH] Basic SSA subtitle support
Thanks for updating the patch Rodeo.
Committed http://trac.handbrake.fr/changeset/3342
Committed http://trac.handbrake.fr/changeset/3342
Re: [PATCH] Basic SSA subtitle support
Think this might have broke building, at least on OSX for me. Link error with _hb_decssasub undefined.
This is with a clean checkout of svn3342 on a core 2 duo mac, previously successfully used to build several earlier svn versions up to and including svn3339 yesterday. :-)
Full log of build: http://handbrake.fr/pastebin/pastebin.php?show=1452
(As I just reported a subtitling related bug seen on svn3339 and svn3340 and i just saw these committed I thought I'd look see if there was any difference or anything more in activity log. But can't as it won't build. :-))
Forget to svn add something? ;-)
This is with a clean checkout of svn3342 on a core 2 duo mac, previously successfully used to build several earlier svn versions up to and including svn3339 yesterday. :-)
Full log of build: http://handbrake.fr/pastebin/pastebin.php?show=1452
(As I just reported a subtitling related bug seen on svn3339 and svn3340 and i just saw these committed I thought I'd look see if there was any difference or anything more in activity log. But can't as it won't build. :-))
Forget to svn add something? ;-)
- JohnAStebbins
- HandBrake Team
- Posts: 5773
- Joined: Sat Feb 09, 2008 7:21 pm
Re: [PATCH] Basic SSA subtitle support
Confirmed; it builds, ship it. :-)
Re: [PATCH] Basic SSA subtitle support
Just noticed a buffer overflow that snuck in with the rich-text enhancements.
The following line in libhb/decssasub.c:
should read:
The following line in libhb/decssasub.c:
Code: Select all
int maxOutputSize = (end - pos) + ((numStyleOverrides + 1) * MAX_OVERHEAD_PER_OVERRIDE);
Code: Select all
int maxOutputSize = (end - textFieldPos) + ((numStyleOverrides + 1) * MAX_OVERHEAD_PER_OVERRIDE);
- JohnAStebbins
- HandBrake Team
- Posts: 5773
- Joined: Sat Feb 09, 2008 7:21 pm