[FFmpeg-devel] [PATCH] specify a name/description per stream

Aurelien Jacobs aurel
Wed Aug 27 20:04:13 CEST 2008


Baptiste Coudurier wrote:

> Hi,
> 
> Aurelien Jacobs wrote:
> > Hi,
> > 
> > Attached patch allows muxers/demxuers to associate a name/description to
> > each AVStream. OK to apply ?
> > 
> > Aurel
> > 
> > 
> > ------------------------------------------------------------------------
> > 
> > Index: ffmpeg.c
> > ===================================================================
> > --- ffmpeg.c	(revision 14980)
> > +++ ffmpeg.c	(working copy)
> > @@ -139,6 +139,7 @@
> >  static int intra_dc_precision = 8;
> >  static int loop_input = 0;
> >  static int loop_output = AVFMT_NOOUTPUTLOOP;
> > +static char *video_name = NULL;
> >  static int qp_hist = 0;
> >  
> >  static int intra_only = 0;
> > @@ -149,10 +150,12 @@
> >  static int audio_channels = 1;
> >  static char  *audio_codec_name = NULL;
> >  static int audio_codec_tag = 0;
> > +static char *audio_name = NULL;
> >  static char *audio_language = NULL;
> >  
> >  static int subtitle_disable = 0;
> >  static char *subtitle_codec_name = NULL;
> > +static char *subtitle_name = NULL;
> >  static char *subtitle_language = NULL;
> >  
> >  static float mux_preload= 0.5;
> > @@ -391,6 +394,7 @@
> >              url_fclose(s->pb);
> >          for(j=0;j<s->nb_streams;j++) {
> >              av_free(s->streams[j]->codec);
> > +            av_free(s->streams[j]->name);
> >              av_free(s->streams[j]);
> >          }
> 
> Unrelated but isnt't it time for a av_close_output_file ?

I agree.
I may give it a try after this patch is applied.
(but don't hesitate to do it if you feel motivated ;-)

> > [...]
> >  
> > Index: libavformat/avformat.h
> > ===================================================================
> > --- libavformat/avformat.h	(revision 14980)
> > +++ libavformat/avformat.h	(working copy)
> > @@ -409,6 +409,8 @@
> >       * - decoding: Set by libavformat.
> >       */
> >      AVRational sample_aspect_ratio;
> > +
> > +    char *name;  /**< name/description of the track */
> >  } AVStream;
> 
> Maybe char name[1024] is preferrable, like all other metadata in
> AVFormatContext ?

I tried to be consistent with other fields in AVStream, such as
filename. If an array is really preferred I can change it.
Any other opinion about this.

Aurel




More information about the ffmpeg-devel mailing list