View This Site In Your Own Language

ffmpeg for handling audio and video files




  • images to mp4 : this command is also applicable for different name of image files

ffmpeg -framerate 1 -pattern_type glob -i '*.png'   -c:v libx264 -r 30 -pix_fmt yuv420p output.mp4

framerate : rate of passing images per second. here, 1 image per one second. you can use float number(e.g. 0.5) also.

  • croping video

ffmpeg -i input.mp4 -vf "crop=520:820" output.mp4

crop : desired shape

  • adding audio files into video files

ffmpeg -i input_video.mp4 -i input_audio.mp3 -map 0:v -map 1:a -c copy -shortest -strict -2 output.mp4

  • concatenating more than one video files : this command is also applicable for different types of video formats

ffmpeg -i input1.mp4 -i input2.webm -i input3.mp4 -i input4.mp4 -i input5.mp4 -filter_complex "[0:v:0] [0:a:0] [1:v:0] [1:a:0] [2:v:0] [2:a:0] concat=n=3:v=1:a=1 [v] [a]" -map "[v]" -map "[a]" output.mp4
ffmpeg for handling audio and video files ffmpeg for handling audio and video files Reviewed by Ikram on 6/25/2020 10:32:00 AM Rating: 5

No comments:

Powered by Blogger.