Pieter van Gils

Luck is what happens when preparation meets opportunity

How to convert avi to mp4 for iPhone with VLC

I had some problems converting my avi (divx) torrents to a mp4 format for my iPhone. Googling for some answers I only came to crapy sites offering me paid software. Because I know it’s not that hard to convert a file I tried some things my self with the free VLC player. Here’s a guide how you convert your downloaded torrents to mp4 (suitable for iPod or iPhone):

1. Download VLC player.

2. Go to the streaming/exporting wizard.

3. Choose transcode/Save to file.

4. Choose your input stream.

5. Put the video codec on “MPEG-4 Video” and choose your bitrate (I recommend 512)

6. Put the audio codec on “MPEG-4 Audio” and choose your bitrate (I recommend 128)

7. Put the encapsulation format on MPEG 4 / MP4

8. Choose the name and location you want to save the file.

9. Click on finish, that’s all!

Now you can put your movies or series in iTunes and sync it with your iPhone. If you want to convert a DVD to your iPhone or any other device I suggest you use Handbrake.

64 Comments »

  Lottie wrote @ November 11th, 2007 at 11:37 pm

Hi, this is a really good help, although I have encountered a problem while trying to import the movie (now an mp4 file) into iTunes to put it on my iPod. It simply won’t do it. I also attempt to open it in Quicktime, which it should do now in it’s current form, but a notice appears saying ‘the movie contains some invalid data’. Am I doing somthing wrong, or does it jsut now work?

  Pieter van Gils wrote @ November 15th, 2007 at 3:16 pm

What kind of input do you use? Is it an .avi file or something else? QuickTime should work without giving errors!

  Ali wrote @ November 16th, 2007 at 2:35 am

Same here. Used an Avi file. The output is an mp4 which can be opened by vlc but not by quicktime.

  Pieter van Gils wrote @ November 16th, 2007 at 9:29 am

Are you using mac or windows? I’ve done several movies now and have no problems…. Maybe you can tell more about the movie file?

  Lottie wrote @ November 18th, 2007 at 12:26 am

Hi again. yes, i’m using a mac. The movie is a ‘.avi’ file and opens and can play in VCL. It managed to export correctly, but then if I try to play it, as it should do in Quicktime, an alert appears saying the movie contains invalid data. I’m not sure what this means, perhaps it should be exported differently??

  Tim wrote @ November 24th, 2007 at 6:15 am

Interesting “how to”, I am trying to convert some home movies shot on my Canon digital camera in AVI format into MP4 to display on my iPod and, after having had VLC for years, looked forward to using this method.

But I ran into a snag.

I suspect you need VLC version 0.8.6c of the windows version to perform AVI to MP4 conversions. I attempted the procedure with my VLC 0.8.5 and found the (Step number 7) MP4 option unavailable. I will do a version update and retry and post a follow up comment.

  Tim wrote @ November 24th, 2007 at 6:57 am

VLC 0.8.6c gave me choice of the MP4 option under step 7 but still ultimately failed. It seems you can’t easily nominate an output file name. And if you enter in an output file name it creates a 1 kb empty file.

Presumably this stuff works for other people!

  josh wrote @ November 26th, 2007 at 9:39 am

thanks. it was a great help. i followed your “how to” step by step and it worked perfectly.

  Gold wrote @ December 3rd, 2007 at 8:10 pm

This seems to half way work. We’re using VLC 0.8.6c and the instructions are simple and it would seem hard to go wrong with these.

However, we don’t seem able to import the file into iTunes. It fails silently.

The other issue is that the transcoded file only seems to be audio dispite having selected the video for encoding also.

The source file we’re using is mp3 and XVID in an avi wrapper.

Anyone else experiencing this?

  Anthony wrote @ December 17th, 2007 at 6:06 am

