About AMV file format

Video encoding, MTV, DMV, AMV, AMR, fps and everything video-related

Moderator: scrub50187

About AMV file format

Postby sotux » Tue May 30, 2006 2:54 pm

I read a post from a Chinese mp3 bbs. The post describe the amv format.
Here's the link:
http://forum.easydigi.com/dispbbs.asp?boardID=69&ID=15817&page=3
http://forum.easydigi.com/dispbbs.asp?boardID=69&ID=15818&page=3

The first link describe the video part and the second link describe the audio part.

The post said that amv format is a riff format.
Anyone know about this?
sotux
 
Posts: 2
Joined: Tue May 30, 2006 2:37 pm
Location: Shanghai China

Postby wladston » Wed May 31, 2006 1:13 am

no idea ... anyone can dig the page and extract the informations ?
1GB Standard s1 mp3 player. (MP-482C MAIN V8)
1GB "mp4" s1mp3 player. Not remarked.
I DO __NOT__ reply to PM's. Send email instead. I won't be even notified for new PM's.
User avatar
wladston
Site Admin
Site Admin
 
Posts: 1721
Joined: Tue Aug 23, 2005 8:54 pm
Location: Belo Horizonte, MG - Brazil

Postby sotux » Fri Jun 09, 2006 4:59 pm

Code: Select all
1.   Analyze the AMV file
Open an AMV file by AMV player and you can find the file property including fps, size and the audio bit rate.
2.   Analyze the file header
Open an AMV file by HEdit
 
See “RIFF”?
First, let’s know about the RIFF format. RIFF use FOURCC to present data type, e.g. ‘RIFF’,’AVI’,’LIST’ etc. The first 4 bytes is ‘RIFF’. It means this is a RIFF file, the next 4 bytes means the size of file. The third 4 bytes means the type of file (e.g. avi, wave), and the rest is data. But AMV format ignores the length info. All data presenting length is 0.
AMV use ‘AVI’ to present its format. The struct of AVI file is: RIFF header + 2 List (One describes media type, another saves media data) + optional index block.
The struct of a normal AVI(one video stream, one audio stream) file is:
RIFF(‘AVI’
      LIST(
         ‘hdrl’
         ‘avih’  (AVI info data)
         LIST(
            ‘strl’  (video stream)
            ‘strh’  (stream info data)
            ‘strf’  (stream format data)
            ‘strd’  (expended stream info, optional)
            ‘strn’  (stream name, optional)
         )
         LIST(
            ‘strl’  (audio stream)
            ‘strh’  (stream info data)
            ‘strf’  (stream format data)
            ‘strd’  (expended stream info, optional)
            ‘strn’  (stream name, optional)
         )
      )
      LIST(
         ‘movi’  (stream data block)
         …
         …
         …
      )
      [‘idxl’]  (index data, optional)
)
The stream data block use FOURCC to present the type. The FOURCC is combined by 2 bytes stream number and 2 bytes type code. The standard type code definition is ‘db’(Uncompressed video frame), ’dc’(Compressed video frame), ’pc’(use new palette) and ‘wb’(audio)
So AMV format and AVI format are almost the same.
RIFF(‘AMV’...)presents AMV format. The following is the first ‘hdrl’LIST to describe the format info. The‘hdrl’LIST include blocks and sub lists . First is a ‘amvh’ block including the global file info, e.g. stream’s amount, video width/height, etc. See below of the data struct.

typedef struct _amvmainheader {
    FOURCC  fcc;                // Must be ‘amvh’
    DWORD cb;                  // The size of data strcut itself. Not including the first 8 bytes.
    DWORD dwMicroSecPerFrame;  // Frame alternate time (MicroSecond)
    BYTE     reserve[28];       // All is 0, unkonw usage
    DWORD dwWidth;           //  Width (Pixel)
    DWORD dwHeight;          // Height (Pixel)
    DWORD Speed;              // FPS
    DWORD reserve0;          // value is 1, unknown usage
    DWORD reserve1;          // value is 0, unknown usage
    BYTE     dwTimeSec;       // Total time (second)
    BYTE     dwTimeMin;       // Total Time (minute);
    WORD   dwTimeHour;     // Total Time (hour);
} AMVMAINHEADER;
sotux
 
Posts: 2
Joined: Tue May 30, 2006 2:37 pm
Location: Shanghai China

Postby ntoni » Sun Feb 25, 2007 4:31 pm

Well I'm collecting some informations about this format... in my effort to try to build up an highly experimental conversion script for linux.
As I've seen, the format uses AVI incapsulation and encodes video in single jpeg frames while encoding audio simply in mp3.
For video and audio encoding we could use mencoder, which provides support both to jpeg frame-by-frame and to mp3 conversion.
My question is: does anybody knows how to incapsulate this informations in to an AVI file using mencoder?
Thanks!
User avatar
ntoni
 
Posts: 5
Joined: Sun Feb 18, 2007 12:46 pm

Postby jpablo » Wed Mar 07, 2007 4:04 am

AMV Video Structure

Here is a simple test to understand what's in the AMV video file.

1. make an AVI video of total 10 frames using RAW DATA format, at 12fps sized 160x120 without sound
2. save eche frame to BMP (do not use jpeg now, name them as 01.bmp ~ 10.bmp)
3. convert the BMP files to JPEG, be careful with the JPEG compress level
4. convert the AVI file to 160x120, 12fps AMV, again be careful about the Image quality setting which is the JPEG compress level, and set Image Zoom to 0
5. compare the AMV and JPEG files using a hex editor


well this could be done with mencoder, it's just a matter of study some of the documentation of mencoder, to see if it's possible...
jpablo
 
Posts: 4
Joined: Wed Mar 07, 2007 4:01 am

Postby ntoni » Tue Apr 10, 2007 8:30 pm

More information
See at http://www.moviecodec.com/topics/7595p5.html what Stefan Burger wrote.
User avatar
ntoni
 
Posts: 5
Joined: Sun Feb 18, 2007 12:46 pm

Re: About AMV file format

Postby ntoni » Thu Sep 13, 2007 4:54 pm

More informations once again!
Found out this, googling around. Might work! I'll test it on a clean linux environment with the last available mencoder version this evening.
Code: Select all
mencoder -noodml naruto13.flv -of avi -o test.amv -ofps 24 -vf-add scale=128:96 -srate 44100 -ovc xvid -xvidencopts bitrate=550:max_bframes=0:quant_type=h263:me_quality=4 -oac lavc -lavcopts acodec=mp2:abitrate=128

and this
Code: Select all
    mencoder -noodml [SOURCEFILE] -of avi -o [DESTNAME].avi -ofps 24 -vf-add scale=224:176 -vf-add expand=224:176:-1:-1:1 -srate 44100 -ovc xvid -xvidencopts bitrate=550:max_bframes=0:quant_type=h263:me_quality=4 -oac lavc -lavcopts acodec=mp2:abitrate=128
User avatar
ntoni
 
Posts: 5
Joined: Sun Feb 18, 2007 12:46 pm


Return to Video related (MTV, AMV, encoders, etc.)

Who is online

Users browsing this forum: No registered users and 2 guests



cron