ffmpeg 备忘

如果批处理有问题,那就先复制到记事本里面保存,再修改。注意编码问题

合并 若干个视频

ffmpeg -f concat -i list.txt -c copy output

list.txt
    file '1.mp4'
    file '2.mp4'

添加字幕

ffmpeg -i input.mp4 -i subtitles.srt -c:s mov_text -c:v copy -c:a copy output.mp4

转换格式

ffmpeg -i imput.mp4 -c:v h264 -c:a aac output.mp4

截取视频

ffmpeg -i imput.mp4 -ss 01:17:03 -to 01:42:45  -c:v h264 -c:a aac output.mp4

-ss 开始时间 -to 停止时间 -t 持续时间 从-ss开始计算

多线程

-threads 0 (optimal);

-threads 1 (single-threaded);

-threads 2 (2 threads for e.g. an Intel Core 2 Duo);

分辨率

-vf video filter 
-vf scale=1920:1080 或者 -vf scale=1920:-1 会按原来的比例缩放

字幕编码

ffmpeg -sub_charenc GB2312 -i aaaa.ass aaaa.srt

先写编码 在输入字幕文件
编码类型 
https://trac.ffmpeg.org/attachment/ticket/2431/sub_charenc_parameters.txt

你可能感兴趣的:(ffmpeg 备忘)