How to: Convert avi to Mp4 quick and easy

Moderators: RokuDouglas, RokuShawnS, RokuKen, RokuRyan, RokuJamesL

How to: Convert avi to Mp4 quick and easy

Postby pixeltricks » Sat Aug 06, 2011 9:01 am

If you are like me you have a lot of files in .avi format. If those files are using xvid for the codec , then chances are you can convert that to mp4 without doing a video transcode.
A lot of times the audio may be in mp3 format and the player sometimes hangs playing that back inside an mp4, so I convert to AAC, really can't tell the difference.

The video I am converting is:
codec 4CC: XVID
Image Size: 624 x 352
frame rate: 23.976
total duration: 53:00

Audio is MP3.

Step 1.
Download avidemux and install it.
http://avidemux.sourceforge.net/

Step 2.
In avidemux click file , open
pick the avi file you want to convert
If a pop up ask about building time maps , click yes
For rebuild time index , click yes

Step 3.
Under video tab on left, select copy

Step 4.
Under audio tab, select AAC
You can click configure and up the bitrate, I have mine at 160

Step 5.
Under format , select MP4.

Step 6.
Under file, select save video
give it a name and add the .mp4 extension

Now wait for it to finish. Depending on cpu speed it shouldn't take more than a couple minutes to finish. It is copying the video leaving it untouched, transcoding the audio.
If the audio is already in a roku capable format you can select copy under audio as well.
On my pc Q6600 cpu it takes about 2 minutes per hour of video.

Put the file on a usb drive and play ! The video shouldn't have to buffer , all of mine start instantly.

This also works for stubborn MKV files and may work for other file types that have mpeg4 files inside the container.
pixeltricks
 
Posts: 21
Joined: Sat Aug 06, 2011 6:41 am

Re: How to: Convert avi to Mp4 quick and easy

Postby mikebdoss » Sat Aug 06, 2011 9:30 am

I'd like to second everything as described above. avidemux takes care of most 45-minute-long AVIs (television shows) in less than 5 minutes of encoding time. Handbrake and the like are great for other file formats, but very often the underlying file is already in a readable format, you just need to do what avidemux does.
mikebdoss
** Valued Community Member **
 
Posts: 3453
Joined: Mon Oct 25, 2010 12:52 am

Re: How to: Convert avi to Mp4 quick and easy

Postby Newsboys6 » Sat Aug 06, 2011 9:34 am

Will avidemux also encode the file to h.264, i have found the mpeg-4 encoding in handbrake to be quite fast whereas the h.264 is a bit slower and if i am going to transcode my files I would like to do it in h.264 because image quality is better for similar file sizes than mpeg-4.
Newsboys6
 
Posts: 45
Joined: Thu Jan 20, 2011 4:44 pm
Location: Tampa, FL

Re: How to: Convert avi to Mp4 quick and easy

Postby socantra » Sat Aug 06, 2011 9:54 am

Newsboys6 wrote:Will avidemux also encode the file to h.264

Avidemux wiki documentation
http://www.avidemux.org/admWiki/doku.php

H.264 encoding guide
http://www.avidemux.org/admWiki/doku.ph ... rial:h.264
Please attempt to maintain a thin veneer of civility.
Remember, you are speaking to strangers on the internet,
not your own family at home.
socantra
 
Posts: 1144
Joined: Sun Mar 13, 2011 10:11 am

Re: How to: Convert avi to Mp4 quick and easy

Postby Newsboys6 » Sat Aug 06, 2011 10:00 am

socantra wrote:
Newsboys6 wrote:Will avidemux also encode the file to h.264

Avidemux wiki documentation
http://www.avidemux.org/admWiki/doku.php

H.264 encoding guide
http://www.avidemux.org/admWiki/doku.ph ... rial:h.264



Currently reading, you the man dude thanks!
Newsboys6
 
Posts: 45
Joined: Thu Jan 20, 2011 4:44 pm
Location: Tampa, FL

Re: How to: Convert avi to Mp4 quick and easy

Postby pixeltricks » Sat Aug 06, 2011 11:10 am

Newsboys6 wrote:Will avidemux also encode the file to h.264, i have found the mpeg-4 encoding in handbrake to be quite fast whereas the h.264 is a bit slower and if i am going to transcode my files I would like to do it in h.264 because image quality is better for similar file sizes than mpeg-4.


