17

Looking at the avconv website there seem to be a vast array of options to convert video.

However, I'm getting lost in all the technical detail.

Is there a simple way to convert a .mov to a .mp4 (or h264)?

I'm happy if it's slightly lossy.

If it helps I'm on Ubuntu 12.04.2 LTS.

Snowcrash
  • 80,579
  • 89
  • 266
  • 376

1 Answers1

37

In a very basic form, it would look a bit like this:

avconv -i inputfile.mov -c:v libx264 outputfile.mp4

This will only work if you compiled avconv with libx264 support - you can see here on how to do that.


If you're not that concerned about codecs and just need an ".mp4" file, you can also run this:

avconv -i inputfile.mov -c copy outputfile.mp4

This will copy all codec information from the .mov container and place it into the .mp4 container file.


Just as a note, avconv is a fork of ffmpeg, many of the switches for ffmpeg will work for avconv (if that helps your search for answers)

Community
  • 1
  • 1
Jamie Taylor
  • 4,709
  • 5
  • 44
  • 66
  • 1
    If you need more information, Try over at Super User - if you get a response from slhck or LordNeckBeard, they seem to be the guys who know everything about avconv/ffmpeg – Jamie Taylor Sep 27 '13 at 13:46
  • `avconv` should work out what you want from the filename. So `avconv -i vid.mpeg vid.mp4` will convert the video to .mp4 using the defaults options. – Ken Sharp Jan 17 '16 at 03:38
  • 1
    @JamieTaylor Thank you dude, second command is Briliant. I needed to change mkv container into mp4 without any transcoding. I have NAS server (slow CPU) which receives .mkv files (h246) from IP camera and needed to convert it just to .mp4 container because i wanted to display videos via HTML5 Video tag (which needs mp4 container). With transcoding, converting 30sec movie to mp4 lasted 1-2min (slot CPU on NAS server). Without transcoding (second command) it's done INSTANTLY! I'm really glad i've found this great solution! – Karol Łuckiewicz Feb 20 '18 at 17:03
  • Glad to help :) – Jamie Taylor Feb 22 '18 at 16:22