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

Mike Scheutzow scheutzow
Fri May 14 19:44:20 CEST 2010

Baptiste Coudurier wrote:
> Hey guys,
> $subject.

Hi Baptiste,

Here are a few more thoughts on the ffmpeg.c part of this patch:

1) if the new options are not used, then this patch sets all AVStream.id 
values to 0. I think the old behavior should be kept.

2. This ffmpeg.c implementation doesn't seem to allow putting 2 audio 
streams in the output file. Will ffmpeg.c try to assign them the same 
stream id value?

3. The new -vid, -aid, -sid command line options for ffmpeg.c seem very 
narrowly targeted. A generic approach would allow specifying the actual 
AVStream index for the output context so that other types of data could 
have their id set.

And I don't see how these proposed options would be cleanly extended to 
allow that. Would you create a 4th option to generically set AVStream.id?

Seems ugly to have so many ways to set the AVStream.id value.

How about this alternate syntax, which could eventually handle all these 

	-streamid output_stream_index:new_id_value

When output_stream_index field is an integer, it specifies a stream 
index. But the field could be extended to permit non-integer values: the 
special value "v" could mean 'first video stream', "a" could mean 'first 
audio stream" and "s" could mean 'first subtitle stream'.

Example 1:
	-streamid 0:32 -streamid 1:36

Example 2:
	-streamid v:32 -streamid a:36

Mike Scheutzow

More information about the ffmpeg-devel mailing list