I could not send a mp4 using Yahoo! mail because it took around 30 minutes.

On Ubuntu MATE 18.04, I reduced the size using ffmpeg.

ffmpeg -i sm_Julia1.mpr -s hd480 -strict -2  output.mp4

But the file was still too big.

Is there another option?

  • You can make a video as small as you want. The smaller you make it, the less you will see on it. – vanadium Jun 7 '20 at 10:26
  • @llogan size limit for yahoo mail is 25 Mb. – fixit7 Jun 8 '20 at 22:10
  • 72 seconds. @llogan – fixit7 Jun 9 '20 at 22:04

split the file using zip:

$ zip -s 100m archive.zip output.mp4

And reassemble with:

$ zip -s 0 archive.zip --out output.zip

Last unzip the archive:

$ unzip output.zip

Using the file duration (72 seconds) you can use two-pass encoding to output approximately your desired output file size (25 MB). From FFmpeg Wiki: H.264 - Two-Pass:

(25 MiB * 8192 [converts MiB to kBit]) / 72 seconds = ~2844 kBit/s total bitrate
2844 kBit/s - 128 kBit/s (desired audio bitrate) = 2716 kBit/s video bitrate - 5% safety margin = 2580 kBit/s

So use -b:v 2580k:

ffmpeg -y -i input.mp4 -c:v libx264 -an -pass 1 -b:v 2580k -f mp4 /dev/null && ffmpeg -i input.mp4 -c:v libx264 -c:a aac -b:v 2580k -b:a 128k -pass 2 -movflags faststart output.mp4

Result ≈ 24 MB.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.