[FFmpeg-devel] [patch] export pmt and pcr pids from mpegts demuxer

Baptiste Coudurier baptiste.coudurier
Fri Jun 11 02:52:55 CEST 2010

On 06/10/2010 03:45 PM, Michael Niedermayer wrote:
> On Thu, Jun 10, 2010 at 03:30:00PM -0700, Baptiste Coudurier wrote:
>> On 06/10/2010 03:18 PM, Michael Niedermayer wrote:
>>> On Mon, Jun 07, 2010 at 07:21:09PM -0700, Baptiste Coudurier wrote:
>>>> On 06/07/2010 07:08 PM, Michael Niedermayer wrote:
>>>>> On Sun, Jun 06, 2010 at 01:11:35PM -0400, Mike Scheutzow wrote:
>>>>>> This patch allows a libav application to obtain the pmt pid(s) and pcr
>>>>>> pid(s) values parsed by the mpegts demuxer. This is useful for
>>>>>> applications
>>>>>> that need the output stream pids to match the input stream pids.
>>>>>> The pid values are added to AVProgram.metadata inside the
>>>>>> AVFormatContext.
>>>>>> Example:    key="pmt_pid" value="129"
>>>>>>       key="pcr_pid" value="1064"
>>>>>> Values are base10.  This patch supports multiple programs per transport
>>>>>> stream.
>>>>>> Feedback appreciated.
>>>>> this feels like a misuse of the metadata API
>>>> Well, I don't agree, poluting AVStream with this format specific values
>>>> seems really ugly to me.
>>> [...]
>>> Puttiing them in metadata though means they will be copied into the output
>>> files metadata too. ( like a .mkv or .mov) and further copying to mpg in a
>>> second step might then even create actual problems if the muxer does
>>> something
>>> with these tags.
>> This is a problem that was introduced intentionally, IMHO we shouldn't
>> blindly copy all metadata.
> metadata (that is data describing the video and audio content) can be copied
> blindly.
> The problem is that pcr_pid&  pmt_pid is not data describing the video/audio
> its data describing the mpeg stream

It's the same as major brand from mp4.

We are turning around here.
Polluting AVStream/AVFormatContext with this format specific information 
seems ugly to me. We are not going to add a field for every value we 
want to export.

So what do you propose ? Another field which is not called metadata ?

Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer                                  http://www.ffmpeg.org

More information about the ffmpeg-devel mailing list