php ffmpeg 覆盖输出文件(如果存在)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/39788972/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
ffmpeg override output file if exists
提问by Muhammad Omer Aslam
I am creating a clip from an audio file .FLAC
with a start
and end
time, here is my command
.
我创建从一个音频文件的剪辑.FLAC
带start
和end
时间,这里是我的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,
我将此命令与我的PHP
代码一起使用,我的问题是,
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.
如果文件存在,我应该使用什么switch
或额外的东西command
来自动覆盖。
回答by Veer
use option -y
with your command
将选项-y
与您的命令一起使用
ffmpeg -y
-i /audio/your_file_name.flac
-t 51
-ss 69
/clips/your_clip_name.mp3 2>&1 >> /ffmpegLogs.log
回答by Muhammad Omer Aslam
I need to add the -y
global switch before specifying the output file to accomplish this
我需要-y
在指定输出文件之前添加全局开关来完成这个
ffmpeg -i /audio/191079007530_1_01.flac -t 51 -ss 69 -y /clips/44z274v23303t264y2z2s2s2746454t234_clip.mp3 2>&1 >> /ffmpegLogs.log
Alternatively, you can use the
-n
option to deny overriding the file.
或者,您可以使用该
-n
选项拒绝覆盖文件。