ffmpeg override output file if exists

Muhammad Omer Aslam picture Muhammad Omer Aslam · Sep 30, 2016 · Viewed 87.5k times · Source

I am creating a clip from an audio file .FLAC with a start and end time, here is my command.

ffmpeg -i /audio/191079007530_1_01.flac 
       -t 51 
       -ss 69 
       /clips/44z274v23303t264y2z2s2s2746454t234_clip.mp3 
       2>&1 >> /ffmpegLogs.log

I use this command with my PHP code and my question is,

When i run the above command on the console it asks me to

override the output file if the output file already exists in the destination,

what switch or extra command should I use to automatically override if the file exists.

Answer

Veer picture Veer · Sep 30, 2016

use option -y with your command

ffmpeg -y 
-i /audio/your_file_name.flac 
-t 51 
-ss 69 
/clips/your_clip_name.mp3 2>&1 >> /ffmpegLogs.log