I am converting video clips aka (.avi) and I am using a windows computer. I downloaded the VLC media player and followed all of your directions by clicking file and using the wizard, and using the settings you suggested. But then when I get finished, it just puts the converted file into the folder as a “file” and has no program that runs it and I can not import the file into itunes. Have you had this trouble before? Anything I could be doing wrong? Thanks for your help I really appreciate it.

-Anthony

  Pieter van Gils wrote @ December 17th, 2007 at 10:41 am

I’m using a mac and just drag-and-drop the files into iTunes. Try the same with windows… maybe it works.

For the file input I simply use the average xvid movies you can download using any torrent client. (tip: for movies search for axxo, always good quality).

I’m using the VLC 0.8.6a player so maybe this is a difference. I don’t know if these last letters are the same for mac and windows. I’ll try to convert a movie on a windows pc later this week.

  Daza wrote @ December 19th, 2007 at 1:40 am

For the having the problem of not being able to open the new mp4 file created, it might be that in step 8 after you name the new file you must put ‘.mp4′ after the name.

example:

Wrong way: videoforiphone

Correct way: videoforiphone.mp4

If you forget to do this the Pc will not reconize the file, but you can simply rename the the file extention with a .mp4 extention. The right click and open with iTunes and you done!

The problem I’m having is sometimes all I get is audio with no picture, can anyone help?

  Mitch wrote @ December 19th, 2007 at 10:54 am

I don’t have MP4 for the encapsulation option (step 7) which one should I use then?

  Caz wrote @ December 23rd, 2007 at 2:12 pm

Thanks for this Pieter,

I was having the same problem…I converted the avi file to mp4, then nothing when I tried to move it into itunes. A tweek at step 5 seemed to solve this problem, I selected video codec H 264 (bit rate 256) and then followed the rest as per Pieters way. And now I can import into itunes no problem! Im using PC

  Andrew Bucklin wrote @ December 26th, 2007 at 6:57 am

Same error here! QuickTime says there is invalid data and when trying to import into iTunes nothing happens! I tried WinAVI video converter and also some Chinese conversion program, but those either did a poor job, or did not work at all. I finally found Xilisoft Video Converter on TorrentScan.com and selected the iPod Touch profile, and it worked like a charm! (I used the following bit rates, which resulted in just over a 400MB file for a 2 hour movie… 312 for video and 112 for audio)

  Andrew Bucklin wrote @ December 26th, 2007 at 7:05 am

