GNOME Bugzilla – Bug 595123
[playbin2] Should hide the difference between subtitles and subpictures
Last modified: 2009-11-12 12:28:29 UTC
Hi, IMHO playbin2 should hide the difference between subtitles and subpictures. From the application point of view it's both subtitles, just that (as an implementation detail) the subpicture subtitles are not plain text. Having this differentiation in the public playbin2 API makes it more difficult for applications to use it. Also, from the inside of playbin2, both could be handled the same way. I was planning to write a subtitlebin that abstracts this handling and for example for something like assrender it would have to do exactly the same as for something like dvdspu (the bin would have one video sink, one subtitle sink and a video src) (FYI this subtitlebin would also scale the subpicture subtitles to fit the video and all that but that's not exactly interesting for this bug I guess)
For this playsink has to be changed too... good that we don't make any real API stability guarantees yet.
Created attachment 146710 [details] [review] playbin2: Aggregate subpicture and text streams in properties Make the text stream properties reflect the aggregate of available text and subpicture streams.
This patch achieves the goal somewhat, by making subpicture streams visible and selectable via the current-text property, as per other subtitle types. There are still some limitations, and potential weirdness when both subpicture *and* text streams are available in a given file - it's probably possible to end up with 2 streams (one text, and one subpicture) being rendered at the same time, because the de-selected type doesn't get disabled properly.
Don't worry about those other weirdnesses, today or tomorrow I'll also make subtitles and subpictures internally the same for playbin2/playsink. Thanks for that patch though, saves me some time :)
Created attachment 146816 [details] [review] playsink: Use subtitleoverlay for subtitles
Created attachment 146817 [details] [review] playsink: Add a queue before subtitleoverlay This will improve playback, and the same thing is done for subpicture streams too.
Created attachment 146818 [details] [review] playbin2/playsink: Remove everything related to subpicture streams These will soon be handled the same way as subtitle streams.
Created attachment 146819 [details] [review] playbin2: Set subtitle caps as raw caps for the uridecodebins This will make sure that no subparse is ever plugged and subtitleoverlay in playsink can select whatever it wants for subtitle decodebin.
These patches are on top of those in bug #600370 btw
All this should be here too in a few minutes: http://cgit.freedesktop.org/~slomo/gst-plugins-base
Created attachment 146822 [details] assrender.dot Graph of playbin2 during playback of a Matroska file with ASS subtitles that are rendered with assrender
Created attachment 146823 [details] ssaparse.dot Same but this time without assrender installed: will use ssaparse/textoverlay
Created attachment 146824 [details] external-subtitle.dot And a bit different with an external subtitle file. Btw, to create nice pictures from this call dot -Tpng -oexternal-subtitle.png external-subtitle.dot
Created attachment 146827 [details] [review] playsink: Add a queue before the video sink if no subtitles are rendered In case there are subtitles, this queue is already before the subtitle overlay.
Ok, instead of polluting bugzilla, latest patches are here: http://cgit.freedesktop.org/~slomo/gst-plugins-base/
(In reply to comment #14) > Created an attachment (id=146827) [details] [review] > playsink: Add a queue before the video sink if no subtitles are rendered > > In case there are subtitles, this queue is already before the subtitle > overlay. Will this fix the bug http://bugzilla.gnome.org/show_bug.cgi?id=531166 ( Bug 531166 - [textoverlay] subtitles shown with delay after keyframe seek) ?
(In reply to comment #16) > (In reply to comment #14) > > Created an attachment (id=146827) [details] [review] [details] [review] > > playsink: Add a queue before the video sink if no subtitles are rendered > > > > In case there are subtitles, this queue is already before the subtitle > > overlay. > > Will this fix the bug http://bugzilla.gnome.org/show_bug.cgi?id=531166 ( Bug > 531166 - [textoverlay] subtitles shown with delay after keyframe seek) ? Depends, if its an external subtitle file: yes. For internal (i.e. inside Matroska or another container format) subtitles it only became better, not perfect yet.
commit e91458f13caa92e5c3d15f67f1c0c8b0a23a5c33 Author: Sebastian Dröge <sebastian.droege@collabora.co.uk> Date: Tue Nov 3 12:47:55 2009 +0100 playbin2: Set subtitle caps as raw caps for the uridecodebins This will make sure that no subparse is ever plugged and subtitleoverlay, that subpicture streams are handled the same was as subtitles and that subtitle renderers are used if available. Fixes bugs #595123, #570753, #591662, #591706.