Opened 9 years ago

Closed 9 years ago

#4254 closed enhancement (fixed)

Smarter FFmpeg — abort and do not write output when no input is supplied

Reported by: zmwangx Owned by:
Priority: normal Component: ffmpeg
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug

I hope that FFmpeg could be smart enough so that when it detects no input, it issues a warning, aborts, and does not write output. The reason for this request is that I've been bitten more than once by accidentally leaving out -i and consequently having my input video emptied (while -y is on).

How to reproduce

ffmpeg -y input.ts -c copy output.mp4

There it goes, input.ts is emptied for good.

As you can see, I obviously meant to type ffmpeg -y -i input.ts -c copy output.mp4. As far as I can tell, it should be fairly simple for FFmpeg to realize that no input is supplied. And I believe that no one ever wants to write an output with no streams (any example?).

Change History (3)

comment:1 by Timothy Gu, 9 years ago

Well it was you the user who typed -y.

in reply to:  1 comment:2 by zmwangx, 9 years ago

Replying to Timothy_Gu:

Well it was you the user who typed -y.

It makes sense, especially when you are testing something over and over again, and don't want to confirm each time. And it is especially easy to make mistakes (e.g., accidentally deleting an -i from a long command line) after you've tested over and over again. After all, in no case — whether or not -y is present — should output be written when no input is supplied. No one willfully empties a file with ffmpeg -y, when there are much simpler and unambiguous ways like cat /dev/null >.

comment:3 by Michael Niedermayer, 9 years ago

Reproduced by developer: set
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.