convert .mov video to .mp4 with ffmpeg

5

3

I am trying to convert a .mov video to .mp4 with ffmpeg:

ffmpeg -i ~/Desktop/Sample.mov ~/Desktop/Sample.mp4

This doesn't work though, and when I try to open the produced video in quicktime it tells me that the file is either corrupted or in a format quicktime doesn't understand.

How do I get this to work?

theonlygusti

Posted 2016-12-10T19:02:56.790

Reputation: 354

Use handbrake for MAC – answerSeeker – 2016-12-10T19:10:35.660

@TatakaiWasumi I already have it installed. What's the command to convert a video then? – theonlygusti – 2016-12-10T19:17:27.410

Answers

17

To convert videos, I like to use hanbrake. You can find it here:https://handbrake.fr/ I use it on Linux but it should work well on MAC too.

For ffmpeg:

ffmpeg -i {in-video}.mov -vcodec h264 -acodec aac -strict -2 {out-video}.mp4

For HandBrake:

handbrakecli -i {in-video}.mov -e x264 -E facc -o {out-video}.mp4

answerSeeker

Posted 2016-12-10T19:02:56.790

Reputation: 991

Handbrake worked. The ffmpeg command doesn't. – theonlygusti – 2016-12-12T22:34:05.700

2ffmpeg worked great as above for me – Andy – 2017-03-24T22:16:08.340

1Works great! Thanks! What does the -strict 2 stand for? I couldn't find it in the commands list nor in the full documentation. When trying to run with and without it - couldn't find any difference. – arieljannai – 2017-11-29T19:22:16.553

@arieljannai, I just saw your comment. If you look at the documentations on the ffmpg website, https://linux.die.net/man/1/ffmpeg you will see that it says: -strict strictness How strictly to follow the standards.

– answerSeeker – 2018-05-04T18:41:35.343

Maybe I found another documentation thanks! – arieljannai – 2018-05-05T11:05:59.303