magic words wanted ffmpeg avi to mp4 conversion for youtube
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
magic words wanted ffmpeg avi to mp4 conversion for youtube
I have been scraping and clawing all over the Web, trying and erring for long enough to give up and ask you:
I want to convert AVI files created on my Canon digital camera to a youtube-friendly format. Youtube says: "you may get the best uploading results from converting your file to MPEG4 video with MP3 audio" and they suggest ffmpeg. Unfortunately I don't understand what I am doing, just trying to slavishly follow the recipe. I am running this version of ffmpeg:
I have tried countless command-line invocations of ffmpeg and gotten various fatal errors. Rather than paste all the clutter in here, I pose the question: what is the command to tell ffmpeg to convert input.avi to an MPEG-4 video with MP3 audio?
PS I know Youtube will accept my AVI and do the processing for me. I also know they recommend give you them your original instead of mucking with it yourself. But a 2-minute AVI is over 200MB and I want something that will upload faster. Of course this has taken me 25 times longer than the AVI upload would have (-:
Gratefully,
Last edited by vtbludgeon; 06-22-2010 at 08:56 AM.
What format is the avi file ? mpeg4 is a codec, avi is a container for many formats. If fact mpeg4 can be contained by an avi.
But having said that, there is an example in man ffmpeg :
Code:
* You can transcode decrypted VOBs
ffmpeg -i snatch_1.vob -f avi -vcodec mpeg4 -b 800 -g 300 -bf 2 -acodec mp3 -ab 128 snatch.avi
Quote:
This is a typical DVD ripping example; the input is a VOB file, the
output an AVI file with MPEG-4 video and MP3 audio. Note that in this
command we use B-frames so the MPEG-4 stream is DivX5 compatible, and
GOP size is 300 which means one intra frame every 10 seconds for
29.97fps input video. Furthermore, the audio stream is MP3-encoded so
you need to enable LAME support by passing "--enable-mp3lame" to con-
figure. The mapping is particularly useful for DVD transcoding to get
the desired audio language.
NOTE: To see the supported input formats, use "ffmpeg -formats".
What format is the avi file ? mpeg4 is a codec, avi is a container for many formats. If fact mpeg4 can be contained by an avi.
Ah! Thank you, now I am slightly less ignorant than before.
Quote:
Originally Posted by smoker
But having said that, there is an example in man ffmpeg :[...]
Yes I saw that, but it's going in the opposite direction from what I am trying to do. My input file is AVI, not my output. Truth to tell, as I mentioned before, I don't understand this stuff.
It looks like I got some information about the input file there, right?
I hypothesize that my ffmpeg was not compiled with support for whatever. I got it by way of 'apt-get install.' Or is there something else I could apt-get that would resolve some dependency? Or is there something else I'm not doing right?
Last edited by vtbludgeon; 06-22-2010 at 11:29 AM.
Furthermore, the audio stream is MP3-encoded so
you need to enable LAME support by passing "--enable-mp3lame" to con-
figure.
I don't know how you achieve that other than recompiling ffmpeg (which isn't a bad idea really) Get it from svn and build it yourself, there are plenty of howtos for just about all distros.
The process as described is not going in reverse. Remember I said avi is a container format ?
Quote:
This is a typical DVD ripping example; the input is a VOB file, the
output an AVI file with MPEG-4 video and MP3 audio.
I have been scraping and clawing all over the Web, trying and erring for long enough to give up and ask you:
I want to convert AVI files created on my Canon digital camera to a youtube-friendly format. Youtube says: "you may get the best uploading results from converting your file to MPEG4 video with MP3 audio" and they suggest ffmpeg. Unfortunately I don't understand what I am doing, just trying to slavishly follow the recipe.
Just upload the AVI. YouTube will do the converting for you.
OK, Youtube thought about it for over 24 hours before deciding it won't accept my AVI from my little Canon Powershot, so... I manned up and compiled my own ffmpeg from source checked out from svn.
For ./configure I simply said --enable-libmp3lame. And now...
ffmpeg -i cards.avi -vcodec mpeg4 -acodec mp3 cards.mpg
So you see -- compiled from source with libmp3lame support, and still "unknown encoder mp3." Any advice? Some magic words missing from my configure command, perhaps?
Thanks.
Last edited by vtbludgeon; 06-23-2010 at 11:17 AM.
Reading package lists... Done
Building dependency tree
Reading state information... Done
lame is already the newest version.
apt-get install libmp3lame-dev
Code:
Reading package lists... Done
Building dependency tree
Reading state information... Done
libmp3lame-dev is already the newest version
But... let me read your URL (been there before) and give it a shot. Am I gonna shoot myself in the foot if I run those commands even though it doesn't explicitly say they're for my distro (9.10)?
Last edited by vtbludgeon; 06-23-2010 at 11:59 AM.
I don't think you can hurt things too much, as long as a package is available for your version, it shouldn't matter. If you already have it, it won't install or it will complain.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.