[Fwd: Re: [gst-devel] Subtitle support in 0.10]

Michal Benes michal.benes at xeris.cz
Fri Dec 16 12:14:02 CET 2005


Hi Wim,


> If you don't know the positions of the subtitles (some muxed formats?,
> mpeg for sure) 

	Yes, this is my case. I want to take DVD subtitles reencode them to PNG
and mux them to matroska. (In future, OCR may be implemented)

	Actually, subtitles are not the only problem. There are some DVDs where
audio stream ends some seconds before the video stream ends. This causes
that collectpads block the entire pad - note that dvddemux do not know
if the audio stream ended until the end of file is reached. Of course,
large queue would help here but this is not a systematic solution. 

> sending an empty subtitle buffer at regular times might
> do the trick. I don't consider this more of a hack then sending filler
> events every now and then and makes it easier to deal with for elements
> since they don't have to combine events and buffers to reconstruct a
> continuous stream. 

	I know some people consider filler events or empty buffers as hacks but
sparse streams do happen. I have not yet found a better solution.

> 
> Another option is to mark pads on collectpads as sparse so that they
> don't block collecting of the other pads. If data arrives on such sparse
> pads, it can be collected.  

	The problem with this approach is that the muxer can not assure that
the subtitle packets will not be muxed much later than the corresponding
audio packets. In practice, there will probably be no problem, still, it
breaks the idea that the muxers should be able to sort the streams
according to their timestamps.

	My current idea is to put a 2 seconds large queue before each
matroskamux sink pads, when any of these queues overrun, then I push an
empty buffer with timestamp T + (1 * GST_SECOND) to all pads which has
no buffer collected and their queue is empty. Nearly all of this hackery
will be done from the application so I will not need to implement these
hacks to the existing plugins.

	Michal





More information about the gstreamer-devel mailing list