目录

FFmpeg

Guide

如何使用 FFmpeg 进行视频转码

FFmpeg and H.264 Encoding Guide

Snippet

Convert mp4 to gif[(cite:>Convert video to gif with ffmpeg)]:

ffmpeg -i input.mkv -vf scale=1024:-1 -t 20 -r 20 output.gif

Convert mp3 to ogg[(cite:>convert mp3 to ogg vorbis)]

ffmpeg -i input.mp3 -c:a libvorbis -q:a 4 output.ogg

Clip video [(cite:>ffmpeg视频精准剪切)] [(cite:>ffmpeg wiki: Seeking)]:

ffmpeg -ss [start-time] -accurate_seek  -i [input-file] -to [end-time] -c:v copy -c:a copy -avoid_negative_ts 1 [output-file]