-
-
Save lukehedger/277d136f68b028e22bed to your computer and use it in GitHub Desktop.
$ ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4 |
Commands using Linux with ffmpeg to shrinking big MP4 video file to smaller sizes
ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 out.mp4
- 3.6 Gb to 556 Mb, great quality 🥇
ffmpeg -i input.mp4 -s 1280x720 -acodec copy -y output.mp4
- 3.6 Gb to 62 Mb, quality "good enough"/acceptable 👍
ffmpeg -i input.mp4 -vcodec h264 -b:v 1000k -acodec mp3 output.mp4
- 3.6 Gb to 30 Mb, very shitty quality 💩
good enough worked fine for me..To my "average human" eye, i coudlnt find any real difference with the original video compared side by side (original: 1gb to good enough: 296mb)
Edit: if you wanna go lower try changinng -b:v value e.g.:
ffmpeg -i input.mp4 -vcodec h264 -b:v 700k -acodec mp3 output.mp4
and if you don't want sound try:ffmpeg -i input.mp4 -vcodec h264 -b:v 700k -an output.mp4
My experiment:
ffmpeg -i input.mp4 -vcodec h264 -b:v 1000k -an output.mp4
32MB to 3.6MBffmpeg -i input.mp4 -vcodec h264 -b:v 200k -an output.mp4
32MB to 742KB
thanks, it works.
using || -b:v 1000K || ---- from 2MB to 1MB mp4 file
./ffmpeg -i input.mp4 -c:v libx265 -preset ultrafast -crf 28 -c:a aac -b:a 250k output.mp4
This is better for h265, it's fast and should reduce the file size by 50-70% if you want better video, change the ultrafast to fast or change the -crf to a lower number like 24
If you want to change from 4K to 1080P, add -s 1920x1080
after the -i input.mp4
./ffmpeg -i input.mp4 -c:v libx265 -preset ultrafast -crf 28 -c:a aac -b:a 250k output.mp4
This is better for h265, it's fast and should reduce the file size by 50-70% if you want better video, change the ultrafast to fast or change the -crf to a lower number like 24
If you want to change from 4K to 1080P, add
-s 1920x1080
after the-i input.mp4
This worked pretty well for me -- converted a 323 MB Zoom recording to a 81 MB file. without reducing resolution, is there anything more one can do to further shave off the file size?
Commands using Linux with ffmpeg to shrinking big MP4 video file to smaller sizes
ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 out.mp4
- 3.6 Gb to 556 Mb, great quality 🥇
ffmpeg -i input.mp4 -s 1280x720 -acodec copy -y output.mp4
- 3.6 Gb to 62 Mb, quality "good enough"/acceptable 👍
ffmpeg -i input.mp4 -vcodec h264 -b:v 1000k -acodec mp3 output.mp4
- 3.6 Gb to 30 Mb, very shitty quality 💩
Thanks for sharing, really helpful!
None of these have done anything, but give me a 30-35% INCREASE in size. I'm still determined to find a solution but attempts to compress this video by ANY means results in similar results.....
Very good! Using it, reduced 86mb to 64mb. thank you all. I also summarized some other methods, I hope it can help everyone https://vidon.me/compress-mp4
Nice! It works! Thanks for sharing you. Also, use this DVD to MP4 Converter to compress your DVD contents.
Myfans
...
We have OnlyFans bots on Github now? Thanks my day is ruined
Thanks for sharing! I've used a programm before and the compressed videos always got pixelated, blurry, or blocky. This one works just fine. I've also found an article introducing people how to convert blu ray to MP4. It might be useful for anyone in need.
Nice work! Also, check out KeepVid for more amazing video-related tools.
Maybe these 2 articles can help you:
https://dvdfab.at/drm-m3u8-downloader/m3u8-to-mp4.htm
https://streamfab.de/mp4-downloader
Commands using Linux with ffmpeg to shrinking big MP4 video file to smaller sizes
ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 out.mp4
- 3.6 Gb to 556 Mb, great quality 🥇
ffmpeg -i input.mp4 -s 1280x720 -acodec copy -y output.mp4
- 3.6 Gb to 62 Mb, quality "good enough"/acceptable 👍
ffmpeg -i input.mp4 -vcodec h264 -b:v 1000k -acodec mp3 output.mp4
- 3.6 Gb to 30 Mb, very shitty quality 💩
Thanks for sharing, really helpful!
do these commands work just the same way on windows 10?
Thanks for sharing. I found that StreamFab can help you convert Netflix to MP4, then you can play them on most devices. You can learn more by https://streamfab.com/ .
Great discussion !
By the way if you want some dvd processing tools, theses one are highly recommanded.
https://dvdfab.fr/uhd-copy.htm
https://dvdfab.fr/dvd-copy.htm
Read this article published by KeepStreams very helpful
i'm gonna add some notes here
-b:a 96k
I'd recommend that you first let ffmpeg compress it automatically without any arguments
ffmpeg -i input.ext output.mp4
-b:v
and keep lowering until you reach a desired size-vf scale=1280:720
-c:v libx265
, it has better compression, and just ike 264, nearly lossless. the issue with this is that it's still not widely adapted and sites like discord can't play it