My favorites | Sign in
Project Logo
                
Search
for
Updated Nov 13, 2007 by voroshil
Labels: Featured
HowToConvertToAMV  
How to convert video into AMV format

How to convert video into AMV format

Using patched FFmpeg

In common case command line will look like

ffmpeg -i <input> -f amv -s <width>x<height> -r 16 -ac 1 -ar 22050 -qmin 3 -qmax 3 <output>

FFmpeg accepts any picture resolutions, but hardware players supports only:

  • 128x90
  • 128x128
  • 160x120

Input file can be any video format supported by FFmpeg.

Note: if output file has 'amv' extention, -f amv option can be omitted.

Option -r 16 sets framerate to 16 frames/sec (other values seems to be not supported by hardware players).

Options -ac 1 and -ar 22050 sets 22050 Hz mono sound. Other formats are not supported.

Options -qmin 3 and -qmax 3 forces quantizer to be equal to 3. This will give you good quality with acceptable file size.

Example 1. Converting AVI file into AMV with 160x120 picture size:

ffmpeg -i file.avi -s 160x120 -ac 1 -ar 22050 -qmin 3 -qmax 3 file.amv

Comment by libin.charles, Jan 13, 2008

I met a error when using ffmpeg, so what's this mean?

Unable to find a suitable output format for 'TITANIC_My_Heart_Will_Go_On?.amv'

Comment by nononoeno, Feb 03, 2008

have you downloaded the "amv-ffmpeg-linux-i386-20071030" and put it into /usr/bin ?

it's better if you rename this file (#mv amv-ffmpeg-linux-i386-20071030 ffmpeg-amv), give the +x permission to all and then launch the conversion with:

ffmpeg-amv -i file.avi -s 160x120 -ac 1 -ar 22050 -qmin 3 -qmax 3 file.amv

Comment by testcoop, Feb 03, 2008

