Examples of ffmpeg command lines.
ffmpeg -i input_file.mp4 -aq 95k output_file.mp3
ffmpeg -ss 00:00:14 -i input_file.mp4 output_file.mp3
ffmpeg -t 00:05:00 -i input_file.mp4 output_file.mp3
ffmpeg -i input_file.mov -strict -2 -s 848x478 output_file.mp4
ffmpeg -re -i input_file.mov -strict -2 output_file.mp4
ffmpeg -i input.m4v -map_chapters -1 -strict -2 output_file.m4v
ffmpeg -i input_file.m4v -map_chapters -1 -c:v copy -c:a copy output_file.m4v
ffmpeg -i input_file.m4v -metadata title=“New Title” -strict -2 output_file.m4v
ffmpeg -i input_file.m4v -metadata title=“New Title” -c:v copy -c:a copy output_file.m4v
Change Video Resolution
ffmpeg -i input_file.mp4 -s 1280x720 -strict -2 output_file.mp4
Change Video Bitrate
ffmpeg -i input_file.mp4 -b:v 2000k -strict - 2 output_file.mp4
ffmpeg -i input_file.mp4 -c copy -an output_file.mp4
Extract only Video
ffmpeg -i input_file.flv -c:v copy -an output_file.m4v
Extract only Audio
ffmpeg -i input_file.flv -c:a copy -vn output_file.m4a
Combine Video and Audio
ffmpeg -i input_file.m4v -i input_file.m4a -c copy output_file.mp4
Delay Video by 1.23 seconds
ffmpeg -i input_file.mp4 -itsoffset 1.23 -i input_file.mp4 -map 1:v -map 0:a -c copy output_file.mp4
Delay Audio by 1.23 seconds
ffmpeg -i input_file.mp4 -itsoffset 1.23 -i input_file.mp4 -map 0:v -map 1:a -c copy output_file.mp4
We need a text file with the list of files in the following format:
file '/path/to/file1.wav' file '/path/to/file2.wav' file '/path/to/file3.wav'
Let’s assume we have the above list on a file named ‘list.txt’
We would use the following to concatenate the files:
ffmpeg -f concat -i list.txt -c copy output_file.wav