ffmpeg 基本用法

1 视频合并
/usr/local/ffmpeg/bin/ffmpeg -f concat -safe 0 -protocol_whitelist "file,http,https,rtp,udp,tcp,tls"  -i /web/video/filelist.txt -c copy /web/video/1.mp4


filelist.txt 文件格式
file https://xxx.com/1.mp4
file https://xxx.com/2.mp4
file https://xxx.com/3.mp4
2 获取视频信息
/usr/local/ffmpeg/bin/ffmpeg -i "1.mp4"   -preset ultrafast  2>&1 
3 视频裁剪
/usr/local/ffmpeg/bin/ffmpeg -ss 0  -i test.mp4  -vcodec copy -t 5 output.mp4
表示从第0秒开始 裁剪5秒
4 消除音频
/usr/local/ffmpeg/bin/ffmpeg -i test.mp4 -vcodec copy -an  temp_novoice.mp4

  

5 插入音频 (对视频插入音频之前需要先消除音频)
/usr/local/ffmpeg/bin/ffmpeg -i test.mp4 -i music.mp3  -vcodec copy -acodec copy newfiles.mp4
原文地址:https://www.cnblogs.com/jackspider/p/15034960.html