Mercurial > mplayer.hg
comparison DOCS/tech/formats.txt @ 2764:6f7814af2a58
extended ascii version of formats.html
author | arpi |
---|---|
date | Wed, 07 Nov 2001 23:01:49 +0000 |
parents | |
children | a24cd70a12d1 |
comparison
equal
deleted
inserted
replaced
2763:1af36191ad26 | 2764:6f7814af2a58 |
---|---|
1 1. Input layer, supported devices, methods: | |
2 - plain file, with seeking | |
3 - STDIN, without seeking backward | |
4 - network streaming (currently plain wget-like HTTP, no MMS support yet) | |
5 - VCD (Video CD) track, by direct CDROM device access (not requires mounting disc) | |
6 - DVD titles using .IFO structure, by direct DVD device access (not requires mounting disc) | |
7 | |
8 2. Demuxer/parser layer, supported file/media formats: | |
9 | |
10 - MPEG streams (ES,PES,PS. no TS support yet) | |
11 note: mpeg demuxer silently ignore non-mpeg content, and find mpeg packets | |
12 in arbitrary streams. it means you can play directly VCD images (for example | |
13 CDRwin's .BIN files) without extracting mpeg files first (with tools like vcdgear) | |
14 It accepts all PES variants, including files created by VDR. | |
15 Note: VOB (video object) is simple mpeg stream, but it usually has 01BD | |
16 streams which may contain subtitles and non-mpeg audio. Usually found on DVD discs. | |
17 | |
18 Headers: mpeg streams has no global header. each frame sequecne (also called GOP, | |
19 group of pictures) contains an sequence header, it describes that block. | |
20 In normal mpeg 1/2 content there are GOPs of 12-15 frames (24/30 fps). | |
21 It means you can freely seek in mpeg streams, and even can cut it to | |
22 small parts with standard file tools (dd, cut) without destroying it. | |
23 | |
24 Codecs: video is always mpeg video (mpeg1, mpeg2 or mpeg4). | |
25 audio is usually mpeg audio (any layer allowed, but it's layer 2 in most files) | |
26 but 01BD streams may contain AC3 or LPCM too. | |
27 | |
28 FPS: mpeg2 content allow variable framerate, in form of delayed frames. | |
29 It's mostly used for playback 24fps contant at 29.97/30 fps (NTSC) rate. | |
30 (so called Telecine or 3:2 pulldown effect) | |
31 It means you see 30 frames per second, but there are only 24 different | |
32 pictures and some of them are shown longer to fill 30 frame time. | |
33 If you encode such files with mencoder, using -ofps 24 or -ofps 23.98 | |
34 is recommended. | |
35 | |
36 - AVI streams. | |
37 Two kind of RIFF AVI files exists: | |
38 1. interleaved: audio and video contant is interlaved. it's faster and | |
39 requires only 1 reading thread, so it's recommended (and mostly used). | |
40 2. non-interleaved: audio and video aren't interleaved, i mean first come | |
41 whole video followed by whole audio. it requires 2 reading process or | |
42 1 reading with lots of seeking. very bad for network or cdrom. | |
43 3. badly interleaved streams: mplayer detects interleaving at startup and | |
44 enables -ni option if it finds non-interleaved content. but sometimes | |
45 the stream seems to be interleaved, but with bad sync so it should be | |
46 played as non-interleaved otherwise you get a-v desync or buffer overflow. | |
47 MPlayer supports 2 kind of timing for AVI files: | |
48 - bps-based: it is baed on bitrate/samplerate of video/audio steram. | |
49 this method is used by most players, including avifile and wmp. | |
50 files with broken headers, and files created with VBR audio but not | |
51 vbr-compliant encoder will result a-v desync with this method. | |
52 (mostly at seeking). | |
53 - interleaving-based: note: it can't be used togethwer with -ni | |
54 it doesn't use bitrate stuff of header, it uses the relative position | |
55 of interleaved audio and video chunks. makes some badly encoded file | |
56 with vbr audio playable. | |
57 | |
58 Headers: AVI files has a mandatory header at the begin of the file, | |
59 describing video parameters (resolution, fps) and codecs. Optionally | |
60 they have an INDEX block at the end of the file. It's optional, but | |
61 most files has such block, because it REQUIRES for seeking. | |
62 Btw usually it can be rebuild from file content, mplayer does it with | |
63 the -idx switch. Mplayer can fix broken index blocks using -forceidx. | |
64 As AVI files needs index for random access, broken files with no index | |
65 are usually unplayable. | |
66 Of course, cutting/joining AVI files needs special programs. | |
67 | |
68 Codecs: any audio and video codecs allowed, but I note that VBR audio is | |
69 not well supported by most players. The file format makes it possible to | |
70 use VBR audio, but most players expect CBR audio and fails with VBR, | |
71 as VBR is unusual, and Microsoft's AVI specs only describe CBR audio. | |
72 I also note, that most AVI encoders/multiplexers create bad files if | |
73 using VBR audio. only 2 exception (known by me): NaNDub and MEncoder. | |
74 | |
75 FPS: must be constant, but skipping frames are allowed. | |
76 | |
77 - ASF streams: | |
78 ASF (active streaming format) comes from Microsoft. they developed two | |
79 variant of ASF, v1.0 and v2.0. v1.0 is used by their media tools (wmp and | |
80 wme) and v2.0 is published and patented :). of course, they differ, | |
81 no compatibility at all. (it's just a legality game) | |
82 MPlayer supports only v1.0, as nobody ever seen v2.0 files :) | |
83 Note, that .ASF files are nowdays come with extension .WMA or .WMV. | |
84 | |
85 Headers: Stream headers (codecs parameters) can be everywhere (in theory), | |
86 but all files i've seen had it at the beginning of the file. | |
87 Asf uses fixed packet size, so it is seekable without any INDEX block, | |
88 and broken files are playable well. | |
89 | |
90 Codecs: video is mostly microsoft's mpeg4 variants, MP42, MP43 (aka DivX), | |
91 WMV1 and WMV2. but any codecs allowed. | |
92 audio is usually wma or voxware, but any codecs allowed. | |
93 | |
94 FPS: no fixed fps, every video frame has an exact timestamp instead. | |
95 I've got stream with up to 3 sec frame display times. | |
96 | |
97 - QuickTime / MOV files: | |
98 They come from Mac users, usually with .mov or .qt extension, but as | |
99 MPEG Group choose quicktime as recommended file format for MPEG4, | |
100 sometimes you meet quicktime files with .mpg extension. | |
101 | |
102 At first look, it's a mixture of ASF and AVI. | |
103 It requires INDEX block for random access and seeking, and even for | |
104 playback, like AVI, but uses timestamps instead of constant framerate | |
105 and has more flexible stream options (including network stuff) like ASF. | |
106 | |
107 Headers: header can be placed at the beginning or at the end of file. | |
108 About half of my files has it at the begining, others has it at the end. | |
109 Broken files are only playable if they have header at the beginning! | |
110 | |
111 Codecs: any codecs allowed, both CBR and VBR. | |
112 Note: most new mov files use Sorenson video and audio, they are | |
113 patented, closed, secret, (TM)-ed etc formats, only Apple's quicktime | |
114 player is able to playback these files (on win/mac only). | |
115 | |
116 - VIVO files: | |
117 They are funny streams. They have a human-readable ascii header at | |
118 the beginning, followed by interleaved audio and video chunks. | |
119 It has no index block, has no fixed packetsize or sync bytes, and most | |
120 files even has no keyframes, so forget seeking! | |
121 Video is standard h.263 (in vivo/2.0 files it's modified, non-standard | |
122 h.263), audio is either standard g.723 or Vivo Siren codec. | |
123 | |
124 Note, that microsoft licensed vivo stuff, and included in their netshow | |
125 v2.0 program, so there are VfW/ACM codecs for vivo video and audio. | |
126 |