H.264 + MP4 container, no audio
ffmpeg -i in.avi -vcodec h264 out.mp4
ffmpeg -i in.avi -ss 00:12:34 -t 01:23:45 out.mp4
-ss : the starting timecode, hh:mm:ss.xxx -t : the duration to transcode after the starting timecode, If omitted, will encode to the end.
-vcodec copy -acodec copy -vn : ignore video -an : ignore audio
To encode an image sequence to a video file:
ffmpeg -framerate 25 -i “image_%03d.png” -vcodec h264 -b:v 10485760 out.mp4
ffmpeg -framerate 24 -start_number 12 -i “image_%03d.png” -vcodec h264 -b:v 10485760 out.mp4
-b:v : the video bitrate of the output file
Transcode a video to an image sequence:
ffmpeg -i in.mp4 -vocdec png -an “image_%03d.png”
Rotate video
0 = 90CounterClockwise and Vertical Flip (default)
1 = 90Clockwise
2 = 90CounterClockwise
3 = 90Clockwise and Vertical Flip
To rotate 180 degress, instead use “transpose=2,transpose=2”
ffmpeg -i in.mp4 -vf “transpose=1” -codec:a copy out.mp4
'C, C++ > FFmepg' 카테고리의 다른 글
Cutting Videos Based on Time Range using FFmpeg (0) | 2022.11.23 |
---|---|
FFmpeg CLI Tips (0) | 2021.09.01 |