[FFmpeg-devel] PATCH: mpegtsenc.c

JULIAN GARDNER joolzg
Wed Jan 19 09:26:55 CET 2011



--- On Wed, 19/1/11, M?ns Rullg?rd <mans at mansr.com> wrote:

> From: M?ns Rullg?rd <mans at mansr.com>
> Subject: Re: [FFmpeg-devel] PATCH: mpegtsenc.c
> To: "FFmpeg development discussions and patches" <ffmpeg-devel at mplayerhq.hu>
> Date: Wednesday, 19 January, 2011, 2:02
> JULIAN GARDNER <joolzg at btinternet.com>
> writes:
> 
> > Hi new user here.
> >
> > I have the following patch which allows the user
> through the
> > --metadata to also change the provider name on TS
> files, a bit like
> > the title option changes the service name.
> >
> > Index: libavformat/mpegtsenc.c
> >
> ===================================================================
> > --- libavformat/mpegtsenc.c???
> (revision 25941)
> > +++ libavformat/mpegtsenc.c??? (working
> copy)
> > @@ -392,17 +392,22 @@
> >? ? ? MpegTSService *service;
> >? ? ? AVStream *st, *pcr_st = NULL;
> >? ? ? AVMetadataTag *title;
> > +? ? AVMetadataTag *program;
> >? ? ? int i, j;
> >? ? ? const char *service_name;
> > +? ? const char *program_name;
> >? ? ? int *pids;
> > +??? int default_pid =
> DEFAULT_START_PID;
> 
> That line doesn't belong.
> 
> >? ? ? ts->tsid = DEFAULT_TSID;
> >? ? ? ts->onid = DEFAULT_ONID;
> >? ? ? /* allocate a single DVB service
> */
> >? ? ? title =
> av_metadata_get(s->metadata, "title", NULL, 0);
> >? ? ? service_name = title ?
> title->value : DEFAULT_SERVICE_NAME;
> > +? ? program =
> av_metadata_get(s->metadata, "program", NULL, 0);
> > +? ? program_name = program ?
> program->value : DEFAULT_PROVIDER_NAME;
> >? ? ? service = mpegts_add_service(ts,
> DEFAULT_SID,
> > -? ? ? ? ? ? ?
> ? ? ? ? ? ? ? ?
> ???DEFAULT_PROVIDER_NAME, service_name);
> > +? ? ? ? ? ? ?
> ? ? ? ? ? ? ? ?
> ???program_name, service_name);
> >? ? ? service->pmt.write_packet =
> section_write_packet;
> >? ? ? service->pmt.opaque = s;
> >? ? ? service->pmt.cc = 15;
> 
> This change looks sane as far as the code goes.?
> However, I'm not
> sure "program" is the best choice of tag name.?
> Perhaps someone with
> a fresher memory of DVB specs and practices can comment.
> 

Sorry for the DEFAULT_PID was looking at being able to change the pid range so a muxer would have less work to do!

On the "program" i picked this because i dont think "title" is correct, and if using ffprobe or ffplay they come out as "name" and "provider_name" so some inconsistency.

As i have seen another post that does the same its up to the maintainers to which one to use.

DVB Spec "Service Descriptor" 0x48
   descriptor_tag                8 bits
   descriptor_length             8 bits
   service_type                  8 bits
   service_provider_name_length  8 bits
   for(l=0;l<N;i++)
     char                        8 bits
   service_name_length           8 bits
   for(l=0;l<N;i++)
     char                        8 bits

so these need renaming?

joolz



      



More information about the ffmpeg-devel mailing list