EDIT to my previous comment… For the 1 video i converted, the audio and video sync was off by 1 second by the end of the video… :-(

  Ward wrote @ December 30th, 2007 at 2:08 am

Great Help thanks so much

  Tayeb wrote @ January 1st, 2008 at 7:30 pm

Hi, Happy new years people. Well i tried the same thing that was on the instructions and it wont import into itunes. Im using currently 0.8.6c i just up loaded to 0.8.6d and im going to download 0.8.6a to see if that is going to work. If it works ill get back to you. But currently it wont.

  William wrote @ January 15th, 2008 at 10:48 pm

main: cannot add a new stream (unsupported while muxing to this format)
stream_out_transcode: cannot add this stream

using 0.8.6d… What is wrong with this?

  me wrote @ February 11th, 2008 at 3:57 pm

Great! It has worked !

  elad morad wrote @ February 18th, 2008 at 10:59 pm

hey… i just did anything you said and it is working great just that
there is no sound !!! do you know why is it like that ?
hope to hear from u soon

  elad morad wrote @ February 18th, 2008 at 11:05 pm

hey
thanks it is working great, just one problem, i do it but i cant hear it, do you know why there is no sound ?

hope to hear from u soon

  Lawrence wrote @ February 21st, 2008 at 3:11 am

Thanks for the post!

I believe I am having a similar issue as elad: I encoded a video following your instructions, the video will play fine in iTunes, quicktime, and VLC, but once it’s loaded onto my iPhone, the sound disappears. Any suggestions? Thanks again.

  I wrote @ February 22nd, 2008 at 4:20 am

This program is working. I was able to convert so far 4 Episodes from a show for my iPhone. A couple showed “the movie contains invalid data” as I was trying to open it with QuickTime player. BUT! If you go VLC -> File -> Open File - and you would choose the file you’ve just created and couldn’t watched IT WILL OPEN and showed by VLC! Also, there would be another window explaining what kind of error a program encountered while converting AVI to MP4, thus proving that it works only with normal files without glitches.
Mine says:
“An error has occurred which probably prevented the proper execution of the program:
main: decoder is leaking pictures, resetting the heap
main: picture 0×2b6af70 refcount is -1
main: decoder is leaking pictures, resetting the heap
main: picture 0×2b6af70 refcount is -1

If you believe that this is a bug, please follow the instraction at
http://www.videolan.org/support/bug-reporting.html

So, there are really some king of a problem with a file… but not a program. Because, some players could temporary patch the file while viewing, therefore you think that your file is perfect.

  I wrote @ February 22nd, 2008 at 4:29 am

BTW,

check out this site - you may find a lot of answers to your questions:

http://wiki.videolan.org/Common_Problems

  turn wrote @ February 24th, 2008 at 1:30 am

it worked and yet didnt work.

I followed the instructions step by step, and in the end I did manage to come with an mp4 file, but it only plays for a few seconds of the video instead of the whole movie. I wander if there was something I didnt do or did it wrong.

Am using: VLC 0.8.6d
and the input file is an avi file.
anyone encoutered the same problem? or could someone come up with a solution?
PS: I think this should work, and thx for this good idea, I hope it will work for everyone eventually.

  Jeff wrote @ February 28th, 2008 at 4:06 am

Trying this out to change video formats for Zune, i changed an .avi to .mpeg4 but still can’t open it with Zune and Zune is supposed to support .mpeg4. Anyone know anything about this?

  josh wrote @ March 3rd, 2008 at 7:26 am

yeah that way didnt work for me this is what worked for me

1) File, Open File

2)press browse after you put the movie you want to convert go to stream/save (bottom left) box check that then go to settings to the right of it

3)under Outputs check the file box then name the fold what ever you want with .mp4 after it (if you dont it wont work) ex dashboard.mp4

4) then click MP4 in under Encapsulation Method

5) then click Video codec and Audio codec

6)make the video codec a mp4v and the audio mp4a (the box for changing the type is to the left of them)

7)after that but the bitrate for the audio at 64 and the channel on 1 (other wise you wont get sound out of it)

8)after that press ok, this will take you back to the first window

9)press ok after this it will start to convert it

yeah some times the auto and video dont match up but ive had this problem with all the converting tools ive used so yeah soo i hope it works for you. if it doesnt work out dont give up just try out different junk and youll get it ^^ thats what i did :p

  suzie wrote @ March 5th, 2008 at 3:42 pm

Would anyone be able to help me out, i’m following the guide but i seem to be only getting the audio and no pictures. Any help would be much appreciated

  Dan wrote @ March 13th, 2008 at 10:42 am

