Compare commits
323 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1450d6e637 | ||
|
|
a99a35c8ea | ||
|
|
056e9efc8e | ||
|
|
cf43508eb3 | ||
|
|
c9c6e5f4e8 | ||
|
|
a5a02ea3f2 | ||
|
|
69b6248327 | ||
|
|
533dbaa55b | ||
|
|
ec7f0b527c | ||
|
|
a582b028a4 | ||
|
|
f36cea2673 | ||
|
|
5d833dd299 | ||
|
|
bf7dc6b29d | ||
|
|
596762f058 | ||
|
|
d2c5904cab | ||
|
|
3899b3be0c | ||
|
|
5163de0873 | ||
|
|
738c17b3a6 | ||
|
|
27128d82fa | ||
|
|
ed288c0edd | ||
|
|
9442f50c33 | ||
|
|
89bd2307f5 | ||
|
|
60a1384013 | ||
|
|
b59919afe2 | ||
|
|
764ffdd0ec | ||
|
|
ed9e561490 | ||
|
|
24e0a9e451 | ||
|
|
4d8330d095 | ||
|
|
30d7dce94f | ||
|
|
6e21f03547 | ||
|
|
fa3f7391be | ||
|
|
b7000d0517 | ||
|
|
169e634457 | ||
|
|
053bc4ce8b | ||
|
|
56634b2328 | ||
|
|
1072498081 | ||
|
|
e952ff6981 | ||
|
|
9cee26dfde | ||
|
|
605f89ffc9 | ||
|
|
21587509ec | ||
|
|
ad6177e52c | ||
|
|
b1ceca016a | ||
|
|
85b1e265c9 | ||
|
|
8449cebc90 | ||
|
|
4a721b18ed | ||
|
|
f0869d3721 | ||
|
|
be82df9e12 | ||
|
|
b70a37f854 | ||
|
|
812a4a5813 | ||
|
|
c9316b7c6d | ||
|
|
8511c141e0 | ||
|
|
2bf9a09a2c | ||
|
|
4601765ee8 | ||
|
|
54544100a3 | ||
|
|
97437dada6 | ||
|
|
c8736de331 | ||
|
|
92f1b5df32 | ||
|
|
82e4fd193f | ||
|
|
3a0649ddeb | ||
|
|
9f05400ea8 | ||
|
|
09cfd6f597 | ||
|
|
b2af83a9ed | ||
|
|
f38b2a6be8 | ||
|
|
db93a5a0c8 | ||
|
|
b5fe6bee01 | ||
|
|
57571f348e | ||
|
|
ab2ea6415b | ||
|
|
7181adab80 | ||
|
|
bac822025e | ||
|
|
8a8aafd2b9 | ||
|
|
a13ef61051 | ||
|
|
4fbc35cd53 | ||
|
|
1ec29b2da5 | ||
|
|
5cc5152e80 | ||
|
|
558cf502ac | ||
|
|
b0da6a744a | ||
|
|
d99613bad6 | ||
|
|
64556c200e | ||
|
|
c026f336b9 | ||
|
|
5c2d684986 | ||
|
|
77dafced71 | ||
|
|
9c96b1efb1 | ||
|
|
30442fa217 | ||
|
|
e7d10f5a90 | ||
|
|
ca5dfd1550 | ||
|
|
1979a9b4f2 | ||
|
|
d805b8f454 | ||
|
|
a01387bb35 | ||
|
|
11b72c073c | ||
|
|
bb6702f206 | ||
|
|
dd606be909 | ||
|
|
8c987d8291 | ||
|
|
6ddb12b688 | ||
|
|
c34968c6d4 | ||
|
|
a5107aab98 | ||
|
|
bc2dd37e4f | ||
|
|
4482ee9d9c | ||
|
|
2ac3aa129e | ||
|
|
1486e99b90 | ||
|
|
dc6ee18363 | ||
|
|
bb0c352ec5 | ||
|
|
1125f26f83 | ||
|
|
c11d360ebc | ||
|
|
dd6334a1e4 | ||
|
|
6b1af6a328 | ||
|
|
1656dd7a4e | ||
|
|
144c80042b | ||
|
|
a460d9e1f7 | ||
|
|
94af9cf46b | ||
|
|
46d9dd6980 | ||
|
|
a652bb2857 | ||
|
|
7850a9b384 | ||
|
|
de33e8675c | ||
|
|
fe9dae6df8 | ||
|
|
a7d35b2f99 | ||
|
|
526f24e3fd | ||
|
|
a8edc1cbc7 | ||
|
|
f45cfb4751 | ||
|
|
566d26923e | ||
|
|
767efcb46e | ||
|
|
cb9ccc89c5 | ||
|
|
5925e25218 | ||
|
|
303e48e6a2 | ||
|
|
e30e0a16af | ||
|
|
210d8f4ca2 | ||
|
|
cc4718196a | ||
|
|
f629fcd308 | ||
|
|
b8fa424ce2 | ||
|
|
01f1201267 | ||
|
|
3af3a871af | ||
|
|
82d7ad3344 | ||
|
|
c5388d680e | ||
|
|
8abaa83d2c | ||
|
|
8e0a53bd34 | ||
|
|
ba19cb6885 | ||
|
|
3b80fb50d8 | ||
|
|
fe7deb7cc4 | ||
|
|
44b3f05309 | ||
|
|
dc3ab8ca43 | ||
|
|
e308a91c9c | ||
|
|
207db36a4f | ||
|
|
9bf76932e5 | ||
|
|
91f9c7917c | ||
|
|
fa75093381 | ||
|
|
baec70e16f | ||
|
|
2649439bbd | ||
|
|
266ec41f77 | ||
|
|
694279bfd2 | ||
|
|
0ab69793fc | ||
|
|
fa38ed8ac0 | ||
|
|
acf2d3293c | ||
|
|
48ba48fb13 | ||
|
|
e1baba3ddb | ||
|
|
399f7e0e75 | ||
|
|
90edd5df3d | ||
|
|
e6df35b3be | ||
|
|
b2c9e9be87 | ||
|
|
f4e34d1614 | ||
|
|
076a8dfd41 | ||
|
|
61f55565fb | ||
|
|
a9a8e5ca99 | ||
|
|
b6b46db9e4 | ||
|
|
21d99be9dc | ||
|
|
c2a2ad133e | ||
|
|
b6187e48db | ||
|
|
8af11e51f2 | ||
|
|
f597825052 | ||
|
|
7d704f5127 | ||
|
|
7b6b9be861 | ||
|
|
374409eb1a | ||
|
|
a352fedb24 | ||
|
|
c92068430d | ||
|
|
274a5b7cdb | ||
|
|
eb975b1c8b | ||
|
|
84648d33ba | ||
|
|
4b8a0b058d | ||
|
|
1de90fd375 | ||
|
|
20ca827019 | ||
|
|
c8b37fd03d | ||
|
|
b37131f798 | ||
|
|
95345e942c | ||
|
|
878a7d1573 | ||
|
|
bd968d260a | ||
|
|
00c5cf4beb | ||
|
|
87757508ab | ||
|
|
6a57021cf9 | ||
|
|
f66418afba | ||
|
|
f20f79307b | ||
|
|
7371b0ca6f | ||
|
|
c5cbda5079 | ||
|
|
d1bc77d86c | ||
|
|
91d5da9321 | ||
|
|
08ddfb77a1 | ||
|
|
a0352d01e9 | ||
|
|
8893f7d815 | ||
|
|
7c772ccd27 | ||
|
|
cf82c5cd5b | ||
|
|
2ff36ef521 | ||
|
|
cb8577a4da | ||
|
|
7e33a66c0e | ||
|
|
b55b34f862 | ||
|
|
893cf1b1ae | ||
|
|
609d299ed0 | ||
|
|
01a0612c70 | ||
|
|
dcf1830a15 | ||
|
|
a8d89df367 | ||
|
|
095946afa7 | ||
|
|
6d75dbebc0 | ||
|
|
f54b8f8482 | ||
|
|
a05219d801 | ||
|
|
c02b02d725 | ||
|
|
5fab0ccd81 | ||
|
|
20829cf8a2 | ||
|
|
0b4840af0c | ||
|
|
896f80f82c | ||
|
|
b57c6d1a4c | ||
|
|
3749066dd8 | ||
|
|
c29c609e0f | ||
|
|
9459390f29 | ||
|
|
2bbd81fba3 | ||
|
|
5e3578893a | ||
|
|
dc1b670a2c | ||
|
|
0156f4f9da | ||
|
|
a52c615a42 | ||
|
|
5c2d7c4dc8 | ||
|
|
004194f465 | ||
|
|
cd63c32ff6 | ||
|
|
5a33a29a91 | ||
|
|
683df9bf54 | ||
|
|
64e2656f7c | ||
|
|
8e3d264fb2 | ||
|
|
46a2dc9175 | ||
|
|
b9e126fbe2 | ||
|
|
07dc4a79c7 | ||
|
|
43de5c034f | ||
|
|
2f0a10174e | ||
|
|
0a48a67e57 | ||
|
|
e8baa8eb7f | ||
|
|
d32b2d4de1 | ||
|
|
924b2ee8f2 | ||
|
|
f95e5225fe | ||
|
|
8f536408d1 | ||
|
|
093f0f13e6 | ||
|
|
c172eb7925 | ||
|
|
154ea553f6 | ||
|
|
d734d4ce6a | ||
|
|
c445e9dc62 | ||
|
|
c5c2654351 | ||
|
|
2fe47b21c8 | ||
|
|
b91ebb60d8 | ||
|
|
f1d1ef810a | ||
|
|
b263e94f77 | ||
|
|
9da3063e1c | ||
|
|
b6fe44b9db | ||
|
|
72ac64544f | ||
|
|
8f7f3f0453 | ||
|
|
376dfd07ab | ||
|
|
b62c0c0bce | ||
|
|
00498a7e59 | ||
|
|
cb66b55270 | ||
|
|
9482dd0d17 | ||
|
|
87eedf6943 | ||
|
|
f239b91596 | ||
|
|
06107e9605 | ||
|
|
d052370c1e | ||
|
|
ce993ce791 | ||
|
|
e54fd33848 | ||
|
|
9b69efc02b | ||
|
|
1bf80a9a14 | ||
|
|
c0b90d4088 | ||
|
|
9c709f0534 | ||
|
|
4ad56612f9 | ||
|
|
acb62e998f | ||
|
|
180faac637 | ||
|
|
13c943ffb1 | ||
|
|
18052f1df9 | ||
|
|
4c8b14c37f | ||
|
|
e4071fa04c | ||
|
|
bf5ed476ba | ||
|
|
fcd26ebc8f | ||
|
|
6a34f5d447 | ||
|
|
26f48752fb | ||
|
|
1aef8de6d7 | ||
|
|
9ac3e32b29 | ||
|
|
5254285636 | ||
|
|
137838945f | ||
|
|
6cef3ddbdc | ||
|
|
403eee165c | ||
|
|
523b57b331 | ||
|
|
a3589cce81 | ||
|
|
0820593e64 | ||
|
|
4db2b966be | ||
|
|
b7b61ff6a3 | ||
|
|
7a6e47b99d | ||
|
|
f84c349b3b | ||
|
|
26f732e21d | ||
|
|
82b2dd5ee4 | ||
|
|
e82ddde05a | ||
|
|
07f5da6128 | ||
|
|
e845455225 | ||
|
|
3fedb3e65c | ||
|
|
0b5c261212 | ||
|
|
680e473643 | ||
|
|
44e83d0c97 | ||
|
|
1986380df2 | ||
|
|
df3850db49 | ||
|
|
082b4f8348 | ||
|
|
788c313b50 | ||
|
|
779d7610c7 | ||
|
|
56629aa012 | ||
|
|
33651e3edf | ||
|
|
d46aada5c2 | ||
|
|
66b1f210c0 | ||
|
|
d4b98d475f | ||
|
|
8d8962ca3e | ||
|
|
329559ae50 | ||
|
|
0b3a88fe15 | ||
|
|
563fe360c3 | ||
|
|
73a502dd43 | ||
|
|
ea189b77eb | ||
|
|
2ebd47841f | ||
|
|
9d7244c4c6 | ||
|
|
7aee089978 |
8
.gitignore
vendored
8
.gitignore
vendored
@@ -15,17 +15,14 @@ config.*
|
|||||||
doc/*.1
|
doc/*.1
|
||||||
doc/*.html
|
doc/*.html
|
||||||
doc/*.pod
|
doc/*.pod
|
||||||
doc/fate.txt
|
|
||||||
doxy
|
doxy
|
||||||
ffmpeg
|
ffmpeg
|
||||||
ffplay
|
ffplay
|
||||||
ffprobe
|
ffprobe
|
||||||
ffserver
|
ffserver
|
||||||
avconv
|
|
||||||
libavcodec/*_tablegen
|
libavcodec/*_tablegen
|
||||||
libavcodec/*_tables.c
|
libavcodec/*_tables.c
|
||||||
libavcodec/*_tables.h
|
libavcodec/*_tables.h
|
||||||
libavcodec/codec_names.h
|
|
||||||
libavcodec/libavcodec*
|
libavcodec/libavcodec*
|
||||||
libavcore/libavcore*
|
libavcore/libavcore*
|
||||||
libavdevice/libavdevice*
|
libavdevice/libavdevice*
|
||||||
@@ -34,23 +31,22 @@ libavformat/libavformat*
|
|||||||
libavutil/avconfig.h
|
libavutil/avconfig.h
|
||||||
libavutil/libavutil*
|
libavutil/libavutil*
|
||||||
libpostproc/libpostproc*
|
libpostproc/libpostproc*
|
||||||
libswresample/libswresample*
|
|
||||||
libswscale/libswscale*
|
libswscale/libswscale*
|
||||||
tests/audiogen
|
tests/audiogen
|
||||||
tests/base64
|
tests/base64
|
||||||
tests/data
|
tests/data
|
||||||
tests/rotozoom
|
tests/rotozoom
|
||||||
|
tests/seek_test
|
||||||
tests/tiny_psnr
|
tests/tiny_psnr
|
||||||
tests/videogen
|
tests/videogen
|
||||||
tests/vsynth1
|
tests/vsynth1
|
||||||
tests/vsynth2
|
tests/vsynth2
|
||||||
tools/aviocat
|
|
||||||
tools/cws2fws
|
tools/cws2fws
|
||||||
tools/graph2dot
|
tools/graph2dot
|
||||||
tools/ismindex
|
|
||||||
tools/lavfi-showfiltfmts
|
tools/lavfi-showfiltfmts
|
||||||
tools/pktdumper
|
tools/pktdumper
|
||||||
tools/probetest
|
tools/probetest
|
||||||
tools/qt-faststart
|
tools/qt-faststart
|
||||||
tools/trasher
|
tools/trasher
|
||||||
|
tools/trasher*.d
|
||||||
version.h
|
version.h
|
||||||
|
|||||||
259
Changelog
259
Changelog
@@ -1,187 +1,59 @@
|
|||||||
Entries are sorted chronologically from oldest to youngest within each release,
|
Entries are sorted chronologically from oldest to youngest within each release,
|
||||||
releases are sorted from youngest to oldest.
|
releases are sorted from youngest to oldest.
|
||||||
|
|
||||||
version next:
|
|
||||||
|
|
||||||
version 0.10:
|
version 0.7.1:
|
||||||
- Fixes: CVE-2011-3929, CVE-2011-3934, CVE-2011-3935, CVE-2011-3936,
|
|
||||||
CVE-2011-3937, CVE-2011-3940, CVE-2011-3941, CVE-2011-3944,
|
|
||||||
CVE-2011-3945, CVE-2011-3946, CVE-2011-3947, CVE-2011-3949,
|
|
||||||
CVE-2011-3950, CVE-2011-3951, CVE-2011-3952
|
|
||||||
- v410 Quicktime Uncompressed 4:4:4 10-bit encoder and decoder
|
|
||||||
- SBaGen (SBG) binaural beats script demuxer
|
|
||||||
- OpenMG Audio muxer
|
|
||||||
- Timecode extraction in DV and MOV
|
|
||||||
- thumbnail video filter
|
|
||||||
- XML output in ffprobe
|
|
||||||
- asplit audio filter
|
|
||||||
- tinterlace video filter
|
|
||||||
- astreamsync audio filter
|
|
||||||
- amerge audio filter
|
|
||||||
- ISMV (Smooth Streaming) muxer
|
|
||||||
- GSM audio parser
|
|
||||||
- SMJPEG muxer
|
|
||||||
- XWD encoder and decoder
|
|
||||||
- Automatic thread count based on detection number of (available) CPU cores
|
|
||||||
- y41p Brooktree Uncompressed 4:1:1 12-bit encoder and decoder
|
|
||||||
- ffprobe -show_error option
|
|
||||||
- Avid 1:1 10-bit RGB Packer codec
|
|
||||||
- v308 Quicktime Uncompressed 4:4:4 encoder and decoder
|
|
||||||
- yuv4 libquicktime packed 4:2:0 encoder and decoder
|
|
||||||
- ffprobe -show_frames option
|
|
||||||
- silencedetect audio filter
|
|
||||||
- ffprobe -show_program_version, -show_library_versions, -show_versions options
|
|
||||||
- rv34: frame-level multi-threading
|
|
||||||
- optimized iMDCT transform on x86 using SSE for for mpegaudiodec
|
|
||||||
- Improved PGS subtitle decoder
|
|
||||||
- dumpgraph option to lavfi device
|
|
||||||
- r210 and r10k encoders
|
|
||||||
- ffwavesynth decoder
|
|
||||||
- aviocat tool
|
|
||||||
- ffeval tool
|
|
||||||
|
|
||||||
|
- added various additional FOURCC codec identifiers
|
||||||
|
- H.264 4:4:4 fixes
|
||||||
|
- build system and compilation fixes
|
||||||
|
- Doxygen and general documentation corrections and improvements
|
||||||
|
- fixed segfault in ffprobe
|
||||||
|
- behavioral fix in av_open_input_stream()
|
||||||
|
- Licensing clarification for LGPL'ed vf_gradfun
|
||||||
|
- bugfixes while seeking in multithreaded decoding
|
||||||
|
- support newer versions of OpenCV
|
||||||
|
- ffmpeg: fix operation with --disable-avfilter
|
||||||
|
- fixed integer underflow in matroska decoder
|
||||||
|
|
||||||
version 0.9:
|
version 0.7:
|
||||||
|
|
||||||
- openal input device added
|
|
||||||
- boxblur filter added
|
|
||||||
- BWF muxer
|
|
||||||
- Flash Screen Video 2 decoder
|
|
||||||
- lavfi input device added
|
|
||||||
- added avconv, which is almost the same for now, except
|
|
||||||
for a few incompatible changes in the options, which will hopefully make them
|
|
||||||
easier to use. The changes are:
|
|
||||||
* The options placement is now strictly enforced! While in theory the
|
|
||||||
options for ffmpeg should be given in [input options] -i INPUT [output
|
|
||||||
options] OUTPUT order, in practice it was possible to give output options
|
|
||||||
before the -i and it mostly worked. Except when it didn't - the behavior was
|
|
||||||
a bit inconsistent. In avconv, it is not possible to mix input and output
|
|
||||||
options. All non-global options are reset after an input or output filename.
|
|
||||||
* All per-file options are now truly per-file - they apply only to the next
|
|
||||||
input or output file and specifying different values for different files
|
|
||||||
will now work properly (notably -ss and -t options).
|
|
||||||
* All per-stream options are now truly per-stream - it is possible to
|
|
||||||
specify which stream(s) should a given option apply to. See the Stream
|
|
||||||
specifiers section in the avconv manual for details.
|
|
||||||
* In ffmpeg some options (like -newvideo/-newaudio/...) are irregular in the
|
|
||||||
sense that they're specified after the output filename instead of before,
|
|
||||||
like all other options. In avconv this irregularity is removed, all options
|
|
||||||
apply to the next input or output file.
|
|
||||||
* -newvideo/-newaudio/-newsubtitle options were removed. Not only were they
|
|
||||||
irregular and highly confusing, they were also redundant. In avconv the -map
|
|
||||||
option will create new streams in the output file and map input streams to
|
|
||||||
them. E.g. avconv -i INPUT -map 0 OUTPUT will create an output stream for
|
|
||||||
each stream in the first input file.
|
|
||||||
* The -map option now has slightly different and more powerful syntax:
|
|
||||||
+ Colons (':') are used to separate file index/stream type/stream index
|
|
||||||
instead of dots. Comma (',') is used to separate the sync stream instead
|
|
||||||
of colon.. This is done for consistency with other options.
|
|
||||||
+ It's possible to specify stream type. E.g. -map 0:a:2 creates an
|
|
||||||
output stream from the third input audio stream.
|
|
||||||
+ Omitting the stream index now maps all the streams of the given type,
|
|
||||||
not just the first. E.g. -map 0:s creates output streams for all the
|
|
||||||
subtitle streams in the first input file.
|
|
||||||
+ Since -map can now match multiple streams, negative mappings were
|
|
||||||
introduced. Negative mappings disable some streams from an already
|
|
||||||
defined map. E.g. '-map 0 -map -0:a:1' means 'create output streams for
|
|
||||||
all the stream in the first input file, except for the second audio
|
|
||||||
stream'.
|
|
||||||
* There is a new option -c (or -codec) for choosing the decoder/encoder to
|
|
||||||
use, which allows to precisely specify target stream(s) consistently with
|
|
||||||
other options. E.g. -c:v lib264 sets the codec for all video streams, -c:a:0
|
|
||||||
libvorbis sets the codec for the first audio stream and -c copy copies all
|
|
||||||
the streams without reencoding. Old -vcodec/-acodec/-scodec options are now
|
|
||||||
aliases to -c:v/a/s
|
|
||||||
* It is now possible to precisely specify which stream should an AVOption
|
|
||||||
apply to. E.g. -b:v:0 2M sets the bitrate for the first video stream, while
|
|
||||||
-b:a 128k sets the bitrate for all audio streams. Note that the old -ab 128k
|
|
||||||
syntax is deprecated and will stop working soon.
|
|
||||||
* -map_chapters now takes only an input file index and applies to the next
|
|
||||||
output file. This is consistent with how all the other options work.
|
|
||||||
* -map_metadata now takes only an input metadata specifier and applies to
|
|
||||||
the next output file. Output metadata specifier is now part of the option
|
|
||||||
name, similarly to the AVOptions/map/codec feature above.
|
|
||||||
* -metadata can now be used to set metadata on streams and chapters, e.g.
|
|
||||||
-metadata:s:1 language=eng sets the language of the first stream to 'eng'.
|
|
||||||
This made -vlang/-alang/-slang options redundant, so they were removed.
|
|
||||||
* -qscale option now uses stream specifiers and applies to all streams, not
|
|
||||||
just video. I.e. plain -qscale number would now apply to all streams. To get
|
|
||||||
the old behavior, use -qscale:v. Also there is now a shortcut -q for -qscale
|
|
||||||
and -aq is now an alias for -q:a.
|
|
||||||
* -vbsf/-absf/-sbsf options were removed and replaced by a -bsf option which
|
|
||||||
uses stream specifiers. Use -bsf:v/a/s instead of the old options.
|
|
||||||
* -itsscale option now uses stream specifiers, so its argument is only the
|
|
||||||
scale parameter.
|
|
||||||
* -intra option was removed, use -g 0 for the same effect.
|
|
||||||
* -psnr option was removed, use -flags +psnr for the same effect.
|
|
||||||
* -vf option is now an alias to the new -filter option, which uses stream specifiers.
|
|
||||||
* -vframes/-aframes/-dframes options are now aliases to the new -frames option.
|
|
||||||
* -vtag/-atag/-stag options are now aliases to the new -tag option.
|
|
||||||
- XMV demuxer
|
|
||||||
- LOAS demuxer
|
|
||||||
- ashowinfo filter added
|
|
||||||
- Windows Media Image decoder
|
|
||||||
- amovie source added
|
|
||||||
- LATM muxer/demuxer
|
|
||||||
- Speex encoder via libspeex
|
|
||||||
- JSON output in ffprobe
|
|
||||||
- WTV muxer
|
|
||||||
- Optional C++ Support (needed for libstagefright)
|
|
||||||
- H.264 Decoding on Android via Stagefright
|
|
||||||
- Prores decoder
|
|
||||||
- BIN/XBIN/ADF/IDF text file decoder
|
|
||||||
- aconvert audio filter added
|
|
||||||
- audio support to lavfi input device added
|
|
||||||
- libcdio-paranoia input device for audio CD grabbing
|
|
||||||
- Apple ProRes decoder
|
|
||||||
- CELT in Ogg demuxing
|
|
||||||
- G.723.1 demuxer and decoder
|
|
||||||
- libmodplug support (--enable-libmodplug)
|
|
||||||
- VC-1 interlaced decoding
|
|
||||||
- libutvideo wrapper (--enable-libutvideo)
|
|
||||||
- aevalsrc audio source added
|
|
||||||
- Ut Video decoder
|
|
||||||
- Speex encoding via libspeex
|
|
||||||
- 4:2:2 H.264 decoding support
|
|
||||||
- 4:2:2 and 4:4:4 H.264 encoding with libx264
|
|
||||||
- Pulseaudio input device
|
|
||||||
- Prores encoder
|
|
||||||
- Video Decoder Acceleration (VDA) HWAccel module.
|
|
||||||
- replacement Indeo 3 decoder
|
|
||||||
- new ffmpeg option: -map_channel
|
|
||||||
- volume audio filter added
|
|
||||||
- earwax audio filter added
|
|
||||||
- libv4l2 support (--enable-libv4l2)
|
|
||||||
- TLS/SSL and HTTPS protocol support
|
|
||||||
- AVOptions API rewritten and documented
|
|
||||||
- most of CODEC_FLAG2_*, some CODEC_FLAG_* and many codec-specific fields in
|
|
||||||
AVCodecContext deprecated. Codec private options should be used instead.
|
|
||||||
- Properly working defaults in libx264 wrapper, support for native presets.
|
|
||||||
- Encrypted OMA files support
|
|
||||||
- Discworld II BMV decoding support
|
|
||||||
- VBLE Decoder
|
|
||||||
- OS X Video Decoder Acceleration (VDA) support
|
|
||||||
- compact and csv output in ffprobe
|
|
||||||
- pan audio filter
|
|
||||||
- IFF Amiga Continuous Bitmap (ACBM) decoder
|
|
||||||
- ass filter
|
|
||||||
- CRI ADX audio format muxer and demuxer
|
|
||||||
- Playstation Portable PMP format demuxer
|
|
||||||
- Microsoft Windows ICO demuxer
|
|
||||||
- life source
|
|
||||||
- PCM format support in OMA demuxer
|
|
||||||
- CLJR encoder
|
|
||||||
- new option: -report
|
|
||||||
- Dxtory capture format decoder
|
|
||||||
- cellauto source
|
|
||||||
- Simple segmenting muxer
|
|
||||||
- Indeo 4 decoder
|
|
||||||
- SMJPEG demuxer
|
|
||||||
|
|
||||||
|
|
||||||
version 0.8:
|
|
||||||
|
|
||||||
- many many things we forgot because we rather write code than changelogs
|
- many many things we forgot because we rather write code than changelogs
|
||||||
|
- libmpcodecs video filter support (3 times as many filters than before)
|
||||||
|
- mpeg2 aspect ratio dection fixed
|
||||||
|
- libxvid aspect pickiness fixed
|
||||||
|
- Frame multithreaded decoding
|
||||||
|
- E-AC-3 audio encoder
|
||||||
|
- ac3enc: add channel coupling support
|
||||||
|
- floating-point sample format support for (E-)AC-3, DCA, AAC, Vorbis decoders
|
||||||
|
- H.264/MPEG frame-level multithreading
|
||||||
|
- av_metadata_* functions renamed to av_dict_* and moved to libavutil
|
||||||
|
- 4:4:4 H.264 decoding support
|
||||||
|
- 10-bit H.264 optimizations for x86
|
||||||
|
- lut, lutrgb, and lutyuv filters added
|
||||||
|
- buffersink libavfilter sink added
|
||||||
|
- bump libswscale for recently reported ABI break
|
||||||
|
|
||||||
|
|
||||||
|
version 0.7_beta2:
|
||||||
|
|
||||||
|
- VP8 frame-level multithreading
|
||||||
|
- NEON optimizations for VP8
|
||||||
|
- removed a lot of deprecated API cruft
|
||||||
|
- FFT and IMDCT optimizations for AVX (Sandy Bridge) processors
|
||||||
|
- showinfo filter added
|
||||||
|
- DPX image encoder
|
||||||
|
- SMPTE 302M AES3 audio decoder
|
||||||
|
- Apple Core Audio Format muxer
|
||||||
|
- 9bit and 10bit per sample support in the H.264 decoder
|
||||||
|
- 9bit and 10bit FFV1 encoding / decoding
|
||||||
|
- split filter added
|
||||||
|
- select filter added
|
||||||
|
- sdl output device added
|
||||||
|
|
||||||
|
|
||||||
|
version 0.7_beta1:
|
||||||
|
|
||||||
- WebM support in Matroska de/muxer
|
- WebM support in Matroska de/muxer
|
||||||
- low overhead Ogg muxing
|
- low overhead Ogg muxing
|
||||||
- MMS-TCP support
|
- MMS-TCP support
|
||||||
@@ -189,7 +61,6 @@ version 0.8:
|
|||||||
- Demuxer for On2's IVF format
|
- Demuxer for On2's IVF format
|
||||||
- Pictor/PC Paint decoder
|
- Pictor/PC Paint decoder
|
||||||
- HE-AAC v2 decoder
|
- HE-AAC v2 decoder
|
||||||
- HE-AAC v2 encoding with libaacplus
|
|
||||||
- libfaad2 wrapper removed
|
- libfaad2 wrapper removed
|
||||||
- DTS-ES extension (XCh) decoding support
|
- DTS-ES extension (XCh) decoding support
|
||||||
- native VP8 decoder
|
- native VP8 decoder
|
||||||
@@ -201,7 +72,7 @@ version 0.8:
|
|||||||
- RTP depacketization of QDM2
|
- RTP depacketization of QDM2
|
||||||
- ANSI/ASCII art playback system
|
- ANSI/ASCII art playback system
|
||||||
- Lego Mindstorms RSO de/muxer
|
- Lego Mindstorms RSO de/muxer
|
||||||
- libavcore added (and subsequently removed)
|
- libavcore added
|
||||||
- SubRip subtitle file muxer and demuxer
|
- SubRip subtitle file muxer and demuxer
|
||||||
- Chinese AVS encoding via libxavs
|
- Chinese AVS encoding via libxavs
|
||||||
- ffprobe -show_packets option added
|
- ffprobe -show_packets option added
|
||||||
@@ -269,38 +140,6 @@ version 0.8:
|
|||||||
- AMR-WB encoding via libvo-amrwbenc
|
- AMR-WB encoding via libvo-amrwbenc
|
||||||
- xWMA demuxer
|
- xWMA demuxer
|
||||||
- Mobotix MxPEG decoder
|
- Mobotix MxPEG decoder
|
||||||
- VP8 frame-multithreading
|
|
||||||
- NEON optimizations for VP8
|
|
||||||
- Lots of deprecated API cruft removed
|
|
||||||
- fft and imdct optimizations for AVX (Sandy Bridge) processors
|
|
||||||
- showinfo filter added
|
|
||||||
- SMPTE 302M AES3 audio decoder
|
|
||||||
- Apple Core Audio Format muxer
|
|
||||||
- 9bit and 10bit per sample support in the H.264 decoder
|
|
||||||
- 9bit and 10bit FFV1 encoding / decoding
|
|
||||||
- split filter added
|
|
||||||
- select filter added
|
|
||||||
- sdl output device added
|
|
||||||
- libmpcodecs video filter support (3 times as many filters than before)
|
|
||||||
- mpeg2 aspect ratio dection fixed
|
|
||||||
- libxvid aspect pickiness fixed
|
|
||||||
- Frame multithreaded decoding
|
|
||||||
- E-AC-3 audio encoder
|
|
||||||
- ac3enc: add channel coupling support
|
|
||||||
- floating-point sample format support to the ac3, eac3, dca, aac, and vorbis decoders.
|
|
||||||
- H264/MPEG frame-level multi-threading
|
|
||||||
- All av_metadata_* functions renamed to av_dict_* and moved to libavutil
|
|
||||||
- 4:4:4 H.264 decoding support
|
|
||||||
- 10-bit H.264 optimizations for x86
|
|
||||||
- lut, lutrgb, and lutyuv filters added
|
|
||||||
- buffersink libavfilter sink added
|
|
||||||
- Bump libswscale for recently reported ABI break
|
|
||||||
- New J2K encoder (via OpenJPEG)
|
|
||||||
|
|
||||||
|
|
||||||
version 0.7:
|
|
||||||
|
|
||||||
- all the changes for 0.8, but keeping API/ABI compatibility with the 0.6 release
|
|
||||||
|
|
||||||
|
|
||||||
version 0.6:
|
version 0.6:
|
||||||
|
|||||||
21
Doxyfile
21
Doxyfile
@@ -31,13 +31,7 @@ PROJECT_NAME = FFmpeg
|
|||||||
# This could be handy for archiving the generated documentation or
|
# This could be handy for archiving the generated documentation or
|
||||||
# if some version control system is used.
|
# if some version control system is used.
|
||||||
|
|
||||||
PROJECT_NUMBER = 0.10
|
PROJECT_NUMBER = 0.7.5
|
||||||
|
|
||||||
# With the PROJECT_LOGO tag one can specify an logo or icon that is included
|
|
||||||
# in the documentation. The maximum height of the logo should not exceed 55
|
|
||||||
# pixels and the maximum width should not exceed 200 pixels. Doxygen will
|
|
||||||
# copy the logo to the output directory.
|
|
||||||
PROJECT_LOGO =
|
|
||||||
|
|
||||||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
||||||
# base path where the generated documentation will be put.
|
# base path where the generated documentation will be put.
|
||||||
@@ -766,7 +760,7 @@ ALPHABETICAL_INDEX = YES
|
|||||||
# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
|
# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
|
||||||
# in which this list will be split (can be a number in the range [1..20])
|
# in which this list will be split (can be a number in the range [1..20])
|
||||||
|
|
||||||
COLS_IN_ALPHA_INDEX = 2
|
COLS_IN_ALPHA_INDEX = 5
|
||||||
|
|
||||||
# In case all classes in a project start with a common prefix, all
|
# In case all classes in a project start with a common prefix, all
|
||||||
# classes will be put under the same header in the alphabetical index.
|
# classes will be put under the same header in the alphabetical index.
|
||||||
@@ -800,13 +794,13 @@ HTML_FILE_EXTENSION = .html
|
|||||||
# each generated HTML page. If it is left blank doxygen will generate a
|
# each generated HTML page. If it is left blank doxygen will generate a
|
||||||
# standard header.
|
# standard header.
|
||||||
|
|
||||||
HTML_HEADER = doc/doxy/header.html
|
HTML_HEADER =
|
||||||
|
|
||||||
# The HTML_FOOTER tag can be used to specify a personal HTML footer for
|
# The HTML_FOOTER tag can be used to specify a personal HTML footer for
|
||||||
# each generated HTML page. If it is left blank doxygen will generate a
|
# each generated HTML page. If it is left blank doxygen will generate a
|
||||||
# standard footer.
|
# standard footer.
|
||||||
|
|
||||||
HTML_FOOTER = doc/doxy/footer.html
|
HTML_FOOTER =
|
||||||
|
|
||||||
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
|
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
|
||||||
# style sheet that is used by each HTML page. It can be used to
|
# style sheet that is used by each HTML page. It can be used to
|
||||||
@@ -815,7 +809,7 @@ HTML_FOOTER = doc/doxy/footer.html
|
|||||||
# the style sheet file to the HTML output directory, so don't put your own
|
# the style sheet file to the HTML output directory, so don't put your own
|
||||||
# stylesheet in the HTML output directory as well, or it will be erased!
|
# stylesheet in the HTML output directory as well, or it will be erased!
|
||||||
|
|
||||||
HTML_STYLESHEET = doc/doxy/doxy_stylesheet.css
|
HTML_STYLESHEET =
|
||||||
|
|
||||||
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
|
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
|
||||||
# Doxygen will adjust the colors in the stylesheet and background images
|
# Doxygen will adjust the colors in the stylesheet and background images
|
||||||
@@ -825,7 +819,7 @@ HTML_STYLESHEET = doc/doxy/doxy_stylesheet.css
|
|||||||
# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
|
# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
|
||||||
# The allowed range is 0 to 359.
|
# The allowed range is 0 to 359.
|
||||||
|
|
||||||
HTML_COLORSTYLE_HUE = 120
|
HTML_COLORSTYLE_HUE = 220
|
||||||
|
|
||||||
# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
|
# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
|
||||||
# the colors in the HTML output. For a value of 0 the output will use
|
# the colors in the HTML output. For a value of 0 the output will use
|
||||||
@@ -1388,8 +1382,7 @@ PREDEFINED = "__attribute__(x)=" \
|
|||||||
# The macro definition that is found in the sources will be used.
|
# The macro definition that is found in the sources will be used.
|
||||||
# Use the PREDEFINED tag if you want to use a different macro definition.
|
# Use the PREDEFINED tag if you want to use a different macro definition.
|
||||||
|
|
||||||
EXPAND_AS_DEFINED = declare_idct \
|
EXPAND_AS_DEFINED = declare_idct
|
||||||
READ_PAR_DATA \
|
|
||||||
|
|
||||||
# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
|
# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
|
||||||
# doxygen's preprocessor will remove all function-like macros that are alone
|
# doxygen's preprocessor will remove all function-like macros that are alone
|
||||||
|
|||||||
6
LICENSE
6
LICENSE
@@ -41,6 +41,6 @@ is incompatible with the LGPL v2.1 and the GPL v2, but not with version 3 of
|
|||||||
those licenses. So to combine the OpenCORE libraries with FFmpeg, the license
|
those licenses. So to combine the OpenCORE libraries with FFmpeg, the license
|
||||||
version needs to be upgraded by passing --enable-version3 to configure.
|
version needs to be upgraded by passing --enable-version3 to configure.
|
||||||
|
|
||||||
The nonfree external libraries libfaac and libaacplus can be hooked up in FFmpeg.
|
The nonfree external library libfaac can be hooked up in FFmpeg. You need to
|
||||||
You need to pass --enable-nonfree to configure to enable it. Employ this option
|
pass --enable-nonfree to configure to enable it. Employ this option with care
|
||||||
with care as FFmpeg then becomes nonfree and unredistributable.
|
as FFmpeg then becomes nonfree and unredistributable.
|
||||||
|
|||||||
55
MAINTAINERS
55
MAINTAINERS
@@ -4,12 +4,6 @@ FFmpeg maintainers
|
|||||||
Below is a list of the people maintaining different parts of the
|
Below is a list of the people maintaining different parts of the
|
||||||
FFmpeg code.
|
FFmpeg code.
|
||||||
|
|
||||||
Please try to keep entries where you are the maintainer upto date!
|
|
||||||
|
|
||||||
Names in () mean that the maintainer currently has no time to maintain the code.
|
|
||||||
A CC after the name means that the maintainer prefers to be CC-ed on patches
|
|
||||||
and related discussions.
|
|
||||||
|
|
||||||
|
|
||||||
Project Leader
|
Project Leader
|
||||||
==============
|
==============
|
||||||
@@ -25,7 +19,7 @@ ffmpeg:
|
|||||||
ffmpeg.c Michael Niedermayer
|
ffmpeg.c Michael Niedermayer
|
||||||
|
|
||||||
ffplay:
|
ffplay:
|
||||||
ffplay.c Marton Balint
|
ffplay.c Michael Niedermayer
|
||||||
|
|
||||||
ffprobe:
|
ffprobe:
|
||||||
ffprobe.c Stefano Sabatini
|
ffprobe.c Stefano Sabatini
|
||||||
@@ -44,13 +38,13 @@ Miscellaneous Areas
|
|||||||
===================
|
===================
|
||||||
|
|
||||||
documentation Mike Melanson
|
documentation Mike Melanson
|
||||||
website Robert Swain, Lou Logan
|
website Robert Swain
|
||||||
build system (configure,Makefiles) Diego Biurrun, Mans Rullgard
|
build system (configure,Makefiles) Diego Biurrun, Mans Rullgard
|
||||||
project server Árpád Gereöffy, Michael Niedermayer, Reimar Döffinger
|
project server Diego Biurrun, Mans Rullgard
|
||||||
mailinglists Michael Niedermayer, Baptiste Coudurier, Lou Logan
|
mailinglists Michael Niedermayer, Baptiste Coudurier
|
||||||
presets Robert Swain
|
presets Robert Swain
|
||||||
metadata subsystem Aurelien Jacobs
|
metadata subsystem Aurelien Jacobs
|
||||||
release management Michael Niedermayer
|
release management Diego Biurrun, Reinhard Tartler
|
||||||
|
|
||||||
|
|
||||||
libavutil
|
libavutil
|
||||||
@@ -87,8 +81,6 @@ Generic Parts:
|
|||||||
bitstream.c, bitstream.h Michael Niedermayer
|
bitstream.c, bitstream.h Michael Niedermayer
|
||||||
CABAC:
|
CABAC:
|
||||||
cabac.h, cabac.c Michael Niedermayer
|
cabac.h, cabac.c Michael Niedermayer
|
||||||
codec names:
|
|
||||||
codec_names.sh Nicolas George
|
|
||||||
DSP utilities:
|
DSP utilities:
|
||||||
dsputils.c, dsputils.h Michael Niedermayer
|
dsputils.c, dsputils.h Michael Niedermayer
|
||||||
entropy coding:
|
entropy coding:
|
||||||
@@ -142,7 +134,6 @@ Codecs:
|
|||||||
dv.c Roman Shaposhnik
|
dv.c Roman Shaposhnik
|
||||||
eacmv*, eaidct*, eat* Peter Ross
|
eacmv*, eaidct*, eat* Peter Ross
|
||||||
ffv1.c Michael Niedermayer
|
ffv1.c Michael Niedermayer
|
||||||
ffwavesynth.c Nicolas George
|
|
||||||
flac* Justin Ruggles
|
flac* Justin Ruggles
|
||||||
flashsv* Benjamin Larsson
|
flashsv* Benjamin Larsson
|
||||||
flicvideo.c Mike Melanson
|
flicvideo.c Mike Melanson
|
||||||
@@ -163,11 +154,9 @@ Codecs:
|
|||||||
jvdec.c Peter Ross
|
jvdec.c Peter Ross
|
||||||
kmvc.c Kostya Shishkov
|
kmvc.c Kostya Shishkov
|
||||||
lcl*.c Roberto Togni, Reimar Doeffinger
|
lcl*.c Roberto Togni, Reimar Doeffinger
|
||||||
libcelt_dec.c Nicolas George
|
|
||||||
libgsm.c Michel Bardiaux
|
libgsm.c Michel Bardiaux
|
||||||
libdirac* David Conrad
|
libdirac* David Conrad
|
||||||
libopenjpeg.c Jaikrishnan Menon
|
libopenjpeg.c Jaikrishnan Menon
|
||||||
libopenjpegenc.c Michael Bradshaw
|
|
||||||
libschroedinger* David Conrad
|
libschroedinger* David Conrad
|
||||||
libspeexdec.c Justin Ruggles
|
libspeexdec.c Justin Ruggles
|
||||||
libtheoraenc.c David Conrad
|
libtheoraenc.c David Conrad
|
||||||
@@ -222,9 +211,7 @@ Codecs:
|
|||||||
tta.c Alex Beregszaszi, Jaikrishnan Menon
|
tta.c Alex Beregszaszi, Jaikrishnan Menon
|
||||||
txd.c Ivo van Poorten
|
txd.c Ivo van Poorten
|
||||||
ulti* Kostya Shishkov
|
ulti* Kostya Shishkov
|
||||||
v410*.c Derek Buitenhuis
|
|
||||||
vb.c Kostya Shishkov
|
vb.c Kostya Shishkov
|
||||||
vble.c Derek Buitenhuis
|
|
||||||
vc1* Kostya Shishkov
|
vc1* Kostya Shishkov
|
||||||
vcr1.c Michael Niedermayer
|
vcr1.c Michael Niedermayer
|
||||||
vmnc.c Kostya Shishkov
|
vmnc.c Kostya Shishkov
|
||||||
@@ -248,9 +235,7 @@ Codecs:
|
|||||||
Hardware acceleration:
|
Hardware acceleration:
|
||||||
crystalhd.c Philip Langdale
|
crystalhd.c Philip Langdale
|
||||||
dxva2* Laurent Aimar
|
dxva2* Laurent Aimar
|
||||||
libstagefright.cpp Mohamed Naufal
|
|
||||||
vaapi* Gwenole Beauchesne
|
vaapi* Gwenole Beauchesne
|
||||||
vda* Sebastien Zwickert
|
|
||||||
vdpau* Carl Eugen Hoyos
|
vdpau* Carl Eugen Hoyos
|
||||||
|
|
||||||
|
|
||||||
@@ -265,18 +250,6 @@ libavdevice
|
|||||||
vfwcap.c Ramiro Polla
|
vfwcap.c Ramiro Polla
|
||||||
|
|
||||||
|
|
||||||
libavfilter
|
|
||||||
===========
|
|
||||||
|
|
||||||
Video filters:
|
|
||||||
graphdump.c Nicolas George
|
|
||||||
af_amerge.c Nicolas George
|
|
||||||
af_astreamsync.c Nicolas George
|
|
||||||
af_pan.c Nicolas George
|
|
||||||
vsrc_mandelbrot.c Michael Niedermayer
|
|
||||||
vf_yadif.c Michael Niedermayer
|
|
||||||
|
|
||||||
|
|
||||||
libavformat
|
libavformat
|
||||||
===========
|
===========
|
||||||
|
|
||||||
@@ -314,7 +287,6 @@ Muxers/Demuxers:
|
|||||||
img2.c Michael Niedermayer
|
img2.c Michael Niedermayer
|
||||||
iss.c Stefan Gehrer
|
iss.c Stefan Gehrer
|
||||||
jvdec.c Peter Ross
|
jvdec.c Peter Ross
|
||||||
libmodplug.c Clément Bœsch
|
|
||||||
libnut.c Oded Shimon
|
libnut.c Oded Shimon
|
||||||
lmlm4.c Ivo van Poorten
|
lmlm4.c Ivo van Poorten
|
||||||
lxfdec.c Tomas Härdin
|
lxfdec.c Tomas Härdin
|
||||||
@@ -333,7 +305,6 @@ Muxers/Demuxers:
|
|||||||
msnwc_tcp.c Ramiro Polla
|
msnwc_tcp.c Ramiro Polla
|
||||||
mtv.c Reynaldo H. Verdejo Pinochet
|
mtv.c Reynaldo H. Verdejo Pinochet
|
||||||
mxf* Baptiste Coudurier
|
mxf* Baptiste Coudurier
|
||||||
mxfdec.c Tomas Härdin
|
|
||||||
nsvdec.c Francois Revol
|
nsvdec.c Francois Revol
|
||||||
nut.c Michael Niedermayer
|
nut.c Michael Niedermayer
|
||||||
nuv.c Reimar Doeffinger
|
nuv.c Reimar Doeffinger
|
||||||
@@ -353,7 +324,6 @@ Muxers/Demuxers:
|
|||||||
rtpdec_asf.* Ronald S. Bultje
|
rtpdec_asf.* Ronald S. Bultje
|
||||||
rtpenc_mpv.*, rtpenc_aac.* Martin Storsjo
|
rtpenc_mpv.*, rtpenc_aac.* Martin Storsjo
|
||||||
rtsp.c Luca Barbato
|
rtsp.c Luca Barbato
|
||||||
sbgdec.c Nicolas George
|
|
||||||
sdp.c Martin Storsjo
|
sdp.c Martin Storsjo
|
||||||
segafilm.c Mike Melanson
|
segafilm.c Mike Melanson
|
||||||
siff.c Kostya Shishkov
|
siff.c Kostya Shishkov
|
||||||
@@ -392,15 +362,8 @@ Sparc Roman Shaposhnik
|
|||||||
x86 Michael Niedermayer
|
x86 Michael Niedermayer
|
||||||
|
|
||||||
|
|
||||||
Releases
|
GnuPG Fingerprints of maintainers and others who have svn write access
|
||||||
========
|
======================================================================
|
||||||
|
|
||||||
0.9 Michael Niedermayer
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GnuPG Fingerprints of maintainers and contributors
|
|
||||||
==================================================
|
|
||||||
|
|
||||||
Anssi Hannula 1A92 FF42 2DD9 8D2E 8AF7 65A9 4278 C520 513D F3CB
|
Anssi Hannula 1A92 FF42 2DD9 8D2E 8AF7 65A9 4278 C520 513D F3CB
|
||||||
Anton Khirnov 6D0C 6625 56F8 65D1 E5F5 814B B50A 1241 C067 07AB
|
Anton Khirnov 6D0C 6625 56F8 65D1 E5F5 814B B50A 1241 C067 07AB
|
||||||
@@ -414,11 +377,9 @@ Gwenole Beauchesne 2E63 B3A6 3E44 37E2 017D 2704 53C7 6266 B153 99C4
|
|||||||
Jaikrishnan Menon 61A1 F09F 01C9 2D45 78E1 C862 25DC 8831 AF70 D368
|
Jaikrishnan Menon 61A1 F09F 01C9 2D45 78E1 C862 25DC 8831 AF70 D368
|
||||||
Justin Ruggles 3136 ECC0 C10D 6C04 5F43 CA29 FCBE CD2A 3787 1EBF
|
Justin Ruggles 3136 ECC0 C10D 6C04 5F43 CA29 FCBE CD2A 3787 1EBF
|
||||||
Loren Merritt ABD9 08F4 C920 3F65 D8BE 35D7 1540 DAA7 060F 56DE
|
Loren Merritt ABD9 08F4 C920 3F65 D8BE 35D7 1540 DAA7 060F 56DE
|
||||||
Lou Logan 7D68 DC73 CBEF EABB 671A B6CF 621C 2E28 82F8 DC3A
|
|
||||||
Luca Barbato 6677 4209 213C 8843 5B67 29E7 E84C 78C2 84E9 0E34
|
Luca Barbato 6677 4209 213C 8843 5B67 29E7 E84C 78C2 84E9 0E34
|
||||||
Michael Niedermayer 9FF2 128B 147E F673 0BAD F133 611E C787 040B 0FAB
|
Michael Niedermayer 9FF2 128B 147E F673 0BAD F133 611E C787 040B 0FAB
|
||||||
Nicolas George 24CE 01CE 9ACC 5CEB 74D8 8D9D B063 D997 36E5 4C93
|
Panagiotis Issaris 515C E262 10A8 FDCE 5481 7B9C 3AD7 D9A5 071D B3A9
|
||||||
Panagiotis Issaris 6571 13A3 33D9 3726 F728 AA98 F643 B12E ECF3 E029
|
|
||||||
Peter Ross A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B
|
Peter Ross A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B
|
||||||
Reimar Döffinger C61D 16E5 9E2C D10C 8958 38A4 0899 A2B9 06D4 D9C7
|
Reimar Döffinger C61D 16E5 9E2C D10C 8958 38A4 0899 A2B9 06D4 D9C7
|
||||||
Reinhard Tartler 9300 5DC2 7E87 6C37 ED7B CA9A 9808 3544 9453 48A4
|
Reinhard Tartler 9300 5DC2 7E87 6C37 ED7B CA9A 9808 3544 9453 48A4
|
||||||
|
|||||||
251
Makefile
251
Makefile
@@ -1,14 +1,13 @@
|
|||||||
MAIN_MAKEFILE=1
|
|
||||||
include config.mak
|
include config.mak
|
||||||
|
|
||||||
vpath %.c $(SRC_PATH)
|
SRC_DIR = $(SRC_PATH_BARE)
|
||||||
vpath %.cpp $(SRC_PATH)
|
|
||||||
vpath %.h $(SRC_PATH)
|
vpath %.c $(SRC_DIR)
|
||||||
vpath %.S $(SRC_PATH)
|
vpath %.h $(SRC_DIR)
|
||||||
vpath %.asm $(SRC_PATH)
|
vpath %.S $(SRC_DIR)
|
||||||
vpath %.v $(SRC_PATH)
|
vpath %.asm $(SRC_DIR)
|
||||||
vpath %.texi $(SRC_PATH)
|
vpath %.v $(SRC_DIR)
|
||||||
vpath %/fate_config.sh.template $(SRC_PATH)
|
vpath %.texi $(SRC_PATH_BARE)
|
||||||
|
|
||||||
PROGS-$(CONFIG_FFMPEG) += ffmpeg
|
PROGS-$(CONFIG_FFMPEG) += ffmpeg
|
||||||
PROGS-$(CONFIG_FFPLAY) += ffplay
|
PROGS-$(CONFIG_FFPLAY) += ffplay
|
||||||
@@ -16,57 +15,58 @@ PROGS-$(CONFIG_FFPROBE) += ffprobe
|
|||||||
PROGS-$(CONFIG_FFSERVER) += ffserver
|
PROGS-$(CONFIG_FFSERVER) += ffserver
|
||||||
|
|
||||||
PROGS := $(PROGS-yes:%=%$(EXESUF))
|
PROGS := $(PROGS-yes:%=%$(EXESUF))
|
||||||
INSTPROGS = $(PROGS-yes:%=%$(PROGSSUF)$(EXESUF))
|
PROGS_G = $(PROGS-yes:%=%_g$(EXESUF))
|
||||||
OBJS = $(PROGS-yes:%=%.o) cmdutils.o
|
OBJS = $(PROGS-yes:%=%.o) cmdutils.o
|
||||||
|
MANPAGES = $(PROGS-yes:%=doc/%.1)
|
||||||
|
PODPAGES = $(PROGS-yes:%=doc/%.pod)
|
||||||
|
HTMLPAGES = $(PROGS-yes:%=doc/%.html)
|
||||||
|
TOOLS = $(addprefix tools/, $(addsuffix $(EXESUF), cws2fws graph2dot lavfi-showfiltfmts pktdumper probetest qt-faststart trasher))
|
||||||
TESTTOOLS = audiogen videogen rotozoom tiny_psnr base64
|
TESTTOOLS = audiogen videogen rotozoom tiny_psnr base64
|
||||||
HOSTPROGS := $(TESTTOOLS:%=tests/%)
|
HOSTPROGS := $(TESTTOOLS:%=tests/%)
|
||||||
TOOLS = qt-faststart trasher
|
|
||||||
TOOLS-$(CONFIG_ZLIB) += cws2fws
|
|
||||||
|
|
||||||
BASENAMES = ffmpeg ffplay ffprobe ffserver
|
BASENAMES = ffmpeg ffplay ffprobe ffserver
|
||||||
ALLPROGS = $(BASENAMES:%=%$(PROGSSUF)$(EXESUF))
|
ALLPROGS = $(BASENAMES:%=%$(EXESUF))
|
||||||
ALLPROGS_G = $(BASENAMES:%=%$(PROGSSUF)_g$(EXESUF))
|
ALLPROGS_G = $(BASENAMES:%=%_g$(EXESUF))
|
||||||
ALLMANPAGES = $(BASENAMES:%=%.1)
|
ALLMANPAGES = $(BASENAMES:%=%.1)
|
||||||
|
|
||||||
|
ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale
|
||||||
|
|
||||||
FFLIBS-$(CONFIG_AVDEVICE) += avdevice
|
FFLIBS-$(CONFIG_AVDEVICE) += avdevice
|
||||||
FFLIBS-$(CONFIG_AVFILTER) += avfilter
|
FFLIBS-$(CONFIG_AVFILTER) += avfilter
|
||||||
FFLIBS-$(CONFIG_AVFORMAT) += avformat
|
FFLIBS-$(CONFIG_AVFORMAT) += avformat
|
||||||
FFLIBS-$(CONFIG_AVCODEC) += avcodec
|
FFLIBS-$(CONFIG_AVCODEC) += avcodec
|
||||||
FFLIBS-$(CONFIG_POSTPROC) += postproc
|
FFLIBS-$(CONFIG_POSTPROC) += postproc
|
||||||
FFLIBS-$(CONFIG_SWRESAMPLE)+= swresample
|
|
||||||
FFLIBS-$(CONFIG_SWSCALE) += swscale
|
FFLIBS-$(CONFIG_SWSCALE) += swscale
|
||||||
|
|
||||||
FFLIBS := avutil
|
FFLIBS := avutil
|
||||||
|
|
||||||
DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.ffpreset) $(SRC_PATH)/doc/ffprobe.xsd
|
DATA_FILES := $(wildcard $(SRC_DIR)/ffpresets/*.ffpreset)
|
||||||
|
|
||||||
SKIPHEADERS = cmdutils_common_opts.h
|
SKIPHEADERS = cmdutils_common_opts.h
|
||||||
|
|
||||||
include $(SRC_PATH)/common.mak
|
include common.mak
|
||||||
|
|
||||||
|
FF_LDFLAGS := $(FFLDFLAGS)
|
||||||
FF_EXTRALIBS := $(FFEXTRALIBS)
|
FF_EXTRALIBS := $(FFEXTRALIBS)
|
||||||
FF_DEP_LIBS := $(DEP_LIBS)
|
FF_DEP_LIBS := $(DEP_LIBS)
|
||||||
|
|
||||||
all: $(PROGS)
|
all-$(CONFIG_DOC): documentation
|
||||||
|
|
||||||
$(PROGS): %$(EXESUF): %$(PROGSSUF)_g$(EXESUF)
|
all: $(FF_DEP_LIBS) $(PROGS)
|
||||||
$(CP) $< $@$(PROGSSUF)
|
|
||||||
$(STRIP) $@$(PROGSSUF)
|
|
||||||
|
|
||||||
$(TOOLS): %$(EXESUF): %.o
|
$(PROGS): %$(EXESUF): %_g$(EXESUF)
|
||||||
$(LD) $(LDFLAGS) -o $@ $< $(ELIBS)
|
$(CP) $< $@
|
||||||
|
$(STRIP) $@
|
||||||
tools/cws2fws$(EXESUF): ELIBS = -lz
|
|
||||||
|
|
||||||
config.h: .config
|
config.h: .config
|
||||||
.config: $(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c))
|
.config: $(wildcard $(FFLIBS:%=$(SRC_DIR)/lib%/all*.c))
|
||||||
@-tput bold 2>/dev/null
|
@-tput bold 2>/dev/null
|
||||||
@-printf '\nWARNING: $(?F) newer than config.h, rerun configure\n\n'
|
@-printf '\nWARNING: $(?F) newer than config.h, rerun configure\n\n'
|
||||||
@-tput sgr0 2>/dev/null
|
@-tput sgr0 2>/dev/null
|
||||||
|
|
||||||
SUBDIR_VARS := OBJS FFLIBS CLEANFILES DIRS TESTPROGS EXAMPLES SKIPHEADERS \
|
SUBDIR_VARS := OBJS FFLIBS CLEANFILES DIRS TESTPROGS EXAMPLES SKIPHEADERS \
|
||||||
ALTIVEC-OBJS MMX-OBJS NEON-OBJS X86-OBJS YASM-OBJS-FFT YASM-OBJS \
|
ALTIVEC-OBJS MMX-OBJS NEON-OBJS X86-OBJS YASM-OBJS-FFT YASM-OBJS \
|
||||||
HOSTPROGS BUILT_HEADERS TESTOBJS ARCH_HEADERS ARMV6-OBJS TOOLS
|
HOSTPROGS BUILT_HEADERS TESTOBJS ARCH_HEADERS ARMV6-OBJS
|
||||||
|
|
||||||
define RESET
|
define RESET
|
||||||
$(1) :=
|
$(1) :=
|
||||||
@@ -76,26 +76,31 @@ endef
|
|||||||
define DOSUBDIR
|
define DOSUBDIR
|
||||||
$(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
|
$(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
|
||||||
SUBDIR := $(1)/
|
SUBDIR := $(1)/
|
||||||
include $(SRC_PATH)/$(1)/Makefile
|
include $(1)/Makefile
|
||||||
-include $(SRC_PATH)/$(1)/$(ARCH)/Makefile
|
|
||||||
include $(SRC_PATH)/library.mak
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
|
$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
|
||||||
|
|
||||||
ffplay.o: CFLAGS += $(SDL_CFLAGS)
|
ffplay.o: CFLAGS += $(SDL_CFLAGS)
|
||||||
ffplay_g$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS)
|
ffplay_g$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS)
|
||||||
ffserver_g$(EXESUF): LDFLAGS += $(FFSERVERLDFLAGS)
|
ffserver_g$(EXESUF): FF_LDFLAGS += $(FFSERVERLDFLAGS)
|
||||||
|
|
||||||
%$(PROGSSUF)_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
|
%_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
|
||||||
$(LD) $(LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
|
$(LD) $(FF_LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
|
||||||
|
|
||||||
OBJDIRS += tools
|
alltools: $(TOOLS)
|
||||||
|
|
||||||
|
tools/%$(EXESUF): tools/%.o
|
||||||
|
$(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
|
||||||
|
|
||||||
|
tools/%.o: tools/%.c
|
||||||
|
$(CC) $(CPPFLAGS) $(CFLAGS) -c $(CC_O) $<
|
||||||
|
|
||||||
-include $(wildcard tools/*.d)
|
-include $(wildcard tools/*.d)
|
||||||
|
-include $(wildcard tests/*.d)
|
||||||
|
|
||||||
VERSION_SH = $(SRC_PATH)/version.sh
|
VERSION_SH = $(SRC_PATH_BARE)/version.sh
|
||||||
GIT_LOG = $(SRC_PATH)/.git/logs/HEAD
|
GIT_LOG = $(SRC_PATH_BARE)/.git/logs/HEAD
|
||||||
|
|
||||||
.version: $(wildcard $(GIT_LOG)) $(VERSION_SH) config.mak
|
.version: $(wildcard $(GIT_LOG)) $(VERSION_SH) config.mak
|
||||||
.version: M=@
|
.version: M=@
|
||||||
@@ -107,6 +112,28 @@ version.h .version:
|
|||||||
# force version.sh to run whenever version might have changed
|
# force version.sh to run whenever version might have changed
|
||||||
-include .version
|
-include .version
|
||||||
|
|
||||||
|
DOCS = $(addprefix doc/, developer.html faq.html general.html libavfilter.html) $(HTMLPAGES) $(MANPAGES) $(PODPAGES)
|
||||||
|
|
||||||
|
documentation: $(DOCS)
|
||||||
|
|
||||||
|
-include $(wildcard $(DOCS:%=%.d))
|
||||||
|
|
||||||
|
TEXIDEP = awk '/^@include/ { printf "$@: $(@D)/%s\n", $$2 }' <$< >$(@:%=%.d)
|
||||||
|
|
||||||
|
doc/%.html: TAG = HTML
|
||||||
|
doc/%.html: doc/%.texi $(SRC_PATH_BARE)/doc/t2h.init
|
||||||
|
$(Q)$(TEXIDEP)
|
||||||
|
$(M)texi2html -monolithic --init-file $(SRC_PATH_BARE)/doc/t2h.init --output $@ $<
|
||||||
|
|
||||||
|
doc/%.pod: TAG = POD
|
||||||
|
doc/%.pod: doc/%.texi
|
||||||
|
$(Q)$(TEXIDEP)
|
||||||
|
$(M)doc/texi2pod.pl $< $@
|
||||||
|
|
||||||
|
doc/%.1: TAG = MAN
|
||||||
|
doc/%.1: doc/%.pod
|
||||||
|
$(M)pod2man --section=1 --center=" " --release=" " $< > $@
|
||||||
|
|
||||||
ifdef PROGS
|
ifdef PROGS
|
||||||
install: install-progs install-data
|
install: install-progs install-data
|
||||||
endif
|
endif
|
||||||
@@ -116,17 +143,22 @@ install: install-libs install-headers
|
|||||||
install-libs: install-libs-yes
|
install-libs: install-libs-yes
|
||||||
|
|
||||||
install-progs-yes:
|
install-progs-yes:
|
||||||
|
install-progs-$(CONFIG_DOC): install-man
|
||||||
install-progs-$(CONFIG_SHARED): install-libs
|
install-progs-$(CONFIG_SHARED): install-libs
|
||||||
|
|
||||||
install-progs: install-progs-yes $(PROGS)
|
install-progs: install-progs-yes $(PROGS)
|
||||||
$(Q)mkdir -p "$(BINDIR)"
|
$(Q)mkdir -p "$(BINDIR)"
|
||||||
$(INSTALL) -c -m 755 $(INSTPROGS) "$(BINDIR)"
|
$(INSTALL) -c -m 755 $(PROGS) "$(BINDIR)"
|
||||||
|
|
||||||
install-data: $(DATA_FILES)
|
install-data: $(DATA_FILES)
|
||||||
$(Q)mkdir -p "$(DATADIR)"
|
$(Q)mkdir -p "$(DATADIR)"
|
||||||
$(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
|
$(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
|
||||||
|
|
||||||
uninstall: uninstall-libs uninstall-headers uninstall-progs uninstall-data
|
install-man: $(MANPAGES)
|
||||||
|
$(Q)mkdir -p "$(MANDIR)/man1"
|
||||||
|
$(INSTALL) -m 644 $(MANPAGES) "$(MANDIR)/man1"
|
||||||
|
|
||||||
|
uninstall: uninstall-libs uninstall-headers uninstall-progs uninstall-data uninstall-man
|
||||||
|
|
||||||
uninstall-progs:
|
uninstall-progs:
|
||||||
$(RM) $(addprefix "$(BINDIR)/", $(ALLPROGS))
|
$(RM) $(addprefix "$(BINDIR)/", $(ALLPROGS))
|
||||||
@@ -134,13 +166,21 @@ uninstall-progs:
|
|||||||
uninstall-data:
|
uninstall-data:
|
||||||
$(RM) -r "$(DATADIR)"
|
$(RM) -r "$(DATADIR)"
|
||||||
|
|
||||||
clean::
|
uninstall-man:
|
||||||
|
$(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
|
||||||
|
|
||||||
|
testclean:
|
||||||
|
$(RM) -r tests/vsynth1 tests/vsynth2 tests/data
|
||||||
|
$(RM) $(addprefix tests/,$(CLEANSUFFIXES))
|
||||||
|
$(RM) tests/seek_test$(EXESUF) tests/seek_test.o
|
||||||
|
$(RM) $(TESTTOOLS:%=tests/%$(HOSTEXESUF))
|
||||||
|
|
||||||
|
clean:: testclean
|
||||||
$(RM) $(ALLPROGS) $(ALLPROGS_G)
|
$(RM) $(ALLPROGS) $(ALLPROGS_G)
|
||||||
$(RM) $(CLEANSUFFIXES)
|
$(RM) $(CLEANSUFFIXES)
|
||||||
|
$(RM) doc/*.html doc/*.pod doc/*.1 doc/*.d doc/*~
|
||||||
$(RM) $(TOOLS)
|
$(RM) $(TOOLS)
|
||||||
$(RM) $(CLEANSUFFIXES:%=tools/%)
|
$(RM) $(CLEANSUFFIXES:%=tools/%)
|
||||||
$(RM) coverage.info
|
|
||||||
$(RM) -r coverage-html
|
|
||||||
|
|
||||||
distclean::
|
distclean::
|
||||||
$(RM) $(DISTCLEANSUFFIXES)
|
$(RM) $(DISTCLEANSUFFIXES)
|
||||||
@@ -149,28 +189,119 @@ distclean::
|
|||||||
config:
|
config:
|
||||||
$(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)
|
$(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)
|
||||||
|
|
||||||
# Without the sed genthml thinks "libavutil" and "./libavutil" are two different things
|
# regression tests
|
||||||
coverage.info: $(wildcard *.gcda *.gcno */*.gcda */*.gcno */*/*.gcda */*/*.gcno)
|
|
||||||
$(Q)lcov -c -d . -b . | sed -e 's#/./#/#g' > $@
|
|
||||||
|
|
||||||
coverage-html: coverage.info
|
check: test
|
||||||
$(Q)mkdir -p $@
|
|
||||||
$(Q)genhtml -o $@ $<
|
|
||||||
$(Q)touch $@
|
|
||||||
|
|
||||||
include $(SRC_PATH)/doc/Makefile
|
fulltest test: codectest lavftest lavfitest seektest
|
||||||
include $(SRC_PATH)/tests/Makefile
|
|
||||||
|
|
||||||
$(sort $(OBJDIRS)):
|
FFSERVER_REFFILE = $(SRC_PATH)/tests/ffserver.regression.ref
|
||||||
$(Q)mkdir -p $@
|
|
||||||
|
|
||||||
# Dummy rule to stop make trying to rebuild removed or renamed headers
|
codectest: fate-codec
|
||||||
%.h:
|
lavftest: fate-lavf
|
||||||
@:
|
lavfitest: fate-lavfi
|
||||||
|
seektest: fate-seek
|
||||||
|
|
||||||
# Disable suffix rules. Most of the builtin rules are suffix rules,
|
AREF = fate-acodec-aref
|
||||||
# so this saves some time on slow systems.
|
VREF = fate-vsynth1-vref fate-vsynth2-vref
|
||||||
.SUFFIXES:
|
REFS = $(AREF) $(VREF)
|
||||||
|
|
||||||
.PHONY: all all-yes alltools *clean config examples install*
|
$(VREF): ffmpeg$(EXESUF) tests/vsynth1/00.pgm tests/vsynth2/00.pgm
|
||||||
.PHONY: testprogs uninstall*
|
$(AREF): ffmpeg$(EXESUF) tests/data/asynth1.sw
|
||||||
|
|
||||||
|
ffservertest: ffserver$(EXESUF) tests/vsynth1/00.pgm tests/data/asynth1.sw
|
||||||
|
@echo
|
||||||
|
@echo "Unfortunately ffserver is broken and therefore its regression"
|
||||||
|
@echo "test fails randomly. Treat the results accordingly."
|
||||||
|
@echo
|
||||||
|
$(SRC_PATH)/tests/ffserver-regression.sh $(FFSERVER_REFFILE) $(SRC_PATH)/tests/ffserver.conf
|
||||||
|
|
||||||
|
tests/vsynth1/00.pgm: tests/videogen$(HOSTEXESUF)
|
||||||
|
@mkdir -p tests/vsynth1
|
||||||
|
$(M)./$< 'tests/vsynth1/'
|
||||||
|
|
||||||
|
tests/vsynth2/00.pgm: tests/rotozoom$(HOSTEXESUF)
|
||||||
|
@mkdir -p tests/vsynth2
|
||||||
|
$(M)./$< 'tests/vsynth2/' $(SRC_PATH)/tests/lena.pnm
|
||||||
|
|
||||||
|
tests/data/asynth1.sw: tests/audiogen$(HOSTEXESUF)
|
||||||
|
@mkdir -p tests/data
|
||||||
|
$(M)./$< $@
|
||||||
|
|
||||||
|
tests/data/asynth1.sw tests/vsynth%/00.pgm: TAG = GEN
|
||||||
|
|
||||||
|
tests/seek_test$(EXESUF): tests/seek_test.o $(FF_DEP_LIBS)
|
||||||
|
$(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
|
||||||
|
|
||||||
|
tools/lavfi-showfiltfmts$(EXESUF): tools/lavfi-showfiltfmts.o $(FF_DEP_LIBS)
|
||||||
|
$(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
|
||||||
|
|
||||||
|
include $(SRC_PATH_BARE)/tests/fate.mak
|
||||||
|
include $(SRC_PATH_BARE)/tests/fate2.mak
|
||||||
|
|
||||||
|
include $(SRC_PATH_BARE)/tests/fate/aac.mak
|
||||||
|
include $(SRC_PATH_BARE)/tests/fate/als.mak
|
||||||
|
include $(SRC_PATH_BARE)/tests/fate/fft.mak
|
||||||
|
include $(SRC_PATH_BARE)/tests/fate/h264.mak
|
||||||
|
include $(SRC_PATH_BARE)/tests/fate/mp3.mak
|
||||||
|
include $(SRC_PATH_BARE)/tests/fate/vorbis.mak
|
||||||
|
include $(SRC_PATH_BARE)/tests/fate/vp8.mak
|
||||||
|
|
||||||
|
FATE_ACODEC = $(ACODEC_TESTS:%=fate-acodec-%)
|
||||||
|
FATE_VSYNTH1 = $(VCODEC_TESTS:%=fate-vsynth1-%)
|
||||||
|
FATE_VSYNTH2 = $(VCODEC_TESTS:%=fate-vsynth2-%)
|
||||||
|
FATE_VCODEC = $(FATE_VSYNTH1) $(FATE_VSYNTH2)
|
||||||
|
FATE_LAVF = $(LAVF_TESTS:%=fate-lavf-%)
|
||||||
|
FATE_LAVFI = $(LAVFI_TESTS:%=fate-lavfi-%)
|
||||||
|
FATE_SEEK = $(SEEK_TESTS:seek_%=fate-seek-%)
|
||||||
|
|
||||||
|
FATE = $(FATE_ACODEC) \
|
||||||
|
$(FATE_VCODEC) \
|
||||||
|
$(FATE_LAVF) \
|
||||||
|
$(FATE_LAVFI) \
|
||||||
|
$(FATE_SEEK) \
|
||||||
|
|
||||||
|
$(filter-out %-aref,$(FATE_ACODEC)): $(AREF)
|
||||||
|
$(filter-out %-vref,$(FATE_VCODEC)): $(VREF)
|
||||||
|
$(FATE_LAVF): $(REFS)
|
||||||
|
$(FATE_LAVFI): $(REFS) tools/lavfi-showfiltfmts$(EXESUF)
|
||||||
|
$(FATE_SEEK): fate-codec fate-lavf tests/seek_test$(EXESUF)
|
||||||
|
|
||||||
|
$(FATE_ACODEC): CMD = codectest acodec
|
||||||
|
$(FATE_VSYNTH1): CMD = codectest vsynth1
|
||||||
|
$(FATE_VSYNTH2): CMD = codectest vsynth2
|
||||||
|
$(FATE_LAVF): CMD = lavftest
|
||||||
|
$(FATE_LAVFI): CMD = lavfitest
|
||||||
|
$(FATE_SEEK): CMD = seektest
|
||||||
|
|
||||||
|
fate-codec: fate-acodec fate-vcodec
|
||||||
|
fate-acodec: $(FATE_ACODEC)
|
||||||
|
fate-vcodec: $(FATE_VCODEC)
|
||||||
|
fate-lavf: $(FATE_LAVF)
|
||||||
|
fate-lavfi: $(FATE_LAVFI)
|
||||||
|
fate-seek: $(FATE_SEEK)
|
||||||
|
|
||||||
|
ifdef SAMPLES
|
||||||
|
FATE += $(FATE_TESTS)
|
||||||
|
fate-rsync:
|
||||||
|
rsync -vaLW rsync://fate-suite.libav.org/fate-suite/ $(SAMPLES)
|
||||||
|
else
|
||||||
|
fate-rsync:
|
||||||
|
@echo "use 'make fate-rsync SAMPLES=/path/to/samples' to sync the fate suite"
|
||||||
|
$(FATE_TESTS):
|
||||||
|
@echo "SAMPLES not specified, cannot run FATE. See doc/fate.txt for more information."
|
||||||
|
endif
|
||||||
|
|
||||||
|
FATE_UTILS = base64 tiny_psnr
|
||||||
|
|
||||||
|
fate: $(FATE)
|
||||||
|
|
||||||
|
$(FATE): ffmpeg$(EXESUF) $(FATE_UTILS:%=tests/%$(HOSTEXESUF))
|
||||||
|
@echo "TEST $(@:fate-%=%)"
|
||||||
|
$(Q)$(SRC_PATH)/tests/fate-run.sh $@ "$(SAMPLES)" "$(TARGET_EXEC)" "$(TARGET_PATH)" '$(CMD)' '$(CMP)' '$(REF)' '$(FUZZ)' '$(THREADS)' '$(THREAD_TYPE)'
|
||||||
|
|
||||||
|
fate-list:
|
||||||
|
@printf '%s\n' $(sort $(FATE))
|
||||||
|
|
||||||
|
.PHONY: all alltools *clean check config documentation examples install*
|
||||||
|
.PHONY: *test testprogs uninstall*
|
||||||
|
|||||||
856
cmdutils.c
856
cmdutils.c
File diff suppressed because it is too large
Load Diff
139
cmdutils.h
139
cmdutils.h
@@ -43,15 +43,11 @@ extern const char program_name[];
|
|||||||
*/
|
*/
|
||||||
extern const int program_birth_year;
|
extern const int program_birth_year;
|
||||||
|
|
||||||
/**
|
extern const char **opt_names;
|
||||||
* this year, defined by the program for show_banner()
|
|
||||||
*/
|
|
||||||
extern const int this_year;
|
|
||||||
|
|
||||||
extern AVCodecContext *avcodec_opts[AVMEDIA_TYPE_NB];
|
extern AVCodecContext *avcodec_opts[AVMEDIA_TYPE_NB];
|
||||||
extern AVFormatContext *avformat_opts;
|
extern AVFormatContext *avformat_opts;
|
||||||
extern struct SwsContext *sws_opts;
|
extern struct SwsContext *sws_opts;
|
||||||
extern AVDictionary *format_opts, *codec_opts;
|
extern AVDictionary *format_opts, *video_opts, *audio_opts, *sub_opts;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the cmdutils option system, in particular
|
* Initialize the cmdutils option system, in particular
|
||||||
@@ -81,12 +77,6 @@ int opt_default(const char *opt, const char *arg);
|
|||||||
*/
|
*/
|
||||||
int opt_loglevel(const char *opt, const char *arg);
|
int opt_loglevel(const char *opt, const char *arg);
|
||||||
|
|
||||||
int opt_report(const char *opt);
|
|
||||||
|
|
||||||
int opt_max_alloc(const char *opt, const char *arg);
|
|
||||||
|
|
||||||
int opt_codec_debug(const char *opt, const char *arg);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Limit the execution time.
|
* Limit the execution time.
|
||||||
*/
|
*/
|
||||||
@@ -105,8 +95,7 @@ int opt_timelimit(const char *opt, const char *arg);
|
|||||||
* @param min the minimum valid accepted value
|
* @param min the minimum valid accepted value
|
||||||
* @param max the maximum valid accepted value
|
* @param max the maximum valid accepted value
|
||||||
*/
|
*/
|
||||||
double parse_number_or_die(const char *context, const char *numstr, int type,
|
double parse_number_or_die(const char *context, const char *numstr, int type, double min, double max);
|
||||||
double min, double max);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse a string specifying a time and return its corresponding
|
* Parse a string specifying a time and return its corresponding
|
||||||
@@ -122,19 +111,7 @@ double parse_number_or_die(const char *context, const char *numstr, int type,
|
|||||||
*
|
*
|
||||||
* @see parse_date()
|
* @see parse_date()
|
||||||
*/
|
*/
|
||||||
int64_t parse_time_or_die(const char *context, const char *timestr,
|
int64_t parse_time_or_die(const char *context, const char *timestr, int is_duration);
|
||||||
int is_duration);
|
|
||||||
|
|
||||||
typedef struct SpecifierOpt {
|
|
||||||
char *specifier; /**< stream/chapter/program/... specifier */
|
|
||||||
union {
|
|
||||||
uint8_t *str;
|
|
||||||
int i;
|
|
||||||
int64_t i64;
|
|
||||||
float f;
|
|
||||||
double dbl;
|
|
||||||
} u;
|
|
||||||
} SpecifierOpt;
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
const char *name;
|
const char *name;
|
||||||
@@ -152,95 +129,31 @@ typedef struct {
|
|||||||
#define OPT_INT64 0x0400
|
#define OPT_INT64 0x0400
|
||||||
#define OPT_EXIT 0x0800
|
#define OPT_EXIT 0x0800
|
||||||
#define OPT_DATA 0x1000
|
#define OPT_DATA 0x1000
|
||||||
#define OPT_FUNC2 0x2000
|
|
||||||
#define OPT_OFFSET 0x4000 /* option is specified as an offset in a passed optctx */
|
|
||||||
#define OPT_SPEC 0x8000 /* option is to be stored in an array of SpecifierOpt.
|
|
||||||
Implies OPT_OFFSET. Next element after the offset is
|
|
||||||
an int containing element count in the array. */
|
|
||||||
#define OPT_TIME 0x10000
|
|
||||||
#define OPT_DOUBLE 0x20000
|
|
||||||
union {
|
union {
|
||||||
void *dst_ptr;
|
int *int_arg;
|
||||||
|
char **str_arg;
|
||||||
|
float *float_arg;
|
||||||
int (*func_arg)(const char *, const char *);
|
int (*func_arg)(const char *, const char *);
|
||||||
int (*func2_arg)(void *, const char *, const char *);
|
int64_t *int64_arg;
|
||||||
size_t off;
|
|
||||||
} u;
|
} u;
|
||||||
const char *help;
|
const char *help;
|
||||||
const char *argname;
|
const char *argname;
|
||||||
} OptionDef;
|
} OptionDef;
|
||||||
|
|
||||||
void show_help_options(const OptionDef *options, const char *msg, int mask,
|
void show_help_options(const OptionDef *options, const char *msg, int mask, int value);
|
||||||
int value);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show help for all options with given flags in class and all its
|
|
||||||
* children.
|
|
||||||
*/
|
|
||||||
void show_help_children(const AVClass *class, int flags);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse the command line arguments.
|
* Parse the command line arguments.
|
||||||
*
|
|
||||||
* @param optctx an opaque options context
|
|
||||||
* @param options Array with the definitions required to interpret every
|
* @param options Array with the definitions required to interpret every
|
||||||
* option of the form: -option_name [argument]
|
* option of the form: -option_name [argument]
|
||||||
* @param parse_arg_function Name of the function called to process every
|
* @param parse_arg_function Name of the function called to process every
|
||||||
* argument without a leading option name flag. NULL if such arguments do
|
* argument without a leading option name flag. NULL if such arguments do
|
||||||
* not have to be processed.
|
* not have to be processed.
|
||||||
*/
|
*/
|
||||||
void parse_options(void *optctx, int argc, char **argv, const OptionDef *options,
|
void parse_options(int argc, char **argv, const OptionDef *options,
|
||||||
void (* parse_arg_function)(void *optctx, const char*));
|
int (* parse_arg_function)(const char *opt, const char *arg));
|
||||||
|
|
||||||
/**
|
void set_context_opts(void *ctx, void *opts_ctx, int flags, AVCodec *codec);
|
||||||
* Parse one given option.
|
|
||||||
*
|
|
||||||
* @return on success 1 if arg was consumed, 0 otherwise; negative number on error
|
|
||||||
*/
|
|
||||||
int parse_option(void *optctx, const char *opt, const char *arg,
|
|
||||||
const OptionDef *options);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Find the '-loglevel' option in the command line args and apply it.
|
|
||||||
*/
|
|
||||||
void parse_loglevel(int argc, char **argv, const OptionDef *options);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check if the given stream matches a stream specifier.
|
|
||||||
*
|
|
||||||
* @param s Corresponding format context.
|
|
||||||
* @param st Stream from s to be checked.
|
|
||||||
* @param spec A stream specifier of the [v|a|s|d]:[\<stream index\>] form.
|
|
||||||
*
|
|
||||||
* @return 1 if the stream matches, 0 if it doesn't, <0 on error
|
|
||||||
*/
|
|
||||||
int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Filter out options for given codec.
|
|
||||||
*
|
|
||||||
* Create a new options dictionary containing only the options from
|
|
||||||
* opts which apply to the codec with ID codec_id.
|
|
||||||
*
|
|
||||||
* @param s Corresponding format context.
|
|
||||||
* @param st A stream from s for which the options should be filtered.
|
|
||||||
* @return a pointer to the created dictionary
|
|
||||||
*/
|
|
||||||
AVDictionary *filter_codec_opts(AVDictionary *opts, AVCodec *codec,
|
|
||||||
AVFormatContext *s, AVStream *st);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Setup AVCodecContext options for avformat_find_stream_info().
|
|
||||||
*
|
|
||||||
* Create an array of dictionaries, one dictionary for each stream
|
|
||||||
* contained in s.
|
|
||||||
* Each dictionary will contain the options from codec_opts which can
|
|
||||||
* be applied to the corresponding stream codec context.
|
|
||||||
*
|
|
||||||
* @return pointer to the created array of dictionaries, NULL if it
|
|
||||||
* cannot be created
|
|
||||||
*/
|
|
||||||
AVDictionary **setup_find_stream_info_opts(AVFormatContext *s,
|
|
||||||
AVDictionary *codec_opts);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Print an error message to stderr, indicating filename and a human
|
* Print an error message to stderr, indicating filename and a human
|
||||||
@@ -258,7 +171,7 @@ void print_error(const char *filename, int err);
|
|||||||
* current version of the repository and of the libav* libraries used by
|
* current version of the repository and of the libav* libraries used by
|
||||||
* the program.
|
* the program.
|
||||||
*/
|
*/
|
||||||
void show_banner(int argc, char **argv, const OptionDef *options);
|
void show_banner(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Print the version of the program to stdout. The version message
|
* Print the version of the program to stdout. The version message
|
||||||
@@ -317,12 +230,6 @@ int opt_protocols(const char *opt, const char *arg);
|
|||||||
*/
|
*/
|
||||||
int opt_pix_fmts(const char *opt, const char *arg);
|
int opt_pix_fmts(const char *opt, const char *arg);
|
||||||
|
|
||||||
/**
|
|
||||||
* Print a listing containing all the sample formats supported by the
|
|
||||||
* program.
|
|
||||||
*/
|
|
||||||
int show_sample_fmts(const char *opt, const char *arg);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a positive value if a line read from standard input
|
* Return a positive value if a line read from standard input
|
||||||
* starts with [yY], otherwise return 0.
|
* starts with [yY], otherwise return 0.
|
||||||
@@ -338,7 +245,7 @@ int read_yesno(void);
|
|||||||
* @return 0 in case of success, a negative value corresponding to an
|
* @return 0 in case of success, a negative value corresponding to an
|
||||||
* AVERROR error code in case of failure.
|
* AVERROR error code in case of failure.
|
||||||
*/
|
*/
|
||||||
int cmdutils_read_file(const char *filename, char **bufptr, size_t *size);
|
int read_file(const char *filename, char **bufptr, size_t *size);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a file corresponding to a preset file.
|
* Get a file corresponding to a preset file.
|
||||||
@@ -361,20 +268,4 @@ int cmdutils_read_file(const char *filename, char **bufptr, size_t *size);
|
|||||||
FILE *get_preset_file(char *filename, size_t filename_size,
|
FILE *get_preset_file(char *filename, size_t filename_size,
|
||||||
const char *preset_name, int is_path, const char *codec_name);
|
const char *preset_name, int is_path, const char *codec_name);
|
||||||
|
|
||||||
/**
|
#endif /* FFMPEG_CMDUTILS_H */
|
||||||
* Do all the necessary cleanup and abort.
|
|
||||||
* This function is implemented in the avtools, not cmdutils.
|
|
||||||
*/
|
|
||||||
void exit_program(int ret);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Realloc array to hold new_size elements of elem_size.
|
|
||||||
* Calls exit_program() on failure.
|
|
||||||
*
|
|
||||||
* @param elem_size size in bytes of each element
|
|
||||||
* @param size new element count will be written here
|
|
||||||
* @return reallocated array
|
|
||||||
*/
|
|
||||||
void *grow_array(void *array, int elem_size, int *size, int new_size);
|
|
||||||
|
|
||||||
#endif /* CMDUTILS_H */
|
|
||||||
|
|||||||
@@ -10,9 +10,4 @@
|
|||||||
{ "protocols", OPT_EXIT, {(void*)opt_protocols}, "show available protocols" },
|
{ "protocols", OPT_EXIT, {(void*)opt_protocols}, "show available protocols" },
|
||||||
{ "filters", OPT_EXIT, {(void*)opt_filters }, "show available filters" },
|
{ "filters", OPT_EXIT, {(void*)opt_filters }, "show available filters" },
|
||||||
{ "pix_fmts" , OPT_EXIT, {(void*)opt_pix_fmts }, "show available pixel formats" },
|
{ "pix_fmts" , OPT_EXIT, {(void*)opt_pix_fmts }, "show available pixel formats" },
|
||||||
{ "sample_fmts", OPT_EXIT, {.func_arg = show_sample_fmts }, "show available audio sample formats" },
|
|
||||||
{ "loglevel", HAS_ARG, {(void*)opt_loglevel}, "set libav* logging level", "loglevel" },
|
{ "loglevel", HAS_ARG, {(void*)opt_loglevel}, "set libav* logging level", "loglevel" },
|
||||||
{ "v", HAS_ARG, {(void*)opt_loglevel}, "set libav* logging level", "loglevel" },
|
|
||||||
{ "debug", HAS_ARG, {(void*)opt_codec_debug}, "set debug flags", "flags" },
|
|
||||||
{ "report", 0, {(void*)opt_report}, "generate a report" },
|
|
||||||
{ "max_alloc", HAS_ARG, {(void*)opt_max_alloc}, "set maximum size of a single allocated block", "bytes" },
|
|
||||||
|
|||||||
67
common.mak
67
common.mak
@@ -10,7 +10,7 @@ ifndef SUBDIR
|
|||||||
ifndef V
|
ifndef V
|
||||||
Q = @
|
Q = @
|
||||||
ECHO = printf "$(1)\t%s\n" $(2)
|
ECHO = printf "$(1)\t%s\n" $(2)
|
||||||
BRIEF = CC CXX AS YASM AR LD HOSTCC STRIP CP
|
BRIEF = CC AS YASM AR LD HOSTCC STRIP CP
|
||||||
SILENT = DEPCC YASMDEP RM RANLIB
|
SILENT = DEPCC YASMDEP RM RANLIB
|
||||||
MSG = $@
|
MSG = $@
|
||||||
M = @$(call ECHO,$(TAG),$@);
|
M = @$(call ECHO,$(TAG),$@);
|
||||||
@@ -20,38 +20,20 @@ $(foreach VAR,$(SILENT),$(eval override $(VAR) = @$($(VAR))))
|
|||||||
$(eval INSTALL = @$(call ECHO,INSTALL,$$(^:$(SRC_DIR)/%=%)); $(INSTALL))
|
$(eval INSTALL = @$(call ECHO,INSTALL,$$(^:$(SRC_DIR)/%=%)); $(INSTALL))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale swresample
|
IFLAGS := -I. -I$(SRC_PATH)
|
||||||
|
|
||||||
# NASM requires -I path terminated with /
|
|
||||||
IFLAGS := -I. -I$(SRC_PATH)/
|
|
||||||
CPPFLAGS := $(IFLAGS) $(CPPFLAGS)
|
CPPFLAGS := $(IFLAGS) $(CPPFLAGS)
|
||||||
CFLAGS += $(ECFLAGS)
|
CFLAGS += $(ECFLAGS)
|
||||||
CCFLAGS = $(CFLAGS)
|
YASMFLAGS += $(IFLAGS) -Pconfig.asm
|
||||||
CXXFLAGS := $(CFLAGS) $(CXXFLAGS)
|
|
||||||
YASMFLAGS += $(IFLAGS) -I$(SRC_PATH)/libavutil/x86/ -Pconfig.asm
|
|
||||||
HOSTCFLAGS += $(IFLAGS)
|
HOSTCFLAGS += $(IFLAGS)
|
||||||
LDFLAGS := $(ALLFFLIBS:%=-Llib%) $(LDFLAGS)
|
|
||||||
|
|
||||||
define COMPILE
|
|
||||||
$($(1)DEP)
|
|
||||||
$($(1)) $(CPPFLAGS) $($(1)FLAGS) $($(1)_DEPFLAGS) -c $($(1)_O) $<
|
|
||||||
endef
|
|
||||||
|
|
||||||
COMPILE_C = $(call COMPILE,CC)
|
|
||||||
COMPILE_CXX = $(call COMPILE,CXX)
|
|
||||||
COMPILE_S = $(call COMPILE,AS)
|
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
$(COMPILE_C)
|
$(CCDEP)
|
||||||
|
$(CC) $(CPPFLAGS) $(CFLAGS) $(CC_DEPFLAGS) -c $(CC_O) $<
|
||||||
%.o: %.cpp
|
|
||||||
$(COMPILE_CXX)
|
|
||||||
|
|
||||||
%.s: %.c
|
|
||||||
$(CC) $(CPPFLAGS) $(CFLAGS) -S -o $@ $<
|
|
||||||
|
|
||||||
%.o: %.S
|
%.o: %.S
|
||||||
$(COMPILE_S)
|
$(ASDEP)
|
||||||
|
$(AS) $(CPPFLAGS) $(ASFLAGS) $(AS_DEPFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
%.ho: %.h
|
%.ho: %.h
|
||||||
$(CC) $(CPPFLAGS) $(CFLAGS) -Wno-unused -c -o $@ -x c $<
|
$(CC) $(CPPFLAGS) $(CFLAGS) -Wno-unused -c -o $@ -x c $<
|
||||||
@@ -79,41 +61,30 @@ OBJS += $(OBJS-yes)
|
|||||||
FFLIBS := $(FFLIBS-yes) $(FFLIBS)
|
FFLIBS := $(FFLIBS-yes) $(FFLIBS)
|
||||||
TESTPROGS += $(TESTPROGS-yes)
|
TESTPROGS += $(TESTPROGS-yes)
|
||||||
|
|
||||||
FFEXTRALIBS := $(FFLIBS:%=-l%$(BUILDSUF)) $(EXTRALIBS)
|
FFEXTRALIBS := $(addprefix -l,$(addsuffix $(BUILDSUF),$(FFLIBS))) $(EXTRALIBS)
|
||||||
|
FFLDFLAGS := $(addprefix -Llib,$(ALLFFLIBS)) $(LDFLAGS)
|
||||||
|
|
||||||
EXAMPLES := $(EXAMPLES:%=$(SUBDIR)%-example$(EXESUF))
|
EXAMPLES := $(addprefix $(SUBDIR),$(addsuffix -example$(EXESUF),$(EXAMPLES)))
|
||||||
OBJS := $(sort $(OBJS:%=$(SUBDIR)%))
|
OBJS := $(addprefix $(SUBDIR),$(sort $(OBJS)))
|
||||||
TESTOBJS := $(TESTOBJS:%=$(SUBDIR)%) $(TESTPROGS:%=$(SUBDIR)%-test.o)
|
TESTOBJS := $(addprefix $(SUBDIR),$(TESTOBJS) $(TESTPROGS:%=%-test.o))
|
||||||
TESTPROGS := $(TESTPROGS:%=$(SUBDIR)%-test$(EXESUF))
|
TESTPROGS := $(addprefix $(SUBDIR),$(addsuffix -test$(EXESUF),$(TESTPROGS)))
|
||||||
HOSTOBJS := $(HOSTPROGS:%=$(SUBDIR)%.o)
|
HOSTOBJS := $(addprefix $(SUBDIR),$(addsuffix .o,$(HOSTPROGS)))
|
||||||
HOSTPROGS := $(HOSTPROGS:%=$(SUBDIR)%$(HOSTEXESUF))
|
HOSTPROGS := $(addprefix $(SUBDIR),$(addsuffix $(HOSTEXESUF),$(HOSTPROGS)))
|
||||||
TOOLS += $(TOOLS-yes)
|
|
||||||
TOOLOBJS := $(TOOLS:%=tools/%.o)
|
|
||||||
TOOLS := $(TOOLS:%=tools/%$(EXESUF))
|
|
||||||
|
|
||||||
DEP_LIBS := $(foreach NAME,$(FFLIBS),lib$(NAME)/$($(CONFIG_SHARED:yes=S)LIBNAME))
|
DEP_LIBS := $(foreach NAME,$(FFLIBS),lib$(NAME)/$($(CONFIG_SHARED:yes=S)LIBNAME))
|
||||||
|
|
||||||
ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h))
|
ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h))
|
||||||
SKIPHEADERS += $(ARCH_HEADERS:%=$(ARCH)/%) $(SKIPHEADERS-)
|
SKIPHEADERS += $(addprefix $(ARCH)/,$(ARCH_HEADERS))
|
||||||
SKIPHEADERS := $(SKIPHEADERS:%=$(SUBDIR)%)
|
SKIPHEADERS := $(addprefix $(SUBDIR),$(SKIPHEADERS-) $(SKIPHEADERS))
|
||||||
checkheaders: $(filter-out $(SKIPHEADERS:.h=.ho),$(ALLHEADERS:.h=.ho))
|
checkheaders: $(filter-out $(SKIPHEADERS:.h=.ho),$(ALLHEADERS:.h=.ho))
|
||||||
|
|
||||||
alltools: $(TOOLS)
|
|
||||||
|
|
||||||
$(HOSTOBJS): %.o: %.c
|
$(HOSTOBJS): %.o: %.c
|
||||||
$(HOSTCC) $(HOSTCFLAGS) -c -o $@ $<
|
$(HOSTCC) $(HOSTCFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
$(HOSTPROGS): %$(HOSTEXESUF): %.o
|
$(HOSTPROGS): %$(HOSTEXESUF): %.o
|
||||||
$(HOSTCC) $(HOSTLDFLAGS) -o $@ $< $(HOSTLIBS)
|
$(HOSTCC) $(HOSTLDFLAGS) -o $@ $< $(HOSTLIBS)
|
||||||
|
|
||||||
$(OBJS): | $(sort $(dir $(OBJS)))
|
CLEANSUFFIXES = *.d *.o *~ *.ho *.map *.ver
|
||||||
$(HOSTOBJS): | $(sort $(dir $(HOSTOBJS)))
|
|
||||||
$(TESTOBJS): | $(sort $(dir $(TESTOBJS)))
|
|
||||||
$(TOOLOBJS): | tools
|
|
||||||
|
|
||||||
OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOSTOBJS) $(TESTOBJS))
|
|
||||||
|
|
||||||
CLEANSUFFIXES = *.d *.o *~ *.ho *.map *.ver *.gcno *.gcda
|
|
||||||
DISTCLEANSUFFIXES = *.pc
|
DISTCLEANSUFFIXES = *.pc
|
||||||
LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a *.exp
|
LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a *.exp
|
||||||
|
|
||||||
|
|||||||
241
doc/APIchanges
241
doc/APIchanges
@@ -13,224 +13,7 @@ libavutil: 2011-04-18
|
|||||||
|
|
||||||
API changes, most recent first:
|
API changes, most recent first:
|
||||||
|
|
||||||
2012-01-24 - xxxxxxx - lavfi 2.60.100
|
2011-06-19 - xxxxxxx - lavfi 2.23.0 - avfilter.h
|
||||||
Add avfilter_graph_dump.
|
|
||||||
|
|
||||||
2012-01-25 - lavf 53.22.0
|
|
||||||
f1caf01 Allow doing av_write_frame(ctx, NULL) for flushing possible
|
|
||||||
buffered data within a muxer. Added AVFMT_ALLOW_FLUSH for
|
|
||||||
muxers supporting it (av_write_frame makes sure it is called
|
|
||||||
only for muxers with this flag).
|
|
||||||
|
|
||||||
2012-01-15 - lavc 53.34.0
|
|
||||||
New audio encoding API:
|
|
||||||
b2c75b6 Add CODEC_CAP_VARIABLE_FRAME_SIZE capability for use by audio
|
|
||||||
encoders.
|
|
||||||
5ee5fa0 Add avcodec_fill_audio_frame() as a convenience function.
|
|
||||||
b2c75b6 Add avcodec_encode_audio2() and deprecate avcodec_encode_audio().
|
|
||||||
Add AVCodec.encode2().
|
|
||||||
|
|
||||||
2012-01-12 - 3167dc9 - lavfi 2.15.0
|
|
||||||
Add a new installed header -- libavfilter/version.h -- with version macros.
|
|
||||||
|
|
||||||
2011-12-08 - a502939 - lavfi 2.52.0
|
|
||||||
Add av_buffersink_poll_frame() to buffersink.h.
|
|
||||||
|
|
||||||
2011-12-08 - xxxxxxx - lavu 51.31.0
|
|
||||||
Add av_log_format_line.
|
|
||||||
|
|
||||||
2011-12-03 - xxxxxxx - lavu 51.30.0
|
|
||||||
Add AVERROR_BUG.
|
|
||||||
|
|
||||||
2011-xx-xx - xxxxxxx - lavu 51.28.1
|
|
||||||
Add av_get_alt_sample_fmt() to samplefmt.h.
|
|
||||||
|
|
||||||
2011-11-03 - 96949da - lavu 51.23.0
|
|
||||||
Add av_strcasecmp() and av_strncasecmp() to avstring.h.
|
|
||||||
|
|
||||||
2011-10-20 - b35e9e1 - lavu 51.22.0
|
|
||||||
Add av_strtok() to avstring.h.
|
|
||||||
|
|
||||||
2011-01-03 - b73ec05 - lavu 51.21.0
|
|
||||||
Add av_popcount64
|
|
||||||
|
|
||||||
2011-12-18 - 8400b12 - lavc 53.28.1
|
|
||||||
Deprecate AVFrame.age. The field is unused.
|
|
||||||
|
|
||||||
2011-12-12 - 5266045 - lavf 53.17.0
|
|
||||||
Add avformat_close_input().
|
|
||||||
Deprecate av_close_input_file() and av_close_input_stream().
|
|
||||||
|
|
||||||
2011-12-02 - 0eea212 - lavc 53.25.0
|
|
||||||
Add nb_samples and extended_data fields to AVFrame.
|
|
||||||
Deprecate AVCODEC_MAX_AUDIO_FRAME_SIZE.
|
|
||||||
Deprecate avcodec_decode_audio3() in favor of avcodec_decode_audio4().
|
|
||||||
avcodec_decode_audio4() writes output samples to an AVFrame, which allows
|
|
||||||
audio decoders to use get_buffer().
|
|
||||||
|
|
||||||
2011-12-04 - 560f773 - lavc 53.24.0
|
|
||||||
Change AVFrame.data[4]/base[4]/linesize[4]/error[4] to [8] at next major bump.
|
|
||||||
Change AVPicture.data[4]/linesize[4] to [8] at next major bump.
|
|
||||||
Change AVCodecContext.error[4] to [8] at next major bump.
|
|
||||||
Add AV_NUM_DATA_POINTERS to simplify the bump transition.
|
|
||||||
|
|
||||||
2011-11-23 - bbb46f3 - lavu 51.18.0
|
|
||||||
Add av_samples_get_buffer_size(), av_samples_fill_arrays(), and
|
|
||||||
av_samples_alloc(), to samplefmt.h.
|
|
||||||
|
|
||||||
2011-11-23 - 8889cc4 - lavu 51.17.0
|
|
||||||
Add planar sample formats and av_sample_fmt_is_planar() to samplefmt.h.
|
|
||||||
|
|
||||||
2011-11-19 - f3a29b7 - lavc 53.21.0
|
|
||||||
Move some AVCodecContext fields to a new private struct, AVCodecInternal,
|
|
||||||
which is accessed from a new field, AVCodecContext.internal.
|
|
||||||
- fields moved:
|
|
||||||
AVCodecContext.internal_buffer --> AVCodecInternal.buffer
|
|
||||||
AVCodecContext.internal_buffer_count --> AVCodecInternal.buffer_count
|
|
||||||
AVCodecContext.is_copy --> AVCodecInternal.is_copy
|
|
||||||
|
|
||||||
2011-11-16 - 6270671 - lavu 51.16.0
|
|
||||||
Add av_timegm()
|
|
||||||
|
|
||||||
2011-11-13 - lavf 53.15.0
|
|
||||||
New interrupt callback API, allowing per-AVFormatContext/AVIOContext
|
|
||||||
interrupt callbacks.
|
|
||||||
6aa0b98 Add AVIOInterruptCB struct and the interrupt_callback field to
|
|
||||||
AVFormatContext.
|
|
||||||
1dee0ac Add avio_open2() with additional parameters. Those are
|
|
||||||
an interrupt callback and an options AVDictionary.
|
|
||||||
This will allow passing AVOptions to protocols after lavf
|
|
||||||
54.0.
|
|
||||||
|
|
||||||
2011-11-06 - ba04ecf - lavu 51.14.0
|
|
||||||
Add av_strcasecmp() and av_strncasecmp() to avstring.h.
|
|
||||||
|
|
||||||
2011-11-06 - 07b172f - lavu 51.13.0
|
|
||||||
Add av_toupper()/av_tolower()
|
|
||||||
|
|
||||||
2011-11-05 - b6d08f4 - lavf 53.13.0
|
|
||||||
Add avformat_network_init()/avformat_network_uninit()
|
|
||||||
|
|
||||||
2011-10-27 - 512557b - lavc 53.15.0
|
|
||||||
Remove avcodec_parse_frame.
|
|
||||||
Deprecate AVCodecContext.parse_only and CODEC_CAP_PARSE_ONLY.
|
|
||||||
|
|
||||||
2011-10-19 - 569129a - lavf 53.10.0
|
|
||||||
Add avformat_new_stream(). Deprecate av_new_stream().
|
|
||||||
|
|
||||||
2011-10-13 - b631fba - lavf 53.9.0
|
|
||||||
Add AVFMT_NO_BYTE_SEEK AVInputFormat flag.
|
|
||||||
|
|
||||||
2011-10-12 - lavu 51.12.0
|
|
||||||
AVOptions API rewrite.
|
|
||||||
|
|
||||||
- 145f741 FF_OPT_TYPE* renamed to AV_OPT_TYPE_*
|
|
||||||
- new setting/getting functions with slightly different semantics:
|
|
||||||
dac66da av_set_string3 -> av_opt_set
|
|
||||||
av_set_double -> av_opt_set_double
|
|
||||||
av_set_q -> av_opt_set_q
|
|
||||||
av_set_int -> av_opt_set_int
|
|
||||||
|
|
||||||
41d9d51 av_get_string -> av_opt_get
|
|
||||||
av_get_double -> av_opt_get_double
|
|
||||||
av_get_q -> av_opt_get_q
|
|
||||||
av_get_int -> av_opt_get_int
|
|
||||||
|
|
||||||
- 8c5dcaa trivial rename av_next_option -> av_opt_next
|
|
||||||
- 641c7af new functions - av_opt_child_next, av_opt_child_class_next
|
|
||||||
and av_opt_find2()
|
|
||||||
|
|
||||||
2011-09-22 - a70e787 - lavu 51.17.0
|
|
||||||
Add av_x_if_null().
|
|
||||||
|
|
||||||
2011-09-18 - 645cebb - lavc 53.16.0
|
|
||||||
Add showall flag2
|
|
||||||
|
|
||||||
2011-09-16 - ea8de10 - lavfi 2.42.0
|
|
||||||
Add avfilter_all_channel_layouts.
|
|
||||||
|
|
||||||
2011-09-16 - 9899037 - lavfi 2.41.0
|
|
||||||
Rename avfilter_all_* function names to avfilter_make_all_*.
|
|
||||||
|
|
||||||
In particular, apply the renames:
|
|
||||||
avfilter_all_formats -> avfilter_make_all_formats
|
|
||||||
avfilter_all_channel_layouts -> avfilter_make_all_channel_layouts
|
|
||||||
avfilter_all_packing_formats -> avfilter_make_all_packing_formats
|
|
||||||
|
|
||||||
2011-09-12 - 4381bdd - lavfi 2.40.0
|
|
||||||
Change AVFilterBufferRefAudioProps.sample_rate type from uint32_t to int.
|
|
||||||
|
|
||||||
2011-09-12 - 2c03174 - lavfi 2.40.0
|
|
||||||
Simplify signature for avfilter_get_audio_buffer(), make it
|
|
||||||
consistent with avfilter_get_video_buffer().
|
|
||||||
|
|
||||||
2011-09-06 - 4f7dfe1 - lavfi 2.39.0
|
|
||||||
Rename libavfilter/vsink_buffer.h to libavfilter/buffersink.h.
|
|
||||||
|
|
||||||
2011-09-06 - c4415f6 - lavfi 2.38.0
|
|
||||||
Unify video and audio sink API.
|
|
||||||
|
|
||||||
In particular, add av_buffersink_get_buffer_ref(), deprecate
|
|
||||||
av_vsink_buffer_get_video_buffer_ref() and change the value for the
|
|
||||||
opaque field passed to the abuffersink init function.
|
|
||||||
|
|
||||||
2011-09-04 - 61e2e29 - lavu 51.16.0
|
|
||||||
Add av_asprintf().
|
|
||||||
|
|
||||||
2011-08-22 - dacd827 - lavf 53.10.0
|
|
||||||
Add av_find_program_from_stream().
|
|
||||||
|
|
||||||
2011-08-20 - 69e2c1a - lavu 51.13.0
|
|
||||||
Add av_get_media_type_string().
|
|
||||||
|
|
||||||
2011-09-03 - fb4ca26 - lavc 53.13.0
|
|
||||||
lavf 53.11.0
|
|
||||||
lsws 2.1.0
|
|
||||||
Add {avcodec,avformat,sws}_get_class().
|
|
||||||
|
|
||||||
2011-08-03 - c11fb82 - lavu 51.15.0
|
|
||||||
Add AV_OPT_SEARCH_FAKE_OBJ flag for av_opt_find() function.
|
|
||||||
|
|
||||||
2011-08-14 - 323b930 - lavu 51.12.0
|
|
||||||
Add av_fifo_peek2(), deprecate av_fifo_peek().
|
|
||||||
|
|
||||||
2011-08-26 - lavu 51.9.0
|
|
||||||
- add41de..abc78a5 Do not include intfloat_readwrite.h,
|
|
||||||
mathematics.h, rational.h, pixfmt.h, or log.h from avutil.h.
|
|
||||||
|
|
||||||
2011-08-16 - 48f9e45 - lavf 53.8.0
|
|
||||||
Add avformat_query_codec().
|
|
||||||
|
|
||||||
2011-08-16 - bca06e7 - lavc 53.11.0
|
|
||||||
Add avcodec_get_type().
|
|
||||||
|
|
||||||
2011-08-06 - 2f63440 - lavf 53.7.0
|
|
||||||
Add error_recognition to AVFormatContext.
|
|
||||||
|
|
||||||
2011-08-02 - 9d39cbf - lavc 53.9.1
|
|
||||||
Add AV_PKT_FLAG_CORRUPT AVPacket flag.
|
|
||||||
|
|
||||||
2011-07-16 - b57df29 - lavfi 2.27.0
|
|
||||||
Add audio packing negotiation fields and helper functions.
|
|
||||||
|
|
||||||
In particular, add AVFilterPacking enum, planar, in_packings and
|
|
||||||
out_packings fields to AVFilterLink, and the functions:
|
|
||||||
avfilter_set_common_packing_formats()
|
|
||||||
avfilter_all_packing_formats()
|
|
||||||
|
|
||||||
2011-07-10 - a67c061 - lavf 53.6.0
|
|
||||||
Add avformat_find_stream_info(), deprecate av_find_stream_info().
|
|
||||||
|
|
||||||
2011-07-10 - 0b950fe - lavc 53.8.0
|
|
||||||
Add avcodec_open2(), deprecate avcodec_open().
|
|
||||||
|
|
||||||
2011-07-01 - b442ca6 - lavf 53.5.0 - avformat.h
|
|
||||||
Add function av_get_output_timestamp().
|
|
||||||
|
|
||||||
2011-06-28 - 5129336 - lavu 51.11.0 - avutil.h
|
|
||||||
Define the AV_PICTURE_TYPE_NONE value in AVPictureType enum.
|
|
||||||
|
|
||||||
2011-06-19 - fd2c0a5 - lavfi 2.23.0 - avfilter.h
|
|
||||||
Add layout negotiation fields and helper functions.
|
Add layout negotiation fields and helper functions.
|
||||||
|
|
||||||
In particular, add in_chlayouts and out_chlayouts to AVFilterLink,
|
In particular, add in_chlayouts and out_chlayouts to AVFilterLink,
|
||||||
@@ -239,7 +22,7 @@ API changes, most recent first:
|
|||||||
avfilter_set_common_channel_layouts()
|
avfilter_set_common_channel_layouts()
|
||||||
avfilter_all_channel_layouts()
|
avfilter_all_channel_layouts()
|
||||||
|
|
||||||
2011-06-19 - 527ca39 - lavfi 2.22.0 - AVFilterFormats
|
2011-06-19 - xxxxxxx - lavfi 2.22.0 - AVFilterFormats
|
||||||
Change type of AVFilterFormats.formats from int * to int64_t *,
|
Change type of AVFilterFormats.formats from int * to int64_t *,
|
||||||
and update formats handling API accordingly.
|
and update formats handling API accordingly.
|
||||||
|
|
||||||
@@ -247,33 +30,30 @@ API changes, most recent first:
|
|||||||
it to int64_t. A new function, avfilter_make_format64_list(), that
|
it to int64_t. A new function, avfilter_make_format64_list(), that
|
||||||
takes int64_t arrays has been added.
|
takes int64_t arrays has been added.
|
||||||
|
|
||||||
2011-06-19 - 44f669e - lavfi 2.21.0 - vsink_buffer.h
|
2011-06-19 - xxxxxxx - lavfi 2.21.0 - vsink_buffer.h
|
||||||
Add video sink buffer and vsink_buffer.h public header.
|
Add video sink buffer and vsink_buffer.h public header.
|
||||||
|
|
||||||
2011-06-12 - 9fdf772 - lavfi 2.18.0 - avcodec.h
|
2011-06-12 - xxxxxxx - lavfi 2.18.0 - avcodec.h
|
||||||
Add avfilter_get_video_buffer_ref_from_frame() function in
|
Add avfilter_get_video_buffer_ref_from_frame() function in
|
||||||
libavfilter/avcodec.h.
|
libavfilter/avcodec.h.
|
||||||
|
|
||||||
2011-06-12 - c535494 - lavfi 2.17.0 - avfiltergraph.h
|
2011-06-12 - xxxxxxx - lavfi 2.17.0 - avfiltergraph.h
|
||||||
Add avfilter_inout_alloc() and avfilter_inout_free() functions.
|
Add avfilter_inout_alloc() and avfilter_inout_free() functions.
|
||||||
|
|
||||||
2011-06-12 - 6119b23 - lavfi 2.16.0 - avfilter_graph_parse()
|
2011-06-12 - xxxxxxx - lavfi 2.16.0 - avfilter_graph_parse()
|
||||||
Change avfilter_graph_parse() signature.
|
Change avfilter_graph_parse() signature.
|
||||||
|
|
||||||
2011-06-23 - 67e9ae1 - lavu 51.8.0 - attributes.h
|
2011-06-xx - xxxxxxx - lavf 53.2.0 - avformat.h
|
||||||
Add av_printf_format().
|
|
||||||
|
|
||||||
2011-06-16 - 05e84c9, 25de595 - lavf 53.2.0 - avformat.h
|
|
||||||
Add avformat_open_input and avformat_write_header().
|
Add avformat_open_input and avformat_write_header().
|
||||||
Deprecate av_open_input_stream, av_open_input_file,
|
Deprecate av_open_input_stream, av_open_input_file,
|
||||||
AVFormatParameters and av_write_header.
|
AVFormatParameters and av_write_header.
|
||||||
|
|
||||||
2011-06-16 - 7e83e1c, dc59ec5 - lavu 51.7.0 - opt.h
|
2011-06-xx - xxxxxxx - lavu 51.7.0 - opt.h
|
||||||
Add av_opt_set_dict() and av_opt_find().
|
Add av_opt_set_dict() and av_opt_find().
|
||||||
Deprecate av_find_opt().
|
Deprecate av_find_opt().
|
||||||
Add AV_DICT_APPEND flag.
|
Add AV_DICT_APPEND flag.
|
||||||
|
|
||||||
2011-06-10 - cb7c11c - lavu 51.6.0 - opt.h
|
2011-06-xx - xxxxxxx - lavu 51.6.0 - opt.h
|
||||||
Add av_opt_flag_is_set().
|
Add av_opt_flag_is_set().
|
||||||
|
|
||||||
2011-06-10 - c381960 - lavfi 2.15.0 - avfilter_get_audio_buffer_ref_from_arrays
|
2011-06-10 - c381960 - lavfi 2.15.0 - avfilter_get_audio_buffer_ref_from_arrays
|
||||||
@@ -288,7 +68,7 @@ API changes, most recent first:
|
|||||||
Add av_get_bytes_per_sample() in libavutil/samplefmt.h.
|
Add av_get_bytes_per_sample() in libavutil/samplefmt.h.
|
||||||
Deprecate av_get_bits_per_sample_fmt().
|
Deprecate av_get_bits_per_sample_fmt().
|
||||||
|
|
||||||
2011-06-05 - b39b062 - lavu 51.8.0 - opt.h
|
2011-06-xx - b39b062 - lavu 51.8.0 - opt.h
|
||||||
Add av_opt_free convenience function.
|
Add av_opt_free convenience function.
|
||||||
|
|
||||||
2011-06-06 - 95a0242 - lavfi 2.14.0 - AVFilterBufferRefAudioProps
|
2011-06-06 - 95a0242 - lavfi 2.14.0 - AVFilterBufferRefAudioProps
|
||||||
@@ -442,6 +222,7 @@ API changes, most recent first:
|
|||||||
d9d86e0 rename url_fprintf -> avio_printf
|
d9d86e0 rename url_fprintf -> avio_printf
|
||||||
59f65d9 deprecate url_setbufsize
|
59f65d9 deprecate url_setbufsize
|
||||||
3e68b3b deprecate url_ferror
|
3e68b3b deprecate url_ferror
|
||||||
|
66e5b1d deprecate url_feof
|
||||||
e8bb2e2 deprecate url_fget_max_packet_size
|
e8bb2e2 deprecate url_fget_max_packet_size
|
||||||
76aa876 rename url_fsize -> avio_size
|
76aa876 rename url_fsize -> avio_size
|
||||||
e519753 deprecate url_fgetc
|
e519753 deprecate url_fgetc
|
||||||
|
|||||||
64
doc/Makefile
64
doc/Makefile
@@ -1,64 +0,0 @@
|
|||||||
MANPAGES = $(PROGS-yes:%=doc/%.1)
|
|
||||||
PODPAGES = $(PROGS-yes:%=doc/%.pod)
|
|
||||||
HTMLPAGES = $(PROGS-yes:%=doc/%.html) \
|
|
||||||
doc/developer.html \
|
|
||||||
doc/faq.html \
|
|
||||||
doc/fate.html \
|
|
||||||
doc/general.html \
|
|
||||||
doc/git-howto.html \
|
|
||||||
doc/libavfilter.html \
|
|
||||||
doc/platform.html \
|
|
||||||
|
|
||||||
TXTPAGES = doc/fate.txt \
|
|
||||||
|
|
||||||
|
|
||||||
DOCS = $(HTMLPAGES) $(MANPAGES) $(PODPAGES)
|
|
||||||
ifdef HAVE_MAKEINFO
|
|
||||||
DOCS += $(TXTPAGES)
|
|
||||||
endif
|
|
||||||
|
|
||||||
all-$(CONFIG_DOC): documentation
|
|
||||||
|
|
||||||
documentation: $(DOCS)
|
|
||||||
|
|
||||||
TEXIDEP = awk '/^@(verbatim)?include/ { printf "$@: $(@D)/%s\n", $$2 }' <$< >$(@:%=%.d)
|
|
||||||
|
|
||||||
doc/%.txt: TAG = TXT
|
|
||||||
doc/%.txt: doc/%.texi
|
|
||||||
$(Q)$(TEXIDEP)
|
|
||||||
$(M)makeinfo --force --no-headers -o $@ $< 2>/dev/null
|
|
||||||
|
|
||||||
doc/%.html: TAG = HTML
|
|
||||||
doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init
|
|
||||||
$(Q)$(TEXIDEP)
|
|
||||||
$(M)texi2html -monolithic --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
|
|
||||||
|
|
||||||
doc/%.pod: TAG = POD
|
|
||||||
doc/%.pod: doc/%.texi
|
|
||||||
$(Q)$(TEXIDEP)
|
|
||||||
$(M)$(SRC_PATH)/doc/texi2pod.pl $< $@
|
|
||||||
|
|
||||||
doc/%.1: TAG = MAN
|
|
||||||
doc/%.1: doc/%.pod
|
|
||||||
$(M)pod2man --section=1 --center=" " --release=" " $< > $@
|
|
||||||
|
|
||||||
$(DOCS): | doc
|
|
||||||
OBJDIRS += doc
|
|
||||||
|
|
||||||
install-progs-$(CONFIG_DOC): install-man
|
|
||||||
|
|
||||||
install-man: $(MANPAGES)
|
|
||||||
$(Q)mkdir -p "$(MANDIR)/man1"
|
|
||||||
$(INSTALL) -m 644 $(MANPAGES) "$(MANDIR)/man1"
|
|
||||||
|
|
||||||
uninstall: uninstall-man
|
|
||||||
|
|
||||||
uninstall-man:
|
|
||||||
$(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
|
|
||||||
|
|
||||||
clean::
|
|
||||||
$(RM) $(TXTPAGES) doc/*.html doc/*.pod doc/*.1 $(CLEANSUFFIXES:%=doc/%)
|
|
||||||
|
|
||||||
-include $(wildcard $(DOCS:%=%.d))
|
|
||||||
|
|
||||||
.PHONY: documentation
|
|
||||||
@@ -1,15 +1,28 @@
|
|||||||
Release Notes
|
Release Notes
|
||||||
=============
|
=============
|
||||||
|
|
||||||
* 0.10 "Freedom" January, 2012
|
* 0.8 "Love" June, 2011
|
||||||
|
* 0.7.1 "Peace" June, 2011 (identical to 0.8 but using 0.6 ABI/API)
|
||||||
|
|
||||||
|
|
||||||
General notes
|
General notes
|
||||||
-------------
|
-------------
|
||||||
This release is binary compatible with 0.8 and 0.9.
|
|
||||||
|
|
||||||
See the Changelog file for a list of significant changes. Note, there
|
This release enables frame-based multithreaded decoding for a number of codecs,
|
||||||
are many more new features and bugfixes than whats listed there.
|
including theora, huffyuv, VP8, H.263, mpeg4 and H.264. Additionally, there has
|
||||||
|
been a major cleanup of
|
||||||
|
both internal and external APIs. For this reason, the major versions of all
|
||||||
|
libraries except libpostproc have been bumped. This means that 0.8 can be installed
|
||||||
|
side-by-side with previous releases, on the other hand applications need to be
|
||||||
|
recompiled to use 0.8.
|
||||||
|
|
||||||
|
Other important changes are more than 200 bugfixes, known regressions were fixed
|
||||||
|
w.r.t 0.5 and 0.6, additions of decoders including, but not limited to,
|
||||||
|
AMR-WB, single stream LATM/LOAS, G.722 ADPCM, a native VP8 decoder
|
||||||
|
and HE-AACv2. Additionally, many new de/muxers such as WebM in Matroska, Apple
|
||||||
|
HTTP Live Streaming, SAP, IEC 61937 (S/PDIF) have been added.
|
||||||
|
|
||||||
|
See the Changelog file for a list of significant changes.
|
||||||
|
|
||||||
Bugreports against FFmpeg git master or the most recent FFmpeg release are
|
Bugreports against FFmpeg git master or the most recent FFmpeg release are
|
||||||
accepted. If you are experiencing issues with any formally released version of
|
accepted. If you are experiencing issues with any formally released version of
|
||||||
@@ -17,33 +30,36 @@ FFmpeg, please try git master to check if the issue still exists. If it does,
|
|||||||
make your report against the development code following the usual bug reporting
|
make your report against the development code following the usual bug reporting
|
||||||
guidelines.
|
guidelines.
|
||||||
|
|
||||||
|
Note, if you have difficulty building for mingw, try --disable-outdev=sdl
|
||||||
|
|
||||||
|
|
||||||
API changes
|
API changes
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
A number of additional APIs have been introduced and some existing
|
Please see git log of the public headers or the file doc/APIchanges for
|
||||||
functions have been deprecated and are scheduled for removal in the next
|
programmer-centric information. Note that some long-time deprecated APIs have
|
||||||
release. Significant API changes include:
|
been removed. Also, a number of additional APIs have been deprecated and might
|
||||||
|
be removed in the next release.
|
||||||
* new audio decoding API which decodes from an AVPacket to an AVFrame and
|
|
||||||
is able to use AVCodecContext.get_buffer() in the similar way as video decoding.
|
|
||||||
|
|
||||||
* new audio encoding API which encodes from an AVFrame to an AVPacket, thus
|
|
||||||
allowing it to properly output timing information and side data.
|
|
||||||
|
|
||||||
Please see the git history and the file doc/APIchanges for details.
|
|
||||||
|
|
||||||
|
|
||||||
Other notable changes
|
Other notable changes
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
Libavcodec and libavformat built as shared libraries now hide non-public
|
- high quality dithering in swscale to fix banding issues
|
||||||
symbols. This will break applications using those symbols. Possible solutions
|
- ffmpeg is now interactive and various information can be turned on/off while its running
|
||||||
are, in order of preference:
|
- resolution changing support in ffmpeg
|
||||||
1) Try finding a way of accomplishing the same with public API.
|
- sdl output device
|
||||||
2) If there is no corresponding public API, but you think there should be,
|
- optimizations in libavfilter that make it much faster
|
||||||
post a request on the developer mailing list or IRC channel.
|
- split, buffer, select, lut, negate filters amongth others
|
||||||
3) Finally if your program needs access to FFmpeg / libavcodec / libavformat
|
- more than 50 new video filters from mplayers libmpcodecs
|
||||||
internals for some special reason then the best solution is to link statically.
|
- many ARM NEON optimizations
|
||||||
|
- nonfree libfaad support for AAC decoding removed
|
||||||
Please see the Changelog file and git history for a more detailed list of changes.
|
- 4:4:4 H.264 decoding
|
||||||
|
- 9/10bit H.264 decoding
|
||||||
|
- Win64 Assembler support
|
||||||
|
- native MMSH/MMST support
|
||||||
|
- Windows TV demuxing
|
||||||
|
- native AMR-WB decoding
|
||||||
|
- native GSM-MS decoding
|
||||||
|
- SMPTE 302M decoding
|
||||||
|
- AVS encoding
|
||||||
|
|||||||
82
doc/TODO
Normal file
82
doc/TODO
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
ffmpeg TODO list:
|
||||||
|
----------------
|
||||||
|
|
||||||
|
Fabrice's TODO list: (unordered)
|
||||||
|
-------------------
|
||||||
|
Short term:
|
||||||
|
|
||||||
|
- use AVFMTCTX_DISCARD_PKT in ffplay so that DV has a chance to work
|
||||||
|
- add RTSP regression test (both client and server)
|
||||||
|
- make ffserver allocate AVFormatContext
|
||||||
|
- clean up (incompatible change, for 0.5.0):
|
||||||
|
* AVStream -> AVComponent
|
||||||
|
* AVFormatContext -> AVInputStream/AVOutputStream
|
||||||
|
* suppress rate_emu from AVCodecContext
|
||||||
|
- add new float/integer audio filterting and conversion : suppress
|
||||||
|
CODEC_ID_PCM_xxc and use CODEC_ID_RAWAUDIO.
|
||||||
|
- fix telecine and frame rate conversion
|
||||||
|
|
||||||
|
Long term (ask me if you want to help):
|
||||||
|
|
||||||
|
- commit new imgconvert API and new PIX_FMT_xxx alpha formats
|
||||||
|
- commit new LGPL'ed float and integer-only AC3 decoder
|
||||||
|
- add WMA integer-only decoder
|
||||||
|
- add new MPEG4-AAC audio decoder (both integer-only and float version)
|
||||||
|
|
||||||
|
Michael's TODO list: (unordered) (if anyone wanna help with sth, just ask)
|
||||||
|
-------------------
|
||||||
|
- optimize H264 CABAC
|
||||||
|
- more optimizations
|
||||||
|
- simper rate control
|
||||||
|
|
||||||
|
Philip'a TODO list: (alphabetically ordered) (please help)
|
||||||
|
------------------
|
||||||
|
- Add a multi-ffm filetype so that feeds can be recorded into multiple files rather
|
||||||
|
than one big file.
|
||||||
|
- Authenticated users support -- where the authentication is in the URL
|
||||||
|
- Change ASF files so that the embedded timestamp in the frames is right rather
|
||||||
|
than being an offset from the start of the stream
|
||||||
|
- Make ffm files more resilient to changes in the codec structures so that you
|
||||||
|
can play old ffm files.
|
||||||
|
|
||||||
|
Baptiste's TODO list:
|
||||||
|
-----------------
|
||||||
|
- mov edit list support (AVEditList)
|
||||||
|
- YUV 10 bit per component support "2vuy"
|
||||||
|
- mxf muxer
|
||||||
|
- mpeg2 non linear quantizer
|
||||||
|
|
||||||
|
unassigned TODO: (unordered)
|
||||||
|
---------------
|
||||||
|
- use AVFrame for audio codecs too
|
||||||
|
- rework aviobuf.c buffering strategy and fix url_fskip
|
||||||
|
- generate optimal huffman tables for mjpeg encoding
|
||||||
|
- fix ffserver regression tests
|
||||||
|
- support xvids motion estimation
|
||||||
|
- support x264s motion estimation
|
||||||
|
- support x264s rate control
|
||||||
|
- SNOW: non translational motion compensation
|
||||||
|
- SNOW: more optimal quantization
|
||||||
|
- SNOW: 4x4 block support
|
||||||
|
- SNOW: 1/8 pel motion compensation support
|
||||||
|
- SNOW: iterative motion estimation based on subsampled images
|
||||||
|
- SNOW: try B frames and MCTF and see how their PSNR/bitrate/complexity behaves
|
||||||
|
- SNOW: try to use the wavelet transformed MC-ed reference frame as context for the entropy coder
|
||||||
|
- SNOW: think about/analyize how to make snow use multiple cpus/threads
|
||||||
|
- SNOW: finish spec
|
||||||
|
- FLAC: lossy encoding (viterbi and naive scalar quantization)
|
||||||
|
- libavfilter
|
||||||
|
- JPEG2000 decoder & encoder
|
||||||
|
- MPEG4 GMC encoding support
|
||||||
|
- macroblock based pixel format (better cache locality, somewhat complex, one paper claimed it faster for high res)
|
||||||
|
- regression tests for codecs which do not have an encoder (I+P-frame bitstream in the 'master' branch)
|
||||||
|
- add support for using mplayers video filters to ffmpeg
|
||||||
|
- H264 encoder
|
||||||
|
- per MB ratecontrol (so VCD and such do work better)
|
||||||
|
- write a script which iteratively changes all functions between always_inline and noinline and benchmarks the result to find the best set of inlined functions
|
||||||
|
- convert all the non SIMD asm into small asm vs. C testcases and submit them to the gcc devels so they can improve gcc
|
||||||
|
- generic audio mixing API
|
||||||
|
- extract PES packetizer from PS muxer and use it for new TS muxer
|
||||||
|
- implement automatic AVBistreamFilter activation
|
||||||
|
- make cabac encoder use bytestream (see http://trac.videolan.org/x264/changeset/?format=diff&new=651)
|
||||||
|
- merge imdct and windowing, the current code does considerable amounts of redundant work
|
||||||
@@ -1,168 +0,0 @@
|
|||||||
All the numerical options, if not specified otherwise, accept in input
|
|
||||||
a string representing a number, which may contain one of the
|
|
||||||
International System number postfixes, for example 'K', 'M', 'G'.
|
|
||||||
If 'i' is appended after the postfix, powers of 2 are used instead of
|
|
||||||
powers of 10. The 'B' postfix multiplies the value for 8, and can be
|
|
||||||
appended after another postfix or used alone. This allows using for
|
|
||||||
example 'KB', 'MiB', 'G' and 'B' as postfix.
|
|
||||||
|
|
||||||
Options which do not take arguments are boolean options, and set the
|
|
||||||
corresponding value to true. They can be set to false by prefixing
|
|
||||||
with "no" the option name, for example using "-nofoo" in the
|
|
||||||
command line will set to false the boolean option with name "foo".
|
|
||||||
|
|
||||||
@anchor{Stream specifiers}
|
|
||||||
@section Stream specifiers
|
|
||||||
Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers
|
|
||||||
are used to precisely specify which stream(s) does a given option belong to.
|
|
||||||
|
|
||||||
A stream specifier is a string generally appended to the option name and
|
|
||||||
separated from it by a colon. E.g. @code{-codec:a:1 ac3} option contains
|
|
||||||
@code{a:1} stream specifer, which matches the second audio stream. Therefore it
|
|
||||||
would select the ac3 codec for the second audio stream.
|
|
||||||
|
|
||||||
A stream specifier can match several stream, the option is then applied to all
|
|
||||||
of them. E.g. the stream specifier in @code{-b:a 128k} matches all audio
|
|
||||||
streams.
|
|
||||||
|
|
||||||
An empty stream specifier matches all streams, for example @code{-codec copy}
|
|
||||||
or @code{-codec: copy} would copy all the streams without reencoding.
|
|
||||||
|
|
||||||
Possible forms of stream specifiers are:
|
|
||||||
@table @option
|
|
||||||
@item @var{stream_index}
|
|
||||||
Matches the stream with this index. E.g. @code{-threads:1 4} would set the
|
|
||||||
thread count for the second stream to 4.
|
|
||||||
@item @var{stream_type}[:@var{stream_index}]
|
|
||||||
@var{stream_type} is one of: 'v' for video, 'a' for audio, 's' for subtitle,
|
|
||||||
'd' for data and 't' for attachments. If @var{stream_index} is given, then
|
|
||||||
matches stream number @var{stream_index} of this type. Otherwise matches all
|
|
||||||
streams of this type.
|
|
||||||
@item p:@var{program_id}[:@var{stream_index}]
|
|
||||||
If @var{stream_index} is given, then matches stream number @var{stream_index} in
|
|
||||||
program with id @var{program_id}. Otherwise matches all streams in this program.
|
|
||||||
@end table
|
|
||||||
@section Generic options
|
|
||||||
|
|
||||||
These options are shared amongst the av* tools.
|
|
||||||
|
|
||||||
@table @option
|
|
||||||
|
|
||||||
@item -L
|
|
||||||
Show license.
|
|
||||||
|
|
||||||
@item -h, -?, -help, --help
|
|
||||||
Show help.
|
|
||||||
|
|
||||||
@item -version
|
|
||||||
Show version.
|
|
||||||
|
|
||||||
@item -formats
|
|
||||||
Show available formats.
|
|
||||||
|
|
||||||
The fields preceding the format names have the following meanings:
|
|
||||||
@table @samp
|
|
||||||
@item D
|
|
||||||
Decoding available
|
|
||||||
@item E
|
|
||||||
Encoding available
|
|
||||||
@end table
|
|
||||||
|
|
||||||
@item -codecs
|
|
||||||
Show available codecs.
|
|
||||||
|
|
||||||
The fields preceding the codec names have the following meanings:
|
|
||||||
@table @samp
|
|
||||||
@item D
|
|
||||||
Decoding available
|
|
||||||
@item E
|
|
||||||
Encoding available
|
|
||||||
@item V/A/S
|
|
||||||
Video/audio/subtitle codec
|
|
||||||
@item S
|
|
||||||
Codec supports slices
|
|
||||||
@item D
|
|
||||||
Codec supports direct rendering
|
|
||||||
@item T
|
|
||||||
Codec can handle input truncated at random locations instead of only at frame boundaries
|
|
||||||
@end table
|
|
||||||
|
|
||||||
@item -bsfs
|
|
||||||
Show available bitstream filters.
|
|
||||||
|
|
||||||
@item -protocols
|
|
||||||
Show available protocols.
|
|
||||||
|
|
||||||
@item -filters
|
|
||||||
Show available libavfilter filters.
|
|
||||||
|
|
||||||
@item -pix_fmts
|
|
||||||
Show available pixel formats.
|
|
||||||
|
|
||||||
@item -sample_fmts
|
|
||||||
Show available sample formats.
|
|
||||||
|
|
||||||
@item -loglevel @var{loglevel} | -v @var{loglevel}
|
|
||||||
Set the logging level used by the library.
|
|
||||||
@var{loglevel} is a number or a string containing one of the following values:
|
|
||||||
@table @samp
|
|
||||||
@item quiet
|
|
||||||
@item panic
|
|
||||||
@item fatal
|
|
||||||
@item error
|
|
||||||
@item warning
|
|
||||||
@item info
|
|
||||||
@item verbose
|
|
||||||
@item debug
|
|
||||||
@end table
|
|
||||||
|
|
||||||
By default the program logs to stderr, if coloring is supported by the
|
|
||||||
terminal, colors are used to mark errors and warnings. Log coloring
|
|
||||||
can be disabled setting the environment variable
|
|
||||||
@env{AV_LOG_FORCE_NOCOLOR} or @env{NO_COLOR}, or can be forced setting
|
|
||||||
the environment variable @env{AV_LOG_FORCE_COLOR}.
|
|
||||||
The use of the environment variable @env{NO_COLOR} is deprecated and
|
|
||||||
will be dropped in a following FFmpeg version.
|
|
||||||
|
|
||||||
@item -report
|
|
||||||
Dump full command line and console output to a file named
|
|
||||||
@code{@var{program}-@var{YYYYMMDD}-@var{HHMMSS}.log} in the current
|
|
||||||
directory.
|
|
||||||
This file can be useful for bug reports.
|
|
||||||
It also implies @code{-loglevel verbose}.
|
|
||||||
|
|
||||||
Note: setting the environment variable @code{FFREPORT} to any value has the
|
|
||||||
same effect.
|
|
||||||
|
|
||||||
@end table
|
|
||||||
|
|
||||||
@section AVOptions
|
|
||||||
|
|
||||||
These options are provided directly by the libavformat, libavdevice and
|
|
||||||
libavcodec libraries. To see the list of available AVOptions, use the
|
|
||||||
@option{-help} option. They are separated into two categories:
|
|
||||||
@table @option
|
|
||||||
@item generic
|
|
||||||
These options can be set for any container, codec or device. Generic options
|
|
||||||
are listed under AVFormatContext options for containers/devices and under
|
|
||||||
AVCodecContext options for codecs.
|
|
||||||
@item private
|
|
||||||
These options are specific to the given container, device or codec. Private
|
|
||||||
options are listed under their corresponding containers/devices/codecs.
|
|
||||||
@end table
|
|
||||||
|
|
||||||
For example to write an ID3v2.3 header instead of a default ID3v2.4 to
|
|
||||||
an MP3 file, use the @option{id3v2_version} private option of the MP3
|
|
||||||
muxer:
|
|
||||||
@example
|
|
||||||
ffmpeg -i input.flac -id3v2_version 3 out.mp3
|
|
||||||
@end example
|
|
||||||
|
|
||||||
All codec AVOptions are obviously per-stream, so the chapter on stream
|
|
||||||
specifiers applies to them
|
|
||||||
|
|
||||||
Note @option{-nooption} syntax cannot be used for boolean AVOptions,
|
|
||||||
use @option{-option 0}/@option{-option 1}.
|
|
||||||
|
|
||||||
Note2 old undocumented way of specifying per-stream AVOptions by prepending
|
|
||||||
v/a/s to the options name is now obsolete and will be removed soon.
|
|
||||||
@@ -23,20 +23,6 @@ Below is a description of the currently available bitstream filters.
|
|||||||
|
|
||||||
@section h264_mp4toannexb
|
@section h264_mp4toannexb
|
||||||
|
|
||||||
Convert an H.264 bitstream from length prefixed mode to start code
|
|
||||||
prefixed mode (as defined in the Annex B of the ITU-T H.264
|
|
||||||
specification).
|
|
||||||
|
|
||||||
This is required by some streaming formats, typically the MPEG-2
|
|
||||||
transport stream format ("mpegts").
|
|
||||||
|
|
||||||
For example to remux an MP4 file containing an H.264 stream to mpegts
|
|
||||||
format with @command{ffmpeg}, you can use the command:
|
|
||||||
|
|
||||||
@example
|
|
||||||
ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
|
|
||||||
@end example
|
|
||||||
|
|
||||||
@section imx_dump_header
|
@section imx_dump_header
|
||||||
|
|
||||||
@section mjpeg2jpeg
|
@section mjpeg2jpeg
|
||||||
@@ -48,7 +34,7 @@ JPEG image. The individual frames can be extracted without loss,
|
|||||||
e.g. by
|
e.g. by
|
||||||
|
|
||||||
@example
|
@example
|
||||||
ffmpeg -i ../some_mjpeg.avi -c:v copy frames_%d.jpg
|
ffmpeg -i ../some_mjpeg.avi -vcodec copy frames_%d.jpg
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
Unfortunately, these chunks are incomplete JPEG images, because
|
Unfortunately, these chunks are incomplete JPEG images, because
|
||||||
@@ -71,9 +57,9 @@ stream (carrying the AVI1 header ID and lacking a DHT segment) to
|
|||||||
produce fully qualified JPEG images.
|
produce fully qualified JPEG images.
|
||||||
|
|
||||||
@example
|
@example
|
||||||
ffmpeg -i mjpeg-movie.avi -c:v copy -vbsf mjpeg2jpeg frame_%d.jpg
|
ffmpeg -i mjpeg-movie.avi -vcodec copy -vbsf mjpeg2jpeg frame_%d.jpg
|
||||||
exiftran -i -9 frame*.jpg
|
exiftran -i -9 frame*.jpg
|
||||||
ffmpeg -i frame_%d.jpg -c:v copy rotated.avi
|
ffmpeg -i frame_%d.jpg -vcodec copy rotated.avi
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
@section mjpega_dump_header
|
@section mjpega_dump_header
|
||||||
|
|||||||
@@ -48,16 +48,3 @@ top-field-first is assumed
|
|||||||
@end table
|
@end table
|
||||||
|
|
||||||
@c man end VIDEO DECODERS
|
@c man end VIDEO DECODERS
|
||||||
|
|
||||||
@chapter Audio Decoders
|
|
||||||
@c man begin AUDIO DECODERS
|
|
||||||
|
|
||||||
@section ffwavesynth
|
|
||||||
|
|
||||||
Internal wave synthetizer.
|
|
||||||
|
|
||||||
This decoder generates wave patterns according to predefined sequences. Its
|
|
||||||
use is purely internal and the format of the data it accepts is not publicly
|
|
||||||
documented.
|
|
||||||
|
|
||||||
@c man end AUDIO DECODERS
|
|
||||||
|
|||||||
@@ -49,19 +49,19 @@ sequence of filenames of the form @file{i%m%g-1.jpg},
|
|||||||
The size, the pixel format, and the format of each image must be the
|
The size, the pixel format, and the format of each image must be the
|
||||||
same for all the files in the sequence.
|
same for all the files in the sequence.
|
||||||
|
|
||||||
The following example shows how to use @command{ffmpeg} for creating a
|
The following example shows how to use @file{ffmpeg} for creating a
|
||||||
video from the images in the file sequence @file{img-001.jpeg},
|
video from the images in the file sequence @file{img-001.jpeg},
|
||||||
@file{img-002.jpeg}, ..., assuming an input framerate of 10 frames per
|
@file{img-002.jpeg}, ..., assuming an input framerate of 10 frames per
|
||||||
second:
|
second:
|
||||||
@example
|
@example
|
||||||
ffmpeg -i 'img-%03d.jpeg' -r 10 out.mkv
|
ffmpeg -r 10 -f image2 -i 'img-%03d.jpeg' out.avi
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
Note that the pattern must not necessarily contain "%d" or
|
Note that the pattern must not necessarily contain "%d" or
|
||||||
"%0@var{N}d", for example to convert a single image file
|
"%0@var{N}d", for example to convert a single image file
|
||||||
@file{img.jpeg} you can employ the command:
|
@file{img.jpeg} you can employ the command:
|
||||||
@example
|
@example
|
||||||
ffmpeg -i img.jpeg img.png
|
ffmpeg -f image2 -i img.jpeg img.png
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
@section applehttp
|
@section applehttp
|
||||||
@@ -75,34 +75,4 @@ the caller can decide which variant streams to actually receive.
|
|||||||
The total bitrate of the variant that the stream belongs to is
|
The total bitrate of the variant that the stream belongs to is
|
||||||
available in a metadata key named "variant_bitrate".
|
available in a metadata key named "variant_bitrate".
|
||||||
|
|
||||||
@section sbg
|
|
||||||
|
|
||||||
SBaGen script demuxer.
|
|
||||||
|
|
||||||
This demuxer reads the script language used by SBaGen
|
|
||||||
@url{http://uazu.net/sbagen/} to generate binaural beats sessions. A SBG
|
|
||||||
script looks like that:
|
|
||||||
@example
|
|
||||||
-SE
|
|
||||||
a: 300-2.5/3 440+4.5/0
|
|
||||||
b: 300-2.5/0 440+4.5/3
|
|
||||||
off: -
|
|
||||||
NOW == a
|
|
||||||
+0:07:00 == b
|
|
||||||
+0:14:00 == a
|
|
||||||
+0:21:00 == b
|
|
||||||
+0:30:00 off
|
|
||||||
@end example
|
|
||||||
|
|
||||||
A SBG script can mix absolute and relative timestamps. If the script uses
|
|
||||||
either only absolute timestamps (including the script start time) or only
|
|
||||||
relative ones, then its layout is fixed, and the conversion is
|
|
||||||
straightforward. On the other hand, if the script mixes both kind of
|
|
||||||
timestamps, then the @var{NOW} reference for relative timestamps will be
|
|
||||||
taken from the current time of day at the time the script is read, and the
|
|
||||||
script layout will be frozen according to that reference. That means that if
|
|
||||||
the script is directly played, the actual times will match the absolute
|
|
||||||
timestamps up to the sound controller's clock accuracy, but if the user
|
|
||||||
somehow pauses the playback or seeks, all times will be shifted accordingly.
|
|
||||||
|
|
||||||
@c man end INPUT DEVICES
|
@c man end INPUT DEVICES
|
||||||
|
|||||||
@@ -34,86 +34,9 @@ You can use libavcodec or libavformat in your commercial program, but
|
|||||||
@emph{any patch you make must be published}. The best way to proceed is
|
@emph{any patch you make must be published}. The best way to proceed is
|
||||||
to send your patches to the FFmpeg mailing list.
|
to send your patches to the FFmpeg mailing list.
|
||||||
|
|
||||||
@section Contributing
|
|
||||||
|
|
||||||
There are 3 ways by which code gets into ffmpeg.
|
|
||||||
@itemize @bullet
|
|
||||||
@item Submitting Patches to the main developer mailing list
|
|
||||||
see @ref{Submitting patches} for details.
|
|
||||||
@item Directly committing changes to the main tree.
|
|
||||||
@item Committing changes to a git clone, for example on github.com or
|
|
||||||
gitorious.org. And asking us to merge these changes.
|
|
||||||
@end itemize
|
|
||||||
|
|
||||||
Whichever way, changes should be reviewed by the maintainer of the code
|
|
||||||
before they are committed. And they should follow the @ref{Coding Rules}.
|
|
||||||
The developer making the commit and the author are responsible for their changes
|
|
||||||
and should try to fix issues their commit causes.
|
|
||||||
|
|
||||||
@anchor{Coding Rules}
|
@anchor{Coding Rules}
|
||||||
@section Coding Rules
|
@section Coding Rules
|
||||||
|
|
||||||
@subsection Code formatting conventions
|
|
||||||
|
|
||||||
There are the following guidelines regarding the indentation in files:
|
|
||||||
@itemize @bullet
|
|
||||||
@item
|
|
||||||
Indent size is 4.
|
|
||||||
@item
|
|
||||||
The TAB character is forbidden outside of Makefiles as is any
|
|
||||||
form of trailing whitespace. Commits containing either will be
|
|
||||||
rejected by the git repository.
|
|
||||||
@item
|
|
||||||
You should try to limit your code lines to 80 characters; however, do so if
|
|
||||||
and only if this improves readability.
|
|
||||||
@end itemize
|
|
||||||
The presentation is one inspired by 'indent -i4 -kr -nut'.
|
|
||||||
|
|
||||||
The main priority in FFmpeg is simplicity and small code size in order to
|
|
||||||
minimize the bug count.
|
|
||||||
|
|
||||||
@subsection Comments
|
|
||||||
Use the JavaDoc/Doxygen format (see examples below) so that code documentation
|
|
||||||
can be generated automatically. All nontrivial functions should have a comment
|
|
||||||
above them explaining what the function does, even if it is just one sentence.
|
|
||||||
All structures and their member variables should be documented, too.
|
|
||||||
|
|
||||||
Avoid Qt-style and similar Doxygen syntax with @code{!} in it, i.e. replace
|
|
||||||
@code{//!} with @code{///} and similar. Also @@ syntax should be employed
|
|
||||||
for markup commands, i.e. use @code{@@param} and not @code{\param}.
|
|
||||||
|
|
||||||
@example
|
|
||||||
/**
|
|
||||||
* @@file
|
|
||||||
* MPEG codec.
|
|
||||||
* @@author ...
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Summary sentence.
|
|
||||||
* more text ...
|
|
||||||
* ...
|
|
||||||
*/
|
|
||||||
typedef struct Foobar@{
|
|
||||||
int var1; /**< var1 description */
|
|
||||||
int var2; ///< var2 description
|
|
||||||
/** var3 description */
|
|
||||||
int var3;
|
|
||||||
@} Foobar;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Summary sentence.
|
|
||||||
* more text ...
|
|
||||||
* ...
|
|
||||||
* @@param my_parameter description of my_parameter
|
|
||||||
* @@return return value description
|
|
||||||
*/
|
|
||||||
int myfunc(int my_parameter)
|
|
||||||
...
|
|
||||||
@end example
|
|
||||||
|
|
||||||
@subsection C language features
|
|
||||||
|
|
||||||
FFmpeg is programmed in the ISO C90 language with a few additional
|
FFmpeg is programmed in the ISO C90 language with a few additional
|
||||||
features from ISO C99, namely:
|
features from ISO C99, namely:
|
||||||
@itemize @bullet
|
@itemize @bullet
|
||||||
@@ -145,64 +68,55 @@ mixing statements and declarations;
|
|||||||
GCC statement expressions (@samp{(x = (@{ int y = 4; y; @})}).
|
GCC statement expressions (@samp{(x = (@{ int y = 4; y; @})}).
|
||||||
@end itemize
|
@end itemize
|
||||||
|
|
||||||
@subsection Naming conventions
|
Indent size is 4.
|
||||||
All names are using underscores (_), not CamelCase. For example, @samp{avfilter_get_video_buffer} is
|
The presentation is one inspired by 'indent -i4 -kr -nut'.
|
||||||
a valid function name and @samp{AVFilterGetVideo} is not. The exception from this are type names, like
|
The TAB character is forbidden outside of Makefiles as is any
|
||||||
for example structs and enums; they should always be in the CamelCase
|
form of trailing whitespace. Commits containing either will be
|
||||||
|
rejected by the git repository.
|
||||||
|
|
||||||
|
The main priority in FFmpeg is simplicity and small code size in order to
|
||||||
|
minimize the bug count.
|
||||||
|
|
||||||
There are following conventions for naming variables and functions:
|
Comments: Use the JavaDoc/Doxygen
|
||||||
@itemize @bullet
|
format (see examples below) so that code documentation
|
||||||
@item
|
can be generated automatically. All nontrivial functions should have a comment
|
||||||
For local variables no prefix is required.
|
above them explaining what the function does, even if it is just one sentence.
|
||||||
@item
|
All structures and their member variables should be documented, too.
|
||||||
For variables and functions declared as @code{static} no prefixes are required.
|
@example
|
||||||
@item
|
/**
|
||||||
For variables and functions used internally by the library, @code{ff_} prefix
|
* @@file mpeg.c
|
||||||
should be used.
|
* MPEG codec.
|
||||||
For example, @samp{ff_w64_demuxer}.
|
* @@author ...
|
||||||
@item
|
*/
|
||||||
For variables and functions used internally across multiple libraries, use
|
|
||||||
@code{avpriv_}. For example, @samp{avpriv_aac_parse_header}.
|
/**
|
||||||
@item
|
* Summary sentence.
|
||||||
For exported names, each library has its own prefixes. Just check the existing
|
* more text ...
|
||||||
code and name accordingly.
|
* ...
|
||||||
@end itemize
|
*/
|
||||||
|
typedef struct Foobar@{
|
||||||
|
int var1; /**< var1 description */
|
||||||
|
int var2; ///< var2 description
|
||||||
|
/** var3 description */
|
||||||
|
int var3;
|
||||||
|
@} Foobar;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Summary sentence.
|
||||||
|
* more text ...
|
||||||
|
* ...
|
||||||
|
* @@param my_parameter description of my_parameter
|
||||||
|
* @@return return value description
|
||||||
|
*/
|
||||||
|
int myfunc(int my_parameter)
|
||||||
|
...
|
||||||
|
@end example
|
||||||
|
|
||||||
@subsection Miscellanous conventions
|
|
||||||
@itemize @bullet
|
|
||||||
@item
|
|
||||||
fprintf and printf are forbidden in libavformat and libavcodec,
|
fprintf and printf are forbidden in libavformat and libavcodec,
|
||||||
please use av_log() instead.
|
please use av_log() instead.
|
||||||
@item
|
|
||||||
Casts should be used only when necessary. Unneeded parentheses
|
Casts should be used only when necessary. Unneeded parentheses
|
||||||
should also be avoided if they don't make the code easier to understand.
|
should also be avoided if they don't make the code easier to understand.
|
||||||
@end itemize
|
|
||||||
|
|
||||||
@subsection Editor configuration
|
|
||||||
In order to configure Vim to follow FFmpeg formatting conventions, paste
|
|
||||||
the following snippet into your @file{.vimrc}:
|
|
||||||
@example
|
|
||||||
" indentation rules for FFmpeg: 4 spaces, no tabs
|
|
||||||
set expandtab
|
|
||||||
set shiftwidth=4
|
|
||||||
set softtabstop=4
|
|
||||||
" allow tabs in Makefiles
|
|
||||||
autocmd FileType make set noexpandtab shiftwidth=8 softtabstop=8
|
|
||||||
" Trailing whitespace and tabs are forbidden, so highlight them.
|
|
||||||
highlight ForbiddenWhitespace ctermbg=red guibg=red
|
|
||||||
match ForbiddenWhitespace /\s\+$\|\t/
|
|
||||||
" Do not highlight spaces at the end of line while typing on that line.
|
|
||||||
autocmd InsertEnter * match ForbiddenWhitespace /\t\|\s\+\%#\@@<!$/
|
|
||||||
@end example
|
|
||||||
|
|
||||||
For Emacs, add these roughly equivalent lines to your @file{.emacs.d/init.el}:
|
|
||||||
@example
|
|
||||||
(setq c-default-style "k&r")
|
|
||||||
(setq-default c-basic-offset 4)
|
|
||||||
(setq-default indent-tabs-mode nil)
|
|
||||||
(setq-default show-trailing-whitespace t)
|
|
||||||
@end example
|
|
||||||
|
|
||||||
@section Development Policy
|
@section Development Policy
|
||||||
|
|
||||||
@@ -264,7 +178,7 @@ For Emacs, add these roughly equivalent lines to your @file{.emacs.d/init.el}:
|
|||||||
Always fill out the commit log message. Describe in a few lines what you
|
Always fill out the commit log message. Describe in a few lines what you
|
||||||
changed and why. You can refer to mailing list postings if you fix a
|
changed and why. You can refer to mailing list postings if you fix a
|
||||||
particular bug. Comments such as "fixed!" or "Changed it." are unacceptable.
|
particular bug. Comments such as "fixed!" or "Changed it." are unacceptable.
|
||||||
Recommended format:
|
Recommanded format:
|
||||||
area changed: Short 1 line description
|
area changed: Short 1 line description
|
||||||
|
|
||||||
details describing what and why and giving references.
|
details describing what and why and giving references.
|
||||||
@@ -299,7 +213,7 @@ For Emacs, add these roughly equivalent lines to your @file{.emacs.d/init.el}:
|
|||||||
always check values read from some untrusted source before using them
|
always check values read from some untrusted source before using them
|
||||||
as array index or other risky things.
|
as array index or other risky things.
|
||||||
@item
|
@item
|
||||||
Remember to check if you need to bump versions for the specific libav*
|
Remember to check if you need to bump versions for the specific libav
|
||||||
parts (libavutil, libavcodec, libavformat) you are changing. You need
|
parts (libavutil, libavcodec, libavformat) you are changing. You need
|
||||||
to change the version integer.
|
to change the version integer.
|
||||||
Incrementing the first component means no backward compatibility to
|
Incrementing the first component means no backward compatibility to
|
||||||
@@ -326,11 +240,9 @@ We think our rules are not too hard. If you have comments, contact us.
|
|||||||
|
|
||||||
Note, these rules are mostly borrowed from the MPlayer project.
|
Note, these rules are mostly borrowed from the MPlayer project.
|
||||||
|
|
||||||
@anchor{Submitting patches}
|
|
||||||
@section Submitting patches
|
@section Submitting patches
|
||||||
|
|
||||||
First, read the @ref{Coding Rules} above if you did not yet, in particular
|
First, read the (@pxref{Coding Rules}) above if you did not yet.
|
||||||
the rules regarding patch submission.
|
|
||||||
|
|
||||||
When you submit your patch, please use @code{git format-patch} or
|
When you submit your patch, please use @code{git format-patch} or
|
||||||
@code{git send-email}. We cannot read other diffs :-)
|
@code{git send-email}. We cannot read other diffs :-)
|
||||||
@@ -345,8 +257,8 @@ for us and greatly increases your chances of getting your patch applied.
|
|||||||
Use the patcheck tool of FFmpeg to check your patch.
|
Use the patcheck tool of FFmpeg to check your patch.
|
||||||
The tool is located in the tools directory.
|
The tool is located in the tools directory.
|
||||||
|
|
||||||
Run the @ref{Regression tests} before submitting a patch in order to verify
|
Run the regression tests before submitting a patch so that you can
|
||||||
it does not cause unexpected problems.
|
verify that there are no big problems.
|
||||||
|
|
||||||
Patches should be posted as base64 encoded attachments (or any other
|
Patches should be posted as base64 encoded attachments (or any other
|
||||||
encoding which ensures that the patch will not be trashed during
|
encoding which ensures that the patch will not be trashed during
|
||||||
@@ -380,13 +292,13 @@ send a reminder by email. Your patch should eventually be dealt with.
|
|||||||
AVInputFormat/AVOutputFormat struct?
|
AVInputFormat/AVOutputFormat struct?
|
||||||
@item
|
@item
|
||||||
Did you bump the minor version number (and reset the micro version
|
Did you bump the minor version number (and reset the micro version
|
||||||
number) in @file{libavcodec/version.h} or @file{libavformat/version.h}?
|
number) in @file{avcodec.h} or @file{avformat.h}?
|
||||||
@item
|
@item
|
||||||
Did you register it in @file{allcodecs.c} or @file{allformats.c}?
|
Did you register it in @file{allcodecs.c} or @file{allformats.c}?
|
||||||
@item
|
@item
|
||||||
Did you add the CodecID to @file{avcodec.h}?
|
Did you add the CodecID to @file{avcodec.h}?
|
||||||
@item
|
@item
|
||||||
If it has a fourCC, did you add it to @file{libavformat/riff.c},
|
If it has a fourcc, did you add it to @file{libavformat/riff.c},
|
||||||
even if it is only a decoder?
|
even if it is only a decoder?
|
||||||
@item
|
@item
|
||||||
Did you add a rule to compile the appropriate files in the Makefile?
|
Did you add a rule to compile the appropriate files in the Makefile?
|
||||||
@@ -413,7 +325,7 @@ send a reminder by email. Your patch should eventually be dealt with.
|
|||||||
|
|
||||||
@enumerate
|
@enumerate
|
||||||
@item
|
@item
|
||||||
Does @code{make fate} pass with the patch applied?
|
Does 'make fate' pass with the patch applied?
|
||||||
@item
|
@item
|
||||||
Was the patch generated with git format-patch or send-email?
|
Was the patch generated with git format-patch or send-email?
|
||||||
@item
|
@item
|
||||||
@@ -425,7 +337,7 @@ send a reminder by email. Your patch should eventually be dealt with.
|
|||||||
@item
|
@item
|
||||||
Is the patch against latest FFmpeg git master branch?
|
Is the patch against latest FFmpeg git master branch?
|
||||||
@item
|
@item
|
||||||
Are you subscribed to ffmpeg-devel?
|
Are you subscribed to ffmpeg-dev?
|
||||||
(the list is subscribers only due to spam)
|
(the list is subscribers only due to spam)
|
||||||
@item
|
@item
|
||||||
Have you checked that the changes are minimal, so that the same cannot be
|
Have you checked that the changes are minimal, so that the same cannot be
|
||||||
@@ -498,23 +410,34 @@ After a patch is approved it will be committed to the repository.
|
|||||||
We will review all submitted patches, but sometimes we are quite busy so
|
We will review all submitted patches, but sometimes we are quite busy so
|
||||||
especially for large patches this can take several weeks.
|
especially for large patches this can take several weeks.
|
||||||
|
|
||||||
If you feel that the review process is too slow and you are willing to try to
|
|
||||||
take over maintainership of the area of code you change then just clone
|
|
||||||
git master and maintain the area of code there. We will merge each area from
|
|
||||||
where its best maintained.
|
|
||||||
|
|
||||||
When resubmitting patches, please do not make any significant changes
|
When resubmitting patches, please do not make any significant changes
|
||||||
not related to the comments received during review. Such patches will
|
not related to the comments received during review. Such patches will
|
||||||
be rejected. Instead, submit significant changes or new features as
|
be rejected. Instead, submit significant changes or new features as
|
||||||
separate patches.
|
separate patches.
|
||||||
|
|
||||||
@anchor{Regression tests}
|
|
||||||
@section Regression tests
|
@section Regression tests
|
||||||
|
|
||||||
Before submitting a patch (or committing to the repository), you should at least
|
Before submitting a patch (or committing to the repository), you should at least
|
||||||
test that you did not break anything.
|
test that you did not break anything.
|
||||||
|
|
||||||
Running 'make fate' accomplishes this, please see @url{fate.html} for details.
|
The regression tests build a synthetic video stream and a synthetic
|
||||||
|
audio stream. These are then encoded and decoded with all codecs or
|
||||||
|
formats. The CRC (or MD5) of each generated file is recorded in a
|
||||||
|
result file. A 'diff' is launched to compare the reference results and
|
||||||
|
the result file. The output is checked immediately after each test
|
||||||
|
has run.
|
||||||
|
|
||||||
|
The regression tests then go on to test the FFserver code with a
|
||||||
|
limited set of streams. It is important that this step runs correctly
|
||||||
|
as well.
|
||||||
|
|
||||||
|
Run 'make test' to test all the codecs and formats. Commands like
|
||||||
|
'make regtest-mpeg2' can be used to run a single test. By default,
|
||||||
|
make will abort if any test fails. To run all tests regardless,
|
||||||
|
use make -k. To get a more verbose output, use 'make V=1 test' or
|
||||||
|
'make V=2 test'.
|
||||||
|
|
||||||
|
Run 'make fulltest' to test all the codecs, formats and FFserver.
|
||||||
|
|
||||||
[Of course, some patches may change the results of the regression tests. In
|
[Of course, some patches may change the results of the regression tests. In
|
||||||
this case, the reference results of the regression tests shall be modified
|
this case, the reference results of the regression tests shall be modified
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,10 +0,0 @@
|
|||||||
</div>
|
|
||||||
|
|
||||||
<div id="footer">
|
|
||||||
Generated on $datetime for $projectname by <a href="http://www.doxygen.org/index.html">doxygen</a> $doxygenversion
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<head>
|
|
||||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
||||||
<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
|
|
||||||
<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
|
|
||||||
<link href="$relpath$doxy_stylesheet.css" rel="stylesheet" type="text/css" />
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<div id="container">
|
|
||||||
|
|
||||||
<div id="body">
|
|
||||||
<div>
|
|
||||||
@@ -320,10 +320,10 @@ apply Dolby Surround EX processing.
|
|||||||
Not Indicated (default)
|
Not Indicated (default)
|
||||||
@item 1
|
@item 1
|
||||||
@itemx on
|
@itemx on
|
||||||
Dolby Surround EX Off
|
Dolby Surround EX On
|
||||||
@item 2
|
@item 2
|
||||||
@itemx off
|
@itemx off
|
||||||
Dolby Surround EX On
|
Dolby Surround EX Off
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@item -dheadphone_mode @var{mode}
|
@item -dheadphone_mode @var{mode}
|
||||||
@@ -337,10 +337,10 @@ processing.
|
|||||||
Not Indicated (default)
|
Not Indicated (default)
|
||||||
@item 1
|
@item 1
|
||||||
@itemx on
|
@itemx on
|
||||||
Dolby Headphone Off
|
Dolby Headphone On
|
||||||
@item 2
|
@item 2
|
||||||
@itemx off
|
@itemx off
|
||||||
Dolby Headphone On
|
Dolby Headphone Off
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@item -ad_conv_type @var{type}
|
@item -ad_conv_type @var{type}
|
||||||
@@ -551,33 +551,36 @@ Set the encoding preset.
|
|||||||
|
|
||||||
@item tune @var{tune_name}
|
@item tune @var{tune_name}
|
||||||
Tune the encoding params.
|
Tune the encoding params.
|
||||||
|
Deprecated in favor of @var{x264_opts}
|
||||||
|
|
||||||
@item fastfirstpass @var{bool}
|
@item fastfirstpass @var{bool}
|
||||||
Use fast settings when encoding first pass, default value is 1.
|
Use fast settings when encoding first pass, default value is 1.
|
||||||
|
Deprecated in favor of @var{x264_opts}.
|
||||||
|
|
||||||
@item profile @var{profile_name}
|
@item profile @var{profile_name}
|
||||||
Set profile restrictions.
|
Set profile restrictions.
|
||||||
|
Deprecated in favor of @var{x264_opts}.
|
||||||
|
|
||||||
@item level @var{level}
|
@item level @var{level}
|
||||||
Specify level (as defined by Annex A).
|
Specify level (as defined by Annex A).
|
||||||
Deprecated in favor of @var{x264opts}.
|
Deprecated in favor of @var{x264_opts}.
|
||||||
|
|
||||||
@item passlogfile @var{filename}
|
@item passlogfile @var{filename}
|
||||||
Specify filename for 2 pass stats.
|
Specify filename for 2 pass stats.
|
||||||
Deprecated in favor of @var{x264opts} (see @var{stats} libx264 option).
|
Deprecated in favor of @var{x264_opts}.
|
||||||
|
|
||||||
@item wpredp @var{wpred_type}
|
@item wpredp @var{wpred_type}
|
||||||
Specify Weighted prediction for P-frames.
|
Specify Weighted prediction for P-frames.
|
||||||
Deprecated in favor of @var{x264opts} (see @var{weightp} libx264 option).
|
Deprecated in favor of @var{x264_opts}.
|
||||||
|
|
||||||
@item x264opts @var{options}
|
@item x264opts @var{options}
|
||||||
Allow to set any x264 option, see x264 --fullhelp for a list.
|
Allow to set any x264 option, see x264 manual for a list.
|
||||||
|
|
||||||
@var{options} is a list of @var{key}=@var{value} couples separated by
|
@var{options} is a list of @var{key}=@var{value} couples separated by
|
||||||
":".
|
":".
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
For example to specify libx264 encoding options with @command{ffmpeg}:
|
For example to specify libx264 encoding options with @file{ffmpeg}:
|
||||||
@example
|
@example
|
||||||
ffmpeg -i foo.mpg -vcodec libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
|
ffmpeg -i foo.mpg -vcodec libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
|
||||||
@end example
|
@end example
|
||||||
|
|||||||
174
doc/errno.txt
174
doc/errno.txt
@@ -1,174 +0,0 @@
|
|||||||
The following table lists most error codes found in various operating
|
|
||||||
systems supported by FFmpeg.
|
|
||||||
|
|
||||||
OS
|
|
||||||
Code Std F LBMWwb Text (YMMV)
|
|
||||||
|
|
||||||
E2BIG POSIX ++++++ Argument list too long
|
|
||||||
EACCES POSIX ++++++ Permission denied
|
|
||||||
EADDRINUSE POSIX +++..+ Address in use
|
|
||||||
EADDRNOTAVAIL POSIX +++..+ Cannot assign requested address
|
|
||||||
EADV +..... Advertise error
|
|
||||||
EAFNOSUPPORT POSIX +++..+ Address family not supported
|
|
||||||
EAGAIN POSIX + ++++++ Resource temporarily unavailable
|
|
||||||
EALREADY POSIX +++..+ Operation already in progress
|
|
||||||
EAUTH .++... Authentication error
|
|
||||||
EBADARCH ..+... Bad CPU type in executable
|
|
||||||
EBADE +..... Invalid exchange
|
|
||||||
EBADEXEC ..+... Bad executable
|
|
||||||
EBADF POSIX ++++++ Bad file descriptor
|
|
||||||
EBADFD +..... File descriptor in bad state
|
|
||||||
EBADMACHO ..+... Malformed Macho file
|
|
||||||
EBADMSG POSIX ++4... Bad message
|
|
||||||
EBADR +..... Invalid request descriptor
|
|
||||||
EBADRPC .++... RPC struct is bad
|
|
||||||
EBADRQC +..... Invalid request code
|
|
||||||
EBADSLT +..... Invalid slot
|
|
||||||
EBFONT +..... Bad font file format
|
|
||||||
EBUSY POSIX - ++++++ Device or resource busy
|
|
||||||
ECANCELED POSIX +++... Operation canceled
|
|
||||||
ECHILD POSIX ++++++ No child processes
|
|
||||||
ECHRNG +..... Channel number out of range
|
|
||||||
ECOMM +..... Communication error on send
|
|
||||||
ECONNABORTED POSIX +++..+ Software caused connection abort
|
|
||||||
ECONNREFUSED POSIX - +++ss+ Connection refused
|
|
||||||
ECONNRESET POSIX +++..+ Connection reset
|
|
||||||
EDEADLK POSIX ++++++ Resource deadlock avoided
|
|
||||||
EDEADLOCK +..++. File locking deadlock error
|
|
||||||
EDESTADDRREQ POSIX +++... Destination address required
|
|
||||||
EDEVERR ..+... Device error
|
|
||||||
EDOM C89 - ++++++ Numerical argument out of domain
|
|
||||||
EDOOFUS .F.... Programming error
|
|
||||||
EDOTDOT +..... RFS specific error
|
|
||||||
EDQUOT POSIX +++... Disc quota exceeded
|
|
||||||
EEXIST POSIX ++++++ File exists
|
|
||||||
EFAULT POSIX - ++++++ Bad address
|
|
||||||
EFBIG POSIX - ++++++ File too large
|
|
||||||
EFTYPE .++... Inappropriate file type or format
|
|
||||||
EHOSTDOWN +++... Host is down
|
|
||||||
EHOSTUNREACH POSIX +++..+ No route to host
|
|
||||||
EHWPOISON +..... Memory page has hardware error
|
|
||||||
EIDRM POSIX +++... Identifier removed
|
|
||||||
EILSEQ C99 ++++++ Illegal byte sequence
|
|
||||||
EINPROGRESS POSIX - +++ss+ Operation in progress
|
|
||||||
EINTR POSIX - ++++++ Interrupted system call
|
|
||||||
EINVAL POSIX + ++++++ Invalid argument
|
|
||||||
EIO POSIX + ++++++ I/O error
|
|
||||||
EISCONN POSIX +++..+ Socket is already connected
|
|
||||||
EISDIR POSIX ++++++ Is a directory
|
|
||||||
EISNAM +..... Is a named type file
|
|
||||||
EKEYEXPIRED +..... Key has expired
|
|
||||||
EKEYREJECTED +..... Key was rejected by service
|
|
||||||
EKEYREVOKED +..... Key has been revoked
|
|
||||||
EL2HLT +..... Level 2 halted
|
|
||||||
EL2NSYNC +..... Level 2 not synchronized
|
|
||||||
EL3HLT +..... Level 3 halted
|
|
||||||
EL3RST +..... Level 3 reset
|
|
||||||
ELIBACC +..... Can not access a needed shared library
|
|
||||||
ELIBBAD +..... Accessing a corrupted shared library
|
|
||||||
ELIBEXEC +..... Cannot exec a shared library directly
|
|
||||||
ELIBMAX +..... Too many shared libraries
|
|
||||||
ELIBSCN +..... .lib section in a.out corrupted
|
|
||||||
ELNRNG +..... Link number out of range
|
|
||||||
ELOOP POSIX +++..+ Too many levels of symbolic links
|
|
||||||
EMEDIUMTYPE +..... Wrong medium type
|
|
||||||
EMFILE POSIX ++++++ Too many open files
|
|
||||||
EMLINK POSIX ++++++ Too many links
|
|
||||||
EMSGSIZE POSIX +++..+ Message too long
|
|
||||||
EMULTIHOP POSIX ++4... Multihop attempted
|
|
||||||
ENAMETOOLONG POSIX - ++++++ Filen ame too long
|
|
||||||
ENAVAIL +..... No XENIX semaphores available
|
|
||||||
ENEEDAUTH .++... Need authenticator
|
|
||||||
ENETDOWN POSIX +++..+ Network is down
|
|
||||||
ENETRESET SUSv3 +++..+ Network dropped connection on reset
|
|
||||||
ENETUNREACH POSIX +++..+ Network unreachable
|
|
||||||
ENFILE POSIX ++++++ Too many open files in system
|
|
||||||
ENOANO +..... No anode
|
|
||||||
ENOATTR .++... Attribute not found
|
|
||||||
ENOBUFS POSIX - +++..+ No buffer space available
|
|
||||||
ENOCSI +..... No CSI structure available
|
|
||||||
ENODATA XSR +N4... No message available
|
|
||||||
ENODEV POSIX - ++++++ No such device
|
|
||||||
ENOENT POSIX - ++++++ No such file or directory
|
|
||||||
ENOEXEC POSIX ++++++ Exec format error
|
|
||||||
ENOFILE ...++. No such file or directory
|
|
||||||
ENOKEY +..... Required key not available
|
|
||||||
ENOLCK POSIX ++++++ No locks available
|
|
||||||
ENOLINK POSIX ++4... Link has been severed
|
|
||||||
ENOMEDIUM +..... No medium found
|
|
||||||
ENOMEM POSIX ++++++ Not enough space
|
|
||||||
ENOMSG POSIX +++..+ No message of desired type
|
|
||||||
ENONET +..... Machine is not on the network
|
|
||||||
ENOPKG +..... Package not installed
|
|
||||||
ENOPROTOOPT POSIX +++..+ Protocol not available
|
|
||||||
ENOSPC POSIX ++++++ No space left on device
|
|
||||||
ENOSR XSR +N4... No STREAM resources
|
|
||||||
ENOSTR XSR +N4... Not a STREAM
|
|
||||||
ENOSYS POSIX + ++++++ Function not implemented
|
|
||||||
ENOTBLK +++... Block device required
|
|
||||||
ENOTCONN POSIX +++..+ Socket is not connected
|
|
||||||
ENOTDIR POSIX ++++++ Not a directory
|
|
||||||
ENOTEMPTY POSIX ++++++ Directory not empty
|
|
||||||
ENOTNAM +..... Not a XENIX named type file
|
|
||||||
ENOTRECOVERABLE SUSv4 - +..... State not recoverable
|
|
||||||
ENOTSOCK POSIX +++..+ Socket operation on non-socket
|
|
||||||
ENOTSUP POSIX +++... Operation not supported
|
|
||||||
ENOTTY POSIX ++++++ Inappropriate I/O control operation
|
|
||||||
ENOTUNIQ +..... Name not unique on network
|
|
||||||
ENXIO POSIX ++++++ No such device or address
|
|
||||||
EOPNOTSUPP POSIX +++..+ Operation not supported (on socket)
|
|
||||||
EOVERFLOW POSIX +++..+ Value too large to be stored in data type
|
|
||||||
EOWNERDEAD SUSv4 +..... Owner died
|
|
||||||
EPERM POSIX - ++++++ Operation not permitted
|
|
||||||
EPFNOSUPPORT +++..+ Protocol family not supported
|
|
||||||
EPIPE POSIX - ++++++ Broken pipe
|
|
||||||
EPROCLIM .++... Too many processes
|
|
||||||
EPROCUNAVAIL .++... Bad procedure for program
|
|
||||||
EPROGMISMATCH .++... Program version wrong
|
|
||||||
EPROGUNAVAIL .++... RPC prog. not avail
|
|
||||||
EPROTO POSIX ++4... Protocol error
|
|
||||||
EPROTONOSUPPORT POSIX - +++ss+ Protocol not supported
|
|
||||||
EPROTOTYPE POSIX +++..+ Protocol wrong type for socket
|
|
||||||
EPWROFF ..+... Device power is off
|
|
||||||
ERANGE C89 - ++++++ Result too large
|
|
||||||
EREMCHG +..... Remote address changed
|
|
||||||
EREMOTE +++... Object is remote
|
|
||||||
EREMOTEIO +..... Remote I/O error
|
|
||||||
ERESTART +..... Interrupted system call should be restarted
|
|
||||||
ERFKILL +..... Operation not possible due to RF-kill
|
|
||||||
EROFS POSIX ++++++ Read-only file system
|
|
||||||
ERPCMISMATCH .++... RPC version wrong
|
|
||||||
ESHLIBVERS ..+... Shared library version mismatch
|
|
||||||
ESHUTDOWN +++..+ Cannot send after socket shutdown
|
|
||||||
ESOCKTNOSUPPORT +++... Socket type not supported
|
|
||||||
ESPIPE POSIX ++++++ Illegal seek
|
|
||||||
ESRCH POSIX ++++++ No such process
|
|
||||||
ESRMNT +..... Srmount error
|
|
||||||
ESTALE POSIX +++..+ Stale NFS file handle
|
|
||||||
ESTRPIPE +..... Streams pipe error
|
|
||||||
ETIME XSR +N4... Stream ioctl timeout
|
|
||||||
ETIMEDOUT POSIX - +++ss+ Connection timed out
|
|
||||||
ETOOMANYREFS +++... Too many references: cannot splice
|
|
||||||
ETXTBSY POSIX +++... Text file busy
|
|
||||||
EUCLEAN +..... Structure needs cleaning
|
|
||||||
EUNATCH +..... Protocol driver not attached
|
|
||||||
EUSERS +++... Too many users
|
|
||||||
EWOULDBLOCK POSIX +++..+ Operation would block
|
|
||||||
EXDEV POSIX ++++++ Cross-device link
|
|
||||||
EXFULL +..... Exchange full
|
|
||||||
|
|
||||||
Notations:
|
|
||||||
|
|
||||||
F: used in FFmpeg (-: a few times, +: a lot)
|
|
||||||
|
|
||||||
SUSv3: Single Unix Specification, version 3
|
|
||||||
SUSv4: Single Unix Specification, version 4
|
|
||||||
XSR: XSI STREAMS (obsolete)
|
|
||||||
|
|
||||||
OS: availability on some supported operating systems
|
|
||||||
L: GNU/Linux
|
|
||||||
B: BSD (F: FreeBSD, N: NetBSD)
|
|
||||||
M: MacOS X
|
|
||||||
W: Microsoft Windows (s: emulated with winsock, see libavformat/network.h)
|
|
||||||
w: Mingw32 (3.17) and Mingw64 (2.0.1)
|
|
||||||
b: BeOS
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
@chapter Expression Evaluation
|
@chapter Expression Evaluation
|
||||||
@c man begin EXPRESSION EVALUATION
|
@c man begin EXPRESSION EVALUATION
|
||||||
|
|
||||||
When evaluating an arithmetic expression, FFmpeg uses an internal
|
When evaluating an arithemetic expression, FFmpeg uses an internal
|
||||||
formula evaluator, implemented through the @file{libavutil/eval.h}
|
formula evaluator, implemented through the @file{libavutil/eval.h}
|
||||||
interface.
|
interface.
|
||||||
|
|
||||||
@@ -50,11 +50,10 @@ Allow to store the value of the expression @var{expr} in an internal
|
|||||||
variable. @var{var} specifies the number of the variable where to
|
variable. @var{var} specifies the number of the variable where to
|
||||||
store the value, and it is a value ranging from 0 to 9. The function
|
store the value, and it is a value ranging from 0 to 9. The function
|
||||||
returns the value stored in the internal variable.
|
returns the value stored in the internal variable.
|
||||||
Note, Variables are currently not shared between expressions.
|
|
||||||
|
|
||||||
@item ld(var)
|
@item ld(var)
|
||||||
Allow to load the value of the internal variable with number
|
Allow to load the value of the internal variable with number
|
||||||
@var{var}, which was previously stored with st(@var{var}, @var{expr}).
|
@var{var}, which was previosly stored with st(@var{var}, @var{expr}).
|
||||||
The function returns the loaded value.
|
The function returns the loaded value.
|
||||||
|
|
||||||
@item while(cond, expr)
|
@item while(cond, expr)
|
||||||
@@ -84,54 +83,21 @@ Return 1.0 if @var{expr} is zero, 0.0 otherwise.
|
|||||||
@item pow(x, y)
|
@item pow(x, y)
|
||||||
Compute the power of @var{x} elevated @var{y}, it is equivalent to
|
Compute the power of @var{x} elevated @var{y}, it is equivalent to
|
||||||
"(@var{x})^(@var{y})".
|
"(@var{x})^(@var{y})".
|
||||||
|
|
||||||
@item random(x)
|
|
||||||
Return a pseudo random value between 0.0 and 1.0. @var{x} is the index of the
|
|
||||||
internal variable which will be used to save the seed/state.
|
|
||||||
|
|
||||||
@item hypot(x, y)
|
|
||||||
This function is similar to the C function with the same name; it returns
|
|
||||||
"sqrt(@var{x}*@var{x} + @var{y}*@var{y})", the length of the hypotenuse of a
|
|
||||||
right triangle with sides of length @var{x} and @var{y}, or the distance of the
|
|
||||||
point (@var{x}, @var{y}) from the origin.
|
|
||||||
|
|
||||||
@item gcd(x, y)
|
|
||||||
Return the greatest common divisor of @var{x} and @var{y}. If both @var{x} and
|
|
||||||
@var{y} are 0 or either or both are less than zero then behavior is undefined.
|
|
||||||
|
|
||||||
@item if(x, y)
|
|
||||||
Evaluate @var{x}, and if the result is non-zero return the result of
|
|
||||||
the evaluation of @var{y}, return 0 otherwise.
|
|
||||||
|
|
||||||
@item ifnot(x, y)
|
|
||||||
Evaluate @var{x}, and if the result is zero return the result of the
|
|
||||||
evaluation of @var{y}, return 0 otherwise.
|
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
The following constants are available:
|
Note that:
|
||||||
@table @option
|
|
||||||
@item PI
|
|
||||||
area of the unit disc, approximately 3.14
|
|
||||||
@item E
|
|
||||||
exp(1) (Euler's number), approximately 2.718
|
|
||||||
@item PHI
|
|
||||||
golden ratio (1+sqrt(5))/2, approximately 1.618
|
|
||||||
@end table
|
|
||||||
|
|
||||||
Assuming that an expression is considered "true" if it has a non-zero
|
|
||||||
value, note that:
|
|
||||||
|
|
||||||
@code{*} works like AND
|
@code{*} works like AND
|
||||||
|
|
||||||
@code{+} works like OR
|
@code{+} works like OR
|
||||||
|
|
||||||
and the construct:
|
thus
|
||||||
@example
|
@example
|
||||||
if A then B else C
|
if A then B else C
|
||||||
@end example
|
@end example
|
||||||
is equivalent to
|
is equivalent to
|
||||||
@example
|
@example
|
||||||
if(A,B) + ifnot(A,C)
|
A*B + not(A)*C
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
In your C code, you can extend the list of unary and binary functions,
|
In your C code, you can extend the list of unary and binary functions,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ FFMPEG_LIBS=libavdevice libavformat libavfilter libavcodec libswscale libavutil
|
|||||||
CFLAGS+=$(shell pkg-config --cflags $(FFMPEG_LIBS))
|
CFLAGS+=$(shell pkg-config --cflags $(FFMPEG_LIBS))
|
||||||
LDFLAGS+=$(shell pkg-config --libs $(FFMPEG_LIBS))
|
LDFLAGS+=$(shell pkg-config --libs $(FFMPEG_LIBS))
|
||||||
|
|
||||||
EXAMPLES=decoding_encoding filtering metadata muxing
|
EXAMPLES=encoding-example muxing-example
|
||||||
|
|
||||||
OBJS=$(addsuffix .o,$(EXAMPLES))
|
OBJS=$(addsuffix .o,$(EXAMPLES))
|
||||||
|
|
||||||
|
|||||||
@@ -1,39 +1,42 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001 Fabrice Bellard
|
* Copyright (c) 2001 Fabrice Bellard
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* This file is part of FFmpeg.
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
*
|
||||||
* The above copyright notice and this permission notice shall be included in
|
* FFmpeg is free software; you can redistribute it and/or
|
||||||
* all copies or substantial portions of the Software.
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
* FFmpeg is distributed in the hope that it will be useful,
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
* Lesser General Public License for more details.
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
*
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
* THE SOFTWARE.
|
* License along with FFmpeg; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* libavcodec API use example.
|
* avcodec API use example.
|
||||||
*
|
*
|
||||||
* Note that libavcodec only handles codecs (mpeg, mpeg4, etc...),
|
* Note that this library only handles codecs (mpeg, mpeg4, etc...),
|
||||||
* not file formats (avi, vob, mp4, mov, mkv, mxf, flv, mpegts, mpegps, etc...). See library 'libavformat' for the
|
* not file formats (avi, vob, etc...). See library 'libavformat' for the
|
||||||
* format handling
|
* format handling
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "libavutil/imgutils.h"
|
#include <stdlib.h>
|
||||||
#include "libavutil/opt.h"
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_AV_CONFIG_H
|
||||||
|
#undef HAVE_AV_CONFIG_H
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "libavcodec/avcodec.h"
|
#include "libavcodec/avcodec.h"
|
||||||
#include "libavutil/mathematics.h"
|
#include "libavutil/mathematics.h"
|
||||||
#include "libavutil/samplefmt.h"
|
|
||||||
|
|
||||||
#define INBUF_SIZE 4096
|
#define INBUF_SIZE 4096
|
||||||
#define AUDIO_INBUF_SIZE 20480
|
#define AUDIO_INBUF_SIZE 20480
|
||||||
@@ -61,13 +64,12 @@ static void audio_encode_example(const char *filename)
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
c = avcodec_alloc_context3(codec);
|
c= avcodec_alloc_context();
|
||||||
|
|
||||||
/* put sample parameters */
|
/* put sample parameters */
|
||||||
c->bit_rate = 64000;
|
c->bit_rate = 64000;
|
||||||
c->sample_rate = 44100;
|
c->sample_rate = 44100;
|
||||||
c->channels = 2;
|
c->channels = 2;
|
||||||
c->sample_fmt = AV_SAMPLE_FMT_S16;
|
|
||||||
|
|
||||||
/* open it */
|
/* open it */
|
||||||
if (avcodec_open(c, codec) < 0) {
|
if (avcodec_open(c, codec) < 0) {
|
||||||
@@ -115,11 +117,11 @@ static void audio_decode_example(const char *outfilename, const char *filename)
|
|||||||
{
|
{
|
||||||
AVCodec *codec;
|
AVCodec *codec;
|
||||||
AVCodecContext *c= NULL;
|
AVCodecContext *c= NULL;
|
||||||
int len;
|
int out_size, len;
|
||||||
FILE *f, *outfile;
|
FILE *f, *outfile;
|
||||||
|
uint8_t *outbuf;
|
||||||
uint8_t inbuf[AUDIO_INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE];
|
uint8_t inbuf[AUDIO_INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE];
|
||||||
AVPacket avpkt;
|
AVPacket avpkt;
|
||||||
AVFrame *decoded_frame = NULL;
|
|
||||||
|
|
||||||
av_init_packet(&avpkt);
|
av_init_packet(&avpkt);
|
||||||
|
|
||||||
@@ -132,7 +134,7 @@ static void audio_decode_example(const char *outfilename, const char *filename)
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
c = avcodec_alloc_context3(codec);
|
c= avcodec_alloc_context();
|
||||||
|
|
||||||
/* open it */
|
/* open it */
|
||||||
if (avcodec_open(c, codec) < 0) {
|
if (avcodec_open(c, codec) < 0) {
|
||||||
@@ -140,6 +142,8 @@ static void audio_decode_example(const char *outfilename, const char *filename)
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
outbuf = malloc(AVCODEC_MAX_AUDIO_FRAME_SIZE);
|
||||||
|
|
||||||
f = fopen(filename, "rb");
|
f = fopen(filename, "rb");
|
||||||
if (!f) {
|
if (!f) {
|
||||||
fprintf(stderr, "could not open %s\n", filename);
|
fprintf(stderr, "could not open %s\n", filename);
|
||||||
@@ -156,32 +160,18 @@ static void audio_decode_example(const char *outfilename, const char *filename)
|
|||||||
avpkt.size = fread(inbuf, 1, AUDIO_INBUF_SIZE, f);
|
avpkt.size = fread(inbuf, 1, AUDIO_INBUF_SIZE, f);
|
||||||
|
|
||||||
while (avpkt.size > 0) {
|
while (avpkt.size > 0) {
|
||||||
int got_frame = 0;
|
out_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
|
||||||
|
len = avcodec_decode_audio3(c, (short *)outbuf, &out_size, &avpkt);
|
||||||
if (!decoded_frame) {
|
|
||||||
if (!(decoded_frame = avcodec_alloc_frame())) {
|
|
||||||
fprintf(stderr, "out of memory\n");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
avcodec_get_frame_defaults(decoded_frame);
|
|
||||||
|
|
||||||
len = avcodec_decode_audio4(c, decoded_frame, &got_frame, &avpkt);
|
|
||||||
if (len < 0) {
|
if (len < 0) {
|
||||||
fprintf(stderr, "Error while decoding\n");
|
fprintf(stderr, "Error while decoding\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
if (got_frame) {
|
if (out_size > 0) {
|
||||||
/* if a frame has been decoded, output it */
|
/* if a frame has been decoded, output it */
|
||||||
int data_size = av_samples_get_buffer_size(NULL, c->channels,
|
fwrite(outbuf, 1, out_size, outfile);
|
||||||
decoded_frame->nb_samples,
|
|
||||||
c->sample_fmt, 1);
|
|
||||||
fwrite(decoded_frame->data[0], 1, data_size, outfile);
|
|
||||||
}
|
}
|
||||||
avpkt.size -= len;
|
avpkt.size -= len;
|
||||||
avpkt.data += len;
|
avpkt.data += len;
|
||||||
avpkt.dts =
|
|
||||||
avpkt.pts = AV_NOPTS_VALUE;
|
|
||||||
if (avpkt.size < AUDIO_REFILL_THRESH) {
|
if (avpkt.size < AUDIO_REFILL_THRESH) {
|
||||||
/* Refill the input buffer, to avoid trying to decode
|
/* Refill the input buffer, to avoid trying to decode
|
||||||
* incomplete frames. Instead of this, one could also use
|
* incomplete frames. Instead of this, one could also use
|
||||||
@@ -198,34 +188,34 @@ static void audio_decode_example(const char *outfilename, const char *filename)
|
|||||||
|
|
||||||
fclose(outfile);
|
fclose(outfile);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
free(outbuf);
|
||||||
|
|
||||||
avcodec_close(c);
|
avcodec_close(c);
|
||||||
av_free(c);
|
av_free(c);
|
||||||
av_free(decoded_frame);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Video encoding example
|
* Video encoding example
|
||||||
*/
|
*/
|
||||||
static void video_encode_example(const char *filename, int codec_id)
|
static void video_encode_example(const char *filename)
|
||||||
{
|
{
|
||||||
AVCodec *codec;
|
AVCodec *codec;
|
||||||
AVCodecContext *c= NULL;
|
AVCodecContext *c= NULL;
|
||||||
int i, out_size, size, x, y, outbuf_size;
|
int i, out_size, size, x, y, outbuf_size;
|
||||||
FILE *f;
|
FILE *f;
|
||||||
AVFrame *picture;
|
AVFrame *picture;
|
||||||
uint8_t *outbuf;
|
uint8_t *outbuf, *picture_buf;
|
||||||
|
|
||||||
printf("Video encoding\n");
|
printf("Video encoding\n");
|
||||||
|
|
||||||
/* find the mpeg1 video encoder */
|
/* find the mpeg1 video encoder */
|
||||||
codec = avcodec_find_encoder(codec_id);
|
codec = avcodec_find_encoder(CODEC_ID_MPEG1VIDEO);
|
||||||
if (!codec) {
|
if (!codec) {
|
||||||
fprintf(stderr, "codec not found\n");
|
fprintf(stderr, "codec not found\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
c = avcodec_alloc_context3(codec);
|
c= avcodec_alloc_context();
|
||||||
picture= avcodec_alloc_frame();
|
picture= avcodec_alloc_frame();
|
||||||
|
|
||||||
/* put sample parameters */
|
/* put sample parameters */
|
||||||
@@ -239,9 +229,6 @@ static void video_encode_example(const char *filename, int codec_id)
|
|||||||
c->max_b_frames=1;
|
c->max_b_frames=1;
|
||||||
c->pix_fmt = PIX_FMT_YUV420P;
|
c->pix_fmt = PIX_FMT_YUV420P;
|
||||||
|
|
||||||
if(codec_id == CODEC_ID_H264)
|
|
||||||
av_opt_set(c->priv_data, "preset", "slow", 0);
|
|
||||||
|
|
||||||
/* open it */
|
/* open it */
|
||||||
if (avcodec_open(c, codec) < 0) {
|
if (avcodec_open(c, codec) < 0) {
|
||||||
fprintf(stderr, "could not open codec\n");
|
fprintf(stderr, "could not open codec\n");
|
||||||
@@ -257,11 +244,15 @@ static void video_encode_example(const char *filename, int codec_id)
|
|||||||
/* alloc image and output buffer */
|
/* alloc image and output buffer */
|
||||||
outbuf_size = 100000;
|
outbuf_size = 100000;
|
||||||
outbuf = malloc(outbuf_size);
|
outbuf = malloc(outbuf_size);
|
||||||
|
size = c->width * c->height;
|
||||||
|
picture_buf = malloc((size * 3) / 2); /* size for YUV 420 */
|
||||||
|
|
||||||
/* the image can be allocated by any means and av_image_alloc() is
|
picture->data[0] = picture_buf;
|
||||||
* just the most convenient way if av_malloc() is to be used */
|
picture->data[1] = picture->data[0] + size;
|
||||||
av_image_alloc(picture->data, picture->linesize,
|
picture->data[2] = picture->data[1] + size / 4;
|
||||||
c->width, c->height, c->pix_fmt, 1);
|
picture->linesize[0] = c->width;
|
||||||
|
picture->linesize[1] = c->width / 2;
|
||||||
|
picture->linesize[2] = c->width / 2;
|
||||||
|
|
||||||
/* encode 1 second of video */
|
/* encode 1 second of video */
|
||||||
for(i=0;i<25;i++) {
|
for(i=0;i<25;i++) {
|
||||||
@@ -304,11 +295,11 @@ static void video_encode_example(const char *filename, int codec_id)
|
|||||||
outbuf[3] = 0xb7;
|
outbuf[3] = 0xb7;
|
||||||
fwrite(outbuf, 1, 4, f);
|
fwrite(outbuf, 1, 4, f);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
free(picture_buf);
|
||||||
free(outbuf);
|
free(outbuf);
|
||||||
|
|
||||||
avcodec_close(c);
|
avcodec_close(c);
|
||||||
av_free(c);
|
av_free(c);
|
||||||
av_free(picture->data[0]);
|
|
||||||
av_free(picture);
|
av_free(picture);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
@@ -355,7 +346,7 @@ static void video_decode_example(const char *outfilename, const char *filename)
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
c = avcodec_alloc_context3(codec);
|
c= avcodec_alloc_context();
|
||||||
picture= avcodec_alloc_frame();
|
picture= avcodec_alloc_frame();
|
||||||
|
|
||||||
if(codec->capabilities&CODEC_CAP_TRUNCATED)
|
if(codec->capabilities&CODEC_CAP_TRUNCATED)
|
||||||
@@ -463,8 +454,7 @@ int main(int argc, char **argv)
|
|||||||
audio_encode_example("/tmp/test.mp2");
|
audio_encode_example("/tmp/test.mp2");
|
||||||
audio_decode_example("/tmp/test.sw", "/tmp/test.mp2");
|
audio_decode_example("/tmp/test.sw", "/tmp/test.mp2");
|
||||||
|
|
||||||
video_encode_example("/tmp/test.h264", CODEC_ID_H264);
|
video_encode_example("/tmp/test.mpg");
|
||||||
video_encode_example("/tmp/test.mpg", CODEC_ID_MPEG1VIDEO);
|
|
||||||
filename = "/tmp/test.mpg";
|
filename = "/tmp/test.mpg";
|
||||||
} else {
|
} else {
|
||||||
filename = argv[1];
|
filename = argv[1];
|
||||||
@@ -1,229 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2010 Nicolas George
|
|
||||||
* Copyright (c) 2011 Stefano Sabatini
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in
|
|
||||||
* all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
||||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
* THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @file
|
|
||||||
* API example for decoding and filtering
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define _XOPEN_SOURCE 600 /* for usleep */
|
|
||||||
|
|
||||||
#include <libavcodec/avcodec.h>
|
|
||||||
#include <libavformat/avformat.h>
|
|
||||||
#include <libavfilter/avfiltergraph.h>
|
|
||||||
#include <libavfilter/vsrc_buffer.h>
|
|
||||||
|
|
||||||
const char *filter_descr = "scale=78:24";
|
|
||||||
|
|
||||||
static AVFormatContext *fmt_ctx;
|
|
||||||
static AVCodecContext *dec_ctx;
|
|
||||||
AVFilterContext *buffersink_ctx;
|
|
||||||
AVFilterContext *buffersrc_ctx;
|
|
||||||
AVFilterGraph *filter_graph;
|
|
||||||
static int video_stream_index = -1;
|
|
||||||
static int64_t last_pts = AV_NOPTS_VALUE;
|
|
||||||
|
|
||||||
static int open_input_file(const char *filename)
|
|
||||||
{
|
|
||||||
int ret, i;
|
|
||||||
AVCodec *dec;
|
|
||||||
|
|
||||||
if ((ret = avformat_open_input(&fmt_ctx, filename, NULL, NULL)) < 0) {
|
|
||||||
av_log(NULL, AV_LOG_ERROR, "Cannot open input file\n");
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((ret = av_find_stream_info(fmt_ctx)) < 0) {
|
|
||||||
av_log(NULL, AV_LOG_ERROR, "Cannot find stream information\n");
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* select the video stream */
|
|
||||||
ret = av_find_best_stream(fmt_ctx, AVMEDIA_TYPE_VIDEO, -1, -1, &dec, 0);
|
|
||||||
if (ret < 0) {
|
|
||||||
av_log(NULL, AV_LOG_ERROR, "Cannot find a video stream in the input file\n");
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
video_stream_index = ret;
|
|
||||||
dec_ctx = fmt_ctx->streams[video_stream_index]->codec;
|
|
||||||
|
|
||||||
/* init the video decoder */
|
|
||||||
if ((ret = avcodec_open(dec_ctx, dec)) < 0) {
|
|
||||||
av_log(NULL, AV_LOG_ERROR, "Cannot open video decoder\n");
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int init_filters(const char *filters_descr)
|
|
||||||
{
|
|
||||||
char args[512];
|
|
||||||
int ret;
|
|
||||||
AVFilter *buffersrc = avfilter_get_by_name("buffer");
|
|
||||||
AVFilter *buffersink = avfilter_get_by_name("buffersink");
|
|
||||||
AVFilterInOut *outputs = avfilter_inout_alloc();
|
|
||||||
AVFilterInOut *inputs = avfilter_inout_alloc();
|
|
||||||
enum PixelFormat pix_fmts[] = { PIX_FMT_GRAY8, PIX_FMT_NONE };
|
|
||||||
filter_graph = avfilter_graph_alloc();
|
|
||||||
|
|
||||||
/* buffer video source: the decoded frames from the decoder will be inserted here. */
|
|
||||||
snprintf(args, sizeof(args), "%d:%d:%d:%d:%d:%d:%d",
|
|
||||||
dec_ctx->width, dec_ctx->height, dec_ctx->pix_fmt,
|
|
||||||
dec_ctx->time_base.num, dec_ctx->time_base.den,
|
|
||||||
dec_ctx->sample_aspect_ratio.num, dec_ctx->sample_aspect_ratio.den);
|
|
||||||
ret = avfilter_graph_create_filter(&buffersrc_ctx, buffersrc, "in",
|
|
||||||
args, NULL, filter_graph);
|
|
||||||
if (ret < 0) {
|
|
||||||
av_log(NULL, AV_LOG_ERROR, "Cannot create buffer source\n");
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* buffer video sink: to terminate the filter chain. */
|
|
||||||
ret = avfilter_graph_create_filter(&buffersink_ctx, buffersink, "out",
|
|
||||||
NULL, pix_fmts, filter_graph);
|
|
||||||
if (ret < 0) {
|
|
||||||
av_log(NULL, AV_LOG_ERROR, "Cannot create buffer sink\n");
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Endpoints for the filter graph. */
|
|
||||||
outputs->name = av_strdup("in");
|
|
||||||
outputs->filter_ctx = buffersrc_ctx;
|
|
||||||
outputs->pad_idx = 0;
|
|
||||||
outputs->next = NULL;
|
|
||||||
|
|
||||||
inputs->name = av_strdup("out");
|
|
||||||
inputs->filter_ctx = buffersink_ctx;
|
|
||||||
inputs->pad_idx = 0;
|
|
||||||
inputs->next = NULL;
|
|
||||||
|
|
||||||
if ((ret = avfilter_graph_parse(filter_graph, filter_descr,
|
|
||||||
&inputs, &outputs, NULL)) < 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
if ((ret = avfilter_graph_config(filter_graph, NULL)) < 0)
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void display_picref(AVFilterBufferRef *picref, AVRational time_base)
|
|
||||||
{
|
|
||||||
int x, y;
|
|
||||||
uint8_t *p0, *p;
|
|
||||||
int64_t delay;
|
|
||||||
|
|
||||||
if (picref->pts != AV_NOPTS_VALUE) {
|
|
||||||
if (last_pts != AV_NOPTS_VALUE) {
|
|
||||||
/* sleep roughly the right amount of time;
|
|
||||||
* usleep is in microseconds, just like AV_TIME_BASE. */
|
|
||||||
delay = av_rescale_q(picref->pts - last_pts,
|
|
||||||
time_base, AV_TIME_BASE_Q);
|
|
||||||
if (delay > 0 && delay < 1000000)
|
|
||||||
usleep(delay);
|
|
||||||
}
|
|
||||||
last_pts = picref->pts;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Trivial ASCII grayscale display. */
|
|
||||||
p0 = picref->data[0];
|
|
||||||
puts("\033c");
|
|
||||||
for (y = 0; y < picref->video->h; y++) {
|
|
||||||
p = p0;
|
|
||||||
for (x = 0; x < picref->video->w; x++)
|
|
||||||
putchar(" .-+#"[*(p++) / 52]);
|
|
||||||
putchar('\n');
|
|
||||||
p0 += picref->linesize[0];
|
|
||||||
}
|
|
||||||
fflush(stdout);
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
|
||||||
{
|
|
||||||
int ret;
|
|
||||||
AVPacket packet;
|
|
||||||
AVFrame frame;
|
|
||||||
int got_frame;
|
|
||||||
|
|
||||||
if (argc != 2) {
|
|
||||||
fprintf(stderr, "Usage: %s file\n", argv[0]);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
avcodec_register_all();
|
|
||||||
av_register_all();
|
|
||||||
avfilter_register_all();
|
|
||||||
|
|
||||||
if ((ret = open_input_file(argv[1])) < 0)
|
|
||||||
goto end;
|
|
||||||
if ((ret = init_filters(filter_descr)) < 0)
|
|
||||||
goto end;
|
|
||||||
|
|
||||||
/* read all packets */
|
|
||||||
while (1) {
|
|
||||||
AVFilterBufferRef *picref;
|
|
||||||
if ((ret = av_read_frame(fmt_ctx, &packet)) < 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (packet.stream_index == video_stream_index) {
|
|
||||||
avcodec_get_frame_defaults(&frame);
|
|
||||||
got_frame = 0;
|
|
||||||
ret = avcodec_decode_video2(dec_ctx, &frame, &got_frame, &packet);
|
|
||||||
av_free_packet(&packet);
|
|
||||||
if (ret < 0) {
|
|
||||||
av_log(NULL, AV_LOG_ERROR, "Error decoding video\n");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (got_frame) {
|
|
||||||
if (frame.pts == AV_NOPTS_VALUE)
|
|
||||||
frame.pts = frame.pkt_dts == AV_NOPTS_VALUE ?
|
|
||||||
frame.pkt_dts : frame.pkt_pts;
|
|
||||||
/* push the decoded frame into the filtergraph */
|
|
||||||
av_vsrc_buffer_add_frame(buffersrc_ctx, &frame);
|
|
||||||
|
|
||||||
/* pull filtered pictures from the filtergraph */
|
|
||||||
while (avfilter_poll_frame(buffersink_ctx->inputs[0])) {
|
|
||||||
av_vsink_buffer_get_video_buffer_ref(buffersink_ctx, &picref, 0);
|
|
||||||
if (picref) {
|
|
||||||
display_picref(picref, buffersink_ctx->inputs[0]->time_base);
|
|
||||||
avfilter_unref_buffer(picref);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
end:
|
|
||||||
avfilter_graph_free(&filter_graph);
|
|
||||||
if (dec_ctx)
|
|
||||||
avcodec_close(dec_ctx);
|
|
||||||
av_close_input_file(fmt_ctx);
|
|
||||||
|
|
||||||
if (ret < 0 && ret != AVERROR_EOF) {
|
|
||||||
char buf[1024];
|
|
||||||
av_strerror(ret, buf, sizeof(buf));
|
|
||||||
fprintf(stderr, "Error occurred: %s\n", buf);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
exit(0);
|
|
||||||
}
|
|
||||||
@@ -22,10 +22,8 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* libavformat API example.
|
* Libavformat API example: Output a media file in any supported
|
||||||
*
|
* libavformat format. The default codecs are used.
|
||||||
* Output a media file in any supported libavformat format.
|
|
||||||
* The default codecs are used.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -33,14 +31,13 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#include "libavutil/mathematics.h"
|
|
||||||
#include "libavformat/avformat.h"
|
#include "libavformat/avformat.h"
|
||||||
#include "libswscale/swscale.h"
|
#include "libswscale/swscale.h"
|
||||||
|
|
||||||
#undef exit
|
#undef exit
|
||||||
|
|
||||||
/* 5 seconds stream duration */
|
/* 5 seconds stream duration */
|
||||||
#define STREAM_DURATION 200.0
|
#define STREAM_DURATION 5.0
|
||||||
#define STREAM_FRAME_RATE 25 /* 25 images/s */
|
#define STREAM_FRAME_RATE 25 /* 25 images/s */
|
||||||
#define STREAM_NB_FRAMES ((int)(STREAM_DURATION * STREAM_FRAME_RATE))
|
#define STREAM_NB_FRAMES ((int)(STREAM_DURATION * STREAM_FRAME_RATE))
|
||||||
#define STREAM_PIX_FMT PIX_FMT_YUV420P /* default pix_fmt */
|
#define STREAM_PIX_FMT PIX_FMT_YUV420P /* default pix_fmt */
|
||||||
@@ -50,11 +47,11 @@ static int sws_flags = SWS_BICUBIC;
|
|||||||
/**************************************************************/
|
/**************************************************************/
|
||||||
/* audio output */
|
/* audio output */
|
||||||
|
|
||||||
static float t, tincr, tincr2;
|
float t, tincr, tincr2;
|
||||||
static int16_t *samples;
|
int16_t *samples;
|
||||||
static uint8_t *audio_outbuf;
|
uint8_t *audio_outbuf;
|
||||||
static int audio_outbuf_size;
|
int audio_outbuf_size;
|
||||||
static int audio_input_frame_size;
|
int audio_input_frame_size;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* add an audio output stream
|
* add an audio output stream
|
||||||
@@ -64,12 +61,11 @@ static AVStream *add_audio_stream(AVFormatContext *oc, enum CodecID codec_id)
|
|||||||
AVCodecContext *c;
|
AVCodecContext *c;
|
||||||
AVStream *st;
|
AVStream *st;
|
||||||
|
|
||||||
st = avformat_new_stream(oc, NULL);
|
st = av_new_stream(oc, 1);
|
||||||
if (!st) {
|
if (!st) {
|
||||||
fprintf(stderr, "Could not alloc stream\n");
|
fprintf(stderr, "Could not alloc stream\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
st->id = 1;
|
|
||||||
|
|
||||||
c = st->codec;
|
c = st->codec;
|
||||||
c->codec_id = codec_id;
|
c->codec_id = codec_id;
|
||||||
@@ -190,34 +186,25 @@ static void close_audio(AVFormatContext *oc, AVStream *st)
|
|||||||
/**************************************************************/
|
/**************************************************************/
|
||||||
/* video output */
|
/* video output */
|
||||||
|
|
||||||
static AVFrame *picture, *tmp_picture;
|
AVFrame *picture, *tmp_picture;
|
||||||
static uint8_t *video_outbuf;
|
uint8_t *video_outbuf;
|
||||||
static int frame_count, video_outbuf_size;
|
int frame_count, video_outbuf_size;
|
||||||
|
|
||||||
/* add a video output stream */
|
/* add a video output stream */
|
||||||
static AVStream *add_video_stream(AVFormatContext *oc, enum CodecID codec_id)
|
static AVStream *add_video_stream(AVFormatContext *oc, enum CodecID codec_id)
|
||||||
{
|
{
|
||||||
AVCodecContext *c;
|
AVCodecContext *c;
|
||||||
AVStream *st;
|
AVStream *st;
|
||||||
AVCodec *codec;
|
|
||||||
|
|
||||||
st = avformat_new_stream(oc, NULL);
|
st = av_new_stream(oc, 0);
|
||||||
if (!st) {
|
if (!st) {
|
||||||
fprintf(stderr, "Could not alloc stream\n");
|
fprintf(stderr, "Could not alloc stream\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
c = st->codec;
|
c = st->codec;
|
||||||
|
|
||||||
/* find the video encoder */
|
|
||||||
codec = avcodec_find_encoder(codec_id);
|
|
||||||
if (!codec) {
|
|
||||||
fprintf(stderr, "codec not found\n");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
avcodec_get_context_defaults3(c, codec);
|
|
||||||
|
|
||||||
c->codec_id = codec_id;
|
c->codec_id = codec_id;
|
||||||
|
c->codec_type = AVMEDIA_TYPE_VIDEO;
|
||||||
|
|
||||||
/* put sample parameters */
|
/* put sample parameters */
|
||||||
c->bit_rate = 400000;
|
c->bit_rate = 400000;
|
||||||
@@ -382,7 +369,7 @@ static void write_video_frame(AVFormatContext *oc, AVStream *st)
|
|||||||
|
|
||||||
if (oc->oformat->flags & AVFMT_RAWPICTURE) {
|
if (oc->oformat->flags & AVFMT_RAWPICTURE) {
|
||||||
/* raw video case. The API will change slightly in the near
|
/* raw video case. The API will change slightly in the near
|
||||||
future for that. */
|
futur for that */
|
||||||
AVPacket pkt;
|
AVPacket pkt;
|
||||||
av_init_packet(&pkt);
|
av_init_packet(&pkt);
|
||||||
|
|
||||||
@@ -454,7 +441,7 @@ int main(int argc, char **argv)
|
|||||||
"The output format is automatically guessed according to the file extension.\n"
|
"The output format is automatically guessed according to the file extension.\n"
|
||||||
"Raw images can also be output by using '%%d' in the filename\n"
|
"Raw images can also be output by using '%%d' in the filename\n"
|
||||||
"\n", argv[0]);
|
"\n", argv[0]);
|
||||||
return 1;
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
filename = argv[1];
|
filename = argv[1];
|
||||||
@@ -466,7 +453,7 @@ int main(int argc, char **argv)
|
|||||||
avformat_alloc_output_context2(&oc, NULL, "mpeg", filename);
|
avformat_alloc_output_context2(&oc, NULL, "mpeg", filename);
|
||||||
}
|
}
|
||||||
if (!oc) {
|
if (!oc) {
|
||||||
return 1;
|
exit(1);
|
||||||
}
|
}
|
||||||
fmt= oc->oformat;
|
fmt= oc->oformat;
|
||||||
|
|
||||||
@@ -492,15 +479,15 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
/* open the output file, if needed */
|
/* open the output file, if needed */
|
||||||
if (!(fmt->flags & AVFMT_NOFILE)) {
|
if (!(fmt->flags & AVFMT_NOFILE)) {
|
||||||
if (avio_open(&oc->pb, filename, AVIO_FLAG_WRITE) < 0) {
|
if (avio_open(&oc->pb, filename, AVIO_WRONLY) < 0) {
|
||||||
fprintf(stderr, "Could not open '%s'\n", filename);
|
fprintf(stderr, "Could not open '%s'\n", filename);
|
||||||
return 1;
|
exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* write the stream header, if any */
|
/* write the stream header, if any */
|
||||||
av_write_header(oc);
|
av_write_header(oc);
|
||||||
picture->pts = 0;
|
|
||||||
for(;;) {
|
for(;;) {
|
||||||
/* compute current audio and video time */
|
/* compute current audio and video time */
|
||||||
if (audio_st)
|
if (audio_st)
|
||||||
@@ -522,7 +509,6 @@ int main(int argc, char **argv)
|
|||||||
write_audio_frame(oc, audio_st);
|
write_audio_frame(oc, audio_st);
|
||||||
} else {
|
} else {
|
||||||
write_video_frame(oc, video_st);
|
write_video_frame(oc, video_st);
|
||||||
picture->pts++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
192
doc/faq.texi
192
doc/faq.texi
@@ -11,6 +11,22 @@
|
|||||||
|
|
||||||
@chapter General Questions
|
@chapter General Questions
|
||||||
|
|
||||||
|
@section When will the next FFmpeg version be released? / Why are FFmpeg releases so few and far between?
|
||||||
|
|
||||||
|
Like most open source projects FFmpeg suffers from a certain lack of
|
||||||
|
manpower. For this reason the developers have to prioritize the work
|
||||||
|
they do and putting out releases is not at the top of the list, fixing
|
||||||
|
bugs and reviewing patches takes precedence. Please don't complain or
|
||||||
|
request more timely and/or frequent releases unless you are willing to
|
||||||
|
help out creating them.
|
||||||
|
|
||||||
|
@section I have a problem with an old version of FFmpeg; where should I report it?
|
||||||
|
Nowhere. We do not support old FFmpeg versions in any way, we simply lack
|
||||||
|
the time, motivation and manpower to do so. If you have a problem with an
|
||||||
|
old version of FFmpeg, upgrade to the latest git snapshot. If you
|
||||||
|
still experience the problem, then you can report it according to the
|
||||||
|
guidelines in @url{http://ffmpeg.org/bugreports.html}.
|
||||||
|
|
||||||
@section Why doesn't FFmpeg support feature [xyz]?
|
@section Why doesn't FFmpeg support feature [xyz]?
|
||||||
|
|
||||||
Because no one has taken on that task yet. FFmpeg development is
|
Because no one has taken on that task yet. FFmpeg development is
|
||||||
@@ -24,6 +40,30 @@ No. Windows DLLs are not portable, bloated and often slow.
|
|||||||
Moreover FFmpeg strives to support all codecs natively.
|
Moreover FFmpeg strives to support all codecs natively.
|
||||||
A DLL loader is not conducive to that goal.
|
A DLL loader is not conducive to that goal.
|
||||||
|
|
||||||
|
@section My bug report/mail to ffmpeg-devel/user has not received any replies.
|
||||||
|
|
||||||
|
Likely reasons
|
||||||
|
@itemize
|
||||||
|
@item We are busy and haven't had time yet to read your report or
|
||||||
|
investigate the issue.
|
||||||
|
@item You didn't follow @url{http://ffmpeg.org/bugreports.html}.
|
||||||
|
@item You didn't use git HEAD.
|
||||||
|
@item You reported a segmentation fault without gdb output.
|
||||||
|
@item You describe a problem but not how to reproduce it.
|
||||||
|
@item It's unclear if you use ffmpeg as command line tool or use
|
||||||
|
libav* from another application.
|
||||||
|
@item You speak about a video having problems on playback but
|
||||||
|
not what you use to play it.
|
||||||
|
@item We have no faint clue what you are talking about besides
|
||||||
|
that it is related to FFmpeg.
|
||||||
|
@end itemize
|
||||||
|
|
||||||
|
@section Is there a forum for FFmpeg? I do not like mailing lists.
|
||||||
|
|
||||||
|
You may view our mailing lists with a more forum-alike look here:
|
||||||
|
@url{http://dir.gmane.org/gmane.comp.video.ffmpeg.user},
|
||||||
|
but, if you post, please remember that our mailing list rules still apply there.
|
||||||
|
|
||||||
@section I cannot read this file although this format seems to be supported by ffmpeg.
|
@section I cannot read this file although this format seems to be supported by ffmpeg.
|
||||||
|
|
||||||
Even if ffmpeg can read the container format, it may not support all its
|
Even if ffmpeg can read the container format, it may not support all its
|
||||||
@@ -83,8 +123,7 @@ problem and an NP-hard problem...
|
|||||||
|
|
||||||
@section ffmpeg does not work; what is wrong?
|
@section ffmpeg does not work; what is wrong?
|
||||||
|
|
||||||
Try a @code{make distclean} in the ffmpeg source directory before the build.
|
Try a @code{make distclean} in the ffmpeg source directory before the build. If this does not help see
|
||||||
If this does not help see
|
|
||||||
(@url{http://ffmpeg.org/bugreports.html}).
|
(@url{http://ffmpeg.org/bugreports.html}).
|
||||||
|
|
||||||
@section How do I encode single pictures into movies?
|
@section How do I encode single pictures into movies?
|
||||||
@@ -135,15 +174,15 @@ The @file{movie.mpg} used as input will be converted to
|
|||||||
|
|
||||||
Instead of relying on file format self-recognition, you may also use
|
Instead of relying on file format self-recognition, you may also use
|
||||||
@table @option
|
@table @option
|
||||||
@item -c:v ppm
|
@item -vcodec ppm
|
||||||
@item -c:v png
|
@item -vcodec png
|
||||||
@item -c:v mjpeg
|
@item -vcodec mjpeg
|
||||||
@end table
|
@end table
|
||||||
to force the encoding.
|
to force the encoding.
|
||||||
|
|
||||||
Applying that to the previous example:
|
Applying that to the previous example:
|
||||||
@example
|
@example
|
||||||
ffmpeg -i movie.mpg -f image2 -c:v mjpeg menu%d.jpg
|
ffmpeg -i movie.mpg -f image2 -vcodec mjpeg menu%d.jpg
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
Beware that there is no "jpeg" codec. Use "mjpeg" instead.
|
Beware that there is no "jpeg" codec. Use "mjpeg" instead.
|
||||||
@@ -165,18 +204,56 @@ Try '-f image2 test%d.jpg'.
|
|||||||
@section Why can I not change the framerate?
|
@section Why can I not change the framerate?
|
||||||
|
|
||||||
Some codecs, like MPEG-1/2, only allow a small number of fixed framerates.
|
Some codecs, like MPEG-1/2, only allow a small number of fixed framerates.
|
||||||
Choose a different codec with the -c:v command line option.
|
Choose a different codec with the -vcodec command line option.
|
||||||
|
|
||||||
@section How do I encode Xvid or DivX video with ffmpeg?
|
@section How do I encode Xvid or DivX video with ffmpeg?
|
||||||
|
|
||||||
Both Xvid and DivX (version 4+) are implementations of the ISO MPEG-4
|
Both Xvid and DivX (version 4+) are implementations of the ISO MPEG-4
|
||||||
standard (note that there are many other coding formats that use this
|
standard (note that there are many other coding formats that use this
|
||||||
same standard). Thus, use '-c:v mpeg4' to encode in these formats. The
|
same standard). Thus, use '-vcodec mpeg4' to encode in these formats. The
|
||||||
default fourcc stored in an MPEG-4-coded file will be 'FMP4'. If you want
|
default fourcc stored in an MPEG-4-coded file will be 'FMP4'. If you want
|
||||||
a different fourcc, use the '-vtag' option. E.g., '-vtag xvid' will
|
a different fourcc, use the '-vtag' option. E.g., '-vtag xvid' will
|
||||||
force the fourcc 'xvid' to be stored as the video fourcc rather than the
|
force the fourcc 'xvid' to be stored as the video fourcc rather than the
|
||||||
default.
|
default.
|
||||||
|
|
||||||
|
@section How do I encode videos which play on the iPod?
|
||||||
|
|
||||||
|
@table @option
|
||||||
|
@item needed stuff
|
||||||
|
-acodec libfaac -vcodec mpeg4 width<=320 height<=240
|
||||||
|
@item working stuff
|
||||||
|
mv4, title
|
||||||
|
@item non-working stuff
|
||||||
|
B-frames
|
||||||
|
@item example command line
|
||||||
|
ffmpeg -i input -acodec libfaac -ab 128k -vcodec mpeg4 -b 1200k -mbd 2 -flags +mv4+aic -trellis 2 -cmp 2 -subcmp 2 -s 320x180 -metadata title=X output.mp4
|
||||||
|
@end table
|
||||||
|
|
||||||
|
@section How do I encode videos which play on the PSP?
|
||||||
|
|
||||||
|
@table @option
|
||||||
|
@item needed stuff
|
||||||
|
-acodec libfaac -vcodec mpeg4 width*height<=76800 width%16=0 height%16=0 -ar 24000 -r 30000/1001 or 15000/1001 -f psp
|
||||||
|
@item working stuff
|
||||||
|
mv4, title
|
||||||
|
@item non-working stuff
|
||||||
|
B-frames
|
||||||
|
@item example command line
|
||||||
|
ffmpeg -i input -acodec libfaac -ab 128k -vcodec mpeg4 -b 1200k -ar 24000 -mbd 2 -flags +mv4+aic -trellis 2 -cmp 2 -subcmp 2 -s 368x192 -r 30000/1001 -metadata title=X -f psp output.mp4
|
||||||
|
@item needed stuff for H.264
|
||||||
|
-acodec libfaac -vcodec libx264 width*height<=76800 width%16=0? height%16=0? -ar 48000 -coder 1 -r 30000/1001 or 15000/1001 -f psp
|
||||||
|
@item working stuff for H.264
|
||||||
|
title, loop filter
|
||||||
|
@item non-working stuff for H.264
|
||||||
|
CAVLC
|
||||||
|
@item example command line
|
||||||
|
ffmpeg -i input -acodec libfaac -ab 128k -vcodec libx264 -b 1200k -ar 48000 -mbd 2 -coder 1 -cmp 2 -subcmp 2 -s 368x192 -r 30000/1001 -metadata title=X -f psp -flags loop -trellis 2 -partitions parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 output.mp4
|
||||||
|
@item higher resolution for newer PSP firmwares, width<=480, height<=272
|
||||||
|
-vcodec libx264 -level 21 -coder 1 -f psp
|
||||||
|
@item example command line
|
||||||
|
ffmpeg -i input -acodec libfaac -ab 128k -ac 2 -ar 48000 -vcodec libx264 -level 21 -b 640k -coder 1 -f psp -flags +loop -trellis 2 -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -g 250 -s 480x272 output.mp4
|
||||||
|
@end table
|
||||||
|
|
||||||
@section Which are good parameters for encoding high quality MPEG-4?
|
@section Which are good parameters for encoding high quality MPEG-4?
|
||||||
|
|
||||||
'-mbd rd -flags +mv4+aic -trellis 2 -cmp 2 -subcmp 2 -g 300 -pass 1/2',
|
'-mbd rd -flags +mv4+aic -trellis 2 -cmp 2 -subcmp 2 -g 300 -pass 1/2',
|
||||||
@@ -208,8 +285,7 @@ Just create an "input.avs" text file with this single line ...
|
|||||||
ffmpeg -i input.avs
|
ffmpeg -i input.avs
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
For ANY other help on Avisynth, please visit the
|
For ANY other help on Avisynth, please visit @url{http://www.avisynth.org/}.
|
||||||
@uref{http://www.avisynth.org/, Avisynth homepage}.
|
|
||||||
|
|
||||||
@section How can I join video files?
|
@section How can I join video files?
|
||||||
|
|
||||||
@@ -222,13 +298,13 @@ equally humble @code{copy} under Windows), and finally transcoding back to your
|
|||||||
format of choice.
|
format of choice.
|
||||||
|
|
||||||
@example
|
@example
|
||||||
ffmpeg -i input1.avi -same_quant intermediate1.mpg
|
ffmpeg -i input1.avi -sameq intermediate1.mpg
|
||||||
ffmpeg -i input2.avi -same_quant intermediate2.mpg
|
ffmpeg -i input2.avi -sameq intermediate2.mpg
|
||||||
cat intermediate1.mpg intermediate2.mpg > intermediate_all.mpg
|
cat intermediate1.mpg intermediate2.mpg > intermediate_all.mpg
|
||||||
ffmpeg -i intermediate_all.mpg -same_quant output.avi
|
ffmpeg -i intermediate_all.mpg -sameq output.avi
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
Notice that you should either use @code{-same_quant} or set a reasonably high
|
Notice that you should either use @code{-sameq} or set a reasonably high
|
||||||
bitrate for your intermediate and output files, if you want to preserve
|
bitrate for your intermediate and output files, if you want to preserve
|
||||||
video quality.
|
video quality.
|
||||||
|
|
||||||
@@ -238,10 +314,10 @@ of named pipes, should your platform support it:
|
|||||||
@example
|
@example
|
||||||
mkfifo intermediate1.mpg
|
mkfifo intermediate1.mpg
|
||||||
mkfifo intermediate2.mpg
|
mkfifo intermediate2.mpg
|
||||||
ffmpeg -i input1.avi -same_quant -y intermediate1.mpg < /dev/null &
|
ffmpeg -i input1.avi -sameq -y intermediate1.mpg < /dev/null &
|
||||||
ffmpeg -i input2.avi -same_quant -y intermediate2.mpg < /dev/null &
|
ffmpeg -i input2.avi -sameq -y intermediate2.mpg < /dev/null &
|
||||||
cat intermediate1.mpg intermediate2.mpg |\
|
cat intermediate1.mpg intermediate2.mpg |\
|
||||||
ffmpeg -f mpeg -i - -same_quant -c:v mpeg4 -acodec libmp3lame output.avi
|
ffmpeg -f mpeg -i - -sameq -vcodec mpeg4 -acodec libmp3lame output.avi
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
Similarly, the yuv4mpegpipe format, and the raw video, raw audio codecs also
|
Similarly, the yuv4mpegpipe format, and the raw video, raw audio codecs also
|
||||||
@@ -268,47 +344,27 @@ cat temp1.a temp2.a > all.a &
|
|||||||
cat temp1.v temp2.v > all.v &
|
cat temp1.v temp2.v > all.v &
|
||||||
ffmpeg -f u16le -acodec pcm_s16le -ac 2 -ar 44100 -i all.a \
|
ffmpeg -f u16le -acodec pcm_s16le -ac 2 -ar 44100 -i all.a \
|
||||||
-f yuv4mpegpipe -i all.v \
|
-f yuv4mpegpipe -i all.v \
|
||||||
-same_quant -y output.flv
|
-sameq -y output.flv
|
||||||
rm temp[12].[av] all.[av]
|
rm temp[12].[av] all.[av]
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
@section -profile option fails when encoding H.264 video with AAC audio
|
@section The ffmpeg program does not respect the -maxrate setting, some frames are bigger than maxrate/fps.
|
||||||
|
|
||||||
@command{ffmpeg} prints an error like
|
Read the MPEG spec about video buffer verifier.
|
||||||
|
|
||||||
@example
|
@section I want CBR, but no matter what I do frame sizes differ.
|
||||||
Undefined constant or missing '(' in 'baseline'
|
|
||||||
Unable to parse option value "baseline"
|
|
||||||
Error setting option profile to value baseline.
|
|
||||||
@end example
|
|
||||||
|
|
||||||
Short answer: write @option{-profile:v} instead of @option{-profile}.
|
You do not understand what CBR is, please read the MPEG spec.
|
||||||
|
Read about video buffer verifier and constant bitrate.
|
||||||
|
The one sentence summary is that there is a buffer and the input rate is
|
||||||
|
constant, the output can vary as needed.
|
||||||
|
|
||||||
Long answer: this happens because the @option{-profile} option can apply to both
|
@section How do I check if a stream is CBR?
|
||||||
video and audio. Specifically the AAC encoder also defines some profiles, none
|
|
||||||
of which are named @var{baseline}.
|
|
||||||
|
|
||||||
The solution is to apply the @option{-profile} option to the video stream only
|
To quote the MPEG-2 spec:
|
||||||
by using @url{http://ffmpeg.org/ffmpeg.html#Stream-specifiers-1, Stream specifiers}.
|
"There is no way to tell that a bitstream is constant bitrate without
|
||||||
Appending @code{:v} to it will do exactly that.
|
examining all of the vbv_delay values and making complicated computations."
|
||||||
|
|
||||||
@section Using @option{-f lavfi}, audio becomes mono for no apparent reason.
|
|
||||||
|
|
||||||
Use @option{-dumpgraph -} to find out exactly where the channel layout is
|
|
||||||
lost.
|
|
||||||
|
|
||||||
Most likely, it is through @code{auto-inserted aconvert}. Try to understand
|
|
||||||
why the converting filter was needed at that place.
|
|
||||||
|
|
||||||
Just before the output is a likely place, as @option{-f lavfi} currently
|
|
||||||
only support packed S16.
|
|
||||||
|
|
||||||
Then insert the correct @code{aconvert} explicitly in the filter graph,
|
|
||||||
specifying the exact format.
|
|
||||||
|
|
||||||
@example
|
|
||||||
aconvert=s16:stereo:packed
|
|
||||||
@end example
|
|
||||||
|
|
||||||
@chapter Development
|
@chapter Development
|
||||||
|
|
||||||
@@ -356,12 +412,12 @@ the FFmpeg Windows Help Forum at
|
|||||||
|
|
||||||
No. These tools are too bloated and they complicate the build.
|
No. These tools are too bloated and they complicate the build.
|
||||||
|
|
||||||
@section Why not rewrite FFmpeg in object-oriented C++?
|
@section Why not rewrite ffmpeg in object-oriented C++?
|
||||||
|
|
||||||
FFmpeg is already organized in a highly modular manner and does not need to
|
FFmpeg is already organized in a highly modular manner and does not need to
|
||||||
be rewritten in a formal object language. Further, many of the developers
|
be rewritten in a formal object language. Further, many of the developers
|
||||||
favor straight C; it works for them. For more arguments on this matter,
|
favor straight C; it works for them. For more arguments on this matter,
|
||||||
read @uref{http://www.tux.org/lkml/#s15, "Programming Religion"}.
|
read "Programming Religion" at (@url{http://www.tux.org/lkml/#s15}).
|
||||||
|
|
||||||
@section Why are the ffmpeg programs devoid of debugging symbols?
|
@section Why are the ffmpeg programs devoid of debugging symbols?
|
||||||
|
|
||||||
@@ -372,10 +428,18 @@ you need the debug information, use the *_g versions.
|
|||||||
@section I do not like the LGPL, can I contribute code under the GPL instead?
|
@section I do not like the LGPL, can I contribute code under the GPL instead?
|
||||||
|
|
||||||
Yes, as long as the code is optional and can easily and cleanly be placed
|
Yes, as long as the code is optional and can easily and cleanly be placed
|
||||||
under #if CONFIG_GPL without breaking anything. So, for example, a new codec
|
under #if CONFIG_GPL without breaking anything. So for example a new codec
|
||||||
or filter would be OK under GPL while a bug fix to LGPL code would not.
|
or filter would be OK under GPL while a bug fix to LGPL code would not.
|
||||||
|
|
||||||
@section I'm using FFmpeg from within my C++ application but the linker complains about missing symbols which seem to be available.
|
@section I want to compile xyz.c alone but my compiler produced many errors.
|
||||||
|
|
||||||
|
Common code is in its own files in libav* and is used by the individual
|
||||||
|
codecs. They will not work without the common parts, you have to compile
|
||||||
|
the whole libav*. If you wish, disable some parts with configure switches.
|
||||||
|
You can also try to hack it and remove more, but if you had problems fixing
|
||||||
|
the compilation failure then you are probably not qualified for this.
|
||||||
|
|
||||||
|
@section I'm using libavcodec from within my C++ application but the linker complains about missing symbols which seem to be available.
|
||||||
|
|
||||||
FFmpeg is a pure C project, so to use the libraries within your C++ application
|
FFmpeg is a pure C project, so to use the libraries within your C++ application
|
||||||
you need to explicitly state that you are using a C library. You can do this by
|
you need to explicitly state that you are using a C library. You can do this by
|
||||||
@@ -385,7 +449,7 @@ See @url{http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html#faq-32.3}
|
|||||||
|
|
||||||
@section I'm using libavutil from within my C++ application but the compiler complains about 'UINT64_C' was not declared in this scope
|
@section I'm using libavutil from within my C++ application but the compiler complains about 'UINT64_C' was not declared in this scope
|
||||||
|
|
||||||
FFmpeg is a pure C project using C99 math features, in order to enable C++
|
Libav is a pure C project using C99 math features, in order to enable C++
|
||||||
to use them you have to append -D__STDC_CONSTANT_MACROS to your CXXFLAGS
|
to use them you have to append -D__STDC_CONSTANT_MACROS to your CXXFLAGS
|
||||||
|
|
||||||
@section I have a file in memory / a API different from *open/*read/ libc how do I use it with libavformat?
|
@section I have a file in memory / a API different from *open/*read/ libc how do I use it with libavformat?
|
||||||
@@ -393,6 +457,14 @@ to use them you have to append -D__STDC_CONSTANT_MACROS to your CXXFLAGS
|
|||||||
You have to implement a URLProtocol, see @file{libavformat/file.c} in
|
You have to implement a URLProtocol, see @file{libavformat/file.c} in
|
||||||
FFmpeg and @file{libmpdemux/demux_lavf.c} in MPlayer sources.
|
FFmpeg and @file{libmpdemux/demux_lavf.c} in MPlayer sources.
|
||||||
|
|
||||||
|
@section I get "No compatible shell script interpreter found." in MSys.
|
||||||
|
|
||||||
|
The standard MSys bash (2.04) is broken. You need to install 2.05 or later.
|
||||||
|
|
||||||
|
@section I get "./configure: line <xxx>: pr: command not found" in MSys.
|
||||||
|
|
||||||
|
The standard MSys install doesn't come with pr. You need to get it from the coreutils package.
|
||||||
|
|
||||||
@section Where can I find libav* headers for Pascal/Delphi?
|
@section Where can I find libav* headers for Pascal/Delphi?
|
||||||
|
|
||||||
see @url{http://www.iversenit.dk/dev/ffmpeg-headers/}
|
see @url{http://www.iversenit.dk/dev/ffmpeg-headers/}
|
||||||
@@ -415,16 +487,4 @@ wrong if it is larger than the average!
|
|||||||
For example, if you have mixed 25 and 30 fps content, then r_frame_rate
|
For example, if you have mixed 25 and 30 fps content, then r_frame_rate
|
||||||
will be 150.
|
will be 150.
|
||||||
|
|
||||||
@section Why is @code{make fate} not running all tests?
|
|
||||||
|
|
||||||
Make sure you have the fate-suite samples and the @code{SAMPLES} Make variable
|
|
||||||
or @code{FATE_SAMPLES} environment variable or the @code{--samples}
|
|
||||||
@command{configure} option is set to the right path.
|
|
||||||
|
|
||||||
@section Why is @code{make fate} not finding the samples?
|
|
||||||
|
|
||||||
Do you happen to have a @code{~} character in the samples path to indicate a
|
|
||||||
home directory? The value is used in ways where the shell cannot expand it,
|
|
||||||
causing FATE to not find files. Just replace @code{~} by the full path.
|
|
||||||
|
|
||||||
@bye
|
@bye
|
||||||
|
|||||||
174
doc/fate.texi
174
doc/fate.texi
@@ -1,174 +0,0 @@
|
|||||||
\input texinfo @c -*- texinfo -*-
|
|
||||||
|
|
||||||
@settitle FATE Automated Testing Environment
|
|
||||||
@titlepage
|
|
||||||
@center @titlefont{FATE Automated Testing Environment}
|
|
||||||
@end titlepage
|
|
||||||
|
|
||||||
@node Top
|
|
||||||
@top
|
|
||||||
|
|
||||||
@contents
|
|
||||||
|
|
||||||
@chapter Introduction
|
|
||||||
|
|
||||||
FATE is an extended regression suite on the client-side and a means
|
|
||||||
for results aggregation and presentation on the server-side.
|
|
||||||
|
|
||||||
The first part of this document explains how you can use FATE from
|
|
||||||
your FFmpeg source directory to test your ffmpeg binary. The second
|
|
||||||
part describes how you can run FATE to submit the results to FFmpeg's
|
|
||||||
FATE server.
|
|
||||||
|
|
||||||
In any way you can have a look at the publicly viewable FATE results
|
|
||||||
by visiting this website:
|
|
||||||
|
|
||||||
@url{http://fate.ffmpeg.org/}
|
|
||||||
|
|
||||||
This is especially recommended for all people contributing source
|
|
||||||
code to FFmpeg, as it can be seen if some test on some platform broke
|
|
||||||
with there recent contribution. This usually happens on the platforms
|
|
||||||
the developers could not test on.
|
|
||||||
|
|
||||||
The second part of this document describes how you can run FATE to
|
|
||||||
submit your results to FFmpeg's FATE server. If you want to submit your
|
|
||||||
results be sure to check that your combination of CPU, OS and compiler
|
|
||||||
is not already listed on the above mentioned website.
|
|
||||||
|
|
||||||
In the third part you can find a comprehensive listing of FATE makefile
|
|
||||||
targets and variables.
|
|
||||||
|
|
||||||
|
|
||||||
@chapter Using FATE from your FFmpeg source directory
|
|
||||||
|
|
||||||
If you want to run FATE on your machine you need to have the samples
|
|
||||||
in place. You can get the samples via the build target fate-rsync.
|
|
||||||
Use this command from the top-level source directory:
|
|
||||||
|
|
||||||
@example
|
|
||||||
make fate-rsync SAMPLES=fate-suite/
|
|
||||||
make fate SAMPLES=fate-suite/
|
|
||||||
@end example
|
|
||||||
|
|
||||||
The above commands set the samples location by passing a makefile
|
|
||||||
variable via command line. It is also possible to set the samples
|
|
||||||
location at source configuration time by invoking configure with
|
|
||||||
`--samples=<path to the samples directory>'. Afterwards you can
|
|
||||||
invoke the makefile targets without setting the SAMPLES makefile
|
|
||||||
variable. This is illustrated by the following commands:
|
|
||||||
|
|
||||||
@example
|
|
||||||
./configure --samples=fate-suite/
|
|
||||||
make fate-rsync
|
|
||||||
make fate
|
|
||||||
@end example
|
|
||||||
|
|
||||||
Yet another way to tell FATE about the location of the sample
|
|
||||||
directory is by making sure the environment variable FATE_SAMPLES
|
|
||||||
contains the path to your samples directory. This can be achieved
|
|
||||||
by e.g. putting that variable in your shell profile or by setting
|
|
||||||
it in your interactive session.
|
|
||||||
|
|
||||||
@example
|
|
||||||
FATE_SAMPLES=fate-suite/ make fate
|
|
||||||
@end example
|
|
||||||
|
|
||||||
@float NOTE
|
|
||||||
Do not put a '~' character in the samples path to indicate a home
|
|
||||||
directory. Because of shell nuances, this will cause FATE to fail.
|
|
||||||
@end float
|
|
||||||
|
|
||||||
|
|
||||||
@chapter Submitting the results to the FFmpeg result aggregation server
|
|
||||||
|
|
||||||
To submit your results to the server you should run fate through the
|
|
||||||
shell script tests/fate.sh from the FFmpeg sources. This script needs
|
|
||||||
to be invoked with a configuration file as its first argument.
|
|
||||||
|
|
||||||
@example
|
|
||||||
tests/fate.sh /path/to/fate_config
|
|
||||||
@end example
|
|
||||||
|
|
||||||
A configuration file template with comments describing the individual
|
|
||||||
configuration variables can be found at @file{tests/fate_config.sh.template}.
|
|
||||||
|
|
||||||
@ifhtml
|
|
||||||
The mentioned configuration template is also available here:
|
|
||||||
@verbatiminclude ../tests/fate_config.sh.template
|
|
||||||
@end ifhtml
|
|
||||||
|
|
||||||
Create a configuration that suits your needs, based on the configuration
|
|
||||||
template. The `slot' configuration variable can be any string that is not
|
|
||||||
yet used, but it is suggested that you name it adhering to the following
|
|
||||||
pattern <arch>-<os>-<compiler>-<compiler version>. The configuration file
|
|
||||||
itself will be sourced in a shell script, therefore all shell features may
|
|
||||||
be used. This enables you to setup the environment as you need it for your
|
|
||||||
build.
|
|
||||||
|
|
||||||
For your first test runs the `fate_recv' variable should be empty or
|
|
||||||
commented out. This will run everything as normal except that it will omit
|
|
||||||
the submission of the results to the server. The following files should be
|
|
||||||
present in $workdir as specified in the configuration file:
|
|
||||||
|
|
||||||
@itemize
|
|
||||||
@item configure.log
|
|
||||||
@item compile.log
|
|
||||||
@item test.log
|
|
||||||
@item report
|
|
||||||
@item version
|
|
||||||
@end itemize
|
|
||||||
|
|
||||||
When you have everything working properly you can create an SSH key and
|
|
||||||
send its public part to the FATE server administrator.
|
|
||||||
|
|
||||||
Configure your SSH client to use public key authentication with that key
|
|
||||||
when connecting to the FATE server. Also do not forget to check the identity
|
|
||||||
of the server and to accept its host key. This can usually be achieved by
|
|
||||||
running your SSH client manually and killing it after you accepted the key.
|
|
||||||
The FATE server's fingerprint is:
|
|
||||||
|
|
||||||
b1:31:c8:79:3f:04:1d:f8:f2:23:26:5a:fd:55:fa:92
|
|
||||||
|
|
||||||
The only thing left is to automate the execution of the fate.sh script and
|
|
||||||
the synchronisation of the samples directory.
|
|
||||||
|
|
||||||
|
|
||||||
@chapter FATE makefile targets and variables
|
|
||||||
|
|
||||||
@section Makefile targets
|
|
||||||
|
|
||||||
@table @option
|
|
||||||
@item fate-rsync
|
|
||||||
Download/synchronize sample files to the configured samples directory.
|
|
||||||
|
|
||||||
@item fate-list
|
|
||||||
Will list all fate/regression test targets.
|
|
||||||
|
|
||||||
@item fate
|
|
||||||
Run the FATE test suite (requires the fate-suite dataset).
|
|
||||||
@end table
|
|
||||||
|
|
||||||
@section Makefile variables
|
|
||||||
|
|
||||||
@table @option
|
|
||||||
@item V
|
|
||||||
Verbosity level, can be set to 0, 1 or 2.
|
|
||||||
@itemize
|
|
||||||
@item 0: show just the test arguments
|
|
||||||
@item 1: show just the command used in the test
|
|
||||||
@item 2: show everything
|
|
||||||
@end itemize
|
|
||||||
|
|
||||||
@item SAMPLES
|
|
||||||
Specify or override the path to the FATE samples at make time, it has a
|
|
||||||
meaning only while running the regression tests.
|
|
||||||
|
|
||||||
@item THREADS
|
|
||||||
Specify how many threads to use while running regression tests, it is
|
|
||||||
quite useful to detect thread-related regressions.
|
|
||||||
@end table
|
|
||||||
|
|
||||||
Example:
|
|
||||||
@example
|
|
||||||
make V=1 SAMPLES=/var/fate/samples THREADS=2 fate
|
|
||||||
@end example
|
|
||||||
45
doc/fate.txt
Normal file
45
doc/fate.txt
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
FATE Automated Testing Environment
|
||||||
|
|
||||||
|
FATE provides a regression testsuite that can be run locally or configured
|
||||||
|
to send reports to fate.ffmpeg.org.
|
||||||
|
In order to run, it needs a large amount of data (samples and references)
|
||||||
|
that is provided separately from the actual source distribution.
|
||||||
|
|
||||||
|
Use the following command to get the fate test samples
|
||||||
|
|
||||||
|
# make fate-rsync SAMPLES=fate-suite/
|
||||||
|
|
||||||
|
To inform the build system about the testsuite location, pass
|
||||||
|
`--samples=<path to the samples>` to configure or set the SAMPLES Make
|
||||||
|
variable or the FATE_SAMPLES environment variable to a suitable value.
|
||||||
|
|
||||||
|
For information on how to set up FATE to send results to the official FFmpeg
|
||||||
|
testing framework, please refer to the following wiki page:
|
||||||
|
http://wiki.multimedia.cx/index.php?title=FATE
|
||||||
|
|
||||||
|
FATE Makefile targets:
|
||||||
|
|
||||||
|
fate-list
|
||||||
|
Will list all fate/regression test targets.
|
||||||
|
|
||||||
|
fate
|
||||||
|
Run the FATE test suite (requires the fate-suite dataset).
|
||||||
|
|
||||||
|
Fate Makefile variables:
|
||||||
|
|
||||||
|
V
|
||||||
|
Verbosity level, can be set to 0, 1 or 2.
|
||||||
|
* 0: show just the test arguments
|
||||||
|
* 1: show just the command used in the test
|
||||||
|
* 2: show everything
|
||||||
|
|
||||||
|
SAMPLES
|
||||||
|
Specify or override the path to the FATE samples at make time, it has a
|
||||||
|
meaning only while running the regression tests.
|
||||||
|
|
||||||
|
THREADS
|
||||||
|
Specify how many threads to use while running regression tests, it is
|
||||||
|
quite useful to detect thread-related regressions.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
make V=1 SAMPLES=/var/fate/samples THREADS=2 fate
|
||||||
4561
doc/ffmpeg-mt-authorship.txt
Normal file
4561
doc/ffmpeg-mt-authorship.txt
Normal file
File diff suppressed because it is too large
Load Diff
604
doc/ffmpeg.texi
604
doc/ffmpeg.texi
@@ -15,7 +15,7 @@ The generic syntax is:
|
|||||||
|
|
||||||
@example
|
@example
|
||||||
@c man begin SYNOPSIS
|
@c man begin SYNOPSIS
|
||||||
ffmpeg [global options] [[infile options][@option{-i} @var{infile}]]... @{[outfile options] @var{outfile}@}...
|
ffmpeg [[infile options][@option{-i} @var{infile}]]... @{[outfile options] @var{outfile}@}...
|
||||||
@c man end
|
@c man end
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
@@ -26,39 +26,21 @@ ffmpeg is a very fast video and audio converter that can also grab from
|
|||||||
a live audio/video source. It can also convert between arbitrary sample
|
a live audio/video source. It can also convert between arbitrary sample
|
||||||
rates and resize video on the fly with a high quality polyphase filter.
|
rates and resize video on the fly with a high quality polyphase filter.
|
||||||
|
|
||||||
ffmpeg reads from an arbitrary number of input "files" (which can be regular
|
The command line interface is designed to be intuitive, in the sense
|
||||||
files, pipes, network streams, grabbing devices, etc.), specified by the
|
that ffmpeg tries to figure out all parameters that can possibly be
|
||||||
@code{-i} option, and writes to an arbitrary number of output "files", which are
|
derived automatically. You usually only have to specify the target
|
||||||
specified by a plain output filename. Anything found on the command line which
|
bitrate you want.
|
||||||
cannot be interpreted as an option is considered to be an output filename.
|
|
||||||
|
|
||||||
Each input or output file can in principle contain any number of streams of
|
|
||||||
different types (video/audio/subtitle/attachment/data). Allowed number and/or
|
|
||||||
types of streams can be limited by the container format. Selecting, which
|
|
||||||
streams from which inputs go into output, is done either automatically or with
|
|
||||||
the @code{-map} option (see the Stream selection chapter).
|
|
||||||
|
|
||||||
To refer to input files in options, you must use their indices (0-based). E.g.
|
|
||||||
the first input file is @code{0}, the second is @code{1} etc. Similarly, streams
|
|
||||||
within a file are referred to by their indices. E.g. @code{2:3} refers to the
|
|
||||||
fourth stream in the third input file. See also the Stream specifiers chapter.
|
|
||||||
|
|
||||||
As a general rule, options are applied to the next specified
|
As a general rule, options are applied to the next specified
|
||||||
file. Therefore, order is important, and you can have the same
|
file. Therefore, order is important, and you can have the same
|
||||||
option on the command line multiple times. Each occurrence is
|
option on the command line multiple times. Each occurrence is
|
||||||
then applied to the next input or output file.
|
then applied to the next input or output file.
|
||||||
Exceptions from this rule are the global options (e.g. verbosity level),
|
|
||||||
which should be specified first.
|
|
||||||
|
|
||||||
Do not mix input and output files -- first specify all input files, then all
|
|
||||||
output files. Also do not mix options which belong to different files. All
|
|
||||||
options apply ONLY to the next input or output file and are reset between files.
|
|
||||||
|
|
||||||
@itemize
|
@itemize
|
||||||
@item
|
@item
|
||||||
To set the video bitrate of the output file to 64kbit/s:
|
To set the video bitrate of the output file to 64kbit/s:
|
||||||
@example
|
@example
|
||||||
ffmpeg -i input.avi -b:v 64k output.avi
|
ffmpeg -i input.avi -b 64k output.avi
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
@item
|
@item
|
||||||
@@ -77,90 +59,51 @@ ffmpeg -r 1 -i input.m2v -r 24 output.avi
|
|||||||
|
|
||||||
The format option may be needed for raw input files.
|
The format option may be needed for raw input files.
|
||||||
|
|
||||||
|
By default ffmpeg tries to convert as losslessly as possible: It
|
||||||
|
uses the same audio and video parameters for the outputs as the one
|
||||||
|
specified for the inputs.
|
||||||
|
|
||||||
@c man end DESCRIPTION
|
@c man end DESCRIPTION
|
||||||
|
|
||||||
@chapter Stream selection
|
|
||||||
@c man begin STREAM SELECTION
|
|
||||||
|
|
||||||
By default ffmpeg includes only one stream of each type (video, audio, subtitle)
|
|
||||||
present in the input files and adds them to each output file. It picks the
|
|
||||||
"best" of each based upon the following criteria; for video it is the stream
|
|
||||||
with the highest resolution, for audio the stream with the most channels, for
|
|
||||||
subtitle it's the first subtitle stream. In the case where several streams of
|
|
||||||
the same type rate equally, the lowest numbered stream is chosen.
|
|
||||||
|
|
||||||
You can disable some of those defaults by using @code{-vn/-an/-sn} options. For
|
|
||||||
full manual control, use the @code{-map} option, which disables the defaults just
|
|
||||||
described.
|
|
||||||
|
|
||||||
@c man end STREAM SELECTION
|
|
||||||
|
|
||||||
@chapter Options
|
@chapter Options
|
||||||
@c man begin OPTIONS
|
@c man begin OPTIONS
|
||||||
|
|
||||||
@include avtools-common-opts.texi
|
@include fftools-common-opts.texi
|
||||||
|
|
||||||
@section Main options
|
@section Main options
|
||||||
|
|
||||||
@table @option
|
@table @option
|
||||||
|
|
||||||
@item -f @var{fmt} (@emph{input/output})
|
@item -f @var{fmt}
|
||||||
Force input or output file format. The format is normally auto detected for input
|
Force format.
|
||||||
files and guessed from file extension for output files, so this option is not
|
|
||||||
needed in most cases.
|
|
||||||
|
|
||||||
@item -i @var{filename} (@emph{input})
|
@item -i @var{filename}
|
||||||
input file name
|
input file name
|
||||||
|
|
||||||
@item -y (@emph{global})
|
@item -y
|
||||||
Overwrite output files without asking.
|
Overwrite output files.
|
||||||
|
|
||||||
@item -n (@emph{global})
|
@item -t @var{duration}
|
||||||
Do not overwrite output files but exit if file exists.
|
Restrict the transcoded/captured video sequence
|
||||||
|
to the duration specified in seconds.
|
||||||
|
@code{hh:mm:ss[.xxx]} syntax is also supported.
|
||||||
|
|
||||||
@item -c[:@var{stream_specifier}] @var{codec} (@emph{input/output,per-stream})
|
@item -fs @var{limit_size}
|
||||||
@itemx -codec[:@var{stream_specifier}] @var{codec} (@emph{input/output,per-stream})
|
|
||||||
Select an encoder (when used before an output file) or a decoder (when used
|
|
||||||
before an input file) for one or more streams. @var{codec} is the name of a
|
|
||||||
decoder/encoder or a special value @code{copy} (output only) to indicate that
|
|
||||||
the stream is not to be re-encoded.
|
|
||||||
|
|
||||||
For example
|
|
||||||
@example
|
|
||||||
ffmpeg -i INPUT -map 0 -c:v libx264 -c:a copy OUTPUT
|
|
||||||
@end example
|
|
||||||
encodes all video streams with libx264 and copies all audio streams.
|
|
||||||
|
|
||||||
For each stream, the last matching @code{c} option is applied, so
|
|
||||||
@example
|
|
||||||
ffmpeg -i INPUT -map 0 -c copy -c:v:1 libx264 -c:a:137 libvorbis OUTPUT
|
|
||||||
@end example
|
|
||||||
will copy all the streams except the second video, which will be encoded with
|
|
||||||
libx264, and the 138th audio, which will be encoded with libvorbis.
|
|
||||||
|
|
||||||
@item -t @var{duration} (@emph{output})
|
|
||||||
Stop writing the output after its duration reaches @var{duration}.
|
|
||||||
@var{duration} may be a number in seconds, or in @code{hh:mm:ss[.xxx]} form.
|
|
||||||
|
|
||||||
@item -fs @var{limit_size} (@emph{output})
|
|
||||||
Set the file size limit.
|
Set the file size limit.
|
||||||
|
|
||||||
@item -ss @var{position} (@emph{input/output})
|
@item -ss @var{position}
|
||||||
When used as an input option (before @code{-i}), seeks in this input file to
|
Seek to given time position in seconds.
|
||||||
@var{position}. When used as an output option (before an output filename),
|
@code{hh:mm:ss[.xxx]} syntax is also supported.
|
||||||
decodes but discards input until the timestamps reach @var{position}. This is
|
|
||||||
slower, but more accurate.
|
|
||||||
|
|
||||||
@var{position} may be either in seconds or in @code{hh:mm:ss[.xxx]} form.
|
@item -itsoffset @var{offset}
|
||||||
|
|
||||||
@item -itsoffset @var{offset} (@emph{input})
|
|
||||||
Set the input time offset in seconds.
|
Set the input time offset in seconds.
|
||||||
@code{[-]hh:mm:ss[.xxx]} syntax is also supported.
|
@code{[-]hh:mm:ss[.xxx]} syntax is also supported.
|
||||||
|
This option affects all the input files that follow it.
|
||||||
The offset is added to the timestamps of the input files.
|
The offset is added to the timestamps of the input files.
|
||||||
Specifying a positive offset means that the corresponding
|
Specifying a positive offset means that the corresponding
|
||||||
streams are delayed by @var{offset} seconds.
|
streams are delayed by 'offset' seconds.
|
||||||
|
|
||||||
@item -timestamp @var{time} (@emph{output})
|
@item -timestamp @var{time}
|
||||||
Set the recording timestamp in the container.
|
Set the recording timestamp in the container.
|
||||||
The syntax for @var{time} is:
|
The syntax for @var{time} is:
|
||||||
@example
|
@example
|
||||||
@@ -172,31 +115,21 @@ interpreted as UTC.
|
|||||||
If the year-month-day part is not specified it takes the current
|
If the year-month-day part is not specified it takes the current
|
||||||
year-month-day.
|
year-month-day.
|
||||||
|
|
||||||
@item -metadata[:metadata_specifier] @var{key}=@var{value} (@emph{output,per-metadata})
|
@item -metadata @var{key}=@var{value}
|
||||||
Set a metadata key/value pair.
|
Set a metadata key/value pair.
|
||||||
|
|
||||||
An optional @var{metadata_specifier} may be given to set metadata
|
|
||||||
on streams or chapters. See @code{-map_metadata} documentation for
|
|
||||||
details.
|
|
||||||
|
|
||||||
This option overrides metadata set with @code{-map_metadata}. It is
|
|
||||||
also possible to delete metadata by using an empty value.
|
|
||||||
|
|
||||||
For example, for setting the title in the output file:
|
For example, for setting the title in the output file:
|
||||||
@example
|
@example
|
||||||
ffmpeg -i in.avi -metadata title="my title" out.flv
|
ffmpeg -i in.avi -metadata title="my title" out.flv
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
To set the language of the first audio stream:
|
@item -v @var{number}
|
||||||
@example
|
Set the logging verbosity level.
|
||||||
ffmpeg -i INPUT -metadata:s:a:1 language=eng OUTPUT
|
|
||||||
@end example
|
|
||||||
|
|
||||||
@item -target @var{type} (@emph{output})
|
@item -target @var{type}
|
||||||
Specify target file type (@code{vcd}, @code{svcd}, @code{dvd}, @code{dv},
|
Specify target file type ("vcd", "svcd", "dvd", "dv", "dv50", "pal-vcd",
|
||||||
@code{dv50}). @var{type} may be prefixed with @code{pal-}, @code{ntsc-} or
|
"ntsc-svcd", ... ). All the format options (bitrate, codecs,
|
||||||
@code{film-} to use the corresponding standard. All the format options
|
buffer sizes) are then set automatically. You can just type:
|
||||||
(bitrate, codecs, buffer sizes) are then set automatically. You can just type:
|
|
||||||
|
|
||||||
@example
|
@example
|
||||||
ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg
|
ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg
|
||||||
@@ -209,71 +142,33 @@ they do not conflict with the standard, as in:
|
|||||||
ffmpeg -i myfile.avi -target vcd -bf 2 /tmp/vcd.mpg
|
ffmpeg -i myfile.avi -target vcd -bf 2 /tmp/vcd.mpg
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
@item -dframes @var{number} (@emph{output})
|
@item -dframes @var{number}
|
||||||
Set the number of data frames to record. This is an alias for @code{-frames:d}.
|
Set the number of data frames to record.
|
||||||
|
|
||||||
@item -frames[:@var{stream_specifier}] @var{framecount} (@emph{output,per-stream})
|
@item -scodec @var{codec}
|
||||||
Stop writing to the stream after @var{framecount} frames.
|
Force subtitle codec ('copy' to copy stream).
|
||||||
|
|
||||||
@item -q[:@var{stream_specifier}] @var{q} (@emph{output,per-stream})
|
@item -newsubtitle
|
||||||
@itemx -qscale[:@var{stream_specifier}] @var{q} (@emph{output,per-stream})
|
Add a new subtitle stream to the current output stream.
|
||||||
Use fixed quality scale (VBR). The meaning of @var{q} is
|
|
||||||
codec-dependent.
|
|
||||||
|
|
||||||
@item -filter[:@var{stream_specifier}] @var{filter_graph} (@emph{output,per-stream})
|
@item -slang @var{code}
|
||||||
@var{filter_graph} is a description of the filter graph to apply to
|
Set the ISO 639 language code (3 letters) of the current subtitle stream.
|
||||||
the stream. Use @code{-filters} to show all the available filters
|
|
||||||
(including also sources and sinks).
|
|
||||||
@item -pre[:@var{stream_specifier}] @var{preset_name} (@emph{output,per-stream})
|
|
||||||
Specify the preset for matching stream(s).
|
|
||||||
|
|
||||||
@item -stats (@emph{global})
|
|
||||||
Print encoding progress/statistics. On by default.
|
|
||||||
|
|
||||||
@item -attach @var{filename} (@emph{output})
|
|
||||||
Add an attachment to the output file. This is supported by a few formats
|
|
||||||
like Matroska for e.g. fonts used in rendering subtitles. Attachments
|
|
||||||
are implemented as a specific type of stream, so this option will add
|
|
||||||
a new stream to the file. It is then possible to use per-stream options
|
|
||||||
on this stream in the usual way. Attachment streams created with this
|
|
||||||
option will be created after all the other streams (i.e. those created
|
|
||||||
with @code{-map} or automatic mappings).
|
|
||||||
|
|
||||||
Note that for Matroska you also have to set the mimetype metadata tag:
|
|
||||||
@example
|
|
||||||
ffmpeg -i INPUT -attach DejaVuSans.ttf -metadata:s:2 mimetype=application/x-truetype-font out.mkv
|
|
||||||
@end example
|
|
||||||
(assuming that the attachment stream will be third in the output file).
|
|
||||||
|
|
||||||
@item -dump_attachment[:@var{stream_specifier}] @var{filename} (@emph{input,per-stream})
|
|
||||||
Extract the matching attachment stream into a file named @var{filename}. If
|
|
||||||
@var{filename} is empty, then the value of the @code{filename} metadata tag
|
|
||||||
will be used.
|
|
||||||
|
|
||||||
E.g. to extract the first attachment to a file named 'out.ttf':
|
|
||||||
@example
|
|
||||||
ffmpeg -dump_attachment:t:0 out.ttf INPUT
|
|
||||||
@end example
|
|
||||||
To extract all attachments to files determined by the @code{filename} tag:
|
|
||||||
@example
|
|
||||||
ffmpeg -dump_attachment:t "" INPUT
|
|
||||||
@end example
|
|
||||||
|
|
||||||
Technical note -- attachments are implemented as codec extradata, so this
|
|
||||||
option can actually be used to extract extradata from any stream, not just
|
|
||||||
attachments.
|
|
||||||
|
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@section Video Options
|
@section Video Options
|
||||||
|
|
||||||
@table @option
|
@table @option
|
||||||
@item -vframes @var{number} (@emph{output})
|
@item -b @var{bitrate}
|
||||||
Set the number of video frames to record. This is an alias for @code{-frames:v}.
|
Set the video bitrate in bit/s (default = 200 kb/s).
|
||||||
@item -r[:@var{stream_specifier}] @var{fps} (@emph{input/output,per-stream})
|
@item -vframes @var{number}
|
||||||
|
Set the number of video frames to record.
|
||||||
|
@item -r @var{fps}
|
||||||
Set frame rate (Hz value, fraction or abbreviation), (default = 25).
|
Set frame rate (Hz value, fraction or abbreviation), (default = 25).
|
||||||
@item -s[:@var{stream_specifier}] @var{size} (@emph{input/output,per-stream})
|
@item -s @var{size}
|
||||||
Set frame size. The format is @samp{wxh} (default - same as source).
|
Set frame size. The format is @samp{wxh} (ffserver default = 160x128).
|
||||||
|
There is no default for input streams,
|
||||||
|
for output streams it is set by default to the size of the source stream.
|
||||||
The following abbreviations are recognized:
|
The following abbreviations are recognized:
|
||||||
@table @samp
|
@table @samp
|
||||||
@item sqcif
|
@item sqcif
|
||||||
@@ -336,7 +231,7 @@ The following abbreviations are recognized:
|
|||||||
1920x1080
|
1920x1080
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@item -aspect[:@var{stream_specifier}] @var{aspect} (@emph{output,per-stream})
|
@item -aspect @var{aspect}
|
||||||
Set the video display aspect ratio specified by @var{aspect}.
|
Set the video display aspect ratio specified by @var{aspect}.
|
||||||
|
|
||||||
@var{aspect} can be a floating point number string, or a string of the
|
@var{aspect} can be a floating point number string, or a string of the
|
||||||
@@ -358,8 +253,7 @@ crop=width:height:x:y instead.
|
|||||||
@item -padcolor @var{hex_color}
|
@item -padcolor @var{hex_color}
|
||||||
All the pad options have been removed. Use -vf
|
All the pad options have been removed. Use -vf
|
||||||
pad=width:height:x:y:color instead.
|
pad=width:height:x:y:color instead.
|
||||||
|
@item -vn
|
||||||
@item -vn (@emph{output})
|
|
||||||
Disable video recording.
|
Disable video recording.
|
||||||
@item -bt @var{tolerance}
|
@item -bt @var{tolerance}
|
||||||
Set video bitrate tolerance (in bits, default 4000k).
|
Set video bitrate tolerance (in bits, default 4000k).
|
||||||
@@ -375,19 +269,17 @@ Requires -bufsize to be set.
|
|||||||
Set min video bitrate (in bit/s).
|
Set min video bitrate (in bit/s).
|
||||||
Most useful in setting up a CBR encode:
|
Most useful in setting up a CBR encode:
|
||||||
@example
|
@example
|
||||||
ffmpeg -i myfile.avi -b:v 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k out.m2v
|
ffmpeg -i myfile.avi -b 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k out.m2v
|
||||||
@end example
|
@end example
|
||||||
It is of little use elsewise.
|
It is of little use elsewise.
|
||||||
@item -bufsize @var{size}
|
@item -bufsize @var{size}
|
||||||
Set video buffer verifier buffer size (in bits).
|
Set video buffer verifier buffer size (in bits).
|
||||||
@item -vcodec @var{codec} (@emph{output})
|
@item -vcodec @var{codec}
|
||||||
Set the video codec. This is an alias for @code{-codec:v}.
|
Force video codec to @var{codec}. Use the @code{copy} special value to
|
||||||
@item -same_quant
|
tell that the raw codec data must be copied as is.
|
||||||
|
@item -sameq
|
||||||
Use same quantizer as source (implies VBR).
|
Use same quantizer as source (implies VBR).
|
||||||
|
|
||||||
Note that this is NOT SAME QUALITY. Do not use this option unless you know you
|
|
||||||
need it.
|
|
||||||
|
|
||||||
@item -pass @var{n}
|
@item -pass @var{n}
|
||||||
Select the pass number (1 or 2). It is used to do two-pass
|
Select the pass number (1 or 2). It is used to do two-pass
|
||||||
video encoding. The statistics of the video are recorded in the first
|
video encoding. The statistics of the video are recorded in the first
|
||||||
@@ -397,41 +289,46 @@ at the exact requested bitrate.
|
|||||||
On pass 1, you may just deactivate audio and set output to null,
|
On pass 1, you may just deactivate audio and set output to null,
|
||||||
examples for Windows and Unix:
|
examples for Windows and Unix:
|
||||||
@example
|
@example
|
||||||
ffmpeg -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y NUL
|
ffmpeg -i foo.mov -vcodec libxvid -pass 1 -an -f rawvideo -y NUL
|
||||||
ffmpeg -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y /dev/null
|
ffmpeg -i foo.mov -vcodec libxvid -pass 1 -an -f rawvideo -y /dev/null
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
@item -passlogfile @var{prefix} (@emph{global})
|
@item -passlogfile @var{prefix}
|
||||||
Set two-pass log file name prefix to @var{prefix}, the default file name
|
Set two-pass log file name prefix to @var{prefix}, the default file name
|
||||||
prefix is ``ffmpeg2pass''. The complete file name will be
|
prefix is ``ffmpeg2pass''. The complete file name will be
|
||||||
@file{PREFIX-N.log}, where N is a number specific to the output
|
@file{PREFIX-N.log}, where N is a number specific to the output
|
||||||
stream
|
stream.
|
||||||
|
|
||||||
|
@item -newvideo
|
||||||
|
Add a new video stream to the current output stream.
|
||||||
|
|
||||||
@item -vlang @var{code}
|
@item -vlang @var{code}
|
||||||
Set the ISO 639 language code (3 letters) of the current video stream.
|
Set the ISO 639 language code (3 letters) of the current video stream.
|
||||||
|
|
||||||
@item -vf @var{filter_graph} (@emph{output})
|
@item -vf @var{filter_graph}
|
||||||
@var{filter_graph} is a description of the filter graph to apply to
|
@var{filter_graph} is a description of the filter graph to apply to
|
||||||
the input video.
|
the input video.
|
||||||
Use the option "-filters" to show all the available filters (including
|
Use the option "-filters" to show all the available filters (including
|
||||||
also sources and sinks). This is an alias for @code{-filter:v}.
|
also sources and sinks).
|
||||||
|
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@section Advanced Video Options
|
@section Advanced Video Options
|
||||||
|
|
||||||
@table @option
|
@table @option
|
||||||
@item -pix_fmt[:@var{stream_specifier}] @var{format} (@emph{input/output,per-stream})
|
@item -pix_fmt @var{format}
|
||||||
Set pixel format. Use @code{-pix_fmts} to show all the supported
|
Set pixel format. Use 'list' as parameter to show all the supported
|
||||||
pixel formats.
|
pixel formats.
|
||||||
@item -sws_flags @var{flags} (@emph{input/output})
|
@item -sws_flags @var{flags}
|
||||||
Set SwScaler flags.
|
Set SwScaler flags.
|
||||||
@item -g @var{gop_size}
|
@item -g @var{gop_size}
|
||||||
Set the group of pictures size.
|
Set the group of pictures size.
|
||||||
@item -intra
|
@item -intra
|
||||||
deprecated, use -g 1
|
Use only intra frames.
|
||||||
@item -vdt @var{n}
|
@item -vdt @var{n}
|
||||||
Discard threshold.
|
Discard threshold.
|
||||||
|
@item -qscale @var{q}
|
||||||
|
Use fixed video quantizer scale (VBR).
|
||||||
@item -qmin @var{q}
|
@item -qmin @var{q}
|
||||||
minimum video quantizer scale (VBR)
|
minimum video quantizer scale (VBR)
|
||||||
@item -qmax @var{q}
|
@item -qmax @var{q}
|
||||||
@@ -503,8 +400,8 @@ and the following constants are available:
|
|||||||
@item avgTex
|
@item avgTex
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@item -rc_override[:@var{stream_specifier}] @var{override} (@emph{output,per-stream})
|
@item -rc_override @var{override}
|
||||||
Rate control override for specific intervals, formatted as "int,int,int"
|
Rate control override for specific intervals, formated as "int,int,int"
|
||||||
list separated with slashes. Two first values are the beginning and
|
list separated with slashes. Two first values are the beginning and
|
||||||
end frame numbers, last one is quantizer to use if positive, or quality
|
end frame numbers, last one is quantizer to use if positive, or quality
|
||||||
factor if negative.
|
factor if negative.
|
||||||
@@ -632,59 +529,69 @@ Calculate PSNR of compressed frames.
|
|||||||
Dump video coding statistics to @file{vstats_HHMMSS.log}.
|
Dump video coding statistics to @file{vstats_HHMMSS.log}.
|
||||||
@item -vstats_file @var{file}
|
@item -vstats_file @var{file}
|
||||||
Dump video coding statistics to @var{file}.
|
Dump video coding statistics to @var{file}.
|
||||||
@item -top[:@var{stream_specifier}] @var{n} (@emph{output,per-stream})
|
@item -top @var{n}
|
||||||
top=1/bottom=0/auto=-1 field first
|
top=1/bottom=0/auto=-1 field first
|
||||||
@item -dc @var{precision}
|
@item -dc @var{precision}
|
||||||
Intra_dc_precision.
|
Intra_dc_precision.
|
||||||
@item -vtag @var{fourcc/tag} (@emph{output})
|
@item -vtag @var{fourcc/tag}
|
||||||
Force video tag/fourcc. This is an alias for @code{-tag:v}.
|
Force video tag/fourcc.
|
||||||
@item -qphist (@emph{global})
|
@item -qphist
|
||||||
Show QP histogram
|
Show QP histogram.
|
||||||
@item -vbsf @var{bitstream_filter}
|
@item -vbsf @var{bitstream_filter}
|
||||||
Deprecated see -bsf
|
Bitstream filters available are "dump_extra", "remove_extra", "noise", "h264_mp4toannexb", "imxdump", "mjpegadump", "mjpeg2jpeg".
|
||||||
@item -force_key_frames[:@var{stream_specifier}] @var{time}[,@var{time}...] (@emph{output,per-stream})
|
@example
|
||||||
|
ffmpeg -i h264.mp4 -vcodec copy -vbsf h264_mp4toannexb -an out.h264
|
||||||
|
@end example
|
||||||
|
@item -force_key_frames @var{time}[,@var{time}...]
|
||||||
Force key frames at the specified timestamps, more precisely at the first
|
Force key frames at the specified timestamps, more precisely at the first
|
||||||
frames after each specified time.
|
frames after each specified time.
|
||||||
This option can be useful to ensure that a seek point is present at a
|
This option can be useful to ensure that a seek point is present at a
|
||||||
chapter mark or any other designated place in the output file.
|
chapter mark or any other designated place in the output file.
|
||||||
The timestamps must be specified in ascending order.
|
The timestamps must be specified in ascending order.
|
||||||
|
|
||||||
@item -copyinkf[:@var{stream_specifier}] (@emph{output,per-stream})
|
|
||||||
When doing stream copy, copy also non-key frames found at the
|
|
||||||
beginning.
|
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@section Audio Options
|
@section Audio Options
|
||||||
|
|
||||||
@table @option
|
@table @option
|
||||||
@item -aframes @var{number} (@emph{output})
|
@item -aframes @var{number}
|
||||||
Set the number of audio frames to record. This is an alias for @code{-frames:a}.
|
Set the number of audio frames to record.
|
||||||
@item -ar[:@var{stream_specifier}] @var{freq} (@emph{input/output,per-stream})
|
@item -ar @var{freq}
|
||||||
Set the audio sampling frequency. For output streams it is set by
|
Set the audio sampling frequency. there is no default for input streams,
|
||||||
default to the frequency of the corresponding input stream. For input
|
for output streams it is set by default to the frequency of the input stream.
|
||||||
streams this option only makes sense for audio grabbing devices and raw
|
@item -ab @var{bitrate}
|
||||||
demuxers and is mapped to the corresponding demuxer options.
|
Set the audio bitrate in bit/s (default = 64k).
|
||||||
@item -aq @var{q} (@emph{output})
|
@item -aq @var{q}
|
||||||
Set the audio quality (codec-specific, VBR). This is an alias for -q:a.
|
Set the audio quality (codec-specific, VBR).
|
||||||
@item -ac[:@var{stream_specifier}] @var{channels} (@emph{input/output,per-stream})
|
@item -ac @var{channels}
|
||||||
Set the number of audio channels. For output streams it is set by
|
Set the number of audio channels. For input streams it is set by
|
||||||
default to the number of input audio channels. For input streams
|
default to 1, for output streams it is set by default to the same
|
||||||
this option only makes sense for audio grabbing devices and raw demuxers
|
number of audio channels in input.
|
||||||
and is mapped to the corresponding demuxer options.
|
@item -an
|
||||||
@item -an (@emph{output})
|
|
||||||
Disable audio recording.
|
Disable audio recording.
|
||||||
@item -acodec @var{codec} (@emph{input/output})
|
@item -acodec @var{codec}
|
||||||
Set the audio codec. This is an alias for @code{-codec:a}.
|
Force audio codec to @var{codec}. Use the @code{copy} special value to
|
||||||
@item -sample_fmt[:@var{stream_specifier}] @var{sample_fmt} (@emph{output,per-stream})
|
specify that the raw codec data must be copied as is.
|
||||||
Set the audio sample format. Use @code{-sample_fmts} to get a list
|
@item -newaudio
|
||||||
of supported sample formats.
|
Add a new audio track to the output file. If you want to specify parameters,
|
||||||
|
do so before @code{-newaudio} (@code{-acodec}, @code{-ab}, etc..).
|
||||||
|
|
||||||
|
Mapping will be done automatically, if the number of output streams is equal to
|
||||||
|
the number of input streams, else it will pick the first one that matches. You
|
||||||
|
can override the mapping using @code{-map} as usual.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
@example
|
||||||
|
ffmpeg -i file.mpg -vcodec copy -acodec ac3 -ab 384k test.mpg -acodec mp2 -ab 192k -newaudio
|
||||||
|
@end example
|
||||||
|
@item -alang @var{code}
|
||||||
|
Set the ISO 639 language code (3 letters) of the current audio stream.
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@section Advanced Audio options:
|
@section Advanced Audio options:
|
||||||
|
|
||||||
@table @option
|
@table @option
|
||||||
@item -atag @var{fourcc/tag} (@emph{output})
|
@item -atag @var{fourcc/tag}
|
||||||
Force audio tag/fourcc. This is an alias for @code{-tag:a}.
|
Force audio tag/fourcc.
|
||||||
@item -audio_service_type @var{type}
|
@item -audio_service_type @var{type}
|
||||||
Set the type of service that the audio stream contains.
|
Set the type of service that the audio stream contains.
|
||||||
@table @option
|
@table @option
|
||||||
@@ -708,155 +615,91 @@ Voice Over
|
|||||||
Karaoke
|
Karaoke
|
||||||
@end table
|
@end table
|
||||||
@item -absf @var{bitstream_filter}
|
@item -absf @var{bitstream_filter}
|
||||||
Deprecated, see -bsf
|
Bitstream filters available are "dump_extra", "remove_extra", "noise", "mp3comp", "mp3decomp".
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@section Subtitle options:
|
@section Subtitle options:
|
||||||
|
|
||||||
@table @option
|
@table @option
|
||||||
|
@item -scodec @var{codec}
|
||||||
|
Force subtitle codec ('copy' to copy stream).
|
||||||
|
@item -newsubtitle
|
||||||
|
Add a new subtitle stream to the current output stream.
|
||||||
@item -slang @var{code}
|
@item -slang @var{code}
|
||||||
Set the ISO 639 language code (3 letters) of the current subtitle stream.
|
Set the ISO 639 language code (3 letters) of the current subtitle stream.
|
||||||
@item -scodec @var{codec} (@emph{input/output})
|
@item -sn
|
||||||
Set the subtitle codec. This is an alias for @code{-codec:s}.
|
|
||||||
@item -sn (@emph{output})
|
|
||||||
Disable subtitle recording.
|
Disable subtitle recording.
|
||||||
@item -sbsf @var{bitstream_filter}
|
@item -sbsf @var{bitstream_filter}
|
||||||
Deprecated, see -bsf
|
Bitstream filters available are "mov2textsub", "text2movsub".
|
||||||
|
@example
|
||||||
|
ffmpeg -i file.mov -an -vn -sbsf mov2textsub -scodec copy -f rawvideo sub.txt
|
||||||
|
@end example
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@section Audio/Video grab options
|
@section Audio/Video grab options
|
||||||
|
|
||||||
@table @option
|
@table @option
|
||||||
@item -isync (@emph{global})
|
@item -vc @var{channel}
|
||||||
|
Set video grab channel (DV1394 only).
|
||||||
|
@item -tvstd @var{standard}
|
||||||
|
Set television standard (NTSC, PAL (SECAM)).
|
||||||
|
@item -isync
|
||||||
Synchronize read on input.
|
Synchronize read on input.
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@section Advanced options
|
@section Advanced options
|
||||||
|
|
||||||
@table @option
|
@table @option
|
||||||
@item -map [-]@var{input_file_id}[:@var{stream_specifier}][,@var{sync_file_id}[:@var{stream_specifier}]] (@emph{output})
|
@item -map @var{input_file_id}.@var{input_stream_id}[:@var{sync_file_id}.@var{sync_stream_id}]
|
||||||
|
|
||||||
Designate one or more input streams as a source for the output file. Each input
|
Designate an input stream as a source for the output file. Each input
|
||||||
stream is identified by the input file index @var{input_file_id} and
|
stream is identified by the input file index @var{input_file_id} and
|
||||||
the input stream index @var{input_stream_id} within the input
|
the input stream index @var{input_stream_id} within the input
|
||||||
file. Both indices start at 0. If specified,
|
file. Both indexes start at 0. If specified,
|
||||||
@var{sync_file_id}:@var{stream_specifier} sets which input stream
|
@var{sync_file_id}.@var{sync_stream_id} sets which input stream
|
||||||
is used as a presentation sync reference.
|
is used as a presentation sync reference.
|
||||||
|
|
||||||
The first @code{-map} option on the command line specifies the
|
The @code{-map} options must be specified just after the output file.
|
||||||
|
If any @code{-map} options are used, the number of @code{-map} options
|
||||||
|
on the command line must match the number of streams in the output
|
||||||
|
file. The first @code{-map} option on the command line specifies the
|
||||||
source for output stream 0, the second @code{-map} option specifies
|
source for output stream 0, the second @code{-map} option specifies
|
||||||
the source for output stream 1, etc.
|
the source for output stream 1, etc.
|
||||||
|
|
||||||
A @code{-} character before the stream identifier creates a "negative" mapping.
|
|
||||||
It disables matching streams from already created mappings.
|
|
||||||
|
|
||||||
For example, to map ALL streams from the first input file to output
|
|
||||||
@example
|
|
||||||
ffmpeg -i INPUT -map 0 output
|
|
||||||
@end example
|
|
||||||
|
|
||||||
For example, if you have two audio streams in the first input file,
|
For example, if you have two audio streams in the first input file,
|
||||||
these streams are identified by "0:0" and "0:1". You can use
|
these streams are identified by "0.0" and "0.1". You can use
|
||||||
@code{-map} to select which streams to place in an output file. For
|
@code{-map} to select which stream to place in an output file. For
|
||||||
example:
|
example:
|
||||||
@example
|
@example
|
||||||
ffmpeg -i INPUT -map 0:1 out.wav
|
ffmpeg -i INPUT out.wav -map 0.1
|
||||||
@end example
|
@end example
|
||||||
will map the input stream in @file{INPUT} identified by "0:1" to
|
will map the input stream in @file{INPUT} identified by "0.1" to
|
||||||
the (single) output stream in @file{out.wav}.
|
the (single) output stream in @file{out.wav}.
|
||||||
|
|
||||||
For example, to select the stream with index 2 from input file
|
For example, to select the stream with index 2 from input file
|
||||||
@file{a.mov} (specified by the identifier "0:2"), and stream with
|
@file{a.mov} (specified by the identifier "0.2"), and stream with
|
||||||
index 6 from input @file{b.mov} (specified by the identifier "1:6"),
|
index 6 from input @file{b.mov} (specified by the identifier "1.6"),
|
||||||
and copy them to the output file @file{out.mov}:
|
and copy them to the output file @file{out.mov}:
|
||||||
@example
|
@example
|
||||||
ffmpeg -i a.mov -i b.mov -c copy -map 0:2 -map 1:6 out.mov
|
ffmpeg -i a.mov -i b.mov -vcodec copy -acodec copy out.mov -map 0.2 -map 1.6
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
To select all video and the third audio stream from an input file:
|
To add more streams to the output file, you can use the
|
||||||
@example
|
@code{-newaudio}, @code{-newvideo}, @code{-newsubtitle} options.
|
||||||
ffmpeg -i INPUT -map 0:v -map 0:a:2 OUTPUT
|
|
||||||
@end example
|
|
||||||
|
|
||||||
To map all the streams except the second audio, use negative mappings
|
@item -map_meta_data @var{outfile}[,@var{metadata}]:@var{infile}[,@var{metadata}]
|
||||||
@example
|
Deprecated, use @var{-map_metadata} instead.
|
||||||
ffmpeg -i INPUT -map 0 -map -0:a:1 OUTPUT
|
|
||||||
@end example
|
|
||||||
|
|
||||||
Note that using this option disables the default mappings for this output file.
|
@item -map_metadata @var{outfile}[,@var{metadata}]:@var{infile}[,@var{metadata}]
|
||||||
|
Set metadata information of @var{outfile} from @var{infile}. Note that those
|
||||||
|
are file indices (zero-based), not filenames.
|
||||||
|
Optional @var{metadata} parameters specify, which metadata to copy - (g)lobal
|
||||||
|
(i.e. metadata that applies to the whole file), per-(s)tream, per-(c)hapter or
|
||||||
|
per-(p)rogram. All metadata specifiers other than global must be followed by the
|
||||||
|
stream/chapter/program number. If metadata specifier is omitted, it defaults to
|
||||||
|
global.
|
||||||
|
|
||||||
@item -map_channel [@var{input_file_id}.@var{stream_specifier}.@var{channel_id}|-1][:@var{output_file_id}.@var{stream_specifier}]
|
By default, global metadata is copied from the first input file to all output files,
|
||||||
Map an audio channel from a given input to an output. If
|
|
||||||
@var{output_file_id}.@var{stream_specifier} are not set, the audio channel will
|
|
||||||
be mapped on all the audio streams.
|
|
||||||
|
|
||||||
Using "-1" instead of
|
|
||||||
@var{input_file_id}.@var{stream_specifier}.@var{channel_id} will map a muted
|
|
||||||
channel.
|
|
||||||
|
|
||||||
For example, assuming @var{INPUT} is a stereo audio file, you can switch the
|
|
||||||
two audio channels with the following command:
|
|
||||||
@example
|
|
||||||
ffmpeg -i INPUT -map_channel 0.0.1 -map_channel 0.0.0 OUTPUT
|
|
||||||
@end example
|
|
||||||
|
|
||||||
If you want to mute the first channel and keep the second:
|
|
||||||
@example
|
|
||||||
ffmpeg -i INPUT -map_channel -1 -map_channel 0.0.1 OUTPUT
|
|
||||||
@end example
|
|
||||||
|
|
||||||
The order of the "-map_channel" option specifies the order of the channels in
|
|
||||||
the output stream. The output channel layout is guessed from the number of
|
|
||||||
channels mapped (mono if one "-map_channel", stereo if two, etc.). Using "-ac"
|
|
||||||
in combination of "-map_channel" makes the channel gain levels to be updated if
|
|
||||||
channel layouts don't match (for instance two "-map_channel" options and "-ac
|
|
||||||
6").
|
|
||||||
|
|
||||||
You can also extract each channel of an @var{INPUT} to specific outputs; the
|
|
||||||
following command extract each channel of the audio stream (file 0, stream 0)
|
|
||||||
to the respective @var{OUTPUT_CH0} and @var{OUTPUT_CH1}:
|
|
||||||
@example
|
|
||||||
ffmpeg -i INPUT -map_channel 0.0.0 OUTPUT_CH0 -map_channel 0.0.1 OUTPUT_CH1
|
|
||||||
@end example
|
|
||||||
|
|
||||||
The following example split the channels of a stereo input into streams:
|
|
||||||
|
|
||||||
@example
|
|
||||||
ffmpeg -i stereo.wav -map 0:0 -map 0:0 -map_channel 0.0.0:0.0 -map_channel 0.0.1:0.1 -y out.ogg
|
|
||||||
@end example
|
|
||||||
|
|
||||||
Note that currently each output stream can only contain channels from a single
|
|
||||||
input stream; you can't for example use "-map_channel" to pick multiple input
|
|
||||||
audio channels contained in different streams (from the same or different files)
|
|
||||||
and merge them into a single output stream. It is therefore not currently
|
|
||||||
possible, for example, to turn two separate mono streams into a single stereo
|
|
||||||
stream. However spliting a stereo stream into two single channel mono streams
|
|
||||||
is possible.
|
|
||||||
|
|
||||||
@item -map_metadata[:@var{metadata_spec_out}] @var{infile}[:@var{metadata_spec_in}] (@emph{output,per-metadata})
|
|
||||||
Set metadata information of the next output file from @var{infile}. Note that
|
|
||||||
those are file indices (zero-based), not filenames.
|
|
||||||
Optional @var{metadata_spec_in/out} parameters specify, which metadata to copy.
|
|
||||||
A metadata specifier can have the following forms:
|
|
||||||
@table @option
|
|
||||||
@item @var{g}
|
|
||||||
global metadata, i.e. metadata that applies to the whole file
|
|
||||||
|
|
||||||
@item @var{s}[:@var{stream_spec}]
|
|
||||||
per-stream metadata. @var{stream_spec} is a stream specifier as described
|
|
||||||
in the @ref{Stream specifiers} chapter. In an input metadata specifier, the first
|
|
||||||
matching stream is copied from. In an output metadata specifier, all matching
|
|
||||||
streams are copied to.
|
|
||||||
|
|
||||||
@item @var{c}:@var{chapter_index}
|
|
||||||
per-chapter metadata. @var{chapter_index} is the zero-based chapter index.
|
|
||||||
|
|
||||||
@item @var{p}:@var{program_index}
|
|
||||||
per-program metadata. @var{program_index} is the zero-based program index.
|
|
||||||
@end table
|
|
||||||
If metadata specifier is omitted, it defaults to global.
|
|
||||||
|
|
||||||
By default, global metadata is copied from the first input file,
|
|
||||||
per-stream and per-chapter metadata is copied along with streams/chapters. These
|
per-stream and per-chapter metadata is copied along with streams/chapters. These
|
||||||
default mappings are disabled by creating any mapping of the relevant type. A negative
|
default mappings are disabled by creating any mapping of the relevant type. A negative
|
||||||
file index can be used to create a dummy mapping that just disables automatic copying.
|
file index can be used to create a dummy mapping that just disables automatic copying.
|
||||||
@@ -864,21 +707,12 @@ file index can be used to create a dummy mapping that just disables automatic co
|
|||||||
For example to copy metadata from the first stream of the input file to global metadata
|
For example to copy metadata from the first stream of the input file to global metadata
|
||||||
of the output file:
|
of the output file:
|
||||||
@example
|
@example
|
||||||
ffmpeg -i in.ogg -map_metadata 0:s:0 out.mp3
|
ffmpeg -i in.ogg -map_metadata 0:0,s0 out.mp3
|
||||||
@end example
|
@end example
|
||||||
|
@item -map_chapters @var{outfile}:@var{infile}
|
||||||
To do the reverse, i.e. copy global metadata to all audio streams:
|
Copy chapters from @var{infile} to @var{outfile}. If no chapter mapping is specified,
|
||||||
@example
|
then chapters are copied from the first input file with at least one chapter to all
|
||||||
ffmpeg -i in.mkv -map_metadata:s:a 0:g out.mkv
|
output files. Use a negative file index to disable any chapter copying.
|
||||||
@end example
|
|
||||||
Note that simple @code{0} would work as well in this example, since global
|
|
||||||
metadata is assumed by default.
|
|
||||||
|
|
||||||
@item -map_chapters @var{input_file_index} (@emph{output})
|
|
||||||
Copy chapters from input file with index @var{input_file_index} to the next
|
|
||||||
output file. If no chapter mapping is specified, then chapters are copied from
|
|
||||||
the first input file with at least one chapter. Use a negative file index to
|
|
||||||
disable any chapter copying.
|
|
||||||
@item -debug @var{category}
|
@item -debug @var{category}
|
||||||
Print specific debug info.
|
Print specific debug info.
|
||||||
@var{category} is a number or a string containing one of the following values:
|
@var{category} is a number or a string containing one of the following values:
|
||||||
@@ -912,44 +746,42 @@ visualize block types
|
|||||||
@item vis_qp
|
@item vis_qp
|
||||||
visualize quantization parameter (QP), lower QP are tinted greener
|
visualize quantization parameter (QP), lower QP are tinted greener
|
||||||
@end table
|
@end table
|
||||||
@item -benchmark (@emph{global})
|
@item -benchmark
|
||||||
Show benchmarking information at the end of an encode.
|
Show benchmarking information at the end of an encode.
|
||||||
Shows CPU time used and maximum memory consumption.
|
Shows CPU time used and maximum memory consumption.
|
||||||
Maximum memory consumption is not supported on all systems,
|
Maximum memory consumption is not supported on all systems,
|
||||||
it will usually display as 0 if not supported.
|
it will usually display as 0 if not supported.
|
||||||
@item -timelimit @var{duration} (@emph{global})
|
@item -dump
|
||||||
Exit after ffmpeg has been running for @var{duration} seconds.
|
Dump each input packet.
|
||||||
@item -dump (@emph{global})
|
@item -hex
|
||||||
Dump each input packet to stderr.
|
|
||||||
@item -hex (@emph{global})
|
|
||||||
When dumping packets, also dump the payload.
|
When dumping packets, also dump the payload.
|
||||||
|
@item -bitexact
|
||||||
|
Only use bit exact algorithms (for codec testing).
|
||||||
@item -ps @var{size}
|
@item -ps @var{size}
|
||||||
Set RTP payload size in bytes.
|
Set RTP payload size in bytes.
|
||||||
@item -re (@emph{input})
|
@item -re
|
||||||
Read input at native frame rate. Mainly used to simulate a grab device.
|
Read input at native frame rate. Mainly used to simulate a grab device.
|
||||||
@item -loop_input
|
@item -loop_input
|
||||||
Loop over the input stream. Currently it works only for image
|
Loop over the input stream. Currently it works only for image
|
||||||
streams. This option is used for automatic FFserver testing.
|
streams. This option is used for automatic FFserver testing.
|
||||||
This option is deprecated, use -loop 1.
|
|
||||||
@item -loop_output @var{number_of_times}
|
@item -loop_output @var{number_of_times}
|
||||||
Repeatedly loop output for formats that support looping such as animated GIF
|
Repeatedly loop output for formats that support looping such as animated GIF
|
||||||
(0 will loop the output infinitely).
|
(0 will loop the output infinitely).
|
||||||
This option is deprecated, use -loop.
|
|
||||||
@item -threads @var{count}
|
@item -threads @var{count}
|
||||||
Thread count.
|
Thread count.
|
||||||
@item -vsync @var{parameter}
|
@item -vsync @var{parameter}
|
||||||
Video sync method.
|
Video sync method.
|
||||||
|
|
||||||
@table @option
|
@table @option
|
||||||
@item 0, passthrough
|
@item 0
|
||||||
Each frame is passed with its timestamp from the demuxer to the muxer.
|
Each frame is passed with its timestamp from the demuxer to the muxer.
|
||||||
@item 1, cfr
|
@item 1
|
||||||
Frames will be duplicated and dropped to achieve exactly the requested
|
Frames will be duplicated and dropped to achieve exactly the requested
|
||||||
constant framerate.
|
constant framerate.
|
||||||
@item 2, vfr
|
@item 2
|
||||||
Frames are passed through with their timestamp or dropped so as to
|
Frames are passed through with their timestamp or dropped so as to
|
||||||
prevent 2 frames from having the same timestamp.
|
prevent 2 frames from having the same timestamp.
|
||||||
@item -1, auto
|
@item -1
|
||||||
Chooses between 1 and 2 depending on muxer capabilities. This is the
|
Chooses between 1 and 2 depending on muxer capabilities. This is the
|
||||||
default method.
|
default method.
|
||||||
@end table
|
@end table
|
||||||
@@ -971,11 +803,11 @@ Copy input stream time base from input to output when stream copying.
|
|||||||
Finish encoding when the shortest input stream ends.
|
Finish encoding when the shortest input stream ends.
|
||||||
@item -dts_delta_threshold
|
@item -dts_delta_threshold
|
||||||
Timestamp discontinuity delta threshold.
|
Timestamp discontinuity delta threshold.
|
||||||
@item -muxdelay @var{seconds} (@emph{input})
|
@item -muxdelay @var{seconds}
|
||||||
Set the maximum demux-decode delay.
|
Set the maximum demux-decode delay.
|
||||||
@item -muxpreload @var{seconds} (@emph{input})
|
@item -muxpreload @var{seconds}
|
||||||
Set the initial demux-decode delay.
|
Set the initial demux-decode delay.
|
||||||
@item -streamid @var{output-stream-index}:@var{new-value} (@emph{output})
|
@item -streamid @var{output-stream-index}:@var{new-value}
|
||||||
Assign a new stream-id value to an output stream. This option should be
|
Assign a new stream-id value to an output stream. This option should be
|
||||||
specified prior to the output filename to which it applies.
|
specified prior to the output filename to which it applies.
|
||||||
For the situation where multiple output files exist, a streamid
|
For the situation where multiple output files exist, a streamid
|
||||||
@@ -986,35 +818,15 @@ an output mpegts file:
|
|||||||
@example
|
@example
|
||||||
ffmpeg -i infile -streamid 0:33 -streamid 1:36 out.ts
|
ffmpeg -i infile -streamid 0:33 -streamid 1:36 out.ts
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
@item -bsf[:@var{stream_specifier}] @var{bitstream_filters} (@emph{output,per-stream})
|
|
||||||
Set bitstream filters for matching streams. @var{bistream_filters} is
|
|
||||||
a comma-separated list of bitstream filters. Use the @code{-bsfs} option
|
|
||||||
to get the list of bitstream filters.
|
|
||||||
@example
|
|
||||||
ffmpeg -i h264.mp4 -c:v copy -vbsf h264_mp4toannexb -an out.h264
|
|
||||||
@end example
|
|
||||||
@example
|
|
||||||
ffmpeg -i file.mov -an -vn -sbsf mov2textsub -c:s copy -f rawvideo sub.txt
|
|
||||||
@end example
|
|
||||||
|
|
||||||
@item -tag[:@var{stream_specifier}] @var{codec_tag} (@emph{per-stream})
|
|
||||||
Force a tag/fourcc for matching streams.
|
|
||||||
|
|
||||||
@item -timecode @var{hh}:@var{mm}:@var{ss}SEP@var{ff}
|
|
||||||
Specify Timecode for writing. @var{SEP} is ':' for non drop timecode and ';'
|
|
||||||
(or '.') for drop.
|
|
||||||
@example
|
|
||||||
ffmpeg -i input.mpg -timecode 01:02:03.04 -r 30000/1001 -s ntsc output.mpg
|
|
||||||
@end example
|
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@section Preset files
|
@section Preset files
|
||||||
|
|
||||||
A preset file contains a sequence of @var{option}=@var{value} pairs,
|
A preset file contains a sequence of @var{option}=@var{value} pairs,
|
||||||
one for each line, specifying a sequence of options which would be
|
one for each line, specifying a sequence of options which would be
|
||||||
awkward to specify on the command line. Lines starting with the hash
|
awkward to specify on the command line. Lines starting with the hash
|
||||||
('#') character are ignored and are used to provide comments. Check
|
('#') character are ignored and are used to provide comments. Check
|
||||||
the @file{presets} directory in the FFmpeg source tree for examples.
|
the @file{ffpresets} directory in the FFmpeg source tree for examples.
|
||||||
|
|
||||||
Preset files are specified with the @code{vpre}, @code{apre},
|
Preset files are specified with the @code{vpre}, @code{apre},
|
||||||
@code{spre}, and @code{fpre} options. The @code{fpre} option takes the
|
@code{spre}, and @code{fpre} options. The @code{fpre} option takes the
|
||||||
@@ -1041,7 +853,7 @@ directories, where @var{codec_name} is the name of the codec to which
|
|||||||
the preset file options will be applied. For example, if you select
|
the preset file options will be applied. For example, if you select
|
||||||
the video codec with @code{-vcodec libx264} and use @code{-vpre max},
|
the video codec with @code{-vcodec libx264} and use @code{-vpre max},
|
||||||
then it will search for the file @file{libx264-max.ffpreset}.
|
then it will search for the file @file{libx264-max.ffpreset}.
|
||||||
@c man end OPTIONS
|
@c man end
|
||||||
|
|
||||||
@chapter Tips
|
@chapter Tips
|
||||||
@c man begin TIPS
|
@c man begin TIPS
|
||||||
@@ -1054,7 +866,7 @@ the Linux player does not seem to be very fast, so it can miss
|
|||||||
frames. An example is:
|
frames. An example is:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
ffmpeg -g 3 -r 3 -t 10 -b:v 50k -s qcif -f rv10 /tmp/b.rm
|
ffmpeg -g 3 -r 3 -t 10 -b 50k -s qcif -f rv10 /tmp/b.rm
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
@item
|
@item
|
||||||
@@ -1081,27 +893,17 @@ To have a constant quality (but a variable bitrate), use the option
|
|||||||
'-qscale n' when 'n' is between 1 (excellent quality) and 31 (worst
|
'-qscale n' when 'n' is between 1 (excellent quality) and 31 (worst
|
||||||
quality).
|
quality).
|
||||||
|
|
||||||
|
@item
|
||||||
|
When converting video files, you can use the '-sameq' option which
|
||||||
|
uses the same quality factor in the encoder as in the decoder.
|
||||||
|
It allows almost lossless encoding.
|
||||||
|
|
||||||
@end itemize
|
@end itemize
|
||||||
@c man end TIPS
|
@c man end TIPS
|
||||||
|
|
||||||
@chapter Examples
|
@chapter Examples
|
||||||
@c man begin EXAMPLES
|
@c man begin EXAMPLES
|
||||||
|
|
||||||
@section Preset files
|
|
||||||
|
|
||||||
A preset file contains a sequence of @var{option=value} pairs, one for
|
|
||||||
each line, specifying a sequence of options which can be specified also on
|
|
||||||
the command line. Lines starting with the hash ('#') character are ignored and
|
|
||||||
are used to provide comments. Empty lines are also ignored. Check the
|
|
||||||
@file{presets} directory in the FFmpeg source tree for examples.
|
|
||||||
|
|
||||||
Preset files are specified with the @code{pre} option, this option takes a
|
|
||||||
preset name as input. FFmpeg searches for a file named @var{preset_name}.avpreset in
|
|
||||||
the directories @file{$AVCONV_DATADIR} (if set), and @file{$HOME/.ffmpeg}, and in
|
|
||||||
the data directory defined at configuration time (usually @file{$PREFIX/share/ffmpeg})
|
|
||||||
in that order. For example, if the argument is @code{libx264-max}, it will
|
|
||||||
search for the file @file{libx264-max.avpreset}.
|
|
||||||
|
|
||||||
@section Video and Audio grabbing
|
@section Video and Audio grabbing
|
||||||
|
|
||||||
If you specify the input format and device then ffmpeg can grab video
|
If you specify the input format and device then ffmpeg can grab video
|
||||||
@@ -1111,14 +913,9 @@ and audio directly.
|
|||||||
ffmpeg -f oss -i /dev/dsp -f video4linux2 -i /dev/video0 /tmp/out.mpg
|
ffmpeg -f oss -i /dev/dsp -f video4linux2 -i /dev/video0 /tmp/out.mpg
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
Or with an ALSA audio source (mono input, card id 1) instead of OSS:
|
|
||||||
@example
|
|
||||||
ffmpeg -f alsa -ac 1 -i hw:1 -f video4linux2 -i /dev/video0 /tmp/out.mpg
|
|
||||||
@end example
|
|
||||||
|
|
||||||
Note that you must activate the right video source and channel before
|
Note that you must activate the right video source and channel before
|
||||||
launching ffmpeg with any TV viewer such as
|
launching ffmpeg with any TV viewer such as xawtv
|
||||||
@uref{http://linux.bytesex.org/xawtv/, xawtv} by Gerd Knorr. You also
|
(@url{http://linux.bytesex.org/xawtv/}) by Gerd Knorr. You also
|
||||||
have to set the audio recording levels correctly with a
|
have to set the audio recording levels correctly with a
|
||||||
standard mixer.
|
standard mixer.
|
||||||
|
|
||||||
@@ -1206,7 +1003,7 @@ You can encode to several formats at the same time and define a
|
|||||||
mapping from input stream to output streams:
|
mapping from input stream to output streams:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
ffmpeg -i /tmp/a.wav -map 0:a -b:a 64k /tmp/a.mp2 -map 0:a -b:a 128k /tmp/b.mp2
|
ffmpeg -i /tmp/a.wav -ab 64k /tmp/a.mp2 -ab 128k /tmp/b.mp2 -map 0:0 -map 0:0
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
Converts a.wav to a.mp2 at 64 kbits and to b.mp2 at 128 kbits. '-map
|
Converts a.wav to a.mp2 at 64 kbits and to b.mp2 at 128 kbits. '-map
|
||||||
@@ -1217,7 +1014,7 @@ stream, in the order of the definition of output streams.
|
|||||||
You can transcode decrypted VOBs:
|
You can transcode decrypted VOBs:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
ffmpeg -i snatch_1.vob -f avi -c:v mpeg4 -b:v 800k -g 300 -bf 2 -c:a libmp3lame -b:a 128k snatch.avi
|
ffmpeg -i snatch_1.vob -f avi -vcodec mpeg4 -b 800k -g 300 -bf 2 -acodec libmp3lame -ab 128k snatch.avi
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
This is a typical DVD ripping example; the input is a VOB file, the
|
This is a typical DVD ripping example; the input is a VOB file, the
|
||||||
@@ -1261,11 +1058,16 @@ only formats accepting a normal integer are suitable.
|
|||||||
You can put many streams of the same type in the output:
|
You can put many streams of the same type in the output:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
ffmpeg -i test1.avi -i test2.avi -map 0.3 -map 0.2 -map 0.1 -map 0.0 -c copy test12.nut
|
ffmpeg -i test1.avi -i test2.avi -vcodec copy -acodec copy -vcodec copy -acodec copy test12.avi -newvideo -newaudio
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
The resulting output file @file{test12.avi} will contain first four streams from
|
In addition to the first video and audio streams, the resulting
|
||||||
the input file in reverse order.
|
output file @file{test12.avi} will contain the second video
|
||||||
|
and the second audio stream found in the input streams list.
|
||||||
|
|
||||||
|
The @code{-newvideo}, @code{-newaudio} and @code{-newsubtitle}
|
||||||
|
options have to be specified immediately after the name of the output
|
||||||
|
file to which you want to add them.
|
||||||
|
|
||||||
@end itemize
|
@end itemize
|
||||||
@c man end EXAMPLES
|
@c man end EXAMPLES
|
||||||
@@ -1292,7 +1094,7 @@ ffplay(1), ffprobe(1), ffserver(1) and the FFmpeg HTML documentation
|
|||||||
@c man end
|
@c man end
|
||||||
|
|
||||||
@c man begin AUTHORS
|
@c man begin AUTHORS
|
||||||
See git history
|
The FFmpeg developers
|
||||||
@c man end
|
@c man end
|
||||||
|
|
||||||
@end ignore
|
@end ignore
|
||||||
|
|||||||
@@ -1,47 +0,0 @@
|
|||||||
:
|
|
||||||
ffmpeg.c : libav*
|
|
||||||
======== : ======
|
|
||||||
:
|
|
||||||
:
|
|
||||||
--------------------------------:---> AVStream...
|
|
||||||
InputStream input_streams[] / :
|
|
||||||
/ :
|
|
||||||
InputFile input_files[] +==========================+ / ^ :
|
|
||||||
------> 0 | : st ---:-----------:--/ : :
|
|
||||||
^ +------+-----------+-----+ / +--------------------------+ : :
|
|
||||||
: | :ist_index--:-----:---------/ 1 | : st : | : :
|
|
||||||
: +------+-----------+-----+ +==========================+ : :
|
|
||||||
nb_input_files : | :ist_index--:-----:------------------> 2 | : st : | : :
|
|
||||||
: +------+-----------+-----+ +--------------------------+ : nb_input_streams :
|
|
||||||
: | :ist_index : | 3 | ... | : :
|
|
||||||
v +------+-----------+-----+ +--------------------------+ : :
|
|
||||||
--> 4 | | : :
|
|
||||||
| +--------------------------+ : :
|
|
||||||
| 5 | | : :
|
|
||||||
| +==========================+ v :
|
|
||||||
| :
|
|
||||||
| :
|
|
||||||
| :
|
|
||||||
| :
|
|
||||||
--------- --------------------------------:---> AVStream...
|
|
||||||
\ / :
|
|
||||||
OutputStream output_streams[] / :
|
|
||||||
\ / :
|
|
||||||
+======\======================/======+ ^ :
|
|
||||||
------> 0 | : source_index : st-:--- | : :
|
|
||||||
OuputFile output_files[] / +------------------------------------+ : :
|
|
||||||
/ 1 | : : : | : :
|
|
||||||
^ +------+------------+-----+ / +------------------------------------+ : :
|
|
||||||
: | : ost_index -:-----:------/ 2 | : : : | : :
|
|
||||||
nb_output_files : +------+------------+-----+ +====================================+ : :
|
|
||||||
: | : ost_index -:-----|-----------------> 3 | : : : | : :
|
|
||||||
: +------+------------+-----+ +------------------------------------+ : nb_output_streams :
|
|
||||||
: | : : | 4 | | : :
|
|
||||||
: +------+------------+-----+ +------------------------------------+ : :
|
|
||||||
: | : : | 5 | | : :
|
|
||||||
v +------+------------+-----+ +------------------------------------+ : :
|
|
||||||
6 | | : :
|
|
||||||
+------------------------------------+ : :
|
|
||||||
7 | | : :
|
|
||||||
+====================================+ v :
|
|
||||||
:
|
|
||||||
@@ -28,7 +28,7 @@ various FFmpeg APIs.
|
|||||||
@chapter Options
|
@chapter Options
|
||||||
@c man begin OPTIONS
|
@c man begin OPTIONS
|
||||||
|
|
||||||
@include avtools-common-opts.texi
|
@include fftools-common-opts.texi
|
||||||
|
|
||||||
@section Main options
|
@section Main options
|
||||||
|
|
||||||
@@ -38,9 +38,8 @@ Force displayed width.
|
|||||||
@item -y @var{height}
|
@item -y @var{height}
|
||||||
Force displayed height.
|
Force displayed height.
|
||||||
@item -s @var{size}
|
@item -s @var{size}
|
||||||
Set frame size (WxH or abbreviation), needed for videos which do
|
Set frame size (WxH or abbreviation), needed for videos which don't
|
||||||
not contain a header with the frame size like raw YUV. This option
|
contain a header with the frame size like raw YUV.
|
||||||
has been deprecated in favor of private options, try -video_size.
|
|
||||||
@item -an
|
@item -an
|
||||||
Disable audio.
|
Disable audio.
|
||||||
@item -vn
|
@item -vn
|
||||||
@@ -91,7 +90,6 @@ Read @var{input_file}.
|
|||||||
@table @option
|
@table @option
|
||||||
@item -pix_fmt @var{format}
|
@item -pix_fmt @var{format}
|
||||||
Set pixel format.
|
Set pixel format.
|
||||||
This option has been deprecated in favor of private options, try -pixel_format.
|
|
||||||
@item -stats
|
@item -stats
|
||||||
Show the stream duration, the codec parameters, the current position in
|
Show the stream duration, the codec parameters, the current position in
|
||||||
the stream and the audio/video synchronisation drift.
|
the stream and the audio/video synchronisation drift.
|
||||||
@@ -134,8 +132,6 @@ Exit when video is done playing.
|
|||||||
Exit if any key is pressed.
|
Exit if any key is pressed.
|
||||||
@item -exitonmousedown
|
@item -exitonmousedown
|
||||||
Exit if any mouse button is pressed.
|
Exit if any mouse button is pressed.
|
||||||
@item -codec:@var{stream_type}
|
|
||||||
Force a specific decoder implementation
|
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@section While playing
|
@section While playing
|
||||||
@@ -168,9 +164,6 @@ Seek backward/forward 10 seconds.
|
|||||||
@item down/up
|
@item down/up
|
||||||
Seek backward/forward 1 minute.
|
Seek backward/forward 1 minute.
|
||||||
|
|
||||||
@item page down/page up
|
|
||||||
Seek backward/forward 10 minutes.
|
|
||||||
|
|
||||||
@item mouse click
|
@item mouse click
|
||||||
Seek to percentage in file corresponding to fraction of width.
|
Seek to percentage in file corresponding to fraction of width.
|
||||||
|
|
||||||
|
|||||||
219
doc/ffprobe.texi
219
doc/ffprobe.texi
@@ -42,18 +42,25 @@ for specifying which information to display, and for setting how
|
|||||||
ffprobe will show it.
|
ffprobe will show it.
|
||||||
|
|
||||||
ffprobe output is designed to be easily parsable by a textual filter,
|
ffprobe output is designed to be easily parsable by a textual filter,
|
||||||
and consists of one or more sections of a form defined by the selected
|
and consists of one or more sections of the form:
|
||||||
writer, which is specified by the @option{print_format} option.
|
@example
|
||||||
|
[SECTION]
|
||||||
|
key1=val1
|
||||||
|
...
|
||||||
|
keyN=valN
|
||||||
|
[/SECTION]
|
||||||
|
@end example
|
||||||
|
|
||||||
Metadata tags stored in the container or in the streams are recognized
|
Metadata tags stored in the container or in the streams are recognized
|
||||||
and printed in the corresponding "FORMAT" or "STREAM" section.
|
and printed in the corresponding "FORMAT" or "STREAM" section, and
|
||||||
|
are prefixed by the string "TAG:".
|
||||||
|
|
||||||
@c man end
|
@c man end
|
||||||
|
|
||||||
@chapter Options
|
@chapter Options
|
||||||
@c man begin OPTIONS
|
@c man begin OPTIONS
|
||||||
|
|
||||||
@include avtools-common-opts.texi
|
@include fftools-common-opts.texi
|
||||||
|
|
||||||
@section Main options
|
@section Main options
|
||||||
|
|
||||||
@@ -80,25 +87,6 @@ Use sexagesimal format HH:MM:SS.MICROSECONDS for time values.
|
|||||||
Prettify the format of the displayed values, it corresponds to the
|
Prettify the format of the displayed values, it corresponds to the
|
||||||
options "-unit -prefix -byte_binary_prefix -sexagesimal".
|
options "-unit -prefix -byte_binary_prefix -sexagesimal".
|
||||||
|
|
||||||
@item -print_format @var{writer_name}[=@var{writer_options}]
|
|
||||||
Set the output printing format.
|
|
||||||
|
|
||||||
@var{writer_name} specifies the name of the writer, and
|
|
||||||
@var{writer_options} specifies the options to be passed to the writer.
|
|
||||||
|
|
||||||
For example for printing the output in JSON format, specify:
|
|
||||||
@example
|
|
||||||
-print_format json
|
|
||||||
@end example
|
|
||||||
|
|
||||||
For more details on the available output printing formats, see the
|
|
||||||
Writers section below.
|
|
||||||
|
|
||||||
@item -show_error
|
|
||||||
Show information about the error found when trying to probe the input.
|
|
||||||
|
|
||||||
The error information is printed within a section with name "ERROR".
|
|
||||||
|
|
||||||
@item -show_format
|
@item -show_format
|
||||||
Show information about the container format of the input multimedia
|
Show information about the container format of the input multimedia
|
||||||
stream.
|
stream.
|
||||||
@@ -113,13 +101,6 @@ stream.
|
|||||||
The information for each single packet is printed within a dedicated
|
The information for each single packet is printed within a dedicated
|
||||||
section with name "PACKET".
|
section with name "PACKET".
|
||||||
|
|
||||||
@item -show_frames
|
|
||||||
Show information about each frame contained in the input multimedia
|
|
||||||
stream.
|
|
||||||
|
|
||||||
The information for each single frame is printed within a dedicated
|
|
||||||
section with name "FRAME".
|
|
||||||
|
|
||||||
@item -show_streams
|
@item -show_streams
|
||||||
Show information about each media stream contained in the input
|
Show information about each media stream contained in the input
|
||||||
multimedia stream.
|
multimedia stream.
|
||||||
@@ -127,190 +108,12 @@ multimedia stream.
|
|||||||
Each media stream information is printed within a dedicated section
|
Each media stream information is printed within a dedicated section
|
||||||
with name "STREAM".
|
with name "STREAM".
|
||||||
|
|
||||||
@item -show_private_data, -private
|
|
||||||
Show private data, that is data depending on the format of the
|
|
||||||
particular shown element.
|
|
||||||
This option is enabled by default, but you may need to disable it
|
|
||||||
for specific uses, for example when creating XSD-compliant XML output.
|
|
||||||
|
|
||||||
@item -show_program_version
|
|
||||||
Show information related to program version.
|
|
||||||
|
|
||||||
Version information is printed within a section with name
|
|
||||||
"PROGRAM_VERSION".
|
|
||||||
|
|
||||||
@item -show_library_versions
|
|
||||||
Show information related to library versions.
|
|
||||||
|
|
||||||
Version information for each library is printed within a section with
|
|
||||||
name "LIBRARY_VERSION".
|
|
||||||
|
|
||||||
@item -show_versions
|
|
||||||
Show information related to program and library versions. This is the
|
|
||||||
equivalent of setting both @option{-show_program_version} and
|
|
||||||
@option{-show_library_versions} options.
|
|
||||||
|
|
||||||
@item -i @var{input_file}
|
@item -i @var{input_file}
|
||||||
Read @var{input_file}.
|
Read @var{input_file}.
|
||||||
|
|
||||||
@end table
|
@end table
|
||||||
@c man end
|
@c man end
|
||||||
|
|
||||||
@chapter Writers
|
|
||||||
@c man begin WRITERS
|
|
||||||
|
|
||||||
A writer defines the output format adopted by @command{ffprobe}, and will be
|
|
||||||
used for printing all the parts of the output.
|
|
||||||
|
|
||||||
A writer may accept one or more arguments, which specify the options to
|
|
||||||
adopt.
|
|
||||||
|
|
||||||
A description of the currently available writers follows.
|
|
||||||
|
|
||||||
@section default
|
|
||||||
Default format.
|
|
||||||
|
|
||||||
Print each section in the form:
|
|
||||||
@example
|
|
||||||
[SECTION]
|
|
||||||
key1=val1
|
|
||||||
...
|
|
||||||
keyN=valN
|
|
||||||
[/SECTION]
|
|
||||||
@end example
|
|
||||||
|
|
||||||
Metadata tags are printed as a line in the corresponding FORMAT or
|
|
||||||
STREAM section, and are prefixed by the string "TAG:".
|
|
||||||
|
|
||||||
@section compact
|
|
||||||
Compact format.
|
|
||||||
|
|
||||||
Each section is printed on a single line.
|
|
||||||
If no option is specifid, the output has the form:
|
|
||||||
@example
|
|
||||||
section|key1=val1| ... |keyN=valN
|
|
||||||
@end example
|
|
||||||
|
|
||||||
Metadata tags are printed in the corresponding "format" or "stream"
|
|
||||||
section. A metadata tag key, if printed, is prefixed by the string
|
|
||||||
"tag:".
|
|
||||||
|
|
||||||
This writer accepts options as a list of @var{key}=@var{value} pairs,
|
|
||||||
separated by ":".
|
|
||||||
|
|
||||||
The description of the accepted options follows.
|
|
||||||
|
|
||||||
@table @option
|
|
||||||
|
|
||||||
@item item_sep, s
|
|
||||||
Specify the character to use for separating fields in the output line.
|
|
||||||
It must be a single printable character, it is "|" by default.
|
|
||||||
|
|
||||||
@item nokey, nk
|
|
||||||
If set to 1 specify not to print the key of each field. Its default
|
|
||||||
value is 0.
|
|
||||||
|
|
||||||
@item escape, e
|
|
||||||
Set the escape mode to use, default to "c".
|
|
||||||
|
|
||||||
It can assume one of the following values:
|
|
||||||
@table @option
|
|
||||||
@item c
|
|
||||||
Perform C-like escaping. Strings containing a newline ('\n') or
|
|
||||||
carriage return ('\r'), the escaping character ('\') or the item
|
|
||||||
separator character @var{SEP} are escaped using C-like fashioned
|
|
||||||
escaping, so that a newline is converted to the sequence "\n", a
|
|
||||||
carriage return to "\r", '\' to "\\" and the separator @var{SEP} is
|
|
||||||
converted to "\@var{SEP}".
|
|
||||||
|
|
||||||
@item csv
|
|
||||||
Perform CSV-like escaping, as described in RFC4180. Strings
|
|
||||||
containing a newline ('\n'), a carriage return ('\r'), a double quote
|
|
||||||
('"'), or @var{SEP} are enclosed in double-quotes.
|
|
||||||
|
|
||||||
@item none
|
|
||||||
Perform no escaping.
|
|
||||||
@end table
|
|
||||||
|
|
||||||
@end table
|
|
||||||
|
|
||||||
@section csv
|
|
||||||
CSV format.
|
|
||||||
|
|
||||||
This writer is equivalent to
|
|
||||||
@code{compact=item_sep=,:nokey=1:escape=csv}.
|
|
||||||
|
|
||||||
@section json
|
|
||||||
JSON based format.
|
|
||||||
|
|
||||||
Each section is printed using JSON notation.
|
|
||||||
|
|
||||||
This writer accepts options as a list of @var{key}=@var{value} pairs,
|
|
||||||
separated by ":".
|
|
||||||
|
|
||||||
The description of the accepted options follows.
|
|
||||||
|
|
||||||
@table @option
|
|
||||||
|
|
||||||
@item compact, c
|
|
||||||
If set to 1 enable compact output, that is each section will be
|
|
||||||
printed on a single line. Default value is 0.
|
|
||||||
@end table
|
|
||||||
|
|
||||||
For more information about JSON, see @url{http://www.json.org/}.
|
|
||||||
|
|
||||||
@section xml
|
|
||||||
XML based format.
|
|
||||||
|
|
||||||
The XML output is described in the XML schema description file
|
|
||||||
@file{ffprobe.xsd} installed in the FFmpeg datadir.
|
|
||||||
|
|
||||||
Note that the output issued will be compliant to the
|
|
||||||
@file{ffprobe.xsd} schema only when no special global output options
|
|
||||||
(@option{unit}, @option{prefix}, @option{byte_binary_prefix},
|
|
||||||
@option{sexagesimal} etc.) are specified.
|
|
||||||
|
|
||||||
This writer accepts options as a list of @var{key}=@var{value} pairs,
|
|
||||||
separated by ":".
|
|
||||||
|
|
||||||
The description of the accepted options follows.
|
|
||||||
|
|
||||||
@table @option
|
|
||||||
|
|
||||||
@item fully_qualified, q
|
|
||||||
If set to 1 specify if the output should be fully qualified. Default
|
|
||||||
value is 0.
|
|
||||||
This is required for generating an XML file which can be validated
|
|
||||||
through an XSD file.
|
|
||||||
|
|
||||||
@item xsd_compliant, x
|
|
||||||
If set to 1 perform more checks for ensuring that the output is XSD
|
|
||||||
compliant. Default value is 0.
|
|
||||||
This option automatically sets @option{fully_qualified} to 1.
|
|
||||||
@end table
|
|
||||||
|
|
||||||
For more information about the XML format, see
|
|
||||||
@url{http://www.w3.org/XML/}.
|
|
||||||
|
|
||||||
@chapter Timecode
|
|
||||||
|
|
||||||
@command{ffprobe} supports Timecode extraction:
|
|
||||||
|
|
||||||
@itemize
|
|
||||||
|
|
||||||
@item MPEG1/2 timecode is extracted from the GOP, and is available in the video
|
|
||||||
stream details (@option{-show_streams}, see @var{timecode}).
|
|
||||||
|
|
||||||
@item MOV timecode is extracted from tmcd track, so is available in the tmcd
|
|
||||||
stream metadata (@option{-show_streams}, see @var{TAG:timecode}).
|
|
||||||
|
|
||||||
@item DV and GXF timecodes are available in format metadata
|
|
||||||
(@option{-show_format}, see @var{TAG:timecode}).
|
|
||||||
|
|
||||||
@end itemize
|
|
||||||
|
|
||||||
@c man end WRITERS
|
|
||||||
|
|
||||||
@include decoders.texi
|
@include decoders.texi
|
||||||
@include demuxers.texi
|
@include demuxers.texi
|
||||||
@include protocols.texi
|
@include protocols.texi
|
||||||
|
|||||||
164
doc/ffprobe.xsd
164
doc/ffprobe.xsd
@@ -1,164 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
|
|
||||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
|
||||||
targetNamespace="http://www.ffmpeg.org/schema/ffprobe"
|
|
||||||
xmlns:ffprobe="http://www.ffmpeg.org/schema/ffprobe">
|
|
||||||
|
|
||||||
<xsd:element name="ffprobe" type="ffprobe:ffprobeType"/>
|
|
||||||
|
|
||||||
<xsd:complexType name="ffprobeType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="packets" type="ffprobe:packetsType" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element name="frames" type="ffprobe:framesType" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element name="streams" type="ffprobe:streamsType" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element name="format" type="ffprobe:formatType" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element name="error" type="ffprobe:errorType" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element name="program_version" type="ffprobe:programVersionType" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element name="library_versions" type="ffprobe:libraryVersionsType" minOccurs="0" maxOccurs="1" />
|
|
||||||
</xsd:sequence>
|
|
||||||
</xsd:complexType>
|
|
||||||
|
|
||||||
<xsd:complexType name="packetsType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="packet" type="ffprobe:packetType" minOccurs="0" maxOccurs="unbounded"/>
|
|
||||||
</xsd:sequence>
|
|
||||||
</xsd:complexType>
|
|
||||||
|
|
||||||
<xsd:complexType name="framesType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="frame" type="ffprobe:frameType" minOccurs="0" maxOccurs="unbounded"/>
|
|
||||||
</xsd:sequence>
|
|
||||||
</xsd:complexType>
|
|
||||||
|
|
||||||
<xsd:complexType name="packetType">
|
|
||||||
<xsd:attribute name="codec_type" type="xsd:string" use="required" />
|
|
||||||
<xsd:attribute name="stream_index" type="xsd:int" use="required" />
|
|
||||||
<xsd:attribute name="pts" type="xsd:long" />
|
|
||||||
<xsd:attribute name="pts_time" type="xsd:float" />
|
|
||||||
<xsd:attribute name="dts" type="xsd:long" />
|
|
||||||
<xsd:attribute name="dts_time" type="xsd:float" />
|
|
||||||
<xsd:attribute name="duration" type="xsd:long" />
|
|
||||||
<xsd:attribute name="duration_time" type="xsd:float" />
|
|
||||||
<xsd:attribute name="size" type="xsd:long" use="required" />
|
|
||||||
<xsd:attribute name="pos" type="xsd:long" />
|
|
||||||
<xsd:attribute name="flags" type="xsd:string" use="required" />
|
|
||||||
</xsd:complexType>
|
|
||||||
|
|
||||||
<xsd:complexType name="frameType">
|
|
||||||
<xsd:attribute name="media_type" type="xsd:string" use="required"/>
|
|
||||||
<xsd:attribute name="key_frame" type="xsd:int" use="required"/>
|
|
||||||
<xsd:attribute name="pts" type="xsd:long" />
|
|
||||||
<xsd:attribute name="pts_time" type="xsd:float"/>
|
|
||||||
<xsd:attribute name="pkt_pts" type="xsd:long" />
|
|
||||||
<xsd:attribute name="pkt_pts_time" type="xsd:float"/>
|
|
||||||
<xsd:attribute name="pkt_dts" type="xsd:long" />
|
|
||||||
<xsd:attribute name="pkt_dts_time" type="xsd:float"/>
|
|
||||||
<xsd:attribute name="pkt_pos" type="xsd:long" />
|
|
||||||
|
|
||||||
<!-- audio attributes -->
|
|
||||||
<xsd:attribute name="sample_fmt" type="xsd:string"/>
|
|
||||||
<xsd:attribute name="nb_samples" type="xsd:long" />
|
|
||||||
|
|
||||||
<!-- video attributes -->
|
|
||||||
<xsd:attribute name="width" type="xsd:long" />
|
|
||||||
<xsd:attribute name="height" type="xsd:long" />
|
|
||||||
<xsd:attribute name="pix_fmt" type="xsd:string"/>
|
|
||||||
<xsd:attribute name="sample_aspect_ratio" type="xsd:string"/>
|
|
||||||
<xsd:attribute name="pict_type" type="xsd:string"/>
|
|
||||||
<xsd:attribute name="coded_picture_number" type="xsd:long" />
|
|
||||||
<xsd:attribute name="display_picture_number" type="xsd:long" />
|
|
||||||
<xsd:attribute name="interlaced_frame" type="xsd:int" />
|
|
||||||
<xsd:attribute name="top_field_first" type="xsd:int" />
|
|
||||||
<xsd:attribute name="repeat_pict" type="xsd:int" />
|
|
||||||
<xsd:attribute name="reference" type="xsd:int" />
|
|
||||||
</xsd:complexType>
|
|
||||||
|
|
||||||
<xsd:complexType name="streamsType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="stream" type="ffprobe:streamType" minOccurs="0" maxOccurs="unbounded"/>
|
|
||||||
</xsd:sequence>
|
|
||||||
</xsd:complexType>
|
|
||||||
|
|
||||||
<xsd:complexType name="streamType">
|
|
||||||
<xsd:attribute name="index" type="xsd:int" use="required"/>
|
|
||||||
<xsd:attribute name="codec_name" type="xsd:string" />
|
|
||||||
<xsd:attribute name="codec_long_name" type="xsd:string" />
|
|
||||||
<xsd:attribute name="codec_type" type="xsd:string" />
|
|
||||||
<xsd:attribute name="codec_time_base" type="xsd:string" use="required"/>
|
|
||||||
<xsd:attribute name="codec_tag" type="xsd:string" use="required"/>
|
|
||||||
<xsd:attribute name="codec_tag_string" type="xsd:string" use="required"/>
|
|
||||||
|
|
||||||
<!-- video attributes -->
|
|
||||||
<xsd:attribute name="width" type="xsd:int"/>
|
|
||||||
<xsd:attribute name="height" type="xsd:int"/>
|
|
||||||
<xsd:attribute name="has_b_frames" type="xsd:int"/>
|
|
||||||
<xsd:attribute name="sample_aspect_ratio" type="xsd:string"/>
|
|
||||||
<xsd:attribute name="display_aspect_ratio" type="xsd:string"/>
|
|
||||||
<xsd:attribute name="pix_fmt" type="xsd:string"/>
|
|
||||||
<xsd:attribute name="level" type="xsd:int"/>
|
|
||||||
<xsd:attribute name="timecode" type="xsd:string"/>
|
|
||||||
|
|
||||||
<!-- audio attributes -->
|
|
||||||
<xsd:attribute name="sample_fmt" type="xsd:string"/>
|
|
||||||
<xsd:attribute name="sample_rate" type="xsd:int"/>
|
|
||||||
<xsd:attribute name="channels" type="xsd:int"/>
|
|
||||||
<xsd:attribute name="bits_per_sample" type="xsd:int"/>
|
|
||||||
|
|
||||||
<xsd:attribute name="id" type="xsd:string"/>
|
|
||||||
<xsd:attribute name="r_frame_rate" type="xsd:string" use="required"/>
|
|
||||||
<xsd:attribute name="avg_frame_rate" type="xsd:string" use="required"/>
|
|
||||||
<xsd:attribute name="time_base" type="xsd:string" use="required"/>
|
|
||||||
<xsd:attribute name="start_time" type="xsd:float"/>
|
|
||||||
<xsd:attribute name="duration" type="xsd:float"/>
|
|
||||||
<xsd:attribute name="nb_frames" type="xsd:int"/>
|
|
||||||
</xsd:complexType>
|
|
||||||
|
|
||||||
<xsd:complexType name="formatType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="tag" type="ffprobe:tagType" minOccurs="0" maxOccurs="unbounded"/>
|
|
||||||
</xsd:sequence>
|
|
||||||
|
|
||||||
<xsd:attribute name="filename" type="xsd:string" use="required"/>
|
|
||||||
<xsd:attribute name="nb_streams" type="xsd:int" use="required"/>
|
|
||||||
<xsd:attribute name="format_name" type="xsd:string" use="required"/>
|
|
||||||
<xsd:attribute name="format_long_name" type="xsd:string" use="required"/>
|
|
||||||
<xsd:attribute name="start_time" type="xsd:float"/>
|
|
||||||
<xsd:attribute name="duration" type="xsd:float"/>
|
|
||||||
<xsd:attribute name="size" type="xsd:long"/>
|
|
||||||
<xsd:attribute name="bit_rate" type="xsd:long"/>
|
|
||||||
</xsd:complexType>
|
|
||||||
|
|
||||||
<xsd:complexType name="tagType">
|
|
||||||
<xsd:attribute name="key" type="xsd:string" use="required"/>
|
|
||||||
<xsd:attribute name="value" type="xsd:string" use="required"/>
|
|
||||||
</xsd:complexType>
|
|
||||||
|
|
||||||
<xsd:complexType name="errorType">
|
|
||||||
<xsd:attribute name="code" type="xsd:int" use="required"/>
|
|
||||||
<xsd:attribute name="string" type="xsd:string" use="required"/>
|
|
||||||
</xsd:complexType>
|
|
||||||
|
|
||||||
<xsd:complexType name="programVersionType">
|
|
||||||
<xsd:attribute name="version" type="xsd:string" use="required"/>
|
|
||||||
<xsd:attribute name="copyright" type="xsd:string" use="required"/>
|
|
||||||
<xsd:attribute name="build_date" type="xsd:string" use="required"/>
|
|
||||||
<xsd:attribute name="build_time" type="xsd:string" use="required"/>
|
|
||||||
<xsd:attribute name="compiler_type" type="xsd:string" use="required"/>
|
|
||||||
<xsd:attribute name="compiler_version" type="xsd:string" use="required"/>
|
|
||||||
<xsd:attribute name="configuration" type="xsd:string" use="required"/>
|
|
||||||
</xsd:complexType>
|
|
||||||
|
|
||||||
<xsd:complexType name="libraryVersionType">
|
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required"/>
|
|
||||||
<xsd:attribute name="major" type="xsd:int" use="required"/>
|
|
||||||
<xsd:attribute name="minor" type="xsd:int" use="required"/>
|
|
||||||
<xsd:attribute name="micro" type="xsd:int" use="required"/>
|
|
||||||
<xsd:attribute name="version" type="xsd:int" use="required"/>
|
|
||||||
</xsd:complexType>
|
|
||||||
|
|
||||||
<xsd:complexType name="libraryVersionsType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="library_version" type="ffprobe:libraryVersionType" minOccurs="0" maxOccurs="unbounded"/>
|
|
||||||
</xsd:sequence>
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:schema>
|
|
||||||
@@ -23,7 +23,6 @@ ffserver [options]
|
|||||||
@c man begin DESCRIPTION
|
@c man begin DESCRIPTION
|
||||||
|
|
||||||
ffserver is a streaming server for both audio and video. It supports
|
ffserver is a streaming server for both audio and video. It supports
|
||||||
|
|
||||||
several live feeds, streaming from files and time shifting on live feeds
|
several live feeds, streaming from files and time shifting on live feeds
|
||||||
(you can seek to positions in the past on each live feed, provided you
|
(you can seek to positions in the past on each live feed, provided you
|
||||||
specify a big enough feed storage in ffserver.conf).
|
specify a big enough feed storage in ffserver.conf).
|
||||||
@@ -35,7 +34,7 @@ file.
|
|||||||
|
|
||||||
This documentation covers only the streaming aspects of ffserver /
|
This documentation covers only the streaming aspects of ffserver /
|
||||||
ffmpeg. All questions about parameters for ffmpeg, codec questions,
|
ffmpeg. All questions about parameters for ffmpeg, codec questions,
|
||||||
etc. are not covered here. Read @file{ffmpeg.html} for more
|
etc. are not covered here. Read @file{ffmpeg-doc.html} for more
|
||||||
information.
|
information.
|
||||||
|
|
||||||
@section How does it work?
|
@section How does it work?
|
||||||
@@ -111,8 +110,8 @@ As a simple test, just run the following two command lines where INPUTFILE
|
|||||||
is some file which you can decode with ffmpeg:
|
is some file which you can decode with ffmpeg:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
ffserver -f doc/ffserver.conf &
|
./ffserver -f doc/ffserver.conf &
|
||||||
ffmpeg -i INPUTFILE http://localhost:8090/feed1.ffm
|
./ffmpeg -i INPUTFILE http://localhost:8090/feed1.ffm
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
At this point you should be able to go to your Windows machine and fire up
|
At this point you should be able to go to your Windows machine and fire up
|
||||||
@@ -147,7 +146,7 @@ that only captures in stereo and also requires that one channel be flipped.
|
|||||||
If you are one of these people, then export 'AUDIO_FLIP_LEFT=1' before
|
If you are one of these people, then export 'AUDIO_FLIP_LEFT=1' before
|
||||||
starting ffmpeg.
|
starting ffmpeg.
|
||||||
|
|
||||||
@subsection The audio and video lose sync after a while.
|
@subsection The audio and video loose sync after a while.
|
||||||
|
|
||||||
Yes, they do.
|
Yes, they do.
|
||||||
|
|
||||||
@@ -241,7 +240,7 @@ For example: @samp{http://localhost:8080/test.asf?date=2002-07-26T23:05:00}.
|
|||||||
@chapter Options
|
@chapter Options
|
||||||
@c man begin OPTIONS
|
@c man begin OPTIONS
|
||||||
|
|
||||||
@include avtools-common-opts.texi
|
@include fftools-common-opts.texi
|
||||||
|
|
||||||
@section Main options
|
@section Main options
|
||||||
|
|
||||||
@@ -266,7 +265,7 @@ rather than as a daemon.
|
|||||||
|
|
||||||
@c man begin SEEALSO
|
@c man begin SEEALSO
|
||||||
|
|
||||||
ffmpeg(1), ffplay(1), ffprobe(1), the @file{ffserver.conf}
|
ffmpeg(1), ffplay(1), ffprobe(1), the @file{ffmpeg/doc/ffserver.conf}
|
||||||
example and the FFmpeg HTML documentation
|
example and the FFmpeg HTML documentation
|
||||||
@c man end
|
@c man end
|
||||||
|
|
||||||
|
|||||||
93
doc/fftools-common-opts.texi
Normal file
93
doc/fftools-common-opts.texi
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
All the numerical options, if not specified otherwise, accept in input
|
||||||
|
a string representing a number, which may contain one of the
|
||||||
|
International System number postfixes, for example 'K', 'M', 'G'.
|
||||||
|
If 'i' is appended after the postfix, powers of 2 are used instead of
|
||||||
|
powers of 10. The 'B' postfix multiplies the value for 8, and can be
|
||||||
|
appended after another postfix or used alone. This allows using for
|
||||||
|
example 'KB', 'MiB', 'G' and 'B' as postfix.
|
||||||
|
|
||||||
|
Options which do not take arguments are boolean options, and set the
|
||||||
|
corresponding value to true. They can be set to false by prefixing
|
||||||
|
with "no" the option name, for example using "-nofoo" in the
|
||||||
|
commandline will set to false the boolean option with name "foo".
|
||||||
|
|
||||||
|
@section Generic options
|
||||||
|
|
||||||
|
These options are shared amongst the ff* tools.
|
||||||
|
|
||||||
|
@table @option
|
||||||
|
|
||||||
|
@item -L
|
||||||
|
Show license.
|
||||||
|
|
||||||
|
@item -h, -?, -help, --help
|
||||||
|
Show help.
|
||||||
|
|
||||||
|
@item -version
|
||||||
|
Show version.
|
||||||
|
|
||||||
|
@item -formats
|
||||||
|
Show available formats.
|
||||||
|
|
||||||
|
The fields preceding the format names have the following meanings:
|
||||||
|
@table @samp
|
||||||
|
@item D
|
||||||
|
Decoding available
|
||||||
|
@item E
|
||||||
|
Encoding available
|
||||||
|
@end table
|
||||||
|
|
||||||
|
@item -codecs
|
||||||
|
Show available codecs.
|
||||||
|
|
||||||
|
The fields preceding the codec names have the following meanings:
|
||||||
|
@table @samp
|
||||||
|
@item D
|
||||||
|
Decoding available
|
||||||
|
@item E
|
||||||
|
Encoding available
|
||||||
|
@item V/A/S
|
||||||
|
Video/audio/subtitle codec
|
||||||
|
@item S
|
||||||
|
Codec supports slices
|
||||||
|
@item D
|
||||||
|
Codec supports direct rendering
|
||||||
|
@item T
|
||||||
|
Codec can handle input truncated at random locations instead of only at frame boundaries
|
||||||
|
@end table
|
||||||
|
|
||||||
|
@item -bsfs
|
||||||
|
Show available bitstream filters.
|
||||||
|
|
||||||
|
@item -protocols
|
||||||
|
Show available protocols.
|
||||||
|
|
||||||
|
@item -filters
|
||||||
|
Show available libavfilter filters.
|
||||||
|
|
||||||
|
@item -pix_fmts
|
||||||
|
Show available pixel formats.
|
||||||
|
|
||||||
|
@item -loglevel @var{loglevel}
|
||||||
|
Set the logging level used by the library.
|
||||||
|
@var{loglevel} is a number or a string containing one of the following values:
|
||||||
|
@table @samp
|
||||||
|
@item quiet
|
||||||
|
@item panic
|
||||||
|
@item fatal
|
||||||
|
@item error
|
||||||
|
@item warning
|
||||||
|
@item info
|
||||||
|
@item verbose
|
||||||
|
@item debug
|
||||||
|
@end table
|
||||||
|
|
||||||
|
By default the program logs to stderr, if coloring is supported by the
|
||||||
|
terminal, colors are used to mark errors and warnings. Log coloring
|
||||||
|
can be disabled setting the environment variable
|
||||||
|
@env{FFMPEG_FORCE_NOCOLOR} or @env{NO_COLOR}, or can be forced setting
|
||||||
|
the environment variable @env{FFMPEG_FORCE_COLOR}.
|
||||||
|
The use of the environment variable @env{NO_COLOR} is deprecated and
|
||||||
|
will be dropped in a following FFmpeg version.
|
||||||
|
|
||||||
|
@end table
|
||||||
1639
doc/filters.texi
1639
doc/filters.texi
File diff suppressed because it is too large
Load Diff
512
doc/general.texi
512
doc/general.texi
@@ -9,92 +9,29 @@
|
|||||||
|
|
||||||
@contents
|
@contents
|
||||||
|
|
||||||
@chapter External libraries
|
@chapter external libraries
|
||||||
|
|
||||||
FFmpeg can be hooked up with a number of external libraries to add support
|
FFmpeg can be hooked up with a number of external libraries to add support
|
||||||
for more formats. None of them are used by default, their use has to be
|
for more formats. None of them are used by default, their use has to be
|
||||||
explicitly requested by passing the appropriate flags to @file{./configure}.
|
explicitly requested by passing the appropriate flags to @file{./configure}.
|
||||||
|
|
||||||
@section OpenJPEG
|
@section OpenCORE AMR
|
||||||
|
|
||||||
FFmpeg can use the OpenJPEG libraries for encoding/decoding J2K videos. Go to
|
|
||||||
@url{http://www.openjpeg.org/} to get the libraries and follow the installation
|
|
||||||
instructions. To enable using OpenJPEG in FFmpeg, pass @code{--enable-libopenjpeg} to
|
|
||||||
@file{./configure}.
|
|
||||||
|
|
||||||
|
|
||||||
@section OpenCORE and VisualOn libraries
|
|
||||||
|
|
||||||
Spun off Google Android sources, OpenCore and VisualOn libraries provide
|
|
||||||
encoders for a number of audio codecs.
|
|
||||||
|
|
||||||
@float NOTE
|
|
||||||
OpenCORE and VisualOn libraries are under the Apache License 2.0
|
|
||||||
(see @url{http://www.apache.org/licenses/LICENSE-2.0} for details), which is
|
|
||||||
incompatible with the LGPL version 2.1 and GPL version 2. You have to
|
|
||||||
upgrade FFmpeg's license to LGPL version 3 (or if you have enabled
|
|
||||||
GPL components, GPL version 3) to use it.
|
|
||||||
@end float
|
|
||||||
|
|
||||||
@subsection OpenCORE AMR
|
|
||||||
|
|
||||||
FFmpeg can make use of the OpenCORE libraries for AMR-NB
|
FFmpeg can make use of the OpenCORE libraries for AMR-NB
|
||||||
decoding/encoding and AMR-WB decoding.
|
decoding/encoding and AMR-WB decoding.
|
||||||
|
|
||||||
Go to @url{http://sourceforge.net/projects/opencore-amr/} and follow the
|
Go to @url{http://sourceforge.net/projects/opencore-amr/} and follow the instructions for
|
||||||
instructions for installing the libraries.
|
installing the libraries. Then pass @code{--enable-libopencore-amrnb} and/or
|
||||||
Then pass @code{--enable-libopencore-amrnb} and/or
|
@code{--enable-libopencore-amrwb} to configure to enable the libraries.
|
||||||
@code{--enable-libopencore-amrwb} to configure to enable them.
|
|
||||||
|
|
||||||
@subsection VisualOn AAC encoder library
|
Note that OpenCORE is under the Apache License 2.0 (see
|
||||||
|
@url{http://www.apache.org/licenses/LICENSE-2.0} for details), which is
|
||||||
FFmpeg can make use of the VisualOn AACenc library for AAC encoding.
|
incompatible with the LGPL version 2.1 and GPL version 2. You have to
|
||||||
|
upgrade FFmpeg's license to LGPL version 3 (or if you have enabled
|
||||||
Go to @url{http://sourceforge.net/projects/opencore-amr/} and follow the
|
GPL components, GPL version 3) to use it.
|
||||||
instructions for installing the library.
|
|
||||||
Then pass @code{--enable-libvo-aacenc} to configure to enable it.
|
|
||||||
|
|
||||||
@subsection VisualOn AMR-WB encoder library
|
|
||||||
|
|
||||||
FFmpeg can make use of the VisualOn AMR-WBenc library for AMR-WB encoding.
|
|
||||||
|
|
||||||
Go to @url{http://sourceforge.net/projects/opencore-amr/} and follow the
|
|
||||||
instructions for installing the library.
|
|
||||||
Then pass @code{--enable-libvo-amrwbenc} to configure to enable it.
|
|
||||||
|
|
||||||
@section LAME
|
|
||||||
|
|
||||||
FFmpeg can make use of the LAME library for MP3 encoding.
|
|
||||||
|
|
||||||
Go to @url{http://lame.sourceforge.net/} and follow the
|
|
||||||
instructions for installing the library.
|
|
||||||
Then pass @code{--enable-libmp3lame} to configure to enable it.
|
|
||||||
|
|
||||||
@section libvpx
|
|
||||||
|
|
||||||
FFmpeg can make use of the libvpx library for VP8 encoding.
|
|
||||||
|
|
||||||
Go to @url{http://www.webmproject.org/} and follow the instructions for
|
|
||||||
installing the library. Then pass @code{--enable-libvpx} to configure to
|
|
||||||
enable it.
|
|
||||||
|
|
||||||
@section x264
|
|
||||||
|
|
||||||
FFmpeg can make use of the x264 library for H.264 encoding.
|
|
||||||
|
|
||||||
Go to @url{http://www.videolan.org/developers/x264.html} and follow the
|
|
||||||
instructions for installing the library. Then pass @code{--enable-libx264} to
|
|
||||||
configure to enable it.
|
|
||||||
|
|
||||||
@float NOTE
|
|
||||||
x264 is under the GNU Public License Version 2 or later
|
|
||||||
(see @url{http://www.gnu.org/licenses/old-licenses/gpl-2.0.html} for
|
|
||||||
details), you must upgrade FFmpeg's license to GPL in order to use it.
|
|
||||||
@end float
|
|
||||||
|
|
||||||
|
|
||||||
|
@chapter Supported File Formats and Codecs
|
||||||
@chapter Supported File Formats, Codecs or Features
|
|
||||||
|
|
||||||
You can use the @code{-formats} and @code{-codecs} options to have an exhaustive list.
|
You can use the @code{-formats} and @code{-codecs} options to have an exhaustive list.
|
||||||
|
|
||||||
@@ -108,15 +45,12 @@ library:
|
|||||||
@item 4xm @tab @tab X
|
@item 4xm @tab @tab X
|
||||||
@tab 4X Technologies format, used in some games.
|
@tab 4X Technologies format, used in some games.
|
||||||
@item 8088flex TMV @tab @tab X
|
@item 8088flex TMV @tab @tab X
|
||||||
@item ACT Voice @tab @tab X
|
|
||||||
@tab contains G.729 audio
|
|
||||||
@item Adobe Filmstrip @tab X @tab X
|
@item Adobe Filmstrip @tab X @tab X
|
||||||
@item Audio IFF (AIFF) @tab X @tab X
|
@item Audio IFF (AIFF) @tab X @tab X
|
||||||
@item American Laser Games MM @tab @tab X
|
@item American Laser Games MM @tab @tab X
|
||||||
@tab Multimedia format used in games like Mad Dog McCree.
|
@tab Multimedia format used in games like Mad Dog McCree.
|
||||||
@item 3GPP AMR @tab X @tab X
|
@item 3GPP AMR @tab X @tab X
|
||||||
@item Apple HTTP Live Streaming @tab @tab X
|
@item Apple HTTP Live Streaming @tab @tab X
|
||||||
@item Artworx Data Format @tab @tab X
|
|
||||||
@item ASF @tab X @tab X
|
@item ASF @tab X @tab X
|
||||||
@item AVI @tab X @tab X
|
@item AVI @tab X @tab X
|
||||||
@item AVISynth @tab @tab X
|
@item AVISynth @tab @tab X
|
||||||
@@ -126,17 +60,12 @@ library:
|
|||||||
@tab Audio and video format used in some games by Beam Software.
|
@tab Audio and video format used in some games by Beam Software.
|
||||||
@item Bethesda Softworks VID @tab @tab X
|
@item Bethesda Softworks VID @tab @tab X
|
||||||
@tab Used in some games from Bethesda Softworks.
|
@tab Used in some games from Bethesda Softworks.
|
||||||
@item Binary text @tab @tab X
|
|
||||||
@item Bink @tab @tab X
|
@item Bink @tab @tab X
|
||||||
@tab Multimedia format used by many games.
|
@tab Multimedia format used by many games.
|
||||||
@item Bitmap Brothers JV @tab @tab X
|
@item Bitmap Brothers JV @tab @tab X
|
||||||
@tab Used in Z and Z95 games.
|
@tab Used in Z and Z95 games.
|
||||||
@item Brute Force & Ignorance @tab @tab X
|
@item Brute Force & Ignorance @tab @tab X
|
||||||
@tab Used in the game Flash Traffic: City of Angels.
|
@tab Used in the game Flash Traffic: City of Angels.
|
||||||
@item BWF @tab X @tab X
|
|
||||||
@item CRI ADX @tab X @tab X
|
|
||||||
@tab Audio-only format used in console video games.
|
|
||||||
@item Discworld II BMV @tab @tab X
|
|
||||||
@item Interplay C93 @tab @tab X
|
@item Interplay C93 @tab @tab X
|
||||||
@tab Used in the game Cyberia from Interplay.
|
@tab Used in the game Cyberia from Interplay.
|
||||||
@item Delphine Software International CIN @tab @tab X
|
@item Delphine Software International CIN @tab @tab X
|
||||||
@@ -172,19 +101,13 @@ library:
|
|||||||
@item framecrc testing format @tab X @tab
|
@item framecrc testing format @tab X @tab
|
||||||
@item FunCom ISS @tab @tab X
|
@item FunCom ISS @tab @tab X
|
||||||
@tab Audio format used in various games from FunCom like The Longest Journey.
|
@tab Audio format used in various games from FunCom like The Longest Journey.
|
||||||
@item G.723.1 @tab X @tab X
|
|
||||||
@item G.729 BIT @tab X @tab X
|
|
||||||
@item G.729 raw @tab @tab X
|
|
||||||
@item GIF Animation @tab X @tab
|
@item GIF Animation @tab X @tab
|
||||||
@item GXF @tab X @tab X
|
@item GXF @tab X @tab X
|
||||||
@tab General eXchange Format SMPTE 360M, used by Thomson Grass Valley
|
@tab General eXchange Format SMPTE 360M, used by Thomson Grass Valley
|
||||||
playout servers.
|
playout servers.
|
||||||
@item iCEDraw File @tab @tab X
|
|
||||||
@item ICO @tab @tab X
|
|
||||||
@tab Microsoft Windows ICO
|
|
||||||
@item id Quake II CIN video @tab @tab X
|
@item id Quake II CIN video @tab @tab X
|
||||||
@item id RoQ @tab X @tab X
|
@item id RoQ @tab X @tab X
|
||||||
@tab Used in Quake III, Jedi Knight 2 and other computer games.
|
@tab Used in Quake III, Jedi Knight 2, other computer games.
|
||||||
@item IEC61937 encapsulation @tab X @tab X
|
@item IEC61937 encapsulation @tab X @tab X
|
||||||
@item IFF @tab @tab X
|
@item IFF @tab @tab X
|
||||||
@tab Interchange File Format
|
@tab Interchange File Format
|
||||||
@@ -194,11 +117,8 @@ library:
|
|||||||
@tab A format generated by IndigoVision 8000 video server.
|
@tab A format generated by IndigoVision 8000 video server.
|
||||||
@item IVF (On2) @tab X @tab X
|
@item IVF (On2) @tab X @tab X
|
||||||
@tab A format used by libvpx
|
@tab A format used by libvpx
|
||||||
@item LATM @tab X @tab X
|
|
||||||
@item LMLM4 @tab @tab X
|
@item LMLM4 @tab @tab X
|
||||||
@tab Used by Linux Media Labs MPEG-4 PCI boards
|
@tab Used by Linux Media Labs MPEG-4 PCI boards
|
||||||
@item LOAS @tab @tab X
|
|
||||||
@tab contains LATM multiplexed AAC audio
|
|
||||||
@item LXF @tab @tab X
|
@item LXF @tab @tab X
|
||||||
@tab VR native stream format, used by Leitch/Harris' video servers.
|
@tab VR native stream format, used by Leitch/Harris' video servers.
|
||||||
@item Matroska @tab X @tab X
|
@item Matroska @tab X @tab X
|
||||||
@@ -307,7 +227,6 @@ library:
|
|||||||
@item RTP @tab X @tab X
|
@item RTP @tab X @tab X
|
||||||
@item RTSP @tab X @tab X
|
@item RTSP @tab X @tab X
|
||||||
@item SAP @tab X @tab X
|
@item SAP @tab X @tab X
|
||||||
@item SBG @tab @tab X
|
|
||||||
@item SDP @tab @tab X
|
@item SDP @tab @tab X
|
||||||
@item Sega FILM/CPK @tab @tab X
|
@item Sega FILM/CPK @tab @tab X
|
||||||
@tab Used in many Sega Saturn console games.
|
@tab Used in many Sega Saturn console games.
|
||||||
@@ -317,9 +236,7 @@ library:
|
|||||||
@tab Used in Sierra CD-ROM games.
|
@tab Used in Sierra CD-ROM games.
|
||||||
@item Smacker @tab @tab X
|
@item Smacker @tab @tab X
|
||||||
@tab Multimedia format used by many games.
|
@tab Multimedia format used by many games.
|
||||||
@item SMJPEG @tab X @tab X
|
@item Sony OpenMG (OMA) @tab @tab X
|
||||||
@tab Used in certain Loki game ports.
|
|
||||||
@item Sony OpenMG (OMA) @tab X @tab X
|
|
||||||
@tab Audio format used in Sony Sonic Stage and Sony Vegas.
|
@tab Audio format used in Sony Sonic Stage and Sony Vegas.
|
||||||
@item Sony PlayStation STR @tab @tab X
|
@item Sony PlayStation STR @tab @tab X
|
||||||
@item Sony Wave64 (W64) @tab @tab X
|
@item Sony Wave64 (W64) @tab @tab X
|
||||||
@@ -335,18 +252,15 @@ library:
|
|||||||
@item WAV @tab X @tab X
|
@item WAV @tab X @tab X
|
||||||
@item WavPack @tab @tab X
|
@item WavPack @tab @tab X
|
||||||
@item WebM @tab X @tab X
|
@item WebM @tab X @tab X
|
||||||
@item Windows Televison (WTV) @tab X @tab X
|
@item Windows Televison (WTV) @tab @tab X
|
||||||
@item Wing Commander III movie @tab @tab X
|
@item Wing Commander III movie @tab @tab X
|
||||||
@tab Multimedia format used in Origin's Wing Commander III computer game.
|
@tab Multimedia format used in Origin's Wing Commander III computer game.
|
||||||
@item Westwood Studios audio @tab @tab X
|
@item Westwood Studios audio @tab @tab X
|
||||||
@tab Multimedia format used in Westwood Studios games.
|
@tab Multimedia format used in Westwood Studios games.
|
||||||
@item Westwood Studios VQA @tab @tab X
|
@item Westwood Studios VQA @tab @tab X
|
||||||
@tab Multimedia format used in Westwood Studios games.
|
@tab Multimedia format used in Westwood Studios games.
|
||||||
@item XMV @tab @tab X
|
|
||||||
@tab Microsoft video container used in Xbox games.
|
|
||||||
@item xWMA @tab @tab X
|
@item xWMA @tab @tab X
|
||||||
@tab Microsoft audio container used by XAudio 2.
|
@tab Microsoft audio container used by XAudio 2.
|
||||||
@item eXtended BINary text (XBIN) @tab @tab X
|
|
||||||
@item YUV4MPEG pipe @tab X @tab X
|
@item YUV4MPEG pipe @tab X @tab X
|
||||||
@item Psygnosis YOP @tab @tab X
|
@item Psygnosis YOP @tab @tab X
|
||||||
@end multitable
|
@end multitable
|
||||||
@@ -387,6 +301,7 @@ following image formats are supported:
|
|||||||
@item PIC @tab @tab X
|
@item PIC @tab @tab X
|
||||||
@tab Pictor/PC Paint
|
@tab Pictor/PC Paint
|
||||||
@item PNG @tab X @tab X
|
@item PNG @tab X @tab X
|
||||||
|
@tab 2/4 bpp not supported yet
|
||||||
@item PPM @tab X @tab X
|
@item PPM @tab X @tab X
|
||||||
@tab Portable PixelMap image
|
@tab Portable PixelMap image
|
||||||
@item PTX @tab @tab X
|
@item PTX @tab @tab X
|
||||||
@@ -399,8 +314,6 @@ following image formats are supported:
|
|||||||
@tab YUV, JPEG and some extension is not supported yet.
|
@tab YUV, JPEG and some extension is not supported yet.
|
||||||
@item Truevision Targa @tab X @tab X
|
@item Truevision Targa @tab X @tab X
|
||||||
@tab Targa (.TGA) image format
|
@tab Targa (.TGA) image format
|
||||||
@item XWD @tab X @tab X
|
|
||||||
@tab X Window Dump image format
|
|
||||||
@end multitable
|
@end multitable
|
||||||
|
|
||||||
@code{X} means that encoding (resp. decoding) is supported.
|
@code{X} means that encoding (resp. decoding) is supported.
|
||||||
@@ -420,11 +333,10 @@ following image formats are supported:
|
|||||||
@tab Creates video suitable to be played on a commodore 64 (multicolor mode).
|
@tab Creates video suitable to be played on a commodore 64 (multicolor mode).
|
||||||
@item American Laser Games MM @tab @tab X
|
@item American Laser Games MM @tab @tab X
|
||||||
@tab Used in games like Mad Dog McCree.
|
@tab Used in games like Mad Dog McCree.
|
||||||
@item AMV Video @tab X @tab X
|
@item AMV Video @tab @tab X
|
||||||
@tab Used in Chinese MP3 players.
|
@tab Used in Chinese MP3 players.
|
||||||
@item ANSI/ASCII art @tab @tab X
|
@item ANSI/ASCII art @tab @tab X
|
||||||
@item Apple MJPEG-B @tab @tab X
|
@item Apple MJPEG-B @tab @tab X
|
||||||
@item Apple ProRes @tab X @tab X
|
|
||||||
@item Apple QuickDraw @tab @tab X
|
@item Apple QuickDraw @tab @tab X
|
||||||
@tab fourcc: qdrw
|
@tab fourcc: qdrw
|
||||||
@item Asus v1 @tab X @tab X
|
@item Asus v1 @tab X @tab X
|
||||||
@@ -440,8 +352,6 @@ following image formats are supported:
|
|||||||
@item Autodesk Animator Flic video @tab @tab X
|
@item Autodesk Animator Flic video @tab @tab X
|
||||||
@item Autodesk RLE @tab @tab X
|
@item Autodesk RLE @tab @tab X
|
||||||
@tab fourcc: AASC
|
@tab fourcc: AASC
|
||||||
@item Avid 1:1 10-bit RGB Packer @tab X @tab X
|
|
||||||
@tab fourcc: AVrp
|
|
||||||
@item AVS (Audio Video Standard) video @tab @tab X
|
@item AVS (Audio Video Standard) video @tab @tab X
|
||||||
@tab Video encoding used by the Creature Shock game.
|
@tab Video encoding used by the Creature Shock game.
|
||||||
@item Beam Software VB @tab @tab X
|
@item Beam Software VB @tab @tab X
|
||||||
@@ -449,7 +359,6 @@ following image formats are supported:
|
|||||||
@tab Used in some games from Bethesda Softworks.
|
@tab Used in some games from Bethesda Softworks.
|
||||||
@item Bink Video @tab @tab X
|
@item Bink Video @tab @tab X
|
||||||
@item Bitmap Brothers JV video @tab @tab X
|
@item Bitmap Brothers JV video @tab @tab X
|
||||||
@item y41p Brooktree uncompressed 4:1:1 12-bit @tab X @tab X
|
|
||||||
@item Brute Force & Ignorance @tab @tab X
|
@item Brute Force & Ignorance @tab @tab X
|
||||||
@tab Used in the game Flash Traffic: City of Angels.
|
@tab Used in the game Flash Traffic: City of Angels.
|
||||||
@item C93 video @tab @tab X
|
@item C93 video @tab @tab X
|
||||||
@@ -462,14 +371,13 @@ following image formats are supported:
|
|||||||
@tab AVS1-P2, JiZhun profile, encoding through external library libxavs
|
@tab AVS1-P2, JiZhun profile, encoding through external library libxavs
|
||||||
@item Delphine Software International CIN video @tab @tab X
|
@item Delphine Software International CIN video @tab @tab X
|
||||||
@tab Codec used in Delphine Software International games.
|
@tab Codec used in Delphine Software International games.
|
||||||
@item Discworld II BMV Video @tab @tab X
|
|
||||||
@item Cinepak @tab @tab X
|
@item Cinepak @tab @tab X
|
||||||
@item Cirrus Logic AccuPak @tab X @tab X
|
@item Cirrus Logic AccuPak @tab @tab X
|
||||||
@tab fourcc: CLJR
|
@tab fourcc: CLJR
|
||||||
@item Creative YUV (CYUV) @tab @tab X
|
@item Creative YUV (CYUV) @tab @tab X
|
||||||
@item DFA @tab @tab X
|
@item DFA @tab @tab X
|
||||||
@tab Codec used in Chronomaster game.
|
@tab Codec used in Chronomaster game.
|
||||||
@item Dirac @tab E @tab X
|
@item Dirac @tab E @tab E
|
||||||
@tab supported through external libdirac/libschroedinger libraries
|
@tab supported through external libdirac/libschroedinger libraries
|
||||||
@item Deluxe Paint Animation @tab @tab X
|
@item Deluxe Paint Animation @tab @tab X
|
||||||
@item DNxHD @tab X @tab X
|
@item DNxHD @tab X @tab X
|
||||||
@@ -479,7 +387,6 @@ following image formats are supported:
|
|||||||
@item Duck TrueMotion 2.0 @tab @tab X
|
@item Duck TrueMotion 2.0 @tab @tab X
|
||||||
@tab fourcc: TM20
|
@tab fourcc: TM20
|
||||||
@item DV (Digital Video) @tab X @tab X
|
@item DV (Digital Video) @tab X @tab X
|
||||||
@item Dxtory capture format @tab @tab X
|
|
||||||
@item Feeble Files/ScummVM DXA @tab @tab X
|
@item Feeble Files/ScummVM DXA @tab @tab X
|
||||||
@tab Codec originally used in Feeble Files game.
|
@tab Codec originally used in Feeble Files game.
|
||||||
@item Electronic Arts CMV video @tab @tab X
|
@item Electronic Arts CMV video @tab @tab X
|
||||||
@@ -489,12 +396,11 @@ following image formats are supported:
|
|||||||
@item Electronic Arts TGQ video @tab @tab X
|
@item Electronic Arts TGQ video @tab @tab X
|
||||||
@item Electronic Arts TQI video @tab @tab X
|
@item Electronic Arts TQI video @tab @tab X
|
||||||
@item Escape 124 @tab @tab X
|
@item Escape 124 @tab @tab X
|
||||||
@item Escape 130 @tab @tab X
|
|
||||||
@item FFmpeg video codec #1 @tab X @tab X
|
@item FFmpeg video codec #1 @tab X @tab X
|
||||||
@tab experimental lossless codec (fourcc: FFV1)
|
@tab experimental lossless codec (fourcc: FFV1)
|
||||||
@item Flash Screen Video v1 @tab X @tab X
|
@item Flash Screen Video v1 @tab X @tab X
|
||||||
@tab fourcc: FSV1
|
@tab fourcc: FSV1
|
||||||
@item Flash Screen Video v2 @tab X @tab X
|
@item Flash Screen Video v2 @tab X
|
||||||
@item Flash Video (FLV) @tab X @tab X
|
@item Flash Video (FLV) @tab X @tab X
|
||||||
@tab Sorenson H.263 used in Flash
|
@tab Sorenson H.263 used in Flash
|
||||||
@item Fraps @tab @tab X
|
@item Fraps @tab @tab X
|
||||||
@@ -513,19 +419,17 @@ following image formats are supported:
|
|||||||
@item id RoQ video @tab X @tab X
|
@item id RoQ video @tab X @tab X
|
||||||
@tab Used in Quake III, Jedi Knight 2, other computer games.
|
@tab Used in Quake III, Jedi Knight 2, other computer games.
|
||||||
@item IFF ILBM @tab @tab X
|
@item IFF ILBM @tab @tab X
|
||||||
@tab IFF interleaved bitmap
|
@tab IFF interlaved bitmap
|
||||||
@item IFF ByteRun1 @tab @tab X
|
@item IFF ByteRun1 @tab @tab X
|
||||||
@tab IFF run length encoded bitmap
|
@tab IFF run length encoded bitmap
|
||||||
@item Intel H.263 @tab @tab X
|
@item Intel H.263 @tab @tab X
|
||||||
@item Intel Indeo 2 @tab @tab X
|
@item Intel Indeo 2 @tab @tab X
|
||||||
@item Intel Indeo 3 @tab @tab X
|
@item Intel Indeo 3 @tab @tab X
|
||||||
@item Intel Indeo 4 @tab @tab X
|
|
||||||
@item Intel Indeo 5 @tab @tab X
|
@item Intel Indeo 5 @tab @tab X
|
||||||
@item Interplay C93 @tab @tab X
|
@item Interplay C93 @tab @tab X
|
||||||
@tab Used in the game Cyberia from Interplay.
|
@tab Used in the game Cyberia from Interplay.
|
||||||
@item Interplay MVE video @tab @tab X
|
@item Interplay MVE video @tab @tab X
|
||||||
@tab Used in Interplay .MVE files.
|
@tab Used in Interplay .MVE files.
|
||||||
@item J2K @tab X @tab X
|
|
||||||
@item Karl Morton's video codec @tab @tab X
|
@item Karl Morton's video codec @tab @tab X
|
||||||
@tab Codec used in Worms games.
|
@tab Codec used in Worms games.
|
||||||
@item Kega Game Video (KGV1) @tab @tab X
|
@item Kega Game Video (KGV1) @tab @tab X
|
||||||
@@ -549,7 +453,7 @@ following image formats are supported:
|
|||||||
@item MPEG-1/2 video (VDPAU acceleration) @tab @tab X
|
@item MPEG-1/2 video (VDPAU acceleration) @tab @tab X
|
||||||
@item MPEG-2 video @tab X @tab X
|
@item MPEG-2 video @tab X @tab X
|
||||||
@item MPEG-4 part 2 @tab X @tab X
|
@item MPEG-4 part 2 @tab X @tab X
|
||||||
@tab libxvidcore can be used alternatively for encoding.
|
@ libxvidcore can be used alternatively for encoding.
|
||||||
@item MPEG-4 part 2 Microsoft variant version 1 @tab @tab X
|
@item MPEG-4 part 2 Microsoft variant version 1 @tab @tab X
|
||||||
@item MPEG-4 part 2 Microsoft variant version 2 @tab X @tab X
|
@item MPEG-4 part 2 Microsoft variant version 2 @tab X @tab X
|
||||||
@item MPEG-4 part 2 Microsoft variant version 3 @tab X @tab X
|
@item MPEG-4 part 2 Microsoft variant version 3 @tab X @tab X
|
||||||
@@ -566,8 +470,6 @@ following image formats are supported:
|
|||||||
@tab fourcc: VP80, encoding supported through external library libvpx
|
@tab fourcc: VP80, encoding supported through external library libvpx
|
||||||
@item planar RGB @tab @tab X
|
@item planar RGB @tab @tab X
|
||||||
@tab fourcc: 8BPS
|
@tab fourcc: 8BPS
|
||||||
@item Prores @tab @tab X
|
|
||||||
@tab fourcc: apch,apcn,apcs,apco
|
|
||||||
@item Q-team QPEG @tab @tab X
|
@item Q-team QPEG @tab @tab X
|
||||||
@tab fourccs: QPEG, Q1.0, Q1.1
|
@tab fourccs: QPEG, Q1.0, Q1.1
|
||||||
@item QuickTime 8BPS video @tab @tab X
|
@item QuickTime 8BPS video @tab @tab X
|
||||||
@@ -577,8 +479,8 @@ following image formats are supported:
|
|||||||
@tab fourcc: 'smc '
|
@tab fourcc: 'smc '
|
||||||
@item QuickTime video (RPZA) @tab @tab X
|
@item QuickTime video (RPZA) @tab @tab X
|
||||||
@tab fourcc: rpza
|
@tab fourcc: rpza
|
||||||
@item R10K AJA Kona 10-bit RGB Codec @tab X @tab X
|
@item R10K AJA Kona 10-bit RGB Codec @tab @tab X
|
||||||
@item R210 Quicktime Uncompressed RGB 10-bit @tab X @tab X
|
@item R210 Quicktime Uncompressed RGB 10-bit @tab @tab X
|
||||||
@item Raw Video @tab X @tab X
|
@item Raw Video @tab X @tab X
|
||||||
@item RealVideo 1.0 @tab X @tab X
|
@item RealVideo 1.0 @tab X @tab X
|
||||||
@item RealVideo 2.0 @tab X @tab X
|
@item RealVideo 2.0 @tab X @tab X
|
||||||
@@ -609,15 +511,10 @@ following image formats are supported:
|
|||||||
@tab encoding supported through external library libtheora
|
@tab encoding supported through external library libtheora
|
||||||
@item Tiertex Limited SEQ video @tab @tab X
|
@item Tiertex Limited SEQ video @tab @tab X
|
||||||
@tab Codec used in DOS CD-ROM FlashBack game.
|
@tab Codec used in DOS CD-ROM FlashBack game.
|
||||||
@item Ut Video @tab @tab X
|
@item V210 Quicktime Uncompressed 4:2:2 10-bit @tab X @tab X
|
||||||
@item v210 QuickTime uncompressed 4:2:2 10-bit @tab X @tab X
|
|
||||||
@item v308 QuickTime uncompressed 4:4:4 @tab X @tab X
|
|
||||||
@item v410 QuickTime uncompressed 4:4:4 10-bit @tab X @tab X
|
|
||||||
@item VBLE Lossless Codec @tab @tab X
|
|
||||||
@item VMware Screen Codec / VMware Video @tab @tab X
|
@item VMware Screen Codec / VMware Video @tab @tab X
|
||||||
@tab Codec used in videos captured by VMware.
|
@tab Codec used in videos captured by VMware.
|
||||||
@item Westwood Studios VQA (Vector Quantized Animation) video @tab @tab X
|
@item Westwood Studios VQA (Vector Quantized Animation) video @tab @tab X
|
||||||
@item Windows Media Image @tab @tab X
|
|
||||||
@item Windows Media Video 7 @tab X @tab X
|
@item Windows Media Video 7 @tab X @tab X
|
||||||
@item Windows Media Video 8 @tab X @tab X
|
@item Windows Media Video 8 @tab X @tab X
|
||||||
@item Windows Media Video 9 @tab @tab X
|
@item Windows Media Video 9 @tab @tab X
|
||||||
@@ -630,8 +527,6 @@ following image formats are supported:
|
|||||||
@item WMV7 @tab X @tab X
|
@item WMV7 @tab X @tab X
|
||||||
@item YAMAHA SMAF @tab X @tab X
|
@item YAMAHA SMAF @tab X @tab X
|
||||||
@item Psygnosis YOP Video @tab @tab X
|
@item Psygnosis YOP Video @tab @tab X
|
||||||
@item yuv4 @tab X @tab X
|
|
||||||
@tab libquicktime uncompressed packed 4:2:0
|
|
||||||
@item ZLIB @tab X @tab X
|
@item ZLIB @tab X @tab X
|
||||||
@tab part of LCL, encoder experimental
|
@tab part of LCL, encoder experimental
|
||||||
@item Zip Motion Blocks Video @tab X @tab X
|
@item Zip Motion Blocks Video @tab X @tab X
|
||||||
@@ -647,8 +542,6 @@ following image formats are supported:
|
|||||||
@multitable @columnfractions .4 .1 .1 .4
|
@multitable @columnfractions .4 .1 .1 .4
|
||||||
@item Name @tab Encoding @tab Decoding @tab Comments
|
@item Name @tab Encoding @tab Decoding @tab Comments
|
||||||
@item 8SVX audio @tab @tab X
|
@item 8SVX audio @tab @tab X
|
||||||
@item AAC+ @tab E @tab X
|
|
||||||
@tab encoding supported through external library libaacplus
|
|
||||||
@item AAC @tab E @tab X
|
@item AAC @tab E @tab X
|
||||||
@tab encoding supported through external library libfaac and libvo-aacenc
|
@tab encoding supported through external library libfaac and libvo-aacenc
|
||||||
@item AC-3 @tab IX @tab X
|
@item AC-3 @tab IX @tab X
|
||||||
@@ -706,16 +599,15 @@ following image formats are supported:
|
|||||||
@item Atrac 3 @tab @tab X
|
@item Atrac 3 @tab @tab X
|
||||||
@item Bink Audio @tab @tab X
|
@item Bink Audio @tab @tab X
|
||||||
@tab Used in Bink and Smacker files in many games.
|
@tab Used in Bink and Smacker files in many games.
|
||||||
@item CELT @tab @tab E
|
@item CELT (Opus) @tab @tab E
|
||||||
@tab decoding supported through external library libcelt
|
@tab decoding supported through external library libcelt
|
||||||
@item Delphine Software International CIN audio @tab @tab X
|
@item Delphine Software International CIN audio @tab @tab X
|
||||||
@tab Codec used in Delphine Software International games.
|
@tab Codec used in Delphine Software International games.
|
||||||
@item Discworld II BMV Audio @tab @tab X
|
|
||||||
@item COOK @tab @tab X
|
@item COOK @tab @tab X
|
||||||
@tab All versions except 5.1 are supported.
|
@tab All versions except 5.1 are supported.
|
||||||
@item DCA (DTS Coherent Acoustics) @tab X @tab X
|
@item DCA (DTS Coherent Acoustics) @tab X @tab X
|
||||||
@item DPCM id RoQ @tab X @tab X
|
@item DPCM id RoQ @tab X @tab X
|
||||||
@tab Used in Quake III, Jedi Knight 2 and other computer games.
|
@tab Used in Quake III, Jedi Knight 2, other computer games.
|
||||||
@item DPCM Interplay @tab @tab X
|
@item DPCM Interplay @tab @tab X
|
||||||
@tab Used in various Interplay computer games.
|
@tab Used in various Interplay computer games.
|
||||||
@item DPCM Sierra Online @tab @tab X
|
@item DPCM Sierra Online @tab @tab X
|
||||||
@@ -727,8 +619,6 @@ following image formats are supported:
|
|||||||
@item DV audio @tab @tab X
|
@item DV audio @tab @tab X
|
||||||
@item Enhanced AC-3 @tab X @tab X
|
@item Enhanced AC-3 @tab X @tab X
|
||||||
@item FLAC (Free Lossless Audio Codec) @tab X @tab IX
|
@item FLAC (Free Lossless Audio Codec) @tab X @tab IX
|
||||||
@item G.723.1 @tab X @tab X
|
|
||||||
@item G.729 @tab @tab X
|
|
||||||
@item GSM @tab E @tab X
|
@item GSM @tab E @tab X
|
||||||
@tab encoding supported through external library libgsm
|
@tab encoding supported through external library libgsm
|
||||||
@item GSM Microsoft variant @tab E @tab X
|
@item GSM Microsoft variant @tab E @tab X
|
||||||
@@ -771,7 +661,7 @@ following image formats are supported:
|
|||||||
@item PCM unsigned 24-bit little-endian @tab X @tab X
|
@item PCM unsigned 24-bit little-endian @tab X @tab X
|
||||||
@item PCM unsigned 32-bit big-endian @tab X @tab X
|
@item PCM unsigned 32-bit big-endian @tab X @tab X
|
||||||
@item PCM unsigned 32-bit little-endian @tab X @tab X
|
@item PCM unsigned 32-bit little-endian @tab X @tab X
|
||||||
@item PCM Zork @tab @tab X
|
@item PCM Zork @tab X @tab X
|
||||||
@item QCELP / PureVoice @tab @tab X
|
@item QCELP / PureVoice @tab @tab X
|
||||||
@item QDesign Music Codec 2 @tab @tab X
|
@item QDesign Music Codec 2 @tab @tab X
|
||||||
@tab There are still some distortions.
|
@tab There are still some distortions.
|
||||||
@@ -791,7 +681,7 @@ following image formats are supported:
|
|||||||
@tab experimental codec
|
@tab experimental codec
|
||||||
@item Sonic lossless @tab X @tab X
|
@item Sonic lossless @tab X @tab X
|
||||||
@tab experimental codec
|
@tab experimental codec
|
||||||
@item Speex @tab E @tab E
|
@item Speex @tab @tab E
|
||||||
@tab supported through external library libspeex
|
@tab supported through external library libspeex
|
||||||
@item True Audio (TTA) @tab @tab X
|
@item True Audio (TTA) @tab @tab X
|
||||||
@item TrueHD @tab @tab X
|
@item TrueHD @tab @tab X
|
||||||
@@ -857,7 +747,6 @@ performance on systems without hardware floating point support).
|
|||||||
@item JACK @tab X @tab
|
@item JACK @tab X @tab
|
||||||
@item LIBDC1394 @tab X @tab
|
@item LIBDC1394 @tab X @tab
|
||||||
@item OSS @tab X @tab X
|
@item OSS @tab X @tab X
|
||||||
@item Pulseaudio @tab X @tab
|
|
||||||
@item Video4Linux @tab X @tab
|
@item Video4Linux @tab X @tab
|
||||||
@item Video4Linux2 @tab X @tab
|
@item Video4Linux2 @tab X @tab
|
||||||
@item VfW capture @tab X @tab
|
@item VfW capture @tab X @tab
|
||||||
@@ -866,15 +755,342 @@ performance on systems without hardware floating point support).
|
|||||||
|
|
||||||
@code{X} means that input/output is supported.
|
@code{X} means that input/output is supported.
|
||||||
|
|
||||||
@section Timecode
|
|
||||||
|
|
||||||
@multitable @columnfractions .4 .1 .1
|
@chapter Platform Specific information
|
||||||
@item Codec/format @tab Read @tab Write
|
|
||||||
@item DV @tab X @tab X
|
@section DOS
|
||||||
@item GXF @tab X @tab X
|
|
||||||
@item MOV @tab X @tab
|
Using a cross-compiler is preferred for various reasons.
|
||||||
@item MPEG1/2 @tab X @tab X
|
|
||||||
@item MXF @tab @tab X
|
@section OS/2
|
||||||
@end multitable
|
|
||||||
|
For information about compiling FFmpeg on OS/2 see
|
||||||
|
@url{http://www.edm2.com/index.php/FFmpeg}.
|
||||||
|
|
||||||
|
@section Unix-like
|
||||||
|
|
||||||
|
Some parts of FFmpeg cannot be built with version 2.15 of the GNU
|
||||||
|
assembler which is still provided by a few AMD64 distributions. To
|
||||||
|
make sure your compiler really uses the required version of gas
|
||||||
|
after a binutils upgrade, run:
|
||||||
|
|
||||||
|
@example
|
||||||
|
$(gcc -print-prog-name=as) --version
|
||||||
|
@end example
|
||||||
|
|
||||||
|
If not, then you should install a different compiler that has no
|
||||||
|
hard-coded path to gas. In the worst case pass @code{--disable-asm}
|
||||||
|
to configure.
|
||||||
|
|
||||||
|
@subsection BSD
|
||||||
|
|
||||||
|
BSD make will not build FFmpeg, you need to install and use GNU Make
|
||||||
|
(@file{gmake}).
|
||||||
|
|
||||||
|
@subsection (Open)Solaris
|
||||||
|
|
||||||
|
GNU Make is required to build FFmpeg, so you have to invoke (@file{gmake}),
|
||||||
|
standard Solaris Make will not work. When building with a non-c99 front-end
|
||||||
|
(gcc, generic suncc) add either @code{--extra-libs=/usr/lib/values-xpg6.o}
|
||||||
|
or @code{--extra-libs=/usr/lib/64/values-xpg6.o} to the configure options
|
||||||
|
since the libc is not c99-compliant by default. The probes performed by
|
||||||
|
configure may raise an exception leading to the death of configure itself
|
||||||
|
due to a bug in the system shell. Simply invoke a different shell such as
|
||||||
|
bash directly to work around this:
|
||||||
|
|
||||||
|
@example
|
||||||
|
bash ./configure
|
||||||
|
@end example
|
||||||
|
|
||||||
|
@subsection Darwin (MacOS X, iPhone)
|
||||||
|
|
||||||
|
MacOS X on PowerPC or ARM (iPhone) requires a preprocessor from
|
||||||
|
@url{http://github.com/yuvi/gas-preprocessor} to build the optimized
|
||||||
|
assembler functions. Just download the Perl script and put it somewhere
|
||||||
|
in your PATH, FFmpeg's configure will pick it up automatically.
|
||||||
|
|
||||||
|
@section Windows
|
||||||
|
|
||||||
|
To get help and instructions for building FFmpeg under Windows, check out
|
||||||
|
the FFmpeg Windows Help Forum at
|
||||||
|
@url{http://ffmpeg.arrozcru.org/}.
|
||||||
|
|
||||||
|
@subsection Native Windows compilation
|
||||||
|
|
||||||
|
FFmpeg can be built to run natively on Windows using the MinGW tools. Install
|
||||||
|
the latest versions of MSYS and MinGW from @url{http://www.mingw.org/}.
|
||||||
|
You can find detailed installation
|
||||||
|
instructions in the download section and the FAQ.
|
||||||
|
|
||||||
|
FFmpeg does not build out-of-the-box with the packages the automated MinGW
|
||||||
|
installer provides. It also requires coreutils to be installed and many other
|
||||||
|
packages updated to the latest version. The minimum version for some packages
|
||||||
|
are listed below:
|
||||||
|
|
||||||
|
@itemize
|
||||||
|
@item bash 3.1
|
||||||
|
@item msys-make 3.81-2 (note: not mingw32-make)
|
||||||
|
@item w32api 3.13
|
||||||
|
@item mingw-runtime 3.15
|
||||||
|
@end itemize
|
||||||
|
|
||||||
|
FFmpeg automatically passes @code{-fno-common} to the compiler to work around
|
||||||
|
a GCC bug (see @url{http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37216}).
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
|
||||||
|
@itemize
|
||||||
|
|
||||||
|
@item Building natively using MSYS can be sped up by disabling implicit rules
|
||||||
|
in the Makefile by calling @code{make -r} instead of plain @code{make}. This
|
||||||
|
speed up is close to non-existent for normal one-off builds and is only
|
||||||
|
noticeable when running make for a second time (for example in
|
||||||
|
@code{make install}).
|
||||||
|
|
||||||
|
@item In order to compile FFplay, you must have the MinGW development library
|
||||||
|
of SDL. Get it from @url{http://www.libsdl.org}.
|
||||||
|
Edit the @file{bin/sdl-config} script so that it points to the correct prefix
|
||||||
|
where SDL was installed. Verify that @file{sdl-config} can be launched from
|
||||||
|
the MSYS command line.
|
||||||
|
|
||||||
|
@item By using @code{./configure --enable-shared} when configuring FFmpeg,
|
||||||
|
you can build libavutil, libavcodec and libavformat as DLLs.
|
||||||
|
|
||||||
|
@end itemize
|
||||||
|
|
||||||
|
@subsection Microsoft Visual C++ compatibility
|
||||||
|
|
||||||
|
As stated in the FAQ, FFmpeg will not compile under MSVC++. However, if you
|
||||||
|
want to use the libav* libraries in your own applications, you can still
|
||||||
|
compile those applications using MSVC++. But the libav* libraries you link
|
||||||
|
to @emph{must} be built with MinGW. However, you will not be able to debug
|
||||||
|
inside the libav* libraries, since MSVC++ does not recognize the debug
|
||||||
|
symbols generated by GCC.
|
||||||
|
We strongly recommend you to move over from MSVC++ to MinGW tools.
|
||||||
|
|
||||||
|
This description of how to use the FFmpeg libraries with MSVC++ is based on
|
||||||
|
Microsoft Visual C++ 2005 Express Edition. If you have a different version,
|
||||||
|
you might have to modify the procedures slightly.
|
||||||
|
|
||||||
|
@subsubsection Using static libraries
|
||||||
|
|
||||||
|
Assuming you have just built and installed FFmpeg in @file{/usr/local}.
|
||||||
|
|
||||||
|
@enumerate
|
||||||
|
|
||||||
|
@item Create a new console application ("File / New / Project") and then
|
||||||
|
select "Win32 Console Application". On the appropriate page of the
|
||||||
|
Application Wizard, uncheck the "Precompiled headers" option.
|
||||||
|
|
||||||
|
@item Write the source code for your application, or, for testing, just
|
||||||
|
copy the code from an existing sample application into the source file
|
||||||
|
that MSVC++ has already created for you. For example, you can copy
|
||||||
|
@file{libavformat/output-example.c} from the FFmpeg distribution.
|
||||||
|
|
||||||
|
@item Open the "Project / Properties" dialog box. In the "Configuration"
|
||||||
|
combo box, select "All Configurations" so that the changes you make will
|
||||||
|
affect both debug and release builds. In the tree view on the left hand
|
||||||
|
side, select "C/C++ / General", then edit the "Additional Include
|
||||||
|
Directories" setting to contain the path where the FFmpeg includes were
|
||||||
|
installed (i.e. @file{c:\msys\1.0\local\include}).
|
||||||
|
Do not add MinGW's include directory here, or the include files will
|
||||||
|
conflict with MSVC's.
|
||||||
|
|
||||||
|
@item Still in the "Project / Properties" dialog box, select
|
||||||
|
"Linker / General" from the tree view and edit the
|
||||||
|
"Additional Library Directories" setting to contain the @file{lib}
|
||||||
|
directory where FFmpeg was installed (i.e. @file{c:\msys\1.0\local\lib}),
|
||||||
|
the directory where MinGW libs are installed (i.e. @file{c:\mingw\lib}),
|
||||||
|
and the directory where MinGW's GCC libs are installed
|
||||||
|
(i.e. @file{C:\mingw\lib\gcc\mingw32\4.2.1-sjlj}). Then select
|
||||||
|
"Linker / Input" from the tree view, and add the files @file{libavformat.a},
|
||||||
|
@file{libavcodec.a}, @file{libavutil.a}, @file{libmingwex.a},
|
||||||
|
@file{libgcc.a}, and any other libraries you used (i.e. @file{libz.a})
|
||||||
|
to the end of "Additional Dependencies".
|
||||||
|
|
||||||
|
@item Now, select "C/C++ / Code Generation" from the tree view. Select
|
||||||
|
"Debug" in the "Configuration" combo box. Make sure that "Runtime
|
||||||
|
Library" is set to "Multi-threaded Debug DLL". Then, select "Release" in
|
||||||
|
the "Configuration" combo box and make sure that "Runtime Library" is
|
||||||
|
set to "Multi-threaded DLL".
|
||||||
|
|
||||||
|
@item Click "OK" to close the "Project / Properties" dialog box.
|
||||||
|
|
||||||
|
@item MSVC++ lacks some C99 header files that are fundamental for FFmpeg.
|
||||||
|
Get msinttypes from @url{http://code.google.com/p/msinttypes/downloads/list}
|
||||||
|
and install it in MSVC++'s include directory
|
||||||
|
(i.e. @file{C:\Program Files\Microsoft Visual Studio 8\VC\include}).
|
||||||
|
|
||||||
|
@item MSVC++ also does not understand the @code{inline} keyword used by
|
||||||
|
FFmpeg, so you must add this line before @code{#include}ing libav*:
|
||||||
|
@example
|
||||||
|
#define inline _inline
|
||||||
|
@end example
|
||||||
|
|
||||||
|
@item Build your application, everything should work.
|
||||||
|
|
||||||
|
@end enumerate
|
||||||
|
|
||||||
|
@subsubsection Using shared libraries
|
||||||
|
|
||||||
|
This is how to create DLL and LIB files that are compatible with MSVC++:
|
||||||
|
|
||||||
|
@enumerate
|
||||||
|
|
||||||
|
@item Add a call to @file{vcvars32.bat} (which sets up the environment
|
||||||
|
variables for the Visual C++ tools) as the first line of @file{msys.bat}.
|
||||||
|
The standard location for @file{vcvars32.bat} is
|
||||||
|
@file{C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat},
|
||||||
|
and the standard location for @file{msys.bat} is @file{C:\msys\1.0\msys.bat}.
|
||||||
|
If this corresponds to your setup, add the following line as the first line
|
||||||
|
of @file{msys.bat}:
|
||||||
|
|
||||||
|
@example
|
||||||
|
call "C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat"
|
||||||
|
@end example
|
||||||
|
|
||||||
|
Alternatively, you may start the @file{Visual Studio 2005 Command Prompt},
|
||||||
|
and run @file{c:\msys\1.0\msys.bat} from there.
|
||||||
|
|
||||||
|
@item Within the MSYS shell, run @code{lib.exe}. If you get a help message
|
||||||
|
from @file{Microsoft (R) Library Manager}, this means your environment
|
||||||
|
variables are set up correctly, the @file{Microsoft (R) Library Manager}
|
||||||
|
is on the path and will be used by FFmpeg to create
|
||||||
|
MSVC++-compatible import libraries.
|
||||||
|
|
||||||
|
@item Build FFmpeg with
|
||||||
|
|
||||||
|
@example
|
||||||
|
./configure --enable-shared
|
||||||
|
make
|
||||||
|
make install
|
||||||
|
@end example
|
||||||
|
|
||||||
|
Your install path (@file{/usr/local/} by default) should now have the
|
||||||
|
necessary DLL and LIB files under the @file{bin} directory.
|
||||||
|
|
||||||
|
@end enumerate
|
||||||
|
|
||||||
|
To use those files with MSVC++, do the same as you would do with
|
||||||
|
the static libraries, as described above. But in Step 4,
|
||||||
|
you should only need to add the directory where the LIB files are installed
|
||||||
|
(i.e. @file{c:\msys\usr\local\bin}). This is not a typo, the LIB files are
|
||||||
|
installed in the @file{bin} directory. And instead of adding the static
|
||||||
|
libraries (@file{libxxx.a} files) you should add the MSVC import libraries
|
||||||
|
(@file{avcodec.lib}, @file{avformat.lib}, and
|
||||||
|
@file{avutil.lib}). Note that you should not use the GCC import
|
||||||
|
libraries (@file{libxxx.dll.a} files), as these will give you undefined
|
||||||
|
reference errors. There should be no need for @file{libmingwex.a},
|
||||||
|
@file{libgcc.a}, and @file{wsock32.lib}, nor any other external library
|
||||||
|
statically linked into the DLLs. The @file{bin} directory contains a bunch
|
||||||
|
of DLL files, but the ones that are actually used to run your application
|
||||||
|
are the ones with a major version number in their filenames
|
||||||
|
(i.e. @file{avcodec-51.dll}).
|
||||||
|
|
||||||
|
FFmpeg headers do not declare global data for Windows DLLs through the usual
|
||||||
|
dllexport/dllimport interface. Such data will be exported properly while
|
||||||
|
building, but to use them in your MSVC++ code you will have to edit the
|
||||||
|
appropriate headers and mark the data as dllimport. For example, in
|
||||||
|
libavutil/pixdesc.h you should have:
|
||||||
|
@example
|
||||||
|
extern __declspec(dllimport) const AVPixFmtDescriptor av_pix_fmt_descriptors[];
|
||||||
|
@end example
|
||||||
|
|
||||||
|
Note that using import libraries created by dlltool requires
|
||||||
|
the linker optimization option to be set to
|
||||||
|
"References: Keep Unreferenced Data (@code{/OPT:NOREF})", otherwise
|
||||||
|
the resulting binaries will fail during runtime. This isn't
|
||||||
|
required when using import libraries generated by lib.exe.
|
||||||
|
This issue is reported upstream at
|
||||||
|
@url{http://sourceware.org/bugzilla/show_bug.cgi?id=12633}.
|
||||||
|
|
||||||
|
@subsection Cross compilation for Windows with Linux
|
||||||
|
|
||||||
|
You must use the MinGW cross compilation tools available at
|
||||||
|
@url{http://www.mingw.org/}.
|
||||||
|
|
||||||
|
Then configure FFmpeg with the following options:
|
||||||
|
@example
|
||||||
|
./configure --target-os=mingw32 --cross-prefix=i386-mingw32msvc-
|
||||||
|
@end example
|
||||||
|
(you can change the cross-prefix according to the prefix chosen for the
|
||||||
|
MinGW tools).
|
||||||
|
|
||||||
|
Then you can easily test FFmpeg with Wine
|
||||||
|
(@url{http://www.winehq.com/}).
|
||||||
|
|
||||||
|
@subsection Compilation under Cygwin
|
||||||
|
|
||||||
|
Please use Cygwin 1.7.x as the obsolete 1.5.x Cygwin versions lack
|
||||||
|
llrint() in its C library.
|
||||||
|
|
||||||
|
Install your Cygwin with all the "Base" packages, plus the
|
||||||
|
following "Devel" ones:
|
||||||
|
@example
|
||||||
|
binutils, gcc4-core, make, git, mingw-runtime, texi2html
|
||||||
|
@end example
|
||||||
|
|
||||||
|
And the following "Utils" one:
|
||||||
|
@example
|
||||||
|
diffutils
|
||||||
|
@end example
|
||||||
|
|
||||||
|
Then run
|
||||||
|
|
||||||
|
@example
|
||||||
|
./configure
|
||||||
|
@end example
|
||||||
|
|
||||||
|
to make a static build.
|
||||||
|
|
||||||
|
The current @code{gcc4-core} package is buggy and needs this flag to build
|
||||||
|
shared libraries:
|
||||||
|
|
||||||
|
@example
|
||||||
|
./configure --enable-shared --disable-static --extra-cflags=-fno-reorder-functions
|
||||||
|
@end example
|
||||||
|
|
||||||
|
If you want to build FFmpeg with additional libraries, download Cygwin
|
||||||
|
"Devel" packages for Ogg and Vorbis from any Cygwin packages repository:
|
||||||
|
@example
|
||||||
|
libogg-devel, libvorbis-devel
|
||||||
|
@end example
|
||||||
|
|
||||||
|
These library packages are only available from Cygwin Ports
|
||||||
|
(@url{http://sourceware.org/cygwinports/}) :
|
||||||
|
|
||||||
|
@example
|
||||||
|
yasm, libSDL-devel, libdirac-devel, libfaac-devel, libgsm-devel,
|
||||||
|
libmp3lame-devel, libschroedinger1.0-devel, speex-devel, libtheora-devel,
|
||||||
|
libxvidcore-devel
|
||||||
|
@end example
|
||||||
|
|
||||||
|
The recommendation for libnut and x264 is to build them from source by
|
||||||
|
yourself, as they evolve too quickly for Cygwin Ports to be up to date.
|
||||||
|
|
||||||
|
Cygwin 1.7.x has IPv6 support. You can add IPv6 to Cygwin 1.5.x by means
|
||||||
|
of the @code{libgetaddrinfo-devel} package, available at Cygwin Ports.
|
||||||
|
|
||||||
|
@subsection Crosscompilation for Windows under Cygwin
|
||||||
|
|
||||||
|
With Cygwin you can create Windows binaries that do not need the cygwin1.dll.
|
||||||
|
|
||||||
|
Just install your Cygwin as explained before, plus these additional
|
||||||
|
"Devel" packages:
|
||||||
|
@example
|
||||||
|
gcc-mingw-core, mingw-runtime, mingw-zlib
|
||||||
|
@end example
|
||||||
|
|
||||||
|
and add some special flags to your configure invocation.
|
||||||
|
|
||||||
|
For a static build run
|
||||||
|
@example
|
||||||
|
./configure --target-os=mingw32 --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin
|
||||||
|
@end example
|
||||||
|
|
||||||
|
and for a build with shared libraries
|
||||||
|
@example
|
||||||
|
./configure --target-os=mingw32 --enable-shared --disable-static --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin
|
||||||
|
@end example
|
||||||
|
|
||||||
@bye
|
@bye
|
||||||
|
|||||||
@@ -1,344 +0,0 @@
|
|||||||
\input texinfo @c -*- texinfo -*-
|
|
||||||
|
|
||||||
@settitle Using git to develop FFmpeg
|
|
||||||
|
|
||||||
@titlepage
|
|
||||||
@center @titlefont{Using git to develop FFmpeg}
|
|
||||||
@end titlepage
|
|
||||||
|
|
||||||
@top
|
|
||||||
|
|
||||||
@contents
|
|
||||||
|
|
||||||
@chapter Introduction
|
|
||||||
|
|
||||||
This document aims in giving some quick references on a set of useful git
|
|
||||||
commands. You should always use the extensive and detailed documentation
|
|
||||||
provided directly by git:
|
|
||||||
|
|
||||||
@example
|
|
||||||
git --help
|
|
||||||
man git
|
|
||||||
@end example
|
|
||||||
|
|
||||||
shows you the available subcommands,
|
|
||||||
|
|
||||||
@example
|
|
||||||
git <command> --help
|
|
||||||
man git-<command>
|
|
||||||
@end example
|
|
||||||
|
|
||||||
shows information about the subcommand <command>.
|
|
||||||
|
|
||||||
Additional information could be found on the
|
|
||||||
@url{http://gitref.org, Git Reference} website
|
|
||||||
|
|
||||||
For more information about the Git project, visit the
|
|
||||||
|
|
||||||
@url{http://git-scm.com/, Git website}
|
|
||||||
|
|
||||||
Consult these resources whenever you have problems, they are quite exhaustive.
|
|
||||||
|
|
||||||
What follows now is a basic introduction to Git and some FFmpeg-specific
|
|
||||||
guidelines to ease the contribution to the project
|
|
||||||
|
|
||||||
@chapter Basics Usage
|
|
||||||
|
|
||||||
@section Get GIT
|
|
||||||
|
|
||||||
You can get git from @url{http://git-scm.com/}
|
|
||||||
Most distribution and operating system provide a package for it.
|
|
||||||
|
|
||||||
|
|
||||||
@section Cloning the source tree
|
|
||||||
|
|
||||||
@example
|
|
||||||
git clone git://source.ffmpeg.org/ffmpeg <target>
|
|
||||||
@end example
|
|
||||||
|
|
||||||
This will put the FFmpeg sources into the directory @var{<target>}.
|
|
||||||
|
|
||||||
@example
|
|
||||||
git clone git@@source.ffmpeg.org:ffmpeg <target>
|
|
||||||
@end example
|
|
||||||
|
|
||||||
This will put the FFmpeg sources into the directory @var{<target>} and let
|
|
||||||
you push back your changes to the remote repository.
|
|
||||||
|
|
||||||
|
|
||||||
@section Updating the source tree to the latest revision
|
|
||||||
|
|
||||||
@example
|
|
||||||
git pull (--rebase)
|
|
||||||
@end example
|
|
||||||
|
|
||||||
pulls in the latest changes from the tracked branch. The tracked branch
|
|
||||||
can be remote. By default the master branch tracks the branch master in
|
|
||||||
the remote origin.
|
|
||||||
|
|
||||||
@float IMPORTANT
|
|
||||||
@command{--rebase} (see below) is recommended.
|
|
||||||
@end float
|
|
||||||
|
|
||||||
@section Rebasing your local branches
|
|
||||||
|
|
||||||
@example
|
|
||||||
git pull --rebase
|
|
||||||
@end example
|
|
||||||
|
|
||||||
fetches the changes from the main repository and replays your local commits
|
|
||||||
over it. This is required to keep all your local changes at the top of
|
|
||||||
FFmpeg's master tree. The master tree will reject pushes with merge commits.
|
|
||||||
|
|
||||||
|
|
||||||
@section Adding/removing files/directories
|
|
||||||
|
|
||||||
@example
|
|
||||||
git add [-A] <filename/dirname>
|
|
||||||
git rm [-r] <filename/dirname>
|
|
||||||
@end example
|
|
||||||
|
|
||||||
GIT needs to get notified of all changes you make to your working
|
|
||||||
directory that makes files appear or disappear.
|
|
||||||
Line moves across files are automatically tracked.
|
|
||||||
|
|
||||||
|
|
||||||
@section Showing modifications
|
|
||||||
|
|
||||||
@example
|
|
||||||
git diff <filename(s)>
|
|
||||||
@end example
|
|
||||||
|
|
||||||
will show all local modifications in your working directory as unified diff.
|
|
||||||
|
|
||||||
|
|
||||||
@section Inspecting the changelog
|
|
||||||
|
|
||||||
@example
|
|
||||||
git log <filename(s)>
|
|
||||||
@end example
|
|
||||||
|
|
||||||
You may also use the graphical tools like gitview or gitk or the web
|
|
||||||
interface available at http://source.ffmpeg.org/
|
|
||||||
|
|
||||||
@section Checking source tree status
|
|
||||||
|
|
||||||
@example
|
|
||||||
git status
|
|
||||||
@end example
|
|
||||||
|
|
||||||
detects all the changes you made and lists what actions will be taken in case
|
|
||||||
of a commit (additions, modifications, deletions, etc.).
|
|
||||||
|
|
||||||
|
|
||||||
@section Committing
|
|
||||||
|
|
||||||
@example
|
|
||||||
git diff --check
|
|
||||||
@end example
|
|
||||||
|
|
||||||
to double check your changes before committing them to avoid trouble later
|
|
||||||
on. All experienced developers do this on each and every commit, no matter
|
|
||||||
how small.
|
|
||||||
Every one of them has been saved from looking like a fool by this many times.
|
|
||||||
It's very easy for stray debug output or cosmetic modifications to slip in,
|
|
||||||
please avoid problems through this extra level of scrutiny.
|
|
||||||
|
|
||||||
For cosmetics-only commits you should get (almost) empty output from
|
|
||||||
|
|
||||||
@example
|
|
||||||
git diff -w -b <filename(s)>
|
|
||||||
@end example
|
|
||||||
|
|
||||||
Also check the output of
|
|
||||||
|
|
||||||
@example
|
|
||||||
git status
|
|
||||||
@end example
|
|
||||||
|
|
||||||
to make sure you don't have untracked files or deletions.
|
|
||||||
|
|
||||||
@example
|
|
||||||
git add [-i|-p|-A] <filenames/dirnames>
|
|
||||||
@end example
|
|
||||||
|
|
||||||
Make sure you have told git your name and email address
|
|
||||||
|
|
||||||
@example
|
|
||||||
git config --global user.name "My Name"
|
|
||||||
git config --global user.email my@@email.invalid
|
|
||||||
@end example
|
|
||||||
|
|
||||||
Use @var{--global} to set the global configuration for all your git checkouts.
|
|
||||||
|
|
||||||
Git will select the changes to the files for commit. Optionally you can use
|
|
||||||
the interactive or the patch mode to select hunk by hunk what should be
|
|
||||||
added to the commit.
|
|
||||||
|
|
||||||
|
|
||||||
@example
|
|
||||||
git commit
|
|
||||||
@end example
|
|
||||||
|
|
||||||
Git will commit the selected changes to your current local branch.
|
|
||||||
|
|
||||||
You will be prompted for a log message in an editor, which is either
|
|
||||||
set in your personal configuration file through
|
|
||||||
|
|
||||||
@example
|
|
||||||
git config --global core.editor
|
|
||||||
@end example
|
|
||||||
|
|
||||||
or set by one of the following environment variables:
|
|
||||||
@var{GIT_EDITOR}, @var{VISUAL} or @var{EDITOR}.
|
|
||||||
|
|
||||||
Log messages should be concise but descriptive. Explain why you made a change,
|
|
||||||
what you did will be obvious from the changes themselves most of the time.
|
|
||||||
Saying just "bug fix" or "10l" is bad. Remember that people of varying skill
|
|
||||||
levels look at and educate themselves while reading through your code. Don't
|
|
||||||
include filenames in log messages, Git provides that information.
|
|
||||||
|
|
||||||
Possibly make the commit message have a terse, descriptive first line, an
|
|
||||||
empty line and then a full description. The first line will be used to name
|
|
||||||
the patch by git format-patch.
|
|
||||||
|
|
||||||
@section Preparing a patchset
|
|
||||||
|
|
||||||
@example
|
|
||||||
git format-patch <commit> [-o directory]
|
|
||||||
@end example
|
|
||||||
|
|
||||||
will generate a set of patches for each commit between @var{<commit>} and
|
|
||||||
current @var{HEAD}. E.g.
|
|
||||||
|
|
||||||
@example
|
|
||||||
git format-patch origin/master
|
|
||||||
@end example
|
|
||||||
|
|
||||||
will generate patches for all commits on current branch which are not
|
|
||||||
present in upstream.
|
|
||||||
A useful shortcut is also
|
|
||||||
|
|
||||||
@example
|
|
||||||
git format-patch -n
|
|
||||||
@end example
|
|
||||||
|
|
||||||
which will generate patches from last @var{n} commits.
|
|
||||||
By default the patches are created in the current directory.
|
|
||||||
|
|
||||||
@section Sending patches for review
|
|
||||||
|
|
||||||
@example
|
|
||||||
git send-email <commit list|directory>
|
|
||||||
@end example
|
|
||||||
|
|
||||||
will send the patches created by @command{git format-patch} or directly
|
|
||||||
generates them. All the email fields can be configured in the global/local
|
|
||||||
configuration or overridden by command line.
|
|
||||||
Note that this tool must often be installed separately (e.g. @var{git-email}
|
|
||||||
package on Debian-based distros).
|
|
||||||
|
|
||||||
|
|
||||||
@section Renaming/moving/copying files or contents of files
|
|
||||||
|
|
||||||
Git automatically tracks such changes, making those normal commits.
|
|
||||||
|
|
||||||
@example
|
|
||||||
mv/cp path/file otherpath/otherfile
|
|
||||||
git add [-A] .
|
|
||||||
git commit
|
|
||||||
@end example
|
|
||||||
|
|
||||||
|
|
||||||
@chapter FFmpeg specific
|
|
||||||
|
|
||||||
@section Reverting broken commits
|
|
||||||
|
|
||||||
@example
|
|
||||||
git reset <commit>
|
|
||||||
@end example
|
|
||||||
|
|
||||||
@command{git reset} will uncommit the changes till @var{<commit>} rewriting
|
|
||||||
the current branch history.
|
|
||||||
|
|
||||||
@example
|
|
||||||
git commit --amend
|
|
||||||
@end example
|
|
||||||
|
|
||||||
allows to amend the last commit details quickly.
|
|
||||||
|
|
||||||
@example
|
|
||||||
git rebase -i origin/master
|
|
||||||
@end example
|
|
||||||
|
|
||||||
will replay local commits over the main repository allowing to edit, merge
|
|
||||||
or remove some of them in the process.
|
|
||||||
|
|
||||||
@float NOTE
|
|
||||||
@command{git reset}, @command{git commit --amend} and @command{git rebase}
|
|
||||||
rewrite history, so you should use them ONLY on your local or topic branches.
|
|
||||||
The main repository will reject those changes.
|
|
||||||
@end float
|
|
||||||
|
|
||||||
@example
|
|
||||||
git revert <commit>
|
|
||||||
@end example
|
|
||||||
|
|
||||||
@command{git revert} will generate a revert commit. This will not make the
|
|
||||||
faulty commit disappear from the history.
|
|
||||||
|
|
||||||
@section Pushing changes to remote trees
|
|
||||||
|
|
||||||
@example
|
|
||||||
git push
|
|
||||||
@end example
|
|
||||||
|
|
||||||
Will push the changes to the default remote (@var{origin}).
|
|
||||||
Git will prevent you from pushing changes if the local and remote trees are
|
|
||||||
out of sync. Refer to and to sync the local tree.
|
|
||||||
|
|
||||||
@example
|
|
||||||
git remote add <name> <url>
|
|
||||||
@end example
|
|
||||||
|
|
||||||
Will add additional remote with a name reference, it is useful if you want
|
|
||||||
to push your local branch for review on a remote host.
|
|
||||||
|
|
||||||
@example
|
|
||||||
git push <remote> <refspec>
|
|
||||||
@end example
|
|
||||||
|
|
||||||
Will push the changes to the @var{<remote>} repository.
|
|
||||||
Omitting @var{<refspec>} makes @command{git push} update all the remote
|
|
||||||
branches matching the local ones.
|
|
||||||
|
|
||||||
@section Finding a specific svn revision
|
|
||||||
|
|
||||||
Since version 1.7.1 git supports @var{:/foo} syntax for specifying commits
|
|
||||||
based on a regular expression. see man gitrevisions
|
|
||||||
|
|
||||||
@example
|
|
||||||
git show :/'as revision 23456'
|
|
||||||
@end example
|
|
||||||
|
|
||||||
will show the svn changeset @var{r23456}. With older git versions searching in
|
|
||||||
the @command{git log} output is the easiest option (especially if a pager with
|
|
||||||
search capabilities is used).
|
|
||||||
This commit can be checked out with
|
|
||||||
|
|
||||||
@example
|
|
||||||
git checkout -b svn_23456 :/'as revision 23456'
|
|
||||||
@end example
|
|
||||||
|
|
||||||
or for git < 1.7.1 with
|
|
||||||
|
|
||||||
@example
|
|
||||||
git checkout -b svn_23456 $SHA1
|
|
||||||
@end example
|
|
||||||
|
|
||||||
where @var{$SHA1} is the commit hash from the @command{git log} output.
|
|
||||||
|
|
||||||
@chapter Server Issues
|
|
||||||
|
|
||||||
Contact the project admins @email{root@@ffmpeg.org} if you have technical
|
|
||||||
problems with the GIT server.
|
|
||||||
@@ -39,17 +39,16 @@ I. BASICS:
|
|||||||
|
|
||||||
0. Get GIT:
|
0. Get GIT:
|
||||||
|
|
||||||
Most distributions have a git package, if not
|
|
||||||
You can get git from http://git-scm.com/
|
You can get git from http://git-scm.com/
|
||||||
|
|
||||||
|
|
||||||
1. Cloning the source tree:
|
1. Cloning the source tree:
|
||||||
|
|
||||||
git clone git://source.ffmpeg.org/ffmpeg <target>
|
git clone git://git.videolan.org/ffmpeg <target>
|
||||||
|
|
||||||
This will put the FFmpeg sources into the directory <target>.
|
This will put the FFmpeg sources into the directory <target>.
|
||||||
|
|
||||||
git clone git@source.ffmpeg.org:ffmpeg <target>
|
git clone git@git.videolan.org:ffmpeg <target>
|
||||||
|
|
||||||
This will put the FFmpeg sources into the directory <target> and let
|
This will put the FFmpeg sources into the directory <target> and let
|
||||||
you push back your changes to the remote repository.
|
you push back your changes to the remote repository.
|
||||||
@@ -98,7 +97,7 @@ I. BASICS:
|
|||||||
git log <filename(s)>
|
git log <filename(s)>
|
||||||
|
|
||||||
You may also use the graphical tools like gitview or gitk or the web
|
You may also use the graphical tools like gitview or gitk or the web
|
||||||
interface available at http://source.ffmpeg.org
|
interface available at http://git.videolan.org
|
||||||
|
|
||||||
6. Checking source tree status:
|
6. Checking source tree status:
|
||||||
|
|
||||||
@@ -206,19 +205,8 @@ I. BASICS:
|
|||||||
|
|
||||||
git format-patch <commit> [-o directory]
|
git format-patch <commit> [-o directory]
|
||||||
|
|
||||||
will generate a set of patches for each commit between <commit> and
|
will generate a set of patches out of the current branch starting from
|
||||||
current HEAD. E.g.
|
commit. By default the patches are created in the current directory.
|
||||||
|
|
||||||
git format-patch origin/master
|
|
||||||
|
|
||||||
will generate patches for all commits on current branch which are not
|
|
||||||
present in upstream.
|
|
||||||
A useful shortcut is also
|
|
||||||
|
|
||||||
git format-patch -n
|
|
||||||
|
|
||||||
which will generate patches from last n commits.
|
|
||||||
By default the patches are created in the current directory.
|
|
||||||
|
|
||||||
11. Sending patches for review
|
11. Sending patches for review
|
||||||
|
|
||||||
@@ -227,8 +215,6 @@ I. BASICS:
|
|||||||
will send the patches created by git format-patch or directly generates
|
will send the patches created by git format-patch or directly generates
|
||||||
them. All the email fields can be configured in the global/local
|
them. All the email fields can be configured in the global/local
|
||||||
configuration or overridden by command line.
|
configuration or overridden by command line.
|
||||||
Note that this tool must often be installed separately (e.g. git-email
|
|
||||||
package on Debian-based distros).
|
|
||||||
|
|
||||||
12. Pushing changes to remote trees
|
12. Pushing changes to remote trees
|
||||||
|
|
||||||
|
|||||||
416
doc/indevs.texi
416
doc/indevs.texi
@@ -42,7 +42,7 @@ specify card number or identifier, device number and subdevice number
|
|||||||
To see the list of cards currently recognized by your system check the
|
To see the list of cards currently recognized by your system check the
|
||||||
files @file{/proc/asound/cards} and @file{/proc/asound/devices}.
|
files @file{/proc/asound/cards} and @file{/proc/asound/devices}.
|
||||||
|
|
||||||
For example to capture with @command{ffmpeg} from an ALSA device with
|
For example to capture with @file{ffmpeg} from an ALSA device with
|
||||||
card id 0, you may run the command:
|
card id 0, you may run the command:
|
||||||
@example
|
@example
|
||||||
ffmpeg -f alsa -i hw:0 alsaout.wav
|
ffmpeg -f alsa -i hw:0 alsaout.wav
|
||||||
@@ -55,101 +55,6 @@ For more information see:
|
|||||||
|
|
||||||
BSD video input device.
|
BSD video input device.
|
||||||
|
|
||||||
@section dshow
|
|
||||||
|
|
||||||
Windows DirectShow input device.
|
|
||||||
|
|
||||||
DirectShow support is enabled when FFmpeg is built with mingw-w64.
|
|
||||||
Currently only audio and video devices are supported.
|
|
||||||
|
|
||||||
Multiple devices may be opened as separate inputs, but they may also be
|
|
||||||
opened on the same input, which should improve synchronism between them.
|
|
||||||
|
|
||||||
The input name should be in the format:
|
|
||||||
|
|
||||||
@example
|
|
||||||
@var{TYPE}=@var{NAME}[:@var{TYPE}=@var{NAME}]
|
|
||||||
@end example
|
|
||||||
|
|
||||||
where @var{TYPE} can be either @var{audio} or @var{video},
|
|
||||||
and @var{NAME} is the device's name.
|
|
||||||
|
|
||||||
@subsection Options
|
|
||||||
|
|
||||||
If no options are specified, the device's defaults are used.
|
|
||||||
If the device does not support the requested options, it will
|
|
||||||
fail to open.
|
|
||||||
|
|
||||||
@table @option
|
|
||||||
|
|
||||||
@item video_size
|
|
||||||
Set the video size in the captured video.
|
|
||||||
|
|
||||||
@item framerate
|
|
||||||
Set the framerate in the captured video.
|
|
||||||
|
|
||||||
@item sample_rate
|
|
||||||
Set the sample rate (in Hz) of the captured audio.
|
|
||||||
|
|
||||||
@item sample_size
|
|
||||||
Set the sample size (in bits) of the captured audio.
|
|
||||||
|
|
||||||
@item channels
|
|
||||||
Set the number of channels in the captured audio.
|
|
||||||
|
|
||||||
@item list_devices
|
|
||||||
If set to @option{true}, print a list of devices and exit.
|
|
||||||
|
|
||||||
@item list_options
|
|
||||||
If set to @option{true}, print a list of selected device's options
|
|
||||||
and exit.
|
|
||||||
|
|
||||||
@item video_device_number
|
|
||||||
Set video device number for devices with same name (starts at 0,
|
|
||||||
defaults to 0).
|
|
||||||
|
|
||||||
@item audio_device_number
|
|
||||||
Set audio device number for devices with same name (starts at 0,
|
|
||||||
defaults to 0).
|
|
||||||
|
|
||||||
@end table
|
|
||||||
|
|
||||||
@subsection Examples
|
|
||||||
|
|
||||||
@itemize
|
|
||||||
|
|
||||||
@item
|
|
||||||
Print the list of DirectShow supported devices and exit:
|
|
||||||
@example
|
|
||||||
$ ffmpeg -list_devices true -f dshow -i dummy
|
|
||||||
@end example
|
|
||||||
|
|
||||||
@item
|
|
||||||
Open video device @var{Camera}:
|
|
||||||
@example
|
|
||||||
$ ffmpeg -f dshow -i video="Camera"
|
|
||||||
@end example
|
|
||||||
|
|
||||||
@item
|
|
||||||
Open second video device with name @var{Camera}:
|
|
||||||
@example
|
|
||||||
$ ffmpeg -f dshow -video_device_number 1 -i video="Camera"
|
|
||||||
@end example
|
|
||||||
|
|
||||||
@item
|
|
||||||
Open video device @var{Camera} and audio device @var{Microphone}:
|
|
||||||
@example
|
|
||||||
$ ffmpeg -f dshow -i video="Camera":audio="Microphone"
|
|
||||||
@end example
|
|
||||||
|
|
||||||
@item
|
|
||||||
Print the list of supported options in selected device and exit:
|
|
||||||
@example
|
|
||||||
$ ffmpeg -list_options true -f dshow -i video="Camera"
|
|
||||||
@end example
|
|
||||||
|
|
||||||
@end itemize
|
|
||||||
|
|
||||||
@section dv1394
|
@section dv1394
|
||||||
|
|
||||||
Linux DV 1394 input device.
|
Linux DV 1394 input device.
|
||||||
@@ -167,14 +72,14 @@ For more detailed information read the file
|
|||||||
Documentation/fb/framebuffer.txt included in the Linux source tree.
|
Documentation/fb/framebuffer.txt included in the Linux source tree.
|
||||||
|
|
||||||
To record from the framebuffer device @file{/dev/fb0} with
|
To record from the framebuffer device @file{/dev/fb0} with
|
||||||
@command{ffmpeg}:
|
@file{ffmpeg}:
|
||||||
@example
|
@example
|
||||||
ffmpeg -f fbdev -r 10 -i /dev/fb0 out.avi
|
ffmpeg -f fbdev -r 10 -i /dev/fb0 out.avi
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
You can take a single screenshot image with the command:
|
You can take a single screenshot image with the command:
|
||||||
@example
|
@example
|
||||||
ffmpeg -f fbdev -frames:v 1 -r 1 -i /dev/fb0 screenshot.jpeg
|
ffmpeg -f fbdev -vframes 1 -r 1 -i /dev/fb0 screenshot.jpeg
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
See also @url{http://linux-fbdev.sourceforge.net/}, and fbset(1).
|
See also @url{http://linux-fbdev.sourceforge.net/}, and fbset(1).
|
||||||
@@ -196,15 +101,15 @@ device.
|
|||||||
Once you have created one or more JACK readable clients, you need to
|
Once you have created one or more JACK readable clients, you need to
|
||||||
connect them to one or more JACK writable clients.
|
connect them to one or more JACK writable clients.
|
||||||
|
|
||||||
To connect or disconnect JACK clients you can use the @command{jack_connect}
|
To connect or disconnect JACK clients you can use the
|
||||||
and @command{jack_disconnect} programs, or do it through a graphical interface,
|
@file{jack_connect} and @file{jack_disconnect} programs, or do it
|
||||||
for example with @command{qjackctl}.
|
through a graphical interface, for example with @file{qjackctl}.
|
||||||
|
|
||||||
To list the JACK clients and their properties you can invoke the command
|
To list the JACK clients and their properties you can invoke the command
|
||||||
@command{jack_lsp}.
|
@file{jack_lsp}.
|
||||||
|
|
||||||
Follows an example which shows how to capture a JACK readable client
|
Follows an example which shows how to capture a JACK readable client
|
||||||
with @command{ffmpeg}.
|
with @file{ffmpeg}.
|
||||||
@example
|
@example
|
||||||
# Create a JACK writable client with name "ffmpeg".
|
# Create a JACK writable client with name "ffmpeg".
|
||||||
$ ffmpeg -f jack -i ffmpeg -y out.wav
|
$ ffmpeg -f jack -i ffmpeg -y out.wav
|
||||||
@@ -228,165 +133,10 @@ $ jack_connect metro:120_bpm ffmpeg:input_1
|
|||||||
For more information read:
|
For more information read:
|
||||||
@url{http://jackaudio.org/}
|
@url{http://jackaudio.org/}
|
||||||
|
|
||||||
@section lavfi
|
|
||||||
|
|
||||||
Libavfilter input virtual device.
|
|
||||||
|
|
||||||
This input device reads data from the open output pads of a libavfilter
|
|
||||||
filtergraph.
|
|
||||||
|
|
||||||
For each filtergraph open output, the input device will create a
|
|
||||||
corresponding stream which is mapped to the generated output. Currently
|
|
||||||
only video data is supported. The filtergraph is specified through the
|
|
||||||
option @option{graph}.
|
|
||||||
|
|
||||||
@subsection Options
|
|
||||||
|
|
||||||
@table @option
|
|
||||||
|
|
||||||
@item graph
|
|
||||||
Specify the filtergraph to use as input. Each video open output must be
|
|
||||||
labelled by a unique string of the form "out@var{N}", where @var{N} is a
|
|
||||||
number starting from 0 corresponding to the mapped input stream
|
|
||||||
generated by the device.
|
|
||||||
The first unlabelled output is automatically assigned to the "out0"
|
|
||||||
label, but all the others need to be specified explicitly.
|
|
||||||
|
|
||||||
If not specified defaults to the filename specified for the input
|
|
||||||
device.
|
|
||||||
@end table
|
|
||||||
|
|
||||||
@subsection Examples
|
|
||||||
|
|
||||||
@itemize
|
|
||||||
@item
|
|
||||||
Create a color video stream and play it back with @command{ffplay}:
|
|
||||||
@example
|
|
||||||
ffplay -f lavfi -graph "color=pink [out0]" dummy
|
|
||||||
@end example
|
|
||||||
|
|
||||||
@item
|
|
||||||
As the previous example, but use filename for specifying the graph
|
|
||||||
description, and omit the "out0" label:
|
|
||||||
@example
|
|
||||||
ffplay -f lavfi color=pink
|
|
||||||
@end example
|
|
||||||
|
|
||||||
@item
|
|
||||||
Create three different video test filtered sources and play them:
|
|
||||||
@example
|
|
||||||
ffplay -f lavfi -graph "testsrc [out0]; testsrc,hflip [out1]; testsrc,negate [out2]" test3
|
|
||||||
@end example
|
|
||||||
|
|
||||||
@item
|
|
||||||
Read an audio stream from a file using the amovie source and play it
|
|
||||||
back with @command{ffplay}:
|
|
||||||
@example
|
|
||||||
ffplay -f lavfi "amovie=test.wav"
|
|
||||||
@end example
|
|
||||||
|
|
||||||
@item
|
|
||||||
Read an audio stream and a video stream and play it back with
|
|
||||||
@command{ffplay}:
|
|
||||||
@example
|
|
||||||
ffplay -f lavfi "movie=test.avi[out0];amovie=test.wav[out1]"
|
|
||||||
@end example
|
|
||||||
|
|
||||||
@end itemize
|
|
||||||
|
|
||||||
@section libdc1394
|
@section libdc1394
|
||||||
|
|
||||||
IIDC1394 input device, based on libdc1394 and libraw1394.
|
IIDC1394 input device, based on libdc1394 and libraw1394.
|
||||||
|
|
||||||
@section openal
|
|
||||||
|
|
||||||
The OpenAL input device provides audio capture on all systems with a
|
|
||||||
working OpenAL 1.1 implementation.
|
|
||||||
|
|
||||||
To enable this input device during configuration, you need OpenAL
|
|
||||||
headers and libraries installed on your system, and need to configure
|
|
||||||
FFmpeg with @code{--enable-openal}.
|
|
||||||
|
|
||||||
OpenAL headers and libraries should be provided as part of your OpenAL
|
|
||||||
implementation, or as an additional download (an SDK). Depending on your
|
|
||||||
installation you may need to specify additional flags via the
|
|
||||||
@code{--extra-cflags} and @code{--extra-ldflags} for allowing the build
|
|
||||||
system to locate the OpenAL headers and libraries.
|
|
||||||
|
|
||||||
An incomplete list of OpenAL implementations follows:
|
|
||||||
|
|
||||||
@table @strong
|
|
||||||
@item Creative
|
|
||||||
The official Windows implementation, providing hardware acceleration
|
|
||||||
with supported devices and software fallback.
|
|
||||||
See @url{http://openal.org/}.
|
|
||||||
@item OpenAL Soft
|
|
||||||
Portable, open source (LGPL) software implementation. Includes
|
|
||||||
backends for the most common sound APIs on the Windows, Linux,
|
|
||||||
Solaris, and BSD operating systems.
|
|
||||||
See @url{http://kcat.strangesoft.net/openal.html}.
|
|
||||||
@item Apple
|
|
||||||
OpenAL is part of Core Audio, the official Mac OS X Audio interface.
|
|
||||||
See @url{http://developer.apple.com/technologies/mac/audio-and-video.html}
|
|
||||||
@end table
|
|
||||||
|
|
||||||
This device allows to capture from an audio input device handled
|
|
||||||
through OpenAL.
|
|
||||||
|
|
||||||
You need to specify the name of the device to capture in the provided
|
|
||||||
filename. If the empty string is provided, the device will
|
|
||||||
automatically select the default device. You can get the list of the
|
|
||||||
supported devices by using the option @var{list_devices}.
|
|
||||||
|
|
||||||
@subsection Options
|
|
||||||
|
|
||||||
@table @option
|
|
||||||
|
|
||||||
@item channels
|
|
||||||
Set the number of channels in the captured audio. Only the values
|
|
||||||
@option{1} (monaural) and @option{2} (stereo) are currently supported.
|
|
||||||
Defaults to @option{2}.
|
|
||||||
|
|
||||||
@item sample_size
|
|
||||||
Set the sample size (in bits) of the captured audio. Only the values
|
|
||||||
@option{8} and @option{16} are currently supported. Defaults to
|
|
||||||
@option{16}.
|
|
||||||
|
|
||||||
@item sample_rate
|
|
||||||
Set the sample rate (in Hz) of the captured audio.
|
|
||||||
Defaults to @option{44.1k}.
|
|
||||||
|
|
||||||
@item list_devices
|
|
||||||
If set to @option{true}, print a list of devices and exit.
|
|
||||||
Defaults to @option{false}.
|
|
||||||
|
|
||||||
@end table
|
|
||||||
|
|
||||||
@subsection Examples
|
|
||||||
|
|
||||||
Print the list of OpenAL supported devices and exit:
|
|
||||||
@example
|
|
||||||
$ ffmpeg -list_devices true -f openal -i dummy out.ogg
|
|
||||||
@end example
|
|
||||||
|
|
||||||
Capture from the OpenAL device @file{DR-BT101 via PulseAudio}:
|
|
||||||
@example
|
|
||||||
$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out.ogg
|
|
||||||
@end example
|
|
||||||
|
|
||||||
Capture from the default device (note the empty string '' as filename):
|
|
||||||
@example
|
|
||||||
$ ffmpeg -f openal -i '' out.ogg
|
|
||||||
@end example
|
|
||||||
|
|
||||||
Capture from two devices simultaneously, writing to two different files,
|
|
||||||
within the same @command{ffmpeg} command:
|
|
||||||
@example
|
|
||||||
$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out1.ogg -f openal -i 'ALSA Default' out2.ogg
|
|
||||||
@end example
|
|
||||||
Note: not all OpenAL implementations support multiple simultaneous capture -
|
|
||||||
try the latest OpenAL Soft if the above does not work.
|
|
||||||
|
|
||||||
@section oss
|
@section oss
|
||||||
|
|
||||||
Open Sound System input device.
|
Open Sound System input device.
|
||||||
@@ -395,7 +145,7 @@ The filename to provide to the input device is the device node
|
|||||||
representing the OSS input device, and is usually set to
|
representing the OSS input device, and is usually set to
|
||||||
@file{/dev/dsp}.
|
@file{/dev/dsp}.
|
||||||
|
|
||||||
For example to grab from @file{/dev/dsp} using @command{ffmpeg} use the
|
For example to grab from @file{/dev/dsp} using @file{ffmpeg} use the
|
||||||
command:
|
command:
|
||||||
@example
|
@example
|
||||||
ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
|
ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
|
||||||
@@ -404,89 +154,6 @@ ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
|
|||||||
For more information about OSS see:
|
For more information about OSS see:
|
||||||
@url{http://manuals.opensound.com/usersguide/dsp.html}
|
@url{http://manuals.opensound.com/usersguide/dsp.html}
|
||||||
|
|
||||||
@section pulse
|
|
||||||
|
|
||||||
pulseaudio input device.
|
|
||||||
|
|
||||||
To enable this input device during configuration you need libpulse-simple
|
|
||||||
installed in your system.
|
|
||||||
|
|
||||||
The filename to provide to the input device is a source device or the
|
|
||||||
string "default"
|
|
||||||
|
|
||||||
To list the pulse source devices and their properties you can invoke
|
|
||||||
the command @command{pactl list sources}.
|
|
||||||
|
|
||||||
@example
|
|
||||||
ffmpeg -f pulse -i default /tmp/pulse.wav
|
|
||||||
@end example
|
|
||||||
|
|
||||||
@subsection @var{server} AVOption
|
|
||||||
|
|
||||||
The syntax is:
|
|
||||||
@example
|
|
||||||
-server @var{server name}
|
|
||||||
@end example
|
|
||||||
|
|
||||||
Connects to a specific server.
|
|
||||||
|
|
||||||
@subsection @var{name} AVOption
|
|
||||||
|
|
||||||
The syntax is:
|
|
||||||
@example
|
|
||||||
-name @var{application name}
|
|
||||||
@end example
|
|
||||||
|
|
||||||
Specify the application name pulse will use when showing active clients,
|
|
||||||
by default it is the LIBAVFORMAT_IDENT string
|
|
||||||
|
|
||||||
@subsection @var{stream_name} AVOption
|
|
||||||
|
|
||||||
The syntax is:
|
|
||||||
@example
|
|
||||||
-stream_name @var{stream name}
|
|
||||||
@end example
|
|
||||||
|
|
||||||
Specify the stream name pulse will use when showing active streams,
|
|
||||||
by default it is "record"
|
|
||||||
|
|
||||||
@subsection @var{sample_rate} AVOption
|
|
||||||
|
|
||||||
The syntax is:
|
|
||||||
@example
|
|
||||||
-sample_rate @var{samplerate}
|
|
||||||
@end example
|
|
||||||
|
|
||||||
Specify the samplerate in Hz, by default 48kHz is used.
|
|
||||||
|
|
||||||
@subsection @var{channels} AVOption
|
|
||||||
|
|
||||||
The syntax is:
|
|
||||||
@example
|
|
||||||
-channels @var{N}
|
|
||||||
@end example
|
|
||||||
|
|
||||||
Specify the channels in use, by default 2 (stereo) is set.
|
|
||||||
|
|
||||||
@subsection @var{frame_size} AVOption
|
|
||||||
|
|
||||||
The syntax is:
|
|
||||||
@example
|
|
||||||
-frame_size @var{bytes}
|
|
||||||
@end example
|
|
||||||
|
|
||||||
Specify the number of byte per frame, by default it is set to 1024.
|
|
||||||
|
|
||||||
@subsection @var{fragment_size} AVOption
|
|
||||||
|
|
||||||
The syntax is:
|
|
||||||
@example
|
|
||||||
-fragment_size @var{bytes}
|
|
||||||
@end example
|
|
||||||
|
|
||||||
Specify the minimal buffering fragment in pulseaudio, it will affect the
|
|
||||||
audio latency. By default it is unset.
|
|
||||||
|
|
||||||
@section sndio
|
@section sndio
|
||||||
|
|
||||||
sndio input device.
|
sndio input device.
|
||||||
@@ -498,7 +165,7 @@ The filename to provide to the input device is the device node
|
|||||||
representing the sndio input device, and is usually set to
|
representing the sndio input device, and is usually set to
|
||||||
@file{/dev/audio0}.
|
@file{/dev/audio0}.
|
||||||
|
|
||||||
For example to grab from @file{/dev/audio0} using @command{ffmpeg} use the
|
For example to grab from @file{/dev/audio0} using @file{ffmpeg} use the
|
||||||
command:
|
command:
|
||||||
@example
|
@example
|
||||||
ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
|
ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
|
||||||
@@ -516,20 +183,17 @@ the device.
|
|||||||
|
|
||||||
Video4Linux and Video4Linux2 devices only support a limited set of
|
Video4Linux and Video4Linux2 devices only support a limited set of
|
||||||
@var{width}x@var{height} sizes and framerates. You can check which are
|
@var{width}x@var{height} sizes and framerates. You can check which are
|
||||||
supported for example with the command @command{dov4l} for Video4Linux
|
supported for example with the command @file{dov4l} for Video4Linux
|
||||||
devices and using @command{-list_formats all} for Video4Linux2 devices.
|
devices and the command @file{v4l-info} for Video4Linux2 devices.
|
||||||
|
|
||||||
If the size for the device is set to 0x0, the input device will
|
If the size for the device is set to 0x0, the input device will
|
||||||
try to auto-detect the size to use.
|
try to autodetect the size to use.
|
||||||
Only for the video4linux2 device, if the frame rate is set to 0/0 the
|
Only for the video4linux2 device, if the frame rate is set to 0/0 the
|
||||||
input device will use the frame rate value already set in the driver.
|
input device will use the frame rate value already set in the driver.
|
||||||
|
|
||||||
Video4Linux support is deprecated since Linux 2.6.30, and will be
|
Video4Linux support is deprecated since Linux 2.6.30, and will be
|
||||||
dropped in later versions.
|
dropped in later versions.
|
||||||
|
|
||||||
Note that if FFmpeg is build with v4l-utils support ("--enable-libv4l2"
|
|
||||||
option), it will always be used.
|
|
||||||
|
|
||||||
Follow some usage examples of the video4linux devices with the ff*
|
Follow some usage examples of the video4linux devices with the ff*
|
||||||
tools.
|
tools.
|
||||||
@example
|
@example
|
||||||
@@ -537,18 +201,15 @@ tools.
|
|||||||
# to the default of 25/1.
|
# to the default of 25/1.
|
||||||
ffplay -s 320x240 -f video4linux /dev/video0
|
ffplay -s 320x240 -f video4linux /dev/video0
|
||||||
|
|
||||||
# Grab and show the input of a video4linux2 device, auto-adjust size.
|
# Grab and show the input of a video4linux2 device, autoadjust size.
|
||||||
ffplay -f video4linux2 /dev/video0
|
ffplay -f video4linux2 /dev/video0
|
||||||
|
|
||||||
# Grab and record the input of a video4linux2 device, auto-adjust size,
|
# Grab and record the input of a video4linux2 device, autoadjust size,
|
||||||
# frame rate value defaults to 0/0 so it is read from the video4linux2
|
# frame rate value defaults to 0/0 so it is read from the video4linux2
|
||||||
# driver.
|
# driver.
|
||||||
ffmpeg -f video4linux2 -i /dev/video0 out.mpeg
|
ffmpeg -f video4linux2 -i /dev/video0 out.mpeg
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
"v4l" and "v4l2" can be used as aliases for the respective "video4linux" and
|
|
||||||
"video4linux2".
|
|
||||||
|
|
||||||
@section vfwcap
|
@section vfwcap
|
||||||
|
|
||||||
VfW (Video for Windows) capture input device.
|
VfW (Video for Windows) capture input device.
|
||||||
@@ -570,7 +231,7 @@ The filename passed as input has the syntax:
|
|||||||
|
|
||||||
@var{hostname}:@var{display_number}.@var{screen_number} specifies the
|
@var{hostname}:@var{display_number}.@var{screen_number} specifies the
|
||||||
X11 display name of the screen to grab from. @var{hostname} can be
|
X11 display name of the screen to grab from. @var{hostname} can be
|
||||||
omitted, and defaults to "localhost". The environment variable
|
ommitted, and defaults to "localhost". The environment variable
|
||||||
@env{DISPLAY} contains the default display name.
|
@env{DISPLAY} contains the default display name.
|
||||||
|
|
||||||
@var{x_offset} and @var{y_offset} specify the offsets of the grabbed
|
@var{x_offset} and @var{y_offset} specify the offsets of the grabbed
|
||||||
@@ -579,54 +240,15 @@ default to 0.
|
|||||||
|
|
||||||
Check the X11 documentation (e.g. man X) for more detailed information.
|
Check the X11 documentation (e.g. man X) for more detailed information.
|
||||||
|
|
||||||
Use the @command{dpyinfo} program for getting basic information about the
|
Use the @file{dpyinfo} program for getting basic information about the
|
||||||
properties of your X11 display (e.g. grep for "name" or "dimensions").
|
properties of your X11 display (e.g. grep for "name" or "dimensions").
|
||||||
|
|
||||||
For example to grab from @file{:0.0} using @command{ffmpeg}:
|
For example to grab from @file{:0.0} using @file{ffmpeg}:
|
||||||
@example
|
@example
|
||||||
ffmpeg -f x11grab -r 25 -s cif -i :0.0 out.mpg
|
ffmpeg -f x11grab -r 25 -s cif -i :0.0 out.mpg
|
||||||
|
|
||||||
# Grab at position 10,20.
|
# Grab at position 10,20.
|
||||||
ffmpeg -f x11grab -r 25 -s cif -i :0.0+10,20 out.mpg
|
ffmpeg -f x11grab -25 -s cif -i :0.0+10,20 out.mpg
|
||||||
@end example
|
|
||||||
|
|
||||||
@subsection @var{follow_mouse} AVOption
|
|
||||||
|
|
||||||
The syntax is:
|
|
||||||
@example
|
|
||||||
-follow_mouse centered|@var{PIXELS}
|
|
||||||
@end example
|
|
||||||
|
|
||||||
When it is specified with "centered", the grabbing region follows the mouse
|
|
||||||
pointer and keeps the pointer at the center of region; otherwise, the region
|
|
||||||
follows only when the mouse pointer reaches within @var{PIXELS} (greater than
|
|
||||||
zero) to the edge of region.
|
|
||||||
|
|
||||||
For example:
|
|
||||||
@example
|
|
||||||
ffmpeg -f x11grab -follow_mouse centered -r 25 -s cif -i :0.0 out.mpg
|
|
||||||
|
|
||||||
# Follows only when the mouse pointer reaches within 100 pixels to edge
|
|
||||||
ffmpeg -f x11grab -follow_mouse 100 -r 25 -s cif -i :0.0 out.mpg
|
|
||||||
@end example
|
|
||||||
|
|
||||||
@subsection @var{show_region} AVOption
|
|
||||||
|
|
||||||
The syntax is:
|
|
||||||
@example
|
|
||||||
-show_region 1
|
|
||||||
@end example
|
|
||||||
|
|
||||||
If @var{show_region} AVOption is specified with @var{1}, then the grabbing
|
|
||||||
region will be indicated on screen. With this option, it's easy to know what is
|
|
||||||
being grabbed if only a portion of the screen is grabbed.
|
|
||||||
|
|
||||||
For example:
|
|
||||||
@example
|
|
||||||
ffmpeg -f x11grab -show_region 1 -r 25 -s cif -i :0.0+10,20 out.mpg
|
|
||||||
|
|
||||||
# With follow_mouse
|
|
||||||
ffmpeg -f x11grab -follow_mouse centered -show_region 1 -r 25 -s cif -i :0.0 out.mpg
|
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
@c man end INPUT DEVICES
|
@c man end INPUT DEVICES
|
||||||
|
|||||||
@@ -5,42 +5,32 @@ NOTE: This is a draft.
|
|||||||
|
|
||||||
Overview:
|
Overview:
|
||||||
---------
|
---------
|
||||||
|
|
||||||
FFmpeg uses Trac for tracking issues, new issues and changes to
|
FFmpeg uses Trac for tracking issues, new issues and changes to
|
||||||
existing issues can be done through a web interface.
|
existing issues can be done through a web interface.
|
||||||
|
|
||||||
Issues can be different kinds of things we want to keep track of
|
|
||||||
but that do not belong into the source tree itself. This includes
|
|
||||||
bug reports, patches, feature requests and license violations. We
|
|
||||||
might add more items to this list in the future, so feel free to
|
|
||||||
propose a new `type of issue' on the ffmpeg-devel mailing list if
|
|
||||||
you feel it is worth tracking.
|
|
||||||
|
|
||||||
It is possible to subscribe to individual issues by adding yourself to the
|
It is possible to subscribe to individual issues by adding yourself to the
|
||||||
Cc list or to subscribe to the ffmpeg-trac mailing list which receives
|
nosy list or to subscribe to the ffmpeg-issues mailing list which receives
|
||||||
a mail for every change to every issue.
|
a mail for every change to every issue. Replies to such mails will also
|
||||||
|
be properly added to the respective issue.
|
||||||
(the above does all work already after light testing)
|
(the above does all work already after light testing)
|
||||||
|
|
||||||
The subscription URL for the ffmpeg-trac list is:
|
The subscription URL for the ffmpeg-trac list is:
|
||||||
http(s)://ffmpeg.org/mailman/listinfo/ffmpeg-trac
|
http(s)://ffmpeg.org/mailman/listinfo/ffmpeg-trac
|
||||||
The URL of the webinterface of the tracker is:
|
The URL of the webinterface of the tracker is:
|
||||||
http(s)://ffmpeg.org/trac/ffmpeg
|
http(s)://ffmpeg.org/trac/ffmpeg
|
||||||
|
|
||||||
|
NOTE: issue = (bug report || patch || feature request)
|
||||||
|
|
||||||
Type:
|
Type:
|
||||||
-----
|
-----
|
||||||
bug / defect
|
bug
|
||||||
An error, flaw, mistake, failure, or fault in FFmpeg or libav* that
|
An error, flaw, mistake, failure, or fault in FFmpeg or libav* that
|
||||||
prevents it from behaving as intended.
|
prevents it from behaving as intended.
|
||||||
|
|
||||||
feature request / enhancement
|
feature request
|
||||||
Request of support for encoding or decoding of a new codec, container
|
Request of support for encoding or decoding of a new codec, container
|
||||||
or variant.
|
or variant.
|
||||||
Request of support for more, less or plain different output or behavior
|
Request of support for more, less or plain different output or behavior
|
||||||
where the current implementation cannot be considered wrong.
|
where the current implementation cannot be considered wrong.
|
||||||
|
|
||||||
license violation
|
|
||||||
ticket to keep track of (L)GPL violations of ffmpeg by others
|
|
||||||
|
|
||||||
patch
|
patch
|
||||||
A patch as generated by diff which conforms to the patch submission and
|
A patch as generated by diff which conforms to the patch submission and
|
||||||
development policy.
|
development policy.
|
||||||
@@ -61,8 +51,6 @@ important
|
|||||||
the separation to normal is somewhat fuzzy.
|
the separation to normal is somewhat fuzzy.
|
||||||
For feature requests this priority would be used for things many people
|
For feature requests this priority would be used for things many people
|
||||||
want.
|
want.
|
||||||
Regressions also should be marked as important, regressions are bugs that
|
|
||||||
don't exist in a past revision or another branch.
|
|
||||||
|
|
||||||
normal
|
normal
|
||||||
|
|
||||||
@@ -92,17 +80,6 @@ closed
|
|||||||
final state
|
final state
|
||||||
|
|
||||||
|
|
||||||
Analyzed flag:
|
|
||||||
--------------
|
|
||||||
Bugs which have been analyzed and where it is understood what causes them
|
|
||||||
and which exact chain of events triggers them. This analysis should be
|
|
||||||
available as a message in the bug report.
|
|
||||||
Note, do not change the status to analyzed without also providing a clear
|
|
||||||
and understandable analysis.
|
|
||||||
This state implicates that the bug either has been reproduced or that
|
|
||||||
reproduction is not needed as the bug is already understood.
|
|
||||||
|
|
||||||
|
|
||||||
Type/Status/Substatus:
|
Type/Status/Substatus:
|
||||||
----------
|
----------
|
||||||
*/new/new
|
*/new/new
|
||||||
@@ -130,6 +107,24 @@ Type/Status/Substatus:
|
|||||||
Issues for which some information has been requested by the developers,
|
Issues for which some information has been requested by the developers,
|
||||||
but which has not been provided by anyone within reasonable time.
|
but which has not been provided by anyone within reasonable time.
|
||||||
|
|
||||||
|
bug/open/reproduced
|
||||||
|
Bugs which have been reproduced.
|
||||||
|
|
||||||
|
bug/open/analyzed
|
||||||
|
Bugs which have been analyzed and where it is understood what causes them
|
||||||
|
and which exact chain of events triggers them. This analysis should be
|
||||||
|
available as a message in the bug report.
|
||||||
|
Note, do not change the status to analyzed without also providing a clear
|
||||||
|
and understandable analysis.
|
||||||
|
This state implicates that the bug either has been reproduced or that
|
||||||
|
reproduction is not needed as the bug is already understood.
|
||||||
|
|
||||||
|
bug/open/needs_more_info
|
||||||
|
Bug reports which are incomplete and or where more information is needed
|
||||||
|
from the submitter or another person who can provide it.
|
||||||
|
This state implicates that the bug has not been analyzed or reproduced.
|
||||||
|
Note, the idea behind needs_more_info is to offload work from the
|
||||||
|
developers to the users whenever possible.
|
||||||
|
|
||||||
bug/closed/fixed
|
bug/closed/fixed
|
||||||
Bugs which have to the best of our knowledge been fixed.
|
Bugs which have to the best of our knowledge been fixed.
|
||||||
@@ -163,6 +158,10 @@ patch/closed/applied
|
|||||||
patch/closed/rejected
|
patch/closed/rejected
|
||||||
Patches which have been rejected.
|
Patches which have been rejected.
|
||||||
|
|
||||||
|
feature_request/open/needs_more_info
|
||||||
|
Feature requests where it is not clear what exactly is wanted
|
||||||
|
(these also could be closed as invalid ...).
|
||||||
|
|
||||||
feature_request/closed/implemented
|
feature_request/closed/implemented
|
||||||
Feature requests which have been implemented.
|
Feature requests which have been implemented.
|
||||||
|
|
||||||
@@ -174,10 +173,12 @@ Note, please do not use type-status-substatus combinations other than the
|
|||||||
above without asking on ffmpeg-dev first!
|
above without asking on ffmpeg-dev first!
|
||||||
|
|
||||||
Note2, if you provide the requested info do not forget to remove the
|
Note2, if you provide the requested info do not forget to remove the
|
||||||
needs_more_info substatus.
|
needs_more_info substate.
|
||||||
|
|
||||||
Component:
|
Topic:
|
||||||
----------
|
------
|
||||||
|
A topic is a tag you should add to your issue in order to make grouping them
|
||||||
|
easier.
|
||||||
|
|
||||||
avcodec
|
avcodec
|
||||||
issues in libavcodec/*
|
issues in libavcodec/*
|
||||||
@@ -197,9 +198,6 @@ ffmpeg
|
|||||||
ffplay
|
ffplay
|
||||||
issues in or related to ffplay.c
|
issues in or related to ffplay.c
|
||||||
|
|
||||||
ffprobe
|
|
||||||
issues in or related to ffprobe.c
|
|
||||||
|
|
||||||
ffserver
|
ffserver
|
||||||
issues in or related to ffserver.c
|
issues in or related to ffserver.c
|
||||||
|
|
||||||
@@ -207,7 +205,7 @@ build system
|
|||||||
issues in or related to configure/Makefile
|
issues in or related to configure/Makefile
|
||||||
|
|
||||||
regression
|
regression
|
||||||
bugs which were not present in a past revision
|
bugs which were working in a past revision
|
||||||
|
|
||||||
trac
|
roundup
|
||||||
issues related to our issue tracker
|
issues related to our issue tracker
|
||||||
|
|||||||
@@ -14,8 +14,20 @@
|
|||||||
Libavfilter is the filtering API of FFmpeg. It is the substitute of the
|
Libavfilter is the filtering API of FFmpeg. It is the substitute of the
|
||||||
now deprecated 'vhooks' and started as a Google Summer of Code project.
|
now deprecated 'vhooks' and started as a Google Summer of Code project.
|
||||||
|
|
||||||
Audio filtering integration into the main FFmpeg repository is a work in
|
Integrating libavfilter into the main FFmpeg repository is a work in
|
||||||
progress, so audio API and ABI should not be considered stable yet.
|
progress. If you wish to try the unfinished development code of
|
||||||
|
libavfilter then check it out from the libavfilter repository into
|
||||||
|
some directory of your choice by:
|
||||||
|
|
||||||
|
@example
|
||||||
|
svn checkout svn://svn.ffmpeg.org/soc/libavfilter
|
||||||
|
@end example
|
||||||
|
|
||||||
|
And then read the README file in the top directory to learn how to
|
||||||
|
integrate it into ffmpeg and ffplay.
|
||||||
|
|
||||||
|
But note that there may still be serious bugs in the code and its API
|
||||||
|
and ABI should not be considered stable yet!
|
||||||
|
|
||||||
@chapter Tutorial
|
@chapter Tutorial
|
||||||
|
|
||||||
@@ -36,20 +48,21 @@ and the vflip filter before merging it back with the other stream by
|
|||||||
overlaying it on top. You can use the following command to achieve this:
|
overlaying it on top. You can use the following command to achieve this:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
ffmpeg -i input -vf "[in] split [T1], fifo, [T2] overlay=0:H/2 [out]; [T1] fifo, crop=iw:ih/2:0:ih/2, vflip [T2]" output
|
./ffmpeg -i in.avi -s 240x320 -vf "[in] split [T1], fifo, [T2] overlay= 0:240 [out]; [T1] fifo, crop=0:0:-1:240, vflip [T2]
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
The result will be that in output the top half of the video is mirrored
|
where input_video.avi has a vertical resolution of 480 pixels. The
|
||||||
|
result will be that in output the top half of the video is mirrored
|
||||||
onto the bottom half.
|
onto the bottom half.
|
||||||
|
|
||||||
Video filters are loaded using the @var{-vf} option passed to
|
Video filters are loaded using the @var{-vf} option passed to
|
||||||
@command{ffmpeg} or to @command{ffplay}. Filters in the same linear
|
ffmpeg or to ffplay. Filters in the same linear chain are separated by
|
||||||
chain are separated by commas. In our example, @var{split, fifo,
|
commas. In our example, @var{split, fifo, overlay} are in one linear
|
||||||
overlay} are in one linear chain, and @var{fifo, crop, vflip} are in
|
chain, and @var{fifo, crop, vflip} are in another. The points where
|
||||||
another. The points where the linear chains join are labeled by names
|
the linear chains join are labeled by names enclosed in square
|
||||||
enclosed in square brackets. In our example, that is @var{[T1]} and
|
brackets. In our example, that is @var{[T1]} and @var{[T2]}. The magic
|
||||||
@var{[T2]}. The magic labels @var{[in]} and @var{[out]} are the points
|
labels @var{[in]} and @var{[out]} are the points where video is input
|
||||||
where video is input and output.
|
and output.
|
||||||
|
|
||||||
Some filters take in input a list of parameters: they are specified
|
Some filters take in input a list of parameters: they are specified
|
||||||
after the filter name and an equal sign, and are separated each other
|
after the filter name and an equal sign, and are separated each other
|
||||||
|
|||||||
@@ -43,15 +43,15 @@ You can print the CRC to stdout with the command:
|
|||||||
ffmpeg -i INPUT -f crc -
|
ffmpeg -i INPUT -f crc -
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
You can select the output format of each frame with @command{ffmpeg} by
|
You can select the output format of each frame with @file{ffmpeg} by
|
||||||
specifying the audio and video codec and format. For example to
|
specifying the audio and video codec and format. For example to
|
||||||
compute the CRC of the input audio converted to PCM unsigned 8-bit
|
compute the CRC of the input audio converted to PCM unsigned 8-bit
|
||||||
and the input video converted to MPEG-2 video, use the command:
|
and the input video converted to MPEG-2 video, use the command:
|
||||||
@example
|
@example
|
||||||
ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f crc -
|
ffmpeg -i INPUT -acodec pcm_u8 -vcodec mpeg2video -f crc -
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
See also the @ref{framecrc} muxer.
|
See also the @code{framecrc} muxer (@pxref{framecrc}).
|
||||||
|
|
||||||
@anchor{framecrc}
|
@anchor{framecrc}
|
||||||
@section framecrc
|
@section framecrc
|
||||||
@@ -79,18 +79,17 @@ You can print the CRC of each decoded frame to stdout with the command:
|
|||||||
ffmpeg -i INPUT -f framecrc -
|
ffmpeg -i INPUT -f framecrc -
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
You can select the output format of each frame with @command{ffmpeg} by
|
You can select the output format of each frame with @file{ffmpeg} by
|
||||||
specifying the audio and video codec and format. For example, to
|
specifying the audio and video codec and format. For example, to
|
||||||
compute the CRC of each decoded input audio frame converted to PCM
|
compute the CRC of each decoded input audio frame converted to PCM
|
||||||
unsigned 8-bit and of each decoded input video frame converted to
|
unsigned 8-bit and of each decoded input video frame converted to
|
||||||
MPEG-2 video, use the command:
|
MPEG-2 video, use the command:
|
||||||
@example
|
@example
|
||||||
ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f framecrc -
|
ffmpeg -i INPUT -acodec pcm_u8 -vcodec mpeg2video -f framecrc -
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
See also the @ref{crc} muxer.
|
See also the @code{crc} muxer (@pxref{crc}).
|
||||||
|
|
||||||
@anchor{image2}
|
|
||||||
@section image2
|
@section image2
|
||||||
|
|
||||||
Image file muxer.
|
Image file muxer.
|
||||||
@@ -120,26 +119,26 @@ The pattern "img%%-%d.jpg" will specify a sequence of filenames of the
|
|||||||
form @file{img%-1.jpg}, @file{img%-2.jpg}, ..., @file{img%-10.jpg},
|
form @file{img%-1.jpg}, @file{img%-2.jpg}, ..., @file{img%-10.jpg},
|
||||||
etc.
|
etc.
|
||||||
|
|
||||||
The following example shows how to use @command{ffmpeg} for creating a
|
The following example shows how to use @file{ffmpeg} for creating a
|
||||||
sequence of files @file{img-001.jpeg}, @file{img-002.jpeg}, ...,
|
sequence of files @file{img-001.jpeg}, @file{img-002.jpeg}, ...,
|
||||||
taking one image every second from the input video:
|
taking one image every second from the input video:
|
||||||
@example
|
@example
|
||||||
ffmpeg -i in.avi -vsync 1 -r 1 -f image2 'img-%03d.jpeg'
|
ffmpeg -i in.avi -r 1 -f image2 'img-%03d.jpeg'
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
Note that with @command{ffmpeg}, if the format is not specified with the
|
Note that with @file{ffmpeg}, if the format is not specified with the
|
||||||
@code{-f} option and the output filename specifies an image file
|
@code{-f} option and the output filename specifies an image file
|
||||||
format, the image2 muxer is automatically selected, so the previous
|
format, the image2 muxer is automatically selected, so the previous
|
||||||
command can be written as:
|
command can be written as:
|
||||||
@example
|
@example
|
||||||
ffmpeg -i in.avi -vsync 1 -r 1 'img-%03d.jpeg'
|
ffmpeg -i in.avi -r 1 'img-%03d.jpeg'
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
Note also that the pattern must not necessarily contain "%d" or
|
Note also that the pattern must not necessarily contain "%d" or
|
||||||
"%0@var{N}d", for example to create a single image file
|
"%0@var{N}d", for example to create a single image file
|
||||||
@file{img.jpeg} from the input video you can employ the command:
|
@file{img.jpeg} from the input video you can employ the command:
|
||||||
@example
|
@example
|
||||||
ffmpeg -i in.avi -f image2 -frames:v 1 img.jpeg
|
ffmpeg -i in.avi -f image2 -vframes 1 img.jpeg
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
The image muxer supports the .Y.U.V image file format. This format is
|
The image muxer supports the .Y.U.V image file format. This format is
|
||||||
@@ -148,18 +147,6 @@ each of the YUV420P components. To read or write this image file format,
|
|||||||
specify the name of the '.Y' file. The muxer will automatically open the
|
specify the name of the '.Y' file. The muxer will automatically open the
|
||||||
'.U' and '.V' files as required.
|
'.U' and '.V' files as required.
|
||||||
|
|
||||||
@section mov
|
|
||||||
|
|
||||||
MOV / MP4 muxer
|
|
||||||
|
|
||||||
The muxer options are:
|
|
||||||
|
|
||||||
@table @option
|
|
||||||
@item -moov_size @var{bytes}
|
|
||||||
Reserves space for the moov atom at the beginning of the file instead of placing the
|
|
||||||
moov atom at the end. If the space reserved is insufficient, muxing will fail.
|
|
||||||
@end table
|
|
||||||
|
|
||||||
@section mpegts
|
@section mpegts
|
||||||
|
|
||||||
MPEG transport stream muxer.
|
MPEG transport stream muxer.
|
||||||
@@ -190,7 +177,7 @@ and @code{service_name}. If they are not set the default for
|
|||||||
@code{service_name} is "Service01".
|
@code{service_name} is "Service01".
|
||||||
|
|
||||||
@example
|
@example
|
||||||
ffmpeg -i file.mpg -c copy \
|
ffmpeg -i file.mpg -acodec copy -vcodec copy \
|
||||||
-mpegts_original_network_id 0x1122 \
|
-mpegts_original_network_id 0x1122 \
|
||||||
-mpegts_transport_stream_id 0x3344 \
|
-mpegts_transport_stream_id 0x3344 \
|
||||||
-mpegts_service_id 0x5566 \
|
-mpegts_service_id 0x5566 \
|
||||||
@@ -208,14 +195,14 @@ Null muxer.
|
|||||||
This muxer does not generate any output file, it is mainly useful for
|
This muxer does not generate any output file, it is mainly useful for
|
||||||
testing or benchmarking purposes.
|
testing or benchmarking purposes.
|
||||||
|
|
||||||
For example to benchmark decoding with @command{ffmpeg} you can use the
|
For example to benchmark decoding with @file{ffmpeg} you can use the
|
||||||
command:
|
command:
|
||||||
@example
|
@example
|
||||||
ffmpeg -benchmark -i INPUT -f null out.null
|
ffmpeg -benchmark -i INPUT -f null out.null
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
Note that the above command does not read or write the @file{out.null}
|
Note that the above command does not read or write the @file{out.null}
|
||||||
file, but specifying the output file is required by the @command{ffmpeg}
|
file, but specifying the output file is required by the @file{ffmpeg}
|
||||||
syntax.
|
syntax.
|
||||||
|
|
||||||
Alternatively you can write the command as:
|
Alternatively you can write the command as:
|
||||||
@@ -283,38 +270,7 @@ Both eyes laced in one Block, Right-eye view is first
|
|||||||
|
|
||||||
For example a 3D WebM clip can be created using the following command line:
|
For example a 3D WebM clip can be created using the following command line:
|
||||||
@example
|
@example
|
||||||
ffmpeg -i sample_left_right_clip.mpg -an -c:v libvpx -metadata stereo_mode=left_right -y stereo_clip.webm
|
ffmpeg -i sample_left_right_clip.mpg -an -vcodec libvpx -metadata stereo_mode=left_right -y stereo_clip.webm
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
@section segment
|
|
||||||
|
|
||||||
Basic stream segmenter.
|
|
||||||
|
|
||||||
The segmenter muxer outputs streams to a number of separate files of nearly
|
|
||||||
fixed duration. Output filename pattern can be set in a fashion similar to
|
|
||||||
@ref{image2}.
|
|
||||||
|
|
||||||
Every segment starts with a video keyframe, if a video stream is present.
|
|
||||||
The segment muxer works best with a single constant frame rate video.
|
|
||||||
|
|
||||||
Optionally it can generate a flat list of the created segments, one segment
|
|
||||||
per line.
|
|
||||||
|
|
||||||
@table @option
|
|
||||||
@item segment_format @var{format}
|
|
||||||
Override the inner container format, by default it is guessed by the filename
|
|
||||||
extension.
|
|
||||||
@item segment_time @var{t}
|
|
||||||
Set segment duration to @var{t} seconds.
|
|
||||||
@item segment_list @var{name}
|
|
||||||
Generate also a listfile named @var{name}.
|
|
||||||
@item segment_list_size @var{size}
|
|
||||||
Overwrite the listfile once it reaches @var{size} entries.
|
|
||||||
@end table
|
|
||||||
|
|
||||||
@example
|
|
||||||
ffmpeg -i in.mkv -c copy -map 0 -f segment -list out.list out%03d.nut
|
|
||||||
@end example
|
|
||||||
|
|
||||||
|
|
||||||
@c man end MUXERS
|
@c man end MUXERS
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ OSS (Open Sound System) output device.
|
|||||||
|
|
||||||
@section sdl
|
@section sdl
|
||||||
|
|
||||||
SDL (Simple DirectMedia Layer) output device.
|
SDL (Simple Directmedia Layer) output device.
|
||||||
|
|
||||||
This output devices allows to show a video stream in an SDL
|
This output devices allows to show a video stream in an SDL
|
||||||
window. Only one SDL window is allowed per application, so you can
|
window. Only one SDL window is allowed per application, so you can
|
||||||
@@ -60,7 +60,7 @@ If not specified it defaults to the size of the input video.
|
|||||||
|
|
||||||
@subsection Examples
|
@subsection Examples
|
||||||
|
|
||||||
The following command shows the @command{ffmpeg} output is an
|
The following command shows the @file{ffmpeg} output is an
|
||||||
SDL window, forcing its size to the qcif format:
|
SDL window, forcing its size to the qcif format:
|
||||||
@example
|
@example
|
||||||
ffmpeg -i INPUT -vcodec rawvideo -pix_fmt yuv420p -window_size qcif -f sdl "SDL output"
|
ffmpeg -i INPUT -vcodec rawvideo -pix_fmt yuv420p -window_size qcif -f sdl "SDL output"
|
||||||
|
|||||||
@@ -1,390 +0,0 @@
|
|||||||
\input texinfo @c -*- texinfo -*-
|
|
||||||
|
|
||||||
@settitle Platform Specific information
|
|
||||||
@titlepage
|
|
||||||
@center @titlefont{Platform Specific information}
|
|
||||||
@end titlepage
|
|
||||||
|
|
||||||
@top
|
|
||||||
|
|
||||||
@contents
|
|
||||||
|
|
||||||
@chapter Unix-like
|
|
||||||
|
|
||||||
Some parts of FFmpeg cannot be built with version 2.15 of the GNU
|
|
||||||
assembler which is still provided by a few AMD64 distributions. To
|
|
||||||
make sure your compiler really uses the required version of gas
|
|
||||||
after a binutils upgrade, run:
|
|
||||||
|
|
||||||
@example
|
|
||||||
$(gcc -print-prog-name=as) --version
|
|
||||||
@end example
|
|
||||||
|
|
||||||
If not, then you should install a different compiler that has no
|
|
||||||
hard-coded path to gas. In the worst case pass @code{--disable-asm}
|
|
||||||
to configure.
|
|
||||||
|
|
||||||
@section BSD
|
|
||||||
|
|
||||||
BSD make will not build FFmpeg, you need to install and use GNU Make
|
|
||||||
(@file{gmake}).
|
|
||||||
|
|
||||||
@section (Open)Solaris
|
|
||||||
|
|
||||||
GNU Make is required to build FFmpeg, so you have to invoke (@file{gmake}),
|
|
||||||
standard Solaris Make will not work. When building with a non-c99 front-end
|
|
||||||
(gcc, generic suncc) add either @code{--extra-libs=/usr/lib/values-xpg6.o}
|
|
||||||
or @code{--extra-libs=/usr/lib/64/values-xpg6.o} to the configure options
|
|
||||||
since the libc is not c99-compliant by default. The probes performed by
|
|
||||||
configure may raise an exception leading to the death of configure itself
|
|
||||||
due to a bug in the system shell. Simply invoke a different shell such as
|
|
||||||
bash directly to work around this:
|
|
||||||
|
|
||||||
@example
|
|
||||||
bash ./configure
|
|
||||||
@end example
|
|
||||||
|
|
||||||
@anchor{Darwin}
|
|
||||||
@section Darwin (Mac OS X, iPhone)
|
|
||||||
|
|
||||||
The toolchain provided with Xcode is sufficient to build the basic
|
|
||||||
unacelerated code.
|
|
||||||
|
|
||||||
Mac OS X on PowerPC or ARM (iPhone) requires a preprocessor from
|
|
||||||
@url{http://github.com/yuvi/gas-preprocessor} to build the optimized
|
|
||||||
assembler functions. Just download the Perl script and put it somewhere
|
|
||||||
in your PATH, FFmpeg's configure will pick it up automatically.
|
|
||||||
|
|
||||||
Mac OS X on amd64 and x86 requires @command{yasm} to build most of the
|
|
||||||
optimized assembler functions. @uref{http://www.finkproject.org/, Fink},
|
|
||||||
@uref{http://www.gentoo.org/proj/en/gentoo-alt/prefix/bootstrap-macos.xml, Gentoo Prefix},
|
|
||||||
@uref{http://mxcl.github.com/homebrew/, Homebrew}
|
|
||||||
or @uref{http://www.macports.org, MacPorts} can easily provide it.
|
|
||||||
|
|
||||||
|
|
||||||
@chapter DOS
|
|
||||||
|
|
||||||
Using a cross-compiler is preferred for various reasons.
|
|
||||||
@url{http://www.delorie.com/howto/djgpp/linux-x-djgpp.html}
|
|
||||||
|
|
||||||
|
|
||||||
@chapter OS/2
|
|
||||||
|
|
||||||
For information about compiling FFmpeg on OS/2 see
|
|
||||||
@url{http://www.edm2.com/index.php/FFmpeg}.
|
|
||||||
|
|
||||||
|
|
||||||
@chapter Windows
|
|
||||||
|
|
||||||
To get help and instructions for building FFmpeg under Windows, check out
|
|
||||||
the FFmpeg Windows Help Forum at
|
|
||||||
@url{http://ffmpeg.arrozcru.org/}.
|
|
||||||
|
|
||||||
@section Native Windows compilation
|
|
||||||
|
|
||||||
FFmpeg can be built to run natively on Windows using the MinGW tools. Install
|
|
||||||
the latest versions of MSYS and MinGW from @url{http://www.mingw.org/}.
|
|
||||||
You can find detailed installation instructions in the download
|
|
||||||
section and the FAQ.
|
|
||||||
|
|
||||||
FFmpeg does not build out-of-the-box with the packages the automated MinGW
|
|
||||||
installer provides. It also requires coreutils to be installed and many other
|
|
||||||
packages updated to the latest version. The minimum version for some packages
|
|
||||||
are listed below:
|
|
||||||
|
|
||||||
@itemize
|
|
||||||
@item bash 3.1
|
|
||||||
@item msys-make 3.81-2 (note: not mingw32-make)
|
|
||||||
@item w32api 3.13
|
|
||||||
@item mingw-runtime 3.15
|
|
||||||
@end itemize
|
|
||||||
|
|
||||||
FFmpeg automatically passes @code{-fno-common} to the compiler to work around
|
|
||||||
a GCC bug (see @url{http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37216}).
|
|
||||||
|
|
||||||
Notes:
|
|
||||||
|
|
||||||
@itemize
|
|
||||||
|
|
||||||
@item Building natively using MSYS can be sped up by disabling implicit rules
|
|
||||||
in the Makefile by calling @code{make -r} instead of plain @code{make}. This
|
|
||||||
speed up is close to non-existent for normal one-off builds and is only
|
|
||||||
noticeable when running make for a second time (for example in
|
|
||||||
@code{make install}).
|
|
||||||
|
|
||||||
@item In order to compile FFplay, you must have the MinGW development library
|
|
||||||
of @uref{http://www.libsdl.org/, SDL}.
|
|
||||||
Edit the @file{bin/sdl-config} script so that it points to the correct prefix
|
|
||||||
where SDL was installed. Verify that @file{sdl-config} can be launched from
|
|
||||||
the MSYS command line.
|
|
||||||
|
|
||||||
@item By using @code{./configure --enable-shared} when configuring FFmpeg,
|
|
||||||
you can build the FFmpeg libraries (e.g. libavutil, libavcodec,
|
|
||||||
libavformat) as DLLs.
|
|
||||||
|
|
||||||
@end itemize
|
|
||||||
|
|
||||||
@section Microsoft Visual C++ compatibility
|
|
||||||
|
|
||||||
As stated in the FAQ, FFmpeg will not compile under MSVC++. However, if you
|
|
||||||
want to use the libav* libraries in your own applications, you can still
|
|
||||||
compile those applications using MSVC++. But the libav* libraries you link
|
|
||||||
to @emph{must} be built with MinGW. However, you will not be able to debug
|
|
||||||
inside the libav* libraries, since MSVC++ does not recognize the debug
|
|
||||||
symbols generated by GCC.
|
|
||||||
We strongly recommend you to move over from MSVC++ to MinGW tools.
|
|
||||||
|
|
||||||
This description of how to use the FFmpeg libraries with MSVC++ is based on
|
|
||||||
Microsoft Visual C++ 2005 Express Edition. If you have a different version,
|
|
||||||
you might have to modify the procedures slightly.
|
|
||||||
|
|
||||||
@subsection Using static libraries
|
|
||||||
|
|
||||||
Assuming you have just built and installed FFmpeg in @file{/usr/local}.
|
|
||||||
|
|
||||||
@enumerate
|
|
||||||
|
|
||||||
@item Create a new console application ("File / New / Project") and then
|
|
||||||
select "Win32 Console Application". On the appropriate page of the
|
|
||||||
Application Wizard, uncheck the "Precompiled headers" option.
|
|
||||||
|
|
||||||
@item Write the source code for your application, or, for testing, just
|
|
||||||
copy the code from an existing sample application into the source file
|
|
||||||
that MSVC++ has already created for you. For example, you can copy
|
|
||||||
@file{libavformat/output-example.c} from the FFmpeg distribution.
|
|
||||||
|
|
||||||
@item Open the "Project / Properties" dialog box. In the "Configuration"
|
|
||||||
combo box, select "All Configurations" so that the changes you make will
|
|
||||||
affect both debug and release builds. In the tree view on the left hand
|
|
||||||
side, select "C/C++ / General", then edit the "Additional Include
|
|
||||||
Directories" setting to contain the path where the FFmpeg includes were
|
|
||||||
installed (i.e. @file{c:\msys\1.0\local\include}).
|
|
||||||
Do not add MinGW's include directory here, or the include files will
|
|
||||||
conflict with MSVC's.
|
|
||||||
|
|
||||||
@item Still in the "Project / Properties" dialog box, select
|
|
||||||
"Linker / General" from the tree view and edit the
|
|
||||||
"Additional Library Directories" setting to contain the @file{lib}
|
|
||||||
directory where FFmpeg was installed (i.e. @file{c:\msys\1.0\local\lib}),
|
|
||||||
the directory where MinGW libs are installed (i.e. @file{c:\mingw\lib}),
|
|
||||||
and the directory where MinGW's GCC libs are installed
|
|
||||||
(i.e. @file{C:\mingw\lib\gcc\mingw32\4.2.1-sjlj}). Then select
|
|
||||||
"Linker / Input" from the tree view, and add the files @file{libavformat.a},
|
|
||||||
@file{libavcodec.a}, @file{libavutil.a}, @file{libmingwex.a},
|
|
||||||
@file{libgcc.a}, and any other libraries you used (i.e. @file{libz.a})
|
|
||||||
to the end of "Additional Dependencies".
|
|
||||||
|
|
||||||
@item Now, select "C/C++ / Code Generation" from the tree view. Select
|
|
||||||
"Debug" in the "Configuration" combo box. Make sure that "Runtime
|
|
||||||
Library" is set to "Multi-threaded Debug DLL". Then, select "Release" in
|
|
||||||
the "Configuration" combo box and make sure that "Runtime Library" is
|
|
||||||
set to "Multi-threaded DLL".
|
|
||||||
|
|
||||||
@item Click "OK" to close the "Project / Properties" dialog box.
|
|
||||||
|
|
||||||
@item MSVC++ lacks some C99 header files that are fundamental for FFmpeg.
|
|
||||||
Get msinttypes from @url{http://code.google.com/p/msinttypes/downloads/list}
|
|
||||||
and install it in MSVC++'s include directory
|
|
||||||
(i.e. @file{C:\Program Files\Microsoft Visual Studio 8\VC\include}).
|
|
||||||
|
|
||||||
@item MSVC++ also does not understand the @code{inline} keyword used by
|
|
||||||
FFmpeg, so you must add this line before @code{#include}ing libav*:
|
|
||||||
@example
|
|
||||||
#define inline _inline
|
|
||||||
@end example
|
|
||||||
|
|
||||||
@item Build your application, everything should work.
|
|
||||||
|
|
||||||
@end enumerate
|
|
||||||
|
|
||||||
@subsection Using shared libraries
|
|
||||||
|
|
||||||
This is how to create DLL and LIB files that are compatible with MSVC++:
|
|
||||||
|
|
||||||
@enumerate
|
|
||||||
|
|
||||||
@item Add a call to @file{vcvars32.bat} (which sets up the environment
|
|
||||||
variables for the Visual C++ tools) as the first line of @file{msys.bat}.
|
|
||||||
The standard location for @file{vcvars32.bat} is
|
|
||||||
@file{C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat},
|
|
||||||
and the standard location for @file{msys.bat} is @file{C:\msys\1.0\msys.bat}.
|
|
||||||
If this corresponds to your setup, add the following line as the first line
|
|
||||||
of @file{msys.bat}:
|
|
||||||
|
|
||||||
@example
|
|
||||||
call "C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat"
|
|
||||||
@end example
|
|
||||||
|
|
||||||
Alternatively, you may start the @file{Visual Studio 2005 Command Prompt},
|
|
||||||
and run @file{c:\msys\1.0\msys.bat} from there.
|
|
||||||
|
|
||||||
@item Within the MSYS shell, run @code{lib.exe}. If you get a help message
|
|
||||||
from @file{Microsoft (R) Library Manager}, this means your environment
|
|
||||||
variables are set up correctly, the @file{Microsoft (R) Library Manager}
|
|
||||||
is on the path and will be used by FFmpeg to create
|
|
||||||
MSVC++-compatible import libraries.
|
|
||||||
|
|
||||||
@item Build FFmpeg with
|
|
||||||
|
|
||||||
@example
|
|
||||||
./configure --enable-shared
|
|
||||||
make
|
|
||||||
make install
|
|
||||||
@end example
|
|
||||||
|
|
||||||
Your install path (@file{/usr/local/} by default) should now have the
|
|
||||||
necessary DLL and LIB files under the @file{bin} directory.
|
|
||||||
|
|
||||||
@end enumerate
|
|
||||||
|
|
||||||
Alternatively, build the libraries with a cross compiler, according to
|
|
||||||
the instructions below in @ref{Cross compilation for Windows with Linux}.
|
|
||||||
|
|
||||||
To use those files with MSVC++, do the same as you would do with
|
|
||||||
the static libraries, as described above. But in Step 4,
|
|
||||||
you should only need to add the directory where the LIB files are installed
|
|
||||||
(i.e. @file{c:\msys\usr\local\bin}). This is not a typo, the LIB files are
|
|
||||||
installed in the @file{bin} directory. And instead of adding the static
|
|
||||||
libraries (@file{libxxx.a} files) you should add the MSVC import libraries
|
|
||||||
(@file{avcodec.lib}, @file{avformat.lib}, and
|
|
||||||
@file{avutil.lib}). Note that you should not use the GCC import
|
|
||||||
libraries (@file{libxxx.dll.a} files), as these will give you undefined
|
|
||||||
reference errors. There should be no need for @file{libmingwex.a},
|
|
||||||
@file{libgcc.a}, and @file{wsock32.lib}, nor any other external library
|
|
||||||
statically linked into the DLLs.
|
|
||||||
|
|
||||||
FFmpeg headers do not declare global data for Windows DLLs through the usual
|
|
||||||
dllexport/dllimport interface. Such data will be exported properly while
|
|
||||||
building, but to use them in your MSVC++ code you will have to edit the
|
|
||||||
appropriate headers and mark the data as dllimport. For example, in
|
|
||||||
libavutil/pixdesc.h you should have:
|
|
||||||
@example
|
|
||||||
extern __declspec(dllimport) const AVPixFmtDescriptor av_pix_fmt_descriptors[];
|
|
||||||
@end example
|
|
||||||
|
|
||||||
Note that using import libraries created by dlltool requires
|
|
||||||
the linker optimization option to be set to
|
|
||||||
"References: Keep Unreferenced Data (@code{/OPT:NOREF})", otherwise
|
|
||||||
the resulting binaries will fail during runtime. This isn't
|
|
||||||
required when using import libraries generated by lib.exe.
|
|
||||||
This issue is reported upstream at
|
|
||||||
@url{http://sourceware.org/bugzilla/show_bug.cgi?id=12633}.
|
|
||||||
|
|
||||||
To create import libraries that work with the @code{/OPT:REF} option
|
|
||||||
(which is enabled by default in Release mode), follow these steps:
|
|
||||||
|
|
||||||
@enumerate
|
|
||||||
|
|
||||||
@item Open @file{Visual Studio 2005 Command Prompt}.
|
|
||||||
|
|
||||||
Alternatively, in a normal command line prompt, call @file{vcvars32.bat}
|
|
||||||
which sets up the environment variables for the Visual C++ tools
|
|
||||||
(the standard location for this file is
|
|
||||||
@file{C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat}).
|
|
||||||
|
|
||||||
@item Enter the @file{bin} directory where the created LIB and DLL files
|
|
||||||
are stored.
|
|
||||||
|
|
||||||
@item Generate new import libraries with @file{lib.exe}:
|
|
||||||
|
|
||||||
@example
|
|
||||||
lib /machine:i386 /def:..\lib\avcodec-53.def /out:avcodec.lib
|
|
||||||
lib /machine:i386 /def:..\lib\avdevice-53.def /out:avdevice.lib
|
|
||||||
lib /machine:i386 /def:..\lib\avfilter-2.def /out:avfilter.lib
|
|
||||||
lib /machine:i386 /def:..\lib\avformat-53.def /out:avformat.lib
|
|
||||||
lib /machine:i386 /def:..\lib\avutil-51.def /out:avutil.lib
|
|
||||||
lib /machine:i386 /def:..\lib\swscale-2.def /out:swscale.lib
|
|
||||||
@end example
|
|
||||||
|
|
||||||
@end enumerate
|
|
||||||
|
|
||||||
@anchor{Cross compilation for Windows with Linux}
|
|
||||||
@section Cross compilation for Windows with Linux
|
|
||||||
|
|
||||||
You must use the MinGW cross compilation tools available at
|
|
||||||
@url{http://www.mingw.org/}.
|
|
||||||
|
|
||||||
Then configure FFmpeg with the following options:
|
|
||||||
@example
|
|
||||||
./configure --target-os=mingw32 --cross-prefix=i386-mingw32msvc-
|
|
||||||
@end example
|
|
||||||
(you can change the cross-prefix according to the prefix chosen for the
|
|
||||||
MinGW tools).
|
|
||||||
|
|
||||||
Then you can easily test FFmpeg with @uref{http://www.winehq.com/, Wine}.
|
|
||||||
|
|
||||||
@section Compilation under Cygwin
|
|
||||||
|
|
||||||
Please use Cygwin 1.7.x as the obsolete 1.5.x Cygwin versions lack
|
|
||||||
llrint() in its C library.
|
|
||||||
|
|
||||||
Install your Cygwin with all the "Base" packages, plus the
|
|
||||||
following "Devel" ones:
|
|
||||||
@example
|
|
||||||
binutils, gcc4-core, make, git, mingw-runtime, texi2html
|
|
||||||
@end example
|
|
||||||
|
|
||||||
And the following "Utils" one:
|
|
||||||
@example
|
|
||||||
diffutils
|
|
||||||
@end example
|
|
||||||
|
|
||||||
Then run
|
|
||||||
|
|
||||||
@example
|
|
||||||
./configure
|
|
||||||
@end example
|
|
||||||
|
|
||||||
to make a static build.
|
|
||||||
|
|
||||||
The current @code{gcc4-core} package is buggy and needs this flag to build
|
|
||||||
shared libraries:
|
|
||||||
|
|
||||||
@example
|
|
||||||
./configure --enable-shared --disable-static --extra-cflags=-fno-reorder-functions
|
|
||||||
@end example
|
|
||||||
|
|
||||||
If you want to build FFmpeg with additional libraries, download Cygwin
|
|
||||||
"Devel" packages for Ogg and Vorbis from any Cygwin packages repository:
|
|
||||||
@example
|
|
||||||
libogg-devel, libvorbis-devel
|
|
||||||
@end example
|
|
||||||
|
|
||||||
These library packages are only available from
|
|
||||||
@uref{http://sourceware.org/cygwinports/, Cygwin Ports}:
|
|
||||||
|
|
||||||
@example
|
|
||||||
yasm, libSDL-devel, libdirac-devel, libfaac-devel, libaacplus-devel, libgsm-devel,
|
|
||||||
libmp3lame-devel, libschroedinger1.0-devel, speex-devel, libtheora-devel,
|
|
||||||
libxvidcore-devel
|
|
||||||
@end example
|
|
||||||
|
|
||||||
The recommendation for libnut and x264 is to build them from source by
|
|
||||||
yourself, as they evolve too quickly for Cygwin Ports to be up to date.
|
|
||||||
|
|
||||||
Cygwin 1.7.x has IPv6 support. You can add IPv6 to Cygwin 1.5.x by means
|
|
||||||
of the @code{libgetaddrinfo-devel} package, available at Cygwin Ports.
|
|
||||||
|
|
||||||
@section Crosscompilation for Windows under Cygwin
|
|
||||||
|
|
||||||
With Cygwin you can create Windows binaries that do not need the cygwin1.dll.
|
|
||||||
|
|
||||||
Just install your Cygwin as explained before, plus these additional
|
|
||||||
"Devel" packages:
|
|
||||||
@example
|
|
||||||
gcc-mingw-core, mingw-runtime, mingw-zlib
|
|
||||||
@end example
|
|
||||||
|
|
||||||
and add some special flags to your configure invocation.
|
|
||||||
|
|
||||||
For a static build run
|
|
||||||
@example
|
|
||||||
./configure --target-os=mingw32 --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin
|
|
||||||
@end example
|
|
||||||
|
|
||||||
and for a build with shared libraries
|
|
||||||
@example
|
|
||||||
./configure --target-os=mingw32 --enable-shared --disable-static --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin
|
|
||||||
@end example
|
|
||||||
|
|
||||||
@bye
|
|
||||||
@@ -52,7 +52,7 @@ resource to be concatenated, each one possibly specifying a distinct
|
|||||||
protocol.
|
protocol.
|
||||||
|
|
||||||
For example to read a sequence of files @file{split1.mpeg},
|
For example to read a sequence of files @file{split1.mpeg},
|
||||||
@file{split2.mpeg}, @file{split3.mpeg} with @command{ffplay} use the
|
@file{split2.mpeg}, @file{split3.mpeg} with @file{ffplay} use the
|
||||||
command:
|
command:
|
||||||
@example
|
@example
|
||||||
ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
|
ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
|
||||||
@@ -67,7 +67,7 @@ File access protocol.
|
|||||||
|
|
||||||
Allow to read from or read to a file.
|
Allow to read from or read to a file.
|
||||||
|
|
||||||
For example to read from a file @file{input.mpeg} with @command{ffmpeg}
|
For example to read from a file @file{input.mpeg} with @file{ffmpeg}
|
||||||
use the command:
|
use the command:
|
||||||
@example
|
@example
|
||||||
ffmpeg -i file:input.mpeg output.mpeg
|
ffmpeg -i file:input.mpeg output.mpeg
|
||||||
@@ -134,14 +134,14 @@ pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If @var{number}
|
|||||||
is not specified, by default the stdout file descriptor will be used
|
is not specified, by default the stdout file descriptor will be used
|
||||||
for writing, stdin for reading.
|
for writing, stdin for reading.
|
||||||
|
|
||||||
For example to read from stdin with @command{ffmpeg}:
|
For example to read from stdin with @file{ffmpeg}:
|
||||||
@example
|
@example
|
||||||
cat test.wav | ffmpeg -i pipe:0
|
cat test.wav | ffmpeg -i pipe:0
|
||||||
# ...this is the same as...
|
# ...this is the same as...
|
||||||
cat test.wav | ffmpeg -i pipe:
|
cat test.wav | ffmpeg -i pipe:
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
For writing to stdout with @command{ffmpeg}:
|
For writing to stdout with @file{ffmpeg}:
|
||||||
@example
|
@example
|
||||||
ffmpeg -i test.wav -f avi pipe:1 | cat > test.avi
|
ffmpeg -i test.wav -f avi pipe:1 | cat > test.avi
|
||||||
# ...this is the same as...
|
# ...this is the same as...
|
||||||
@@ -155,8 +155,8 @@ be seekable, so they will fail with the pipe output protocol.
|
|||||||
|
|
||||||
Real-Time Messaging Protocol.
|
Real-Time Messaging Protocol.
|
||||||
|
|
||||||
The Real-Time Messaging Protocol (RTMP) is used for streaming multimedia
|
The Real-Time Messaging Protocol (RTMP) is used for streaming multime‐
|
||||||
content across a TCP/IP network.
|
dia content across a TCP/IP network.
|
||||||
|
|
||||||
The required syntax is:
|
The required syntax is:
|
||||||
@example
|
@example
|
||||||
@@ -183,7 +183,7 @@ application specified in @var{app}, may be prefixed by "mp4:".
|
|||||||
|
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
For example to read with @command{ffplay} a multimedia resource named
|
For example to read with @file{ffplay} a multimedia resource named
|
||||||
"sample" from the application "vod" from an RTMP server "myserver":
|
"sample" from the application "vod" from an RTMP server "myserver":
|
||||||
@example
|
@example
|
||||||
ffplay rtmp://myserver/vod/sample
|
ffplay rtmp://myserver/vod/sample
|
||||||
@@ -195,7 +195,7 @@ Real-Time Messaging Protocol and its variants supported through
|
|||||||
librtmp.
|
librtmp.
|
||||||
|
|
||||||
Requires the presence of the librtmp headers and library during
|
Requires the presence of the librtmp headers and library during
|
||||||
configuration. You need to explicitly configure the build with
|
configuration. You need to explicitely configure the build with
|
||||||
"--enable-librtmp". If enabled this will replace the native RTMP
|
"--enable-librtmp". If enabled this will replace the native RTMP
|
||||||
protocol.
|
protocol.
|
||||||
|
|
||||||
@@ -219,12 +219,12 @@ meaning as specified for the RTMP native protocol.
|
|||||||
See the librtmp manual page (man 3 librtmp) for more information.
|
See the librtmp manual page (man 3 librtmp) for more information.
|
||||||
|
|
||||||
For example, to stream a file in real-time to an RTMP server using
|
For example, to stream a file in real-time to an RTMP server using
|
||||||
@command{ffmpeg}:
|
@file{ffmpeg}:
|
||||||
@example
|
@example
|
||||||
ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
|
ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
To play the same stream using @command{ffplay}:
|
To play the same stream using @file{ffplay}:
|
||||||
@example
|
@example
|
||||||
ffplay "rtmp://myserver/live/mystream live=1"
|
ffplay "rtmp://myserver/live/mystream live=1"
|
||||||
@end example
|
@end example
|
||||||
@@ -242,19 +242,16 @@ data transferred over RDT).
|
|||||||
|
|
||||||
The muxer can be used to send a stream using RTSP ANNOUNCE to a server
|
The muxer can be used to send a stream using RTSP ANNOUNCE to a server
|
||||||
supporting it (currently Darwin Streaming Server and Mischa Spiegelmock's
|
supporting it (currently Darwin Streaming Server and Mischa Spiegelmock's
|
||||||
@uref{http://github.com/revmischa/rtsp-server, RTSP server}).
|
RTSP server, @url{http://github.com/revmischa/rtsp-server}).
|
||||||
|
|
||||||
The required syntax for a RTSP url is:
|
The required syntax for a RTSP url is:
|
||||||
@example
|
@example
|
||||||
rtsp://@var{hostname}[:@var{port}]/@var{path}
|
rtsp://@var{hostname}[:@var{port}]/@var{path}[?@var{options}]
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
The following options (set on the @command{ffmpeg}/@command{ffplay} command
|
@var{options} is a @code{&}-separated list. The following options
|
||||||
line, or set in code via @code{AVOption}s or in @code{avformat_open_input}),
|
|
||||||
are supported:
|
are supported:
|
||||||
|
|
||||||
Flags for @code{rtsp_transport}:
|
|
||||||
|
|
||||||
@table @option
|
@table @option
|
||||||
|
|
||||||
@item udp
|
@item udp
|
||||||
@@ -264,31 +261,27 @@ Use UDP as lower transport protocol.
|
|||||||
Use TCP (interleaving within the RTSP control channel) as lower
|
Use TCP (interleaving within the RTSP control channel) as lower
|
||||||
transport protocol.
|
transport protocol.
|
||||||
|
|
||||||
@item udp_multicast
|
@item multicast
|
||||||
Use UDP multicast as lower transport protocol.
|
Use UDP multicast as lower transport protocol.
|
||||||
|
|
||||||
@item http
|
@item http
|
||||||
Use HTTP tunneling as lower transport protocol, which is useful for
|
Use HTTP tunneling as lower transport protocol, which is useful for
|
||||||
passing proxies.
|
passing proxies.
|
||||||
|
|
||||||
|
@item filter_src
|
||||||
|
Accept packets only from negotiated peer address and port.
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
Multiple lower transport protocols may be specified, in that case they are
|
Multiple lower transport protocols may be specified, in that case they are
|
||||||
tried one at a time (if the setup of one fails, the next one is tried).
|
tried one at a time (if the setup of one fails, the next one is tried).
|
||||||
For the muxer, only the @code{tcp} and @code{udp} options are supported.
|
For the muxer, only the @code{tcp} and @code{udp} options are supported.
|
||||||
|
|
||||||
Flags for @code{rtsp_flags}:
|
|
||||||
|
|
||||||
@table @option
|
|
||||||
@item filter_src
|
|
||||||
Accept packets only from negotiated peer address and port.
|
|
||||||
@end table
|
|
||||||
|
|
||||||
When receiving data over UDP, the demuxer tries to reorder received packets
|
When receiving data over UDP, the demuxer tries to reorder received packets
|
||||||
(since they may arrive out of order, or packets may get lost totally). In
|
(since they may arrive out of order, or packets may get lost totally). In
|
||||||
order for this to be enabled, a maximum delay must be specified in the
|
order for this to be enabled, a maximum delay must be specified in the
|
||||||
@code{max_delay} field of AVFormatContext.
|
@code{max_delay} field of AVFormatContext.
|
||||||
|
|
||||||
When watching multi-bitrate Real-RTSP streams with @command{ffplay}, the
|
When watching multi-bitrate Real-RTSP streams with @file{ffplay}, the
|
||||||
streams to display can be chosen with @code{-vst} @var{n} and
|
streams to display can be chosen with @code{-vst} @var{n} and
|
||||||
@code{-ast} @var{n} for video and audio respectively, and can be switched
|
@code{-ast} @var{n} for video and audio respectively, and can be switched
|
||||||
on the fly by pressing @code{v} and @code{a}.
|
on the fly by pressing @code{v} and @code{a}.
|
||||||
@@ -298,13 +291,13 @@ Example command lines:
|
|||||||
To watch a stream over UDP, with a max reordering delay of 0.5 seconds:
|
To watch a stream over UDP, with a max reordering delay of 0.5 seconds:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
ffplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4
|
ffplay -max_delay 500000 rtsp://server/video.mp4?udp
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
To watch a stream tunneled over HTTP:
|
To watch a stream tunneled over HTTP:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
ffplay -rtsp_transport http rtsp://server/video.mp4
|
ffplay rtsp://server/video.mp4?http
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
To send a stream in realtime to a RTSP server, for others to watch:
|
To send a stream in realtime to a RTSP server, for others to watch:
|
||||||
@@ -365,13 +358,13 @@ To broadcast a stream on the local subnet, for watching in VLC:
|
|||||||
ffmpeg -re -i @var{input} -f sap sap://224.0.0.255?same_port=1
|
ffmpeg -re -i @var{input} -f sap sap://224.0.0.255?same_port=1
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
Similarly, for watching in @command{ffplay}:
|
Similarly, for watching in ffplay:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
ffmpeg -re -i @var{input} -f sap sap://224.0.0.255
|
ffmpeg -re -i @var{input} -f sap sap://224.0.0.255
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
And for watching in @command{ffplay}, over IPv6:
|
And for watching in ffplay, over IPv6:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
ffmpeg -re -i @var{input} -f sap sap://[ff0e::1:2:3:4]
|
ffmpeg -re -i @var{input} -f sap sap://[ff0e::1:2:3:4]
|
||||||
@@ -446,11 +439,6 @@ set the UDP buffer size in bytes
|
|||||||
@item localport=@var{port}
|
@item localport=@var{port}
|
||||||
override the local UDP port to bind with
|
override the local UDP port to bind with
|
||||||
|
|
||||||
@item localaddr=@var{addr}
|
|
||||||
Choose the local IP address. This is useful e.g. if sending multicast
|
|
||||||
and the host has multiple interfaces, where the user can choose
|
|
||||||
which interface to send on by specifying the IP address of that interface.
|
|
||||||
|
|
||||||
@item pkt_size=@var{size}
|
@item pkt_size=@var{size}
|
||||||
set the size in bytes of UDP packets
|
set the size in bytes of UDP packets
|
||||||
|
|
||||||
@@ -472,7 +460,7 @@ For receiving, this gives the benefit of only receiving packets from
|
|||||||
the specified peer address/port.
|
the specified peer address/port.
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
Some usage examples of the udp protocol with @command{ffmpeg} follow.
|
Some usage examples of the udp protocol with @file{ffmpeg} follow.
|
||||||
|
|
||||||
To stream over UDP to a remote endpoint:
|
To stream over UDP to a remote endpoint:
|
||||||
@example
|
@example
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ essential that changes to their codebase are publicly visible, clean and
|
|||||||
easy reviewable that again leads us to:
|
easy reviewable that again leads us to:
|
||||||
* use of a revision control system like git
|
* use of a revision control system like git
|
||||||
* separation of cosmetic from non-cosmetic changes (this is almost entirely
|
* separation of cosmetic from non-cosmetic changes (this is almost entirely
|
||||||
ignored by mentors and students in soc 2006 which might lead to a surprise
|
ignored by mentors and students in soc 2006 which might lead to a suprise
|
||||||
when the code will be reviewed at the end before a possible inclusion in
|
when the code will be reviewed at the end before a possible inclusion in
|
||||||
FFmpeg, individual changes were generally not reviewable due to cosmetics).
|
FFmpeg, individual changes were generally not reviewable due to cosmetics).
|
||||||
* frequent commits, so that comments can be provided early
|
* frequent commits, so that comments can be provided early
|
||||||
|
|||||||
@@ -1,46 +0,0 @@
|
|||||||
The official guide to swresample for confused developers.
|
|
||||||
=========================================================
|
|
||||||
|
|
||||||
Current (simplified) Architecture:
|
|
||||||
---------------------------------
|
|
||||||
Input
|
|
||||||
v
|
|
||||||
__________________/|\___________
|
|
||||||
/ | \
|
|
||||||
/ input sample format convert v
|
|
||||||
/ | ___________/
|
|
||||||
| |/
|
|
||||||
| v
|
|
||||||
| ___________/|\___________ _____________
|
|
||||||
| / | \ | |
|
|
||||||
| Rematrix | resample <---->| Buffers |
|
|
||||||
| \___________ | ___________/ |_____________|
|
|
||||||
v \|/
|
|
||||||
Special Converter v
|
|
||||||
v ___________/|\___________ _____________
|
|
||||||
| / | \ | |
|
|
||||||
| Rematrix | resample <---->| Buffers |
|
|
||||||
| \___________ | ___________/ |_____________|
|
|
||||||
| \|/
|
|
||||||
| v
|
|
||||||
| |\___________
|
|
||||||
\ | \
|
|
||||||
\ output sample format convert v
|
|
||||||
\_________________ | ___________/
|
|
||||||
\|/
|
|
||||||
v
|
|
||||||
Output
|
|
||||||
|
|
||||||
Planar/Packed convertion is done when needed during sample format convertion
|
|
||||||
Every step can be skiped without memcpy when its not needed.
|
|
||||||
Either Resampling and Rematrixing can be performed first depending on which
|
|
||||||
way its faster.
|
|
||||||
The Buffers are needed for resampling due to resamplng being a process that
|
|
||||||
requires future and past data, it thus also introduces inevitably a delay when
|
|
||||||
used.
|
|
||||||
Internally 32bit float and 16bit int is supported currently, other formats can
|
|
||||||
easily be added
|
|
||||||
Externally all sample formats in packed and planar configuration are supported
|
|
||||||
Its also trivial to add special converters for common cases
|
|
||||||
If only sample format and or packed/planar convertion is needed it
|
|
||||||
is performed from input to output directly in a single pass with no intermediates.
|
|
||||||
156
doc/t2h.init
156
doc/t2h.init
@@ -1,161 +1,15 @@
|
|||||||
# no horiz rules between sections
|
# no horiz rules between sections
|
||||||
$end_section = \&FFmpeg_end_section;
|
$end_section = \&FFMPEG_end_section;
|
||||||
sub FFmpeg_end_section($$)
|
sub FFMPEG_end_section($$)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
$EXTRA_HEAD =
|
$print_page_foot = \&FFMPEG_print_page_foot;
|
||||||
'<link rel="icon" href="favicon.png" type="image/png" />
|
sub FFMPEG_print_page_foot($$)
|
||||||
<link rel="stylesheet" type="text/css" href="default.css" />
|
|
||||||
';
|
|
||||||
|
|
||||||
$CSS_LINES = <<EOT;
|
|
||||||
<style type="text/css">
|
|
||||||
<!--
|
|
||||||
a.summary-letter { text-decoration: none }
|
|
||||||
a { color: #2D6198; }
|
|
||||||
a:visited { color: #884488; }
|
|
||||||
h1 a, h2 a, h3 a { text-decoration: inherit; color: inherit; }
|
|
||||||
p { margin-left: 1em; margin-right: 1em; }
|
|
||||||
table { margin-left: 2em; }
|
|
||||||
pre { margin-left: 2em; }
|
|
||||||
#footer { text-align: center; }
|
|
||||||
#body { margin-left: 1em; margin-right: 1em; }
|
|
||||||
body { background-color: #313131; margin: 0; }
|
|
||||||
|
|
||||||
#container {
|
|
||||||
background-color: white;
|
|
||||||
color: #202020;
|
|
||||||
margin-left: 1em;
|
|
||||||
margin-right: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
background-color: #7BB37B;
|
|
||||||
border: 1px solid #6A996A;
|
|
||||||
color: #151515;
|
|
||||||
font-size: 1.2em;
|
|
||||||
padding-bottom: 0.2em;
|
|
||||||
padding-left: 0.4em;
|
|
||||||
padding-top: 0.2em;
|
|
||||||
}
|
|
||||||
|
|
||||||
h2 {
|
|
||||||
color: #313131;
|
|
||||||
font-size: 1.2em;
|
|
||||||
}
|
|
||||||
|
|
||||||
h3 {
|
|
||||||
color: #313131;
|
|
||||||
font-size: 0.8em;
|
|
||||||
margin-bottom: -8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.note {
|
|
||||||
margin: 1em;
|
|
||||||
border: 1px solid #bbc9d8;
|
|
||||||
background-color: #dde1e1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.important {
|
|
||||||
margin: 1em;
|
|
||||||
border: 1px solid #d26767;
|
|
||||||
background-color: #f8e1e1;
|
|
||||||
}
|
|
||||||
|
|
||||||
-->
|
|
||||||
</style>
|
|
||||||
EOT
|
|
||||||
|
|
||||||
my $FFMPEG_NAVBAR = $ENV{"FFMPEG_NAVBAR"} || '';
|
|
||||||
|
|
||||||
$AFTER_BODY_OPEN =
|
|
||||||
'<div id="container">' .
|
|
||||||
"\n$FFMPEG_NAVBAR\n" .
|
|
||||||
'<div id="body">';
|
|
||||||
|
|
||||||
$PRE_BODY_CLOSE = '</div></div>';
|
|
||||||
|
|
||||||
$SMALL_RULE = '';
|
|
||||||
$BODYTEXT = '';
|
|
||||||
|
|
||||||
$print_page_foot = \&FFmpeg_print_page_foot;
|
|
||||||
sub FFmpeg_print_page_foot($$)
|
|
||||||
{
|
{
|
||||||
my $fh = shift;
|
my $fh = shift;
|
||||||
print $fh '<div id="footer">' . "\n";
|
print $fh "$SMALL_RULE\n";
|
||||||
T2H_DEFAULT_print_page_foot($fh);
|
T2H_DEFAULT_print_page_foot($fh);
|
||||||
print $fh "</div>\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$float = \&FFmpeg_float;
|
|
||||||
|
|
||||||
sub FFmpeg_float($$$$)
|
|
||||||
{
|
|
||||||
my $text = shift;
|
|
||||||
my $float = shift;
|
|
||||||
my $caption = shift;
|
|
||||||
my $shortcaption = shift;
|
|
||||||
|
|
||||||
my $label = '';
|
|
||||||
if (exists($float->{'id'}))
|
|
||||||
{
|
|
||||||
$label = &$anchor($float->{'id'});
|
|
||||||
}
|
|
||||||
my $class = '';
|
|
||||||
my $subject = '';
|
|
||||||
|
|
||||||
if ($caption =~ /NOTE/)
|
|
||||||
{
|
|
||||||
$class = "note";
|
|
||||||
}
|
|
||||||
elsif ($caption =~ /IMPORTANT/)
|
|
||||||
{
|
|
||||||
$class = "important";
|
|
||||||
}
|
|
||||||
|
|
||||||
return '<div class="float ' . $class . '">' . "$label\n" . $text . '</div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
$print_page_head = \&FFmpeg_print_page_head;
|
|
||||||
sub FFmpeg_print_page_head($$)
|
|
||||||
{
|
|
||||||
my $fh = shift;
|
|
||||||
my $longtitle = "$Texi2HTML::THISDOC{'title_no_texi'}";
|
|
||||||
$longtitle .= ": $Texi2HTML::NO_TEXI{'This'}" if exists $Texi2HTML::NO_TEXI{'This'};
|
|
||||||
my $description = $DOCUMENT_DESCRIPTION;
|
|
||||||
$description = $longtitle if (!defined($description));
|
|
||||||
$description = "<meta name=\"description\" content=\"$description\">" if
|
|
||||||
($description ne '');
|
|
||||||
$description = $Texi2HTML::THISDOC{'documentdescription'} if (defined($Texi2HTML::THISDOC{'documentdescription'}));
|
|
||||||
my $encoding = '';
|
|
||||||
$encoding = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=$ENCODING\">" if (defined($ENCODING) and ($ENCODING ne ''));
|
|
||||||
$longtitle =~ s/Documentation.*//g;
|
|
||||||
$longtitle = "FFmpeg documentation : " . $longtitle;
|
|
||||||
|
|
||||||
print $fh <<EOT;
|
|
||||||
$DOCTYPE
|
|
||||||
<html>
|
|
||||||
$Texi2HTML::THISDOC{'copying'}<!-- Created on $Texi2HTML::THISDOC{today} by $Texi2HTML::THISDOC{program} -->
|
|
||||||
<!--
|
|
||||||
$Texi2HTML::THISDOC{program_authors}
|
|
||||||
-->
|
|
||||||
<head>
|
|
||||||
<title>$longtitle</title>
|
|
||||||
|
|
||||||
$description
|
|
||||||
<meta name="keywords" content="$longtitle">
|
|
||||||
<meta name="resource-type" content="document">
|
|
||||||
<meta name="distribution" content="global">
|
|
||||||
<meta name="Generator" content="$Texi2HTML::THISDOC{program}">
|
|
||||||
$encoding
|
|
||||||
$CSS_LINES
|
|
||||||
$EXTRA_HEAD
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body $BODYTEXT>
|
|
||||||
$AFTER_BODY_OPEN
|
|
||||||
EOT
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# no navigation elements
|
# no navigation elements
|
||||||
|
|||||||
@@ -352,7 +352,6 @@ sub postprocess
|
|||||||
s/\(?\@xref\{(?:[^\}]*)\}(?:[^.<]|(?:<[^<>]*>))*\.\)?//g;
|
s/\(?\@xref\{(?:[^\}]*)\}(?:[^.<]|(?:<[^<>]*>))*\.\)?//g;
|
||||||
s/\s+\(\@pxref\{(?:[^\}]*)\}\)//g;
|
s/\s+\(\@pxref\{(?:[^\}]*)\}\)//g;
|
||||||
s/;\s+\@pxref\{(?:[^\}]*)\}//g;
|
s/;\s+\@pxref\{(?:[^\}]*)\}//g;
|
||||||
s/\@ref\{([^\}]*)\}/$1/g;
|
|
||||||
s/\@noindent\s*//g;
|
s/\@noindent\s*//g;
|
||||||
s/\@refill//g;
|
s/\@refill//g;
|
||||||
s/\@gol//g;
|
s/\@gol//g;
|
||||||
|
|||||||
4
ffpresets/libx264-baseline.ffpreset
Normal file
4
ffpresets/libx264-baseline.ffpreset
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
coder=0
|
||||||
|
bf=0
|
||||||
|
flags2=-wpred-dct8x8
|
||||||
|
wpredp=0
|
||||||
7
ffpresets/libx264-ipod320.ffpreset
Normal file
7
ffpresets/libx264-ipod320.ffpreset
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
coder=0
|
||||||
|
bf=0
|
||||||
|
flags2=-wpred-dct8x8
|
||||||
|
level=13
|
||||||
|
maxrate=768000
|
||||||
|
bufsize=3000000
|
||||||
|
wpredp=0
|
||||||
8
ffpresets/libx264-ipod640.ffpreset
Normal file
8
ffpresets/libx264-ipod640.ffpreset
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
coder=0
|
||||||
|
bf=0
|
||||||
|
refs=1
|
||||||
|
flags2=-wpred-dct8x8
|
||||||
|
level=30
|
||||||
|
maxrate=10000000
|
||||||
|
bufsize=10000000
|
||||||
|
wpredp=0
|
||||||
20
ffpresets/libx264-lossless_fast.ffpreset
Normal file
20
ffpresets/libx264-lossless_fast.ffpreset
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
coder=0
|
||||||
|
flags=+loop+cgop
|
||||||
|
cmp=+chroma
|
||||||
|
partitions=-parti8x8+parti4x4+partp8x8-partp4x4-partb8x8
|
||||||
|
me_method=hex
|
||||||
|
subq=3
|
||||||
|
me_range=16
|
||||||
|
g=250
|
||||||
|
keyint_min=25
|
||||||
|
sc_threshold=40
|
||||||
|
i_qfactor=0.71
|
||||||
|
b_strategy=1
|
||||||
|
qcomp=0.6
|
||||||
|
qmin=0
|
||||||
|
qmax=69
|
||||||
|
qdiff=4
|
||||||
|
directpred=1
|
||||||
|
flags2=+fastpskip
|
||||||
|
cqp=0
|
||||||
|
wpredp=0
|
||||||
21
ffpresets/libx264-lossless_max.ffpreset
Normal file
21
ffpresets/libx264-lossless_max.ffpreset
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
coder=1
|
||||||
|
flags=+loop+cgop
|
||||||
|
cmp=+chroma
|
||||||
|
partitions=+parti8x8+parti4x4+partp8x8+partp4x4-partb8x8
|
||||||
|
me_method=esa
|
||||||
|
subq=8
|
||||||
|
me_range=16
|
||||||
|
g=250
|
||||||
|
keyint_min=25
|
||||||
|
sc_threshold=40
|
||||||
|
i_qfactor=0.71
|
||||||
|
b_strategy=1
|
||||||
|
qcomp=0.6
|
||||||
|
qmin=0
|
||||||
|
qmax=69
|
||||||
|
qdiff=4
|
||||||
|
refs=16
|
||||||
|
directpred=1
|
||||||
|
flags2=+mixed_refs+dct8x8+fastpskip
|
||||||
|
cqp=0
|
||||||
|
wpredp=2
|
||||||
20
ffpresets/libx264-lossless_medium.ffpreset
Normal file
20
ffpresets/libx264-lossless_medium.ffpreset
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
coder=1
|
||||||
|
flags=+loop+cgop
|
||||||
|
cmp=+chroma
|
||||||
|
partitions=-parti8x8+parti4x4+partp8x8+partp4x4-partb8x8
|
||||||
|
me_method=hex
|
||||||
|
subq=5
|
||||||
|
me_range=16
|
||||||
|
g=250
|
||||||
|
keyint_min=25
|
||||||
|
sc_threshold=40
|
||||||
|
i_qfactor=0.71
|
||||||
|
b_strategy=1
|
||||||
|
qcomp=0.6
|
||||||
|
qmin=0
|
||||||
|
qmax=69
|
||||||
|
qdiff=4
|
||||||
|
directpred=1
|
||||||
|
flags2=+fastpskip
|
||||||
|
cqp=0
|
||||||
|
wpredp=2
|
||||||
21
ffpresets/libx264-lossless_slow.ffpreset
Normal file
21
ffpresets/libx264-lossless_slow.ffpreset
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
coder=1
|
||||||
|
flags=+loop+cgop
|
||||||
|
cmp=+chroma
|
||||||
|
partitions=+parti8x8+parti4x4+partp8x8+partp4x4-partb8x8
|
||||||
|
me_method=umh
|
||||||
|
subq=6
|
||||||
|
me_range=16
|
||||||
|
g=250
|
||||||
|
keyint_min=25
|
||||||
|
sc_threshold=40
|
||||||
|
i_qfactor=0.71
|
||||||
|
b_strategy=1
|
||||||
|
qcomp=0.6
|
||||||
|
qmin=0
|
||||||
|
qmax=69
|
||||||
|
qdiff=4
|
||||||
|
refs=2
|
||||||
|
directpred=1
|
||||||
|
flags2=+dct8x8+fastpskip
|
||||||
|
cqp=0
|
||||||
|
wpredp=2
|
||||||
21
ffpresets/libx264-lossless_slower.ffpreset
Normal file
21
ffpresets/libx264-lossless_slower.ffpreset
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
coder=1
|
||||||
|
flags=+loop+cgop
|
||||||
|
cmp=+chroma
|
||||||
|
partitions=+parti8x8+parti4x4+partp8x8+partp4x4-partb8x8
|
||||||
|
me_method=umh
|
||||||
|
subq=8
|
||||||
|
me_range=16
|
||||||
|
g=250
|
||||||
|
keyint_min=25
|
||||||
|
sc_threshold=40
|
||||||
|
i_qfactor=0.71
|
||||||
|
b_strategy=1
|
||||||
|
qcomp=0.6
|
||||||
|
qmin=0
|
||||||
|
qmax=69
|
||||||
|
qdiff=4
|
||||||
|
refs=4
|
||||||
|
directpred=1
|
||||||
|
flags2=+mixed_refs+dct8x8+fastpskip
|
||||||
|
cqp=0
|
||||||
|
wpredp=2
|
||||||
19
ffpresets/libx264-lossless_ultrafast.ffpreset
Normal file
19
ffpresets/libx264-lossless_ultrafast.ffpreset
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
coder=0
|
||||||
|
flags=+loop+cgop
|
||||||
|
cmp=+chroma
|
||||||
|
partitions=-parti8x8-parti4x4-partp8x8-partp4x4-partb8x8
|
||||||
|
me_method=dia
|
||||||
|
subq=0
|
||||||
|
me_range=16
|
||||||
|
g=250
|
||||||
|
keyint_min=25
|
||||||
|
sc_threshold=40
|
||||||
|
i_qfactor=0.71
|
||||||
|
b_strategy=1
|
||||||
|
qcomp=0.6
|
||||||
|
qmin=0
|
||||||
|
qmax=69
|
||||||
|
qdiff=4
|
||||||
|
directpred=1
|
||||||
|
flags2=+fastpskip
|
||||||
|
cqp=0
|
||||||
339
ffserver.c
339
ffserver.c
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* G.729, G729 Annex D decoders
|
* Multiple format streaming server
|
||||||
* Copyright (c) 2008 Vladimir Voroshilov
|
* copyright (c) 2002 Fabrice Bellard
|
||||||
*
|
*
|
||||||
* This file is part of FFmpeg.
|
* This file is part of FFmpeg.
|
||||||
*
|
*
|
||||||
@@ -18,12 +18,11 @@
|
|||||||
* License along with FFmpeg; if not, write to the Free Software
|
* License along with FFmpeg; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
#ifndef AVCODEC_G729_H
|
#ifndef FFMPEG_FFSERVER_H
|
||||||
#define AVCODEC_G729_H
|
#define FFMPEG_FFSERVER_H
|
||||||
|
|
||||||
/**
|
/* interface between ffserver and modules */
|
||||||
* subframe size
|
|
||||||
*/
|
|
||||||
#define SUBFRAME_SIZE 40
|
|
||||||
|
|
||||||
#endif // AVCODEC_G729_H
|
void ffserver_module_init(void);
|
||||||
|
|
||||||
|
#endif /* FFMPEG_FFSERVER_H */
|
||||||
177
libavcodec/4xm.c
177
libavcodec/4xm.c
@@ -132,8 +132,8 @@ typedef struct FourXContext{
|
|||||||
AVFrame current_picture, last_picture;
|
AVFrame current_picture, last_picture;
|
||||||
GetBitContext pre_gb; ///< ac/dc prefix
|
GetBitContext pre_gb; ///< ac/dc prefix
|
||||||
GetBitContext gb;
|
GetBitContext gb;
|
||||||
GetByteContext g;
|
const uint8_t *bytestream;
|
||||||
GetByteContext g2;
|
const uint16_t *wordstream;
|
||||||
int mv[256];
|
int mv[256];
|
||||||
VLC pre_vlc;
|
VLC pre_vlc;
|
||||||
int last_dc;
|
int last_dc;
|
||||||
@@ -277,7 +277,7 @@ static void init_mv(FourXContext *f){
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static inline void mcdc(uint16_t *dst, uint16_t *src, int log2w, int h, int stride, int scale, unsigned dc){
|
static inline void mcdc(uint16_t *dst, uint16_t *src, int log2w, int h, int stride, int scale, int dc){
|
||||||
int i;
|
int i;
|
||||||
dc*= 0x10001;
|
dc*= 0x10001;
|
||||||
|
|
||||||
@@ -328,11 +328,7 @@ static void decode_p_block(FourXContext *f, uint16_t *dst, uint16_t *src, int lo
|
|||||||
assert(code>=0 && code<=6);
|
assert(code>=0 && code<=6);
|
||||||
|
|
||||||
if(code == 0){
|
if(code == 0){
|
||||||
if (f->g.buffer_end - f->g.buffer < 1){
|
src += f->mv[ *f->bytestream++ ];
|
||||||
av_log(f->avctx, AV_LOG_ERROR, "bytestream overread\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
src += f->mv[ *f->g.buffer++ ];
|
|
||||||
if(start > src || src > end){
|
if(start > src || src > end){
|
||||||
av_log(f->avctx, AV_LOG_ERROR, "mv out of pic\n");
|
av_log(f->avctx, AV_LOG_ERROR, "mv out of pic\n");
|
||||||
return;
|
return;
|
||||||
@@ -349,37 +345,21 @@ static void decode_p_block(FourXContext *f, uint16_t *dst, uint16_t *src, int lo
|
|||||||
}else if(code == 3 && f->version<2){
|
}else if(code == 3 && f->version<2){
|
||||||
mcdc(dst, src, log2w, h, stride, 1, 0);
|
mcdc(dst, src, log2w, h, stride, 1, 0);
|
||||||
}else if(code == 4){
|
}else if(code == 4){
|
||||||
if (f->g.buffer_end - f->g.buffer < 1){
|
src += f->mv[ *f->bytestream++ ];
|
||||||
av_log(f->avctx, AV_LOG_ERROR, "bytestream overread\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
src += f->mv[ *f->g.buffer++ ];
|
|
||||||
if(start > src || src > end){
|
if(start > src || src > end){
|
||||||
av_log(f->avctx, AV_LOG_ERROR, "mv out of pic\n");
|
av_log(f->avctx, AV_LOG_ERROR, "mv out of pic\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (f->g2.buffer_end - f->g2.buffer < 1){
|
mcdc(dst, src, log2w, h, stride, 1, av_le2ne16(*f->wordstream++));
|
||||||
av_log(f->avctx, AV_LOG_ERROR, "wordstream overread\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
mcdc(dst, src, log2w, h, stride, 1, bytestream2_get_le16(&f->g2));
|
|
||||||
}else if(code == 5){
|
}else if(code == 5){
|
||||||
if (f->g2.buffer_end - f->g2.buffer < 1){
|
mcdc(dst, src, log2w, h, stride, 0, av_le2ne16(*f->wordstream++));
|
||||||
av_log(f->avctx, AV_LOG_ERROR, "wordstream overread\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
mcdc(dst, src, log2w, h, stride, 0, bytestream2_get_le16(&f->g2));
|
|
||||||
}else if(code == 6){
|
}else if(code == 6){
|
||||||
if (f->g2.buffer_end - f->g2.buffer < 2){
|
|
||||||
av_log(f->avctx, AV_LOG_ERROR, "wordstream overread\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(log2w){
|
if(log2w){
|
||||||
dst[0] = bytestream2_get_le16(&f->g2);
|
dst[0] = av_le2ne16(*f->wordstream++);
|
||||||
dst[1] = bytestream2_get_le16(&f->g2);
|
dst[1] = av_le2ne16(*f->wordstream++);
|
||||||
}else{
|
}else{
|
||||||
dst[0 ] = bytestream2_get_le16(&f->g2);
|
dst[0 ] = av_le2ne16(*f->wordstream++);
|
||||||
dst[stride] = bytestream2_get_le16(&f->g2);
|
dst[stride] = av_le2ne16(*f->wordstream++);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -391,12 +371,10 @@ static int decode_p_frame(FourXContext *f, const uint8_t *buf, int length){
|
|||||||
uint16_t *src= (uint16_t*)f->last_picture.data[0];
|
uint16_t *src= (uint16_t*)f->last_picture.data[0];
|
||||||
uint16_t *dst= (uint16_t*)f->current_picture.data[0];
|
uint16_t *dst= (uint16_t*)f->current_picture.data[0];
|
||||||
const int stride= f->current_picture.linesize[0]>>1;
|
const int stride= f->current_picture.linesize[0]>>1;
|
||||||
unsigned int bitstream_size, bytestream_size, wordstream_size, extra, bytestream_offset, wordstream_offset;
|
unsigned int bitstream_size, bytestream_size, wordstream_size, extra;
|
||||||
|
|
||||||
if(f->version>1){
|
if(f->version>1){
|
||||||
extra=20;
|
extra=20;
|
||||||
if (length < extra)
|
|
||||||
return -1;
|
|
||||||
bitstream_size= AV_RL32(buf+8);
|
bitstream_size= AV_RL32(buf+8);
|
||||||
wordstream_size= AV_RL32(buf+12);
|
wordstream_size= AV_RL32(buf+12);
|
||||||
bytestream_size= AV_RL32(buf+16);
|
bytestream_size= AV_RL32(buf+16);
|
||||||
@@ -407,10 +385,11 @@ static int decode_p_frame(FourXContext *f, const uint8_t *buf, int length){
|
|||||||
bytestream_size= FFMAX(length - bitstream_size - wordstream_size, 0);
|
bytestream_size= FFMAX(length - bitstream_size - wordstream_size, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bitstream_size > length ||
|
if(bitstream_size+ bytestream_size+ wordstream_size + extra != length
|
||||||
bytestream_size > length - bitstream_size ||
|
|| bitstream_size > (1<<26)
|
||||||
wordstream_size > length - bytestream_size - bitstream_size ||
|
|| bytestream_size > (1<<26)
|
||||||
extra > length - bytestream_size - bitstream_size - wordstream_size){
|
|| wordstream_size > (1<<26)
|
||||||
|
){
|
||||||
av_log(f->avctx, AV_LOG_ERROR, "lengths %d %d %d %d\n", bitstream_size, bytestream_size, wordstream_size,
|
av_log(f->avctx, AV_LOG_ERROR, "lengths %d %d %d %d\n", bitstream_size, bytestream_size, wordstream_size,
|
||||||
bitstream_size+ bytestream_size+ wordstream_size - length);
|
bitstream_size+ bytestream_size+ wordstream_size - length);
|
||||||
return -1;
|
return -1;
|
||||||
@@ -420,13 +399,10 @@ static int decode_p_frame(FourXContext *f, const uint8_t *buf, int length){
|
|||||||
if (!f->bitstream_buffer)
|
if (!f->bitstream_buffer)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
f->dsp.bswap_buf(f->bitstream_buffer, (const uint32_t*)(buf + extra), bitstream_size/4);
|
f->dsp.bswap_buf(f->bitstream_buffer, (const uint32_t*)(buf + extra), bitstream_size/4);
|
||||||
memset((uint8_t*)f->bitstream_buffer + bitstream_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
|
|
||||||
init_get_bits(&f->gb, f->bitstream_buffer, 8*bitstream_size);
|
init_get_bits(&f->gb, f->bitstream_buffer, 8*bitstream_size);
|
||||||
|
|
||||||
wordstream_offset = extra + bitstream_size;
|
f->wordstream= (const uint16_t*)(buf + extra + bitstream_size);
|
||||||
bytestream_offset = extra + bitstream_size + wordstream_size;
|
f->bytestream= buf + extra + bitstream_size + wordstream_size;
|
||||||
bytestream2_init(&f->g2, buf + wordstream_offset, length - wordstream_offset);
|
|
||||||
bytestream2_init(&f->g, buf + bytestream_offset, length - bytestream_offset);
|
|
||||||
|
|
||||||
init_mv(f);
|
init_mv(f);
|
||||||
|
|
||||||
@@ -438,6 +414,15 @@ static int decode_p_frame(FourXContext *f, const uint8_t *buf, int length){
|
|||||||
dst += 8*stride;
|
dst += 8*stride;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( bitstream_size != (get_bits_count(&f->gb)+31)/32*4
|
||||||
|
|| (((const char*)f->wordstream - (const char*)buf + 2)&~2) != extra + bitstream_size + wordstream_size
|
||||||
|
|| (((const char*)f->bytestream - (const char*)buf + 3)&~3) != extra + bitstream_size + wordstream_size + bytestream_size)
|
||||||
|
av_log(f->avctx, AV_LOG_ERROR, " %d %td %td bytes left\n",
|
||||||
|
bitstream_size - (get_bits_count(&f->gb)+31)/32*4,
|
||||||
|
-(((const char*)f->bytestream - (const char*)buf + 3)&~3) + (extra + bitstream_size + wordstream_size + bytestream_size),
|
||||||
|
-(((const char*)f->wordstream - (const char*)buf + 2)&~2) + (extra + bitstream_size + wordstream_size)
|
||||||
|
);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -448,11 +433,6 @@ static int decode_p_frame(FourXContext *f, const uint8_t *buf, int length){
|
|||||||
static int decode_i_block(FourXContext *f, DCTELEM *block){
|
static int decode_i_block(FourXContext *f, DCTELEM *block){
|
||||||
int code, i, j, level, val;
|
int code, i, j, level, val;
|
||||||
|
|
||||||
if(get_bits_left(&f->gb) < 2){
|
|
||||||
av_log(f->avctx, AV_LOG_ERROR, "%d bits left before decode_i_block()\n", get_bits_left(&f->gb));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* DC coef */
|
/* DC coef */
|
||||||
val = get_vlc2(&f->pre_gb, f->pre_vlc.table, ACDC_VLC_BITS, 3);
|
val = get_vlc2(&f->pre_gb, f->pre_vlc.table, ACDC_VLC_BITS, 3);
|
||||||
if (val>>4){
|
if (val>>4){
|
||||||
@@ -551,7 +531,7 @@ static int decode_i_mb(FourXContext *f){
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const uint8_t *read_huffman_tables(FourXContext *f, const uint8_t * const buf, int buf_size){
|
static const uint8_t *read_huffman_tables(FourXContext *f, const uint8_t * const buf){
|
||||||
int frequency[512];
|
int frequency[512];
|
||||||
uint8_t flag[512];
|
uint8_t flag[512];
|
||||||
int up[512];
|
int up[512];
|
||||||
@@ -559,7 +539,6 @@ static const uint8_t *read_huffman_tables(FourXContext *f, const uint8_t * const
|
|||||||
int bits_tab[257];
|
int bits_tab[257];
|
||||||
int start, end;
|
int start, end;
|
||||||
const uint8_t *ptr= buf;
|
const uint8_t *ptr= buf;
|
||||||
const uint8_t *ptr_end = buf + buf_size;
|
|
||||||
int j;
|
int j;
|
||||||
|
|
||||||
memset(frequency, 0, sizeof(frequency));
|
memset(frequency, 0, sizeof(frequency));
|
||||||
@@ -570,8 +549,6 @@ static const uint8_t *read_huffman_tables(FourXContext *f, const uint8_t * const
|
|||||||
for(;;){
|
for(;;){
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (start <= end && ptr_end - ptr < end - start + 1 + 1)
|
|
||||||
return NULL;
|
|
||||||
for(i=start; i<=end; i++){
|
for(i=start; i<=end; i++){
|
||||||
frequency[i]= *ptr++;
|
frequency[i]= *ptr++;
|
||||||
}
|
}
|
||||||
@@ -624,10 +601,9 @@ static const uint8_t *read_huffman_tables(FourXContext *f, const uint8_t * const
|
|||||||
len_tab[j]= len;
|
len_tab[j]= len;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (init_vlc(&f->pre_vlc, ACDC_VLC_BITS, 257,
|
init_vlc(&f->pre_vlc, ACDC_VLC_BITS, 257,
|
||||||
len_tab , 1, 1,
|
len_tab , 1, 1,
|
||||||
bits_tab, 4, 4, 0))
|
bits_tab, 4, 4, 0);
|
||||||
return NULL;
|
|
||||||
|
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
@@ -643,27 +619,16 @@ static int decode_i2_frame(FourXContext *f, const uint8_t *buf, int length){
|
|||||||
int x, y, x2, y2;
|
int x, y, x2, y2;
|
||||||
const int width= f->avctx->width;
|
const int width= f->avctx->width;
|
||||||
const int height= f->avctx->height;
|
const int height= f->avctx->height;
|
||||||
const int mbs = (FFALIGN(width, 16) >> 4) * (FFALIGN(height, 16) >> 4);
|
|
||||||
uint16_t *dst= (uint16_t*)f->current_picture.data[0];
|
uint16_t *dst= (uint16_t*)f->current_picture.data[0];
|
||||||
const int stride= f->current_picture.linesize[0]>>1;
|
const int stride= f->current_picture.linesize[0]>>1;
|
||||||
const uint8_t *buf_end = buf + length;
|
|
||||||
GetByteContext g3;
|
|
||||||
|
|
||||||
if(length < mbs * 8) {
|
|
||||||
av_log(f->avctx, AV_LOG_ERROR, "packet size too small\n");
|
|
||||||
return AVERROR_INVALIDDATA;
|
|
||||||
}
|
|
||||||
bytestream2_init(&g3, buf, length);
|
|
||||||
|
|
||||||
for(y=0; y<height; y+=16){
|
for(y=0; y<height; y+=16){
|
||||||
for(x=0; x<width; x+=16){
|
for(x=0; x<width; x+=16){
|
||||||
unsigned int color[4], bits;
|
unsigned int color[4], bits;
|
||||||
if (buf_end - buf < 8)
|
|
||||||
return -1;
|
|
||||||
memset(color, 0, sizeof(color));
|
memset(color, 0, sizeof(color));
|
||||||
//warning following is purely guessed ...
|
//warning following is purely guessed ...
|
||||||
color[0]= bytestream2_get_le16u(&g3);
|
color[0]= bytestream_get_le16(&buf);
|
||||||
color[1]= bytestream2_get_le16u(&g3);
|
color[1]= bytestream_get_le16(&buf);
|
||||||
|
|
||||||
if(color[0]&0x8000) av_log(NULL, AV_LOG_ERROR, "unk bit 1\n");
|
if(color[0]&0x8000) av_log(NULL, AV_LOG_ERROR, "unk bit 1\n");
|
||||||
if(color[1]&0x8000) av_log(NULL, AV_LOG_ERROR, "unk bit 2\n");
|
if(color[1]&0x8000) av_log(NULL, AV_LOG_ERROR, "unk bit 2\n");
|
||||||
@@ -671,7 +636,7 @@ static int decode_i2_frame(FourXContext *f, const uint8_t *buf, int length){
|
|||||||
color[2]= mix(color[0], color[1]);
|
color[2]= mix(color[0], color[1]);
|
||||||
color[3]= mix(color[1], color[0]);
|
color[3]= mix(color[1], color[0]);
|
||||||
|
|
||||||
bits= bytestream2_get_le32u(&g3);
|
bits= bytestream_get_le32(&buf);
|
||||||
for(y2=0; y2<16; y2++){
|
for(y2=0; y2<16; y2++){
|
||||||
for(x2=0; x2<16; x2++){
|
for(x2=0; x2<16; x2++){
|
||||||
int index= 2*(x2>>2) + 8*(y2>>2);
|
int index= 2*(x2>>2) + 8*(y2>>2);
|
||||||
@@ -680,7 +645,7 @@ static int decode_i2_frame(FourXContext *f, const uint8_t *buf, int length){
|
|||||||
}
|
}
|
||||||
dst+=16;
|
dst+=16;
|
||||||
}
|
}
|
||||||
dst += 16 * stride - x;
|
dst += 16*stride - width;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -690,27 +655,21 @@ static int decode_i_frame(FourXContext *f, const uint8_t *buf, int length){
|
|||||||
int x, y;
|
int x, y;
|
||||||
const int width= f->avctx->width;
|
const int width= f->avctx->width;
|
||||||
const int height= f->avctx->height;
|
const int height= f->avctx->height;
|
||||||
|
uint16_t *dst= (uint16_t*)f->current_picture.data[0];
|
||||||
|
const int stride= f->current_picture.linesize[0]>>1;
|
||||||
const unsigned int bitstream_size= AV_RL32(buf);
|
const unsigned int bitstream_size= AV_RL32(buf);
|
||||||
unsigned int prestream_size;
|
const int token_count av_unused = AV_RL32(buf + bitstream_size + 8);
|
||||||
const uint8_t *prestream;
|
unsigned int prestream_size= 4*AV_RL32(buf + bitstream_size + 4);
|
||||||
|
const uint8_t *prestream= buf + bitstream_size + 12;
|
||||||
|
|
||||||
if (bitstream_size > (1<<26) || length < bitstream_size + 12) {
|
if(prestream_size + bitstream_size + 12 != length
|
||||||
av_log(f->avctx, AV_LOG_ERROR, "packet size too small\n");
|
|| bitstream_size > (1<<26)
|
||||||
return AVERROR_INVALIDDATA;
|
|| prestream_size > (1<<26)){
|
||||||
}
|
|
||||||
|
|
||||||
prestream_size = 4 * AV_RL32(buf + bitstream_size + 4);
|
|
||||||
prestream = buf + bitstream_size + 12;
|
|
||||||
|
|
||||||
if (prestream_size > (1<<26) ||
|
|
||||||
prestream_size != length - (bitstream_size + 12)){
|
|
||||||
av_log(f->avctx, AV_LOG_ERROR, "size mismatch %d %d %d\n", prestream_size, bitstream_size, length);
|
av_log(f->avctx, AV_LOG_ERROR, "size mismatch %d %d %d\n", prestream_size, bitstream_size, length);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
prestream= read_huffman_tables(f, prestream, buf + length - prestream);
|
prestream= read_huffman_tables(f, prestream);
|
||||||
if (!prestream)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
init_get_bits(&f->gb, buf + 4, 8*bitstream_size);
|
init_get_bits(&f->gb, buf + 4, 8*bitstream_size);
|
||||||
|
|
||||||
@@ -720,7 +679,6 @@ static int decode_i_frame(FourXContext *f, const uint8_t *buf, int length){
|
|||||||
if (!f->bitstream_buffer)
|
if (!f->bitstream_buffer)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
f->dsp.bswap_buf(f->bitstream_buffer, (const uint32_t*)prestream, prestream_size/4);
|
f->dsp.bswap_buf(f->bitstream_buffer, (const uint32_t*)prestream, prestream_size/4);
|
||||||
memset((uint8_t*)f->bitstream_buffer + prestream_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
|
|
||||||
init_get_bits(&f->pre_gb, f->bitstream_buffer, 8*prestream_size);
|
init_get_bits(&f->pre_gb, f->bitstream_buffer, 8*prestream_size);
|
||||||
|
|
||||||
f->last_dc= 0*128*8*8;
|
f->last_dc= 0*128*8*8;
|
||||||
@@ -732,6 +690,7 @@ static int decode_i_frame(FourXContext *f, const uint8_t *buf, int length){
|
|||||||
|
|
||||||
idct_put(f, x, y);
|
idct_put(f, x, y);
|
||||||
}
|
}
|
||||||
|
dst += 16*stride;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(get_vlc2(&f->pre_gb, f->pre_vlc.table, ACDC_VLC_BITS, 3) != 256)
|
if(get_vlc2(&f->pre_gb, f->pre_vlc.table, ACDC_VLC_BITS, 3) != 256)
|
||||||
@@ -751,8 +710,6 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
AVFrame *p, temp;
|
AVFrame *p, temp;
|
||||||
int i, frame_4cc, frame_size;
|
int i, frame_4cc, frame_size;
|
||||||
|
|
||||||
if (buf_size < 12)
|
|
||||||
return AVERROR_INVALIDDATA;
|
|
||||||
frame_4cc= AV_RL32(buf);
|
frame_4cc= AV_RL32(buf);
|
||||||
if(buf_size != AV_RL32(buf+4)+8 || buf_size < 20){
|
if(buf_size != AV_RL32(buf+4)+8 || buf_size < 20){
|
||||||
av_log(f->avctx, AV_LOG_ERROR, "size mismatch %d %d\n", buf_size, AV_RL32(buf+4));
|
av_log(f->avctx, AV_LOG_ERROR, "size mismatch %d %d\n", buf_size, AV_RL32(buf+4));
|
||||||
@@ -765,11 +722,6 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
const int whole_size= AV_RL32(buf+16);
|
const int whole_size= AV_RL32(buf+16);
|
||||||
CFrameBuffer *cfrm;
|
CFrameBuffer *cfrm;
|
||||||
|
|
||||||
if (data_size < 0 || whole_size < 0){
|
|
||||||
av_log(f->avctx, AV_LOG_ERROR, "sizes invalid\n");
|
|
||||||
return AVERROR_INVALIDDATA;
|
|
||||||
}
|
|
||||||
|
|
||||||
for(i=0; i<CFRAME_BUFFER_COUNT; i++){
|
for(i=0; i<CFRAME_BUFFER_COUNT; i++){
|
||||||
if(f->cfrm[i].id && f->cfrm[i].id < avctx->frame_number)
|
if(f->cfrm[i].id && f->cfrm[i].id < avctx->frame_number)
|
||||||
av_log(f->avctx, AV_LOG_ERROR, "lost c frame %d\n", f->cfrm[i].id);
|
av_log(f->avctx, AV_LOG_ERROR, "lost c frame %d\n", f->cfrm[i].id);
|
||||||
@@ -786,8 +738,6 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
}
|
}
|
||||||
cfrm= &f->cfrm[i];
|
cfrm= &f->cfrm[i];
|
||||||
|
|
||||||
if (data_size > UINT_MAX - cfrm->size - FF_INPUT_BUFFER_PADDING_SIZE)
|
|
||||||
return AVERROR_INVALIDDATA;
|
|
||||||
cfrm->data= av_fast_realloc(cfrm->data, &cfrm->allocated_size, cfrm->size + data_size + FF_INPUT_BUFFER_PADDING_SIZE);
|
cfrm->data= av_fast_realloc(cfrm->data, &cfrm->allocated_size, cfrm->size + data_size + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||||
if(!cfrm->data){ //explicit check needed as memcpy below might not catch a NULL
|
if(!cfrm->data){ //explicit check needed as memcpy below might not catch a NULL
|
||||||
av_log(f->avctx, AV_LOG_ERROR, "realloc falure");
|
av_log(f->avctx, AV_LOG_ERROR, "realloc falure");
|
||||||
@@ -823,7 +773,7 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
|
|
||||||
avctx->flags |= CODEC_FLAG_EMU_EDGE; // alternatively we would have to use our own buffer management
|
avctx->flags |= CODEC_FLAG_EMU_EDGE; // alternatively we would have to use our own buffer management
|
||||||
|
|
||||||
p->reference= 3;
|
p->reference= 1;
|
||||||
if (avctx->reget_buffer(avctx, p) < 0) {
|
if (avctx->reget_buffer(avctx, p) < 0) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
|
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
|
||||||
return -1;
|
return -1;
|
||||||
@@ -831,19 +781,15 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
|
|
||||||
if(frame_4cc == AV_RL32("ifr2")){
|
if(frame_4cc == AV_RL32("ifr2")){
|
||||||
p->pict_type= AV_PICTURE_TYPE_I;
|
p->pict_type= AV_PICTURE_TYPE_I;
|
||||||
if(decode_i2_frame(f, buf-4, frame_size + 4) < 0) {
|
if(decode_i2_frame(f, buf-4, frame_size) < 0)
|
||||||
av_log(f->avctx, AV_LOG_ERROR, "decode i2 frame failed\n");
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
}else if(frame_4cc == AV_RL32("ifrm")){
|
}else if(frame_4cc == AV_RL32("ifrm")){
|
||||||
p->pict_type= AV_PICTURE_TYPE_I;
|
p->pict_type= AV_PICTURE_TYPE_I;
|
||||||
if(decode_i_frame(f, buf, frame_size) < 0){
|
if(decode_i_frame(f, buf, frame_size) < 0)
|
||||||
av_log(f->avctx, AV_LOG_ERROR, "decode i frame failed\n");
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
}else if(frame_4cc == AV_RL32("pfrm") || frame_4cc == AV_RL32("pfr2")){
|
}else if(frame_4cc == AV_RL32("pfrm") || frame_4cc == AV_RL32("pfr2")){
|
||||||
if(!f->last_picture.data[0]){
|
if(!f->last_picture.data[0]){
|
||||||
f->last_picture.reference= 3;
|
f->last_picture.reference= 1;
|
||||||
if(avctx->get_buffer(avctx, &f->last_picture) < 0){
|
if(avctx->get_buffer(avctx, &f->last_picture) < 0){
|
||||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||||
return -1;
|
return -1;
|
||||||
@@ -851,10 +797,8 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
p->pict_type= AV_PICTURE_TYPE_P;
|
p->pict_type= AV_PICTURE_TYPE_P;
|
||||||
if(decode_p_frame(f, buf, frame_size) < 0){
|
if(decode_p_frame(f, buf, frame_size) < 0)
|
||||||
av_log(f->avctx, AV_LOG_ERROR, "decode p frame failed\n");
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
}else if(frame_4cc == AV_RL32("snd_")){
|
}else if(frame_4cc == AV_RL32("snd_")){
|
||||||
av_log(avctx, AV_LOG_ERROR, "ignoring snd_ chunk length:%d\n", buf_size);
|
av_log(avctx, AV_LOG_ERROR, "ignoring snd_ chunk length:%d\n", buf_size);
|
||||||
}else{
|
}else{
|
||||||
@@ -887,10 +831,6 @@ static av_cold int decode_init(AVCodecContext *avctx){
|
|||||||
av_log(avctx, AV_LOG_ERROR, "extradata wrong or missing\n");
|
av_log(avctx, AV_LOG_ERROR, "extradata wrong or missing\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if((avctx->width % 16) || (avctx->height % 16)) {
|
|
||||||
av_log(avctx, AV_LOG_ERROR, "unsupported width/height\n");
|
|
||||||
return AVERROR_INVALIDDATA;
|
|
||||||
}
|
|
||||||
|
|
||||||
avcodec_get_frame_defaults(&f->current_picture);
|
avcodec_get_frame_defaults(&f->current_picture);
|
||||||
avcodec_get_frame_defaults(&f->last_picture);
|
avcodec_get_frame_defaults(&f->last_picture);
|
||||||
@@ -925,14 +865,15 @@ static av_cold int decode_end(AVCodecContext *avctx){
|
|||||||
}
|
}
|
||||||
|
|
||||||
AVCodec ff_fourxm_decoder = {
|
AVCodec ff_fourxm_decoder = {
|
||||||
.name = "4xm",
|
"4xm",
|
||||||
.type = AVMEDIA_TYPE_VIDEO,
|
AVMEDIA_TYPE_VIDEO,
|
||||||
.id = CODEC_ID_4XM,
|
CODEC_ID_4XM,
|
||||||
.priv_data_size = sizeof(FourXContext),
|
sizeof(FourXContext),
|
||||||
.init = decode_init,
|
decode_init,
|
||||||
.close = decode_end,
|
NULL,
|
||||||
.decode = decode_frame,
|
decode_end,
|
||||||
.capabilities = CODEC_CAP_DR1,
|
decode_frame,
|
||||||
|
CODEC_CAP_DR1,
|
||||||
.long_name = NULL_IF_CONFIG_SMALL("4X Movie"),
|
.long_name = NULL_IF_CONFIG_SMALL("4X Movie"),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
*
|
*
|
||||||
* Supports: PAL8 (RGB 8bpp, paletted)
|
* Supports: PAL8 (RGB 8bpp, paletted)
|
||||||
* : BGR24 (RGB 24bpp) (can also output it as RGB32)
|
* : BGR24 (RGB 24bpp) (can also output it as RGB32)
|
||||||
* : RGB32 (RGB 32bpp, 4th plane is alpha)
|
* : RGB32 (RGB 32bpp, 4th plane is probably alpha and it's ignored)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -50,8 +50,6 @@ typedef struct EightBpsContext {
|
|||||||
|
|
||||||
unsigned char planes;
|
unsigned char planes;
|
||||||
unsigned char planemap[4];
|
unsigned char planemap[4];
|
||||||
|
|
||||||
uint32_t pal[256];
|
|
||||||
} EightBpsContext;
|
} EightBpsContext;
|
||||||
|
|
||||||
|
|
||||||
@@ -71,6 +69,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
|
|||||||
unsigned int dlen, p, row;
|
unsigned int dlen, p, row;
|
||||||
const unsigned char *lp, *dp;
|
const unsigned char *lp, *dp;
|
||||||
unsigned char count;
|
unsigned char count;
|
||||||
|
unsigned int px_inc;
|
||||||
unsigned int planes = c->planes;
|
unsigned int planes = c->planes;
|
||||||
unsigned char *planemap = c->planemap;
|
unsigned char *planemap = c->planemap;
|
||||||
|
|
||||||
@@ -87,6 +86,12 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
|
|||||||
/* Set data pointer after line lengths */
|
/* Set data pointer after line lengths */
|
||||||
dp = encoded + planes * (height << 1);
|
dp = encoded + planes * (height << 1);
|
||||||
|
|
||||||
|
/* Ignore alpha plane, don't know what to do with it */
|
||||||
|
if (planes == 4)
|
||||||
|
planes--;
|
||||||
|
|
||||||
|
px_inc = planes + (avctx->pix_fmt == PIX_FMT_RGB32);
|
||||||
|
|
||||||
for (p = 0; p < planes; p++) {
|
for (p = 0; p < planes; p++) {
|
||||||
/* Lines length pointer for this plane */
|
/* Lines length pointer for this plane */
|
||||||
lp = encoded + p * (height << 1);
|
lp = encoded + p * (height << 1);
|
||||||
@@ -102,20 +107,20 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
|
|||||||
if ((count = *dp++) <= 127) {
|
if ((count = *dp++) <= 127) {
|
||||||
count++;
|
count++;
|
||||||
dlen -= count + 1;
|
dlen -= count + 1;
|
||||||
if (pixptr + count * planes > pixptr_end)
|
if (pixptr + count * px_inc > pixptr_end)
|
||||||
break;
|
break;
|
||||||
if(dp + count > buf+buf_size) return -1;
|
if(dp + count > buf+buf_size) return -1;
|
||||||
while(count--) {
|
while(count--) {
|
||||||
*pixptr = *dp++;
|
*pixptr = *dp++;
|
||||||
pixptr += planes;
|
pixptr += px_inc;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
count = 257 - count;
|
count = 257 - count;
|
||||||
if (pixptr + count * planes > pixptr_end)
|
if (pixptr + count * px_inc > pixptr_end)
|
||||||
break;
|
break;
|
||||||
while(count--) {
|
while(count--) {
|
||||||
*pixptr = *dp;
|
*pixptr = *dp;
|
||||||
pixptr += planes;
|
pixptr += px_inc;
|
||||||
}
|
}
|
||||||
dp++;
|
dp++;
|
||||||
dlen -= 2;
|
dlen -= 2;
|
||||||
@@ -124,16 +129,13 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (avctx->bits_per_coded_sample <= 8) {
|
if (avctx->palctrl) {
|
||||||
const uint8_t *pal = av_packet_get_side_data(avpkt,
|
memcpy (c->pic.data[1], avctx->palctrl->palette, AVPALETTE_SIZE);
|
||||||
AV_PKT_DATA_PALETTE,
|
if (avctx->palctrl->palette_changed) {
|
||||||
NULL);
|
|
||||||
if (pal) {
|
|
||||||
c->pic.palette_has_changed = 1;
|
c->pic.palette_has_changed = 1;
|
||||||
memcpy(c->pal, pal, AVPALETTE_SIZE);
|
avctx->palctrl->palette_changed = 0;
|
||||||
}
|
} else
|
||||||
|
c->pic.palette_has_changed = 0;
|
||||||
memcpy (c->pic.data[1], c->pal, AVPALETTE_SIZE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
*data_size = sizeof(AVFrame);
|
*data_size = sizeof(AVFrame);
|
||||||
@@ -163,6 +165,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
|||||||
avctx->pix_fmt = PIX_FMT_PAL8;
|
avctx->pix_fmt = PIX_FMT_PAL8;
|
||||||
c->planes = 1;
|
c->planes = 1;
|
||||||
c->planemap[0] = 0; // 1st plane is palette indexes
|
c->planemap[0] = 0; // 1st plane is palette indexes
|
||||||
|
if (avctx->palctrl == NULL) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "Error: PAL8 format but no palette from demuxer.\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 24:
|
case 24:
|
||||||
avctx->pix_fmt = avctx->get_format(avctx, pixfmt_rgb24);
|
avctx->pix_fmt = avctx->get_format(avctx, pixfmt_rgb24);
|
||||||
@@ -178,12 +184,12 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
|||||||
c->planemap[0] = 1; // 1st plane is red
|
c->planemap[0] = 1; // 1st plane is red
|
||||||
c->planemap[1] = 2; // 2nd plane is green
|
c->planemap[1] = 2; // 2nd plane is green
|
||||||
c->planemap[2] = 3; // 3rd plane is blue
|
c->planemap[2] = 3; // 3rd plane is blue
|
||||||
c->planemap[3] = 0; // 4th plane is alpha
|
c->planemap[3] = 0; // 4th plane is alpha???
|
||||||
#else
|
#else
|
||||||
c->planemap[0] = 2; // 1st plane is red
|
c->planemap[0] = 2; // 1st plane is red
|
||||||
c->planemap[1] = 1; // 2nd plane is green
|
c->planemap[1] = 1; // 2nd plane is green
|
||||||
c->planemap[2] = 0; // 3rd plane is blue
|
c->planemap[2] = 0; // 3rd plane is blue
|
||||||
c->planemap[3] = 3; // 4th plane is alpha
|
c->planemap[3] = 3; // 4th plane is alpha???
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -215,13 +221,14 @@ static av_cold int decode_end(AVCodecContext *avctx)
|
|||||||
|
|
||||||
|
|
||||||
AVCodec ff_eightbps_decoder = {
|
AVCodec ff_eightbps_decoder = {
|
||||||
.name = "8bps",
|
"8bps",
|
||||||
.type = AVMEDIA_TYPE_VIDEO,
|
AVMEDIA_TYPE_VIDEO,
|
||||||
.id = CODEC_ID_8BPS,
|
CODEC_ID_8BPS,
|
||||||
.priv_data_size = sizeof(EightBpsContext),
|
sizeof(EightBpsContext),
|
||||||
.init = decode_init,
|
decode_init,
|
||||||
.close = decode_end,
|
NULL,
|
||||||
.decode = decode_frame,
|
decode_end,
|
||||||
.capabilities = CODEC_CAP_DR1,
|
decode_frame,
|
||||||
|
CODEC_CAP_DR1,
|
||||||
.long_name = NULL_IF_CONFIG_SMALL("QuickTime 8BPS video"),
|
.long_name = NULL_IF_CONFIG_SMALL("QuickTime 8BPS video"),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -22,8 +22,6 @@
|
|||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* 8svx audio decoder
|
* 8svx audio decoder
|
||||||
* @author Jaikrishnan Menon
|
|
||||||
*
|
|
||||||
* supports: fibonacci delta encoding
|
* supports: fibonacci delta encoding
|
||||||
* : exponential encoding
|
* : exponential encoding
|
||||||
*
|
*
|
||||||
@@ -41,7 +39,6 @@
|
|||||||
|
|
||||||
/** decoder context */
|
/** decoder context */
|
||||||
typedef struct EightSvxContext {
|
typedef struct EightSvxContext {
|
||||||
AVFrame frame;
|
|
||||||
const int8_t *table;
|
const int8_t *table;
|
||||||
|
|
||||||
/* buffer used to store the whole audio decoded/interleaved chunk,
|
/* buffer used to store the whole audio decoded/interleaved chunk,
|
||||||
@@ -100,19 +97,18 @@ static int delta_decode(int8_t *dst, const uint8_t *src, int src_size,
|
|||||||
return dst-dst0;
|
return dst-dst0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** decode a frame */
|
static int eightsvx_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
|
||||||
static int eightsvx_decode_frame(AVCodecContext *avctx, void *data,
|
AVPacket *avpkt)
|
||||||
int *got_frame_ptr, AVPacket *avpkt)
|
|
||||||
{
|
{
|
||||||
EightSvxContext *esc = avctx->priv_data;
|
EightSvxContext *esc = avctx->priv_data;
|
||||||
int n, out_data_size, ret;
|
int out_data_size, n;
|
||||||
uint8_t *src, *dst;
|
uint8_t *src, *dst;
|
||||||
|
|
||||||
/* decode and interleave the first packet */
|
/* decode and interleave the first packet */
|
||||||
if (!esc->samples && avpkt) {
|
if (!esc->samples && avpkt) {
|
||||||
uint8_t *deinterleaved_samples, *p = NULL;
|
uint8_t *deinterleaved_samples;
|
||||||
|
|
||||||
esc->samples_size = avctx->codec->id == CODEC_ID_8SVX_RAW || avctx->codec->id ==CODEC_ID_PCM_S8_PLANAR?
|
esc->samples_size = avctx->codec->id == CODEC_ID_8SVX_RAW ?
|
||||||
avpkt->size : avctx->channels + (avpkt->size-avctx->channels) * 2;
|
avpkt->size : avctx->channels + (avpkt->size-avctx->channels) * 2;
|
||||||
if (!(esc->samples = av_malloc(esc->samples_size)))
|
if (!(esc->samples = av_malloc(esc->samples_size)))
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
@@ -123,13 +119,8 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
int buf_size = avpkt->size;
|
int buf_size = avpkt->size;
|
||||||
int n = esc->samples_size;
|
int n = esc->samples_size;
|
||||||
|
|
||||||
if (buf_size < 2) {
|
|
||||||
av_log(avctx, AV_LOG_ERROR, "packet size is too small\n");
|
|
||||||
return AVERROR(EINVAL);
|
|
||||||
}
|
|
||||||
if (!(deinterleaved_samples = av_mallocz(n)))
|
if (!(deinterleaved_samples = av_mallocz(n)))
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
p = deinterleaved_samples;
|
|
||||||
|
|
||||||
/* the uncompressed starting value is contained in the first byte */
|
/* the uncompressed starting value is contained in the first byte */
|
||||||
if (avctx->channels == 2) {
|
if (avctx->channels == 2) {
|
||||||
@@ -146,25 +137,21 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
interleave_stereo(esc->samples, deinterleaved_samples, esc->samples_size);
|
interleave_stereo(esc->samples, deinterleaved_samples, esc->samples_size);
|
||||||
else
|
else
|
||||||
memcpy(esc->samples, deinterleaved_samples, esc->samples_size);
|
memcpy(esc->samples, deinterleaved_samples, esc->samples_size);
|
||||||
av_freep(&p);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get output buffer */
|
/* return single packed with fixed size */
|
||||||
esc->frame.nb_samples = (FFMIN(MAX_FRAME_SIZE, esc->samples_size - esc->samples_idx) +avctx->channels-1) / avctx->channels;
|
out_data_size = FFMIN(MAX_FRAME_SIZE, esc->samples_size - esc->samples_idx);
|
||||||
if ((ret = avctx->get_buffer(avctx, &esc->frame)) < 0) {
|
if (*data_size < out_data_size) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
av_log(avctx, AV_LOG_ERROR, "Provided buffer with size %d is too small.\n", *data_size);
|
||||||
return ret;
|
return AVERROR(EINVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
*got_frame_ptr = 1;
|
*data_size = out_data_size;
|
||||||
*(AVFrame *)data = esc->frame;
|
dst = data;
|
||||||
|
|
||||||
dst = esc->frame.data[0];
|
|
||||||
src = esc->samples + esc->samples_idx;
|
src = esc->samples + esc->samples_idx;
|
||||||
out_data_size = esc->frame.nb_samples * avctx->channels;
|
|
||||||
for (n = out_data_size; n > 0; n--)
|
for (n = out_data_size; n > 0; n--)
|
||||||
*dst++ = *src++ + 128;
|
*dst++ = *src++ + 128;
|
||||||
esc->samples_idx += out_data_size;
|
esc->samples_idx += *data_size;
|
||||||
|
|
||||||
return avctx->codec->id == CODEC_ID_8SVX_FIB || avctx->codec->id == CODEC_ID_8SVX_EXP ?
|
return avctx->codec->id == CODEC_ID_8SVX_FIB || avctx->codec->id == CODEC_ID_8SVX_EXP ?
|
||||||
(avctx->frame_number == 0)*2 + out_data_size / 2 :
|
(avctx->frame_number == 0)*2 + out_data_size / 2 :
|
||||||
@@ -175,7 +162,7 @@ static av_cold int eightsvx_decode_init(AVCodecContext *avctx)
|
|||||||
{
|
{
|
||||||
EightSvxContext *esc = avctx->priv_data;
|
EightSvxContext *esc = avctx->priv_data;
|
||||||
|
|
||||||
if (avctx->channels < 1 || avctx->channels > 2) {
|
if (avctx->channels > 2) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "8SVX does not support more than 2 channels\n");
|
av_log(avctx, AV_LOG_ERROR, "8SVX does not support more than 2 channels\n");
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
@@ -183,7 +170,6 @@ static av_cold int eightsvx_decode_init(AVCodecContext *avctx)
|
|||||||
switch (avctx->codec->id) {
|
switch (avctx->codec->id) {
|
||||||
case CODEC_ID_8SVX_FIB: esc->table = fibonacci; break;
|
case CODEC_ID_8SVX_FIB: esc->table = fibonacci; break;
|
||||||
case CODEC_ID_8SVX_EXP: esc->table = exponential; break;
|
case CODEC_ID_8SVX_EXP: esc->table = exponential; break;
|
||||||
case CODEC_ID_PCM_S8_PLANAR:
|
|
||||||
case CODEC_ID_8SVX_RAW: esc->table = NULL; break;
|
case CODEC_ID_8SVX_RAW: esc->table = NULL; break;
|
||||||
default:
|
default:
|
||||||
av_log(avctx, AV_LOG_ERROR, "Invalid codec id %d.\n", avctx->codec->id);
|
av_log(avctx, AV_LOG_ERROR, "Invalid codec id %d.\n", avctx->codec->id);
|
||||||
@@ -191,9 +177,6 @@ static av_cold int eightsvx_decode_init(AVCodecContext *avctx)
|
|||||||
}
|
}
|
||||||
avctx->sample_fmt = AV_SAMPLE_FMT_U8;
|
avctx->sample_fmt = AV_SAMPLE_FMT_U8;
|
||||||
|
|
||||||
avcodec_get_frame_defaults(&esc->frame);
|
|
||||||
avctx->coded_frame = &esc->frame;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -216,7 +199,6 @@ AVCodec ff_eightsvx_fib_decoder = {
|
|||||||
.init = eightsvx_decode_init,
|
.init = eightsvx_decode_init,
|
||||||
.decode = eightsvx_decode_frame,
|
.decode = eightsvx_decode_frame,
|
||||||
.close = eightsvx_decode_close,
|
.close = eightsvx_decode_close,
|
||||||
.capabilities = CODEC_CAP_DR1,
|
|
||||||
.long_name = NULL_IF_CONFIG_SMALL("8SVX fibonacci"),
|
.long_name = NULL_IF_CONFIG_SMALL("8SVX fibonacci"),
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -228,18 +210,16 @@ AVCodec ff_eightsvx_exp_decoder = {
|
|||||||
.init = eightsvx_decode_init,
|
.init = eightsvx_decode_init,
|
||||||
.decode = eightsvx_decode_frame,
|
.decode = eightsvx_decode_frame,
|
||||||
.close = eightsvx_decode_close,
|
.close = eightsvx_decode_close,
|
||||||
.capabilities = CODEC_CAP_DR1,
|
|
||||||
.long_name = NULL_IF_CONFIG_SMALL("8SVX exponential"),
|
.long_name = NULL_IF_CONFIG_SMALL("8SVX exponential"),
|
||||||
};
|
};
|
||||||
|
|
||||||
AVCodec ff_pcm_s8_planar_decoder = {
|
AVCodec ff_eightsvx_raw_decoder = {
|
||||||
.name = "pcm_s8_planar",
|
.name = "8svx_raw",
|
||||||
.type = AVMEDIA_TYPE_AUDIO,
|
.type = AVMEDIA_TYPE_AUDIO,
|
||||||
.id = CODEC_ID_PCM_S8_PLANAR,
|
.id = CODEC_ID_8SVX_RAW,
|
||||||
.priv_data_size = sizeof(EightSvxContext),
|
.priv_data_size = sizeof(EightSvxContext),
|
||||||
.init = eightsvx_decode_init,
|
.init = eightsvx_decode_init,
|
||||||
.close = eightsvx_decode_close,
|
|
||||||
.decode = eightsvx_decode_frame,
|
.decode = eightsvx_decode_frame,
|
||||||
.capabilities = CODEC_CAP_DR1,
|
.close = eightsvx_decode_close,
|
||||||
.long_name = NULL_IF_CONFIG_SMALL("PCM signed 8-bit planar"),
|
.long_name = NULL_IF_CONFIG_SMALL("8SVX rawaudio"),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ include $(SUBDIR)../config.mak
|
|||||||
NAME = avcodec
|
NAME = avcodec
|
||||||
FFLIBS = avutil
|
FFLIBS = avutil
|
||||||
|
|
||||||
HEADERS = avcodec.h avfft.h dxva2.h opt.h vaapi.h vda.h vdpau.h version.h xvmc.h
|
HEADERS = avcodec.h avfft.h dxva2.h opt.h vaapi.h vdpau.h version.h xvmc.h
|
||||||
|
|
||||||
OBJS = allcodecs.o \
|
OBJS = allcodecs.o \
|
||||||
audioconvert.o \
|
audioconvert.o \
|
||||||
@@ -15,6 +15,7 @@ OBJS = allcodecs.o \
|
|||||||
fmtconvert.o \
|
fmtconvert.o \
|
||||||
imgconvert.o \
|
imgconvert.o \
|
||||||
jrevdct.o \
|
jrevdct.o \
|
||||||
|
opt.o \
|
||||||
options.o \
|
options.o \
|
||||||
parser.o \
|
parser.o \
|
||||||
raw.o \
|
raw.o \
|
||||||
@@ -49,7 +50,6 @@ RDFT-OBJS-$(CONFIG_HARDCODED_TABLES) += sin_tables.o
|
|||||||
OBJS-$(CONFIG_RDFT) += rdft.o $(RDFT-OBJS-yes)
|
OBJS-$(CONFIG_RDFT) += rdft.o $(RDFT-OBJS-yes)
|
||||||
OBJS-$(CONFIG_SINEWIN) += sinewin.o
|
OBJS-$(CONFIG_SINEWIN) += sinewin.o
|
||||||
OBJS-$(CONFIG_VAAPI) += vaapi.o
|
OBJS-$(CONFIG_VAAPI) += vaapi.o
|
||||||
OBJS-$(CONFIG_VDA) += vda.o
|
|
||||||
OBJS-$(CONFIG_VDPAU) += vdpau.o
|
OBJS-$(CONFIG_VDPAU) += vdpau.o
|
||||||
|
|
||||||
# decoders/encoders/hardware accelerators
|
# decoders/encoders/hardware accelerators
|
||||||
@@ -63,9 +63,9 @@ OBJS-$(CONFIG_AAC_ENCODER) += aacenc.o aaccoder.o \
|
|||||||
mpeg4audio.o kbdwin.o
|
mpeg4audio.o kbdwin.o
|
||||||
OBJS-$(CONFIG_AASC_DECODER) += aasc.o msrledec.o
|
OBJS-$(CONFIG_AASC_DECODER) += aasc.o msrledec.o
|
||||||
OBJS-$(CONFIG_AC3_DECODER) += ac3dec.o ac3dec_data.o ac3.o kbdwin.o
|
OBJS-$(CONFIG_AC3_DECODER) += ac3dec.o ac3dec_data.o ac3.o kbdwin.o
|
||||||
OBJS-$(CONFIG_AC3_ENCODER) += ac3enc_float.o ac3enc.o ac3tab.o \
|
OBJS-$(CONFIG_AC3_ENCODER) += ac3enc_combined.o ac3enc_fixed.o ac3enc_float.o ac3tab.o ac3.o kbdwin.o ac3enc.o
|
||||||
ac3.o kbdwin.o
|
OBJS-$(CONFIG_AC3_FLOAT_ENCODER) += ac3enc_float.o ac3tab.o ac3tab.o ac3.o kbdwin.o
|
||||||
OBJS-$(CONFIG_AC3_FIXED_ENCODER) += ac3enc_fixed.o ac3enc.o ac3tab.o ac3.o
|
OBJS-$(CONFIG_AC3_FIXED_ENCODER) += ac3enc_fixed.o ac3tab.o ac3tab.o ac3.o ac3enc.o
|
||||||
OBJS-$(CONFIG_ALAC_DECODER) += alac.o
|
OBJS-$(CONFIG_ALAC_DECODER) += alac.o
|
||||||
OBJS-$(CONFIG_ALAC_ENCODER) += alacenc.o
|
OBJS-$(CONFIG_ALAC_ENCODER) += alacenc.o
|
||||||
OBJS-$(CONFIG_ALS_DECODER) += alsdec.o bgmc.o mpeg4audio.o
|
OBJS-$(CONFIG_ALS_DECODER) += alsdec.o bgmc.o mpeg4audio.o
|
||||||
@@ -91,19 +91,14 @@ OBJS-$(CONFIG_ATRAC1_DECODER) += atrac1.o atrac.o
|
|||||||
OBJS-$(CONFIG_ATRAC3_DECODER) += atrac3.o atrac.o
|
OBJS-$(CONFIG_ATRAC3_DECODER) += atrac3.o atrac.o
|
||||||
OBJS-$(CONFIG_AURA_DECODER) += cyuv.o
|
OBJS-$(CONFIG_AURA_DECODER) += cyuv.o
|
||||||
OBJS-$(CONFIG_AURA2_DECODER) += aura.o
|
OBJS-$(CONFIG_AURA2_DECODER) += aura.o
|
||||||
OBJS-$(CONFIG_AVRP_DECODER) += r210dec.o
|
|
||||||
OBJS-$(CONFIG_AVRP_ENCODER) += r210enc.o
|
|
||||||
OBJS-$(CONFIG_AVS_DECODER) += avs.o
|
OBJS-$(CONFIG_AVS_DECODER) += avs.o
|
||||||
OBJS-$(CONFIG_BETHSOFTVID_DECODER) += bethsoftvideo.o
|
OBJS-$(CONFIG_BETHSOFTVID_DECODER) += bethsoftvideo.o
|
||||||
OBJS-$(CONFIG_BFI_DECODER) += bfi.o
|
OBJS-$(CONFIG_BFI_DECODER) += bfi.o
|
||||||
OBJS-$(CONFIG_BINK_DECODER) += bink.o binkdsp.o
|
OBJS-$(CONFIG_BINK_DECODER) += bink.o binkidct.o
|
||||||
OBJS-$(CONFIG_BINKAUDIO_DCT_DECODER) += binkaudio.o wma.o
|
OBJS-$(CONFIG_BINKAUDIO_DCT_DECODER) += binkaudio.o wma.o
|
||||||
OBJS-$(CONFIG_BINKAUDIO_RDFT_DECODER) += binkaudio.o wma.o
|
OBJS-$(CONFIG_BINKAUDIO_RDFT_DECODER) += binkaudio.o wma.o
|
||||||
OBJS-$(CONFIG_BINTEXT_DECODER) += bintext.o cga_data.o
|
|
||||||
OBJS-$(CONFIG_BMP_DECODER) += bmp.o msrledec.o
|
OBJS-$(CONFIG_BMP_DECODER) += bmp.o msrledec.o
|
||||||
OBJS-$(CONFIG_BMP_ENCODER) += bmpenc.o
|
OBJS-$(CONFIG_BMP_ENCODER) += bmpenc.o
|
||||||
OBJS-$(CONFIG_BMV_VIDEO_DECODER) += bmv.o
|
|
||||||
OBJS-$(CONFIG_BMV_AUDIO_DECODER) += bmv.o
|
|
||||||
OBJS-$(CONFIG_C93_DECODER) += c93.o
|
OBJS-$(CONFIG_C93_DECODER) += c93.o
|
||||||
OBJS-$(CONFIG_CAVS_DECODER) += cavs.o cavsdec.o cavsdsp.o \
|
OBJS-$(CONFIG_CAVS_DECODER) += cavs.o cavsdec.o cavsdsp.o \
|
||||||
mpeg12data.o mpegvideo.o
|
mpeg12data.o mpegvideo.o
|
||||||
@@ -116,8 +111,6 @@ OBJS-$(CONFIG_CSCD_DECODER) += cscd.o
|
|||||||
OBJS-$(CONFIG_CYUV_DECODER) += cyuv.o
|
OBJS-$(CONFIG_CYUV_DECODER) += cyuv.o
|
||||||
OBJS-$(CONFIG_DCA_DECODER) += dca.o synth_filter.o dcadsp.o
|
OBJS-$(CONFIG_DCA_DECODER) += dca.o synth_filter.o dcadsp.o
|
||||||
OBJS-$(CONFIG_DCA_ENCODER) += dcaenc.o
|
OBJS-$(CONFIG_DCA_ENCODER) += dcaenc.o
|
||||||
OBJS-$(CONFIG_DIRAC_DECODER) += diracdec.o dirac.o diracdsp.o \
|
|
||||||
dirac_arith.o mpeg12data.o dwt.o
|
|
||||||
OBJS-$(CONFIG_DFA_DECODER) += dfa.o
|
OBJS-$(CONFIG_DFA_DECODER) += dfa.o
|
||||||
OBJS-$(CONFIG_DNXHD_DECODER) += dnxhddec.o dnxhddata.o
|
OBJS-$(CONFIG_DNXHD_DECODER) += dnxhddec.o dnxhddata.o
|
||||||
OBJS-$(CONFIG_DNXHD_ENCODER) += dnxhdenc.o dnxhddata.o \
|
OBJS-$(CONFIG_DNXHD_ENCODER) += dnxhdenc.o dnxhddata.o \
|
||||||
@@ -135,10 +128,9 @@ OBJS-$(CONFIG_DVDSUB_ENCODER) += dvdsubenc.o
|
|||||||
OBJS-$(CONFIG_DVVIDEO_DECODER) += dv.o dvdata.o
|
OBJS-$(CONFIG_DVVIDEO_DECODER) += dv.o dvdata.o
|
||||||
OBJS-$(CONFIG_DVVIDEO_ENCODER) += dv.o dvdata.o
|
OBJS-$(CONFIG_DVVIDEO_ENCODER) += dv.o dvdata.o
|
||||||
OBJS-$(CONFIG_DXA_DECODER) += dxa.o
|
OBJS-$(CONFIG_DXA_DECODER) += dxa.o
|
||||||
OBJS-$(CONFIG_DXTORY_DECODER) += dxtory.o
|
OBJS-$(CONFIG_EAC3_DECODER) += eac3dec.o eac3dec_data.o
|
||||||
OBJS-$(CONFIG_EAC3_DECODER) += eac3dec.o eac3_data.o
|
|
||||||
OBJS-$(CONFIG_EAC3_ENCODER) += eac3enc.o ac3enc.o ac3enc_float.o \
|
OBJS-$(CONFIG_EAC3_ENCODER) += eac3enc.o ac3enc.o ac3enc_float.o \
|
||||||
ac3tab.o ac3.o kbdwin.o eac3_data.o
|
ac3tab.o ac3.o kbdwin.o
|
||||||
OBJS-$(CONFIG_EACMV_DECODER) += eacmv.o
|
OBJS-$(CONFIG_EACMV_DECODER) += eacmv.o
|
||||||
OBJS-$(CONFIG_EAMAD_DECODER) += eamad.o eaidct.o mpeg12.o \
|
OBJS-$(CONFIG_EAMAD_DECODER) += eamad.o eaidct.o mpeg12.o \
|
||||||
mpeg12data.o mpegvideo.o \
|
mpeg12data.o mpegvideo.o \
|
||||||
@@ -153,26 +145,19 @@ OBJS-$(CONFIG_EIGHTSVX_EXP_DECODER) += 8svx.o
|
|||||||
OBJS-$(CONFIG_EIGHTSVX_FIB_DECODER) += 8svx.o
|
OBJS-$(CONFIG_EIGHTSVX_FIB_DECODER) += 8svx.o
|
||||||
OBJS-$(CONFIG_EIGHTSVX_RAW_DECODER) += 8svx.o
|
OBJS-$(CONFIG_EIGHTSVX_RAW_DECODER) += 8svx.o
|
||||||
OBJS-$(CONFIG_ESCAPE124_DECODER) += escape124.o
|
OBJS-$(CONFIG_ESCAPE124_DECODER) += escape124.o
|
||||||
OBJS-$(CONFIG_ESCAPE130_DECODER) += escape130.o
|
|
||||||
OBJS-$(CONFIG_FFV1_DECODER) += ffv1.o rangecoder.o
|
OBJS-$(CONFIG_FFV1_DECODER) += ffv1.o rangecoder.o
|
||||||
OBJS-$(CONFIG_FFV1_ENCODER) += ffv1.o rangecoder.o
|
OBJS-$(CONFIG_FFV1_ENCODER) += ffv1.o rangecoder.o
|
||||||
OBJS-$(CONFIG_FFVHUFF_DECODER) += huffyuv.o
|
OBJS-$(CONFIG_FFVHUFF_DECODER) += huffyuv.o
|
||||||
OBJS-$(CONFIG_FFVHUFF_ENCODER) += huffyuv.o
|
OBJS-$(CONFIG_FFVHUFF_ENCODER) += huffyuv.o
|
||||||
OBJS-$(CONFIG_FFWAVESYNTH_DECODER) += ffwavesynth.o
|
|
||||||
OBJS-$(CONFIG_FLAC_DECODER) += flacdec.o flacdata.o flac.o vorbis_data.o
|
OBJS-$(CONFIG_FLAC_DECODER) += flacdec.o flacdata.o flac.o vorbis_data.o
|
||||||
OBJS-$(CONFIG_FLAC_ENCODER) += flacenc.o flacdata.o flac.o vorbis_data.o
|
OBJS-$(CONFIG_FLAC_ENCODER) += flacenc.o flacdata.o flac.o vorbis_data.o
|
||||||
OBJS-$(CONFIG_FLASHSV_DECODER) += flashsv.o
|
OBJS-$(CONFIG_FLASHSV_DECODER) += flashsv.o
|
||||||
OBJS-$(CONFIG_FLASHSV_ENCODER) += flashsvenc.o
|
OBJS-$(CONFIG_FLASHSV_ENCODER) += flashsvenc.o
|
||||||
OBJS-$(CONFIG_FLASHSV2_ENCODER) += flashsv2enc.o
|
OBJS-$(CONFIG_FLASHSV2_ENCODER) += flashsv2enc.o
|
||||||
OBJS-$(CONFIG_FLASHSV2_DECODER) += flashsv.o
|
|
||||||
OBJS-$(CONFIG_FLIC_DECODER) += flicvideo.o
|
OBJS-$(CONFIG_FLIC_DECODER) += flicvideo.o
|
||||||
OBJS-$(CONFIG_FOURXM_DECODER) += 4xm.o
|
OBJS-$(CONFIG_FOURXM_DECODER) += 4xm.o
|
||||||
OBJS-$(CONFIG_FRAPS_DECODER) += fraps.o
|
OBJS-$(CONFIG_FRAPS_DECODER) += fraps.o
|
||||||
OBJS-$(CONFIG_FRWU_DECODER) += frwu.o
|
OBJS-$(CONFIG_FRWU_DECODER) += frwu.o
|
||||||
OBJS-$(CONFIG_G723_1_DECODER) += g723_1.o acelp_vectors.o \
|
|
||||||
celp_filters.o celp_math.o
|
|
||||||
OBJS-$(CONFIG_G723_1_ENCODER) += g723_1.o
|
|
||||||
OBJS-$(CONFIG_G729_DECODER) += g729dec.o lsp.o celp_math.o acelp_filters.o acelp_pitch_delay.o acelp_vectors.o g729postfilter.o
|
|
||||||
OBJS-$(CONFIG_GIF_DECODER) += gifdec.o lzw.o
|
OBJS-$(CONFIG_GIF_DECODER) += gifdec.o lzw.o
|
||||||
OBJS-$(CONFIG_GIF_ENCODER) += gif.o lzwenc.o
|
OBJS-$(CONFIG_GIF_ENCODER) += gif.o lzwenc.o
|
||||||
OBJS-$(CONFIG_GSM_DECODER) += gsmdec.o gsmdec_data.o msgsmdec.o
|
OBJS-$(CONFIG_GSM_DECODER) += gsmdec.o gsmdec_data.o msgsmdec.o
|
||||||
@@ -200,22 +185,19 @@ OBJS-$(CONFIG_H264_DECODER) += h264.o \
|
|||||||
mpegvideo.o error_resilience.o
|
mpegvideo.o error_resilience.o
|
||||||
OBJS-$(CONFIG_H264_DXVA2_HWACCEL) += dxva2_h264.o
|
OBJS-$(CONFIG_H264_DXVA2_HWACCEL) += dxva2_h264.o
|
||||||
OBJS-$(CONFIG_H264_VAAPI_HWACCEL) += vaapi_h264.o
|
OBJS-$(CONFIG_H264_VAAPI_HWACCEL) += vaapi_h264.o
|
||||||
OBJS-$(CONFIG_H264_VDA_HWACCEL) += vda_h264.o
|
|
||||||
OBJS-$(CONFIG_HUFFYUV_DECODER) += huffyuv.o
|
OBJS-$(CONFIG_HUFFYUV_DECODER) += huffyuv.o
|
||||||
OBJS-$(CONFIG_HUFFYUV_ENCODER) += huffyuv.o
|
OBJS-$(CONFIG_HUFFYUV_ENCODER) += huffyuv.o
|
||||||
OBJS-$(CONFIG_IDCIN_DECODER) += idcinvideo.o
|
OBJS-$(CONFIG_IDCIN_DECODER) += idcinvideo.o
|
||||||
OBJS-$(CONFIG_IDF_DECODER) += bintext.o cga_data.o
|
|
||||||
OBJS-$(CONFIG_IFF_BYTERUN1_DECODER) += iff.o
|
OBJS-$(CONFIG_IFF_BYTERUN1_DECODER) += iff.o
|
||||||
OBJS-$(CONFIG_IFF_ILBM_DECODER) += iff.o
|
OBJS-$(CONFIG_IFF_ILBM_DECODER) += iff.o
|
||||||
OBJS-$(CONFIG_IMC_DECODER) += imc.o
|
OBJS-$(CONFIG_IMC_DECODER) += imc.o
|
||||||
OBJS-$(CONFIG_INDEO2_DECODER) += indeo2.o
|
OBJS-$(CONFIG_INDEO2_DECODER) += indeo2.o
|
||||||
OBJS-$(CONFIG_INDEO3_DECODER) += indeo3.o
|
OBJS-$(CONFIG_INDEO3_DECODER) += indeo3.o
|
||||||
OBJS-$(CONFIG_INDEO4_DECODER) += indeo4.o ivi_common.o ivi_dsp.o
|
|
||||||
OBJS-$(CONFIG_INDEO5_DECODER) += indeo5.o ivi_common.o ivi_dsp.o
|
OBJS-$(CONFIG_INDEO5_DECODER) += indeo5.o ivi_common.o ivi_dsp.o
|
||||||
OBJS-$(CONFIG_INTERPLAY_DPCM_DECODER) += dpcm.o
|
OBJS-$(CONFIG_INTERPLAY_DPCM_DECODER) += dpcm.o
|
||||||
OBJS-$(CONFIG_INTERPLAY_VIDEO_DECODER) += interplayvideo.o
|
OBJS-$(CONFIG_INTERPLAY_VIDEO_DECODER) += interplayvideo.o
|
||||||
OBJS-$(CONFIG_JPEG2000_DECODER) += j2kdec.o mqcdec.o mqc.o j2k.o j2k_dwt.o
|
OBJS-$(CONFIG_JPEG2000_DECODER) += j2kdec.o mqcdec.o mqc.o j2k.o j2k_dwt.o
|
||||||
OBJS-$(CONFIG_JPEG2000_ENCODER) += j2kenc.o mqcenc.o mqc.o j2k.o j2k_dwt.o
|
#OBJS-$(CONFIG_JPEG2000_ENCODER) += j2kenc.o mqcenc.o mqc.o j2k.o j2k_dwt.o
|
||||||
OBJS-$(CONFIG_JPEGLS_DECODER) += jpeglsdec.o jpegls.o \
|
OBJS-$(CONFIG_JPEGLS_DECODER) += jpeglsdec.o jpegls.o \
|
||||||
mjpegdec.o mjpeg.o
|
mjpegdec.o mjpeg.o
|
||||||
OBJS-$(CONFIG_JPEGLS_ENCODER) += jpeglsenc.o jpegls.o
|
OBJS-$(CONFIG_JPEGLS_ENCODER) += jpeglsenc.o jpegls.o
|
||||||
@@ -278,7 +260,6 @@ OBJS-$(CONFIG_MPEG_XVMC_DECODER) += mpegvideo_xvmc.o
|
|||||||
OBJS-$(CONFIG_MPEG1VIDEO_DECODER) += mpeg12.o mpeg12data.o \
|
OBJS-$(CONFIG_MPEG1VIDEO_DECODER) += mpeg12.o mpeg12data.o \
|
||||||
mpegvideo.o error_resilience.o
|
mpegvideo.o error_resilience.o
|
||||||
OBJS-$(CONFIG_MPEG1VIDEO_ENCODER) += mpeg12enc.o mpegvideo_enc.o \
|
OBJS-$(CONFIG_MPEG1VIDEO_ENCODER) += mpeg12enc.o mpegvideo_enc.o \
|
||||||
timecode.o \
|
|
||||||
motion_est.o ratecontrol.o \
|
motion_est.o ratecontrol.o \
|
||||||
mpeg12.o mpeg12data.o \
|
mpeg12.o mpeg12data.o \
|
||||||
mpegvideo.o error_resilience.o
|
mpegvideo.o error_resilience.o
|
||||||
@@ -287,7 +268,6 @@ OBJS-$(CONFIG_MPEG2_VAAPI_HWACCEL) += vaapi_mpeg2.o
|
|||||||
OBJS-$(CONFIG_MPEG2VIDEO_DECODER) += mpeg12.o mpeg12data.o \
|
OBJS-$(CONFIG_MPEG2VIDEO_DECODER) += mpeg12.o mpeg12data.o \
|
||||||
mpegvideo.o error_resilience.o
|
mpegvideo.o error_resilience.o
|
||||||
OBJS-$(CONFIG_MPEG2VIDEO_ENCODER) += mpeg12enc.o mpegvideo_enc.o \
|
OBJS-$(CONFIG_MPEG2VIDEO_ENCODER) += mpeg12enc.o mpegvideo_enc.o \
|
||||||
timecode.o \
|
|
||||||
motion_est.o ratecontrol.o \
|
motion_est.o ratecontrol.o \
|
||||||
mpeg12.o mpeg12data.o \
|
mpeg12.o mpeg12data.o \
|
||||||
mpegvideo.o error_resilience.o
|
mpegvideo.o error_resilience.o
|
||||||
@@ -325,9 +305,6 @@ OBJS-$(CONFIG_PNG_DECODER) += png.o pngdec.o
|
|||||||
OBJS-$(CONFIG_PNG_ENCODER) += png.o pngenc.o
|
OBJS-$(CONFIG_PNG_ENCODER) += png.o pngenc.o
|
||||||
OBJS-$(CONFIG_PPM_DECODER) += pnmdec.o pnm.o
|
OBJS-$(CONFIG_PPM_DECODER) += pnmdec.o pnm.o
|
||||||
OBJS-$(CONFIG_PPM_ENCODER) += pnmenc.o pnm.o
|
OBJS-$(CONFIG_PPM_ENCODER) += pnmenc.o pnm.o
|
||||||
OBJS-$(CONFIG_PRORES_DECODER) += proresdec2.o
|
|
||||||
OBJS-$(CONFIG_PRORES_LGPL_DECODER) += proresdec_lgpl.o proresdsp.o
|
|
||||||
OBJS-$(CONFIG_PRORES_ENCODER) += proresenc.o
|
|
||||||
OBJS-$(CONFIG_PTX_DECODER) += ptx.o
|
OBJS-$(CONFIG_PTX_DECODER) += ptx.o
|
||||||
OBJS-$(CONFIG_QCELP_DECODER) += qcelpdec.o celp_math.o \
|
OBJS-$(CONFIG_QCELP_DECODER) += qcelpdec.o celp_math.o \
|
||||||
celp_filters.o acelp_vectors.o \
|
celp_filters.o acelp_vectors.o \
|
||||||
@@ -340,9 +317,7 @@ OBJS-$(CONFIG_QPEG_DECODER) += qpeg.o
|
|||||||
OBJS-$(CONFIG_QTRLE_DECODER) += qtrle.o
|
OBJS-$(CONFIG_QTRLE_DECODER) += qtrle.o
|
||||||
OBJS-$(CONFIG_QTRLE_ENCODER) += qtrleenc.o
|
OBJS-$(CONFIG_QTRLE_ENCODER) += qtrleenc.o
|
||||||
OBJS-$(CONFIG_R10K_DECODER) += r210dec.o
|
OBJS-$(CONFIG_R10K_DECODER) += r210dec.o
|
||||||
OBJS-$(CONFIG_R10K_ENCODER) += r210enc.o
|
|
||||||
OBJS-$(CONFIG_R210_DECODER) += r210dec.o
|
OBJS-$(CONFIG_R210_DECODER) += r210dec.o
|
||||||
OBJS-$(CONFIG_R210_ENCODER) += r210enc.o
|
|
||||||
OBJS-$(CONFIG_RA_144_DECODER) += ra144dec.o ra144.o celp_filters.o
|
OBJS-$(CONFIG_RA_144_DECODER) += ra144dec.o ra144.o celp_filters.o
|
||||||
OBJS-$(CONFIG_RA_144_ENCODER) += ra144enc.o ra144.o celp_filters.o
|
OBJS-$(CONFIG_RA_144_ENCODER) += ra144enc.o ra144.o celp_filters.o
|
||||||
OBJS-$(CONFIG_RA_288_DECODER) += ra288.o celp_math.o celp_filters.o
|
OBJS-$(CONFIG_RA_288_DECODER) += ra288.o celp_math.o celp_filters.o
|
||||||
@@ -358,9 +333,9 @@ OBJS-$(CONFIG_RV10_DECODER) += rv10.o
|
|||||||
OBJS-$(CONFIG_RV10_ENCODER) += rv10enc.o
|
OBJS-$(CONFIG_RV10_ENCODER) += rv10enc.o
|
||||||
OBJS-$(CONFIG_RV20_DECODER) += rv10.o
|
OBJS-$(CONFIG_RV20_DECODER) += rv10.o
|
||||||
OBJS-$(CONFIG_RV20_ENCODER) += rv20enc.o
|
OBJS-$(CONFIG_RV20_ENCODER) += rv20enc.o
|
||||||
OBJS-$(CONFIG_RV30_DECODER) += rv30.o rv34.o rv30dsp.o rv34dsp.o \
|
OBJS-$(CONFIG_RV30_DECODER) += rv30.o rv34.o rv30dsp.o \
|
||||||
mpegvideo.o error_resilience.o
|
mpegvideo.o error_resilience.o
|
||||||
OBJS-$(CONFIG_RV40_DECODER) += rv40.o rv34.o rv34dsp.o rv40dsp.o \
|
OBJS-$(CONFIG_RV40_DECODER) += rv40.o rv34.o rv40dsp.o \
|
||||||
mpegvideo.o error_resilience.o
|
mpegvideo.o error_resilience.o
|
||||||
OBJS-$(CONFIG_S302M_DECODER) += s302m.o
|
OBJS-$(CONFIG_S302M_DECODER) += s302m.o
|
||||||
OBJS-$(CONFIG_SGI_DECODER) += sgidec.o
|
OBJS-$(CONFIG_SGI_DECODER) += sgidec.o
|
||||||
@@ -373,12 +348,12 @@ OBJS-$(CONFIG_SIPR_DECODER) += sipr.o acelp_pitch_delay.o \
|
|||||||
OBJS-$(CONFIG_SMACKAUD_DECODER) += smacker.o
|
OBJS-$(CONFIG_SMACKAUD_DECODER) += smacker.o
|
||||||
OBJS-$(CONFIG_SMACKER_DECODER) += smacker.o
|
OBJS-$(CONFIG_SMACKER_DECODER) += smacker.o
|
||||||
OBJS-$(CONFIG_SMC_DECODER) += smc.o
|
OBJS-$(CONFIG_SMC_DECODER) += smc.o
|
||||||
OBJS-$(CONFIG_SNOW_DECODER) += snowdec.o snow.o rangecoder.o
|
OBJS-$(CONFIG_SNOW_DECODER) += snow.o rangecoder.o
|
||||||
OBJS-$(CONFIG_SNOW_ENCODER) += snowenc.o snow.o rangecoder.o \
|
OBJS-$(CONFIG_SNOW_ENCODER) += snow.o rangecoder.o motion_est.o \
|
||||||
motion_est.o ratecontrol.o \
|
ratecontrol.o h263.o \
|
||||||
h263.o mpegvideo.o \
|
mpegvideo.o error_resilience.o \
|
||||||
error_resilience.o ituh263enc.o \
|
ituh263enc.o mpegvideo_enc.o \
|
||||||
mpegvideo_enc.o mpeg12data.o
|
mpeg12data.o
|
||||||
OBJS-$(CONFIG_SOL_DPCM_DECODER) += dpcm.o
|
OBJS-$(CONFIG_SOL_DPCM_DECODER) += dpcm.o
|
||||||
OBJS-$(CONFIG_SONIC_DECODER) += sonic.o
|
OBJS-$(CONFIG_SONIC_DECODER) += sonic.o
|
||||||
OBJS-$(CONFIG_SONIC_ENCODER) += sonic.o
|
OBJS-$(CONFIG_SONIC_ENCODER) += sonic.o
|
||||||
@@ -416,16 +391,10 @@ OBJS-$(CONFIG_TTA_DECODER) += tta.o
|
|||||||
OBJS-$(CONFIG_TWINVQ_DECODER) += twinvq.o celp_math.o
|
OBJS-$(CONFIG_TWINVQ_DECODER) += twinvq.o celp_math.o
|
||||||
OBJS-$(CONFIG_TXD_DECODER) += txd.o s3tc.o
|
OBJS-$(CONFIG_TXD_DECODER) += txd.o s3tc.o
|
||||||
OBJS-$(CONFIG_ULTI_DECODER) += ulti.o
|
OBJS-$(CONFIG_ULTI_DECODER) += ulti.o
|
||||||
OBJS-$(CONFIG_UTVIDEO_DECODER) += utvideo.o
|
|
||||||
OBJS-$(CONFIG_V210_DECODER) += v210dec.o
|
OBJS-$(CONFIG_V210_DECODER) += v210dec.o
|
||||||
OBJS-$(CONFIG_V210_ENCODER) += v210enc.o
|
OBJS-$(CONFIG_V210_ENCODER) += v210enc.o
|
||||||
OBJS-$(CONFIG_V308_DECODER) += v308dec.o
|
|
||||||
OBJS-$(CONFIG_V308_ENCODER) += v308enc.o
|
|
||||||
OBJS-$(CONFIG_V410_DECODER) += v410dec.o
|
|
||||||
OBJS-$(CONFIG_V410_ENCODER) += v410enc.o
|
|
||||||
OBJS-$(CONFIG_V210X_DECODER) += v210x.o
|
OBJS-$(CONFIG_V210X_DECODER) += v210x.o
|
||||||
OBJS-$(CONFIG_VB_DECODER) += vb.o
|
OBJS-$(CONFIG_VB_DECODER) += vb.o
|
||||||
OBJS-$(CONFIG_VBLE_DECODER) += vble.o
|
|
||||||
OBJS-$(CONFIG_VC1_DECODER) += vc1dec.o vc1.o vc1data.o vc1dsp.o \
|
OBJS-$(CONFIG_VC1_DECODER) += vc1dec.o vc1.o vc1data.o vc1dsp.o \
|
||||||
msmpeg4.o msmpeg4data.o \
|
msmpeg4.o msmpeg4data.o \
|
||||||
intrax8.o intrax8dsp.o
|
intrax8.o intrax8dsp.o
|
||||||
@@ -448,7 +417,6 @@ OBJS-$(CONFIG_VP6_DECODER) += vp6.o vp56.o vp56data.o vp56dsp.o \
|
|||||||
OBJS-$(CONFIG_VP8_DECODER) += vp8.o vp8dsp.o vp56rac.o
|
OBJS-$(CONFIG_VP8_DECODER) += vp8.o vp8dsp.o vp56rac.o
|
||||||
OBJS-$(CONFIG_VQA_DECODER) += vqavideo.o
|
OBJS-$(CONFIG_VQA_DECODER) += vqavideo.o
|
||||||
OBJS-$(CONFIG_WAVPACK_DECODER) += wavpack.o
|
OBJS-$(CONFIG_WAVPACK_DECODER) += wavpack.o
|
||||||
OBJS-$(CONFIG_WMALOSSLESS_DECODER) += wmalosslessdec.o wma.o
|
|
||||||
OBJS-$(CONFIG_WMAPRO_DECODER) += wmaprodec.o wma.o
|
OBJS-$(CONFIG_WMAPRO_DECODER) += wmaprodec.o wma.o
|
||||||
OBJS-$(CONFIG_WMAV1_DECODER) += wmadec.o wma.o aactab.o
|
OBJS-$(CONFIG_WMAV1_DECODER) += wmadec.o wma.o aactab.o
|
||||||
OBJS-$(CONFIG_WMAV1_ENCODER) += wmaenc.o wma.o aactab.o
|
OBJS-$(CONFIG_WMAV1_ENCODER) += wmaenc.o wma.o aactab.o
|
||||||
@@ -469,17 +437,10 @@ OBJS-$(CONFIG_WS_SND1_DECODER) += ws-snd1.o
|
|||||||
OBJS-$(CONFIG_XAN_DPCM_DECODER) += dpcm.o
|
OBJS-$(CONFIG_XAN_DPCM_DECODER) += dpcm.o
|
||||||
OBJS-$(CONFIG_XAN_WC3_DECODER) += xan.o
|
OBJS-$(CONFIG_XAN_WC3_DECODER) += xan.o
|
||||||
OBJS-$(CONFIG_XAN_WC4_DECODER) += xxan.o
|
OBJS-$(CONFIG_XAN_WC4_DECODER) += xxan.o
|
||||||
OBJS-$(CONFIG_XBIN_DECODER) += bintext.o cga_data.o
|
|
||||||
OBJS-$(CONFIG_XL_DECODER) += xl.o
|
OBJS-$(CONFIG_XL_DECODER) += xl.o
|
||||||
OBJS-$(CONFIG_XSUB_DECODER) += xsubdec.o
|
OBJS-$(CONFIG_XSUB_DECODER) += xsubdec.o
|
||||||
OBJS-$(CONFIG_XSUB_ENCODER) += xsubenc.o
|
OBJS-$(CONFIG_XSUB_ENCODER) += xsubenc.o
|
||||||
OBJS-$(CONFIG_XWD_DECODER) += xwddec.o
|
|
||||||
OBJS-$(CONFIG_XWD_ENCODER) += xwdenc.o
|
|
||||||
OBJS-$(CONFIG_Y41P_DECODER) += y41pdec.o
|
|
||||||
OBJS-$(CONFIG_Y41P_ENCODER) += y41penc.o
|
|
||||||
OBJS-$(CONFIG_YOP_DECODER) += yop.o
|
OBJS-$(CONFIG_YOP_DECODER) += yop.o
|
||||||
OBJS-$(CONFIG_YUV4_DECODER) += yuv4dec.o
|
|
||||||
OBJS-$(CONFIG_YUV4_ENCODER) += yuv4enc.o
|
|
||||||
OBJS-$(CONFIG_ZLIB_DECODER) += lcldec.o
|
OBJS-$(CONFIG_ZLIB_DECODER) += lcldec.o
|
||||||
OBJS-$(CONFIG_ZLIB_ENCODER) += lclenc.o
|
OBJS-$(CONFIG_ZLIB_ENCODER) += lclenc.o
|
||||||
OBJS-$(CONFIG_ZMBV_DECODER) += zmbv.o
|
OBJS-$(CONFIG_ZMBV_DECODER) += zmbv.o
|
||||||
@@ -504,7 +465,6 @@ OBJS-$(CONFIG_PCM_MULAW_DECODER) += pcm.o
|
|||||||
OBJS-$(CONFIG_PCM_MULAW_ENCODER) += pcm.o
|
OBJS-$(CONFIG_PCM_MULAW_ENCODER) += pcm.o
|
||||||
OBJS-$(CONFIG_PCM_S8_DECODER) += pcm.o
|
OBJS-$(CONFIG_PCM_S8_DECODER) += pcm.o
|
||||||
OBJS-$(CONFIG_PCM_S8_ENCODER) += pcm.o
|
OBJS-$(CONFIG_PCM_S8_ENCODER) += pcm.o
|
||||||
OBJS-$(CONFIG_PCM_S8_PLANAR_DECODER) += 8svx.o
|
|
||||||
OBJS-$(CONFIG_PCM_S16BE_DECODER) += pcm.o
|
OBJS-$(CONFIG_PCM_S16BE_DECODER) += pcm.o
|
||||||
OBJS-$(CONFIG_PCM_S16BE_ENCODER) += pcm.o
|
OBJS-$(CONFIG_PCM_S16BE_ENCODER) += pcm.o
|
||||||
OBJS-$(CONFIG_PCM_S16LE_DECODER) += pcm.o
|
OBJS-$(CONFIG_PCM_S16LE_DECODER) += pcm.o
|
||||||
@@ -535,70 +495,66 @@ OBJS-$(CONFIG_PCM_U32BE_ENCODER) += pcm.o
|
|||||||
OBJS-$(CONFIG_PCM_U32LE_DECODER) += pcm.o
|
OBJS-$(CONFIG_PCM_U32LE_DECODER) += pcm.o
|
||||||
OBJS-$(CONFIG_PCM_U32LE_ENCODER) += pcm.o
|
OBJS-$(CONFIG_PCM_U32LE_ENCODER) += pcm.o
|
||||||
OBJS-$(CONFIG_PCM_ZORK_DECODER) += pcm.o
|
OBJS-$(CONFIG_PCM_ZORK_DECODER) += pcm.o
|
||||||
|
OBJS-$(CONFIG_PCM_ZORK_ENCODER) += pcm.o
|
||||||
|
|
||||||
OBJS-$(CONFIG_ADPCM_4XM_DECODER) += adpcm.o adpcm_data.o
|
OBJS-$(CONFIG_ADPCM_4XM_DECODER) += adpcm.o
|
||||||
OBJS-$(CONFIG_ADPCM_ADX_DECODER) += adxdec.o adx.o
|
OBJS-$(CONFIG_ADPCM_ADX_DECODER) += adxdec.o
|
||||||
OBJS-$(CONFIG_ADPCM_ADX_ENCODER) += adxenc.o adx.o
|
OBJS-$(CONFIG_ADPCM_ADX_ENCODER) += adxenc.o
|
||||||
OBJS-$(CONFIG_ADPCM_CT_DECODER) += adpcm.o adpcm_data.o
|
OBJS-$(CONFIG_ADPCM_CT_DECODER) += adpcm.o
|
||||||
OBJS-$(CONFIG_ADPCM_EA_DECODER) += adpcm.o adpcm_data.o
|
OBJS-$(CONFIG_ADPCM_EA_DECODER) += adpcm.o
|
||||||
OBJS-$(CONFIG_ADPCM_EA_MAXIS_XA_DECODER) += adpcm.o adpcm_data.o
|
OBJS-$(CONFIG_ADPCM_EA_MAXIS_XA_DECODER) += adpcm.o
|
||||||
OBJS-$(CONFIG_ADPCM_EA_R1_DECODER) += adpcm.o adpcm_data.o
|
OBJS-$(CONFIG_ADPCM_EA_R1_DECODER) += adpcm.o
|
||||||
OBJS-$(CONFIG_ADPCM_EA_R2_DECODER) += adpcm.o adpcm_data.o
|
OBJS-$(CONFIG_ADPCM_EA_R2_DECODER) += adpcm.o
|
||||||
OBJS-$(CONFIG_ADPCM_EA_R3_DECODER) += adpcm.o adpcm_data.o
|
OBJS-$(CONFIG_ADPCM_EA_R3_DECODER) += adpcm.o
|
||||||
OBJS-$(CONFIG_ADPCM_EA_XAS_DECODER) += adpcm.o adpcm_data.o
|
OBJS-$(CONFIG_ADPCM_EA_XAS_DECODER) += adpcm.o
|
||||||
OBJS-$(CONFIG_ADPCM_G722_DECODER) += g722.o g722dec.o
|
OBJS-$(CONFIG_ADPCM_G722_DECODER) += g722.o
|
||||||
OBJS-$(CONFIG_ADPCM_G722_ENCODER) += g722.o g722enc.o
|
OBJS-$(CONFIG_ADPCM_G722_ENCODER) += g722.o
|
||||||
OBJS-$(CONFIG_ADPCM_G726_DECODER) += g726.o
|
OBJS-$(CONFIG_ADPCM_G726_DECODER) += g726.o
|
||||||
OBJS-$(CONFIG_ADPCM_G726_ENCODER) += g726.o
|
OBJS-$(CONFIG_ADPCM_G726_ENCODER) += g726.o
|
||||||
OBJS-$(CONFIG_ADPCM_IMA_AMV_DECODER) += adpcm.o adpcm_data.o
|
OBJS-$(CONFIG_ADPCM_IMA_AMV_DECODER) += adpcm.o
|
||||||
OBJS-$(CONFIG_ADPCM_IMA_APC_DECODER) += adpcm.o adpcm_data.o
|
OBJS-$(CONFIG_ADPCM_IMA_DK3_DECODER) += adpcm.o
|
||||||
OBJS-$(CONFIG_ADPCM_IMA_DK3_DECODER) += adpcm.o adpcm_data.o
|
OBJS-$(CONFIG_ADPCM_IMA_DK4_DECODER) += adpcm.o
|
||||||
OBJS-$(CONFIG_ADPCM_IMA_DK4_DECODER) += adpcm.o adpcm_data.o
|
OBJS-$(CONFIG_ADPCM_IMA_EA_EACS_DECODER) += adpcm.o
|
||||||
OBJS-$(CONFIG_ADPCM_IMA_EA_EACS_DECODER) += adpcm.o adpcm_data.o
|
OBJS-$(CONFIG_ADPCM_IMA_EA_SEAD_DECODER) += adpcm.o
|
||||||
OBJS-$(CONFIG_ADPCM_IMA_EA_SEAD_DECODER) += adpcm.o adpcm_data.o
|
OBJS-$(CONFIG_ADPCM_IMA_ISS_DECODER) += adpcm.o
|
||||||
OBJS-$(CONFIG_ADPCM_IMA_ISS_DECODER) += adpcm.o adpcm_data.o
|
OBJS-$(CONFIG_ADPCM_IMA_QT_DECODER) += adpcm.o
|
||||||
OBJS-$(CONFIG_ADPCM_IMA_QT_DECODER) += adpcm.o adpcm_data.o
|
OBJS-$(CONFIG_ADPCM_IMA_QT_ENCODER) += adpcm.o
|
||||||
OBJS-$(CONFIG_ADPCM_IMA_QT_ENCODER) += adpcmenc.o adpcm_data.o
|
OBJS-$(CONFIG_ADPCM_IMA_SMJPEG_DECODER) += adpcm.o
|
||||||
OBJS-$(CONFIG_ADPCM_IMA_SMJPEG_DECODER) += adpcm.o adpcm_data.o
|
OBJS-$(CONFIG_ADPCM_IMA_WAV_DECODER) += adpcm.o
|
||||||
OBJS-$(CONFIG_ADPCM_IMA_WAV_DECODER) += adpcm.o adpcm_data.o
|
OBJS-$(CONFIG_ADPCM_IMA_WAV_ENCODER) += adpcm.o
|
||||||
OBJS-$(CONFIG_ADPCM_IMA_WAV_ENCODER) += adpcmenc.o adpcm_data.o
|
OBJS-$(CONFIG_ADPCM_IMA_WS_DECODER) += adpcm.o
|
||||||
OBJS-$(CONFIG_ADPCM_IMA_WS_DECODER) += adpcm.o adpcm_data.o
|
OBJS-$(CONFIG_ADPCM_MS_DECODER) += adpcm.o
|
||||||
OBJS-$(CONFIG_ADPCM_MS_DECODER) += adpcm.o adpcm_data.o
|
OBJS-$(CONFIG_ADPCM_MS_ENCODER) += adpcm.o
|
||||||
OBJS-$(CONFIG_ADPCM_MS_ENCODER) += adpcmenc.o adpcm_data.o
|
OBJS-$(CONFIG_ADPCM_SBPRO_2_DECODER) += adpcm.o
|
||||||
OBJS-$(CONFIG_ADPCM_SBPRO_2_DECODER) += adpcm.o adpcm_data.o
|
OBJS-$(CONFIG_ADPCM_SBPRO_3_DECODER) += adpcm.o
|
||||||
OBJS-$(CONFIG_ADPCM_SBPRO_3_DECODER) += adpcm.o adpcm_data.o
|
OBJS-$(CONFIG_ADPCM_SBPRO_4_DECODER) += adpcm.o
|
||||||
OBJS-$(CONFIG_ADPCM_SBPRO_4_DECODER) += adpcm.o adpcm_data.o
|
OBJS-$(CONFIG_ADPCM_SWF_DECODER) += adpcm.o
|
||||||
OBJS-$(CONFIG_ADPCM_SWF_DECODER) += adpcm.o adpcm_data.o
|
OBJS-$(CONFIG_ADPCM_SWF_ENCODER) += adpcm.o
|
||||||
OBJS-$(CONFIG_ADPCM_SWF_ENCODER) += adpcmenc.o adpcm_data.o
|
OBJS-$(CONFIG_ADPCM_THP_DECODER) += adpcm.o
|
||||||
OBJS-$(CONFIG_ADPCM_THP_DECODER) += adpcm.o adpcm_data.o
|
OBJS-$(CONFIG_ADPCM_XA_DECODER) += adpcm.o
|
||||||
OBJS-$(CONFIG_ADPCM_XA_DECODER) += adpcm.o adpcm_data.o
|
OBJS-$(CONFIG_ADPCM_YAMAHA_DECODER) += adpcm.o
|
||||||
OBJS-$(CONFIG_ADPCM_YAMAHA_DECODER) += adpcm.o adpcm_data.o
|
OBJS-$(CONFIG_ADPCM_YAMAHA_ENCODER) += adpcm.o
|
||||||
OBJS-$(CONFIG_ADPCM_YAMAHA_ENCODER) += adpcmenc.o adpcm_data.o
|
|
||||||
|
|
||||||
# libavformat dependencies
|
# libavformat dependencies
|
||||||
OBJS-$(CONFIG_ADTS_MUXER) += mpeg4audio.o
|
OBJS-$(CONFIG_ADTS_MUXER) += mpeg4audio.o
|
||||||
OBJS-$(CONFIG_ADX_DEMUXER) += adx.o
|
|
||||||
OBJS-$(CONFIG_CAF_DEMUXER) += mpeg4audio.o mpegaudiodata.o
|
OBJS-$(CONFIG_CAF_DEMUXER) += mpeg4audio.o mpegaudiodata.o
|
||||||
OBJS-$(CONFIG_DV_DEMUXER) += dvdata.o
|
OBJS-$(CONFIG_DV_DEMUXER) += dvdata.o
|
||||||
OBJS-$(CONFIG_DV_MUXER) += dvdata.o timecode.o
|
OBJS-$(CONFIG_DV_MUXER) += dvdata.o
|
||||||
OBJS-$(CONFIG_FLAC_DEMUXER) += flacdec.o flacdata.o flac.o vorbis_data.o
|
OBJS-$(CONFIG_FLAC_DEMUXER) += flacdec.o flacdata.o flac.o vorbis_data.o
|
||||||
OBJS-$(CONFIG_FLAC_MUXER) += flacdec.o flacdata.o flac.o vorbis_data.o
|
OBJS-$(CONFIG_FLAC_MUXER) += flacdec.o flacdata.o flac.o vorbis_data.o
|
||||||
OBJS-$(CONFIG_FLV_DEMUXER) += mpeg4audio.o
|
OBJS-$(CONFIG_FLV_DEMUXER) += mpeg4audio.o
|
||||||
OBJS-$(CONFIG_GXF_DEMUXER) += mpeg12data.o
|
OBJS-$(CONFIG_GXF_DEMUXER) += mpeg12data.o
|
||||||
OBJS-$(CONFIG_IFF_DEMUXER) += iff.o
|
OBJS-$(CONFIG_IFF_DEMUXER) += iff.o
|
||||||
OBJS-$(CONFIG_LATM_MUXER) += mpeg4audio.o
|
|
||||||
OBJS-$(CONFIG_MATROSKA_AUDIO_MUXER) += xiph.o mpeg4audio.o vorbis_data.o \
|
OBJS-$(CONFIG_MATROSKA_AUDIO_MUXER) += xiph.o mpeg4audio.o vorbis_data.o \
|
||||||
flacdec.o flacdata.o flac.o
|
flacdec.o flacdata.o flac.o
|
||||||
OBJS-$(CONFIG_MATROSKA_DEMUXER) += mpeg4audio.o mpegaudiodata.o
|
OBJS-$(CONFIG_MATROSKA_DEMUXER) += mpeg4audio.o mpegaudiodata.o
|
||||||
OBJS-$(CONFIG_MATROSKA_MUXER) += xiph.o mpeg4audio.o \
|
OBJS-$(CONFIG_MATROSKA_MUXER) += xiph.o mpeg4audio.o \
|
||||||
flacdec.o flacdata.o flac.o \
|
flacdec.o flacdata.o flac.o \
|
||||||
mpegaudiodata.o vorbis_data.o
|
mpegaudiodata.o vorbis_data.o
|
||||||
OBJS-$(CONFIG_MP3_MUXER) += mpegaudiodata.o mpegaudiodecheader.o
|
OBJS-$(CONFIG_MOV_DEMUXER) += mpeg4audio.o mpegaudiodata.o
|
||||||
OBJS-$(CONFIG_MOV_DEMUXER) += mpeg4audio.o mpegaudiodata.o timecode.o
|
|
||||||
OBJS-$(CONFIG_MOV_MUXER) += mpeg4audio.o mpegaudiodata.o
|
OBJS-$(CONFIG_MOV_MUXER) += mpeg4audio.o mpegaudiodata.o
|
||||||
OBJS-$(CONFIG_MPEGTS_MUXER) += mpegvideo.o mpeg4audio.o
|
OBJS-$(CONFIG_MPEGTS_MUXER) += mpegvideo.o mpeg4audio.o
|
||||||
OBJS-$(CONFIG_MPEGTS_DEMUXER) += mpeg4audio.o mpegaudiodata.o
|
OBJS-$(CONFIG_MPEGTS_DEMUXER) += mpeg4audio.o mpegaudiodata.o
|
||||||
OBJS-$(CONFIG_MXF_MUXER) += timecode.o
|
|
||||||
OBJS-$(CONFIG_NUT_MUXER) += mpegaudiodata.o
|
OBJS-$(CONFIG_NUT_MUXER) += mpegaudiodata.o
|
||||||
OBJS-$(CONFIG_OGG_DEMUXER) += flacdec.o flacdata.o flac.o \
|
OBJS-$(CONFIG_OGG_DEMUXER) += flacdec.o flacdata.o flac.o \
|
||||||
dirac.o mpeg12data.o vorbis_data.o
|
dirac.o mpeg12data.o vorbis_data.o
|
||||||
@@ -612,7 +568,6 @@ OBJS-$(CONFIG_WEBM_MUXER) += xiph.o mpeg4audio.o \
|
|||||||
OBJS-$(CONFIG_WTV_DEMUXER) += mpeg4audio.o mpegaudiodata.o
|
OBJS-$(CONFIG_WTV_DEMUXER) += mpeg4audio.o mpegaudiodata.o
|
||||||
|
|
||||||
# external codec libraries
|
# external codec libraries
|
||||||
OBJS-$(CONFIG_LIBAACPLUS_ENCODER) += libaacplus.o
|
|
||||||
OBJS-$(CONFIG_LIBCELT_DECODER) += libcelt_dec.o
|
OBJS-$(CONFIG_LIBCELT_DECODER) += libcelt_dec.o
|
||||||
OBJS-$(CONFIG_LIBDIRAC_DECODER) += libdiracdec.o
|
OBJS-$(CONFIG_LIBDIRAC_DECODER) += libdiracdec.o
|
||||||
OBJS-$(CONFIG_LIBDIRAC_ENCODER) += libdiracenc.o libdirac_libschro.o
|
OBJS-$(CONFIG_LIBDIRAC_ENCODER) += libdiracenc.o libdirac_libschro.o
|
||||||
@@ -625,8 +580,7 @@ OBJS-$(CONFIG_LIBMP3LAME_ENCODER) += libmp3lame.o
|
|||||||
OBJS-$(CONFIG_LIBOPENCORE_AMRNB_DECODER) += libopencore-amr.o
|
OBJS-$(CONFIG_LIBOPENCORE_AMRNB_DECODER) += libopencore-amr.o
|
||||||
OBJS-$(CONFIG_LIBOPENCORE_AMRNB_ENCODER) += libopencore-amr.o
|
OBJS-$(CONFIG_LIBOPENCORE_AMRNB_ENCODER) += libopencore-amr.o
|
||||||
OBJS-$(CONFIG_LIBOPENCORE_AMRWB_DECODER) += libopencore-amr.o
|
OBJS-$(CONFIG_LIBOPENCORE_AMRWB_DECODER) += libopencore-amr.o
|
||||||
OBJS-$(CONFIG_LIBOPENJPEG_DECODER) += libopenjpegdec.o
|
OBJS-$(CONFIG_LIBOPENJPEG_DECODER) += libopenjpeg.o
|
||||||
OBJS-$(CONFIG_LIBOPENJPEG_ENCODER) += libopenjpegenc.o
|
|
||||||
OBJS-$(CONFIG_LIBSCHROEDINGER_DECODER) += libschroedingerdec.o \
|
OBJS-$(CONFIG_LIBSCHROEDINGER_DECODER) += libschroedingerdec.o \
|
||||||
libschroedinger.o \
|
libschroedinger.o \
|
||||||
libdirac_libschro.o
|
libdirac_libschro.o
|
||||||
@@ -635,9 +589,7 @@ OBJS-$(CONFIG_LIBSCHROEDINGER_ENCODER) += libschroedingerenc.o \
|
|||||||
libdirac_libschro.o
|
libdirac_libschro.o
|
||||||
OBJS-$(CONFIG_LIBSPEEX_DECODER) += libspeexdec.o
|
OBJS-$(CONFIG_LIBSPEEX_DECODER) += libspeexdec.o
|
||||||
OBJS-$(CONFIG_LIBSPEEX_ENCODER) += libspeexenc.o
|
OBJS-$(CONFIG_LIBSPEEX_ENCODER) += libspeexenc.o
|
||||||
OBJS-$(CONFIG_LIBSTAGEFRIGHT_H264_DECODER)+= libstagefright.o
|
|
||||||
OBJS-$(CONFIG_LIBTHEORA_ENCODER) += libtheoraenc.o
|
OBJS-$(CONFIG_LIBTHEORA_ENCODER) += libtheoraenc.o
|
||||||
OBJS-$(CONFIG_LIBUTVIDEO_DECODER) += libutvideo.o
|
|
||||||
OBJS-$(CONFIG_LIBVO_AACENC_ENCODER) += libvo-aacenc.o mpeg4audio.o
|
OBJS-$(CONFIG_LIBVO_AACENC_ENCODER) += libvo-aacenc.o mpeg4audio.o
|
||||||
OBJS-$(CONFIG_LIBVO_AMRWBENC_ENCODER) += libvo-amrwbenc.o
|
OBJS-$(CONFIG_LIBVO_AMRWBENC_ENCODER) += libvo-amrwbenc.o
|
||||||
OBJS-$(CONFIG_LIBVORBIS_ENCODER) += libvorbis.o vorbis_data.o
|
OBJS-$(CONFIG_LIBVORBIS_ENCODER) += libvorbis.o vorbis_data.o
|
||||||
@@ -652,7 +604,6 @@ OBJS-$(CONFIG_AAC_PARSER) += aac_parser.o aac_ac3_parser.o \
|
|||||||
aacadtsdec.o mpeg4audio.o
|
aacadtsdec.o mpeg4audio.o
|
||||||
OBJS-$(CONFIG_AC3_PARSER) += ac3_parser.o ac3tab.o \
|
OBJS-$(CONFIG_AC3_PARSER) += ac3_parser.o ac3tab.o \
|
||||||
aac_ac3_parser.o
|
aac_ac3_parser.o
|
||||||
OBJS-$(CONFIG_ADX_PARSER) += adx_parser.o adx.o
|
|
||||||
OBJS-$(CONFIG_CAVSVIDEO_PARSER) += cavs_parser.o
|
OBJS-$(CONFIG_CAVSVIDEO_PARSER) += cavs_parser.o
|
||||||
OBJS-$(CONFIG_DCA_PARSER) += dca_parser.o
|
OBJS-$(CONFIG_DCA_PARSER) += dca_parser.o
|
||||||
OBJS-$(CONFIG_DIRAC_PARSER) += dirac_parser.o
|
OBJS-$(CONFIG_DIRAC_PARSER) += dirac_parser.o
|
||||||
@@ -661,7 +612,6 @@ OBJS-$(CONFIG_DVBSUB_PARSER) += dvbsub_parser.o
|
|||||||
OBJS-$(CONFIG_DVDSUB_PARSER) += dvdsub_parser.o
|
OBJS-$(CONFIG_DVDSUB_PARSER) += dvdsub_parser.o
|
||||||
OBJS-$(CONFIG_FLAC_PARSER) += flac_parser.o flacdata.o flac.o \
|
OBJS-$(CONFIG_FLAC_PARSER) += flac_parser.o flacdata.o flac.o \
|
||||||
vorbis_data.o
|
vorbis_data.o
|
||||||
OBJS-$(CONFIG_GSM_PARSER) += gsm_parser.o
|
|
||||||
OBJS-$(CONFIG_H261_PARSER) += h261_parser.o
|
OBJS-$(CONFIG_H261_PARSER) += h261_parser.o
|
||||||
OBJS-$(CONFIG_H263_PARSER) += h263_parser.o
|
OBJS-$(CONFIG_H263_PARSER) += h263_parser.o
|
||||||
OBJS-$(CONFIG_H264_PARSER) += h264_parser.o h264.o \
|
OBJS-$(CONFIG_H264_PARSER) += h264_parser.o h264.o \
|
||||||
@@ -683,8 +633,6 @@ OBJS-$(CONFIG_MPEGVIDEO_PARSER) += mpegvideo_parser.o \
|
|||||||
mpeg12.o mpeg12data.o \
|
mpeg12.o mpeg12data.o \
|
||||||
mpegvideo.o error_resilience.o
|
mpegvideo.o error_resilience.o
|
||||||
OBJS-$(CONFIG_PNM_PARSER) += pnm_parser.o pnm.o
|
OBJS-$(CONFIG_PNM_PARSER) += pnm_parser.o pnm.o
|
||||||
OBJS-$(CONFIG_RV30_PARSER) += rv34_parser.o
|
|
||||||
OBJS-$(CONFIG_RV40_PARSER) += rv34_parser.o
|
|
||||||
OBJS-$(CONFIG_VC1_PARSER) += vc1_parser.o vc1.o vc1data.o \
|
OBJS-$(CONFIG_VC1_PARSER) += vc1_parser.o vc1.o vc1data.o \
|
||||||
msmpeg4.o msmpeg4data.o mpeg4video.o \
|
msmpeg4.o msmpeg4data.o mpeg4video.o \
|
||||||
h263.o mpegvideo.o error_resilience.o
|
h263.o mpegvideo.o error_resilience.o
|
||||||
@@ -710,8 +658,7 @@ OBJS-$(CONFIG_TEXT2MOVSUB_BSF) += movsub_bsf.o
|
|||||||
|
|
||||||
# thread libraries
|
# thread libraries
|
||||||
OBJS-$(HAVE_PTHREADS) += pthread.o
|
OBJS-$(HAVE_PTHREADS) += pthread.o
|
||||||
OBJS-$(HAVE_W32THREADS) += pthread.o
|
OBJS-$(HAVE_W32THREADS) += w32thread.o
|
||||||
OBJS-$(HAVE_OS2THREADS) += pthread.o
|
|
||||||
|
|
||||||
OBJS-$(CONFIG_MLIB) += mlib/dsputil_mlib.o \
|
OBJS-$(CONFIG_MLIB) += mlib/dsputil_mlib.o \
|
||||||
|
|
||||||
@@ -721,6 +668,8 @@ OBJS-$(CONFIG_MLIB) += mlib/dsputil_mlib.o \
|
|||||||
# well.
|
# well.
|
||||||
OBJS-$(!CONFIG_SMALL) += inverse.o
|
OBJS-$(!CONFIG_SMALL) += inverse.o
|
||||||
|
|
||||||
|
-include $(SUBDIR)$(ARCH)/Makefile
|
||||||
|
|
||||||
SKIPHEADERS += %_tablegen.h \
|
SKIPHEADERS += %_tablegen.h \
|
||||||
%_tables.h \
|
%_tables.h \
|
||||||
aac_tablegen_decl.h \
|
aac_tablegen_decl.h \
|
||||||
@@ -731,12 +680,10 @@ SKIPHEADERS-$(CONFIG_DXVA2) += dxva2.h dxva2_internal.h
|
|||||||
SKIPHEADERS-$(CONFIG_LIBDIRAC) += libdirac.h
|
SKIPHEADERS-$(CONFIG_LIBDIRAC) += libdirac.h
|
||||||
SKIPHEADERS-$(CONFIG_LIBSCHROEDINGER) += libschroedinger.h
|
SKIPHEADERS-$(CONFIG_LIBSCHROEDINGER) += libschroedinger.h
|
||||||
SKIPHEADERS-$(CONFIG_VAAPI) += vaapi_internal.h
|
SKIPHEADERS-$(CONFIG_VAAPI) += vaapi_internal.h
|
||||||
SKIPHEADERS-$(CONFIG_VDA) += vda_internal.h
|
|
||||||
SKIPHEADERS-$(CONFIG_VDPAU) += vdpau.h
|
SKIPHEADERS-$(CONFIG_VDPAU) += vdpau.h
|
||||||
SKIPHEADERS-$(CONFIG_XVMC) += xvmc.h
|
SKIPHEADERS-$(CONFIG_XVMC) += xvmc.h
|
||||||
SKIPHEADERS-$(HAVE_W32THREADS) += w32pthreads.h
|
|
||||||
|
|
||||||
TESTPROGS = cabac dct fft fft-fixed h264 iirfilter rangecoder snowenc
|
TESTPROGS = cabac dct fft fft-fixed h264 iirfilter rangecoder snow
|
||||||
TESTPROGS-$(HAVE_MMX) += motion
|
TESTPROGS-$(HAVE_MMX) += motion
|
||||||
TESTOBJS = dctref.o
|
TESTOBJS = dctref.o
|
||||||
|
|
||||||
@@ -748,6 +695,8 @@ DIRS = alpha arm bfin mlib ppc ps2 sh4 sparc x86
|
|||||||
|
|
||||||
CLEANFILES = *_tables.c *_tables.h *_tablegen$(HOSTEXESUF)
|
CLEANFILES = *_tables.c *_tables.h *_tablegen$(HOSTEXESUF)
|
||||||
|
|
||||||
|
include $(SUBDIR)../subdir.mak
|
||||||
|
|
||||||
$(SUBDIR)dct-test$(EXESUF): $(SUBDIR)dctref.o
|
$(SUBDIR)dct-test$(EXESUF): $(SUBDIR)dctref.o
|
||||||
|
|
||||||
TRIG_TABLES = cos cos_fixed sin
|
TRIG_TABLES = cos cos_fixed sin
|
||||||
@@ -782,10 +731,3 @@ $(SUBDIR)motionpixels.o: $(SUBDIR)motionpixels_tables.h
|
|||||||
$(SUBDIR)pcm.o: $(SUBDIR)pcm_tables.h
|
$(SUBDIR)pcm.o: $(SUBDIR)pcm_tables.h
|
||||||
$(SUBDIR)qdm2.o: $(SUBDIR)qdm2_tables.h
|
$(SUBDIR)qdm2.o: $(SUBDIR)qdm2_tables.h
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CODEC_NAMES_SH := $(SRC_PATH)/$(SUBDIR)codec_names.sh
|
|
||||||
AVCODEC_H := $(SRC_PATH)/$(SUBDIR)avcodec.h
|
|
||||||
$(SUBDIR)codec_names.h: $(CODEC_NAMES_SH) config.h $(AVCODEC_H)
|
|
||||||
$(CC) $(CPPFLAGS) $(CFLAGS) -E $(AVCODEC_H) | \
|
|
||||||
$(CODEC_NAMES_SH) config.h $@
|
|
||||||
$(SUBDIR)utils.o: $(SUBDIR)codec_names.h
|
|
||||||
|
|||||||
@@ -84,7 +84,6 @@ enum BandType {
|
|||||||
#define IS_CODEBOOK_UNSIGNED(x) ((x - 1) & 10)
|
#define IS_CODEBOOK_UNSIGNED(x) ((x - 1) & 10)
|
||||||
|
|
||||||
enum ChannelPosition {
|
enum ChannelPosition {
|
||||||
AAC_CHANNEL_OFF = 0,
|
|
||||||
AAC_CHANNEL_FRONT = 1,
|
AAC_CHANNEL_FRONT = 1,
|
||||||
AAC_CHANNEL_SIDE = 2,
|
AAC_CHANNEL_SIDE = 2,
|
||||||
AAC_CHANNEL_BACK = 3,
|
AAC_CHANNEL_BACK = 3,
|
||||||
@@ -105,11 +104,11 @@ enum CouplingPoint {
|
|||||||
* Output configuration status
|
* Output configuration status
|
||||||
*/
|
*/
|
||||||
enum OCStatus {
|
enum OCStatus {
|
||||||
OC_NONE, ///< Output unconfigured
|
OC_NONE, //< Output unconfigured
|
||||||
OC_TRIAL_PCE, ///< Output configuration under trial specified by an inband PCE
|
OC_TRIAL_PCE, //< Output configuration under trial specified by an inband PCE
|
||||||
OC_TRIAL_FRAME, ///< Output configuration under trial specified by a frame header
|
OC_TRIAL_FRAME, //< Output configuration under trial specified by a frame header
|
||||||
OC_GLOBAL_HDR, ///< Output configuration set in a global header but not yet locked
|
OC_GLOBAL_HDR, //< Output configuration set in a global header but not yet locked
|
||||||
OC_LOCKED, ///< Output configuration locked in place
|
OC_LOCKED, //< Output configuration locked in place
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -252,7 +251,6 @@ typedef struct {
|
|||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
AVCodecContext *avctx;
|
AVCodecContext *avctx;
|
||||||
AVFrame frame;
|
|
||||||
|
|
||||||
MPEG4AudioConfig m4ac;
|
MPEG4AudioConfig m4ac;
|
||||||
|
|
||||||
@@ -301,7 +299,6 @@ typedef struct {
|
|||||||
DECLARE_ALIGNED(32, float, temp)[128];
|
DECLARE_ALIGNED(32, float, temp)[128];
|
||||||
|
|
||||||
enum OCStatus output_configured;
|
enum OCStatus output_configured;
|
||||||
int warned_num_aac_frames;
|
|
||||||
} AACContext;
|
} AACContext;
|
||||||
|
|
||||||
#endif /* AVCODEC_AAC_H */
|
#endif /* AVCODEC_AAC_H */
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ typedef struct AACAC3ParseContext {
|
|||||||
int sample_rate;
|
int sample_rate;
|
||||||
int bit_rate;
|
int bit_rate;
|
||||||
int samples;
|
int samples;
|
||||||
uint64_t channel_layout;
|
int64_t channel_layout;
|
||||||
int service_type;
|
int service_type;
|
||||||
|
|
||||||
int remaining_size;
|
int remaining_size;
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ static int aac_adtstoasc_filter(AVBitStreamFilterContext *bsfc,
|
|||||||
if (show_bits(&gb, 12) != 0xfff)
|
if (show_bits(&gb, 12) != 0xfff)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (avpriv_aac_parse_header(&gb, &hdr) < 0) {
|
if (ff_aac_parse_header(&gb, &hdr) < 0) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Error parsing ADTS frame header!\n");
|
av_log(avctx, AV_LOG_ERROR, "Error parsing ADTS frame header!\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -78,7 +78,7 @@ static int aac_adtstoasc_filter(AVBitStreamFilterContext *bsfc,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
init_put_bits(&pb, pce_data, MAX_PCE_SIZE);
|
init_put_bits(&pb, pce_data, MAX_PCE_SIZE);
|
||||||
pce_size = avpriv_copy_pce_data(&pb, &gb)/8;
|
pce_size = ff_copy_pce_data(&pb, &gb)/8;
|
||||||
flush_put_bits(&pb);
|
flush_put_bits(&pb);
|
||||||
buf_size -= get_bits_count(&gb)/8;
|
buf_size -= get_bits_count(&gb)/8;
|
||||||
buf += get_bits_count(&gb)/8;
|
buf += get_bits_count(&gb)/8;
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ static int aac_sync(uint64_t state, AACAC3ParseContext *hdr_info,
|
|||||||
tmp.u64 = av_be2ne64(state);
|
tmp.u64 = av_be2ne64(state);
|
||||||
init_get_bits(&bits, tmp.u8+8-AAC_ADTS_HEADER_SIZE, AAC_ADTS_HEADER_SIZE * 8);
|
init_get_bits(&bits, tmp.u8+8-AAC_ADTS_HEADER_SIZE, AAC_ADTS_HEADER_SIZE * 8);
|
||||||
|
|
||||||
if ((size = avpriv_aac_parse_header(&bits, &hdr)) < 0)
|
if ((size = ff_aac_parse_header(&bits, &hdr)) < 0)
|
||||||
return 0;
|
return 0;
|
||||||
*need_next_header = 0;
|
*need_next_header = 0;
|
||||||
*new_frame_start = 1;
|
*new_frame_start = 1;
|
||||||
@@ -61,9 +61,9 @@ static av_cold int aac_parse_init(AVCodecParserContext *s1)
|
|||||||
|
|
||||||
|
|
||||||
AVCodecParser ff_aac_parser = {
|
AVCodecParser ff_aac_parser = {
|
||||||
.codec_ids = { CODEC_ID_AAC },
|
{ CODEC_ID_AAC },
|
||||||
.priv_data_size = sizeof(AACAC3ParseContext),
|
sizeof(AACAC3ParseContext),
|
||||||
.parser_init = aac_parse_init,
|
aac_parse_init,
|
||||||
.parser_parse = ff_aac_ac3_parse,
|
ff_aac_ac3_parse,
|
||||||
.parser_close = ff_parse_close,
|
ff_parse_close,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
#include "get_bits.h"
|
#include "get_bits.h"
|
||||||
#include "mpeg4audio.h"
|
#include "mpeg4audio.h"
|
||||||
|
|
||||||
int avpriv_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr)
|
int ff_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr)
|
||||||
{
|
{
|
||||||
int size, rdb, ch, sr;
|
int size, rdb, ch, sr;
|
||||||
int aot, crc_abs;
|
int aot, crc_abs;
|
||||||
@@ -39,7 +39,7 @@ int avpriv_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr)
|
|||||||
crc_abs = get_bits1(gbc); /* protection_absent */
|
crc_abs = get_bits1(gbc); /* protection_absent */
|
||||||
aot = get_bits(gbc, 2); /* profile_objecttype */
|
aot = get_bits(gbc, 2); /* profile_objecttype */
|
||||||
sr = get_bits(gbc, 4); /* sample_frequency_index */
|
sr = get_bits(gbc, 4); /* sample_frequency_index */
|
||||||
if(!avpriv_mpeg4audio_sample_rates[sr])
|
if(!ff_mpeg4audio_sample_rates[sr])
|
||||||
return AAC_AC3_PARSE_ERROR_SAMPLE_RATE;
|
return AAC_AC3_PARSE_ERROR_SAMPLE_RATE;
|
||||||
skip_bits1(gbc); /* private_bit */
|
skip_bits1(gbc); /* private_bit */
|
||||||
ch = get_bits(gbc, 3); /* channel_configuration */
|
ch = get_bits(gbc, 3); /* channel_configuration */
|
||||||
@@ -62,7 +62,7 @@ int avpriv_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr)
|
|||||||
hdr->crc_absent = crc_abs;
|
hdr->crc_absent = crc_abs;
|
||||||
hdr->num_aac_frames = rdb + 1;
|
hdr->num_aac_frames = rdb + 1;
|
||||||
hdr->sampling_index = sr;
|
hdr->sampling_index = sr;
|
||||||
hdr->sample_rate = avpriv_mpeg4audio_sample_rates[sr];
|
hdr->sample_rate = ff_mpeg4audio_sample_rates[sr];
|
||||||
hdr->samples = (rdb + 1) * 1024;
|
hdr->samples = (rdb + 1) * 1024;
|
||||||
hdr->bit_rate = size * 8 * hdr->sample_rate / hdr->samples;
|
hdr->bit_rate = size * 8 * hdr->sample_rate / hdr->samples;
|
||||||
|
|
||||||
|
|||||||
@@ -49,6 +49,6 @@ typedef struct {
|
|||||||
* -2 if the version element is invalid, -3 if the sample rate
|
* -2 if the version element is invalid, -3 if the sample rate
|
||||||
* element is invalid, or -4 if the bit rate element is invalid.
|
* element is invalid, or -4 if the bit rate element is invalid.
|
||||||
*/
|
*/
|
||||||
int avpriv_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr);
|
int ff_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr);
|
||||||
|
|
||||||
#endif /* AVCODEC_AACADTSDEC_H */
|
#endif /* AVCODEC_AACADTSDEC_H */
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
#include "libavutil/libm.h" // brought forward to work around cygwin header breakage
|
#include "libavutil/libm.h" // brought forward to work around cygwin header breakage
|
||||||
|
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
#include "libavutil/mathematics.h"
|
#include <math.h>
|
||||||
#include "avcodec.h"
|
#include "avcodec.h"
|
||||||
#include "put_bits.h"
|
#include "put_bits.h"
|
||||||
#include "aac.h"
|
#include "aac.h"
|
||||||
@@ -110,15 +110,14 @@ static av_always_inline float quantize_and_encode_band_cost_template(
|
|||||||
int *bits, int BT_ZERO, int BT_UNSIGNED,
|
int *bits, int BT_ZERO, int BT_UNSIGNED,
|
||||||
int BT_PAIR, int BT_ESC)
|
int BT_PAIR, int BT_ESC)
|
||||||
{
|
{
|
||||||
const int q_idx = POW_SF2_ZERO - scale_idx + SCALE_ONE_POS - SCALE_DIV_512;
|
|
||||||
const float Q = ff_aac_pow2sf_tab [q_idx];
|
|
||||||
const float Q34 = ff_aac_pow34sf_tab[q_idx];
|
|
||||||
const float IQ = ff_aac_pow2sf_tab[POW_SF2_ZERO + scale_idx - SCALE_ONE_POS + SCALE_DIV_512];
|
const float IQ = ff_aac_pow2sf_tab[POW_SF2_ZERO + scale_idx - SCALE_ONE_POS + SCALE_DIV_512];
|
||||||
|
const float Q = ff_aac_pow2sf_tab[POW_SF2_ZERO - scale_idx + SCALE_ONE_POS - SCALE_DIV_512];
|
||||||
const float CLIPPED_ESCAPE = 165140.0f*IQ;
|
const float CLIPPED_ESCAPE = 165140.0f*IQ;
|
||||||
int i, j;
|
int i, j;
|
||||||
float cost = 0;
|
float cost = 0;
|
||||||
const int dim = BT_PAIR ? 2 : 4;
|
const int dim = BT_PAIR ? 2 : 4;
|
||||||
int resbits = 0;
|
int resbits = 0;
|
||||||
|
const float Q34 = sqrtf(Q * sqrtf(Q));
|
||||||
const int range = aac_cb_range[cb];
|
const int range = aac_cb_range[cb];
|
||||||
const int maxval = aac_cb_maxval[cb];
|
const int maxval = aac_cb_maxval[cb];
|
||||||
int off;
|
int off;
|
||||||
@@ -347,7 +346,7 @@ static void encode_window_bands_info(AACEncContext *s, SingleChannelElement *sce
|
|||||||
float cost_stay_here, cost_get_here;
|
float cost_stay_here, cost_get_here;
|
||||||
float rd = 0.0f;
|
float rd = 0.0f;
|
||||||
for (w = 0; w < group_len; w++) {
|
for (w = 0; w < group_len; w++) {
|
||||||
FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(win+w)*16+swb];
|
FFPsyBand *band = &s->psy.psy_bands[s->cur_channel*PSY_MAX_BANDS+(win+w)*16+swb];
|
||||||
rd += quantize_band_cost(s, sce->coeffs + start + w*128,
|
rd += quantize_band_cost(s, sce->coeffs + start + w*128,
|
||||||
s->scoefs + start + w*128, size,
|
s->scoefs + start + w*128, size,
|
||||||
sce->sf_idx[(win+w)*16+swb], cb,
|
sce->sf_idx[(win+w)*16+swb], cb,
|
||||||
@@ -421,7 +420,7 @@ static void codebook_trellis_rate(AACEncContext *s, SingleChannelElement *sce,
|
|||||||
const int run_esc = (1 << run_bits) - 1;
|
const int run_esc = (1 << run_bits) - 1;
|
||||||
int idx, ppos, count;
|
int idx, ppos, count;
|
||||||
int stackrun[120], stackcb[120], stack_len;
|
int stackrun[120], stackcb[120], stack_len;
|
||||||
float next_minbits = INFINITY;
|
float next_minrd = INFINITY;
|
||||||
int next_mincb = 0;
|
int next_mincb = 0;
|
||||||
|
|
||||||
abs_pow34_v(s->scoefs, sce->coeffs, 1024);
|
abs_pow34_v(s->scoefs, sce->coeffs, 1024);
|
||||||
@@ -434,32 +433,16 @@ static void codebook_trellis_rate(AACEncContext *s, SingleChannelElement *sce,
|
|||||||
for (swb = 0; swb < max_sfb; swb++) {
|
for (swb = 0; swb < max_sfb; swb++) {
|
||||||
size = sce->ics.swb_sizes[swb];
|
size = sce->ics.swb_sizes[swb];
|
||||||
if (sce->zeroes[win*16 + swb]) {
|
if (sce->zeroes[win*16 + swb]) {
|
||||||
float cost_stay_here = path[swb][0].cost;
|
for (cb = 0; cb < 12; cb++) {
|
||||||
float cost_get_here = next_minbits + run_bits + 4;
|
path[swb+1][cb].prev_idx = cb;
|
||||||
if ( run_value_bits[sce->ics.num_windows == 8][path[swb][0].run]
|
path[swb+1][cb].cost = path[swb][cb].cost;
|
||||||
!= run_value_bits[sce->ics.num_windows == 8][path[swb][0].run+1])
|
path[swb+1][cb].run = path[swb][cb].run + 1;
|
||||||
cost_stay_here += run_bits;
|
|
||||||
if (cost_get_here < cost_stay_here) {
|
|
||||||
path[swb+1][0].prev_idx = next_mincb;
|
|
||||||
path[swb+1][0].cost = cost_get_here;
|
|
||||||
path[swb+1][0].run = 1;
|
|
||||||
} else {
|
|
||||||
path[swb+1][0].prev_idx = 0;
|
|
||||||
path[swb+1][0].cost = cost_stay_here;
|
|
||||||
path[swb+1][0].run = path[swb][0].run + 1;
|
|
||||||
}
|
|
||||||
next_minbits = path[swb+1][0].cost;
|
|
||||||
next_mincb = 0;
|
|
||||||
for (cb = 1; cb < 12; cb++) {
|
|
||||||
path[swb+1][cb].cost = 61450;
|
|
||||||
path[swb+1][cb].prev_idx = -1;
|
|
||||||
path[swb+1][cb].run = 0;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
float minbits = next_minbits;
|
float minrd = next_minrd;
|
||||||
int mincb = next_mincb;
|
int mincb = next_mincb;
|
||||||
int startcb = sce->band_type[win*16+swb];
|
int startcb = sce->band_type[win*16+swb];
|
||||||
next_minbits = INFINITY;
|
next_minrd = INFINITY;
|
||||||
next_mincb = 0;
|
next_mincb = 0;
|
||||||
for (cb = 0; cb < startcb; cb++) {
|
for (cb = 0; cb < startcb; cb++) {
|
||||||
path[swb+1][cb].cost = 61450;
|
path[swb+1][cb].cost = 61450;
|
||||||
@@ -468,15 +451,15 @@ static void codebook_trellis_rate(AACEncContext *s, SingleChannelElement *sce,
|
|||||||
}
|
}
|
||||||
for (cb = startcb; cb < 12; cb++) {
|
for (cb = startcb; cb < 12; cb++) {
|
||||||
float cost_stay_here, cost_get_here;
|
float cost_stay_here, cost_get_here;
|
||||||
float bits = 0.0f;
|
float rd = 0.0f;
|
||||||
for (w = 0; w < group_len; w++) {
|
for (w = 0; w < group_len; w++) {
|
||||||
bits += quantize_band_cost(s, sce->coeffs + start + w*128,
|
rd += quantize_band_cost(s, sce->coeffs + start + w*128,
|
||||||
s->scoefs + start + w*128, size,
|
s->scoefs + start + w*128, size,
|
||||||
sce->sf_idx[(win+w)*16+swb], cb,
|
sce->sf_idx[(win+w)*16+swb], cb,
|
||||||
0, INFINITY, NULL);
|
0, INFINITY, NULL);
|
||||||
}
|
}
|
||||||
cost_stay_here = path[swb][cb].cost + bits;
|
cost_stay_here = path[swb][cb].cost + rd;
|
||||||
cost_get_here = minbits + bits + run_bits + 4;
|
cost_get_here = minrd + rd + run_bits + 4;
|
||||||
if ( run_value_bits[sce->ics.num_windows == 8][path[swb][cb].run]
|
if ( run_value_bits[sce->ics.num_windows == 8][path[swb][cb].run]
|
||||||
!= run_value_bits[sce->ics.num_windows == 8][path[swb][cb].run+1])
|
!= run_value_bits[sce->ics.num_windows == 8][path[swb][cb].run+1])
|
||||||
cost_stay_here += run_bits;
|
cost_stay_here += run_bits;
|
||||||
@@ -489,8 +472,8 @@ static void codebook_trellis_rate(AACEncContext *s, SingleChannelElement *sce,
|
|||||||
path[swb+1][cb].cost = cost_stay_here;
|
path[swb+1][cb].cost = cost_stay_here;
|
||||||
path[swb+1][cb].run = path[swb][cb].run + 1;
|
path[swb+1][cb].run = path[swb][cb].run + 1;
|
||||||
}
|
}
|
||||||
if (path[swb+1][cb].cost < next_minbits) {
|
if (path[swb+1][cb].cost < next_minrd) {
|
||||||
next_minbits = path[swb+1][cb].cost;
|
next_minrd = path[swb+1][cb].cost;
|
||||||
next_mincb = cb;
|
next_mincb = cb;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -627,7 +610,7 @@ static void search_for_quantizers_anmr(AVCodecContext *avctx, AACEncContext *s,
|
|||||||
qmin = INT_MAX;
|
qmin = INT_MAX;
|
||||||
qmax = 0.0f;
|
qmax = 0.0f;
|
||||||
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
|
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
|
||||||
FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g];
|
FFPsyBand *band = &s->psy.psy_bands[s->cur_channel*PSY_MAX_BANDS+(w+w2)*16+g];
|
||||||
if (band->energy <= band->threshold || band->threshold == 0.0f) {
|
if (band->energy <= band->threshold || band->threshold == 0.0f) {
|
||||||
sce->zeroes[(w+w2)*16+g] = 1;
|
sce->zeroes[(w+w2)*16+g] = 1;
|
||||||
continue;
|
continue;
|
||||||
@@ -656,7 +639,7 @@ static void search_for_quantizers_anmr(AVCodecContext *avctx, AACEncContext *s,
|
|||||||
float dist = 0;
|
float dist = 0;
|
||||||
int cb = find_min_book(maxval, sce->sf_idx[w*16+g]);
|
int cb = find_min_book(maxval, sce->sf_idx[w*16+g]);
|
||||||
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
|
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
|
||||||
FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g];
|
FFPsyBand *band = &s->psy.psy_bands[s->cur_channel*PSY_MAX_BANDS+(w+w2)*16+g];
|
||||||
dist += quantize_band_cost(s, coefs + w2*128, s->scoefs + start + w2*128, sce->ics.swb_sizes[g],
|
dist += quantize_band_cost(s, coefs + w2*128, s->scoefs + start + w2*128, sce->ics.swb_sizes[g],
|
||||||
q + q0, cb, lambda / band->threshold, INFINITY, NULL);
|
q + q0, cb, lambda / band->threshold, INFINITY, NULL);
|
||||||
}
|
}
|
||||||
@@ -729,7 +712,7 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
|
|||||||
int nz = 0;
|
int nz = 0;
|
||||||
float uplim = 0.0f;
|
float uplim = 0.0f;
|
||||||
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
|
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
|
||||||
FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g];
|
FFPsyBand *band = &s->psy.psy_bands[s->cur_channel*PSY_MAX_BANDS+(w+w2)*16+g];
|
||||||
uplim += band->threshold;
|
uplim += band->threshold;
|
||||||
if (band->energy <= band->threshold || band->threshold == 0.0f) {
|
if (band->energy <= band->threshold || band->threshold == 0.0f) {
|
||||||
sce->zeroes[(w+w2)*16+g] = 1;
|
sce->zeroes[(w+w2)*16+g] = 1;
|
||||||
@@ -1029,7 +1012,7 @@ static void search_for_quantizers_fast(AVCodecContext *avctx, AACEncContext *s,
|
|||||||
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
|
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
|
||||||
for (g = 0; g < sce->ics.num_swb; g++) {
|
for (g = 0; g < sce->ics.num_swb; g++) {
|
||||||
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
|
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
|
||||||
FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g];
|
FFPsyBand *band = &s->psy.psy_bands[s->cur_channel*PSY_MAX_BANDS+(w+w2)*16+g];
|
||||||
if (band->energy <= band->threshold) {
|
if (band->energy <= band->threshold) {
|
||||||
sce->sf_idx[(w+w2)*16+g] = 218;
|
sce->sf_idx[(w+w2)*16+g] = 218;
|
||||||
sce->zeroes[(w+w2)*16+g] = 1;
|
sce->zeroes[(w+w2)*16+g] = 1;
|
||||||
@@ -1067,8 +1050,8 @@ static void search_for_ms(AACEncContext *s, ChannelElement *cpe,
|
|||||||
if (!cpe->ch[0].zeroes[w*16+g] && !cpe->ch[1].zeroes[w*16+g]) {
|
if (!cpe->ch[0].zeroes[w*16+g] && !cpe->ch[1].zeroes[w*16+g]) {
|
||||||
float dist1 = 0.0f, dist2 = 0.0f;
|
float dist1 = 0.0f, dist2 = 0.0f;
|
||||||
for (w2 = 0; w2 < sce0->ics.group_len[w]; w2++) {
|
for (w2 = 0; w2 < sce0->ics.group_len[w]; w2++) {
|
||||||
FFPsyBand *band0 = &s->psy.ch[s->cur_channel+0].psy_bands[(w+w2)*16+g];
|
FFPsyBand *band0 = &s->psy.psy_bands[(s->cur_channel+0)*PSY_MAX_BANDS+(w+w2)*16+g];
|
||||||
FFPsyBand *band1 = &s->psy.ch[s->cur_channel+1].psy_bands[(w+w2)*16+g];
|
FFPsyBand *band1 = &s->psy.psy_bands[(s->cur_channel+1)*PSY_MAX_BANDS+(w+w2)*16+g];
|
||||||
float minthr = FFMIN(band0->threshold, band1->threshold);
|
float minthr = FFMIN(band0->threshold, band1->threshold);
|
||||||
float maxthr = FFMAX(band0->threshold, band1->threshold);
|
float maxthr = FFMAX(band0->threshold, band1->threshold);
|
||||||
for (i = 0; i < sce0->ics.swb_sizes[g]; i++) {
|
for (i = 0; i < sce0->ics.swb_sizes[g]; i++) {
|
||||||
@@ -1113,7 +1096,7 @@ static void search_for_ms(AACEncContext *s, ChannelElement *cpe,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AACCoefficientsEncoder ff_aac_coders[AAC_CODER_NB] = {
|
AACCoefficientsEncoder ff_aac_coders[] = {
|
||||||
{
|
{
|
||||||
search_for_quantizers_faac,
|
search_for_quantizers_faac,
|
||||||
encode_window_bands_info,
|
encode_window_bands_info,
|
||||||
|
|||||||
@@ -98,7 +98,6 @@
|
|||||||
#include "aacsbr.h"
|
#include "aacsbr.h"
|
||||||
#include "mpeg4audio.h"
|
#include "mpeg4audio.h"
|
||||||
#include "aacadtsdec.h"
|
#include "aacadtsdec.h"
|
||||||
#include "libavutil/intfloat.h"
|
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
@@ -109,6 +108,11 @@
|
|||||||
# include "arm/aac.h"
|
# include "arm/aac.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
union float754 {
|
||||||
|
float f;
|
||||||
|
uint32_t i;
|
||||||
|
};
|
||||||
|
|
||||||
static VLC vlc_scalefactors;
|
static VLC vlc_scalefactors;
|
||||||
static VLC vlc_spectral[11];
|
static VLC vlc_spectral[11];
|
||||||
|
|
||||||
@@ -163,19 +167,6 @@ static ChannelElement *get_che(AACContext *ac, int type, int elem_id)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int count_channels(enum ChannelPosition che_pos[4][MAX_ELEM_ID])
|
|
||||||
{
|
|
||||||
int i, type, sum = 0;
|
|
||||||
for (i = 0; i < MAX_ELEM_ID; i++) {
|
|
||||||
for (type = 0; type < 4; type++) {
|
|
||||||
sum += (1 + (type == TYPE_CPE)) *
|
|
||||||
(che_pos[type][i] != AAC_CHANNEL_OFF &&
|
|
||||||
che_pos[type][i] != AAC_CHANNEL_CC);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return sum;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check for the channel element in the current channel position configuration.
|
* Check for the channel element in the current channel position configuration.
|
||||||
* If it exists, make sure the appropriate element is allocated and map the
|
* If it exists, make sure the appropriate element is allocated and map the
|
||||||
@@ -193,11 +184,9 @@ static av_cold int che_configure(AACContext *ac,
|
|||||||
int type, int id, int *channels)
|
int type, int id, int *channels)
|
||||||
{
|
{
|
||||||
if (che_pos[type][id]) {
|
if (che_pos[type][id]) {
|
||||||
if (!ac->che[type][id]) {
|
if (!ac->che[type][id] && !(ac->che[type][id] = av_mallocz(sizeof(ChannelElement))))
|
||||||
if (!(ac->che[type][id] = av_mallocz(sizeof(ChannelElement))))
|
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
ff_aac_sbr_ctx_init(ac, &ac->che[type][id]->sbr);
|
ff_aac_sbr_ctx_init(ac, &ac->che[type][id]->sbr);
|
||||||
}
|
|
||||||
if (type != TYPE_CCE) {
|
if (type != TYPE_CCE) {
|
||||||
ac->output_data[(*channels)++] = ac->che[type][id]->ch[0].ret;
|
ac->output_data[(*channels)++] = ac->che[type][id]->ch[0].ret;
|
||||||
if (type == TYPE_CPE ||
|
if (type == TYPE_CPE ||
|
||||||
@@ -271,23 +260,6 @@ static av_cold int output_configure(AACContext *ac,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void flush(AVCodecContext *avctx)
|
|
||||||
{
|
|
||||||
AACContext *ac= avctx->priv_data;
|
|
||||||
int type, i, j;
|
|
||||||
|
|
||||||
for (type = 3; type >= 0; type--) {
|
|
||||||
for (i = 0; i < MAX_ELEM_ID; i++) {
|
|
||||||
ChannelElement *che = ac->che[type][i];
|
|
||||||
if (che) {
|
|
||||||
for (j = 0; j <= 1; j++) {
|
|
||||||
memset(che->ch[j].saved, 0, sizeof(che->ch[j].saved));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Decode an array of 4 bit element IDs, optionally interleaved with a stereo/mono switching bit.
|
* Decode an array of 4 bit element IDs, optionally interleaved with a stereo/mono switching bit.
|
||||||
*
|
*
|
||||||
@@ -450,12 +422,6 @@ static int decode_ga_specific_config(AACContext *ac, AVCodecContext *avctx,
|
|||||||
if ((ret = set_default_channel_config(avctx, new_che_pos, channel_config)))
|
if ((ret = set_default_channel_config(avctx, new_che_pos, channel_config)))
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count_channels(new_che_pos) > 1) {
|
|
||||||
m4ac->ps = 0;
|
|
||||||
} else if (m4ac->sbr == 1 && m4ac->ps == -1)
|
|
||||||
m4ac->ps = 1;
|
|
||||||
|
|
||||||
if (ac && (ret = output_configure(ac, ac->che_pos, new_che_pos, channel_config, OC_GLOBAL_HDR)))
|
if (ac && (ret = output_configure(ac, ac->che_pos, new_che_pos, channel_config, OC_GLOBAL_HDR)))
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
@@ -486,17 +452,15 @@ static int decode_ga_specific_config(AACContext *ac, AVCodecContext *avctx,
|
|||||||
* @param ac pointer to AACContext, may be null
|
* @param ac pointer to AACContext, may be null
|
||||||
* @param avctx pointer to AVCCodecContext, used for logging
|
* @param avctx pointer to AVCCodecContext, used for logging
|
||||||
* @param m4ac pointer to MPEG4AudioConfig, used for parsing
|
* @param m4ac pointer to MPEG4AudioConfig, used for parsing
|
||||||
* @param data pointer to buffer holding an audio specific config
|
* @param data pointer to AVCodecContext extradata
|
||||||
* @param bit_size size of audio specific config or data in bits
|
* @param data_size size of AVCCodecContext extradata
|
||||||
* @param sync_extension look for an appended sync extension
|
|
||||||
*
|
*
|
||||||
* @return Returns error status or number of consumed bits. <0 - error
|
* @return Returns error status or number of consumed bits. <0 - error
|
||||||
*/
|
*/
|
||||||
static int decode_audio_specific_config(AACContext *ac,
|
static int decode_audio_specific_config(AACContext *ac,
|
||||||
AVCodecContext *avctx,
|
AVCodecContext *avctx,
|
||||||
MPEG4AudioConfig *m4ac,
|
MPEG4AudioConfig *m4ac,
|
||||||
const uint8_t *data, int bit_size,
|
const uint8_t *data, int data_size)
|
||||||
int sync_extension)
|
|
||||||
{
|
{
|
||||||
GetBitContext gb;
|
GetBitContext gb;
|
||||||
int i;
|
int i;
|
||||||
@@ -506,14 +470,16 @@ static int decode_audio_specific_config(AACContext *ac,
|
|||||||
av_dlog(avctx, "%02x ", avctx->extradata[i]);
|
av_dlog(avctx, "%02x ", avctx->extradata[i]);
|
||||||
av_dlog(avctx, "\n");
|
av_dlog(avctx, "\n");
|
||||||
|
|
||||||
init_get_bits(&gb, data, bit_size);
|
init_get_bits(&gb, data, data_size * 8);
|
||||||
|
|
||||||
if ((i = avpriv_mpeg4audio_get_config(m4ac, data, bit_size, sync_extension)) < 0)
|
if ((i = ff_mpeg4audio_get_config(m4ac, data, data_size)) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
if (m4ac->sampling_index > 12) {
|
if (m4ac->sampling_index > 12) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "invalid sampling rate index %d\n", m4ac->sampling_index);
|
av_log(avctx, AV_LOG_ERROR, "invalid sampling rate index %d\n", m4ac->sampling_index);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
if (m4ac->sbr == 1 && m4ac->ps == -1)
|
||||||
|
m4ac->ps = 1;
|
||||||
|
|
||||||
skip_bits_long(&gb, i);
|
skip_bits_long(&gb, i);
|
||||||
|
|
||||||
@@ -566,22 +532,6 @@ static void reset_all_predictors(PredictorState *ps)
|
|||||||
reset_predict_state(&ps[i]);
|
reset_predict_state(&ps[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sample_rate_idx (int rate)
|
|
||||||
{
|
|
||||||
if (92017 <= rate) return 0;
|
|
||||||
else if (75132 <= rate) return 1;
|
|
||||||
else if (55426 <= rate) return 2;
|
|
||||||
else if (46009 <= rate) return 3;
|
|
||||||
else if (37566 <= rate) return 4;
|
|
||||||
else if (27713 <= rate) return 5;
|
|
||||||
else if (23004 <= rate) return 6;
|
|
||||||
else if (18783 <= rate) return 7;
|
|
||||||
else if (13856 <= rate) return 8;
|
|
||||||
else if (11502 <= rate) return 9;
|
|
||||||
else if (9391 <= rate) return 10;
|
|
||||||
else return 11;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void reset_predictor_group(PredictorState *ps, int group_num)
|
static void reset_predictor_group(PredictorState *ps, int group_num)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@@ -606,33 +556,8 @@ static av_cold int aac_decode_init(AVCodecContext *avctx)
|
|||||||
if (avctx->extradata_size > 0) {
|
if (avctx->extradata_size > 0) {
|
||||||
if (decode_audio_specific_config(ac, ac->avctx, &ac->m4ac,
|
if (decode_audio_specific_config(ac, ac->avctx, &ac->m4ac,
|
||||||
avctx->extradata,
|
avctx->extradata,
|
||||||
avctx->extradata_size*8, 1) < 0)
|
avctx->extradata_size) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
|
||||||
int sr, i;
|
|
||||||
enum ChannelPosition new_che_pos[4][MAX_ELEM_ID];
|
|
||||||
|
|
||||||
sr = sample_rate_idx(avctx->sample_rate);
|
|
||||||
ac->m4ac.sampling_index = sr;
|
|
||||||
ac->m4ac.channels = avctx->channels;
|
|
||||||
ac->m4ac.sbr = -1;
|
|
||||||
ac->m4ac.ps = -1;
|
|
||||||
|
|
||||||
for (i = 0; i < FF_ARRAY_ELEMS(ff_mpeg4audio_channels); i++)
|
|
||||||
if (ff_mpeg4audio_channels[i] == avctx->channels)
|
|
||||||
break;
|
|
||||||
if (i == FF_ARRAY_ELEMS(ff_mpeg4audio_channels)) {
|
|
||||||
i = 0;
|
|
||||||
}
|
|
||||||
ac->m4ac.chan_config = i;
|
|
||||||
|
|
||||||
if (ac->m4ac.chan_config) {
|
|
||||||
int ret = set_default_channel_config(avctx, new_che_pos, ac->m4ac.chan_config);
|
|
||||||
if (!ret)
|
|
||||||
output_configure(ac, ac->che_pos, new_che_pos, ac->m4ac.chan_config, OC_GLOBAL_HDR);
|
|
||||||
else if (avctx->err_recognition & AV_EF_EXPLODE)
|
|
||||||
return AVERROR_INVALIDDATA;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (avctx->request_sample_fmt == AV_SAMPLE_FMT_FLT) {
|
if (avctx->request_sample_fmt == AV_SAMPLE_FMT_FLT) {
|
||||||
@@ -680,9 +605,6 @@ static av_cold int aac_decode_init(AVCodecContext *avctx)
|
|||||||
|
|
||||||
cbrt_tableinit();
|
cbrt_tableinit();
|
||||||
|
|
||||||
avcodec_get_frame_defaults(&ac->frame);
|
|
||||||
avctx->coded_frame = &ac->frame;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -739,13 +661,16 @@ static void decode_ltp(AACContext *ac, LongTermPrediction *ltp,
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Decode Individual Channel Stream info; reference: table 4.6.
|
* Decode Individual Channel Stream info; reference: table 4.6.
|
||||||
|
*
|
||||||
|
* @param common_window Channels have independent [0], or shared [1], Individual Channel Stream information.
|
||||||
*/
|
*/
|
||||||
static int decode_ics_info(AACContext *ac, IndividualChannelStream *ics,
|
static int decode_ics_info(AACContext *ac, IndividualChannelStream *ics,
|
||||||
GetBitContext *gb)
|
GetBitContext *gb, int common_window)
|
||||||
{
|
{
|
||||||
if (get_bits1(gb)) {
|
if (get_bits1(gb)) {
|
||||||
av_log(ac->avctx, AV_LOG_ERROR, "Reserved bit set.\n");
|
av_log(ac->avctx, AV_LOG_ERROR, "Reserved bit set.\n");
|
||||||
return AVERROR_INVALIDDATA;
|
memset(ics, 0, sizeof(IndividualChannelStream));
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
ics->window_sequence[1] = ics->window_sequence[0];
|
ics->window_sequence[1] = ics->window_sequence[0];
|
||||||
ics->window_sequence[0] = get_bits(gb, 2);
|
ics->window_sequence[0] = get_bits(gb, 2);
|
||||||
@@ -780,11 +705,13 @@ static int decode_ics_info(AACContext *ac, IndividualChannelStream *ics,
|
|||||||
if (ics->predictor_present) {
|
if (ics->predictor_present) {
|
||||||
if (ac->m4ac.object_type == AOT_AAC_MAIN) {
|
if (ac->m4ac.object_type == AOT_AAC_MAIN) {
|
||||||
if (decode_prediction(ac, ics, gb)) {
|
if (decode_prediction(ac, ics, gb)) {
|
||||||
return AVERROR_INVALIDDATA;
|
memset(ics, 0, sizeof(IndividualChannelStream));
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
} else if (ac->m4ac.object_type == AOT_AAC_LC) {
|
} else if (ac->m4ac.object_type == AOT_AAC_LC) {
|
||||||
av_log(ac->avctx, AV_LOG_ERROR, "Prediction is not allowed in AAC-LC.\n");
|
av_log(ac->avctx, AV_LOG_ERROR, "Prediction is not allowed in AAC-LC.\n");
|
||||||
return AVERROR_INVALIDDATA;
|
memset(ics, 0, sizeof(IndividualChannelStream));
|
||||||
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
if ((ics->ltp.present = get_bits(gb, 1)))
|
if ((ics->ltp.present = get_bits(gb, 1)))
|
||||||
decode_ltp(ac, &ics->ltp, gb, ics->max_sfb);
|
decode_ltp(ac, &ics->ltp, gb, ics->max_sfb);
|
||||||
@@ -796,7 +723,8 @@ static int decode_ics_info(AACContext *ac, IndividualChannelStream *ics,
|
|||||||
av_log(ac->avctx, AV_LOG_ERROR,
|
av_log(ac->avctx, AV_LOG_ERROR,
|
||||||
"Number of scalefactor bands in group (%d) exceeds limit (%d).\n",
|
"Number of scalefactor bands in group (%d) exceeds limit (%d).\n",
|
||||||
ics->max_sfb, ics->num_swb);
|
ics->max_sfb, ics->num_swb);
|
||||||
return AVERROR_INVALIDDATA;
|
memset(ics, 0, sizeof(IndividualChannelStream));
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -826,10 +754,10 @@ static int decode_band_types(AACContext *ac, enum BandType band_type[120],
|
|||||||
av_log(ac->avctx, AV_LOG_ERROR, "invalid band type\n");
|
av_log(ac->avctx, AV_LOG_ERROR, "invalid band type\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
while ((sect_len_incr = get_bits(gb, bits)) == (1 << bits) - 1 && get_bits_left(gb) >= bits)
|
while ((sect_len_incr = get_bits(gb, bits)) == (1 << bits) - 1)
|
||||||
sect_end += sect_len_incr;
|
sect_end += sect_len_incr;
|
||||||
sect_end += sect_len_incr;
|
sect_end += sect_len_incr;
|
||||||
if (get_bits_left(gb) < 0 || sect_len_incr == (1 << bits) - 1) {
|
if (get_bits_left(gb) < 0) {
|
||||||
av_log(ac->avctx, AV_LOG_ERROR, overread_err);
|
av_log(ac->avctx, AV_LOG_ERROR, overread_err);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -1030,7 +958,7 @@ static inline float *VMUL4(float *dst, const float *v, unsigned idx,
|
|||||||
static inline float *VMUL2S(float *dst, const float *v, unsigned idx,
|
static inline float *VMUL2S(float *dst, const float *v, unsigned idx,
|
||||||
unsigned sign, const float *scale)
|
unsigned sign, const float *scale)
|
||||||
{
|
{
|
||||||
union av_intfloat32 s0, s1;
|
union float754 s0, s1;
|
||||||
|
|
||||||
s0.f = s1.f = *scale;
|
s0.f = s1.f = *scale;
|
||||||
s0.i ^= sign >> 1 << 31;
|
s0.i ^= sign >> 1 << 31;
|
||||||
@@ -1048,8 +976,8 @@ static inline float *VMUL4S(float *dst, const float *v, unsigned idx,
|
|||||||
unsigned sign, const float *scale)
|
unsigned sign, const float *scale)
|
||||||
{
|
{
|
||||||
unsigned nz = idx >> 12;
|
unsigned nz = idx >> 12;
|
||||||
union av_intfloat32 s = { .f = *scale };
|
union float754 s = { .f = *scale };
|
||||||
union av_intfloat32 t;
|
union float754 t;
|
||||||
|
|
||||||
t.i = s.i ^ (sign & 1U<<31);
|
t.i = s.i ^ (sign & 1U<<31);
|
||||||
*dst++ = v[idx & 3] * t.f;
|
*dst++ = v[idx & 3] * t.f;
|
||||||
@@ -1162,7 +1090,7 @@ static int decode_spectrum_and_dequant(AACContext *ac, float coef[1024],
|
|||||||
GET_VLC(code, re, gb, vlc_tab, 8, 2);
|
GET_VLC(code, re, gb, vlc_tab, 8, 2);
|
||||||
cb_idx = cb_vector_idx[code];
|
cb_idx = cb_vector_idx[code];
|
||||||
nnz = cb_idx >> 8 & 15;
|
nnz = cb_idx >> 8 & 15;
|
||||||
bits = nnz ? GET_CACHE(re, gb) : 0;
|
bits = SHOW_UBITS(re, gb, nnz) << (32-nnz);
|
||||||
LAST_SKIP_BITS(re, gb, nnz);
|
LAST_SKIP_BITS(re, gb, nnz);
|
||||||
cf = VMUL4S(cf, vq, cb_idx, bits, sf + idx);
|
cf = VMUL4S(cf, vq, cb_idx, bits, sf + idx);
|
||||||
} while (len -= 4);
|
} while (len -= 4);
|
||||||
@@ -1202,7 +1130,7 @@ static int decode_spectrum_and_dequant(AACContext *ac, float coef[1024],
|
|||||||
GET_VLC(code, re, gb, vlc_tab, 8, 2);
|
GET_VLC(code, re, gb, vlc_tab, 8, 2);
|
||||||
cb_idx = cb_vector_idx[code];
|
cb_idx = cb_vector_idx[code];
|
||||||
nnz = cb_idx >> 8 & 15;
|
nnz = cb_idx >> 8 & 15;
|
||||||
sign = nnz ? SHOW_UBITS(re, gb, nnz) << (cb_idx >> 12) : 0;
|
sign = SHOW_UBITS(re, gb, nnz) << (cb_idx >> 12);
|
||||||
LAST_SKIP_BITS(re, gb, nnz);
|
LAST_SKIP_BITS(re, gb, nnz);
|
||||||
cf = VMUL2S(cf, vq, cb_idx, sign, sf + idx);
|
cf = VMUL2S(cf, vq, cb_idx, sign, sf + idx);
|
||||||
} while (len -= 2);
|
} while (len -= 2);
|
||||||
@@ -1298,7 +1226,7 @@ static int decode_spectrum_and_dequant(AACContext *ac, float coef[1024],
|
|||||||
|
|
||||||
static av_always_inline float flt16_round(float pf)
|
static av_always_inline float flt16_round(float pf)
|
||||||
{
|
{
|
||||||
union av_intfloat32 tmp;
|
union float754 tmp;
|
||||||
tmp.f = pf;
|
tmp.f = pf;
|
||||||
tmp.i = (tmp.i + 0x00008000U) & 0xFFFF0000U;
|
tmp.i = (tmp.i + 0x00008000U) & 0xFFFF0000U;
|
||||||
return tmp.f;
|
return tmp.f;
|
||||||
@@ -1306,7 +1234,7 @@ static av_always_inline float flt16_round(float pf)
|
|||||||
|
|
||||||
static av_always_inline float flt16_even(float pf)
|
static av_always_inline float flt16_even(float pf)
|
||||||
{
|
{
|
||||||
union av_intfloat32 tmp;
|
union float754 tmp;
|
||||||
tmp.f = pf;
|
tmp.f = pf;
|
||||||
tmp.i = (tmp.i + 0x00007FFFU + (tmp.i & 0x00010000U >> 16)) & 0xFFFF0000U;
|
tmp.i = (tmp.i + 0x00007FFFU + (tmp.i & 0x00010000U >> 16)) & 0xFFFF0000U;
|
||||||
return tmp.f;
|
return tmp.f;
|
||||||
@@ -1314,7 +1242,7 @@ static av_always_inline float flt16_even(float pf)
|
|||||||
|
|
||||||
static av_always_inline float flt16_trunc(float pf)
|
static av_always_inline float flt16_trunc(float pf)
|
||||||
{
|
{
|
||||||
union av_intfloat32 pun;
|
union float754 pun;
|
||||||
pun.f = pf;
|
pun.f = pf;
|
||||||
pun.i &= 0xFFFF0000U;
|
pun.i &= 0xFFFF0000U;
|
||||||
return pun.f;
|
return pun.f;
|
||||||
@@ -1401,8 +1329,8 @@ static int decode_ics(AACContext *ac, SingleChannelElement *sce,
|
|||||||
global_gain = get_bits(gb, 8);
|
global_gain = get_bits(gb, 8);
|
||||||
|
|
||||||
if (!common_window && !scale_flag) {
|
if (!common_window && !scale_flag) {
|
||||||
if (decode_ics_info(ac, ics, gb) < 0)
|
if (decode_ics_info(ac, ics, gb, 0) < 0)
|
||||||
return AVERROR_INVALIDDATA;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (decode_band_types(ac, sce->band_type, sce->band_type_run_end, gb, ics) < 0)
|
if (decode_band_types(ac, sce->band_type, sce->band_type_run_end, gb, ics) < 0)
|
||||||
@@ -1518,8 +1446,8 @@ static int decode_cpe(AACContext *ac, GetBitContext *gb, ChannelElement *cpe)
|
|||||||
|
|
||||||
common_window = get_bits1(gb);
|
common_window = get_bits1(gb);
|
||||||
if (common_window) {
|
if (common_window) {
|
||||||
if (decode_ics_info(ac, &cpe->ch[0].ics, gb))
|
if (decode_ics_info(ac, &cpe->ch[0].ics, gb, 1))
|
||||||
return AVERROR_INVALIDDATA;
|
return -1;
|
||||||
i = cpe->ch[1].ics.use_kb_window[0];
|
i = cpe->ch[1].ics.use_kb_window[0];
|
||||||
cpe->ch[1].ics = cpe->ch[0].ics;
|
cpe->ch[1].ics = cpe->ch[0].ics;
|
||||||
cpe->ch[1].ics.use_kb_window[1] = i;
|
cpe->ch[1].ics.use_kb_window[1] = i;
|
||||||
@@ -2108,49 +2036,46 @@ static int parse_adts_frame_header(AACContext *ac, GetBitContext *gb)
|
|||||||
int size;
|
int size;
|
||||||
AACADTSHeaderInfo hdr_info;
|
AACADTSHeaderInfo hdr_info;
|
||||||
|
|
||||||
size = avpriv_aac_parse_header(gb, &hdr_info);
|
size = ff_aac_parse_header(gb, &hdr_info);
|
||||||
if (size > 0) {
|
if (size > 0) {
|
||||||
if (hdr_info.chan_config) {
|
if (ac->output_configured != OC_LOCKED && hdr_info.chan_config) {
|
||||||
enum ChannelPosition new_che_pos[4][MAX_ELEM_ID];
|
enum ChannelPosition new_che_pos[4][MAX_ELEM_ID];
|
||||||
memset(new_che_pos, 0, 4 * MAX_ELEM_ID * sizeof(new_che_pos[0][0]));
|
memset(new_che_pos, 0, 4 * MAX_ELEM_ID * sizeof(new_che_pos[0][0]));
|
||||||
ac->m4ac.chan_config = hdr_info.chan_config;
|
ac->m4ac.chan_config = hdr_info.chan_config;
|
||||||
if (set_default_channel_config(ac->avctx, new_che_pos, hdr_info.chan_config))
|
if (set_default_channel_config(ac->avctx, new_che_pos, hdr_info.chan_config))
|
||||||
return -7;
|
return -7;
|
||||||
if (output_configure(ac, ac->che_pos, new_che_pos, hdr_info.chan_config,
|
if (output_configure(ac, ac->che_pos, new_che_pos, hdr_info.chan_config, OC_TRIAL_FRAME))
|
||||||
FFMAX(ac->output_configured, OC_TRIAL_FRAME)))
|
|
||||||
return -7;
|
return -7;
|
||||||
} else if (ac->output_configured != OC_LOCKED) {
|
} else if (ac->output_configured != OC_LOCKED) {
|
||||||
ac->m4ac.chan_config = 0;
|
|
||||||
ac->output_configured = OC_NONE;
|
ac->output_configured = OC_NONE;
|
||||||
}
|
}
|
||||||
if (ac->output_configured != OC_LOCKED) {
|
if (ac->output_configured != OC_LOCKED) {
|
||||||
ac->m4ac.sbr = -1;
|
ac->m4ac.sbr = -1;
|
||||||
ac->m4ac.ps = -1;
|
ac->m4ac.ps = -1;
|
||||||
|
}
|
||||||
ac->m4ac.sample_rate = hdr_info.sample_rate;
|
ac->m4ac.sample_rate = hdr_info.sample_rate;
|
||||||
ac->m4ac.sampling_index = hdr_info.sampling_index;
|
ac->m4ac.sampling_index = hdr_info.sampling_index;
|
||||||
ac->m4ac.object_type = hdr_info.object_type;
|
ac->m4ac.object_type = hdr_info.object_type;
|
||||||
}
|
|
||||||
if (!ac->avctx->sample_rate)
|
if (!ac->avctx->sample_rate)
|
||||||
ac->avctx->sample_rate = hdr_info.sample_rate;
|
ac->avctx->sample_rate = hdr_info.sample_rate;
|
||||||
if (!ac->warned_num_aac_frames && hdr_info.num_aac_frames != 1) {
|
if (hdr_info.num_aac_frames == 1) {
|
||||||
// This is 2 for "VLB " audio in NSV files.
|
|
||||||
// See samples/nsv/vlb_audio.
|
|
||||||
av_log_missing_feature(ac->avctx, "More than one AAC RDB per ADTS frame is", 0);
|
|
||||||
ac->warned_num_aac_frames = 1;
|
|
||||||
}
|
|
||||||
if (!hdr_info.crc_absent)
|
if (!hdr_info.crc_absent)
|
||||||
skip_bits(gb, 16);
|
skip_bits(gb, 16);
|
||||||
|
} else {
|
||||||
|
av_log_missing_feature(ac->avctx, "More than one AAC RDB per ADTS frame is", 0);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
|
static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
|
||||||
int *got_frame_ptr, GetBitContext *gb)
|
int *data_size, GetBitContext *gb)
|
||||||
{
|
{
|
||||||
AACContext *ac = avctx->priv_data;
|
AACContext *ac = avctx->priv_data;
|
||||||
ChannelElement *che = NULL, *che_prev = NULL;
|
ChannelElement *che = NULL, *che_prev = NULL;
|
||||||
enum RawDataBlockType elem_type, elem_type_prev = TYPE_END;
|
enum RawDataBlockType elem_type, elem_type_prev = TYPE_END;
|
||||||
int err, elem_id;
|
int err, elem_id, data_size_tmp;
|
||||||
int samples = 0, multiplier, audio_found = 0;
|
int samples = 0, multiplier, audio_found = 0;
|
||||||
|
|
||||||
if (show_bits(gb, 12) == 0xfff) {
|
if (show_bits(gb, 12) == 0xfff) {
|
||||||
@@ -2170,15 +2095,6 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
|
|||||||
elem_id = get_bits(gb, 4);
|
elem_id = get_bits(gb, 4);
|
||||||
|
|
||||||
if (elem_type < TYPE_DSE) {
|
if (elem_type < TYPE_DSE) {
|
||||||
if (!ac->tags_mapped && elem_type == TYPE_CPE && ac->m4ac.chan_config==1) {
|
|
||||||
enum ChannelPosition new_che_pos[4][MAX_ELEM_ID]= {0};
|
|
||||||
ac->m4ac.chan_config=2;
|
|
||||||
|
|
||||||
if (set_default_channel_config(ac->avctx, new_che_pos, 2)<0)
|
|
||||||
return -1;
|
|
||||||
if (output_configure(ac, ac->che_pos, new_che_pos, 2, OC_TRIAL_FRAME)<0)
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if (!(che=get_che(ac, elem_type, elem_id))) {
|
if (!(che=get_che(ac, elem_type, elem_id))) {
|
||||||
av_log(ac->avctx, AV_LOG_ERROR, "channel element %d.%d is not allocated\n",
|
av_log(ac->avctx, AV_LOG_ERROR, "channel element %d.%d is not allocated\n",
|
||||||
elem_type, elem_id);
|
elem_type, elem_id);
|
||||||
@@ -2218,11 +2134,10 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
|
|||||||
if ((err = decode_pce(avctx, &ac->m4ac, new_che_pos, gb)))
|
if ((err = decode_pce(avctx, &ac->m4ac, new_che_pos, gb)))
|
||||||
break;
|
break;
|
||||||
if (ac->output_configured > OC_TRIAL_PCE)
|
if (ac->output_configured > OC_TRIAL_PCE)
|
||||||
av_log(avctx, AV_LOG_INFO,
|
av_log(avctx, AV_LOG_ERROR,
|
||||||
"Evaluating a further program_config_element.\n");
|
"Not evaluating a further program_config_element as this construct is dubious at best.\n");
|
||||||
|
else
|
||||||
err = output_configure(ac, ac->che_pos, new_che_pos, 0, OC_TRIAL_PCE);
|
err = output_configure(ac, ac->che_pos, new_che_pos, 0, OC_TRIAL_PCE);
|
||||||
if (!err)
|
|
||||||
ac->m4ac.chan_config = 0;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2264,26 +2179,24 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
|
|||||||
avctx->frame_size = samples;
|
avctx->frame_size = samples;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (samples) {
|
data_size_tmp = samples * avctx->channels *
|
||||||
/* get output buffer */
|
av_get_bytes_per_sample(avctx->sample_fmt);
|
||||||
ac->frame.nb_samples = samples;
|
if (*data_size < data_size_tmp) {
|
||||||
if ((err = avctx->get_buffer(avctx, &ac->frame)) < 0) {
|
av_log(avctx, AV_LOG_ERROR,
|
||||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
"Output buffer too small (%d) or trying to output too many samples (%d) for this frame.\n",
|
||||||
return err;
|
*data_size, data_size_tmp);
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
*data_size = data_size_tmp;
|
||||||
|
|
||||||
|
if (samples) {
|
||||||
if (avctx->sample_fmt == AV_SAMPLE_FMT_FLT)
|
if (avctx->sample_fmt == AV_SAMPLE_FMT_FLT)
|
||||||
ac->fmt_conv.float_interleave((float *)ac->frame.data[0],
|
ac->fmt_conv.float_interleave(data, (const float **)ac->output_data,
|
||||||
(const float **)ac->output_data,
|
|
||||||
samples, avctx->channels);
|
samples, avctx->channels);
|
||||||
else
|
else
|
||||||
ac->fmt_conv.float_to_int16_interleave((int16_t *)ac->frame.data[0],
|
ac->fmt_conv.float_to_int16_interleave(data, (const float **)ac->output_data,
|
||||||
(const float **)ac->output_data,
|
|
||||||
samples, avctx->channels);
|
samples, avctx->channels);
|
||||||
|
|
||||||
*(AVFrame *)data = ac->frame;
|
|
||||||
}
|
}
|
||||||
*got_frame_ptr = !!samples;
|
|
||||||
|
|
||||||
if (ac->output_configured && audio_found)
|
if (ac->output_configured && audio_found)
|
||||||
ac->output_configured = OC_LOCKED;
|
ac->output_configured = OC_LOCKED;
|
||||||
@@ -2292,37 +2205,18 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int aac_decode_frame(AVCodecContext *avctx, void *data,
|
static int aac_decode_frame(AVCodecContext *avctx, void *data,
|
||||||
int *got_frame_ptr, AVPacket *avpkt)
|
int *data_size, AVPacket *avpkt)
|
||||||
{
|
{
|
||||||
AACContext *ac = avctx->priv_data;
|
|
||||||
const uint8_t *buf = avpkt->data;
|
const uint8_t *buf = avpkt->data;
|
||||||
int buf_size = avpkt->size;
|
int buf_size = avpkt->size;
|
||||||
GetBitContext gb;
|
GetBitContext gb;
|
||||||
int buf_consumed;
|
int buf_consumed;
|
||||||
int buf_offset;
|
int buf_offset;
|
||||||
int err;
|
int err;
|
||||||
int new_extradata_size;
|
|
||||||
const uint8_t *new_extradata = av_packet_get_side_data(avpkt,
|
|
||||||
AV_PKT_DATA_NEW_EXTRADATA,
|
|
||||||
&new_extradata_size);
|
|
||||||
|
|
||||||
if (new_extradata) {
|
|
||||||
av_free(avctx->extradata);
|
|
||||||
avctx->extradata = av_mallocz(new_extradata_size +
|
|
||||||
FF_INPUT_BUFFER_PADDING_SIZE);
|
|
||||||
if (!avctx->extradata)
|
|
||||||
return AVERROR(ENOMEM);
|
|
||||||
avctx->extradata_size = new_extradata_size;
|
|
||||||
memcpy(avctx->extradata, new_extradata, new_extradata_size);
|
|
||||||
if (decode_audio_specific_config(ac, ac->avctx, &ac->m4ac,
|
|
||||||
avctx->extradata,
|
|
||||||
avctx->extradata_size*8, 1) < 0)
|
|
||||||
return AVERROR_INVALIDDATA;
|
|
||||||
}
|
|
||||||
|
|
||||||
init_get_bits(&gb, buf, buf_size * 8);
|
init_get_bits(&gb, buf, buf_size * 8);
|
||||||
|
|
||||||
if ((err = aac_decode_frame_int(avctx, data, got_frame_ptr, &gb)) < 0)
|
if ((err = aac_decode_frame_int(avctx, data, data_size, &gb)) < 0)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
buf_consumed = (get_bits_count(&gb) + 7) >> 3;
|
buf_consumed = (get_bits_count(&gb) + 7) >> 3;
|
||||||
@@ -2373,44 +2267,29 @@ static inline uint32_t latm_get_value(GetBitContext *b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int latm_decode_audio_specific_config(struct LATMContext *latmctx,
|
static int latm_decode_audio_specific_config(struct LATMContext *latmctx,
|
||||||
GetBitContext *gb, int asclen)
|
GetBitContext *gb)
|
||||||
{
|
{
|
||||||
AACContext *ac = &latmctx->aac_ctx;
|
AVCodecContext *avctx = latmctx->aac_ctx.avctx;
|
||||||
AVCodecContext *avctx = ac->avctx;
|
MPEG4AudioConfig m4ac;
|
||||||
MPEG4AudioConfig m4ac = {0};
|
|
||||||
int config_start_bit = get_bits_count(gb);
|
int config_start_bit = get_bits_count(gb);
|
||||||
int sync_extension = 0;
|
|
||||||
int bits_consumed, esize;
|
int bits_consumed, esize;
|
||||||
|
|
||||||
if (asclen) {
|
|
||||||
sync_extension = 1;
|
|
||||||
asclen = FFMIN(asclen, get_bits_left(gb));
|
|
||||||
} else
|
|
||||||
asclen = get_bits_left(gb);
|
|
||||||
|
|
||||||
if (config_start_bit % 8) {
|
if (config_start_bit % 8) {
|
||||||
av_log_missing_feature(latmctx->aac_ctx.avctx, "audio specific "
|
av_log_missing_feature(latmctx->aac_ctx.avctx, "audio specific "
|
||||||
"config not byte aligned.\n", 1);
|
"config not byte aligned.\n", 1);
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
} else {
|
||||||
if (asclen <= 0)
|
bits_consumed =
|
||||||
return AVERROR_INVALIDDATA;
|
decode_audio_specific_config(NULL, avctx, &m4ac,
|
||||||
bits_consumed = decode_audio_specific_config(NULL, avctx, &m4ac,
|
|
||||||
gb->buffer + (config_start_bit / 8),
|
gb->buffer + (config_start_bit / 8),
|
||||||
asclen, sync_extension);
|
get_bits_left(gb) / 8);
|
||||||
|
|
||||||
if (bits_consumed < 0)
|
if (bits_consumed < 0)
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
|
|
||||||
if (ac->m4ac.sample_rate != m4ac.sample_rate ||
|
|
||||||
ac->m4ac.chan_config != m4ac.chan_config) {
|
|
||||||
|
|
||||||
av_log(avctx, AV_LOG_INFO, "audio config changed\n");
|
|
||||||
latmctx->initialized = 0;
|
|
||||||
|
|
||||||
esize = (bits_consumed+7) / 8;
|
esize = (bits_consumed+7) / 8;
|
||||||
|
|
||||||
if (avctx->extradata_size < esize) {
|
if (avctx->extradata_size <= esize) {
|
||||||
av_free(avctx->extradata);
|
av_free(avctx->extradata);
|
||||||
avctx->extradata = av_malloc(esize + FF_INPUT_BUFFER_PADDING_SIZE);
|
avctx->extradata = av_malloc(esize + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||||
if (!avctx->extradata)
|
if (!avctx->extradata)
|
||||||
@@ -2420,8 +2299,9 @@ static int latm_decode_audio_specific_config(struct LATMContext *latmctx,
|
|||||||
avctx->extradata_size = esize;
|
avctx->extradata_size = esize;
|
||||||
memcpy(avctx->extradata, gb->buffer + (config_start_bit/8), esize);
|
memcpy(avctx->extradata, gb->buffer + (config_start_bit/8), esize);
|
||||||
memset(avctx->extradata+esize, 0, FF_INPUT_BUFFER_PADDING_SIZE);
|
memset(avctx->extradata+esize, 0, FF_INPUT_BUFFER_PADDING_SIZE);
|
||||||
}
|
|
||||||
skip_bits_long(gb, bits_consumed);
|
skip_bits_long(gb, bits_consumed);
|
||||||
|
}
|
||||||
|
|
||||||
return bits_consumed;
|
return bits_consumed;
|
||||||
}
|
}
|
||||||
@@ -2460,11 +2340,11 @@ static int read_stream_mux_config(struct LATMContext *latmctx,
|
|||||||
|
|
||||||
// for all but first stream: use_same_config = get_bits(gb, 1);
|
// for all but first stream: use_same_config = get_bits(gb, 1);
|
||||||
if (!audio_mux_version) {
|
if (!audio_mux_version) {
|
||||||
if ((ret = latm_decode_audio_specific_config(latmctx, gb, 0)) < 0)
|
if ((ret = latm_decode_audio_specific_config(latmctx, gb)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
} else {
|
} else {
|
||||||
int ascLen = latm_get_value(gb);
|
int ascLen = latm_get_value(gb);
|
||||||
if ((ret = latm_decode_audio_specific_config(latmctx, gb, ascLen)) < 0)
|
if ((ret = latm_decode_audio_specific_config(latmctx, gb)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
ascLen -= ret;
|
ascLen -= ret;
|
||||||
skip_bits_long(gb, ascLen);
|
skip_bits_long(gb, ascLen);
|
||||||
@@ -2558,13 +2438,16 @@ static int read_audio_mux_element(struct LATMContext *latmctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int latm_decode_frame(AVCodecContext *avctx, void *out,
|
static int latm_decode_frame(AVCodecContext *avctx, void *out, int *out_size,
|
||||||
int *got_frame_ptr, AVPacket *avpkt)
|
AVPacket *avpkt)
|
||||||
{
|
{
|
||||||
struct LATMContext *latmctx = avctx->priv_data;
|
struct LATMContext *latmctx = avctx->priv_data;
|
||||||
int muxlength, err;
|
int muxlength, err;
|
||||||
GetBitContext gb;
|
GetBitContext gb;
|
||||||
|
|
||||||
|
if (avpkt->size == 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
init_get_bits(&gb, avpkt->data, avpkt->size * 8);
|
init_get_bits(&gb, avpkt->data, avpkt->size * 8);
|
||||||
|
|
||||||
// check for LOAS sync word
|
// check for LOAS sync word
|
||||||
@@ -2581,12 +2464,11 @@ static int latm_decode_frame(AVCodecContext *avctx, void *out,
|
|||||||
|
|
||||||
if (!latmctx->initialized) {
|
if (!latmctx->initialized) {
|
||||||
if (!avctx->extradata) {
|
if (!avctx->extradata) {
|
||||||
*got_frame_ptr = 0;
|
*out_size = 0;
|
||||||
return avpkt->size;
|
return avpkt->size;
|
||||||
} else {
|
} else {
|
||||||
if ((err = decode_audio_specific_config(
|
aac_decode_close(avctx);
|
||||||
&latmctx->aac_ctx, avctx, &latmctx->aac_ctx.m4ac,
|
if ((err = aac_decode_init(avctx)) < 0)
|
||||||
avctx->extradata, avctx->extradata_size*8, 1)) < 0)
|
|
||||||
return err;
|
return err;
|
||||||
latmctx->initialized = 1;
|
latmctx->initialized = 1;
|
||||||
}
|
}
|
||||||
@@ -2599,7 +2481,7 @@ static int latm_decode_frame(AVCodecContext *avctx, void *out,
|
|||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((err = aac_decode_frame_int(avctx, out, got_frame_ptr, &gb)) < 0)
|
if ((err = aac_decode_frame_int(avctx, out, out_size, &gb)) < 0)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
return muxlength;
|
return muxlength;
|
||||||
@@ -2608,28 +2490,33 @@ static int latm_decode_frame(AVCodecContext *avctx, void *out,
|
|||||||
av_cold static int latm_decode_init(AVCodecContext *avctx)
|
av_cold static int latm_decode_init(AVCodecContext *avctx)
|
||||||
{
|
{
|
||||||
struct LATMContext *latmctx = avctx->priv_data;
|
struct LATMContext *latmctx = avctx->priv_data;
|
||||||
int ret = aac_decode_init(avctx);
|
int ret;
|
||||||
|
|
||||||
if (avctx->extradata_size > 0)
|
ret = aac_decode_init(avctx);
|
||||||
|
|
||||||
|
if (avctx->extradata_size > 0) {
|
||||||
latmctx->initialized = !ret;
|
latmctx->initialized = !ret;
|
||||||
|
} else {
|
||||||
|
latmctx->initialized = 0;
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
AVCodec ff_aac_decoder = {
|
AVCodec ff_aac_decoder = {
|
||||||
.name = "aac",
|
"aac",
|
||||||
.type = AVMEDIA_TYPE_AUDIO,
|
AVMEDIA_TYPE_AUDIO,
|
||||||
.id = CODEC_ID_AAC,
|
CODEC_ID_AAC,
|
||||||
.priv_data_size = sizeof(AACContext),
|
sizeof(AACContext),
|
||||||
.init = aac_decode_init,
|
aac_decode_init,
|
||||||
.close = aac_decode_close,
|
NULL,
|
||||||
.decode = aac_decode_frame,
|
aac_decode_close,
|
||||||
|
aac_decode_frame,
|
||||||
.long_name = NULL_IF_CONFIG_SMALL("Advanced Audio Coding"),
|
.long_name = NULL_IF_CONFIG_SMALL("Advanced Audio Coding"),
|
||||||
.sample_fmts = (const enum AVSampleFormat[]) {
|
.sample_fmts = (const enum AVSampleFormat[]) {
|
||||||
AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE
|
AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE
|
||||||
},
|
},
|
||||||
.capabilities = CODEC_CAP_CHANNEL_CONF | CODEC_CAP_DR1,
|
|
||||||
.channel_layouts = aac_channel_layout,
|
.channel_layouts = aac_channel_layout,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -2650,7 +2537,5 @@ AVCodec ff_aac_latm_decoder = {
|
|||||||
.sample_fmts = (const enum AVSampleFormat[]) {
|
.sample_fmts = (const enum AVSampleFormat[]) {
|
||||||
AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE
|
AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE
|
||||||
},
|
},
|
||||||
.capabilities = CODEC_CAP_CHANNEL_CONF | CODEC_CAP_DR1,
|
|
||||||
.channel_layouts = aac_channel_layout,
|
.channel_layouts = aac_channel_layout,
|
||||||
.flush = flush,
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ static const uint8_t aac_channel_layout_map[7][5][2] = {
|
|||||||
{ { TYPE_CPE, 0 }, { TYPE_SCE, 0 }, { TYPE_LFE, 0 }, { TYPE_CPE, 2 }, { TYPE_CPE, 1 }, },
|
{ { TYPE_CPE, 0 }, { TYPE_SCE, 0 }, { TYPE_LFE, 0 }, { TYPE_CPE, 2 }, { TYPE_CPE, 1 }, },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const uint64_t aac_channel_layout[8] = {
|
static const int64_t aac_channel_layout[8] = {
|
||||||
AV_CH_LAYOUT_MONO,
|
AV_CH_LAYOUT_MONO,
|
||||||
AV_CH_LAYOUT_STEREO,
|
AV_CH_LAYOUT_STEREO,
|
||||||
AV_CH_LAYOUT_SURROUND,
|
AV_CH_LAYOUT_SURROUND,
|
||||||
|
|||||||
@@ -46,14 +46,6 @@
|
|||||||
|
|
||||||
#define AAC_MAX_CHANNELS 6
|
#define AAC_MAX_CHANNELS 6
|
||||||
|
|
||||||
#define ERROR_IF(cond, ...) \
|
|
||||||
if (cond) { \
|
|
||||||
av_log(avctx, AV_LOG_ERROR, __VA_ARGS__); \
|
|
||||||
return AVERROR(EINVAL); \
|
|
||||||
}
|
|
||||||
|
|
||||||
float ff_aac_pow34sf_tab[428];
|
|
||||||
|
|
||||||
static const uint8_t swb_size_1024_96[] = {
|
static const uint8_t swb_size_1024_96[] = {
|
||||||
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8,
|
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8,
|
||||||
12, 12, 12, 12, 12, 16, 16, 24, 28, 36, 44,
|
12, 12, 12, 12, 12, 16, 16, 24, 28, 36, 44,
|
||||||
@@ -143,10 +135,7 @@ static const uint8_t aac_chan_configs[6][5] = {
|
|||||||
{4, TYPE_SCE, TYPE_CPE, TYPE_CPE, TYPE_LFE}, // 6 channels - front center + stereo + back stereo + LFE
|
{4, TYPE_SCE, TYPE_CPE, TYPE_CPE, TYPE_LFE}, // 6 channels - front center + stereo + back stereo + LFE
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
static const uint8_t channel_maps[][AAC_MAX_CHANNELS] = {
|
||||||
* Table to remap channels from Libav's default order to AAC order.
|
|
||||||
*/
|
|
||||||
static const uint8_t aac_chan_maps[AAC_MAX_CHANNELS][AAC_MAX_CHANNELS] = {
|
|
||||||
{ 0 },
|
{ 0 },
|
||||||
{ 0, 1 },
|
{ 0, 1 },
|
||||||
{ 2, 0, 1 },
|
{ 2, 0, 1 },
|
||||||
@@ -167,7 +156,7 @@ static void put_audio_specific_config(AVCodecContext *avctx)
|
|||||||
init_put_bits(&pb, avctx->extradata, avctx->extradata_size*8);
|
init_put_bits(&pb, avctx->extradata, avctx->extradata_size*8);
|
||||||
put_bits(&pb, 5, 2); //object type - AAC-LC
|
put_bits(&pb, 5, 2); //object type - AAC-LC
|
||||||
put_bits(&pb, 4, s->samplerate_index); //sample rate index
|
put_bits(&pb, 4, s->samplerate_index); //sample rate index
|
||||||
put_bits(&pb, 4, s->channels);
|
put_bits(&pb, 4, avctx->channels);
|
||||||
//GASpecificConfig
|
//GASpecificConfig
|
||||||
put_bits(&pb, 1, 0); //frame length - 1024 samples
|
put_bits(&pb, 1, 0); //frame length - 1024 samples
|
||||||
put_bits(&pb, 1, 0); //does not depend on core coder
|
put_bits(&pb, 1, 0); //does not depend on core coder
|
||||||
@@ -180,80 +169,113 @@ static void put_audio_specific_config(AVCodecContext *avctx)
|
|||||||
flush_put_bits(&pb);
|
flush_put_bits(&pb);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define WINDOW_FUNC(type) \
|
static av_cold int aac_encode_init(AVCodecContext *avctx)
|
||||||
static void apply_ ##type ##_window(DSPContext *dsp, SingleChannelElement *sce, const float *audio)
|
|
||||||
|
|
||||||
WINDOW_FUNC(only_long)
|
|
||||||
{
|
{
|
||||||
|
AACEncContext *s = avctx->priv_data;
|
||||||
|
int i;
|
||||||
|
const uint8_t *sizes[2];
|
||||||
|
int lengths[2];
|
||||||
|
|
||||||
|
avctx->frame_size = 1024;
|
||||||
|
|
||||||
|
for (i = 0; i < 16; i++)
|
||||||
|
if (avctx->sample_rate == ff_mpeg4audio_sample_rates[i])
|
||||||
|
break;
|
||||||
|
if (i == 16) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "Unsupported sample rate %d\n", avctx->sample_rate);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (avctx->channels > AAC_MAX_CHANNELS) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "Unsupported number of channels: %d\n", avctx->channels);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (avctx->profile != FF_PROFILE_UNKNOWN && avctx->profile != FF_PROFILE_AAC_LOW) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "Unsupported profile %d\n", avctx->profile);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (1024.0 * avctx->bit_rate / avctx->sample_rate > 6144 * avctx->channels) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "Too many bits per frame requested\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
s->samplerate_index = i;
|
||||||
|
|
||||||
|
dsputil_init(&s->dsp, avctx);
|
||||||
|
ff_mdct_init(&s->mdct1024, 11, 0, 1.0);
|
||||||
|
ff_mdct_init(&s->mdct128, 8, 0, 1.0);
|
||||||
|
// window init
|
||||||
|
ff_kbd_window_init(ff_aac_kbd_long_1024, 4.0, 1024);
|
||||||
|
ff_kbd_window_init(ff_aac_kbd_short_128, 6.0, 128);
|
||||||
|
ff_init_ff_sine_windows(10);
|
||||||
|
ff_init_ff_sine_windows(7);
|
||||||
|
|
||||||
|
s->samples = av_malloc(2 * 1024 * avctx->channels * sizeof(s->samples[0]));
|
||||||
|
s->cpe = av_mallocz(sizeof(ChannelElement) * aac_chan_configs[avctx->channels-1][0]);
|
||||||
|
avctx->extradata = av_mallocz(5 + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||||
|
avctx->extradata_size = 5;
|
||||||
|
put_audio_specific_config(avctx);
|
||||||
|
|
||||||
|
sizes[0] = swb_size_1024[i];
|
||||||
|
sizes[1] = swb_size_128[i];
|
||||||
|
lengths[0] = ff_aac_num_swb_1024[i];
|
||||||
|
lengths[1] = ff_aac_num_swb_128[i];
|
||||||
|
ff_psy_init(&s->psy, avctx, 2, sizes, lengths);
|
||||||
|
s->psypp = ff_psy_preprocess_init(avctx);
|
||||||
|
s->coder = &ff_aac_coders[2];
|
||||||
|
|
||||||
|
s->lambda = avctx->global_quality ? avctx->global_quality : 120;
|
||||||
|
|
||||||
|
ff_aac_tableinit();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void apply_window_and_mdct(AVCodecContext *avctx, AACEncContext *s,
|
||||||
|
SingleChannelElement *sce, short *audio)
|
||||||
|
{
|
||||||
|
int i, k;
|
||||||
|
const int chans = avctx->channels;
|
||||||
const float * lwindow = sce->ics.use_kb_window[0] ? ff_aac_kbd_long_1024 : ff_sine_1024;
|
const float * lwindow = sce->ics.use_kb_window[0] ? ff_aac_kbd_long_1024 : ff_sine_1024;
|
||||||
const float *pwindow = sce->ics.use_kb_window[1] ? ff_aac_kbd_long_1024 : ff_sine_1024;
|
|
||||||
float *out = sce->ret;
|
|
||||||
|
|
||||||
dsp->vector_fmul (out, audio, lwindow, 1024);
|
|
||||||
dsp->vector_fmul_reverse(out + 1024, audio + 1024, pwindow, 1024);
|
|
||||||
}
|
|
||||||
|
|
||||||
WINDOW_FUNC(long_start)
|
|
||||||
{
|
|
||||||
const float *lwindow = sce->ics.use_kb_window[1] ? ff_aac_kbd_long_1024 : ff_sine_1024;
|
|
||||||
const float *swindow = sce->ics.use_kb_window[0] ? ff_aac_kbd_short_128 : ff_sine_128;
|
|
||||||
float *out = sce->ret;
|
|
||||||
|
|
||||||
dsp->vector_fmul(out, audio, lwindow, 1024);
|
|
||||||
memcpy(out + 1024, audio, sizeof(out[0]) * 448);
|
|
||||||
dsp->vector_fmul_reverse(out + 1024 + 448, audio, swindow, 128);
|
|
||||||
memset(out + 1024 + 576, 0, sizeof(out[0]) * 448);
|
|
||||||
}
|
|
||||||
|
|
||||||
WINDOW_FUNC(long_stop)
|
|
||||||
{
|
|
||||||
const float *lwindow = sce->ics.use_kb_window[0] ? ff_aac_kbd_long_1024 : ff_sine_1024;
|
|
||||||
const float *swindow = sce->ics.use_kb_window[1] ? ff_aac_kbd_short_128 : ff_sine_128;
|
|
||||||
float *out = sce->ret;
|
|
||||||
|
|
||||||
memset(out, 0, sizeof(out[0]) * 448);
|
|
||||||
dsp->vector_fmul(out + 448, audio + 448, swindow, 128);
|
|
||||||
memcpy(out + 576, audio + 576, sizeof(out[0]) * 448);
|
|
||||||
dsp->vector_fmul_reverse(out + 1024, audio + 1024, lwindow, 1024);
|
|
||||||
}
|
|
||||||
|
|
||||||
WINDOW_FUNC(eight_short)
|
|
||||||
{
|
|
||||||
const float * swindow = sce->ics.use_kb_window[0] ? ff_aac_kbd_short_128 : ff_sine_128;
|
const float * swindow = sce->ics.use_kb_window[0] ? ff_aac_kbd_short_128 : ff_sine_128;
|
||||||
const float * pwindow = sce->ics.use_kb_window[1] ? ff_aac_kbd_short_128 : ff_sine_128;
|
const float * pwindow = sce->ics.use_kb_window[1] ? ff_aac_kbd_short_128 : ff_sine_128;
|
||||||
const float *in = audio + 448;
|
|
||||||
float *out = sce->ret;
|
|
||||||
|
|
||||||
for (int w = 0; w < 8; w++) {
|
|
||||||
dsp->vector_fmul (out, in, w ? pwindow : swindow, 128);
|
|
||||||
out += 128;
|
|
||||||
in += 128;
|
|
||||||
dsp->vector_fmul_reverse(out, in, swindow, 128);
|
|
||||||
out += 128;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void (*const apply_window[4])(DSPContext *dsp, SingleChannelElement *sce, const float *audio) = {
|
|
||||||
[ONLY_LONG_SEQUENCE] = apply_only_long_window,
|
|
||||||
[LONG_START_SEQUENCE] = apply_long_start_window,
|
|
||||||
[EIGHT_SHORT_SEQUENCE] = apply_eight_short_window,
|
|
||||||
[LONG_STOP_SEQUENCE] = apply_long_stop_window
|
|
||||||
};
|
|
||||||
|
|
||||||
static void apply_window_and_mdct(AACEncContext *s, SingleChannelElement *sce,
|
|
||||||
float *audio)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
float *output = sce->ret;
|
float *output = sce->ret;
|
||||||
|
|
||||||
apply_window[sce->ics.window_sequence[0]](&s->dsp, sce, audio);
|
if (sce->ics.window_sequence[0] != EIGHT_SHORT_SEQUENCE) {
|
||||||
|
memcpy(output, sce->saved, sizeof(float)*1024);
|
||||||
if (sce->ics.window_sequence[0] != EIGHT_SHORT_SEQUENCE)
|
if (sce->ics.window_sequence[0] == LONG_STOP_SEQUENCE) {
|
||||||
|
memset(output, 0, sizeof(output[0]) * 448);
|
||||||
|
for (i = 448; i < 576; i++)
|
||||||
|
output[i] = sce->saved[i] * pwindow[i - 448];
|
||||||
|
for (i = 576; i < 704; i++)
|
||||||
|
output[i] = sce->saved[i];
|
||||||
|
}
|
||||||
|
if (sce->ics.window_sequence[0] != LONG_START_SEQUENCE) {
|
||||||
|
for (i = 0; i < 1024; i++) {
|
||||||
|
output[i+1024] = audio[i * chans] * lwindow[1024 - i - 1];
|
||||||
|
sce->saved[i] = audio[i * chans] * lwindow[i];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (i = 0; i < 448; i++)
|
||||||
|
output[i+1024] = audio[i * chans];
|
||||||
|
for (; i < 576; i++)
|
||||||
|
output[i+1024] = audio[i * chans] * swindow[576 - i - 1];
|
||||||
|
memset(output+1024+576, 0, sizeof(output[0]) * 448);
|
||||||
|
for (i = 0; i < 1024; i++)
|
||||||
|
sce->saved[i] = audio[i * chans];
|
||||||
|
}
|
||||||
s->mdct1024.mdct_calc(&s->mdct1024, sce->coeffs, output);
|
s->mdct1024.mdct_calc(&s->mdct1024, sce->coeffs, output);
|
||||||
else
|
} else {
|
||||||
for (i = 0; i < 1024; i += 128)
|
for (k = 0; k < 1024; k += 128) {
|
||||||
s->mdct128.mdct_calc(&s->mdct128, sce->coeffs + i, output + i*2);
|
for (i = 448 + k; i < 448 + k + 256; i++)
|
||||||
memcpy(audio, audio + 1024, sizeof(audio[0]) * 1024);
|
output[i - 448 - k] = (i < 1024)
|
||||||
|
? sce->saved[i]
|
||||||
|
: audio[(i-1024)*chans];
|
||||||
|
s->dsp.vector_fmul (output, output, k ? swindow : pwindow, 128);
|
||||||
|
s->dsp.vector_fmul_reverse(output+128, output+128, swindow, 128);
|
||||||
|
s->mdct128.mdct_calc(&s->mdct128, sce->coeffs + k, output);
|
||||||
|
}
|
||||||
|
for (i = 0; i < 1024; i++)
|
||||||
|
sce->saved[i] = audio[i * chans];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -350,7 +372,7 @@ static void adjust_frame_information(AACEncContext *apc, ChannelElement *cpe, in
|
|||||||
if (msc == 0 || ics0->max_sfb == 0)
|
if (msc == 0 || ics0->max_sfb == 0)
|
||||||
cpe->ms_mode = 0;
|
cpe->ms_mode = 0;
|
||||||
else
|
else
|
||||||
cpe->ms_mode = msc < ics0->max_sfb * ics0->num_windows ? 1 : 2;
|
cpe->ms_mode = msc < ics0->max_sfb ? 1 : 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -462,75 +484,70 @@ static void put_bitstream_info(AVCodecContext *avctx, AACEncContext *s,
|
|||||||
put_bits(&s->pb, 3, TYPE_FIL);
|
put_bits(&s->pb, 3, TYPE_FIL);
|
||||||
put_bits(&s->pb, 4, FFMIN(namelen, 15));
|
put_bits(&s->pb, 4, FFMIN(namelen, 15));
|
||||||
if (namelen >= 15)
|
if (namelen >= 15)
|
||||||
put_bits(&s->pb, 8, namelen - 14);
|
put_bits(&s->pb, 8, namelen - 16);
|
||||||
put_bits(&s->pb, 4, 0); //extension type - filler
|
put_bits(&s->pb, 4, 0); //extension type - filler
|
||||||
padbits = -put_bits_count(&s->pb) & 7;
|
padbits = 8 - (put_bits_count(&s->pb) & 7);
|
||||||
avpriv_align_put_bits(&s->pb);
|
align_put_bits(&s->pb);
|
||||||
for (i = 0; i < namelen - 2; i++)
|
for (i = 0; i < namelen - 2; i++)
|
||||||
put_bits(&s->pb, 8, name[i]);
|
put_bits(&s->pb, 8, name[i]);
|
||||||
put_bits(&s->pb, 12 - padbits, 0);
|
put_bits(&s->pb, 12 - padbits, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Deinterleave input samples.
|
|
||||||
* Channels are reordered from Libav's default order to AAC order.
|
|
||||||
*/
|
|
||||||
static void deinterleave_input_samples(AACEncContext *s,
|
|
||||||
const float *samples)
|
|
||||||
{
|
|
||||||
int ch, i;
|
|
||||||
const int sinc = s->channels;
|
|
||||||
const uint8_t *channel_map = aac_chan_maps[sinc - 1];
|
|
||||||
|
|
||||||
/* deinterleave and remap input samples */
|
|
||||||
for (ch = 0; ch < sinc; ch++) {
|
|
||||||
const float *sptr = samples + channel_map[ch];
|
|
||||||
|
|
||||||
/* copy last 1024 samples of previous frame to the start of the current frame */
|
|
||||||
memcpy(&s->planar_samples[ch][0], &s->planar_samples[ch][1024], 1024 * sizeof(s->planar_samples[0][0]));
|
|
||||||
|
|
||||||
/* deinterleave */
|
|
||||||
for (i = 1024; i < 1024 * 2; i++) {
|
|
||||||
s->planar_samples[ch][i] = *sptr;
|
|
||||||
sptr += sinc;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static int aac_encode_frame(AVCodecContext *avctx,
|
static int aac_encode_frame(AVCodecContext *avctx,
|
||||||
uint8_t *frame, int buf_size, void *data)
|
uint8_t *frame, int buf_size, void *data)
|
||||||
{
|
{
|
||||||
AACEncContext *s = avctx->priv_data;
|
AACEncContext *s = avctx->priv_data;
|
||||||
float **samples = s->planar_samples, *samples2, *la, *overlap;
|
int16_t *samples = s->samples, *samples2, *la;
|
||||||
ChannelElement *cpe;
|
ChannelElement *cpe;
|
||||||
int i, ch, w, g, chans, tag, start_ch;
|
int i, ch, w, g, chans, tag, start_ch;
|
||||||
|
const uint8_t *chan_map = aac_chan_configs[avctx->channels-1];
|
||||||
int chan_el_counter[4];
|
int chan_el_counter[4];
|
||||||
FFPsyWindowInfo windows[AAC_MAX_CHANNELS];
|
FFPsyWindowInfo windows[AAC_MAX_CHANNELS];
|
||||||
|
|
||||||
if (s->last_frame)
|
if (s->last_frame)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (data) {
|
if (data) {
|
||||||
deinterleave_input_samples(s, data);
|
if (!s->psypp) {
|
||||||
if (s->psypp)
|
if (avctx->channels <= 2) {
|
||||||
ff_psy_preprocess(s->psypp, s->planar_samples, s->channels);
|
memcpy(s->samples + 1024 * avctx->channels, data,
|
||||||
|
1024 * avctx->channels * sizeof(s->samples[0]));
|
||||||
|
} else {
|
||||||
|
for (i = 0; i < 1024; i++)
|
||||||
|
for (ch = 0; ch < avctx->channels; ch++)
|
||||||
|
s->samples[(i + 1024) * avctx->channels + ch] =
|
||||||
|
((int16_t*)data)[i * avctx->channels +
|
||||||
|
channel_maps[avctx->channels-1][ch]];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
start_ch = 0;
|
||||||
|
samples2 = s->samples + 1024 * avctx->channels;
|
||||||
|
for (i = 0; i < chan_map[0]; i++) {
|
||||||
|
tag = chan_map[i+1];
|
||||||
|
chans = tag == TYPE_CPE ? 2 : 1;
|
||||||
|
ff_psy_preprocess(s->psypp,
|
||||||
|
(uint16_t*)data + channel_maps[avctx->channels-1][start_ch],
|
||||||
|
samples2 + start_ch, start_ch, chans);
|
||||||
|
start_ch += chans;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!avctx->frame_number) {
|
||||||
|
memcpy(s->samples, s->samples + 1024 * avctx->channels,
|
||||||
|
1024 * avctx->channels * sizeof(s->samples[0]));
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!avctx->frame_number)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
start_ch = 0;
|
start_ch = 0;
|
||||||
for (i = 0; i < s->chan_map[0]; i++) {
|
for (i = 0; i < chan_map[0]; i++) {
|
||||||
FFPsyWindowInfo* wi = windows + start_ch;
|
FFPsyWindowInfo* wi = windows + start_ch;
|
||||||
tag = s->chan_map[i+1];
|
tag = chan_map[i+1];
|
||||||
chans = tag == TYPE_CPE ? 2 : 1;
|
chans = tag == TYPE_CPE ? 2 : 1;
|
||||||
cpe = &s->cpe[i];
|
cpe = &s->cpe[i];
|
||||||
for (ch = 0; ch < chans; ch++) {
|
for (ch = 0; ch < chans; ch++) {
|
||||||
IndividualChannelStream *ics = &cpe->ch[ch].ics;
|
IndividualChannelStream *ics = &cpe->ch[ch].ics;
|
||||||
int cur_channel = start_ch + ch;
|
int cur_channel = start_ch + ch;
|
||||||
overlap = &samples[cur_channel][0];
|
samples2 = samples + cur_channel;
|
||||||
samples2 = overlap + 1024;
|
la = samples2 + (448+64) * avctx->channels;
|
||||||
la = samples2 + (448+64);
|
|
||||||
if (!data)
|
if (!data)
|
||||||
la = NULL;
|
la = NULL;
|
||||||
if (tag == TYPE_LFE) {
|
if (tag == TYPE_LFE) {
|
||||||
@@ -538,12 +555,6 @@ static int aac_encode_frame(AVCodecContext *avctx,
|
|||||||
wi[ch].window_shape = 0;
|
wi[ch].window_shape = 0;
|
||||||
wi[ch].num_windows = 1;
|
wi[ch].num_windows = 1;
|
||||||
wi[ch].grouping[0] = 1;
|
wi[ch].grouping[0] = 1;
|
||||||
|
|
||||||
/* Only the lowest 12 coefficients are used in a LFE channel.
|
|
||||||
* The expression below results in only the bottom 8 coefficients
|
|
||||||
* being used for 11.025kHz to 16kHz sample rates.
|
|
||||||
*/
|
|
||||||
ics->num_swb = s->samplerate_index >= 8 ? 1 : 3;
|
|
||||||
} else {
|
} else {
|
||||||
wi[ch] = s->psy.model->window(&s->psy, samples2, la, cur_channel,
|
wi[ch] = s->psy.model->window(&s->psy, samples2, la, cur_channel,
|
||||||
ics->window_sequence[0]);
|
ics->window_sequence[0]);
|
||||||
@@ -554,11 +565,11 @@ static int aac_encode_frame(AVCodecContext *avctx,
|
|||||||
ics->use_kb_window[0] = wi[ch].window_shape;
|
ics->use_kb_window[0] = wi[ch].window_shape;
|
||||||
ics->num_windows = wi[ch].num_windows;
|
ics->num_windows = wi[ch].num_windows;
|
||||||
ics->swb_sizes = s->psy.bands [ics->num_windows == 8];
|
ics->swb_sizes = s->psy.bands [ics->num_windows == 8];
|
||||||
ics->num_swb = tag == TYPE_LFE ? ics->num_swb : s->psy.num_bands[ics->num_windows == 8];
|
ics->num_swb = tag == TYPE_LFE ? 12 : s->psy.num_bands[ics->num_windows == 8];
|
||||||
for (w = 0; w < ics->num_windows; w++)
|
for (w = 0; w < ics->num_windows; w++)
|
||||||
ics->group_len[w] = wi[ch].grouping[w];
|
ics->group_len[w] = wi[ch].grouping[w];
|
||||||
|
|
||||||
apply_window_and_mdct(s, &cpe->ch[ch], overlap);
|
apply_window_and_mdct(avctx, s, &cpe->ch[ch], samples2);
|
||||||
}
|
}
|
||||||
start_ch += chans;
|
start_ch += chans;
|
||||||
}
|
}
|
||||||
@@ -569,19 +580,16 @@ static int aac_encode_frame(AVCodecContext *avctx,
|
|||||||
put_bitstream_info(avctx, s, LIBAVCODEC_IDENT);
|
put_bitstream_info(avctx, s, LIBAVCODEC_IDENT);
|
||||||
start_ch = 0;
|
start_ch = 0;
|
||||||
memset(chan_el_counter, 0, sizeof(chan_el_counter));
|
memset(chan_el_counter, 0, sizeof(chan_el_counter));
|
||||||
for (i = 0; i < s->chan_map[0]; i++) {
|
for (i = 0; i < chan_map[0]; i++) {
|
||||||
FFPsyWindowInfo* wi = windows + start_ch;
|
FFPsyWindowInfo* wi = windows + start_ch;
|
||||||
const float *coeffs[2];
|
tag = chan_map[i+1];
|
||||||
tag = s->chan_map[i+1];
|
|
||||||
chans = tag == TYPE_CPE ? 2 : 1;
|
chans = tag == TYPE_CPE ? 2 : 1;
|
||||||
cpe = &s->cpe[i];
|
cpe = &s->cpe[i];
|
||||||
put_bits(&s->pb, 3, tag);
|
put_bits(&s->pb, 3, tag);
|
||||||
put_bits(&s->pb, 4, chan_el_counter[tag]++);
|
put_bits(&s->pb, 4, chan_el_counter[tag]++);
|
||||||
for (ch = 0; ch < chans; ch++)
|
|
||||||
coeffs[ch] = cpe->ch[ch].coeffs;
|
|
||||||
s->psy.model->analyze(&s->psy, start_ch, coeffs, wi);
|
|
||||||
for (ch = 0; ch < chans; ch++) {
|
for (ch = 0; ch < chans; ch++) {
|
||||||
s->cur_channel = start_ch * 2 + ch;
|
s->cur_channel = start_ch + ch;
|
||||||
|
s->psy.model->analyze(&s->psy, s->cur_channel, cpe->ch[ch].coeffs, &wi[ch]);
|
||||||
s->coder->search_for_quantizers(avctx, s, &cpe->ch[ch], s->lambda);
|
s->coder->search_for_quantizers(avctx, s, &cpe->ch[ch], s->lambda);
|
||||||
}
|
}
|
||||||
cpe->common_window = 0;
|
cpe->common_window = 0;
|
||||||
@@ -597,7 +605,7 @@ static int aac_encode_frame(AVCodecContext *avctx,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
s->cur_channel = start_ch * 2;
|
s->cur_channel = start_ch;
|
||||||
if (s->options.stereo_mode && cpe->common_window) {
|
if (s->options.stereo_mode && cpe->common_window) {
|
||||||
if (s->options.stereo_mode > 0) {
|
if (s->options.stereo_mode > 0) {
|
||||||
IndividualChannelStream *ics = &cpe->ch[0].ics;
|
IndividualChannelStream *ics = &cpe->ch[0].ics;
|
||||||
@@ -624,8 +632,8 @@ static int aac_encode_frame(AVCodecContext *avctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
frame_bits = put_bits_count(&s->pb);
|
frame_bits = put_bits_count(&s->pb);
|
||||||
if (frame_bits <= 6144 * s->channels - 3) {
|
if (frame_bits <= 6144 * avctx->channels - 3) {
|
||||||
s->psy.bitres.bits = frame_bits / s->channels;
|
s->psy.bitres.bits = frame_bits / avctx->channels;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -646,7 +654,8 @@ static int aac_encode_frame(AVCodecContext *avctx,
|
|||||||
|
|
||||||
if (!data)
|
if (!data)
|
||||||
s->last_frame = 1;
|
s->last_frame = 1;
|
||||||
|
memcpy(s->samples, s->samples + 1024 * avctx->channels,
|
||||||
|
1024 * avctx->channels * sizeof(s->samples[0]));
|
||||||
return put_bits_count(&s->pb)>>3;
|
return put_bits_count(&s->pb)>>3;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -657,116 +666,18 @@ static av_cold int aac_encode_end(AVCodecContext *avctx)
|
|||||||
ff_mdct_end(&s->mdct1024);
|
ff_mdct_end(&s->mdct1024);
|
||||||
ff_mdct_end(&s->mdct128);
|
ff_mdct_end(&s->mdct128);
|
||||||
ff_psy_end(&s->psy);
|
ff_psy_end(&s->psy);
|
||||||
if (s->psypp)
|
|
||||||
ff_psy_preprocess_end(s->psypp);
|
ff_psy_preprocess_end(s->psypp);
|
||||||
av_freep(&s->buffer.samples);
|
av_freep(&s->samples);
|
||||||
av_freep(&s->cpe);
|
av_freep(&s->cpe);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static av_cold int dsp_init(AVCodecContext *avctx, AACEncContext *s)
|
|
||||||
{
|
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
dsputil_init(&s->dsp, avctx);
|
|
||||||
|
|
||||||
// window init
|
|
||||||
ff_kbd_window_init(ff_aac_kbd_long_1024, 4.0, 1024);
|
|
||||||
ff_kbd_window_init(ff_aac_kbd_short_128, 6.0, 128);
|
|
||||||
ff_init_ff_sine_windows(10);
|
|
||||||
ff_init_ff_sine_windows(7);
|
|
||||||
|
|
||||||
if (ret = ff_mdct_init(&s->mdct1024, 11, 0, 32768.0))
|
|
||||||
return ret;
|
|
||||||
if (ret = ff_mdct_init(&s->mdct128, 8, 0, 32768.0))
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static av_cold int alloc_buffers(AVCodecContext *avctx, AACEncContext *s)
|
|
||||||
{
|
|
||||||
FF_ALLOCZ_OR_GOTO(avctx, s->buffer.samples, 3 * 1024 * s->channels * sizeof(s->buffer.samples[0]), alloc_fail);
|
|
||||||
FF_ALLOCZ_OR_GOTO(avctx, s->cpe, sizeof(ChannelElement) * s->chan_map[0], alloc_fail);
|
|
||||||
FF_ALLOCZ_OR_GOTO(avctx, avctx->extradata, 5 + FF_INPUT_BUFFER_PADDING_SIZE, alloc_fail);
|
|
||||||
|
|
||||||
for(int ch = 0; ch < s->channels; ch++)
|
|
||||||
s->planar_samples[ch] = s->buffer.samples + 3 * 1024 * ch;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
alloc_fail:
|
|
||||||
return AVERROR(ENOMEM);
|
|
||||||
}
|
|
||||||
|
|
||||||
static av_cold int aac_encode_init(AVCodecContext *avctx)
|
|
||||||
{
|
|
||||||
AACEncContext *s = avctx->priv_data;
|
|
||||||
int i, ret = 0;
|
|
||||||
const uint8_t *sizes[2];
|
|
||||||
uint8_t grouping[AAC_MAX_CHANNELS];
|
|
||||||
int lengths[2];
|
|
||||||
|
|
||||||
avctx->frame_size = 1024;
|
|
||||||
|
|
||||||
for (i = 0; i < 16; i++)
|
|
||||||
if (avctx->sample_rate == avpriv_mpeg4audio_sample_rates[i])
|
|
||||||
break;
|
|
||||||
|
|
||||||
s->channels = avctx->channels;
|
|
||||||
|
|
||||||
ERROR_IF(i == 16,
|
|
||||||
"Unsupported sample rate %d\n", avctx->sample_rate);
|
|
||||||
ERROR_IF(s->channels > AAC_MAX_CHANNELS,
|
|
||||||
"Unsupported number of channels: %d\n", s->channels);
|
|
||||||
ERROR_IF(avctx->profile != FF_PROFILE_UNKNOWN && avctx->profile != FF_PROFILE_AAC_LOW,
|
|
||||||
"Unsupported profile %d\n", avctx->profile);
|
|
||||||
ERROR_IF(1024.0 * avctx->bit_rate / avctx->sample_rate > 6144 * s->channels,
|
|
||||||
"Too many bits per frame requested\n");
|
|
||||||
|
|
||||||
s->samplerate_index = i;
|
|
||||||
|
|
||||||
s->chan_map = aac_chan_configs[s->channels-1];
|
|
||||||
|
|
||||||
if (ret = dsp_init(avctx, s))
|
|
||||||
goto fail;
|
|
||||||
|
|
||||||
if (ret = alloc_buffers(avctx, s))
|
|
||||||
goto fail;
|
|
||||||
|
|
||||||
avctx->extradata_size = 5;
|
|
||||||
put_audio_specific_config(avctx);
|
|
||||||
|
|
||||||
sizes[0] = swb_size_1024[i];
|
|
||||||
sizes[1] = swb_size_128[i];
|
|
||||||
lengths[0] = ff_aac_num_swb_1024[i];
|
|
||||||
lengths[1] = ff_aac_num_swb_128[i];
|
|
||||||
for (i = 0; i < s->chan_map[0]; i++)
|
|
||||||
grouping[i] = s->chan_map[i + 1] == TYPE_CPE;
|
|
||||||
if (ret = ff_psy_init(&s->psy, avctx, 2, sizes, lengths, s->chan_map[0], grouping))
|
|
||||||
goto fail;
|
|
||||||
s->psypp = ff_psy_preprocess_init(avctx);
|
|
||||||
s->coder = &ff_aac_coders[s->options.aac_coder];
|
|
||||||
|
|
||||||
s->lambda = avctx->global_quality ? avctx->global_quality : 120;
|
|
||||||
|
|
||||||
ff_aac_tableinit();
|
|
||||||
|
|
||||||
for (i = 0; i < 428; i++)
|
|
||||||
ff_aac_pow34sf_tab[i] = sqrt(ff_aac_pow2sf_tab[i] * sqrt(ff_aac_pow2sf_tab[i]));
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
fail:
|
|
||||||
aac_encode_end(avctx);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
#define AACENC_FLAGS AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM
|
#define AACENC_FLAGS AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM
|
||||||
static const AVOption aacenc_options[] = {
|
static const AVOption aacenc_options[] = {
|
||||||
{"stereo_mode", "Stereo coding method", offsetof(AACEncContext, options.stereo_mode), AV_OPT_TYPE_INT, {.dbl = 0}, -1, 1, AACENC_FLAGS, "stereo_mode"},
|
{"stereo_mode", "Stereo coding method", offsetof(AACEncContext, options.stereo_mode), FF_OPT_TYPE_INT, {.dbl = 0}, -1, 1, AACENC_FLAGS, "stereo_mode"},
|
||||||
{"auto", "Selected by the Encoder", 0, AV_OPT_TYPE_CONST, {.dbl = -1 }, INT_MIN, INT_MAX, AACENC_FLAGS, "stereo_mode"},
|
{"auto", "Selected by the Encoder", 0, FF_OPT_TYPE_CONST, {.dbl = -1 }, INT_MIN, INT_MAX, AACENC_FLAGS, "stereo_mode"},
|
||||||
{"ms_off", "Disable Mid/Side coding", 0, AV_OPT_TYPE_CONST, {.dbl = 0 }, INT_MIN, INT_MAX, AACENC_FLAGS, "stereo_mode"},
|
{"ms_off", "Disable Mid/Side coding", 0, FF_OPT_TYPE_CONST, {.dbl = 0 }, INT_MIN, INT_MAX, AACENC_FLAGS, "stereo_mode"},
|
||||||
{"ms_force", "Force Mid/Side for the whole frame if possible", 0, AV_OPT_TYPE_CONST, {.dbl = 1 }, INT_MIN, INT_MAX, AACENC_FLAGS, "stereo_mode"},
|
{"ms_force", "Force Mid/Side for the whole frame if possible", 0, FF_OPT_TYPE_CONST, {.dbl = 1 }, INT_MIN, INT_MAX, AACENC_FLAGS, "stereo_mode"},
|
||||||
{"aac_coder", "", offsetof(AACEncContext, options.aac_coder), AV_OPT_TYPE_INT, {.dbl = 2}, 0, AAC_CODER_NB-1, AACENC_FLAGS},
|
|
||||||
{NULL}
|
{NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -778,15 +689,15 @@ static const AVClass aacenc_class = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
AVCodec ff_aac_encoder = {
|
AVCodec ff_aac_encoder = {
|
||||||
.name = "aac",
|
"aac",
|
||||||
.type = AVMEDIA_TYPE_AUDIO,
|
AVMEDIA_TYPE_AUDIO,
|
||||||
.id = CODEC_ID_AAC,
|
CODEC_ID_AAC,
|
||||||
.priv_data_size = sizeof(AACEncContext),
|
sizeof(AACEncContext),
|
||||||
.init = aac_encode_init,
|
aac_encode_init,
|
||||||
.encode = aac_encode_frame,
|
aac_encode_frame,
|
||||||
.close = aac_encode_end,
|
aac_encode_end,
|
||||||
.capabilities = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY | CODEC_CAP_EXPERIMENTAL,
|
.capabilities = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY | CODEC_CAP_EXPERIMENTAL,
|
||||||
.sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_FLT,AV_SAMPLE_FMT_NONE},
|
.sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE},
|
||||||
.long_name = NULL_IF_CONFIG_SMALL("Advanced Audio Coding"),
|
.long_name = NULL_IF_CONFIG_SMALL("Advanced Audio Coding"),
|
||||||
.priv_class = &aacenc_class,
|
.priv_class = &aacenc_class,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -30,11 +30,8 @@
|
|||||||
|
|
||||||
#include "psymodel.h"
|
#include "psymodel.h"
|
||||||
|
|
||||||
#define AAC_CODER_NB 4
|
|
||||||
|
|
||||||
typedef struct AACEncOptions {
|
typedef struct AACEncOptions {
|
||||||
int stereo_mode;
|
int stereo_mode;
|
||||||
int aac_coder;
|
|
||||||
} AACEncOptions;
|
} AACEncOptions;
|
||||||
|
|
||||||
struct AACEncContext;
|
struct AACEncContext;
|
||||||
@@ -61,11 +58,9 @@ typedef struct AACEncContext {
|
|||||||
FFTContext mdct1024; ///< long (1024 samples) frame transform context
|
FFTContext mdct1024; ///< long (1024 samples) frame transform context
|
||||||
FFTContext mdct128; ///< short (128 samples) frame transform context
|
FFTContext mdct128; ///< short (128 samples) frame transform context
|
||||||
DSPContext dsp;
|
DSPContext dsp;
|
||||||
float *planar_samples[6]; ///< saved preprocessed input
|
int16_t *samples; ///< saved preprocessed input
|
||||||
|
|
||||||
int samplerate_index; ///< MPEG-4 samplerate index
|
int samplerate_index; ///< MPEG-4 samplerate index
|
||||||
int channels; ///< channel count
|
|
||||||
const uint8_t *chan_map; ///< channel configuration map
|
|
||||||
|
|
||||||
ChannelElement *cpe; ///< channel elements
|
ChannelElement *cpe; ///< channel elements
|
||||||
FFPsyContext psy;
|
FFPsyContext psy;
|
||||||
@@ -76,12 +71,6 @@ typedef struct AACEncContext {
|
|||||||
float lambda;
|
float lambda;
|
||||||
DECLARE_ALIGNED(16, int, qcoefs)[96]; ///< quantized coefficients
|
DECLARE_ALIGNED(16, int, qcoefs)[96]; ///< quantized coefficients
|
||||||
DECLARE_ALIGNED(32, float, scoefs)[1024]; ///< scaled coefficients
|
DECLARE_ALIGNED(32, float, scoefs)[1024]; ///< scaled coefficients
|
||||||
|
|
||||||
struct {
|
|
||||||
float *samples;
|
|
||||||
} buffer;
|
|
||||||
} AACEncContext;
|
} AACEncContext;
|
||||||
|
|
||||||
extern float ff_aac_pow34sf_tab[428];
|
|
||||||
|
|
||||||
#endif /* AVCODEC_AACENC_H */
|
#endif /* AVCODEC_AACENC_H */
|
||||||
|
|||||||
@@ -28,9 +28,9 @@
|
|||||||
#include "aacps_tablegen.h"
|
#include "aacps_tablegen.h"
|
||||||
#include "aacpsdata.c"
|
#include "aacpsdata.c"
|
||||||
|
|
||||||
#define PS_BASELINE 0 ///< Operate in Baseline PS mode
|
#define PS_BASELINE 0 //< Operate in Baseline PS mode
|
||||||
///< Baseline implies 10 or 20 stereo bands,
|
//< Baseline implies 10 or 20 stereo bands,
|
||||||
///< mixing mode A, and no ipd/opd
|
//< mixing mode A, and no ipd/opd
|
||||||
|
|
||||||
#define numQMFSlots 32 //numTimeSlots * RATE
|
#define numQMFSlots 32 //numTimeSlots * RATE
|
||||||
|
|
||||||
@@ -69,19 +69,19 @@ static const int huff_iid[] = {
|
|||||||
|
|
||||||
static VLC vlc_ps[10];
|
static VLC vlc_ps[10];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read Inter-channel Intensity Difference/Inter-Channel Coherence/
|
||||||
|
* Inter-channel Phase Difference/Overall Phase Difference parameters from the
|
||||||
|
* bitstream.
|
||||||
|
*
|
||||||
|
* @param avctx contains the current codec context
|
||||||
|
* @param gb pointer to the input bitstream
|
||||||
|
* @param ps pointer to the Parametric Stereo context
|
||||||
|
* @param par pointer to the parameter to be read
|
||||||
|
* @param e envelope to decode
|
||||||
|
* @param dt 1: time delta-coded, 0: frequency delta-coded
|
||||||
|
*/
|
||||||
#define READ_PAR_DATA(PAR, OFFSET, MASK, ERR_CONDITION) \
|
#define READ_PAR_DATA(PAR, OFFSET, MASK, ERR_CONDITION) \
|
||||||
/** \
|
|
||||||
* Read Inter-channel Intensity Difference/Inter-Channel Coherence/ \
|
|
||||||
* Inter-channel Phase Difference/Overall Phase Difference parameters from the \
|
|
||||||
* bitstream. \
|
|
||||||
* \
|
|
||||||
* @param avctx contains the current codec context \
|
|
||||||
* @param gb pointer to the input bitstream \
|
|
||||||
* @param ps pointer to the Parametric Stereo context \
|
|
||||||
* @param PAR pointer to the parameter to be read \
|
|
||||||
* @param e envelope to decode \
|
|
||||||
* @param dt 1: time delta-coded, 0: frequency delta-coded \
|
|
||||||
*/ \
|
|
||||||
static int read_ ## PAR ## _data(AVCodecContext *avctx, GetBitContext *gb, PSContext *ps, \
|
static int read_ ## PAR ## _data(AVCodecContext *avctx, GetBitContext *gb, PSContext *ps, \
|
||||||
int8_t (*PAR)[PS_MAX_NR_IIDICC], int table_idx, int e, int dt) \
|
int8_t (*PAR)[PS_MAX_NR_IIDICC], int table_idx, int e, int dt) \
|
||||||
{ \
|
{ \
|
||||||
@@ -223,7 +223,7 @@ int ff_ps_read_data(AVCodecContext *avctx, GetBitContext *gb_host, PSContext *ps
|
|||||||
cnt -= 2 + ps_read_extension_data(gb, ps, ps_extension_id);
|
cnt -= 2 + ps_read_extension_data(gb, ps, ps_extension_id);
|
||||||
}
|
}
|
||||||
if (cnt < 0) {
|
if (cnt < 0) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "ps extension overflow %d\n", cnt);
|
av_log(avctx, AV_LOG_ERROR, "ps extension overflow %d", cnt);
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
skip_bits(gb, cnt);
|
skip_bits(gb, cnt);
|
||||||
@@ -654,7 +654,7 @@ static void decorrelation(PSContext *ps, float (*out)[32][2], const float (*s)[3
|
|||||||
const int8_t *k_to_i = is34 ? k_to_i_34 : k_to_i_20;
|
const int8_t *k_to_i = is34 ? k_to_i_34 : k_to_i_20;
|
||||||
const float peak_decay_factor = 0.76592833836465f;
|
const float peak_decay_factor = 0.76592833836465f;
|
||||||
const float transient_impact = 1.5f;
|
const float transient_impact = 1.5f;
|
||||||
const float a_smooth = 0.25f; ///< Smoothing coefficient
|
const float a_smooth = 0.25f; //< Smoothing coefficient
|
||||||
int i, k, m, n;
|
int i, k, m, n;
|
||||||
int n0 = 0, nL = 32;
|
int n0 = 0, nL = 32;
|
||||||
static const int link_delay[] = { 3, 4, 5 };
|
static const int link_delay[] = { 3, 4, 5 };
|
||||||
|
|||||||
@@ -52,11 +52,11 @@ typedef struct {
|
|||||||
int num_env;
|
int num_env;
|
||||||
int enable_ipdopd;
|
int enable_ipdopd;
|
||||||
int border_position[PS_MAX_NUM_ENV+1];
|
int border_position[PS_MAX_NUM_ENV+1];
|
||||||
int8_t iid_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; ///< Inter-channel Intensity Difference Parameters
|
int8_t iid_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; //<Inter-channel Intensity Difference Parameters
|
||||||
int8_t icc_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; ///< Inter-Channel Coherence Parameters
|
int8_t icc_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; //<Inter-Channel Coherence Parameters
|
||||||
/* ipd/opd is iid/icc sized so that the same functions can handle both */
|
/* ipd/opd is iid/icc sized so that the same functions can handle both */
|
||||||
int8_t ipd_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; ///< Inter-channel Phase Difference Parameters
|
int8_t ipd_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; //<Inter-channel Phase Difference Parameters
|
||||||
int8_t opd_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; ///< Overall Phase Difference Parameters
|
int8_t opd_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; //<Overall Phase Difference Parameters
|
||||||
int is34bands;
|
int is34bands;
|
||||||
int is34bands_old;
|
int is34bands_old;
|
||||||
|
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ static void ps_tableinit(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (iid = 0; iid < 46; iid++) {
|
for (iid = 0; iid < 46; iid++) {
|
||||||
float c = iid_par_dequant[iid]; ///< Linear Inter-channel Intensity Difference
|
float c = iid_par_dequant[iid]; //<Linear Inter-channel Intensity Difference
|
||||||
float c1 = (float)M_SQRT2 / sqrtf(1.0f + c*c);
|
float c1 = (float)M_SQRT2 / sqrtf(1.0f + c*c);
|
||||||
float c2 = c * c1;
|
float c2 = c * c1;
|
||||||
for (icc = 0; icc < 8; icc++) {
|
for (icc = 0; icc < 8; icc++) {
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ static const float psy_fir_coeffs[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculate the ABR attack threshold from the above LAME psymodel table.
|
* calculates the attack threshold for ABR from the above table for the LAME psy model
|
||||||
*/
|
*/
|
||||||
static float lame_calc_attack_threshold(int bitrate)
|
static float lame_calc_attack_threshold(int bitrate)
|
||||||
{
|
{
|
||||||
@@ -377,9 +377,8 @@ static const uint8_t window_grouping[9] = {
|
|||||||
* Tell encoder which window types to use.
|
* Tell encoder which window types to use.
|
||||||
* @see 3GPP TS26.403 5.4.1 "Blockswitching"
|
* @see 3GPP TS26.403 5.4.1 "Blockswitching"
|
||||||
*/
|
*/
|
||||||
static av_unused FFPsyWindowInfo psy_3gpp_window(FFPsyContext *ctx,
|
static FFPsyWindowInfo psy_3gpp_window(FFPsyContext *ctx,
|
||||||
const int16_t *audio,
|
const int16_t *audio, const int16_t *la,
|
||||||
const int16_t *la,
|
|
||||||
int channel, int prev_type)
|
int channel, int prev_type)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
@@ -400,7 +399,7 @@ static av_unused FFPsyWindowInfo psy_3gpp_window(FFPsyContext *ctx,
|
|||||||
int stay_short = 0;
|
int stay_short = 0;
|
||||||
for (i = 0; i < 8; i++) {
|
for (i = 0; i < 8; i++) {
|
||||||
for (j = 0; j < 128; j++) {
|
for (j = 0; j < 128; j++) {
|
||||||
v = iir_filter(la[i*128+j], pch->iir_state);
|
v = iir_filter(la[(i*128+j)*ctx->avctx->channels], pch->iir_state);
|
||||||
sum += v*v;
|
sum += v*v;
|
||||||
}
|
}
|
||||||
s[i] = sum;
|
s[i] = sum;
|
||||||
@@ -557,7 +556,7 @@ static float calc_reduced_thr_3gpp(AacPsyBand *band, float min_snr,
|
|||||||
/**
|
/**
|
||||||
* Calculate band thresholds as suggested in 3GPP TS26.403
|
* Calculate band thresholds as suggested in 3GPP TS26.403
|
||||||
*/
|
*/
|
||||||
static void psy_3gpp_analyze_channel(FFPsyContext *ctx, int channel,
|
static void psy_3gpp_analyze(FFPsyContext *ctx, int channel,
|
||||||
const float *coefs, const FFPsyWindowInfo *wi)
|
const float *coefs, const FFPsyWindowInfo *wi)
|
||||||
{
|
{
|
||||||
AacPsyContext *pctx = (AacPsyContext*) ctx->model_priv_data;
|
AacPsyContext *pctx = (AacPsyContext*) ctx->model_priv_data;
|
||||||
@@ -627,7 +626,7 @@ static void psy_3gpp_analyze_channel(FFPsyContext *ctx, int channel,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* 5.6.1.3.2 "Calculation of the desired perceptual entropy" */
|
/* 5.6.1.3.2 "Calculation of the desired perceptual entropy" */
|
||||||
ctx->ch[channel].entropy = pe;
|
ctx->pe[channel] = pe;
|
||||||
desired_bits = calc_bit_demand(pctx, pe, ctx->bitres.bits, ctx->bitres.size, wi->num_windows == 8);
|
desired_bits = calc_bit_demand(pctx, pe, ctx->bitres.bits, ctx->bitres.size, wi->num_windows == 8);
|
||||||
desired_pe = PSY_3GPP_BITS_TO_PE(desired_bits);
|
desired_pe = PSY_3GPP_BITS_TO_PE(desired_bits);
|
||||||
/* NOTE: PE correction is kept simple. During initial testing it had very
|
/* NOTE: PE correction is kept simple. During initial testing it had very
|
||||||
@@ -731,7 +730,7 @@ static void psy_3gpp_analyze_channel(FFPsyContext *ctx, int channel,
|
|||||||
for (w = 0; w < wi->num_windows*16; w += 16) {
|
for (w = 0; w < wi->num_windows*16; w += 16) {
|
||||||
for (g = 0; g < num_bands; g++) {
|
for (g = 0; g < num_bands; g++) {
|
||||||
AacPsyBand *band = &pch->band[w+g];
|
AacPsyBand *band = &pch->band[w+g];
|
||||||
FFPsyBand *psy_band = &ctx->ch[channel].psy_bands[w+g];
|
FFPsyBand *psy_band = &ctx->psy_bands[channel*PSY_MAX_BANDS+w+g];
|
||||||
|
|
||||||
psy_band->threshold = band->thr;
|
psy_band->threshold = band->thr;
|
||||||
psy_band->energy = band->energy;
|
psy_band->energy = band->energy;
|
||||||
@@ -741,16 +740,6 @@ static void psy_3gpp_analyze_channel(FFPsyContext *ctx, int channel,
|
|||||||
memcpy(pch->prev_band, pch->band, sizeof(pch->band));
|
memcpy(pch->prev_band, pch->band, sizeof(pch->band));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void psy_3gpp_analyze(FFPsyContext *ctx, int channel,
|
|
||||||
const float **coeffs, const FFPsyWindowInfo *wi)
|
|
||||||
{
|
|
||||||
int ch;
|
|
||||||
FFPsyChannelGroup *group = ff_psy_find_group(ctx, channel);
|
|
||||||
|
|
||||||
for (ch = 0; ch < group->num_ch; ch++)
|
|
||||||
psy_3gpp_analyze_channel(ctx, channel + ch, coeffs[ch], &wi[ch]);
|
|
||||||
}
|
|
||||||
|
|
||||||
static av_cold void psy_3gpp_end(FFPsyContext *apc)
|
static av_cold void psy_3gpp_end(FFPsyContext *apc)
|
||||||
{
|
{
|
||||||
AacPsyContext *pctx = (AacPsyContext*) apc->model_priv_data;
|
AacPsyContext *pctx = (AacPsyContext*) apc->model_priv_data;
|
||||||
@@ -776,8 +765,9 @@ static void lame_apply_block_type(AacPsyChannel *ctx, FFPsyWindowInfo *wi, int u
|
|||||||
ctx->next_window_seq = blocktype;
|
ctx->next_window_seq = blocktype;
|
||||||
}
|
}
|
||||||
|
|
||||||
static FFPsyWindowInfo psy_lame_window(FFPsyContext *ctx, const float *audio,
|
static FFPsyWindowInfo psy_lame_window(FFPsyContext *ctx,
|
||||||
const float *la, int channel, int prev_type)
|
const int16_t *audio, const int16_t *la,
|
||||||
|
int channel, int prev_type)
|
||||||
{
|
{
|
||||||
AacPsyContext *pctx = (AacPsyContext*) ctx->model_priv_data;
|
AacPsyContext *pctx = (AacPsyContext*) ctx->model_priv_data;
|
||||||
AacPsyChannel *pch = &pctx->ch[channel];
|
AacPsyChannel *pch = &pctx->ch[channel];
|
||||||
@@ -794,20 +784,20 @@ static FFPsyWindowInfo psy_lame_window(FFPsyContext *ctx, const float *audio,
|
|||||||
float attack_intensity[(AAC_NUM_BLOCKS_SHORT + 1) * PSY_LAME_NUM_SUBBLOCKS];
|
float attack_intensity[(AAC_NUM_BLOCKS_SHORT + 1) * PSY_LAME_NUM_SUBBLOCKS];
|
||||||
float energy_subshort[(AAC_NUM_BLOCKS_SHORT + 1) * PSY_LAME_NUM_SUBBLOCKS];
|
float energy_subshort[(AAC_NUM_BLOCKS_SHORT + 1) * PSY_LAME_NUM_SUBBLOCKS];
|
||||||
float energy_short[AAC_NUM_BLOCKS_SHORT + 1] = { 0 };
|
float energy_short[AAC_NUM_BLOCKS_SHORT + 1] = { 0 };
|
||||||
const float *firbuf = la + (AAC_BLOCK_SIZE_SHORT/4 - PSY_LAME_FIR_LEN);
|
int chans = ctx->avctx->channels;
|
||||||
|
const int16_t *firbuf = la + (AAC_BLOCK_SIZE_SHORT/4 - PSY_LAME_FIR_LEN) * chans;
|
||||||
int j, att_sum = 0;
|
int j, att_sum = 0;
|
||||||
|
|
||||||
/* LAME comment: apply high pass filter of fs/4 */
|
/* LAME comment: apply high pass filter of fs/4 */
|
||||||
for (i = 0; i < AAC_BLOCK_SIZE_LONG; i++) {
|
for (i = 0; i < AAC_BLOCK_SIZE_LONG; i++) {
|
||||||
float sum1, sum2;
|
float sum1, sum2;
|
||||||
sum1 = firbuf[i + (PSY_LAME_FIR_LEN - 1) / 2];
|
sum1 = firbuf[(i + ((PSY_LAME_FIR_LEN - 1) / 2)) * chans];
|
||||||
sum2 = 0.0;
|
sum2 = 0.0;
|
||||||
for (j = 0; j < ((PSY_LAME_FIR_LEN - 1) / 2) - 1; j += 2) {
|
for (j = 0; j < ((PSY_LAME_FIR_LEN - 1) / 2) - 1; j += 2) {
|
||||||
sum1 += psy_fir_coeffs[j] * (firbuf[i + j] + firbuf[i + PSY_LAME_FIR_LEN - j]);
|
sum1 += psy_fir_coeffs[j] * (firbuf[(i + j) * chans] + firbuf[(i + PSY_LAME_FIR_LEN - j) * chans]);
|
||||||
sum2 += psy_fir_coeffs[j + 1] * (firbuf[i + j + 1] + firbuf[i + PSY_LAME_FIR_LEN - j - 1]);
|
sum2 += psy_fir_coeffs[j + 1] * (firbuf[(i + j + 1) * chans] + firbuf[(i + PSY_LAME_FIR_LEN - j - 1) * chans]);
|
||||||
}
|
}
|
||||||
/* NOTE: The LAME psymodel expects it's input in the range -32768 to 32768. Tuning this for normalized floats would be difficult. */
|
hpfsmpl[i] = sum1 + sum2;
|
||||||
hpfsmpl[i] = (sum1 + sum2) * 32768.0f;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Calculate the energies of each sub-shortblock */
|
/* Calculate the energies of each sub-shortblock */
|
||||||
@@ -822,12 +812,13 @@ static FFPsyWindowInfo psy_lame_window(FFPsyContext *ctx, const float *audio,
|
|||||||
float const *const pfe = pf + AAC_BLOCK_SIZE_LONG / (AAC_NUM_BLOCKS_SHORT * PSY_LAME_NUM_SUBBLOCKS);
|
float const *const pfe = pf + AAC_BLOCK_SIZE_LONG / (AAC_NUM_BLOCKS_SHORT * PSY_LAME_NUM_SUBBLOCKS);
|
||||||
float p = 1.0f;
|
float p = 1.0f;
|
||||||
for (; pf < pfe; pf++)
|
for (; pf < pfe; pf++)
|
||||||
p = FFMAX(p, fabsf(*pf));
|
if (p < fabsf(*pf))
|
||||||
|
p = fabsf(*pf);
|
||||||
pch->prev_energy_subshort[i] = energy_subshort[i + PSY_LAME_NUM_SUBBLOCKS] = p;
|
pch->prev_energy_subshort[i] = energy_subshort[i + PSY_LAME_NUM_SUBBLOCKS] = p;
|
||||||
energy_short[1 + i / PSY_LAME_NUM_SUBBLOCKS] += p;
|
energy_short[1 + i / PSY_LAME_NUM_SUBBLOCKS] += p;
|
||||||
/* NOTE: The indexes below are [i + 3 - 2] in the LAME source.
|
/* FIXME: The indexes below are [i + 3 - 2] in the LAME source.
|
||||||
* Obviously the 3 and 2 have some significance, or this would be just [i + 1]
|
* Obviously the 3 and 2 have some significance, or this would be just [i + 1]
|
||||||
* (which is what we use here). What the 3 stands for is ambiguous, as it is both
|
* (which is what we use here). What the 3 stands for is ambigious, as it is both
|
||||||
* number of short blocks, and the number of sub-short blocks.
|
* number of short blocks, and the number of sub-short blocks.
|
||||||
* It seems that LAME is comparing each sub-block to sub-block + 1 in the
|
* It seems that LAME is comparing each sub-block to sub-block + 1 in the
|
||||||
* previous block.
|
* previous block.
|
||||||
|
|||||||
@@ -33,7 +33,6 @@
|
|||||||
#include "fft.h"
|
#include "fft.h"
|
||||||
#include "aacps.h"
|
#include "aacps.h"
|
||||||
#include "libavutil/libm.h"
|
#include "libavutil/libm.h"
|
||||||
#include "libavutil/avassert.h"
|
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
@@ -131,8 +130,6 @@ av_cold void ff_aac_sbr_init(void)
|
|||||||
av_cold void ff_aac_sbr_ctx_init(AACContext *ac, SpectralBandReplication *sbr)
|
av_cold void ff_aac_sbr_ctx_init(AACContext *ac, SpectralBandReplication *sbr)
|
||||||
{
|
{
|
||||||
float mdct_scale;
|
float mdct_scale;
|
||||||
if(sbr->mdct.mdct_bits)
|
|
||||||
return;
|
|
||||||
sbr->kx[0] = sbr->kx[1] = 32; //Typo in spec, kx' inits to 32
|
sbr->kx[0] = sbr->kx[1] = 32; //Typo in spec, kx' inits to 32
|
||||||
sbr->data[0].e_a[1] = sbr->data[1].e_a[1] = -1;
|
sbr->data[0].e_a[1] = sbr->data[1].e_a[1] = -1;
|
||||||
sbr->data[0].synthesis_filterbank_samples_offset = SBR_SYNTHESIS_BUF_SIZE - (1280 - 128);
|
sbr->data[0].synthesis_filterbank_samples_offset = SBR_SYNTHESIS_BUF_SIZE - (1280 - 128);
|
||||||
@@ -1185,15 +1182,14 @@ static void sbr_qmf_synthesis(DSPContext *dsp, FFTContext *mdct,
|
|||||||
{
|
{
|
||||||
int i, n;
|
int i, n;
|
||||||
const float *sbr_qmf_window = div ? sbr_qmf_window_ds : sbr_qmf_window_us;
|
const float *sbr_qmf_window = div ? sbr_qmf_window_ds : sbr_qmf_window_us;
|
||||||
const int step = 128 >> div;
|
|
||||||
float *v;
|
float *v;
|
||||||
for (i = 0; i < 32; i++) {
|
for (i = 0; i < 32; i++) {
|
||||||
if (*v_off < step) {
|
if (*v_off == 0) {
|
||||||
int saved_samples = (1280 - 128) >> div;
|
int saved_samples = (1280 - 128) >> div;
|
||||||
memcpy(&v0[SBR_SYNTHESIS_BUF_SIZE - saved_samples], v0, saved_samples * sizeof(float));
|
memcpy(&v0[SBR_SYNTHESIS_BUF_SIZE - saved_samples], v0, saved_samples * sizeof(float));
|
||||||
*v_off = SBR_SYNTHESIS_BUF_SIZE - saved_samples - step;
|
*v_off = SBR_SYNTHESIS_BUF_SIZE - saved_samples - (128 >> div);
|
||||||
} else {
|
} else {
|
||||||
*v_off -= step;
|
*v_off -= 128 >> div;
|
||||||
}
|
}
|
||||||
v = v0 + *v_off;
|
v = v0 + *v_off;
|
||||||
if (div) {
|
if (div) {
|
||||||
@@ -1461,7 +1457,6 @@ static void sbr_mapping(AACContext *ac, SpectralBandReplication *sbr,
|
|||||||
uint16_t *table = ch_data->bs_freq_res[e + 1] ? sbr->f_tablehigh : sbr->f_tablelow;
|
uint16_t *table = ch_data->bs_freq_res[e + 1] ? sbr->f_tablehigh : sbr->f_tablelow;
|
||||||
int k;
|
int k;
|
||||||
|
|
||||||
av_assert0(sbr->kx[1] <= table[0]);
|
|
||||||
for (i = 0; i < ilim; i++)
|
for (i = 0; i < ilim; i++)
|
||||||
for (m = table[i]; m < table[i + 1]; m++)
|
for (m = table[i]; m < table[i + 1]; m++)
|
||||||
sbr->e_origmapped[e][m - sbr->kx[1]] = ch_data->env_facs[e+1][i];
|
sbr->e_origmapped[e][m - sbr->kx[1]] = ch_data->env_facs[e+1][i];
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ static int aasc_decode_frame(AVCodecContext *avctx,
|
|||||||
AascContext *s = avctx->priv_data;
|
AascContext *s = avctx->priv_data;
|
||||||
int compr, i, stride;
|
int compr, i, stride;
|
||||||
|
|
||||||
s->frame.reference = 3;
|
s->frame.reference = 1;
|
||||||
s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
|
s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
|
||||||
if (avctx->reget_buffer(avctx, &s->frame)) {
|
if (avctx->reget_buffer(avctx, &s->frame)) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
|
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
|
||||||
@@ -79,13 +79,8 @@ static int aasc_decode_frame(AVCodecContext *avctx,
|
|||||||
case 0:
|
case 0:
|
||||||
stride = (avctx->width * 3 + 3) & ~3;
|
stride = (avctx->width * 3 + 3) & ~3;
|
||||||
for(i = avctx->height - 1; i >= 0; i--){
|
for(i = avctx->height - 1; i >= 0; i--){
|
||||||
if(avctx->width*3 > buf_size){
|
|
||||||
av_log(avctx, AV_LOG_ERROR, "Next line is beyond buffer bounds\n");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
memcpy(s->frame.data[0] + i*s->frame.linesize[0], buf, avctx->width*3);
|
memcpy(s->frame.data[0] + i*s->frame.linesize[0], buf, avctx->width*3);
|
||||||
buf += stride;
|
buf += stride;
|
||||||
buf_size -= stride;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
@@ -115,13 +110,14 @@ static av_cold int aasc_decode_end(AVCodecContext *avctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
AVCodec ff_aasc_decoder = {
|
AVCodec ff_aasc_decoder = {
|
||||||
.name = "aasc",
|
"aasc",
|
||||||
.type = AVMEDIA_TYPE_VIDEO,
|
AVMEDIA_TYPE_VIDEO,
|
||||||
.id = CODEC_ID_AASC,
|
CODEC_ID_AASC,
|
||||||
.priv_data_size = sizeof(AascContext),
|
sizeof(AascContext),
|
||||||
.init = aasc_decode_init,
|
aasc_decode_init,
|
||||||
.close = aasc_decode_end,
|
NULL,
|
||||||
.decode = aasc_decode_frame,
|
aasc_decode_end,
|
||||||
.capabilities = CODEC_CAP_DR1,
|
aasc_decode_frame,
|
||||||
|
CODEC_CAP_DR1,
|
||||||
.long_name = NULL_IF_CONFIG_SMALL("Autodesk RLE"),
|
.long_name = NULL_IF_CONFIG_SMALL("Autodesk RLE"),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ typedef struct {
|
|||||||
uint32_t bit_rate;
|
uint32_t bit_rate;
|
||||||
uint8_t channels;
|
uint8_t channels;
|
||||||
uint16_t frame_size;
|
uint16_t frame_size;
|
||||||
uint64_t channel_layout;
|
int64_t channel_layout;
|
||||||
/** @} */
|
/** @} */
|
||||||
} AC3HeaderInfo;
|
} AC3HeaderInfo;
|
||||||
|
|
||||||
@@ -131,8 +131,47 @@ typedef enum {
|
|||||||
EAC3_FRAME_TYPE_RESERVED
|
EAC3_FRAME_TYPE_RESERVED
|
||||||
} EAC3FrameType;
|
} EAC3FrameType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Encoding Options used by AVOption.
|
||||||
|
*/
|
||||||
|
typedef struct AC3EncOptions {
|
||||||
|
/* AC-3 metadata options*/
|
||||||
|
int dialogue_level;
|
||||||
|
int bitstream_mode;
|
||||||
|
float center_mix_level;
|
||||||
|
float surround_mix_level;
|
||||||
|
int dolby_surround_mode;
|
||||||
|
int audio_production_info;
|
||||||
|
int mixing_level;
|
||||||
|
int room_type;
|
||||||
|
int copyright;
|
||||||
|
int original;
|
||||||
|
int extended_bsi_1;
|
||||||
|
int preferred_stereo_downmix;
|
||||||
|
float ltrt_center_mix_level;
|
||||||
|
float ltrt_surround_mix_level;
|
||||||
|
float loro_center_mix_level;
|
||||||
|
float loro_surround_mix_level;
|
||||||
|
int extended_bsi_2;
|
||||||
|
int dolby_surround_ex_mode;
|
||||||
|
int dolby_headphone_mode;
|
||||||
|
int ad_converter_type;
|
||||||
|
|
||||||
|
/* other encoding options */
|
||||||
|
int allow_per_frame_metadata;
|
||||||
|
int stereo_rematrixing;
|
||||||
|
int channel_coupling;
|
||||||
|
int cpl_start;
|
||||||
|
} AC3EncOptions;
|
||||||
|
|
||||||
void ff_ac3_common_init(void);
|
void ff_ac3_common_init(void);
|
||||||
|
|
||||||
|
extern const int64_t ff_ac3_channel_layouts[];
|
||||||
|
extern const AVOption ff_ac3_options[];
|
||||||
|
|
||||||
|
extern AVCodec ff_ac3_float_encoder;
|
||||||
|
extern AVCodec ff_ac3_fixed_encoder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculate the log power-spectral density of the input signal.
|
* Calculate the log power-spectral density of the input signal.
|
||||||
* This gives a rough estimate of signal power in the frequency domain by using
|
* This gives a rough estimate of signal power in the frequency domain by using
|
||||||
|
|||||||
@@ -34,20 +34,8 @@ static const uint8_t eac3_blocks[4] = {
|
|||||||
1, 2, 3, 6
|
1, 2, 3, 6
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Table for center mix levels
|
|
||||||
* reference: Section 5.4.2.4 cmixlev
|
|
||||||
*/
|
|
||||||
static const uint8_t center_levels[4] = { 4, 5, 6, 5 };
|
|
||||||
|
|
||||||
/**
|
int ff_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr)
|
||||||
* Table for surround mix levels
|
|
||||||
* reference: Section 5.4.2.5 surmixlev
|
|
||||||
*/
|
|
||||||
static const uint8_t surround_levels[4] = { 4, 6, 7, 6 };
|
|
||||||
|
|
||||||
|
|
||||||
int avpriv_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr)
|
|
||||||
{
|
{
|
||||||
int frame_size_code;
|
int frame_size_code;
|
||||||
|
|
||||||
@@ -65,8 +53,8 @@ int avpriv_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr)
|
|||||||
hdr->num_blocks = 6;
|
hdr->num_blocks = 6;
|
||||||
|
|
||||||
/* set default mix levels */
|
/* set default mix levels */
|
||||||
hdr->center_mix_level = 5; // -4.5dB
|
hdr->center_mix_level = 1; // -4.5dB
|
||||||
hdr->surround_mix_level = 6; // -6.0dB
|
hdr->surround_mix_level = 1; // -6.0dB
|
||||||
|
|
||||||
if(hdr->bitstream_id <= 10) {
|
if(hdr->bitstream_id <= 10) {
|
||||||
/* Normal AC-3 */
|
/* Normal AC-3 */
|
||||||
@@ -88,9 +76,9 @@ int avpriv_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr)
|
|||||||
skip_bits(gbc, 2); // skip dsurmod
|
skip_bits(gbc, 2); // skip dsurmod
|
||||||
} else {
|
} else {
|
||||||
if((hdr->channel_mode & 1) && hdr->channel_mode != AC3_CHMODE_MONO)
|
if((hdr->channel_mode & 1) && hdr->channel_mode != AC3_CHMODE_MONO)
|
||||||
hdr-> center_mix_level = center_levels[get_bits(gbc, 2)];
|
hdr->center_mix_level = get_bits(gbc, 2);
|
||||||
if(hdr->channel_mode & 4)
|
if(hdr->channel_mode & 4)
|
||||||
hdr->surround_mix_level = surround_levels[get_bits(gbc, 2)];
|
hdr->surround_mix_level = get_bits(gbc, 2);
|
||||||
}
|
}
|
||||||
hdr->lfe_on = get_bits1(gbc);
|
hdr->lfe_on = get_bits1(gbc);
|
||||||
|
|
||||||
@@ -153,7 +141,7 @@ static int ac3_sync(uint64_t state, AACAC3ParseContext *hdr_info,
|
|||||||
GetBitContext gbc;
|
GetBitContext gbc;
|
||||||
|
|
||||||
init_get_bits(&gbc, tmp.u8+8-AC3_HEADER_SIZE, 54);
|
init_get_bits(&gbc, tmp.u8+8-AC3_HEADER_SIZE, 54);
|
||||||
err = avpriv_ac3_parse_header(&gbc, &hdr);
|
err = ff_ac3_parse_header(&gbc, &hdr);
|
||||||
|
|
||||||
if(err < 0)
|
if(err < 0)
|
||||||
return 0;
|
return 0;
|
||||||
@@ -186,9 +174,9 @@ static av_cold int ac3_parse_init(AVCodecParserContext *s1)
|
|||||||
|
|
||||||
|
|
||||||
AVCodecParser ff_ac3_parser = {
|
AVCodecParser ff_ac3_parser = {
|
||||||
.codec_ids = { CODEC_ID_AC3, CODEC_ID_EAC3 },
|
{ CODEC_ID_AC3, CODEC_ID_EAC3 },
|
||||||
.priv_data_size = sizeof(AACAC3ParseContext),
|
sizeof(AACAC3ParseContext),
|
||||||
.parser_init = ac3_parse_init,
|
ac3_parse_init,
|
||||||
.parser_parse = ff_aac_ac3_parse,
|
ff_aac_ac3_parse,
|
||||||
.parser_close = ff_parse_close,
|
ff_parse_close,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -36,6 +36,6 @@
|
|||||||
* -2 if the bsid (version) element is invalid, -3 if the fscod (sample rate)
|
* -2 if the bsid (version) element is invalid, -3 if the fscod (sample rate)
|
||||||
* element is invalid, or -4 if the frmsizecod (bit rate) element is invalid.
|
* element is invalid, or -4 if the frmsizecod (bit rate) element is invalid.
|
||||||
*/
|
*/
|
||||||
int avpriv_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr);
|
int ff_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr);
|
||||||
|
|
||||||
#endif /* AVCODEC_AC3_PARSER_H */
|
#endif /* AVCODEC_AC3_PARSER_H */
|
||||||
|
|||||||
@@ -30,7 +30,6 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "libavutil/crc.h"
|
#include "libavutil/crc.h"
|
||||||
#include "libavutil/opt.h"
|
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
#include "aac_ac3_parser.h"
|
#include "aac_ac3_parser.h"
|
||||||
#include "ac3_parser.h"
|
#include "ac3_parser.h"
|
||||||
@@ -44,6 +43,7 @@
|
|||||||
*/
|
*/
|
||||||
static uint8_t ungroup_3_in_7_bits_tab[128][3];
|
static uint8_t ungroup_3_in_7_bits_tab[128][3];
|
||||||
|
|
||||||
|
|
||||||
/** tables for ungrouping mantissas */
|
/** tables for ungrouping mantissas */
|
||||||
static int b1_mantissas[32][3];
|
static int b1_mantissas[32][3];
|
||||||
static int b2_mantissas[128][3];
|
static int b2_mantissas[128][3];
|
||||||
@@ -76,6 +76,18 @@ static const float gain_levels[9] = {
|
|||||||
LEVEL_MINUS_9DB
|
LEVEL_MINUS_9DB
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Table for center mix levels
|
||||||
|
* reference: Section 5.4.2.4 cmixlev
|
||||||
|
*/
|
||||||
|
static const uint8_t center_levels[4] = { 4, 5, 6, 5 };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Table for surround mix levels
|
||||||
|
* reference: Section 5.4.2.5 surmixlev
|
||||||
|
*/
|
||||||
|
static const uint8_t surround_levels[4] = { 4, 6, 7, 6 };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Table for default stereo downmixing coefficients
|
* Table for default stereo downmixing coefficients
|
||||||
* reference: Section 7.8.2 Downmixing Into Two Channels
|
* reference: Section 7.8.2 Downmixing Into Two Channels
|
||||||
@@ -154,6 +166,7 @@ static av_cold void ac3_tables_init(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* AVCodec initialization
|
* AVCodec initialization
|
||||||
*/
|
*/
|
||||||
@@ -162,11 +175,6 @@ static av_cold int ac3_decode_init(AVCodecContext *avctx)
|
|||||||
AC3DecodeContext *s = avctx->priv_data;
|
AC3DecodeContext *s = avctx->priv_data;
|
||||||
s->avctx = avctx;
|
s->avctx = avctx;
|
||||||
|
|
||||||
#if FF_API_DRC_SCALE
|
|
||||||
if (avctx->drc_scale)
|
|
||||||
s->drc_scale = avctx->drc_scale;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ff_ac3_common_init();
|
ff_ac3_common_init();
|
||||||
ac3_tables_init();
|
ac3_tables_init();
|
||||||
ff_mdct_init(&s->imdct_256, 8, 1, 1.0);
|
ff_mdct_init(&s->imdct_256, 8, 1, 1.0);
|
||||||
@@ -194,9 +202,6 @@ static av_cold int ac3_decode_init(AVCodecContext *avctx)
|
|||||||
}
|
}
|
||||||
s->downmixed = 1;
|
s->downmixed = 1;
|
||||||
|
|
||||||
avcodec_get_frame_defaults(&s->frame);
|
|
||||||
avctx->coded_frame = &s->frame;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -211,7 +216,7 @@ static int ac3_parse_header(AC3DecodeContext *s)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* read the rest of the bsi. read twice for dual mono mode. */
|
/* read the rest of the bsi. read twice for dual mono mode. */
|
||||||
i = !s->channel_mode;
|
i = !(s->channel_mode);
|
||||||
do {
|
do {
|
||||||
skip_bits(gbc, 5); // skip dialog normalization
|
skip_bits(gbc, 5); // skip dialog normalization
|
||||||
if (get_bits1(gbc))
|
if (get_bits1(gbc))
|
||||||
@@ -250,7 +255,7 @@ static int parse_frame_header(AC3DecodeContext *s)
|
|||||||
AC3HeaderInfo hdr;
|
AC3HeaderInfo hdr;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
err = avpriv_ac3_parse_header(&s->gbc, &hdr);
|
err = ff_ac3_parse_header(&s->gbc, &hdr);
|
||||||
if(err)
|
if(err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
@@ -308,8 +313,8 @@ static int parse_frame_header(AC3DecodeContext *s)
|
|||||||
static void set_downmix_coeffs(AC3DecodeContext *s)
|
static void set_downmix_coeffs(AC3DecodeContext *s)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
float cmix = gain_levels[s-> center_mix_level];
|
float cmix = gain_levels[center_levels[s->center_mix_level]];
|
||||||
float smix = gain_levels[s->surround_mix_level];
|
float smix = gain_levels[surround_levels[s->surround_mix_level]];
|
||||||
float norm0, norm1;
|
float norm0, norm1;
|
||||||
|
|
||||||
for(i=0; i<s->fbw_channels; i++) {
|
for(i=0; i<s->fbw_channels; i++) {
|
||||||
@@ -343,8 +348,7 @@ static void set_downmix_coeffs(AC3DecodeContext *s)
|
|||||||
|
|
||||||
if(s->output_mode == AC3_CHMODE_MONO) {
|
if(s->output_mode == AC3_CHMODE_MONO) {
|
||||||
for(i=0; i<s->fbw_channels; i++)
|
for(i=0; i<s->fbw_channels; i++)
|
||||||
s->downmix_coeffs[i][0] = (s->downmix_coeffs[i][0] +
|
s->downmix_coeffs[i][0] = (s->downmix_coeffs[i][0] + s->downmix_coeffs[i][1]) * LEVEL_MINUS_3DB;
|
||||||
s->downmix_coeffs[i][1]) * LEVEL_MINUS_3DB;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -401,8 +405,7 @@ static void calc_transform_coeffs_cpl(AC3DecodeContext *s)
|
|||||||
if (s->channel_in_cpl[ch]) {
|
if (s->channel_in_cpl[ch]) {
|
||||||
int cpl_coord = s->cpl_coords[ch][band] << 5;
|
int cpl_coord = s->cpl_coords[ch][band] << 5;
|
||||||
for (bin = band_start; bin < band_end; bin++) {
|
for (bin = band_start; bin < band_end; bin++) {
|
||||||
s->fixed_coeffs[ch][bin] =
|
s->fixed_coeffs[ch][bin] = MULH(s->fixed_coeffs[CPL_CH][bin] << 4, cpl_coord);
|
||||||
MULH(s->fixed_coeffs[CPL_CH][bin] << 4, cpl_coord);
|
|
||||||
}
|
}
|
||||||
if (ch == 2 && s->phase_flags[band]) {
|
if (ch == 2 && s->phase_flags[band]) {
|
||||||
for (bin = band_start; bin < band_end; bin++)
|
for (bin = band_start; bin < band_end; bin++)
|
||||||
@@ -455,7 +458,8 @@ static void ac3_decode_transform_coeffs_ch(AC3DecodeContext *s, int ch_index, ma
|
|||||||
if(m->b1){
|
if(m->b1){
|
||||||
m->b1--;
|
m->b1--;
|
||||||
mantissa = m->b1_mant[m->b1];
|
mantissa = m->b1_mant[m->b1];
|
||||||
} else {
|
}
|
||||||
|
else{
|
||||||
int bits = get_bits(gbc, 5);
|
int bits = get_bits(gbc, 5);
|
||||||
mantissa = b1_mantissas[bits][0];
|
mantissa = b1_mantissas[bits][0];
|
||||||
m->b1_mant[1] = b1_mantissas[bits][1];
|
m->b1_mant[1] = b1_mantissas[bits][1];
|
||||||
@@ -467,7 +471,8 @@ static void ac3_decode_transform_coeffs_ch(AC3DecodeContext *s, int ch_index, ma
|
|||||||
if(m->b2){
|
if(m->b2){
|
||||||
m->b2--;
|
m->b2--;
|
||||||
mantissa = m->b2_mant[m->b2];
|
mantissa = m->b2_mant[m->b2];
|
||||||
} else {
|
}
|
||||||
|
else{
|
||||||
int bits = get_bits(gbc, 7);
|
int bits = get_bits(gbc, 7);
|
||||||
mantissa = b2_mantissas[bits][0];
|
mantissa = b2_mantissas[bits][0];
|
||||||
m->b2_mant[1] = b2_mantissas[bits][1];
|
m->b2_mant[1] = b2_mantissas[bits][1];
|
||||||
@@ -482,7 +487,8 @@ static void ac3_decode_transform_coeffs_ch(AC3DecodeContext *s, int ch_index, ma
|
|||||||
if(m->b4){
|
if(m->b4){
|
||||||
m->b4 = 0;
|
m->b4 = 0;
|
||||||
mantissa = m->b4_mant;
|
mantissa = m->b4_mant;
|
||||||
} else {
|
}
|
||||||
|
else{
|
||||||
int bits = get_bits(gbc, 7);
|
int bits = get_bits(gbc, 7);
|
||||||
mantissa = b4_mantissas[bits][0];
|
mantissa = b4_mantissas[bits][0];
|
||||||
m->b4_mant = b4_mantissas[bits][1];
|
m->b4_mant = b4_mantissas[bits][1];
|
||||||
@@ -493,9 +499,9 @@ static void ac3_decode_transform_coeffs_ch(AC3DecodeContext *s, int ch_index, ma
|
|||||||
mantissa = b5_mantissas[get_bits(gbc, 4)];
|
mantissa = b5_mantissas[get_bits(gbc, 4)];
|
||||||
break;
|
break;
|
||||||
default: /* 6 to 15 */
|
default: /* 6 to 15 */
|
||||||
|
mantissa = get_bits(gbc, quantization_tab[bap]);
|
||||||
/* Shift mantissa and sign-extend it. */
|
/* Shift mantissa and sign-extend it. */
|
||||||
mantissa = get_sbits(gbc, quantization_tab[bap]);
|
mantissa = (mantissa << (32-quantization_tab[bap]))>>8;
|
||||||
mantissa <<= 24 - quantization_tab[bap];
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
coeffs[freq] = mantissa >> exps[freq];
|
coeffs[freq] = mantissa >> exps[freq];
|
||||||
@@ -611,15 +617,13 @@ static inline void do_imdct(AC3DecodeContext *s, int channels)
|
|||||||
for(i=0; i<128; i++)
|
for(i=0; i<128; i++)
|
||||||
x[i] = s->transform_coeffs[ch][2*i];
|
x[i] = s->transform_coeffs[ch][2*i];
|
||||||
s->imdct_256.imdct_half(&s->imdct_256, s->tmp_output, x);
|
s->imdct_256.imdct_half(&s->imdct_256, s->tmp_output, x);
|
||||||
s->dsp.vector_fmul_window(s->output[ch - 1], s->delay[ch - 1],
|
s->dsp.vector_fmul_window(s->output[ch-1], s->delay[ch-1], s->tmp_output, s->window, 128);
|
||||||
s->tmp_output, s->window, 128);
|
|
||||||
for(i=0; i<128; i++)
|
for(i=0; i<128; i++)
|
||||||
x[i] = s->transform_coeffs[ch][2*i+1];
|
x[i] = s->transform_coeffs[ch][2*i+1];
|
||||||
s->imdct_256.imdct_half(&s->imdct_256, s->delay[ch-1], x);
|
s->imdct_256.imdct_half(&s->imdct_256, s->delay[ch-1], x);
|
||||||
} else {
|
} else {
|
||||||
s->imdct_512.imdct_half(&s->imdct_512, s->tmp_output, s->transform_coeffs[ch]);
|
s->imdct_512.imdct_half(&s->imdct_512, s->tmp_output, s->transform_coeffs[ch]);
|
||||||
s->dsp.vector_fmul_window(s->output[ch - 1], s->delay[ch - 1],
|
s->dsp.vector_fmul_window(s->output[ch-1], s->delay[ch-1], s->tmp_output, s->window, 128);
|
||||||
s->tmp_output, s->window, 128);
|
|
||||||
memcpy(s->delay[ch-1], s->tmp_output+128, 128*sizeof(float));
|
memcpy(s->delay[ch-1], s->tmp_output+128, 128*sizeof(float));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -628,8 +632,7 @@ static inline void do_imdct(AC3DecodeContext *s, int channels)
|
|||||||
/**
|
/**
|
||||||
* Downmix the output to mono or stereo.
|
* Downmix the output to mono or stereo.
|
||||||
*/
|
*/
|
||||||
void ff_ac3_downmix_c(float (*samples)[256], float (*matrix)[2],
|
void ff_ac3_downmix_c(float (*samples)[256], float (*matrix)[2], int out_ch, int in_ch, int len)
|
||||||
int out_ch, int in_ch, int len)
|
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
float v0, v1;
|
float v0, v1;
|
||||||
@@ -780,11 +783,11 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* dynamic range */
|
/* dynamic range */
|
||||||
i = !s->channel_mode;
|
i = !(s->channel_mode);
|
||||||
do {
|
do {
|
||||||
if(get_bits1(gbc)) {
|
if(get_bits1(gbc)) {
|
||||||
s->dynamic_range[i] = ((dynamic_range_tab[get_bits(gbc, 8)]-1.0) *
|
s->dynamic_range[i] = ((dynamic_range_tab[get_bits(gbc, 8)]-1.0) *
|
||||||
s->drc_scale) + 1.0;
|
s->avctx->drc_scale)+1.0;
|
||||||
} else if(blk == 0) {
|
} else if(blk == 0) {
|
||||||
s->dynamic_range[i] = 1.0f;
|
s->dynamic_range[i] = 1.0f;
|
||||||
}
|
}
|
||||||
@@ -869,8 +872,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
|
|||||||
bandsize = s->spx_band_sizes[bnd];
|
bandsize = s->spx_band_sizes[bnd];
|
||||||
nratio = ((float)((bin + (bandsize >> 1))) / s->spx_dst_end_freq) - spx_blend;
|
nratio = ((float)((bin + (bandsize >> 1))) / s->spx_dst_end_freq) - spx_blend;
|
||||||
nratio = av_clipf(nratio, 0.0f, 1.0f);
|
nratio = av_clipf(nratio, 0.0f, 1.0f);
|
||||||
nblend = sqrtf(3.0f * nratio); // noise is scaled by sqrt(3)
|
nblend = sqrtf(3.0f * nratio); // noise is scaled by sqrt(3) to give unity variance
|
||||||
// to give unity variance
|
|
||||||
sblend = sqrtf(1.0f - nratio);
|
sblend = sqrtf(1.0f - nratio);
|
||||||
bin += bandsize;
|
bin += bandsize;
|
||||||
|
|
||||||
@@ -954,8 +956,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
|
|||||||
}
|
}
|
||||||
} else if (!s->eac3) {
|
} else if (!s->eac3) {
|
||||||
if(!blk) {
|
if(!blk) {
|
||||||
av_log(s->avctx, AV_LOG_ERROR, "new coupling strategy must "
|
av_log(s->avctx, AV_LOG_ERROR, "new coupling strategy must be present in block 0\n");
|
||||||
"be present in block 0\n");
|
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
s->cpl_in_use[blk] = s->cpl_in_use[blk-1];
|
s->cpl_in_use[blk] = s->cpl_in_use[blk-1];
|
||||||
@@ -984,8 +985,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
|
|||||||
s->cpl_coords[ch][bnd] >>= (cpl_coord_exp + master_cpl_coord);
|
s->cpl_coords[ch][bnd] >>= (cpl_coord_exp + master_cpl_coord);
|
||||||
}
|
}
|
||||||
} else if (!blk) {
|
} else if (!blk) {
|
||||||
av_log(s->avctx, AV_LOG_ERROR, "new coupling coordinates must "
|
av_log(s->avctx, AV_LOG_ERROR, "new coupling coordinates must be present in block 0\n");
|
||||||
"be present in block 0\n");
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -1013,8 +1013,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
|
|||||||
for(bnd=0; bnd<s->num_rematrixing_bands; bnd++)
|
for(bnd=0; bnd<s->num_rematrixing_bands; bnd++)
|
||||||
s->rematrixing_flags[bnd] = get_bits1(gbc);
|
s->rematrixing_flags[bnd] = get_bits1(gbc);
|
||||||
} else if (!blk) {
|
} else if (!blk) {
|
||||||
av_log(s->avctx, AV_LOG_WARNING, "Warning: "
|
av_log(s->avctx, AV_LOG_WARNING, "Warning: new rematrixing strategy not present in block 0\n");
|
||||||
"new rematrixing strategy not present in block 0\n");
|
|
||||||
s->num_rematrixing_bands = 0;
|
s->num_rematrixing_bands = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1082,8 +1081,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
|
|||||||
for(ch=!cpl_in_use; ch<=s->channels; ch++)
|
for(ch=!cpl_in_use; ch<=s->channels; ch++)
|
||||||
bit_alloc_stages[ch] = FFMAX(bit_alloc_stages[ch], 2);
|
bit_alloc_stages[ch] = FFMAX(bit_alloc_stages[ch], 2);
|
||||||
} else if (!blk) {
|
} else if (!blk) {
|
||||||
av_log(s->avctx, AV_LOG_ERROR, "new bit allocation info must "
|
av_log(s->avctx, AV_LOG_ERROR, "new bit allocation info must be present in block 0\n");
|
||||||
"be present in block 0\n");
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1152,8 +1150,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
|
|||||||
s->bit_alloc_params.cpl_fast_leak = fl;
|
s->bit_alloc_params.cpl_fast_leak = fl;
|
||||||
s->bit_alloc_params.cpl_slow_leak = sl;
|
s->bit_alloc_params.cpl_slow_leak = sl;
|
||||||
} else if (!s->eac3 && !blk) {
|
} else if (!s->eac3 && !blk) {
|
||||||
av_log(s->avctx, AV_LOG_ERROR, "new coupling leak info must "
|
av_log(s->avctx, AV_LOG_ERROR, "new coupling leak info must be present in block 0\n");
|
||||||
"be present in block 0\n");
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
s->first_cpl_leak = 0;
|
s->first_cpl_leak = 0;
|
||||||
@@ -1247,8 +1244,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
|
|||||||
} else {
|
} else {
|
||||||
gain *= s->dynamic_range[0];
|
gain *= s->dynamic_range[0];
|
||||||
}
|
}
|
||||||
s->fmt_conv.int32_to_float_fmul_scalar(s->transform_coeffs[ch],
|
s->fmt_conv.int32_to_float_fmul_scalar(s->transform_coeffs[ch], s->fixed_coeffs[ch], gain, 256);
|
||||||
s->fixed_coeffs[ch], gain, 256);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* apply spectral extension to high frequency bins */
|
/* apply spectral extension to high frequency bins */
|
||||||
@@ -1273,19 +1269,16 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
|
|||||||
do_imdct(s, s->channels);
|
do_imdct(s, s->channels);
|
||||||
|
|
||||||
if(downmix_output) {
|
if(downmix_output) {
|
||||||
s->dsp.ac3_downmix(s->output, s->downmix_coeffs,
|
s->dsp.ac3_downmix(s->output, s->downmix_coeffs, s->out_channels, s->fbw_channels, 256);
|
||||||
s->out_channels, s->fbw_channels, 256);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(downmix_output) {
|
if(downmix_output) {
|
||||||
s->dsp.ac3_downmix(s->transform_coeffs + 1, s->downmix_coeffs,
|
s->dsp.ac3_downmix(s->transform_coeffs+1, s->downmix_coeffs, s->out_channels, s->fbw_channels, 256);
|
||||||
s->out_channels, s->fbw_channels, 256);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(downmix_output && !s->downmixed) {
|
if(downmix_output && !s->downmixed) {
|
||||||
s->downmixed = 1;
|
s->downmixed = 1;
|
||||||
s->dsp.ac3_downmix(s->delay, s->downmix_coeffs, s->out_channels,
|
s->dsp.ac3_downmix(s->delay, s->downmix_coeffs, s->out_channels, s->fbw_channels, 128);
|
||||||
s->fbw_channels, 128);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
do_imdct(s, s->out_channels);
|
do_imdct(s, s->out_channels);
|
||||||
@@ -1297,15 +1290,16 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
|
|||||||
/**
|
/**
|
||||||
* Decode a single AC-3 frame.
|
* Decode a single AC-3 frame.
|
||||||
*/
|
*/
|
||||||
static int ac3_decode_frame(AVCodecContext * avctx, void *data,
|
static int ac3_decode_frame(AVCodecContext * avctx, void *data, int *data_size,
|
||||||
int *got_frame_ptr, AVPacket *avpkt)
|
AVPacket *avpkt)
|
||||||
{
|
{
|
||||||
const uint8_t *buf = avpkt->data;
|
const uint8_t *buf = avpkt->data;
|
||||||
int buf_size = avpkt->size;
|
int buf_size = avpkt->size;
|
||||||
AC3DecodeContext *s = avctx->priv_data;
|
AC3DecodeContext *s = avctx->priv_data;
|
||||||
float *out_samples_flt;
|
float *out_samples_flt = data;
|
||||||
int16_t *out_samples_s16;
|
int16_t *out_samples_s16 = data;
|
||||||
int blk, ch, err, ret;
|
int blk, ch, err;
|
||||||
|
int data_size_orig, data_size_tmp;
|
||||||
const uint8_t *channel_map;
|
const uint8_t *channel_map;
|
||||||
const float *output[AC3_MAX_CHANNELS];
|
const float *output[AC3_MAX_CHANNELS];
|
||||||
|
|
||||||
@@ -1322,6 +1316,8 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
|
|||||||
init_get_bits(&s->gbc, buf, buf_size * 8);
|
init_get_bits(&s->gbc, buf, buf_size * 8);
|
||||||
|
|
||||||
/* parse the syncinfo */
|
/* parse the syncinfo */
|
||||||
|
data_size_orig = *data_size;
|
||||||
|
*data_size = 0;
|
||||||
err = parse_frame_header(s);
|
err = parse_frame_header(s);
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
@@ -1342,9 +1338,7 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
|
|||||||
/* skip frame if CRC is ok. otherwise use error concealment. */
|
/* skip frame if CRC is ok. otherwise use error concealment. */
|
||||||
/* TODO: add support for substreams and dependent frames */
|
/* TODO: add support for substreams and dependent frames */
|
||||||
if(s->frame_type == EAC3_FRAME_TYPE_DEPENDENT || s->substreamid) {
|
if(s->frame_type == EAC3_FRAME_TYPE_DEPENDENT || s->substreamid) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "unsupported frame type : "
|
av_log(avctx, AV_LOG_ERROR, "unsupported frame type : skipping frame\n");
|
||||||
"skipping frame\n");
|
|
||||||
*got_frame_ptr = 0;
|
|
||||||
return s->frame_size;
|
return s->frame_size;
|
||||||
} else {
|
} else {
|
||||||
av_log(avctx, AV_LOG_ERROR, "invalid frame type\n");
|
av_log(avctx, AV_LOG_ERROR, "invalid frame type\n");
|
||||||
@@ -1359,10 +1353,9 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
|
|||||||
if (s->frame_size > buf_size) {
|
if (s->frame_size > buf_size) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "incomplete frame\n");
|
av_log(avctx, AV_LOG_ERROR, "incomplete frame\n");
|
||||||
err = AAC_AC3_PARSE_ERROR_FRAME_SIZE;
|
err = AAC_AC3_PARSE_ERROR_FRAME_SIZE;
|
||||||
} else if (avctx->err_recognition & (AV_EF_CRCCHECK|AV_EF_CAREFUL)) {
|
} else if (avctx->error_recognition >= FF_ER_CAREFUL) {
|
||||||
/* check for crc mismatch */
|
/* check for crc mismatch */
|
||||||
if (av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0, &buf[2],
|
if (av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0, &buf[2], s->frame_size-2)) {
|
||||||
s->frame_size - 2)) {
|
|
||||||
av_log(avctx, AV_LOG_ERROR, "frame CRC mismatch\n");
|
av_log(avctx, AV_LOG_ERROR, "frame CRC mismatch\n");
|
||||||
err = AAC_AC3_PARSE_ERROR_CRC;
|
err = AAC_AC3_PARSE_ERROR_CRC;
|
||||||
}
|
}
|
||||||
@@ -1388,10 +1381,6 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
|
|||||||
avctx->channels = s->out_channels;
|
avctx->channels = s->out_channels;
|
||||||
avctx->channel_layout = s->channel_layout;
|
avctx->channel_layout = s->channel_layout;
|
||||||
|
|
||||||
s->loro_center_mix_level = gain_levels[s-> center_mix_level];
|
|
||||||
s->loro_surround_mix_level = gain_levels[s->surround_mix_level];
|
|
||||||
s->ltrt_center_mix_level = LEVEL_MINUS_3DB;
|
|
||||||
s->ltrt_surround_mix_level = LEVEL_MINUS_3DB;
|
|
||||||
/* set downmixing coefficients if needed */
|
/* set downmixing coefficients if needed */
|
||||||
if(s->channels != s->out_channels && !((s->output_mode & AC3_OUTPUT_LFEON) &&
|
if(s->channels != s->out_channels && !((s->output_mode & AC3_OUTPUT_LFEON) &&
|
||||||
s->fbw_channels == s->out_channels)) {
|
s->fbw_channels == s->out_channels)) {
|
||||||
@@ -1407,24 +1396,21 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
|
|||||||
if (s->bitstream_mode == 0x7 && s->channels > 1)
|
if (s->bitstream_mode == 0x7 && s->channels > 1)
|
||||||
avctx->audio_service_type = AV_AUDIO_SERVICE_TYPE_KARAOKE;
|
avctx->audio_service_type = AV_AUDIO_SERVICE_TYPE_KARAOKE;
|
||||||
|
|
||||||
/* get output buffer */
|
|
||||||
s->frame.nb_samples = s->num_blocks * 256;
|
|
||||||
if ((ret = avctx->get_buffer(avctx, &s->frame)) < 0) {
|
|
||||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
out_samples_flt = (float *)s->frame.data[0];
|
|
||||||
out_samples_s16 = (int16_t *)s->frame.data[0];
|
|
||||||
|
|
||||||
/* decode the audio blocks */
|
/* decode the audio blocks */
|
||||||
channel_map = ff_ac3_dec_channel_map[s->output_mode & ~AC3_OUTPUT_LFEON][s->lfe_on];
|
channel_map = ff_ac3_dec_channel_map[s->output_mode & ~AC3_OUTPUT_LFEON][s->lfe_on];
|
||||||
for (ch = 0; ch < s->out_channels; ch++)
|
for (ch = 0; ch < s->out_channels; ch++)
|
||||||
output[ch] = s->output[channel_map[ch]];
|
output[ch] = s->output[channel_map[ch]];
|
||||||
|
data_size_tmp = s->num_blocks * 256 * avctx->channels;
|
||||||
|
data_size_tmp *= avctx->sample_fmt == AV_SAMPLE_FMT_FLT ? sizeof(*out_samples_flt) : sizeof(*out_samples_s16);
|
||||||
|
if (data_size_orig < data_size_tmp)
|
||||||
|
return -1;
|
||||||
|
*data_size = data_size_tmp;
|
||||||
for (blk = 0; blk < s->num_blocks; blk++) {
|
for (blk = 0; blk < s->num_blocks; blk++) {
|
||||||
if (!err && decode_audio_block(s, blk)) {
|
if (!err && decode_audio_block(s, blk)) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "error decoding the audio block\n");
|
av_log(avctx, AV_LOG_ERROR, "error decoding the audio block\n");
|
||||||
err = 1;
|
err = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (avctx->sample_fmt == AV_SAMPLE_FMT_FLT) {
|
if (avctx->sample_fmt == AV_SAMPLE_FMT_FLT) {
|
||||||
s->fmt_conv.float_interleave(out_samples_flt, output, 256,
|
s->fmt_conv.float_interleave(out_samples_flt, output, 256,
|
||||||
s->out_channels);
|
s->out_channels);
|
||||||
@@ -1435,10 +1421,8 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
|
|||||||
out_samples_s16 += 256 * s->out_channels;
|
out_samples_s16 += 256 * s->out_channels;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*data_size = s->num_blocks * 256 * avctx->channels *
|
||||||
*got_frame_ptr = 1;
|
av_get_bytes_per_sample(avctx->sample_fmt);
|
||||||
*(AVFrame *)data = s->frame;
|
|
||||||
|
|
||||||
return FFMIN(buf_size, s->frame_size);
|
return FFMIN(buf_size, s->frame_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1454,27 +1438,6 @@ static av_cold int ac3_decode_end(AVCodecContext *avctx)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define OFFSET(x) offsetof(AC3DecodeContext, x)
|
|
||||||
#define PAR (AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM)
|
|
||||||
static const AVOption options[] = {
|
|
||||||
{ "drc_scale", "percentage of dynamic range compression to apply", OFFSET(drc_scale), AV_OPT_TYPE_FLOAT, {1.0}, 0.0, 1.0, PAR },
|
|
||||||
|
|
||||||
{"dmix_mode", "Preferred Stereo Downmix Mode", OFFSET(preferred_stereo_downmix), AV_OPT_TYPE_INT, {.dbl = -1 }, -1, 2, 0, "dmix_mode"},
|
|
||||||
{"ltrt_cmixlev", "Lt/Rt Center Mix Level", OFFSET(ltrt_center_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, 0},
|
|
||||||
{"ltrt_surmixlev", "Lt/Rt Surround Mix Level", OFFSET(ltrt_surround_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, 0},
|
|
||||||
{"loro_cmixlev", "Lo/Ro Center Mix Level", OFFSET(loro_center_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, 0},
|
|
||||||
{"loro_surmixlev", "Lo/Ro Surround Mix Level", OFFSET(loro_surround_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, 0},
|
|
||||||
|
|
||||||
{ NULL},
|
|
||||||
};
|
|
||||||
|
|
||||||
static const AVClass ac3_decoder_class = {
|
|
||||||
.class_name = "AC3 decoder",
|
|
||||||
.item_name = av_default_item_name,
|
|
||||||
.option = options,
|
|
||||||
.version = LIBAVUTIL_VERSION_INT,
|
|
||||||
};
|
|
||||||
|
|
||||||
AVCodec ff_ac3_decoder = {
|
AVCodec ff_ac3_decoder = {
|
||||||
.name = "ac3",
|
.name = "ac3",
|
||||||
.type = AVMEDIA_TYPE_AUDIO,
|
.type = AVMEDIA_TYPE_AUDIO,
|
||||||
@@ -1483,22 +1446,13 @@ AVCodec ff_ac3_decoder = {
|
|||||||
.init = ac3_decode_init,
|
.init = ac3_decode_init,
|
||||||
.close = ac3_decode_end,
|
.close = ac3_decode_end,
|
||||||
.decode = ac3_decode_frame,
|
.decode = ac3_decode_frame,
|
||||||
.capabilities = CODEC_CAP_DR1,
|
|
||||||
.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"),
|
.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"),
|
||||||
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLT,
|
.sample_fmts = (const enum AVSampleFormat[]) {
|
||||||
AV_SAMPLE_FMT_S16,
|
AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE
|
||||||
AV_SAMPLE_FMT_NONE },
|
},
|
||||||
.priv_class = &ac3_decoder_class,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#if CONFIG_EAC3_DECODER
|
#if CONFIG_EAC3_DECODER
|
||||||
static const AVClass eac3_decoder_class = {
|
|
||||||
.class_name = "E-AC3 decoder",
|
|
||||||
.item_name = av_default_item_name,
|
|
||||||
.option = options,
|
|
||||||
.version = LIBAVUTIL_VERSION_INT,
|
|
||||||
};
|
|
||||||
|
|
||||||
AVCodec ff_eac3_decoder = {
|
AVCodec ff_eac3_decoder = {
|
||||||
.name = "eac3",
|
.name = "eac3",
|
||||||
.type = AVMEDIA_TYPE_AUDIO,
|
.type = AVMEDIA_TYPE_AUDIO,
|
||||||
@@ -1507,11 +1461,9 @@ AVCodec ff_eac3_decoder = {
|
|||||||
.init = ac3_decode_init,
|
.init = ac3_decode_init,
|
||||||
.close = ac3_decode_end,
|
.close = ac3_decode_end,
|
||||||
.decode = ac3_decode_frame,
|
.decode = ac3_decode_frame,
|
||||||
.capabilities = CODEC_CAP_DR1,
|
|
||||||
.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52B (AC-3, E-AC-3)"),
|
.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52B (AC-3, E-AC-3)"),
|
||||||
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLT,
|
.sample_fmts = (const enum AVSampleFormat[]) {
|
||||||
AV_SAMPLE_FMT_S16,
|
AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE
|
||||||
AV_SAMPLE_FMT_NONE },
|
},
|
||||||
.priv_class = &eac3_decoder_class,
|
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -66,9 +66,7 @@
|
|||||||
#define AC3_FRAME_BUFFER_SIZE 32768
|
#define AC3_FRAME_BUFFER_SIZE 32768
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
AVClass *class; ///< class for AVOptions
|
|
||||||
AVCodecContext *avctx; ///< parent context
|
AVCodecContext *avctx; ///< parent context
|
||||||
AVFrame frame; ///< AVFrame for decoded output
|
|
||||||
GetBitContext gbc; ///< bitstream reader
|
GetBitContext gbc; ///< bitstream reader
|
||||||
|
|
||||||
///@name Bit stream information
|
///@name Bit stream information
|
||||||
@@ -89,12 +87,6 @@ typedef struct {
|
|||||||
int eac3; ///< indicates if current frame is E-AC-3
|
int eac3; ///< indicates if current frame is E-AC-3
|
||||||
///@}
|
///@}
|
||||||
|
|
||||||
int preferred_stereo_downmix;
|
|
||||||
float ltrt_center_mix_level;
|
|
||||||
float ltrt_surround_mix_level;
|
|
||||||
float loro_center_mix_level;
|
|
||||||
float loro_surround_mix_level;
|
|
||||||
|
|
||||||
///@name Frame syntax parameters
|
///@name Frame syntax parameters
|
||||||
int snr_offset_strategy; ///< SNR offset strategy (snroffststr)
|
int snr_offset_strategy; ///< SNR offset strategy (snroffststr)
|
||||||
int block_switch_syntax; ///< block switch syntax enabled (blkswe)
|
int block_switch_syntax; ///< block switch syntax enabled (blkswe)
|
||||||
@@ -151,7 +143,6 @@ typedef struct {
|
|||||||
|
|
||||||
///@name Dynamic range
|
///@name Dynamic range
|
||||||
float dynamic_range[2]; ///< dynamic range
|
float dynamic_range[2]; ///< dynamic range
|
||||||
float drc_scale; ///< percentage of dynamic range compression to be applied
|
|
||||||
///@}
|
///@}
|
||||||
|
|
||||||
///@name Bandwidth
|
///@name Bandwidth
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
#include "avcodec.h"
|
#include "avcodec.h"
|
||||||
#include "ac3.h"
|
#include "ac3.h"
|
||||||
#include "ac3dsp.h"
|
#include "ac3dsp.h"
|
||||||
#include "mathops.h"
|
|
||||||
|
|
||||||
static void ac3_exponent_min_c(uint8_t *exp, int num_reuse_blocks, int nb_coefs)
|
static void ac3_exponent_min_c(uint8_t *exp, int num_reuse_blocks, int nb_coefs)
|
||||||
{
|
{
|
||||||
@@ -165,50 +164,21 @@ static void ac3_extract_exponents_c(uint8_t *exp, int32_t *coef, int nb_coefs)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < nb_coefs; i++) {
|
for (i = 0; i < nb_coefs; i++) {
|
||||||
|
int e;
|
||||||
int v = abs(coef[i]);
|
int v = abs(coef[i]);
|
||||||
exp[i] = v ? 23 - av_log2(v) : 24;
|
if (v == 0)
|
||||||
|
e = 24;
|
||||||
|
else {
|
||||||
|
e = 23 - av_log2(v);
|
||||||
|
if (e >= 24) {
|
||||||
|
e = 24;
|
||||||
|
coef[i] = 0;
|
||||||
|
} else if (e < 0) {
|
||||||
|
e = 0;
|
||||||
|
coef[i] = av_clip(coef[i], -16777215, 16777215);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
exp[i] = e;
|
||||||
static void ac3_sum_square_butterfly_int32_c(int64_t sum[4],
|
|
||||||
const int32_t *coef0,
|
|
||||||
const int32_t *coef1,
|
|
||||||
int len)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
sum[0] = sum[1] = sum[2] = sum[3] = 0;
|
|
||||||
|
|
||||||
for (i = 0; i < len; i++) {
|
|
||||||
int lt = coef0[i];
|
|
||||||
int rt = coef1[i];
|
|
||||||
int md = lt + rt;
|
|
||||||
int sd = lt - rt;
|
|
||||||
MAC64(sum[0], lt, lt);
|
|
||||||
MAC64(sum[1], rt, rt);
|
|
||||||
MAC64(sum[2], md, md);
|
|
||||||
MAC64(sum[3], sd, sd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void ac3_sum_square_butterfly_float_c(float sum[4],
|
|
||||||
const float *coef0,
|
|
||||||
const float *coef1,
|
|
||||||
int len)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
sum[0] = sum[1] = sum[2] = sum[3] = 0;
|
|
||||||
|
|
||||||
for (i = 0; i < len; i++) {
|
|
||||||
float lt = coef0[i];
|
|
||||||
float rt = coef1[i];
|
|
||||||
float md = lt + rt;
|
|
||||||
float sd = lt - rt;
|
|
||||||
sum[0] += lt * lt;
|
|
||||||
sum[1] += rt * rt;
|
|
||||||
sum[2] += md * md;
|
|
||||||
sum[3] += sd * sd;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -223,8 +193,6 @@ av_cold void ff_ac3dsp_init(AC3DSPContext *c, int bit_exact)
|
|||||||
c->update_bap_counts = ac3_update_bap_counts_c;
|
c->update_bap_counts = ac3_update_bap_counts_c;
|
||||||
c->compute_mantissa_size = ac3_compute_mantissa_size_c;
|
c->compute_mantissa_size = ac3_compute_mantissa_size_c;
|
||||||
c->extract_exponents = ac3_extract_exponents_c;
|
c->extract_exponents = ac3_extract_exponents_c;
|
||||||
c->sum_square_butterfly_int32 = ac3_sum_square_butterfly_int32_c;
|
|
||||||
c->sum_square_butterfly_float = ac3_sum_square_butterfly_float_c;
|
|
||||||
|
|
||||||
if (ARCH_ARM)
|
if (ARCH_ARM)
|
||||||
ff_ac3dsp_init_arm(c, bit_exact);
|
ff_ac3dsp_init_arm(c, bit_exact);
|
||||||
|
|||||||
@@ -125,12 +125,6 @@ typedef struct AC3DSPContext {
|
|||||||
int (*compute_mantissa_size)(uint16_t mant_cnt[6][16]);
|
int (*compute_mantissa_size)(uint16_t mant_cnt[6][16]);
|
||||||
|
|
||||||
void (*extract_exponents)(uint8_t *exp, int32_t *coef, int nb_coefs);
|
void (*extract_exponents)(uint8_t *exp, int32_t *coef, int nb_coefs);
|
||||||
|
|
||||||
void (*sum_square_butterfly_int32)(int64_t sum[4], const int32_t *coef0,
|
|
||||||
const int32_t *coef1, int len);
|
|
||||||
|
|
||||||
void (*sum_square_butterfly_float)(float sum[4], const float *coef0,
|
|
||||||
const float *coef1, int len);
|
|
||||||
} AC3DSPContext;
|
} AC3DSPContext;
|
||||||
|
|
||||||
void ff_ac3dsp_init (AC3DSPContext *c, int bit_exact);
|
void ff_ac3dsp_init (AC3DSPContext *c, int bit_exact);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user