[FFmpeg-devel] [PATCH] options to set stream id (custom TS pid)

Michael Niedermayer michaelni
Sun Jun 6 23:33:50 CEST 2010


On Sun, Jun 06, 2010 at 01:48:51PM -0700, Baptiste Coudurier wrote:
> On 6/5/10 10:30 AM, Mike Scheutzow wrote:
>> Here are updated patches incorporating Baptiste's comments.
>>
>> Baptiste Coudurier wrote:
>>> The < 16 check is useless.
>> Fixed. I also added a check for id values > 0x1FFF.
>>> Well, I'm not sure what we want to do
>>>
>>> avformat.h:
>>> * @param id file-format-dependent stream ID
>>>
>>> I don't know why we want to set it to stream index here.
>>> IMHO I would set it to 0 assuming it has no side effect.
>>> I quickly check before the last patch and I didn't see st->id usage,
>>> but I could have missed it.
>>> No strong feeling, initing streamid_map just for this seems a waste.
>> Patch modified so that an unspecified stream id is now set to 0 in the
>> AVStream struct. The streamid_map[] init operation is removed from
>> main(), but a simplified form is still present in the output_file handler.
>>> ffmpeg -i in.ts -vcodec copy -streamid 0:33 -streamid 1:36 -acodec mp2
>>> out1.ts -vcodec copy -acodec ac3 out2.ts
>>>
>>> Would also set out2 stream ids, it might not be wanted, not sure,
>> Your assumption about a second output file is not correct. I think the
>> most intuitive behavior is that the scope of a -streamid value ends at
>> the output file name. There is code in my original patch to reset the
>> streamid_map[] array to default values in the output_file handler. I
>> tested this behavior, and it worked as desired.
>>
>>
>> ffmpeg_set_streamid_v2.patch
>>
>> [...]
> >
>> @@ -3750,6 +3774,8 @@
>>       oc->flags |= AVFMT_FLAG_NONBLOCK;
>>
>>       set_context_opts(oc, avformat_opts, AV_OPT_FLAG_ENCODING_PARAM);
>> +
>> +    memset( streamid_map, 0, sizeof(streamid_map) );
>>   }
>
> Parantheses placement.
>
> > [...]
> >
>> @@ -420,6 +425,26 @@
>>           st->priv_data = ts_st;
>>           ts_st->service = service;
>>           ts_st->pid = DEFAULT_START_PID + i;
>> +        /* maintain compatibility for apps that set st->id to AVStream 
>> index */
>> +        if (st->id>= 16) {
>
> This is not the reason, pid < 16 are reserved.
>
> Except these I'm ok with with the patch.

iam ok with the parts tat fall under my maintainership as well

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100606/e3165386/attachment.pgp>



More information about the ffmpeg-devel mailing list