One funny thing I got with Handbrake which might carry over here: the default mpeg-4 encoder writes to .m4v, which won’t import into iTunes. If you change Handbrake to default to .mp4 when exporting for iTunes, it works fine. You might see if something similar is happening? My files were playable by QuickTime, but couldn’t be imported by iTunes :(

  airpoint wrote @ March 15th, 2008 at 3:37 pm

Thanks Johs! Your guide worked great for me.
Except the step 7 - it’s working with higher bitrate as well

Great job
Thanks again

  iPhoned wrote @ March 16th, 2008 at 6:04 pm

Cucusoft iphone video converter is great iphone video software, support converts avi, mpeg, vob, flv, mov, wmv, etc to iphone, doanload here

http://www.dvd-ipod.biz/iphoneconverter/avi_to_iphone.html

  Marjan wrote @ March 16th, 2008 at 6:44 pm

Maybe this could be a help (at least at MPG4 format): Make sure you have ‘Mosaic video sub filter’ checked in preferences->Stream output->Sout stream->Transcode. That worked for me… for MPG4. AVI and other formats won’t allow to create another stream whatever that might mean. No much use of such message, if reason is not displayed, right? In case of Mosaic video filter it was: I checked all filters on the list and message window reported that freetype encoder is missing. I unchecked it, and subtitle merging went through… Only problem is now code page of subtitles … You cannot set it manually, so It is again useless…

  Marjan wrote @ March 16th, 2008 at 6:45 pm

BTW: I use iMac and tiger. Input file was AVI, output MPG4.

  Tee wrote @ March 17th, 2008 at 3:58 am

I have been using this method for a while and have the same problems as everyone else. When I first had the idea to do it, I tried it with a 30 minute tv show and it worked great, however every time I try to convert a movie it just will not work. Perhaps it is do with the file size?

  Marjan wrote @ March 23rd, 2008 at 6:29 pm

I was successfull at last. Well, nearly. Movie is created with subtitles, but can be only played in VLC, and nowhere else.
No what?

  tombs wrote @ April 13th, 2008 at 12:11 am

i have same problem, i have managed to convert some movies (.avi) to mpeg4 with great success, others have the same issue of invalid data when opening in quicktime, and vlc errors as noted previously. has anyone cracked this problem yet.?

  Duncan wrote @ April 13th, 2008 at 4:44 am

Thanks for the recipe Pieter, but this didn’t work completely for me. I managed to create the m4p files, and import them into iTunes, but when syncing to the iPhone it balked, claiming that they could not be played on the phone. Same error for both mpeg 4 and the H.264 (256 bit rate) that another commenter suggested. Does anyone know specifically what the requirements for playback are on the iPhone? Does this potentially also perhaps depend on the source of your avi files? (Mine were exported from EyeTV 2.x as DivX format)
- D.

  thos wrote @ April 14th, 2008 at 3:23 pm

i have had similar issues as above, just found and tried isquint (isquint.org) - freeware, have tried with .avi and flash, and results have been excellent. although simple by default, there are advanced settings to optimise for TV out, for larger but better quality conversions.

  bjorn wrote @ May 8th, 2008 at 6:31 pm

that’s weird u guys r having issues it works flawlessly for me

  Jay wrote @ May 11th, 2008 at 5:51 pm

For those of you having problems, give this a try:

1. Instead of using the wizard, do the regular open file and combo of stream/save.

2. Under settings, select the encapsulation method as MP4 and MP4V/MP4A for video/audio per this article.

3. Now, on the top of the dialog box, you’ll see a Target: (under Stream Output MRL).

4. Enter the following:

#transcode{width=320,canvas-height=240,vcodec=mp4v …}

The additional stuff you have to enter is the width= and canvas-height= values.

In my case, those videos that didn’t convert for me were super widescreen. Some weird ratios and those that worked were not so wide. When I did this, the videos that wouldn’t play back in QT or won’t transfer to iTunes now works. I tried it with 2 video files thus far. I can’t be 100% sure it’ll work with all my videos unfortunately.

Good luck.

  sammy wrote @ May 26th, 2008 at 4:48 am

Thanks Jay for your effort,

You did e very good job by posting the details on how to convert.

But i want to add if anybody want’s to convert to i phone try this:

1_ follow Jay’s steps but on the 4th line just simply replace the #’s

before= #transcode{width=320,canvas-height=240,vcodec=mp4v …}

after= #transcode{width=720,canvas-height=406,vcodec=mp4v …}

this is a very easy change …… so i want to make sure that Jay from above coment should get the credit …..

Try this on your iphone it will work for sure…
God bless

  sammy wrote @ May 26th, 2008 at 7:31 pm

I realized that vlc doesn’t work with some movies and i still enquire problems when i try to drag it to itunes.

So i came across this software camtasia, that i used to use on on my computer to edit movies.

I did some research on their website on i saw that they produce video for iphone…….

This is amazing and is working with every movie that i’m converthing no more problems.

The only thing is, this software cost money that’s the bummer.

But if you don’t care about money here is the link:

http://www.techsmith.com/camtasia/whatsnew.asp

This will work for sure no more issues garrantie.

God bless.

  MEL wrote @ May 26th, 2008 at 11:18 pm

Thanks Pieter,

Worked like a charm!
Converted all my comedy shows for my iphone.

Thanks…

  sushi wrote @ June 3rd, 2008 at 11:07 pm

hi, i tired many ways to convert my digital cams avi movie files to mpeg4 but nothing works…all i get is audio format..even when i use video format converstoin.. the video is gone an there is only audio..how can i fix that??

  Jane wrote @ June 8th, 2008 at 1:53 pm

Now a free VLC Media Player itself for Apple iPhone and iPod Touch

http://thinkabdul.com/2008/06/07/zodplay-download-free-vlc-media-player-for-apple-iphone-ipod-touch/

  thos wrote @ June 17th, 2008 at 12:16 pm

isquint still works flawlessly for me everytime, two clicks and sorted! n one of the hassles with VLC variables, it has all the presets on board so you just need to select an output quality for ipod or TV. :)

  G. wrote @ June 27th, 2008 at 4:56 am

