ffmpeg was created by Fabrice Bellard the same creator as QEMU and QuickJS, the engine behind JSLinux.
In addition to the conventional conversion commands that we use on a daily basis, let’s see 15 more utilities that can be good for you in many cases.
ffmpeg -i output.mp4 2>&1 | egrep -o '[0-9]+ fps'
fmpeg -i input.mp4 -vf "zoompan=z='if(lte(mod(time,10),10),2,1)':d=1:x=iw/2-(iw/zoom/2 ):y=ih/2-(ih/zoom/2):fps=30" output.mp4
Decreasing the size without losing image quality:
ffmpeg -i input.mp4 -vcodec libx264 -crf 28 output.mp4
Leaving it in the resolution: 1280x720
ffmpeg -i input.mp4 -vf scale=1280:720 -preset slow -crf 18 output.mp4
Specified for width of 1280 .
ffmpeg -i input.mp4 -vf scale=1280:-1 output.mp4
Specified for height of 720
ffmpeg -i input.mp4 -vf scale=-1:720 output.mp4
ffmpeg -i input.mp4 -c copy -an output.mp4
It looks like a cell phone screen, the width becomes the height and vice versa
ffmpeg -i input.mp4 -vf "transpose=clock" output.mp4
If the video is “upside down” you will reverse it
ffmpeg -i input.mp4 -vf "transpose=2,transpose=2" output.mp4
When you run the command: ffmpeg -i output.mp4
ffmpeg displays the video data, but the header makes it difficult to see this, to ignore that initial data, run:
ffmpeg -i output.mp4 -hide_banner
mkdir frames
ffmpeg -y -ss 00:00 -i input.mp4 -t 10 "frames/filename%05d.jpg"
There will be several images in the frames directory named filename00001.jpg up to the maximum number of images that the video has.
ffmpeg -y -ss 00:00 -i input.mp4 -t 10 "frames/filename%05d.jpg"
ffplay video.mp4
ffplay music.mp3
Example caption:
vim subtitle.srt
1
00:00:00,000 --> 00:00:02,827
- Root Terminal - Systems
Operational, C++ and Development.
two
00:00:02,827 --> 00:00:06,383
15 Examples of different usage
from ffmpeg to help you
3
00:00:06,383 --> 00:00:09,427
Don't forget to also read
the links below. It cost!
Command:
ffmpeg -i input.mp4 -i subtitle.srt -c copy -c:s mov_text outfile.mp4