MTV

From S1MP3 Wiki
Jump to: navigation, search

MTV is one of the simple video formats supported by the video enabled S1mp3s. It has no compression rate. The MTV format is currently playable with ffmpeg's svn version.

MTV-Format specifications

This was posted by by Stefan Burger [1]. Some of the header information is still unclear, but uncritical as long as the provided default values are used.

------------------------------------------------
[header] fix size of 512 byte

0x00 3 string constant 'AMV' -> 0x41 0x4d 0x56

0x03 4 file size (sometimes only estimated, see 'formulas'-section)
0x07 4 number of 512 byte segments: =(int)(filesize/512)

0x0b 7 rmination of 0x0b and therefore 0x00

0x23 1 ??? most of the time 0x21
0x28 1 ??? most of the time 0x02

0x2b 3 string constant 'MP3' -> 0x4d 0x50 0x33
0x2e 2 ??? 0x40 when big img 0x80 when small img, sometimes also 0

0x30 3 colorformat either 0x05-0x05-0x05 or 0x05-0x06-0x05
0x33 1 bits per pixel 0x10 -> 16 bit
0x34 2 image width 0x80 -> 128 or 0x60 -> 96
0x36 2 image height 0x60 -> 96 or 0x40 -> 64
0x38 2 image size 0x3000 -> 12288 or 0x6000 -> 24576

0x3e indicator for size of audio segment:

-------128 kbps---------- -------64 kbps----------
1 fps -> 0x20 -> 32 16384 1 fps -> 0x10 -> 16 8192
2 fps -> 0x10 -> 16 8192 2 fps -> 0x08 -> 8 4096
4 fps -> 0x08 -> 8 4096 4 fps -> 0x04 -> 4 2048
8 fps -> 0x04 -> 4 2048 8 fps -> 0x02 -> 2 1024
16fps -> 0x02 -> 2 1024 16fps -> 0x01 -> 1 512

0x40 1 ?? most of the time 0x18
0x41 1 ?? most of the time 0x00
0x42 1 ?? most of the time 0x01

0x47 1 ??hours??
0x48 1 minutes
0x49 1 seconds

0x4a 2 string constant 'TL' -> 0x54 0x4c
0x4c 19 creation date yyyy/MM/dd/hh:mm:ss
0x5f 1 ??may be string termination of 0x4c and therefore 0x00


[audiosegment]
size according to [header@0x3e]
bitrate: either 64kbps or 128kbps
samplerate: always 44100

audiosegemnts are segmentet within themselves:
each subsegment has 512 byte size, where the first 12 byte are always 0-byte
mp3-frame is neither aligned within subsegment nor within segment.
(they are cutted 'hard' whenever a subsegment border appears).


[videoframe]
size according to [header@0x38]
bits per pixel according to [header@0x33]
color format according to [header@0x30]
image width according to [header@0x34]
image height according to [header@0x36]
line order: first line last, last line first
column order: first column first, last column last



some forumulas:
fps = audio_bitrate * 128 / audio_segment_size
audio_bitrate = fps * audio_segment_size / 128
audio_segment_size = audio_bitrate * 128 / fps

estimated_filesize = header_size + (seconds * fps * (img_size + audio_segment_size))
estimated_filesize = header_size + (seconds * audio_bitrate * 128 / audio_segment_size * 
                                   (img_size + audio_segment_size))
estimated_filesize = header_size + (seconds * fps * (img_size + (audio_bitrate * 128 / fps)))

ideal settings may be:
- audio(80kb,1024seg), 10 fps -> 400MB/800MB
- audio(40kb, 512seg), 10 fps -> 384MB/768MB
- audio(48kb, 512seg), 12 fps -> 460MB/920MB

Encoding to MTV

To view tricks and methods to encode video to thsi format, see Video encoding