ffmpeg -i in.mp4 out.avi
ffmpeg -i video.mp4 -i audio.wav -c:v copy -c:a copy output.mp4
ffmpeg -i video.mp4 -i audio.wav -c copy output.mkv
ffmpeg -i video.mp4 -i audio.wav -c:v copy -c:a aac -map 0:v:0 -map 1:a:0 output.mp4
Delay video by 3.84 seconds:
ffmpeg -i in.mp4 -itsoffset 3.84 -i in.mp4 -map 1:v -map 0:a -vcodec copy -acodec copy out.mp4
Delay audio by 3.84 seconds:
ffmpeg -i in.mp4 -itsoffset 3.84 -i in.mp4 -map 0:v -map 1:a -vcodec copy -acodec copy out.mp4
Use the libass library (make sure your ffmpeg install has the library in the configuration --enable-libass
).
First convert the subtitles to .ass format:
ffmpeg -i sub.srt sub.ass
Then add them using a video filter:
ffmpeg -i in.mp4 -vf ass=sub.ass out.mp4
- Locate the playlist file, e.g. using Chrome > F12 > Network > Filter: m3u8
- Download and concatenate the video fragments:
ffmpeg -i "path_to_playlist.m3u8" -c copy -bsf:a aac_adtstoasc out.mp4
If you get a "Protocol 'https not on whitelist 'file,crypto'!" error, add the protocol_whitelist
option:
ffmpeg -protocol_whitelist "file,http,https,tcp,tls" -i "path_to_playlist.m3u8" -c copy -bsf:a aac_adtstoasc out.mp4
Parameters: -r
marks the image framerate (inverse time of each image); -vf fps=25
marks the true framerate of the output.
ffmpeg -r 1/5 -i img%03d.png -c:v libx264 -vf fps=25 -pix_fmt yuv420p out.mp4
- Extract all frames:
ffmpeg -i input.mp4 thumb%04d.jpg -hide_banner
- Extract a frame each second:
ffmpeg -i input.mp4 -vf fps=1 thumb%04d.jpg -hide_banner
- Extract only one frame:
ffmpeg -i input.mp4 -ss 00:00:10.000 -vframes 1 thumb.jpg