[FFmpeg-devel] Stream selection algorithm crossing program boundaries

Gyan Doshi gyandoshi at gmail.com
Fri May 18 20:08:55 EEST 2018

Hi Devin,

On 5/18/2018 9:17 PM, Devin Heitmueller wrote:

> Indeed when I dug into the code it became clear that there is added complexity when multiple input files are involved, if for no other reason than it’s not immediately clear which input stream comes from which file and hence it’s difficult to know which AVFormatContext to be looking at for a given stream. 

Since the proposed change will have to be in open_output_file() in 
ffmpeg_opt.c, you can check InputStream->file_index or do you mean 
something else?

> I suppose a question worth asking is whether a user would really be passing in multiple files where the streams are already arranged into programs and expect the audio to come from a different input file by default?

Based on the thousands of users I've engaged with, at SE sites, most 
users have little to middling familiarity with ffmpeg, have cribbed and 
perhaps adjusted a command from a similar operation discussed elsewhere, 
and would be unaware of whether a file sports Programs or otherwise.

if the user had clear and specific needs, they would supply -map and 
this conversation is moot. We are talking about those users relying 
either on ffmpeg "magic" or traditional behaviour they have encountered 
in past use. If multiple inputs are specified, that's a good clue that 
all inputs are intended for some use, and to me, of higher salience than 
presence of Programs, because the former is an express declaration by 
the user to ffmpeg of the resources required. The latter may be an 
incidental property of the input of which the user may or may not be aware.


More information about the ffmpeg-devel mailing list