After doing the last suggested thing I met an error ffmpeg-amv ffmpeg-amv: /lib/tls/libc.so.6: version `GLIBC_2.4' not found (required by ffmpeg-amv)

How to overcome it?

Thanks

Comment by wizofwonders, Feb 06, 2008

is it possible to convert amv back into other files? if so please tell me how.

thanks

Comment by elproferoman, Feb 10, 2008

Hi. In Linux i can convert avi video to amv, but the speed in this amv file is slow and... step by step (i don't know howto explain beter). The command used is: ffmpeg-amv -i fz18.avi -s 160x120 -ac 1 -ar 22050 -qmin 3 -qmax 3 fz18.amv

Any body can help me?

(sorry by my english)

Roman

Comment by rohm...@yahoo.com, Feb 12, 2008

HI, does anyone have the code to make a amv preset into WinFF?

Comment by sylvain.zambelli, Mar 11, 2008

Hi, I just found this tool and it was exactly what i was looking for to ease transcoding videos to amv.

I'm fairly new to all this, but i found out about avisynth and thought it would be a good way to resize, crop, add borders and/or rotate my videos before feeding them to ffmpeg (i don't know if ffmpeg rotates). I read on an ffmpeg FAQ (http://ffmpeg.mplayerhq.hu/faq.html#SEC28) :

"If you have built FFmpeg with ./configure --enable-avisynth (only possible on MinGW/Cygwin platforms), then you may use any file that DirectShow? can read as input."

Since I use windows and know nothing about compiling, I just wanted to know if this could be included in the windows exe of your project or not at all. Or, if it is possible for me to do it myself, if someone could just point the way ...

thx

Comment by devjoe, Mar 23, 2008

I am experiencing the same issues as elproferoman. The playback of the AMV file produced by amv-ffmpeg is choppy and slower than it should be. In my case, I am using the Oasis player by Mach Speed Technologies, and resolution 208x176 since that is the resolution of my player. I will experiment with different frame rates and audio formats, since it is already the case that my player has a higher resolution than the players mentioned in the start of this page.

Comment by devjoe, Mar 24, 2008

My player (see above) works at 10 frames per second. The wikipedia page for the format says 12 frames per second has also been seen.

Comment by b4rr37, Apr 11, 2008

Mi player reproduce formatos: .SMV, es posible con este programa?

Gracias,

Comment by einrad.traum, May 17, 2008

I got this to work with my clone iPod, however I found some information on this page is lacking.

Firstly, "-r 16" must be included when I encode my flash videos into AMV in order for them to play on my device.

The resolutions also don't quite make sense... the second "supported" resolution has a height of 128 pixels, yet the largest "supported" resolution only has a height of 120?? It may work, however I tried at 160x128 and it works perfectly (uses all the space on that small screen). The first "supported" resolution seems strange too, because the SQCIF resolution is 128x96 (I tested SQCIF and it worked perfectly, however it didn't use the entire screen).

There are no guarantees that this will work with your device, however here is a practical example based on the command I use to play AMVs on the chinaPod I got in Thailand:

ffmpeg-amv -i '/input/file/here.flv' -s '160x128' -r 16 -ac 1 -ar 22050 -qmin 3 -qmax 3 '/output/file/here.amv'

The following assumptions are made: you got the script from Google and put it in your /usr/bin, you did sudo chmod +x to it and you named it ffmpeg-amv (otherwise replace "ffmpeg-amv" to whatever you named the file), and you want the biggest supported resolution (160x128).

Again, the most important part of the practical example I am posting here is the inclusion of "-r 16".

@b4rr37:

No, Ud. tiene que buscar otro software para codificar sus videos en SMV.

Con este codificador de Google, hice ffmpeg-amv -formats y no aparece el SMV.

(No, SMV isn't supported, see ffmpeg-amv -formats.)

Comment by andrzej.januszkiewicz, May 25, 2008

there is a question above: "is it possible to convert amv back into other files? if so please tell me how."

sure it is. but the method specified above scales the frames down do 160x120. this is a picture of the size of a post stamp. so the conversion back to avi/mpeg, although possible, is useless, because your move lacks all the details even if viewed full screen.

Comment by ldibanyez, Jun 16, 2008

To testcoop: I think that you got an older version of the glibc package than 2.4, check that and upgrad if needed.

Comment by peppinolisi, Jul 02, 2008

How can convert in sunplus avi 320x240?

Comment by Andrew.Mainland, Sep 23, 2008

I'm getting a "Format Error" error at the end or middle of the video. I've tried various sizes. All with same result. Please tell me how I can get a better error message or any ideas on how to fix this issue.

Comment by Andrew.Mainland, Sep 23, 2008

Also I believe the resolution of my player Curst2026 is 120x120

Comment by dfox94085, Sep 25, 2008

OK, going back to the first example:

I did a few test encodes with the patched ffmpeg in the last 2 days. I have recently obtained a 4gig IVO-Sound media player (m620) that supports the AMV video file format. Using this command one needs to tell it the fps (-m 16) in the first example. The other examples I tried omitted this and as such the player is incapable of playing the format - presumably because the fps value is too high (it also increases the file size quite a bit).

So thanks to all as I was able to get this player to work in Linux (of course the player info tells me I need Windows :( ) using ubuntu hardy. No issues mounting the device either - it's just that this player is finicky with the format of the AMV file. I'll do some more testing ;).

Comment by Frank.Grant56, Oct 28, 2008

My Sansui san20084 has soft crackly sound. It needs 88kbs instead of 64kbs streaming. How do you change that setting. Also it works fine with a setting of 208x176 for the video

Comment by m4rtin.m, Dec 24, 2008

FFmpeg accepts any picture resolutions, but hardware players supports only:

  • 128x90
  • 128x128
  • 160x120

PLEASE ADD 208x176 ,.,... THANK YOU!!

Comment by heinzmann.claudio, Jan 03, 2009

ffmpeg.exe-i(video.avi)-f amv-s128x90-r16-ac1-ar22050-qmin3-qmax3(video.amv)

Comment by chpbruckner, Jan 11, 2009

for me, audio has strange gaps or noise. I adjusted -f to 18 and now it seems to be fine.

Comment by anthony.madamba1, Jun 19, 2009

sir i have no idea about what you said but im only a newbie here... can someone say explain it to me as if im a 2 year old child... this will be very helpful to me.. coz i used a lot of converters to change my vidz to .amv file but the player says unsupported file... thank you so much

Comment by alain.goldberg, Aug 06, 2009

Thanks for this great info. As my favorite is php, i wrote a quick and dirty php script to ease the convertion, use it if you wish. I called it: 2amv.php usage: % 2amv.php filenameOfOriginal.xxx for me it creates: filenameOfOriginal.amv that work well.

#!/usr/bin/php <?php

$filea = explode(".",$argv1?,2); $cmd = "/usr/bin/ffmpeg-amv -i '" .
$argv1? . "' -s 160x120 -ac 1 -ar 22050 -qmin 3 -qmax 3 '" . $filea0? . ".amv'";
exec ( $cmd, $resULT, $retval );
?>

( yes it's dirty... but i am in hurry ) Alain

Comment by stephan....@gmail.com, Oct 16, 2009

A quick bit of advice. If you're immediately getting "Format Error" when trying to play the generated files, double check that your player's filesystem isn't corrupt.

If it is, copy off any files you don't have other copies of, check them for corruption, and then reformat the device using /usr/sbin/mkfs.vfat (For some reason, flash devices I buy seem eager to get their FATs out of sync unless/until I reformat using the Linux VFAT formatter.)


Sign in to add a comment
Hosted by Google Code