Ok, so it worked well, kind of… I had the same problem as someone above: it will only convert a few seconds of the movie. I use a mac and am converting .avi files. Has anyone figured out this little glitch yet?

  G. wrote @ June 27th, 2008 at 5:14 am

Ok, so I was able to convert it with Jay’s instructions but I can’t get it into iTunes. What now?

  JZ wrote @ July 8th, 2008 at 7:21 am

Thanks for all the tips — the original directions didn’t work but by using H.264, the converted AVI file loaded like a champ into iTunes - drag and drop. However, when I tried to sync to my iPhone - no joy - everything was properly checked, but the file didn’t sync. Next, I right clicked on the file inside of iTunes and selected “Convert selection to iPhone/iPod”.

Boom - it works! Thanks for the tips and troubleshooting.

  Darren wrote @ July 14th, 2008 at 10:24 pm

I’ve had differing results with this and I’m fairly sure it’s down to the source file.
I’ve had ones that work perfectly following the original instructions and I’ve had ones that needed encoding as H.264 then converting in iTunes (see above).

Not sure yet why it is different.

  William Jones wrote @ August 21st, 2008 at 4:01 pm

Do have VLC installed on my computer, how do I convert my MPEG4 format films to avi to play on my stand-alone dvd player.

  rich seymour wrote @ September 2nd, 2008 at 6:57 pm

the first few worked for me, then it without changing anything it just stopped working!…
am going to try some of the tweaks suggested.

  Brad wrote @ September 26th, 2008 at 6:36 pm

This worked great for me, i was able to convert my videos using VLC and import them into itunes and sync to my iphone. All working flawlessly. Thanks!

  B. Cyrus Davarmanesh wrote @ October 6th, 2008 at 8:53 pm

Hello,
Let me first thank you so very much for you innovation, money well spent, in this day and age it’s a magic..
I have a problem that I was not able to solve with Mac Support.
I have home made movies (Kind : AVI Movie) that I would like to watch on my 3G.
I have VLC, Quick Time Player on my MacBook to open…
However, I am unable to open the movies.
When I do download the move in to a designated folder with in the 3G, it appears as two of the same but with different magnitudes.
The mac Support representative asked me to drag the movie on to the desktop, open iTunes, connect 3G, Itunes File > drop dawn menu > Add to Library > find the movie > double click, and it should appear in Movie segment of iTunes.
That did not work aether.
So Please help.
Sorry I am not doing a good job explaining.
Once again many thanks for your wonderful product.
GOD bless.
Respectfully,
Cyrus.
You say you are seeing “two of the same but with different magnitudes.” I believe that you are seeing the movie file and the resource file. If the movie file is named something like “movie.avi”, the resource file will be named “._movie.avi”. The resource file is much smaller. Does this sound right so far? This is all expected. You would see the same results if you copied your movie file to an iDisk.

