From MultimediaWiki
Jump to: navigation, search

Short for PlayStation Portable Movie Format, PSMF is a SONY proprietary format used for movies intended to be played on the PSP portable game console. The format is based on MPEG, and contains H.264 video and Sony ATRAC audio.

PSMF files start with a variable length header, followed by MPEG Program Stream data. The video data is carried in PES packets using a stream_id of 0xE0, and audio data is carried in private_stream_1 PES packets.

Header format

Byte order: BIG endian

Offset Name Bits Type Semantics
0x0 magic 32 ASCII "PSMF"
0x4 version_num 32 ASCII version number
0x8 data_offset 32 be int PMF-relative data offset. - this is seemingly always 2048 bytes
0xc data_size 32 be int total size of PMF data (subsequent-to 0x800 data-offset)

The aforementioned 16-bytes delimits the total length of the PMF header; which is proceeded-with 64-bytes of null padding-data. Given this; the following block-address-map is invariably always situated at 0x50.

Offset Name Bits Type Semantics
0x50 table_size 32 be int the overall length (from 0x54 -) of the mapping-table.
0x54 unknown 16 be int always 0?
0x56 tick_freq 32 be int  ?
0x5a unknown 16 be int always 0?
0x5c duration 32 be int stream duration in ticks
0x60 mux_rate 32 be int equal to program_mux_rate in pack_header