[FFmpeg-devel] [PATCH] make image2 muxer/demuxer support sequence of individual rawvideo files

Måns Rullgård mans
Thu Feb 10 13:20:31 CET 2011


Peter Ross <pross at xvid.org> writes:

> ---
>  libavformat/img2.c |   13 ++++++++++---
>  1 files changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/libavformat/img2.c b/libavformat/img2.c
> index 9583eea..8137970 100644
> --- a/libavformat/img2.c
> +++ b/libavformat/img2.c
> @@ -31,6 +31,7 @@ typedef struct {
>      int img_number;
>      int img_count;
>      int is_pipe;
> +    int is_y;
>      char path[1024];
>  } VideoData;
>
> @@ -55,6 +56,7 @@ static const IdStrMap img_tags[] = {
>      { CODEC_ID_MPEG2VIDEO, "mpg2-img"},
>      { CODEC_ID_MPEG4     , "mpg4-img"},
>      { CODEC_ID_FFV1      , "ffv1-img"},
> +    { CODEC_ID_RAWVIDEO  , "raw"},
>      { CODEC_ID_RAWVIDEO  , "y"},
>      { CODEC_ID_BMP       , "bmp"},
>      { CODEC_ID_GIF       , "gif"},
> @@ -240,6 +242,8 @@ static int read_header(AVFormatContext *s1, AVFormatParameters *ap)
>          st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
>          st->codec->codec_id = s1->audio_codec_id;
>      }else{
> +        const char *str= strrchr(s->path, '.');
> +        s->is_y = str && !strcasecmp(str + 1, "y");
>          st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
>          st->codec->codec_id = av_str2id(img_tags, s->path);
>      }

I don't understand the purpose of the is_y field.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list