[FFmpeg-user] feature proposal - avoid overwriting the input file

DopeLabs dopelabs at dubstep.fm
Wed Oct 11 21:01:20 EEST 2017


ffmpeg commands are all structured in a specific and standardized way

a few bits from the description on the man page

ffmpeg [global_options] {[input_file_options] -i input_url} ... {[output_file_options] output_url} ...

ffmpeg reads from an arbitrary number of input "files" (which can be regular files, pipes, network streams, grabbing devices, etc.), specified by the "-i" option, and writes to an arbitrary number of output
"files", which are specified by a plain output url. Anything found on the command line which cannot be interpreted as an option is considered to be an output url.

Each input or output url can, in principle, contain any number of streams of different types (video/audio/subtitle/attachment/data). The allowed number and/or types of streams may be limited by the container
format. Selecting which streams from which inputs will go into which output is either done automatically or with the "-map" option (see the Stream selection chapter).

To refer to input files in options, you must use their indices (0-based). E.g.  the first input file is 0, the second is 1, etc. Similarly, streams within a file are referred to by their indices. E.g. "2:3"
refers to the fourth stream in the third input file. Also see the Stream specifiers chapter.

As a general rule, options are applied to the next specified file. Therefore, order is important, and you can have the same option on the command line multiple times. Each occurrence is then applied to the
next input or output file.  Exceptions from this rule are the global options (e.g. verbosity level), which should be specified first.

Do not mix input and output files -- first specify all input files, then all output files. Also do not mix options which belong to different files. All options apply ONLY to the next input or output file and
are reset between files.


in your example 

> $ ffmpeg -i input.mp4 [...] -yo output.mov

ffmpeg -i input.mp4 [..] output.mov

works just fine no need to add -y because .mov is a different filename

> $ ffmpeg -yo output.mov -i input.mp4 [...]

is incorrect structure for ffmpeg...

> The order shouldn't overly matter

it matters... see above



> On Oct 11, 2017, at 8:39 06AM, Douglas Marsh <ffmpeg at dx9s.net> wrote:
> 
> On 2017-10-10 18:18, Mikhail V wrote:
>> James Girotti wrote:
>> Sure, I am. But anybody can miss the typo, and its not so easy to
>> notice in console or text editor, its just two chars
>> in a pile of chars.
> 
> 
> Perhaps then add a new switch.. something *like*
> 
> $ ffmpeg -i input.mp4 [...] -yo output.mov
> 
> 
> (for "Yes Output/Overwrite" where the parameter that MUST come next is the filename)
> 
> and the following example would NOT work:
> 
> $ ffmpeg -yo -i input/mp4 [...] output.mov
> 
> as -yo has no parameter [the filename to overwrite] and assuming "output.mov" exist so it would not overwrite without prompt. The order shouldn't overly matter as the following COULD work:
> 
> $ ffmpeg -yo output.mov -i input.mp4 [...]
> 
> 
> Just an idea.
> 
> 
> --Doug (dx9s)
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
> 
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".



More information about the ffmpeg-user mailing list