


# To combine video and audio into one file ffmpeg -i video.ext -i audio.ext -c:v copy -c:a copy output.ext # To add ass subtitle to the video ffmpeg -i input_video.mp4 -vf ass = sub.ass output_video_subtitles.mp4 # To convert webm to mp4 ffmpeg -i input_video.webm output_video.mp4 # To convert mp4 to mov ffmpeg -i input_video.mp4 -acodec copy -vcodec copy -f mov output_video.mov # To convert mov to mp4 ffmpeg -i input_video.mov -vcodec copy -acodec copy output_video.mp4 # Listen to 10 seconds of audio from a video file # -ss : start time # -t : seconds to cut # -autoexit : closes ffplay as soon as the audio finishes ffmpeg -ss 00 :34:24.85 -t 10 -i path/to/file.mp4 -f mp3 pipe:play | ffplay -i pipe:play -autoexit # To combine audio and video from N files: # See also cat mylist.txt file '/path/to/file1' file '/path/to/file2' file '/path/to/file3' ffmpeg -f concat -safe 0 -i mylist.txt -c copy output.mp4 tldr:ffmpeg # ffmpeg # Video conversion tool. bar # -g : GOP, for searchability ffmpeg -i input.foo -vcodec bar -acodec baz -b:v 21000k -b:a 320k -g 150 -threads 4 output.bar # To convert image sequence to video: ffmpeg -r 18 -pattern_type glob -i '*.png' -b:v 21000k -s hd1080 -vcodec vp9 -an -pix_fmt yuv420p -deinterlace output.ext # By the way, this example works non-recursively. This will be a huge time-saver! Note that this is Bash syntax. ffmpeg -i IN_FILE OUT_FILE & rm -v IN_FILE # Convert all MP3s in the CWD to OGGs, deleting the originals when successfully ffmpeg -i IN_FILE OUT_FILE # Remove the original upon successful completion of ffmpeg(1). So, if your IN_FILE has # the `.mp3` extension and your OUT_FILE has the `.ogg` extension, then your # file will be converted - but original kept in-tact - to an OGG file. Cheat.sh/ffmpeg $ curl cheat.sh/ cheat.sheets:ffmpeg # ffmpeg # Tools for transcoding, streaming and playing of multimedia files # Convert IN_FILE to OUT_FILE, based on its extension.
