GNOME Bugzilla – Bug 588638
[katedec] add x-dvd-subpicture output
Last modified: 2009-08-10 23:25:59 UTC
As requested in https://bugzilla.gnome.org/show_bug.cgi?id=525743#c37, this patch adds to katedec the ability to convert suitable background images to DVD style SPU bitmaps.
Created attachment 138432 [details] [review] Create x-dvd-subpicture bitmaps from suitable background images
The following command plays a Theora/Vorbis/Kate stream using dvdspu: gst-launch filesrc location=test.ogv ! oggdemux name=demux ! queue ! theoradec ! ffmpegcolorspace ! dvdspu name=spu ! ffmpegcolorspace ! xvimagesink demux. ! queue ! katedec ! spu.
Ah, yes: it seems that displaying a SPU outside the video crashes dvdspu. This can happen if a DVD was encoded at a lower than original resolution. Images are kept in the Kate stream at original resolution. This looks to be a bug in dvdspu (encoding the SPU to display at 0x0 makes it work fine (as it's fully onscreen for my test case then)). Since katedec does not know the size of the video the SPU will be drawn onto, it cannot rescale it at decode time (which is what the tiger element does, as it overlays). Storing pre-scaled images in the Kate stream seems like a poor idea (and doesn't fix the problem anyway) as upscaling the video on playback will have lesser resolution subtitles).
I was pretty focussed on DVD as I wrote the dvdspu element - there may be more than a few places where it assumes it's doing either 720x480 or 720x576 video in some way. That said, I didn't have much trouble adapting it to support Blu-ray PGS subpictures, so it can handle (for e.g.) 1920x1080 OK too - it may just need extra checks around only rendering within the video frame.
Created attachment 138808 [details] [review] add two category names to the simple subtitles type check This is to be applied after the patch to add 'SUB' to the new split-media-type-in-two change in https://bugzilla.gnome.org/show_bug.cgi?id=525743 so image based subs can go through katedec too.
Could you udpate this/these so they apply against git master?
Oops.
Created attachment 138818 [details] [review] Create SPU format images from suitable background images Replaces and merges the two patches, against this morning's git master.
Great stuff, thanks! commit 7ae5022cee9bdcb46f62b109058caf82fe2db2be Author: Vincent Penquerc'h <ogg.k.ogg.k@googlemail.com> Date: Mon Jul 20 13:54:49 2009 +0100 katedec: create SPU format images from suitable background images Make katedec fabricate dvd-style subpictures for subtitle overlay bitmaps, for easier playbin2 integration (#588638). Now we just need to make dvdspu handle 'oversized' subpicture input properly, then we can hook everything up in playbin2.
Thanks for the rapid fire commits. I'll try to have a look at fixing the dvdspu one, but it's code I'm not familiar with, so might take some time. Besides, there are cases where it'll be unreadable due to clipping, unless scaled (which has its own readability problems).
dvdspu fixed (for my test cases): http://bugzilla.gnome.org/show_bug.cgi?id=589609