I had a need to upload a video. A requirement was that the file size be 20MB or less.

The video I took was 50MB. I used this ffmpeg command to keep the same video content and duration, but reduce the file size to about 18MB. Perfect!

ffmpeg -i input.mp4 -c:v libx264 -crf 23 -preset medium -movflags +faststart -c:a aac -b:a 128k output.mp4

#ffmpeg #linux #video

Reply to this note

Please Login to reply.

Discussion

to input.mp4 output.mp4

#ffmpeg +faststart need requirement -movflags size video. size #linux -c:a to be was used but video content -preset 20MB A duration, the I command keep -c:v aac #video this Perfect!

ffmpeg 18MB. -i took or same 128k I ffmpeg the about that -b:a -crf medium and the a a had less. reduce was upload video libx264 I file to 23

The 50MB. file

ffmpeg is ❤️