[FFmpeg-devel] [PATCH] Add SUP (raw BluRay PGS subtitle) muxer

Petri Hintukainen phintuka at gmail.com
Fri Aug 29 23:29:46 CEST 2014


On pe, 2014-08-29 at 12:51 +0200, wm4 wrote:
>
> Do you plan on writing a demuxer too? If not, then I'd give it a try.

Probably not (at least in next week or two).

It should be simple to parse :). After the header there's always segment
type byte and length (16-bits BE). Without index seeking is not possible
(file must be read from beginning to end).

I don't know if there should be also parser ? mkvmerge seems to combine
several PGS segments to single packet. ffmpeg matroska demuxer does not
split matroska packets back to PGS segments, so remuxing subtitles from
such .mkv file results in broken .sup file.
mkvextract correctly splits packets back to segments, but of course most
of the timestamps have been lost.

Another option would be splitting AVFrame back to PGS segments in .sup
muxer. Or it could check segment length and refuse to mux if segment
length does not match with input frame.

With m2ts input ("native" PGS container) there are no problems because
of each segment must be packed to separate PES frame.


- Petri



More information about the ffmpeg-devel mailing list