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

Mike Scheutzow mjs973
Sat Jun 5 19:30:47 CEST 2010


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.

-- 
Mike Scheutzow


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ffmpeg_set_streamid_v2.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100605/b83d5506/attachment.asc>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mpegts_custom_pids_v3.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100605/b83d5506/attachment.txt>



More information about the ffmpeg-devel mailing list