[FFmpeg-devel] [PATCH] new -vlang option (FFmpeg)

Stefano Sabatini stefano.sabatini-lala
Tue Dec 15 16:59:11 CET 2009


On date Tuesday 2009-12-15 16:07:01 +0100, Matthieu encoded:
> Greetings,
> 
> This adds -vlang option to set ISO 639 video stream language code.
> This is similar to existing -alang & -slang options.
> 
> Regards,
> Matthieu Crapet
> 
> PS: See attached patch.

> tested on: FFmpeg version SVN-r20853-snapshop
> 
> diff --git a/doc/ffmpeg-doc.texi b/doc/ffmpeg-doc.texi
> index f79b749..a0ab60d
> --- a/doc/ffmpeg-doc.texi
> +++ b/doc/ffmpeg-doc.texi
> @@ -505,6 +505,9 @@ stream.
>  @item -newvideo
>  Add a new video stream to the current output stream.
>  
> + at item -vlang @var{code}
> +Set the ISO 639 language code (3 letters) of the current video stream.
> +
>  @end table
>  
>  @section Advanced Video Options
> diff --git a/ffmpeg.c b/ffmpeg.c
> index 63aa053..b7cbd21
> --- a/ffmpeg.c
> +++ b/ffmpeg.c
> @@ -134,6 +134,7 @@ static int video_disable = 0;
>  static int video_discard = 0;
>  static char *video_codec_name = NULL;
>  static int video_codec_tag = 0;
> +static char *video_language = NULL;
>  static int same_quality = 0;
>  static int do_deinterlace = 0;
>  static int top_field_first = -1;
> @@ -3179,6 +3180,11 @@ static void new_video_stream(AVFormatContext *oc)
>          }
>      }
>      nb_ocodecs++;
> +    if (video_language) {
> +        av_metadata_set(&st->metadata, "language", video_language);
> +        av_free(video_language);
> +        video_language = NULL;

av_freep(&video_language);

BTW why not to set the language for a stream, i.e. why not simply a lang
option?

Regards.
-- 
FFmpeg = Fiendish & Fast MultiPurpose Exxagerate Ghost



More information about the ffmpeg-devel mailing list