Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Converting mov to mp4 with ffmpeg better quality [closed]

Tags:

ffmpeg

mp4

mov

I want to convert mov videos to mp4. Currentoy I manage this with ffmpeg via bash with the following call:

ffmpeg -i input.mov -f mp4 -vcodec mpeg2video -acodec mp3 output.mp4

Yes that works, but the quality is abysmal. My 50Mb is shrunken to a handy 2.3 Mb file. The I tried the variation where I just change the container:

ffmpeg -i input.mov -f mp4 -vcodec copy -acodec mp3 output.mp4

Yes that works, too, but the file is still huge since I don't compress the video. So my 50Mb stay 50Mb.

Is there a setting, where I can do a slight or gradual compression, without having a total lack of quality? an output file of maybe 10 - 20 Mb would be my target.

What I tried:

ffmpeg -i input.mov -f mp4 -vcodec -qscale:v 4 -acodec mp3 output.mp4

Gives me the error message:

WARNING: library configuration mismatch [...] Unknown encoder '-qscale:v'

Version used: ffmpeg version 2.8.11-0ubuntu0.16.04.1

like image 319
Calamity Jane Avatar asked Apr 02 '18 19:04

Calamity Jane


People also ask

Can you convert MOV to MP4 without losing quality?

There will be mostly zero quality loss during the MOV to MP4 conversion and the conversion normally takes only moments because the software supports 6X faster speed with Intel and NVIDIA hardware acceleration.

Can FFmpeg convert MOV to MP4?

There are a number of tools online, but why load any of those when you can just run ffmpeg from your terminal! You can download their installer or on a Mac, just run brew install ffmpeg . This went from a 24MB Quicktime Movie file to a 3.7MB MP4!

Does FFmpeg support MOV?

FFmpeg can input most container formats natively, including MP4, . ts, MOV, AVI, Y4M, MKV, and many others.


1 Answers

Remux only

If your input video and audio are compatible with MP4 you can use stream copy mode:

ffmpeg -i input.mov -c copy output.mp4

Re-encode

If you need to encode to other formats compatible with MP4:

ffmpeg -i input.mov -crf 23 -preset medium -movflags +faststart -c:a aac output.mp4
  • Use the highest -crf value that provides an acceptable quality.
  • Use the slowest -preset that you have patience for.
  • If the input is AAC audio you can change -c:a aac to -c:a copy.

See FFmpeg Wiki: H.264 and FFmpeg Wiki: H.265.

like image 176
llogan Avatar answered Sep 21 '22 23:09

llogan