

Image-%2d.png – Indicates how we want to name the extracted image. f-Indicates the output format, that is, in our case, it is an image. That is, the number of frames to images is extracted every second. Extract images from videos ffmpeg -i input.mp4 -r 1 -f image2 image-%2d.png

You can use the -ab flag to indicate the bit rate of the output fileįfmpeg -i input.mp4 -vn -ab 320 output.mp3 9. Remove the video stream from a media file (convert the given media file to an audio file) ffmpeg -i input.mp4 -vn output.mp3 Remove audio stream from a video file ffmpeg -i input.mp4 -an output.mp4 Compress audio files ffmpeg -i input.mp3 -ab 128 output.mp3ģ20kbps 7. You can use the following options to convert the encoded audio to reduce the bit rate, make it stereo, and reduce the size. If 24 is too aggressive, you can lower the -crf value to or lower. Reducing the size of the video file will lose the video quality. Compress video files ffmpeg -i input.mp4 -vf scale=1280:-1 -c:v libx264 -preset veryslow -crf 24 output.mp4 Change the resolution of the video file ffmpeg -i input.mp4 -filter:v scale=1280:720 -c:a copy output.mp4įfmpeg -i input.mp4 -s 1280x720 -c:a copy output.mp4 5. ar-Set the audio frequency of the output file. vn-Indicates that we have disabled video recording in the output file. In addition, you can also use various audio conversion encoding options for the output files, as demonstrated below.įfmpeg -i input.mp4 -vn -ar 44100 -ac 2 -ab 320 -f mp3 output.mp3 Convert video files to audio files ffmpeg -i input.mp4 -vn output.mp3 If you want to maintain the quality of your source video file, use -qscale 0įfmpeg -i input.webm -qscale 0 output.mp4 3. Convert video files to different formats ffmpeg -i video.mp4 video.avi > You can convert media files to any format you choose For example, to convert YouTube flv format video to mpeg format To display the details of your media files ffmpeg -i video.mp4įfmpeg -i image.png > Just look at media file information ffmpeg -i video.mp4 -hide_bannerįfmpeg -i image.png -hide_banner 2. FFmpeg supported format ffmpeg -formats 1.