If I understand, though, you are trying to play AVI movies on the iPhone. This is not supported by the iPhone or by Air Sharing. The iPhone supports a limited set of movie types. In the app description on the App Store, we state that Air Sharing supports “Movie (standard iPhone formats: H.264, MPEG-4, 3GPP, etc.).” The key to all of these is that they are encoded either in MPEG-4 or in H.264.

Sincerely,
Dave

I forgot to tell you this part:

If you want to be able to play your AVI files on the iPhone, you will need to convert them to MPEG-4 or H.264. There are numerous tools that can do this conversion, including Apple’s own QuickTime Player Pro. If you google “convert iphone avi” you will find a number of converters.

Cheers!
Dave

Can you please help I am having a heel of a time with this.
Many thanks,
Cyrus.

  Deadwood wrote @ October 19th, 2008 at 4:28 am

Here’s maybe some help if only parts of movies can be seen…

When I converted my first avi file I could easily convert the file. Itunes recognised it and everything looked good. Until I noticed it was only 9 min. of a 60 min. serie. It puzzeled me…

I noticed that although you cannot see it, VLC is processing the file in the background. If you drag the file too early to Itunes it’s not ready yet and you will only transfer the beginning of a film. At least, that’s what happened to me. The one hour avi file (346 MB) took about 13 minutes to convert (to 280 MB) on my Mac Book Pro. Dragging it to Itunes and transfer it to the phone was a piece of cake. The movie played flawless after that on my Iphone…

Oh, don’t forget to put .mp4 behind the name of the file. ;-)

Great manual Pieter thanks!

Have anyone tried to insert subs yet? I think I saw an option for that…

  ryan wrote @ October 29th, 2008 at 3:14 am

I have converted .avi to .mp4 using h.264 and brought it into itunes. The problem is there audio play for about 5 sec then turns off. Anyone help?

  Jenn wrote @ December 7th, 2008 at 10:10 pm

Thanks! This step-by-step directions worked like a charm for me once I tried the H.264 option. Now if I could just get the file from itunes to my iphone…..right-clicking doesn’t give me a convert option.

  Pieter van Gils wrote @ December 7th, 2008 at 10:37 pm

@ Jenn
Try to drag and drop it, that should work.

  hey wrote @ December 17th, 2008 at 6:39 pm

does this work for ipod?

  Jason wrote @ December 28th, 2008 at 5:54 am

Awesome work! Worked 1st go perfectly. Thanks

  Tate-Tot wrote @ December 28th, 2008 at 8:56 am

Hi.
I got as far as converting it to mp4 using the Pieter as well as using H.264 as my video amount. I drug my file into iTunes and it all was going pretty well, but the sound is really messed up. The Sound was originally bad because it was a file I got from the internet, but when playing in VLC it was perfect.

Anyways, when I played the new file in iTunes , the sound was VERY choppy, and did not play as it did in VLC. What is the reason for this?

I also tried the “Convert file to fit iPhone and iPod” choice in itunes, and an error box appeared each time.

I do not know what to do! I want this movie on my iPod/ iPhone so badly! LOL.

Oh I am using a mac by the way and VLC version 0.9.8.

I thank you all so much for writing on this forum. You have all been tremendous help and I believe you can help me to get though this.

Thanks Again!

  Tate-Tot wrote @ December 28th, 2008 at 8:59 am

I meant to say the Pieter recipe. LOL.

Sorry for the run on comments, I understand that this post is from a while ago, but I would love if anyone ever checks this to help me out.

Thank you again.

  Mike Davidson wrote @ December 29th, 2008 at 2:01 pm

Pieter thanks a million for this, I am fed up with installing buggy 3rd party products on my PC and didn’t realise I could transcode through VLC until I found your article 0 thanks again !!!

Your comment

HTML-Tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>