[FFmpeg-devel] Add mpeg user_data CEA-608/708 extraction.

Laurent Aimar fenrir
Sun Apr 11 23:41:06 CEST 2010


On Sun, 2010-04-11 at 23:28 +0200, Michael Niedermayer wrote:
> [...]
> > Index: libavcodec/mpegvideo.h
> > ===================================================================
> > --- libavcodec/mpegvideo.h	(revision 22838)
> > +++ libavcodec/mpegvideo.h	(working copy)
> > @@ -645,6 +645,13 @@
> >  
> >      DCTELEM (*block)[64]; ///< points to one of the following blocks
> >      DCTELEM (*blocks)[8][64]; // for HQ mode we need to keep the best block
> > +
> > +#define ATSC_CC_BUF_SIZE 1024
> > +    /// Used to hold cached user_data about caption packets before the
> > +    /// frame for these packets has been created in MPV_frame_start().
> > +    uint8_t tmp_atsc_cc_buf[ATSC_CC_BUF_SIZE];
> > +    int     tmp_atsc_cc_len;
> > +
> >      int (*decode_mb)(struct MpegEncContext *s, DCTELEM block[6][64]); // used by some codecs to avoid a switch()
> >  #define SLICE_OK         0
> >  #define SLICE_ERROR     -1
> 
> if its specific to mpeg1/2 then it doesnt belong in here, especially if its 1kb
 In itself, Closed Captions data can be found in user data of mpeg-1/2,
h264 and VC-1.
 Now, CEA-608/708 restricts the number of data you can find per frame to
something like 32 cc_data (ie 32*3 bytes if you ignore the
headers/footers).
 
> > +    /** ATSC CC data CEA-608/708 \
> > +     * - encoding: unused\
> > +     * - decoding: Set by libavcodec
> > +     */\
> > +    uint8_t atsc_cc_buf[1024];\
> > +    int atsc_cc_len;\
 I am not sure if using atsc_ is really good. There are multiples way to
convey CC in user data and the ATSC way is just one of them (and yes,
some samples use more than one way at once).

 It may be simpler (and more complete) to be able to ask avcodec to
return the user_data from the ES per picture.

-- 
fenrir




More information about the ffmpeg-devel mailing list