[FFmpeg-devel] [PATCH] add support for text subtitles in MOV

Michael Niedermayer michaelni
Sat Jan 26 22:15:58 CET 2008


On Sat, Jan 26, 2008 at 09:48:04PM +0100, Reimar D?ffinger wrote:
> Hello,
> attached patch adds support for that.
> It discards the advanced styles version (specifying font etc) and only
> exports the text.
> You might want to do some "cosmetics", like using an extra variable or
> also checking codec_type or just adding a flag into MOVContext to
> indicate if text subtitle processing should be done...
> Samples:
> http://samples.mplayerhq.hu/mov/subtitles-embedded/subtitlemovie.mov
> http://samples.mplayerhq.hu/mov/subtitles-embedded/water_phase_diagram_cap.mov
> 
> Greetings,
> Reimar D?ffinger

[...]
> @@ -1532,6 +1535,12 @@
>      } else {
>  #endif
>          av_get_packet(s->pb, pkt, sample->size);
> +        if (s->streams[sc->ffindex]->codec->codec_id == CODEC_ID_TEXT) {
> +            int textlen = FFMIN(AV_RB16(pkt->data), sample->size - 2);
> +            textlen = FFMAX(textlen, 0);
> +            memmove(pkt->data, pkt->data + 2, textlen);
> +            pkt->size = textlen;
> +        }
>  #ifdef CONFIG_DV_DEMUXER
>          if (mov->dv_demux) {
>              void *pkt_destruct_func = pkt->destruct;

ok

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I count him braver who overcomes his desires than him who conquers his
enemies for the hardest victory is over self. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080126/8e5edc18/attachment.pgp>



More information about the ffmpeg-devel mailing list