[FFmpeg-devel] PATCH: mpegtsenc.c

Georgi Chorbadzhiyski gf
Wed Jan 19 22:36:46 CET 2011


On 1/19/11 9:35 AM, Anton Khirnov wrote:
> On Wed, Jan 19, 2011 at 02:02:59AM +0000, M?ns Rullg?rd wrote:
>> 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.
>>
> Won't one of the existing generic tags be usable for this?
> If not, the new tag should be added to the list in avformat.h so people
> know it exists without having to read the code.

Did you mean in this comment?


> /*
>  * Public Metadata API.
>  * The metadata API allows libavformat to export metadata tags to a client
>  * application using a sequence of key/value pairs. Like all strings in FFmpeg,

...

>  * album        -- name of the set this work belongs to
>  * album_artist -- main creator of the set/album, if different from artist.
>  *                 e.g. "Various Artists" for compilation albums.
>  * artist       -- main creator of the work
>  * comment      -- any additional description of the file.
>  * composer     -- who composed the work, if different from artist.
>  * copyright    -- name of copyright holder.
>  * creation_time-- date when the file was created, preferably in ISO 8601.
>  * date         -- date when the work was created, preferably in ISO 8601.
>  * disc         -- number of a subset, e.g. disc in a multi-disc collection.
>  * encoder      -- name/settings of the software/hardware that produced the file.
>  * encoded_by   -- person/group who created the file.
>  * filename     -- original name of the file.
>  * genre        -- <self-evident>.
>  * language     -- main language in which the work is performed, preferably
>  *                 in ISO 639-2 format.
>  * performer    -- artist who performed the work, if different from artist.
>  *                 E.g for "Also sprach Zarathustra", artist would be "Richard
>  *                 Strauss" and performer "London Philharmonic Orchestra".
>  * publisher    -- name of the label/publisher.
>  * title        -- name of the work.
>  * track        -- number of this work in the set, can be in form current/total.
>  */

"Publisher" is not really close to service provider name in DVB
terminology so it is not working.

-- 
Georgi Chorbadzhiyski
http://georgi.unixsol.org/



More information about the ffmpeg-devel mailing list