AVI files are nothing but containers that have a video stream and an audio stream. Avidemux splits the avi file into those streams and then combines them back into a new container, mp4 in this case.
If your avi video is already mpeg4 then you don't have to transcode it, both xvid and h.264 are mpeg4. By using avidemux you avoid converting the video to another format and losing quality.
The program can transcode to/from other codecs but don't do it unless the source is in a format the roku cannot play otherwise you are re-encoding already compressed content.
pixeltricks
 
Posts: 21
Joined: Sat Aug 06, 2011 6:41 am

Re: How to: Convert avi to Mp4 quick and easy

Postby Newsboys6 » Sat Aug 06, 2011 11:30 am

avidemux is pretty much the same speed as handbrake when transcoding an xvid avi to h.264 m4v, perhaps it is because, as you mentioned, it is transcoding codecs and re-compressing.

I do have some avi files that are h.264 so perhaps I will try them and see what happens.
Newsboys6
 
Posts: 45
Joined: Thu Jan 20, 2011 4:44 pm
Location: Tampa, FL

Re: How to: Convert avi to Mp4 quick and easy

Postby Newsboys6 » Sat Aug 06, 2011 12:08 pm

Its all the same speed.

and Handbrake is more straight forward IMO so I will continue to use it.

EDIT: actually I will try your listed method for the h.264 avi and see what happens. Because i am pretty sure that for everything else that I want in h.264 I will need to do the transcode if it is in xvid/divx.

EDIT #2: so when converting a file with avidemux that uses the h.264 codec in the avi container by the above instructions, the file does not play. However, I still have failed to do EXACTLY what you said so I will now do an XVID avi with the copy options enabled. lol this is fun though.

EDIT #3: You Sir, have saved me a ton of transcode time and I learned something new. I extend to you, a virtual handshake.
Newsboys6
 
Posts: 45
Joined: Thu Jan 20, 2011 4:44 pm
Location: Tampa, FL

Re: How to: Convert avi to Mp4 quick and easy

Postby Newsboys6 » Sat Aug 06, 2011 1:05 pm

Now all we really need is for the USB channel to be able to play one file after the other automatically without me having to press play once one is finished (autoplay) and/or (even better) to be able to shuffle video files and play things back at random.

I know it seems petty but really the only reason I ever ripped my media was because it makes good background noise while I am doing academic work and I would like for things to play constantly while I work without having to pause at intervals to play the next file.

I have been using my WDTV mini for this but would rather use my roku because the Wii will not work when plugged into the same component vid port as the WDTV because the WDTV sends somewhat of a video signal even when it is off and I have to unplug it for the wii to work (only have one component input).
Newsboys6
 
Posts: 45
Joined: Thu Jan 20, 2011 4:44 pm
Location: Tampa, FL

Re: How to: Convert avi to Mp4 quick and easy

Postby stratcat96 » Sat Aug 06, 2011 1:09 pm

I usually just use Freemake to do encodes. I have used Destructo's directions with Handbrake with good results, but Handbrake has refused to do any ripping on a number of DVDs because of copy-protection that Freemake had no problems with. It is a very simple program that has "just worked" on everything I've tried. The one thing I don't like is that it doesn't have the control that Handbrake does, like being able to rip individual chapters. Can avidemux do that?
Last edited by stratcat96 on Sat Aug 06, 2011 3:03 pm, edited 1 time in total.
stratcat96
** Valued Community Member **
 
Posts: 3430
Joined: Sat Nov 06, 2010 7:22 pm
Location: Ice Planet Hoth

Re: How to: Convert avi to Mp4 quick and easy

Postby socantra » Sat Aug 06, 2011 1:20 pm

pixeltricks wrote:If you are like me you have a lot of files in .avi format. If those files are using xvid for the codec , then chances are you can convert that to mp4 without doing a video transcode.
A lot of times the audio may be in mp3 format and the player sometimes hangs playing that back inside an mp4, so I convert to AAC, really can't tell the difference.

The video I am converting is:
codec 4CC: XVID
Image Size: 624 x 352
frame rate: 23.976
total duration: 53:00

Audio is MP3.

Step 1.
Download avidemux and install it.
http://avidemux.sourceforge.net/

Step 2.
In avidemux click file , open
pick the avi file you want to convert
If a pop up ask about building time maps , click yes
For rebuild time index , click yes

Step 3.
Under video tab on left, select copy

Step 4.
Under audio tab, select AAC
You can click configure and up the bitrate, I have mine at 160

Step 5.
Under format , select MP4.

Step 6.
Under file, select save video
give it a name and add the .mp4 extension

