FFmpeg


https://www.ffmpeg.org/

A complete, cross-platform solution to record, convert and stream audio and video.  FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. It is also highly portable: FFmpeg compiles, runs, and passes our testing infrastructure FATE across Linux, Mac OS X, Microsoft Windows, the BSDs, Solaris, etc. under a wide variety of build environments, machine architectures, and configurations.

 https://www.ffmpeg.org/



Some examples
You can set the width or height to -1 in order to let ffmpeg resize the video keeping the aspect ratio. Actually, -2 is a better choice since the computed value should even. So you could type:
 
ffmpeg -i in.mp4 -vf scale=720:-2 out.mp4 
 
Subtitles
ffmpeg.exe  -i in.mp4  -vf subtitles="in.srt" out.avi 


… and you want to add a second filter, then all you have to do is add it with a comma:
ffmpeg -i input -filter:v "scale=-1:480, fps=fps=30" output

.. set Video bit rate 640kb, audio bit rate 64kb  scale 640x, fps 25 & subs....

ffmpeg -i in.mp4  -b:v 640k -b:a 64k -vf "scale=640:-2,fps=25, subtitles=in.srt" output.avi
 
.. remove all metadata for output file

-fflags +bitexact -flags:v +bitexact -flags:a +bitexact

While this won't strip the existing metadata present in the original file, it will keep ffmpeg from adding it.

.. export  part of video

ffmpeg -i input-video.mp4 -codec copy -ss MM:SS -to MM:SS output.mp4

.. auto split  large video file into small clips 15 sec each
ffmpeg -i input.mp4 -codec copy -map 0 -f segment -segment_time 15 -segment_format_options movflags=+faststart out%03d.mp4






Previous Post Next Post