[FFmpeg-devel] [PATCH]Basic XSUB encoder

Baptiste Coudurier baptiste.coudurier
Mon Feb 2 07:57:54 CET 2009


Hi,

Bj?rn Axelsson wrote:
> This is a cleanup of a patch submitted earlier by Steve Lhomme / DivX
> Corp [1].
> 
> With this command line I can encode an avi with subtitles which displays
> somewhat correctly on a PS3 and in ffplay:
> ./ffmpeg -i Starship_Troopers.vob -s 1280x536 -vtag DX50 -vcodec mpeg4 -an
> -scodec xsub -y test.avi
> 
 > [...]
>  
> +
> +static void xsub_encode_rle(uint8_t **pq,
> +                            const uint8_t *bitmap, int linesize,
> +                            int w, int h)

FFmpeg has a rle encoder in rle.c, can it be used ?

> +
> +static int xsub_init_encoder(AVCodecContext *avctx)
> +{
> +    if(! avctx->codec_tag)
> +        avctx->codec_tag = MKTAG('D','X','S','B');

space after !

> +
> +    /* Those are used by put_bmp_header. Don't know how important they are. */
> +    avctx->width = 720;
> +    avctx->height = 576;

Shouldn't it be video stream values ?

> [...]
>
> +
> +static int xsub_close_encoder(AVCodecContext *avctx)
> +{
> +    return 0;
> +}

Useless function.

> +
> +static int xsub_encode(AVCodecContext *avctx,
> +                       unsigned char *buf, int buf_size, void *data)
> +{
> +    AVSubtitle *sub = data;
> +    return encode_xsub_subtitles(avctx, buf, sub);
> +}

Useless wrapper ?

[...]

-- 
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