Now wait for it to finish. Depending on cpu speed it shouldn't take more than a couple minutes to finish. It is copying the video leaving it untouched, transcoding the audio.
If the audio is already in a roku capable format you can select copy under audio as well.
On my pc Q6600 cpu it takes about 2 minutes per hour of video.

Put the file on a usb drive and play ! The video shouldn't have to buffer , all of mine start instantly.


I just gave pixeltricks' step-by-step tutorial for converting AVIs to MP4s for the Roku (model 1) the official dummy test and it works perfectly.

I don't have much of a need to convert and don't normally use my Roku for local streaming, but it seems that people have been having a lot of trouble with AVI conversions and besides, it is 108 degrees outside.

I followed the directions in the original post to the letter and tried two files.
1). a DVD Rip of Spawn at about 1.4gb.
2). an old bit torrent copy of Charlie Chan - The Black Camel at around 800mb.

It took a bit longer on my old single core xp machine, 16 minutes for Spawn and about 10 for Charlie Chan. Then transferred the thumb drive by Tennis Shoe Network to the Roku and both played just fine, loaded quickly and worked well on pause and FF. Comparing the mp4s on the Roku to the Avis on my 1st generation WD Live, I couldn't tell any difference.

So, many thanks pixeltricks. It certainly worked well on this limited test and seemed much easier than anything else I have seen discussed. It also looks like from the docs that there is a fairly low hassle batch mode available in Avidemux and the price is certainly right (free).
Please attempt to maintain a thin veneer of civility.
Remember, you are speaking to strangers on the internet,
not your own family at home.
socantra
 
Posts: 1144
Joined: Sun Mar 13, 2011 10:11 am

Re: How to: Convert avi to Mp4 quick and easy

Postby pixeltricks » Wed Aug 10, 2011 9:07 am

socantra wrote:So, many thanks pixeltricks. It certainly worked well on this limited test and seemed much easier than anything else I have seen discussed. It also looks like from the docs that there is a fairly low hassle batch mode available in Avidemux and the price is certainly right (free).


here is a simple bat file that will encode every avi in the directory to mp4. Just save as a .bat file and double click to run.

Code: Select all
set avidemux="C:\Program Files \Avidemux 2.5\avidemux2.exe"
set videocodec=copy
set audiocodec=AAC
for %%f in (*.avi) do %avidemux% --video-codec %videocodec% --audio-codec %audiocodec% --autoindex  --load "%%f" --output-format MP4 --save "%%f.mp4" --quit
pixeltricks
 
Posts: 21
Joined: Sat Aug 06, 2011 6:41 am

Re: How to: Convert avi to Mp4 quick and easy

Postby Newsboys6 » Wed Aug 10, 2011 9:18 am

I guess I'll have to boot into Windows...
Newsboys6
 
Posts: 45
Joined: Thu Jan 20, 2011 4:44 pm
Location: Tampa, FL

Re: How to: Convert avi to Mp4 quick and easy

Postby StellarRat » Wed Aug 10, 2011 3:27 pm

You can also reformat with VLC. It's open source (i.e. free) and there are both Linux and Windows versions. It also is an excellent music and video player. :D
StellarRat
 
Posts: 129
Joined: Tue Jan 04, 2011 3:34 pm

Re: How to: Convert avi to Mp4 quick and easy

Postby mikebdoss » Wed Aug 10, 2011 3:28 pm

pixeltricks wrote:
socantra wrote:So, many thanks pixeltricks. It certainly worked well on this limited test and seemed much easier than anything else I have seen discussed. It also looks like from the docs that there is a fairly low hassle batch mode available in Avidemux and the price is certainly right (free).


here is a simple bat file that will encode every avi in the directory to mp4. Just save as a .bat file and double click to run.

Code: Select all
set avidemux="C:\Program Files \Avidemux 2.5\avidemux2.exe"
set videocodec=copy
set audiocodec=AAC
for %%f in (*.avi) do %avidemux% --video-codec %videocodec% --audio-codec %audiocodec% --autoindex  --load "%%f" --output-format MP4 --save "%%f.mp4" --quit


Do you have equivalent command line commands for linux? I'd like to be able to do this on my Ubuntu machines as well.
mikebdoss
** Valued Community Member **
 
Posts: 3453
Joined: Mon Oct 25, 2010 12:52 am

Next

Return to Roku Streaming Player General Discussion

Who is online

Users browsing this forum: Basil and 20 guests