Convert from .mov to .mp4 (or h264) using avconv
Asked Answered
G

1

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.

Gereron answered 24/9, 2013 at 9:11 Comment(1)
refer to the H.264 Encoding Guide at trac.ffmpeg.org/wiki/Encode/H.264Quest
V
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)

Vaas answered 24/9, 2013 at 10:49 Comment(4)
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/ffmpegVaas
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.Devaughn
@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!Diazine
Glad to help :)Vaas

© 2022 - 2024 — McMap. All rights reserved.