[FFmpeg-devel] [PATCH] vobsub in mov support

Baptiste Coudurier baptiste.coudurier
Wed Apr 1 09:54:10 CEST 2009


Hi Reimar,

On 3/31/2009 2:47 PM, Reimar D?ffinger wrote:
> Hello,
> attached patch adds support for the vobsub subtitles used by the mp4
> files created by Nero, a sample is here:
> http://samples.mplayerhq.hu/sub/NeroMP4/unsupported-embedded-subs-2.mp4
> If wanted, adding the mp4s tag can be avoided by simply skipping the "fake atom"
> handling code if id is <= 0 I think.

Rah, this ugly way store dvd subs in .mp4 :(

> ------------------------------------------------------------------------
> 
> Index: libavformat/mov.c
> ===================================================================
> --- libavformat/mov.c	(revision 18285)
> +++ libavformat/mov.c	(working copy)
> @@ -806,7 +806,8 @@
>                  if(id > 0)
>                      st->codec->codec_type = CODEC_TYPE_SUBTITLE;
>              }
> -        }
> +        } else if (st->codec->codec_type == CODEC_TYPE_SUBTITLE)
> +            id = codec_get_id(ff_codec_movsubtitle_tags, format);

I believe this hunk is not needed.

>          dprintf(c->fc, "size=%d 4CC= %c%c%c%c codec_type=%d\n", size,
>                  (format >> 0) & 0xff, (format >> 8) & 0xff, (format >> 16) & 0xff,
> @@ -997,6 +998,7 @@
>              // ttxt stsd contains display flags, justification, background
>              // color, fonts, and default styles, so fake an atom to read it
>              MOVAtom fake_atom = { .size = size - (url_ftell(pb) - start_pos) };
> +            if (id != CODEC_ID_DVD_SUBTITLE) // this contains a proper esds atom
>              mov_read_glbl(c, pb, fake_atom);
>              st->codec->codec_id= id;
>              st->codec->width = sc->width;

This hunk should be sufficient

[...]

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
checking for life_signs in -lkenny... no
FFmpeg maintainer                                  http://www.ffmpeg.org



More information about the ffmpeg-devel mailing list