mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-06 06:49:59 +01:00
Compare commits
708 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4bc7c1ba8e | ||
|
|
0efb4ff86c | ||
|
|
f0bb0aaaa7 | ||
|
|
eb3330b050 | ||
|
|
e31e66948d | ||
|
|
835bc39b26 | ||
|
|
bb81b2b2e0 | ||
|
|
58287d3b10 | ||
|
|
2a7bdbf67e | ||
|
|
653cdf42ee | ||
|
|
829e43017f | ||
|
|
8d14e1d64e | ||
|
|
5da68aff96 | ||
|
|
55aedd679a | ||
|
|
af26185bdc | ||
|
|
af1fb1d467 | ||
|
|
a9fc88ea93 | ||
|
|
23e4284160 | ||
|
|
42c7ed49a9 | ||
|
|
494f2d4f9e | ||
|
|
9597807ab1 | ||
|
|
99fe4c577f | ||
|
|
98e1f0a2db | ||
|
|
3ee5458aa8 | ||
|
|
99f953b3fe | ||
|
|
9b9aee27f4 | ||
|
|
7e350b7ddd | ||
|
|
fc4d11ec9b | ||
|
|
f06e39fe6b | ||
|
|
fd2ba1807e | ||
|
|
3ac156b707 | ||
|
|
09ace619d6 | ||
|
|
145de32896 | ||
|
|
812955a12b | ||
|
|
a63e83cd4b | ||
|
|
c10f3fed25 | ||
|
|
04d2f9ace3 | ||
|
|
10f384e4f5 | ||
|
|
78aa2ed620 | ||
|
|
ad1223d6bc | ||
|
|
a89868d714 | ||
|
|
607863acae | ||
|
|
2ff935a060 | ||
|
|
2e4c649b3e | ||
|
|
60701469ab | ||
|
|
4d60ab62e0 | ||
|
|
8bd27a167b | ||
|
|
17e7edf75b | ||
|
|
a6a8f66608 | ||
|
|
b62704891d | ||
|
|
0c8c6b4419 | ||
|
|
97b6916f93 | ||
|
|
ce1dacb435 | ||
|
|
78dc022f6f | ||
|
|
5379c5184b | ||
|
|
4d90550cf9 | ||
|
|
bacf5db196 | ||
|
|
5358f1b507 | ||
|
|
de75bc01cd | ||
|
|
0b0f1cd44e | ||
|
|
00516b5491 | ||
|
|
3706c22992 | ||
|
|
eac1c3f384 | ||
|
|
163196562f | ||
|
|
2e12af4587 | ||
|
|
20c8f17629 | ||
|
|
c8c93795e4 | ||
|
|
38bd229af9 | ||
|
|
fe8bc7d1ee | ||
|
|
9f7a8b8f8f | ||
|
|
9272aa4698 | ||
|
|
aeca97a7b5 | ||
|
|
b4c479a82a | ||
|
|
9f883e75e6 | ||
|
|
e47543eda5 | ||
|
|
153deed18b | ||
|
|
9eba02d5dd | ||
|
|
557df77eab | ||
|
|
f8a72f041c | ||
|
|
9e505065b5 | ||
|
|
eba112b4e3 | ||
|
|
d411f07751 | ||
|
|
8484351749 | ||
|
|
01a58b439d | ||
|
|
47bb4d888e | ||
|
|
057f655dc6 | ||
|
|
3bd0cd2677 | ||
|
|
a4acb5b900 | ||
|
|
c42fd4c6ee | ||
|
|
3eee21406a | ||
|
|
852ee0e0ad | ||
|
|
ed2c15eadc | ||
|
|
4ad0330b3d | ||
|
|
9fde820d8e | ||
|
|
b5e2ef771d | ||
|
|
63e370b2cf | ||
|
|
af225c41d4 | ||
|
|
bf31271478 | ||
|
|
8715ca0b82 | ||
|
|
4d073ddac9 | ||
|
|
007f3f4165 | ||
|
|
6d2e3efd7c | ||
|
|
fbbd6317e2 | ||
|
|
87908de715 | ||
|
|
de5e003369 | ||
|
|
5c6aea5c31 | ||
|
|
dfe0ba46bf | ||
|
|
6bfa823b70 | ||
|
|
701543a081 | ||
|
|
580418bd55 | ||
|
|
777bc81a91 | ||
|
|
1e9e311e21 | ||
|
|
0eb465f981 | ||
|
|
b01e4d80c6 | ||
|
|
68c9904669 | ||
|
|
790606cfe9 | ||
|
|
7b9bcd993c | ||
|
|
aade60ab16 | ||
|
|
3d91117df0 | ||
|
|
9486e98712 | ||
|
|
f3c7e604fa | ||
|
|
4cb3efc206 | ||
|
|
1e9d234c0c | ||
|
|
8dc4b2c92e | ||
|
|
251b4655be | ||
|
|
1a65ce923a | ||
|
|
b438451b7e | ||
|
|
f1f8c0e558 | ||
|
|
c93874c3a8 | ||
|
|
e27fab0e6e | ||
|
|
f743c4ece8 | ||
|
|
86bf0a8871 | ||
|
|
558d0b9483 | ||
|
|
f78a3868fd | ||
|
|
df2fc63543 | ||
|
|
890c36d7ff | ||
|
|
a2e7fd406c | ||
|
|
7043e435dd | ||
|
|
f7fcd40e63 | ||
|
|
b7a4b4c145 | ||
|
|
de1609bc2d | ||
|
|
bd055c1768 | ||
|
|
2892b01227 | ||
|
|
e4a49ae561 | ||
|
|
1feef46b90 | ||
|
|
19382a2a10 | ||
|
|
57588cda7b | ||
|
|
e5162b3bc9 | ||
|
|
ee9a440f49 | ||
|
|
5582cfd0e4 | ||
|
|
68c9f5cf64 | ||
|
|
e36a005749 | ||
|
|
9fb9419b02 | ||
|
|
23633f4925 | ||
|
|
be5fef6e0d | ||
|
|
e3e5779a04 | ||
|
|
46ecbef251 | ||
|
|
528dd54d15 | ||
|
|
ccdeedf22c | ||
|
|
5c0dff6c60 | ||
|
|
856bdcd5bc | ||
|
|
a5fe40f728 | ||
|
|
359bfa4c27 | ||
|
|
bb263cc33a | ||
|
|
f508bf7ff1 | ||
|
|
898c51a016 | ||
|
|
7fe88bc66c | ||
|
|
333e708520 | ||
|
|
0930a562e7 | ||
|
|
fd85d03162 | ||
|
|
26605efed7 | ||
|
|
a32bbe54e4 | ||
|
|
07bfb254c6 | ||
|
|
9b89041a86 | ||
|
|
09fcc2f865 | ||
|
|
847d3225a8 | ||
|
|
465742bbbe | ||
|
|
40b8e7f168 | ||
|
|
77783c7114 | ||
|
|
979f97a861 | ||
|
|
1b16302e54 | ||
|
|
cbc6ded5b7 | ||
|
|
93fbabb60f | ||
|
|
a14ff5b256 | ||
|
|
7c30ea5006 | ||
|
|
e2d32ad18e | ||
|
|
cea1769fb6 | ||
|
|
082e3fd469 | ||
|
|
747c320a19 | ||
|
|
cf6a34b2a5 | ||
|
|
6537f57782 | ||
|
|
c92e37c207 | ||
|
|
dd923878e8 | ||
|
|
e897e0631a | ||
|
|
b26c9f4e52 | ||
|
|
937cedd7c0 | ||
|
|
c5ba226c1b | ||
|
|
cb31b6ca72 | ||
|
|
b53db58ab7 | ||
|
|
d0323b6234 | ||
|
|
d502bd7410 | ||
|
|
97e6099c0c | ||
|
|
0b6adcf76b | ||
|
|
116aa30db4 | ||
|
|
e6cf47ee9e | ||
|
|
f8602ef717 | ||
|
|
a5bdec1c75 | ||
|
|
dcbfba3bb6 | ||
|
|
068bc633f2 | ||
|
|
95275723ae | ||
|
|
47cb05d783 | ||
|
|
dc556d8bf7 | ||
|
|
fbbe487b1c | ||
|
|
7e9debb083 | ||
|
|
256d615383 | ||
|
|
9680f84a31 | ||
|
|
505415b985 | ||
|
|
d55f7a174d | ||
|
|
cf738340d0 | ||
|
|
861526bbd1 | ||
|
|
7514868cb0 | ||
|
|
4ec5c35850 | ||
|
|
be71990da6 | ||
|
|
99d82a07e7 | ||
|
|
96f9b18497 | ||
|
|
c03533ace2 | ||
|
|
423ce8830e | ||
|
|
5e46ad33eb | ||
|
|
cbc1212499 | ||
|
|
64867f3cb5 | ||
|
|
d6a65735f9 | ||
|
|
c4e2758eec | ||
|
|
9f1c3cd5ad | ||
|
|
160910acdb | ||
|
|
c02d4c1a98 | ||
|
|
6d2a92c467 | ||
|
|
aa99cb15f6 | ||
|
|
67a8a1c202 | ||
|
|
8f3fe7c696 | ||
|
|
64bcb5d350 | ||
|
|
998a0389d3 | ||
|
|
86eec54c94 | ||
|
|
e7800543fe | ||
|
|
fb1823e178 | ||
|
|
a747cf8873 | ||
|
|
002ca3e099 | ||
|
|
fa6eef4210 | ||
|
|
daa809fd9f | ||
|
|
6124a7edbc | ||
|
|
cb51d9ed25 | ||
|
|
3f5824aa18 | ||
|
|
a1ce54ce6a | ||
|
|
ef81f55ec7 | ||
|
|
c2c9b7297f | ||
|
|
a1ac3c2d9c | ||
|
|
ae72abf652 | ||
|
|
9260710739 | ||
|
|
b0558cd011 | ||
|
|
0f84286677 | ||
|
|
18900381e2 | ||
|
|
944c47166d | ||
|
|
86a816902f | ||
|
|
8695d814e1 | ||
|
|
ce74b92c09 | ||
|
|
ba8d684622 | ||
|
|
25ed0f05fd | ||
|
|
b186a5d08c | ||
|
|
af95e174c5 | ||
|
|
93fc80f8bf | ||
|
|
9aaca159bd | ||
|
|
258eea3f2e | ||
|
|
1c2bd6fe5f | ||
|
|
73d5d7acb0 | ||
|
|
80d73b4ada | ||
|
|
b9892e1813 | ||
|
|
d76480e6ba | ||
|
|
33388299fb | ||
|
|
d8dab6c3b8 | ||
|
|
c8fb5d0f38 | ||
|
|
5f7944a308 | ||
|
|
f518fa6bee | ||
|
|
51a23b0e95 | ||
|
|
5c54fc6195 | ||
|
|
2cdc976320 | ||
|
|
efcfd50c9f | ||
|
|
8bd0372937 | ||
|
|
9761abffb6 | ||
|
|
fbeae4a951 | ||
|
|
88433979c2 | ||
|
|
9d1b173aae | ||
|
|
c7934c6c0b | ||
|
|
04c29196ad | ||
|
|
e2dcc4452d | ||
|
|
24dc6b1a06 | ||
|
|
d8e76a531c | ||
|
|
2cfdf732ef | ||
|
|
8268c1fea8 | ||
|
|
d9a91dfb54 | ||
|
|
5d2e4c918f | ||
|
|
7e326d52a7 | ||
|
|
71b8ef938c | ||
|
|
5e6122ddad | ||
|
|
1a0cdd18b0 | ||
|
|
d33b0f7224 | ||
|
|
6ddc1eb037 | ||
|
|
ded74ab5d1 | ||
|
|
f82e9deec2 | ||
|
|
d0cabcc789 | ||
|
|
dac0d4f354 | ||
|
|
3f71c0c1b0 | ||
|
|
ea56f6e5a7 | ||
|
|
9ac3c6c2c6 | ||
|
|
04c506e912 | ||
|
|
bc4dc32b2a | ||
|
|
01580c0955 | ||
|
|
8eb7c2566c | ||
|
|
042b8c2f06 | ||
|
|
2fae70db2a | ||
|
|
f08b0ff051 | ||
|
|
f86b2e4f49 | ||
|
|
d6373f1586 | ||
|
|
2a39548181 | ||
|
|
4c052a7b8b | ||
|
|
30394adc44 | ||
|
|
f908e3ce92 | ||
|
|
683cbbb721 | ||
|
|
cff8d01e15 | ||
|
|
8c118207ea | ||
|
|
406632d1ef | ||
|
|
c320f9f5e9 | ||
|
|
5fed47b94f | ||
|
|
5a01ab0e62 | ||
|
|
dbaf3f7b0b | ||
|
|
4f6fbe47a9 | ||
|
|
7251de3032 | ||
|
|
5ba83e9091 | ||
|
|
93fbf034c9 | ||
|
|
10f77c165c | ||
|
|
5a8dcc993d | ||
|
|
aed12df7fe | ||
|
|
7923a25fdd | ||
|
|
510a96a211 | ||
|
|
0af5a774eb | ||
|
|
aaeef7fa0d | ||
|
|
c340319559 | ||
|
|
582aec4989 | ||
|
|
2c23237cb4 | ||
|
|
9eecf633f7 | ||
|
|
7f451cb01f | ||
|
|
a987750267 | ||
|
|
2416eff5b9 | ||
|
|
414c6bf094 | ||
|
|
6f585f1e66 | ||
|
|
85277ff936 | ||
|
|
f544553c29 | ||
|
|
51ee51b5eb | ||
|
|
2e00dd4d62 | ||
|
|
91138821fb | ||
|
|
a4681d1043 | ||
|
|
151c2ca8c7 | ||
|
|
dafd8228bc | ||
|
|
d9ab7c6292 | ||
|
|
426715ccbd | ||
|
|
a4e3bb0106 | ||
|
|
cd2d8aca84 | ||
|
|
e9d9fd1137 | ||
|
|
e4bae0a140 | ||
|
|
520c3d2303 | ||
|
|
82a627c2c3 | ||
|
|
0cb4887b83 | ||
|
|
4a45535836 | ||
|
|
4427e96bb1 | ||
|
|
731f4bb6fd | ||
|
|
898ce4d6e2 | ||
|
|
93f80cf2cc | ||
|
|
204c8798a8 | ||
|
|
9767d7513c | ||
|
|
d2b9da2f37 | ||
|
|
395538e073 | ||
|
|
a367ab657f | ||
|
|
63235b8d41 | ||
|
|
5353bd0285 | ||
|
|
065996b984 | ||
|
|
1ace588f4a | ||
|
|
50a3442120 | ||
|
|
008ae91bcc | ||
|
|
82c3792a30 | ||
|
|
1fa37f2bfa | ||
|
|
d2d38531d6 | ||
|
|
600bc1deba | ||
|
|
77a2f4cbcf | ||
|
|
7f8b55b560 | ||
|
|
1ab4578c88 | ||
|
|
52ab9e8984 | ||
|
|
2922ab7e6f | ||
|
|
5772cbb343 | ||
|
|
46e1d05991 | ||
|
|
a6f7fc8f3b | ||
|
|
0662967d2b | ||
|
|
ddeb6eeeb1 | ||
|
|
5aac081110 | ||
|
|
d8745de6ae | ||
|
|
46fd6e4f2e | ||
|
|
6cad940989 | ||
|
|
c046890191 | ||
|
|
d70bad04de | ||
|
|
c8462bd17f | ||
|
|
a3410b5a1f | ||
|
|
43039f9386 | ||
|
|
d0c4d61c8b | ||
|
|
95db1624ef | ||
|
|
b0b33ce148 | ||
|
|
fa4192e31f | ||
|
|
4c412580fd | ||
|
|
8f558c3e10 | ||
|
|
5ebdfbe893 | ||
|
|
094a35aeef | ||
|
|
62f9253781 | ||
|
|
858864d350 | ||
|
|
ba31b72f46 | ||
|
|
7594868296 | ||
|
|
09e391abd8 | ||
|
|
b90816d94b | ||
|
|
05015d03da | ||
|
|
34ecaf6e88 | ||
|
|
bb46240cbb | ||
|
|
5ee539f69d | ||
|
|
8ba3198549 | ||
|
|
8355383802 | ||
|
|
c0f7df9662 | ||
|
|
fc6825ebb6 | ||
|
|
f074618a9f | ||
|
|
c6dce25967 | ||
|
|
aba56c03b9 | ||
|
|
2e06758479 | ||
|
|
fc7071cb53 | ||
|
|
2dfe3a7b4d | ||
|
|
9d5f16f6fe | ||
|
|
dc794d7096 | ||
|
|
31a77177ff | ||
|
|
9b0d0fd3c4 | ||
|
|
9925dca119 | ||
|
|
3d5323a351 | ||
|
|
69659389a3 | ||
|
|
731902bd19 | ||
|
|
85a685ac0a | ||
|
|
bd593a98dc | ||
|
|
6f787aa79b | ||
|
|
1e7f825a9b | ||
|
|
c50241080d | ||
|
|
a0361a6c30 | ||
|
|
22c27e1f4a | ||
|
|
9d4355d90a | ||
|
|
0b0e87bb54 | ||
|
|
4fb6fa477e | ||
|
|
c8557235fd | ||
|
|
f719e6566c | ||
|
|
b9a1efa6f4 | ||
|
|
3ee967c1d8 | ||
|
|
e44f89371c | ||
|
|
e586e4d93b | ||
|
|
f156dc54f8 | ||
|
|
685f50b374 | ||
|
|
6086a4d74d | ||
|
|
88089eecfd | ||
|
|
0daf1428e8 | ||
|
|
97cc2f286f | ||
|
|
21d568be17 | ||
|
|
d84c51904c | ||
|
|
0cb3cab343 | ||
|
|
b77d9cbbd5 | ||
|
|
905f5c8a1e | ||
|
|
20373a66ec | ||
|
|
d48da91373 | ||
|
|
62a657de16 | ||
|
|
747fbe0c21 | ||
|
|
c1f479e8df | ||
|
|
d3b40af01f | ||
|
|
74880e78d8 | ||
|
|
60dd8b5733 | ||
|
|
77cf052e39 | ||
|
|
146eac0a0c | ||
|
|
4852b3aabd | ||
|
|
41313bdcc5 | ||
|
|
088ba9bc3e | ||
|
|
b642e45d8c | ||
|
|
a8fc0bb608 | ||
|
|
7c8beec48c | ||
|
|
992957ac30 | ||
|
|
b3c8fd1f0e | ||
|
|
7327505883 | ||
|
|
a3b3096772 | ||
|
|
704952fee5 | ||
|
|
b6f5a1ca58 | ||
|
|
efa8603518 | ||
|
|
1b0082eabc | ||
|
|
78dbb1a7e1 | ||
|
|
4f3f2fe14b | ||
|
|
cdbaaa4f00 | ||
|
|
d4d1f32e48 | ||
|
|
c6c4dc6935 | ||
|
|
494ddd377a | ||
|
|
37e99e384e | ||
|
|
73d6f4651e | ||
|
|
50ebb524cd | ||
|
|
98e96652f1 | ||
|
|
4bde8c1369 | ||
|
|
ece16d91ee | ||
|
|
3348e66e2e | ||
|
|
6e8ed38fab | ||
|
|
f64e4a8c9a | ||
|
|
d92a7870d7 | ||
|
|
5fb5ac7148 | ||
|
|
8d3bc52acd | ||
|
|
dc745b76aa | ||
|
|
b6ae41e7f4 | ||
|
|
670128ff13 | ||
|
|
1f9073f41b | ||
|
|
a991c0673f | ||
|
|
77493bfd97 | ||
|
|
bb3f1cad17 | ||
|
|
a6403a3b69 | ||
|
|
e2cf32ca5f | ||
|
|
48fd461977 | ||
|
|
612b28194b | ||
|
|
8bce2c60b8 | ||
|
|
488ffb8135 | ||
|
|
b786ddc0f2 | ||
|
|
88ae77cea4 | ||
|
|
5bed920971 | ||
|
|
705e89d75f | ||
|
|
ef688e7425 | ||
|
|
02d1efdd5b | ||
|
|
469cb61193 | ||
|
|
a642be972d | ||
|
|
bc9d341be8 | ||
|
|
80ddf7889e | ||
|
|
4be63111d1 | ||
|
|
6626a7df53 | ||
|
|
ab434bf0d0 | ||
|
|
52b18c1fde | ||
|
|
0b2b8ab979 | ||
|
|
65bf4c9c45 | ||
|
|
7c40a0449b | ||
|
|
811a504c6b | ||
|
|
75211f2b8c | ||
|
|
f6687bbb64 | ||
|
|
1400f1a1e4 | ||
|
|
1ea5bbc594 | ||
|
|
f5955d9f6f | ||
|
|
e14564b926 | ||
|
|
0f5a0a4155 | ||
|
|
7acfa7758c | ||
|
|
56b6909b39 | ||
|
|
c6f59b95c5 | ||
|
|
d61c6ebccf | ||
|
|
b9a287f237 | ||
|
|
6407800521 | ||
|
|
6c62098827 | ||
|
|
a23d6ea1e4 | ||
|
|
e492818d89 | ||
|
|
1ca25bc387 | ||
|
|
057051b848 | ||
|
|
71fee2ab1e | ||
|
|
7d3e217623 | ||
|
|
2ac6b573a4 | ||
|
|
7f8846405e | ||
|
|
81bcf9454e | ||
|
|
5a3c8f95d5 | ||
|
|
358e4081ed | ||
|
|
6baaaa0174 | ||
|
|
9e3e11a348 | ||
|
|
1d20d975aa | ||
|
|
e67491a2a4 | ||
|
|
e1a86b1433 | ||
|
|
5310da7e83 | ||
|
|
4eede1fca2 | ||
|
|
b7765d00f9 | ||
|
|
5479e08cc4 | ||
|
|
d0249f1c2e | ||
|
|
108ca6fad1 | ||
|
|
5bee21d724 | ||
|
|
1f8bf163e4 | ||
|
|
7e35c50b81 | ||
|
|
e835ce83e2 | ||
|
|
00bf66785f | ||
|
|
e0e4250421 | ||
|
|
901682ff78 | ||
|
|
5af78cc98d | ||
|
|
59f22ef91a | ||
|
|
5393a5600d | ||
|
|
077beee465 | ||
|
|
02d3ad8609 | ||
|
|
b48cf5412b | ||
|
|
5f3fa5f930 | ||
|
|
0e1bb99f26 | ||
|
|
d2c1a8dc2d | ||
|
|
5a97a5291a | ||
|
|
f6b50924a5 | ||
|
|
a55c274f51 | ||
|
|
eaa9d2cd6b | ||
|
|
d3bec24739 | ||
|
|
3ef1538121 | ||
|
|
47e462eecc | ||
|
|
f3d1670606 | ||
|
|
9547034f91 | ||
|
|
62c9beda0c | ||
|
|
0e68b6ddce | ||
|
|
75e88db330 | ||
|
|
6baa549249 | ||
|
|
22561bc0e9 | ||
|
|
8a4464514f | ||
|
|
85e94a30ee | ||
|
|
3445bec6fc | ||
|
|
c8dace2728 | ||
|
|
9bcb84810f | ||
|
|
54e19092fd | ||
|
|
3d67f52f9d | ||
|
|
bfd586577c | ||
|
|
5589549c1d | ||
|
|
5c316acaa0 | ||
|
|
f4fb841ad1 | ||
|
|
c2d11275f7 | ||
|
|
b54c155f5b | ||
|
|
ea2d44503f | ||
|
|
59f7d583a3 | ||
|
|
fb876e4572 | ||
|
|
c2d2bf1d6b | ||
|
|
302094e1d2 | ||
|
|
8d55c2441c | ||
|
|
d7e7e12abc | ||
|
|
a856623e87 | ||
|
|
348cd84fc8 | ||
|
|
62de693a17 | ||
|
|
33769e908d | ||
|
|
1a28948eb3 | ||
|
|
01050448cf | ||
|
|
edc00dea02 | ||
|
|
8d0631c8fa | ||
|
|
1135928903 | ||
|
|
6f3bc92c29 | ||
|
|
bd531038e8 | ||
|
|
90da0cb60e | ||
|
|
3049d5b9b3 | ||
|
|
43c6b45a53 | ||
|
|
68a0477bc0 | ||
|
|
ccf0cd967d | ||
|
|
002ad7cd39 | ||
|
|
397fafad23 | ||
|
|
30f0cd2f1e | ||
|
|
4d6d8d9ae9 | ||
|
|
9348514a67 | ||
|
|
17704500fb | ||
|
|
2338eda8d8 | ||
|
|
6a0633e961 | ||
|
|
16dc41de27 | ||
|
|
ab471e17e4 | ||
|
|
3be8aeb14e | ||
|
|
b48e251360 | ||
|
|
65a4b90840 | ||
|
|
59956a5957 | ||
|
|
d4a08e560d | ||
|
|
dacac91973 | ||
|
|
d39400fed7 | ||
|
|
07174ed841 | ||
|
|
e7475335b1 | ||
|
|
722bfe4e7c | ||
|
|
cc8ab98656 | ||
|
|
d7cff9f8e8 | ||
|
|
9bfda9df71 | ||
|
|
0a837b6317 | ||
|
|
c3c1db7c56 | ||
|
|
21ca4ab944 | ||
|
|
c749bec8c3 | ||
|
|
a95306e2d7 | ||
|
|
ed12d1ecad | ||
|
|
05ed9b7005 | ||
|
|
76477c3843 | ||
|
|
ccc4219558 | ||
|
|
9d60f608af | ||
|
|
6a4803a6a9 | ||
|
|
c3b67720f9 | ||
|
|
1c373456f6 | ||
|
|
9636266cbd | ||
|
|
dc3349024a | ||
|
|
66a3112100 | ||
|
|
72eca26bf9 | ||
|
|
e44d56b18d | ||
|
|
71e00caeab | ||
|
|
7a2ee770f5 | ||
|
|
fadebd256e | ||
|
|
3dab6e5429 | ||
|
|
bc182a6aca | ||
|
|
fbde7b2d0a | ||
|
|
58baa367d6 | ||
|
|
ca2e3f1131 | ||
|
|
ebd3aa429c | ||
|
|
ddb0317154 | ||
|
|
606aa3baee | ||
|
|
36dac6da41 | ||
|
|
9202824e1b | ||
|
|
0135dd73bb | ||
|
|
c01be297ce | ||
|
|
42bd6d9cf6 | ||
|
|
79013a59c0 | ||
|
|
c1555ae4b6 | ||
|
|
a557005417 | ||
|
|
8069b44ebf |
11
.gitignore
vendored
11
.gitignore
vendored
@@ -6,8 +6,6 @@
|
||||
*.dylib
|
||||
*.exe
|
||||
*.exp
|
||||
*.gcda
|
||||
*.gcno
|
||||
*.h.c
|
||||
*.ilk
|
||||
*.lib
|
||||
@@ -26,13 +24,11 @@
|
||||
/ffprobe
|
||||
/ffserver
|
||||
/config.*
|
||||
/coverage.info
|
||||
/version.h
|
||||
/doc/*.1
|
||||
/doc/*.3
|
||||
/doc/*.html
|
||||
/doc/*.pod
|
||||
/doc/config.texi
|
||||
/doc/avoptions_codec.texi
|
||||
/doc/avoptions_format.texi
|
||||
/doc/examples/decoding_encoding
|
||||
@@ -41,13 +37,11 @@
|
||||
/doc/examples/filtering_video
|
||||
/doc/examples/metadata
|
||||
/doc/examples/muxing
|
||||
/doc/examples/pc-uninstalled
|
||||
/doc/examples/resampling_audio
|
||||
/doc/examples/scaling_video
|
||||
/doc/fate.txt
|
||||
/doc/doxy/html/
|
||||
/doc/print_options
|
||||
/lcov/
|
||||
/libavcodec/*_tablegen
|
||||
/libavcodec/*_tables.c
|
||||
/libavcodec/*_tables.h
|
||||
@@ -57,23 +51,18 @@
|
||||
/tests/data/
|
||||
/tests/rotozoom
|
||||
/tests/tiny_psnr
|
||||
/tests/tiny_ssim
|
||||
/tests/videogen
|
||||
/tests/vsynth1/
|
||||
/tools/aviocat
|
||||
/tools/ffbisect
|
||||
/tools/bisect.need
|
||||
/tools/crypto_bench
|
||||
/tools/cws2fws
|
||||
/tools/fourcc2pixfmt
|
||||
/tools/ffescape
|
||||
/tools/ffeval
|
||||
/tools/ffhash
|
||||
/tools/graph2dot
|
||||
/tools/ismindex
|
||||
/tools/pktdumper
|
||||
/tools/probetest
|
||||
/tools/qt-faststart
|
||||
/tools/trasher
|
||||
/tools/seek_print
|
||||
/tools/zmqsend
|
||||
|
||||
59
CREDITS
59
CREDITS
@@ -1,6 +1,55 @@
|
||||
See the Git history of the project (git://source.ffmpeg.org/ffmpeg) to
|
||||
get the names of people who have contributed to FFmpeg.
|
||||
This file contains the names of some of the people who have contributed to
|
||||
FFmpeg. The names are sorted alphabetically by last name. As this file is
|
||||
currently quite outdated and git serves as a much better tool for determining
|
||||
authorship, it remains here for historical reasons only.
|
||||
|
||||
To check the log, you can type the command "git log" in the FFmpeg
|
||||
source directory, or browse the online repository at
|
||||
http://source.ffmpeg.org.
|
||||
Dénes Balatoni
|
||||
Michel Bardiaux
|
||||
Fabrice Bellard
|
||||
Patrice Bensoussan
|
||||
Alex Beregszaszi
|
||||
BERO
|
||||
Thilo Borgmann
|
||||
Mario Brito
|
||||
Ronald Bultje
|
||||
Alex Converse
|
||||
Maarten Daniels
|
||||
Reimar Doeffinger
|
||||
Tim Ferguson
|
||||
Brian Foley
|
||||
Arpad Gereoffy
|
||||
Philip Gladstone
|
||||
Vladimir Gneushev
|
||||
Roine Gustafsson
|
||||
David Hammerton
|
||||
Wolfgang Hesseler
|
||||
Marc Hoffman
|
||||
Falk Hueffner
|
||||
Aurélien Jacobs
|
||||
Steven Johnson
|
||||
Zdenek Kabelac
|
||||
Robin Kay
|
||||
Todd Kirby
|
||||
Nick Kurshev
|
||||
Benjamin Larsson
|
||||
Loïc Le Loarer
|
||||
Daniel Maas
|
||||
Mike Melanson
|
||||
Loren Merritt
|
||||
Jeff Muizelaar
|
||||
Michael Niedermayer
|
||||
François Revol
|
||||
Peter Ross
|
||||
Måns Rullgård
|
||||
Stefano Sabatini
|
||||
Roman Shaposhnik
|
||||
Oded Shimon
|
||||
Dieter Shirley
|
||||
Konstantin Shishkov
|
||||
Juan J. Sierralta
|
||||
Ewald Snel
|
||||
Sascha Sommer
|
||||
Leon van Stuivenberg
|
||||
Roberto Togni
|
||||
Lionel Ulmer
|
||||
Reynaldo Verdejo
|
||||
|
||||
30
LICENSE
30
LICENSE
@@ -33,28 +33,16 @@ Specifically, the GPL parts of FFmpeg are
|
||||
- vf_geq.c
|
||||
- vf_histeq.c
|
||||
- vf_hqdn3d.c
|
||||
- vf_hue.c
|
||||
- vf_kerndeint.c
|
||||
- vf_mcdeint.c
|
||||
- vf_mp.c
|
||||
- vf_owdenoise.c
|
||||
- vf_perspective.c
|
||||
- vf_phase.c
|
||||
- vf_pp.c
|
||||
- vf_pullup.c
|
||||
- vf_sab.c
|
||||
- vf_smartblur.c
|
||||
- vf_spp.c
|
||||
- vf_stereo3d.c
|
||||
- vf_super2xsai.c
|
||||
- vf_tinterlace.c
|
||||
- vf_yadif.c
|
||||
- vsrc_mptestsrc.c
|
||||
|
||||
Should you, for whatever reason, prefer to use version 3 of the (L)GPL, then
|
||||
the configure parameter --enable-version3 will activate this licensing option
|
||||
for you. Read the file COPYING.LGPLv3 or, if you have enabled GPL parts,
|
||||
COPYING.GPLv3 to learn the exact legal terms that apply in this case.
|
||||
|
||||
There are a handful of files under other licensing terms, namely:
|
||||
|
||||
* The files libavcodec/jfdctfst.c, libavcodec/jfdctint_template.c and
|
||||
@@ -64,6 +52,11 @@ There are a handful of files under other licensing terms, namely:
|
||||
You must also indicate any changes including additions and deletions to
|
||||
those three files in the documentation.
|
||||
|
||||
Should you, for whatever reason, prefer to use version 3 of the (L)GPL, then
|
||||
the configure parameter --enable-version3 will activate this licensing option
|
||||
for you. Read the file COPYING.LGPLv3 or, if you have enabled GPL parts,
|
||||
COPYING.GPLv3 to learn the exact legal terms that apply in this case.
|
||||
|
||||
|
||||
external libraries
|
||||
==================
|
||||
@@ -74,15 +67,8 @@ affect the licensing of binaries resulting from the combination.
|
||||
compatible libraries
|
||||
--------------------
|
||||
|
||||
The following libraries are under GPL:
|
||||
- frei0r
|
||||
- libcdio
|
||||
- libutvideo
|
||||
- libvidstab
|
||||
- libx264
|
||||
- libxavs
|
||||
- libxvid
|
||||
When combining them with FFmpeg, FFmpeg needs to be licensed as GPL as well by
|
||||
The libcdio, libx264, libxavs and libxvid libraries are under GPL. When
|
||||
combining them with FFmpeg, FFmpeg needs to be licensed as GPL as well by
|
||||
passing --enable-gpl to configure.
|
||||
|
||||
The OpenCORE and VisualOn libraries are under the Apache License 2.0. That
|
||||
|
||||
116
MAINTAINERS
116
MAINTAINERS
@@ -7,8 +7,8 @@ FFmpeg code.
|
||||
Please try to keep entries where you are the maintainer up to date!
|
||||
|
||||
Names in () mean that the maintainer currently has no time to maintain the code.
|
||||
A (CC <address>) after the name means that the maintainer prefers to be CC-ed on
|
||||
patches and related discussions.
|
||||
A CC after the name means that the maintainer prefers to be CC-ed on patches
|
||||
and related discussions.
|
||||
|
||||
|
||||
Project Leader
|
||||
@@ -43,24 +43,16 @@ QuickTime faststart:
|
||||
Miscellaneous Areas
|
||||
===================
|
||||
|
||||
documentation Stefano Sabatini, Mike Melanson, Timothy Gu
|
||||
documentation Mike Melanson
|
||||
website Robert Swain, Lou Logan
|
||||
build system (configure,Makefiles) Diego Biurrun, Mans Rullgard
|
||||
project server Árpád Gereöffy, Michael Niedermayer, Reimar Döffinger, Alexander Strasser
|
||||
project server Árpád Gereöffy, Michael Niedermayer, Reimar Döffinger
|
||||
mailinglists Michael Niedermayer, Baptiste Coudurier, Lou Logan
|
||||
presets Robert Swain
|
||||
metadata subsystem Aurelien Jacobs
|
||||
release management Michael Niedermayer
|
||||
|
||||
|
||||
Communication
|
||||
=============
|
||||
|
||||
website Robert Swain, Lou Logan
|
||||
mailinglists Michael Niedermayer, Baptiste Coudurier, Lou Logan
|
||||
Google+ Paul B Mahol, Michael Niedermayer, Alexander Strasser
|
||||
Twitter Lou Logan
|
||||
Launchpad Timothy Gu
|
||||
|
||||
|
||||
libavutil
|
||||
=========
|
||||
|
||||
@@ -70,23 +62,11 @@ Internal Interfaces:
|
||||
libavutil/common.h Michael Niedermayer
|
||||
|
||||
Other:
|
||||
bprint Nicolas George
|
||||
bswap.h
|
||||
des Reimar Doeffinger
|
||||
eval.c, eval.h Michael Niedermayer
|
||||
float_dsp Loren Merritt
|
||||
hash Reimar Doeffinger
|
||||
intfloat* Michael Niedermayer
|
||||
integer.c, integer.h Michael Niedermayer
|
||||
lzo Reimar Doeffinger
|
||||
mathematics.c, mathematics.h Michael Niedermayer
|
||||
mem.c, mem.h Michael Niedermayer
|
||||
opencl.c, opencl.h Wei Gao
|
||||
opt.c, opt.h Michael Niedermayer
|
||||
rational.c, rational.h Michael Niedermayer
|
||||
rc4 Reimar Doeffinger
|
||||
ripemd.c, ripemd.h James Almer
|
||||
timecode Clément Bœsch
|
||||
mathematics.c, mathematics.h Michael Niedermayer
|
||||
integer.c, integer.h Michael Niedermayer
|
||||
bswap.h
|
||||
|
||||
|
||||
libavcodec
|
||||
@@ -97,6 +77,10 @@ Generic Parts:
|
||||
avcodec.h Michael Niedermayer
|
||||
utility code:
|
||||
utils.c Michael Niedermayer
|
||||
mem.c Michael Niedermayer
|
||||
opt.c, opt.h Michael Niedermayer
|
||||
arithmetic expression evaluator:
|
||||
eval.c Michael Niedermayer
|
||||
audio and video frame extraction:
|
||||
parser.c Michael Niedermayer
|
||||
bitstream reading:
|
||||
@@ -127,8 +111,6 @@ Generic Parts:
|
||||
libpostproc/* Michael Niedermayer
|
||||
table generation:
|
||||
tableprint.c, tableprint.h Reimar Doeffinger
|
||||
fixed point FFT:
|
||||
fft* Zeljko Lukac
|
||||
|
||||
Codecs:
|
||||
4xm.c Michael Niedermayer
|
||||
@@ -147,8 +129,8 @@ Codecs:
|
||||
binkaudio.c Peter Ross
|
||||
bmp.c Mans Rullgard, Kostya Shishkov
|
||||
cavs* Stefan Gehrer
|
||||
cdxl.c Paul B Mahol
|
||||
celp_filters.* Vitor Sessak
|
||||
cdxl.c Paul B Mahol
|
||||
cinepak.c Roberto Togni
|
||||
cljr Alex Beregszaszi
|
||||
cllc.c Derek Buitenhuis
|
||||
@@ -159,10 +141,9 @@ Codecs:
|
||||
dca.c Kostya Shishkov, Benjamin Larsson
|
||||
dnxhd* Baptiste Coudurier
|
||||
dpcm.c Mike Melanson
|
||||
dv.c Roman Shaposhnik
|
||||
dxa.c Kostya Shishkov
|
||||
dv.c Roman Shaposhnik
|
||||
eacmv*, eaidct*, eat* Peter Ross
|
||||
exif.c, exif.h Thilo Borgmann
|
||||
ffv1.c Michael Niedermayer
|
||||
ffwavesynth.c Nicolas George
|
||||
flac* Justin Ruggles
|
||||
@@ -171,9 +152,9 @@ Codecs:
|
||||
g722.c Martin Storsjo
|
||||
g726.c Roman Shaposhnik
|
||||
gifdec.c Baptiste Coudurier
|
||||
h264* Loren Merritt, Michael Niedermayer
|
||||
h261* Michael Niedermayer
|
||||
h263* Michael Niedermayer
|
||||
h264* Loren Merritt, Michael Niedermayer
|
||||
huffyuv.c Michael Niedermayer
|
||||
idcinvideo.c Mike Melanson
|
||||
imc* Benjamin Larsson
|
||||
@@ -182,14 +163,13 @@ Codecs:
|
||||
interplayvideo.c Mike Melanson
|
||||
ivi* Kostya Shishkov
|
||||
jacosub* Clément Bœsch
|
||||
jpeg2000* Nicolas Bertrand
|
||||
jpeg_ls.c Kostya Shishkov
|
||||
jvdec.c Peter Ross
|
||||
kmvc.c Kostya Shishkov
|
||||
lcl*.c Roberto Togni, Reimar Doeffinger
|
||||
libcelt_dec.c Nicolas George
|
||||
libdirac* David Conrad
|
||||
libgsm.c Michel Bardiaux
|
||||
libdirac* David Conrad
|
||||
libopenjpeg.c Jaikrishnan Menon
|
||||
libopenjpegenc.c Michael Bradshaw
|
||||
libschroedinger* David Conrad
|
||||
@@ -197,8 +177,8 @@ Codecs:
|
||||
libtheoraenc.c David Conrad
|
||||
libutvideo* Derek Buitenhuis
|
||||
libvorbis.c David Conrad
|
||||
libx264.c Mans Rullgard, Jason Garrett-Glaser
|
||||
libxavs.c Stefan Gehrer
|
||||
libx264.c Mans Rullgard, Jason Garrett-Glaser
|
||||
loco.c Kostya Shishkov
|
||||
lzo.h, lzo.c Reimar Doeffinger
|
||||
mdec.c Michael Niedermayer
|
||||
@@ -209,7 +189,6 @@ Codecs:
|
||||
mpc* Kostya Shishkov
|
||||
mpeg12.c, mpeg12data.h Michael Niedermayer
|
||||
mpegvideo.c, mpegvideo.h Michael Niedermayer
|
||||
mqc* Nicolas Bertrand
|
||||
msmpeg4.c, msmpeg4data.h Michael Niedermayer
|
||||
msrle.c Mike Melanson
|
||||
msvideo1.c Mike Melanson
|
||||
@@ -235,7 +214,6 @@ Codecs:
|
||||
s3tc* Ivo van Poorten
|
||||
smacker.c Kostya Shishkov
|
||||
smc.c Mike Melanson
|
||||
smvjpegdec.c Ash Hughes
|
||||
snow.c Michael Niedermayer, Loren Merritt
|
||||
sonic.c Alex Beregszaszi
|
||||
srt* Aurelien Jacobs
|
||||
@@ -249,7 +227,6 @@ Codecs:
|
||||
truespeech.c Kostya Shishkov
|
||||
tscc.c Kostya Shishkov
|
||||
tta.c Alex Beregszaszi, Jaikrishnan Menon
|
||||
ttaenc.c Paul B Mahol
|
||||
txd.c Ivo van Poorten
|
||||
ulti* Kostya Shishkov
|
||||
v410*.c Derek Buitenhuis
|
||||
@@ -260,8 +237,8 @@ Codecs:
|
||||
vda_h264_dec.c Xidorn Quan
|
||||
vima.c Paul B Mahol
|
||||
vmnc.c Kostya Shishkov
|
||||
vorbis_dec.c Denes Balatoni, David Conrad
|
||||
vorbis_enc.c Oded Shimon
|
||||
vorbis_dec.c Denes Balatoni, David Conrad
|
||||
vp3* Mike Melanson
|
||||
vp5 Aurelien Jacobs
|
||||
vp6 Aurelien Jacobs
|
||||
@@ -274,7 +251,6 @@ Codecs:
|
||||
wnv1.c Kostya Shishkov
|
||||
xan.c Mike Melanson
|
||||
xbm* Paul B Mahol
|
||||
xface Stefano Sabatini
|
||||
xl.c Kostya Shishkov
|
||||
xvmc.c Ivan Kalvachev
|
||||
xwd* Paul B Mahol
|
||||
@@ -296,15 +272,11 @@ libavdevice
|
||||
libavdevice/avdevice.h
|
||||
|
||||
|
||||
dshow.c Roger Pack
|
||||
fbdev_enc.c Lukasz Marek
|
||||
iec61883.c Georg Lippitsch
|
||||
lavfi Stefano Sabatini
|
||||
libdc1394.c Roman Shaposhnik
|
||||
pulse_audio_enc.c Lukasz Marek
|
||||
sdl Stefano Sabatini
|
||||
v4l2.c Luca Abeni
|
||||
vfwcap.c Ramiro Polla
|
||||
dshow.c Roger Pack
|
||||
|
||||
libavfilter
|
||||
===========
|
||||
@@ -313,33 +285,10 @@ Generic parts:
|
||||
graphdump.c Nicolas George
|
||||
|
||||
Filters:
|
||||
af_adelay.c Paul B Mahol
|
||||
af_aecho.c Paul B Mahol
|
||||
af_afade.c Paul B Mahol
|
||||
af_amerge.c Nicolas George
|
||||
af_aphaser.c Paul B Mahol
|
||||
af_aresample.c Michael Niedermayer
|
||||
af_astats.c Paul B Mahol
|
||||
af_astreamsync.c Nicolas George
|
||||
af_atempo.c Pavel Koshevoy
|
||||
af_biquads.c Paul B Mahol
|
||||
af_compand.c Paul B Mahol
|
||||
af_ladspa.c Paul B Mahol
|
||||
af_pan.c Nicolas George
|
||||
avf_avectorscope.c Paul B Mahol
|
||||
vf_blend.c Paul B Mahol
|
||||
vf_colorbalance.c Paul B Mahol
|
||||
vf_delogo.c Jean Delvare (CC <khali@linux-fr.org>)
|
||||
vf_drawbox.c/drawgrid Andrey Utkin
|
||||
vf_extractplanes.c Paul B Mahol
|
||||
vf_histogram.c Paul B Mahol
|
||||
vf_il.c Paul B Mahol
|
||||
vf_mergeplanes.c Paul B Mahol
|
||||
vf_psnr.c Paul B Mahol
|
||||
vf_scale.c Michael Niedermayer
|
||||
vf_separatefields.c Paul B Mahol
|
||||
vf_stereo3d.c Paul B Mahol
|
||||
vf_telecine.c Paul B Mahol
|
||||
vf_yadif.c Michael Niedermayer
|
||||
|
||||
Sources:
|
||||
@@ -359,14 +308,12 @@ Muxers/Demuxers:
|
||||
4xm.c Mike Melanson
|
||||
adtsenc.c Robert Swain
|
||||
afc.c Paul B Mahol
|
||||
aiffdec.c Baptiste Coudurier, Matthieu Bouron
|
||||
aiffenc.c Baptiste Coudurier, Matthieu Bouron
|
||||
aiff.c Baptiste Coudurier
|
||||
ape.c Kostya Shishkov
|
||||
ass* Aurelien Jacobs
|
||||
astdec.c Paul B Mahol
|
||||
astenc.c James Almer
|
||||
avi* Michael Niedermayer
|
||||
avisynth.c AvxSynth Team (avxsynth.testing at gmail dot com)
|
||||
avr.c Paul B Mahol
|
||||
bink.c Peter Ross
|
||||
brstm.c Paul B Mahol
|
||||
@@ -388,8 +335,8 @@ Muxers/Demuxers:
|
||||
idcin.c Mike Melanson
|
||||
idroqdec.c Mike Melanson
|
||||
iff.c Jaikrishnan Menon
|
||||
img2*.c Michael Niedermayer
|
||||
ipmovie.c Mike Melanson
|
||||
img2*.c Michael Niedermayer
|
||||
ircam* Paul B Mahol
|
||||
iss.c Stefan Gehrer
|
||||
jacosub* Clément Bœsch
|
||||
@@ -403,11 +350,11 @@ Muxers/Demuxers:
|
||||
matroskadec.c Aurelien Jacobs
|
||||
matroskaenc.c David Conrad
|
||||
metadata* Aurelien Jacobs
|
||||
mgsts.c Paul B Mahol
|
||||
microdvd* Aurelien Jacobs
|
||||
mgsts.c Paul B Mahol
|
||||
mm.c Peter Ross
|
||||
mov.c Michael Niedermayer, Baptiste Coudurier
|
||||
movenc.c Baptiste Coudurier, Matthieu Bouron
|
||||
movenc.c Michael Niedermayer, Baptiste Coudurier
|
||||
mpc.c Kostya Shishkov
|
||||
mpeg.c Michael Niedermayer
|
||||
mpegenc.c Michael Niedermayer
|
||||
@@ -452,7 +399,6 @@ Muxers/Demuxers:
|
||||
voc.c Aurelien Jacobs
|
||||
wav.c Michael Niedermayer
|
||||
wc3movie.c Mike Melanson
|
||||
webvtt* Matthew J Heaney
|
||||
westwood.c Mike Melanson
|
||||
wtv.c Peter Ross
|
||||
wv.c Kostya Shishkov
|
||||
@@ -460,9 +406,7 @@ Muxers/Demuxers:
|
||||
|
||||
Protocols:
|
||||
bluray.c Petri Hintukainen
|
||||
ftp.c Lukasz Marek
|
||||
http.c Ronald S. Bultje
|
||||
libssh.c Lukasz Marek
|
||||
mms*.c Ronald S. Bultje
|
||||
udp.c Luca Abeni
|
||||
|
||||
@@ -487,7 +431,7 @@ Operating systems / CPU architectures
|
||||
Alpha Mans Rullgard, Falk Hueffner
|
||||
ARM Mans Rullgard
|
||||
AVR32 Mans Rullgard
|
||||
MIPS Mans Rullgard, Nedeljko Babic
|
||||
MIPS Mans Rullgard
|
||||
Mac OS X / PowerPC Romain Dolbeau, Guillaume Poirier
|
||||
Amiga / PowerPC Colin Ward
|
||||
Linux / PowerPC Luca Barbato
|
||||
@@ -501,8 +445,9 @@ x86 Michael Niedermayer
|
||||
Releases
|
||||
========
|
||||
|
||||
2.1 Michael Niedermayer
|
||||
2.0 Michael Niedermayer
|
||||
1.2 Michael Niedermayer
|
||||
1.1 Michael Niedermayer
|
||||
1.0 Michael Niedermayer
|
||||
|
||||
If you want to maintain an older release, please contact us
|
||||
|
||||
@@ -510,10 +455,8 @@ If you want to maintain an older release, please contact us
|
||||
GnuPG Fingerprints of maintainers and contributors
|
||||
==================================================
|
||||
|
||||
Alexander Strasser 1C96 78B7 83CB 8AA7 9AF5 D1EB A7D8 A57B A876 E58F
|
||||
Anssi Hannula 1A92 FF42 2DD9 8D2E 8AF7 65A9 4278 C520 513D F3CB
|
||||
Anton Khirnov 6D0C 6625 56F8 65D1 E5F5 814B B50A 1241 C067 07AB
|
||||
Ash Hughes 694D 43D2 D180 C7C7 6421 ABD3 A641 D0B7 623D 6029
|
||||
Attila Kinali 11F0 F9A6 A1D2 11F6 C745 D10C 6520 BCDD F2DF E765
|
||||
Baptiste Coudurier 8D77 134D 20CC 9220 201F C5DB 0AC9 325C 5C1A BAAA
|
||||
Ben Littler 3EE3 3723 E560 3214 A8CD 4DEB 2CDB FCE7 768C 8D2C
|
||||
@@ -521,10 +464,8 @@ Benoit Fouet B22A 4F4F 43EF 636B BB66 FCDC 0023 AE1E 2985 49C8
|
||||
Bœsch Clément 52D0 3A82 D445 F194 DB8B 2B16 87EE 2CB8 F4B8 FCF9
|
||||
Daniel Verkamp 78A6 07ED 782C 653E C628 B8B9 F0EB 8DD8 2F0E 21C7
|
||||
Diego Biurrun 8227 1E31 B6D9 4994 7427 E220 9CAE D6CC 4757 FCC5
|
||||
FFmpeg release signing key FCF9 86EA 15E6 E293 A564 4F10 B432 2F04 D676 58D8
|
||||
Gwenole Beauchesne 2E63 B3A6 3E44 37E2 017D 2704 53C7 6266 B153 99C4
|
||||
Jaikrishnan Menon 61A1 F09F 01C9 2D45 78E1 C862 25DC 8831 AF70 D368
|
||||
Jean Delvare 7CA6 9F44 60F1 BDC4 1FD2 C858 A552 6B9B B3CD 4E6A
|
||||
Justin Ruggles 3136 ECC0 C10D 6C04 5F43 CA29 FCBE CD2A 3787 1EBF
|
||||
Loren Merritt ABD9 08F4 C920 3F65 D8BE 35D7 1540 DAA7 060F 56DE
|
||||
Lou Logan 7D68 DC73 CBEF EABB 671A B6CF 621C 2E28 82F8 DC3A
|
||||
@@ -541,4 +482,3 @@ Sascha Sommer 38A0 F88B 868E 9D3A 97D4 D6A0 E823 706F 1E07 0D3C
|
||||
Stefano Sabatini 0D0B AD6B 5330 BBAD D3D6 6A0C 719C 2839 FC43 2D5F
|
||||
Stephan Hilb 4F38 0B3A 5F39 B99B F505 E562 8D5C 5554 4E17 8863
|
||||
Tomas Härdin A79D 4E3D F38F 763F 91F5 8B33 A01E 8AE0 41BB 2551
|
||||
Wei Gao 4269 7741 857A 0E60 9EC5 08D2 4744 4EFA 62C1 87B9
|
||||
|
||||
18
Makefile
18
Makefile
@@ -20,7 +20,7 @@ INSTPROGS = $(PROGS-yes:%=%$(PROGSSUF)$(EXESUF))
|
||||
|
||||
OBJS = cmdutils.o $(EXEOBJS)
|
||||
OBJS-ffmpeg = ffmpeg_opt.o ffmpeg_filter.o
|
||||
TESTTOOLS = audiogen videogen rotozoom tiny_psnr tiny_ssim base64
|
||||
TESTTOOLS = audiogen videogen rotozoom tiny_psnr base64
|
||||
HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options
|
||||
TOOLS = qt-faststart trasher
|
||||
TOOLS-$(CONFIG_ZLIB) += cws2fws
|
||||
@@ -28,6 +28,7 @@ TOOLS-$(CONFIG_ZLIB) += cws2fws
|
||||
BASENAMES = ffmpeg ffplay ffprobe ffserver
|
||||
ALLPROGS = $(BASENAMES:%=%$(PROGSSUF)$(EXESUF))
|
||||
ALLPROGS_G = $(BASENAMES:%=%$(PROGSSUF)_g$(EXESUF))
|
||||
ALLMANPAGES = $(BASENAMES:%=%.1)
|
||||
|
||||
FFLIBS-$(CONFIG_AVDEVICE) += avdevice
|
||||
FFLIBS-$(CONFIG_AVFILTER) += avfilter
|
||||
@@ -43,7 +44,7 @@ FFLIBS := avutil
|
||||
DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.ffpreset) $(SRC_PATH)/doc/ffprobe.xsd
|
||||
EXAMPLES_FILES := $(wildcard $(SRC_PATH)/doc/examples/*.c) $(SRC_PATH)/doc/examples/Makefile $(SRC_PATH)/doc/examples/README
|
||||
|
||||
SKIPHEADERS = cmdutils_common_opts.h compat/w32pthreads.h
|
||||
SKIPHEADERS = cmdutils_common_opts.h
|
||||
|
||||
include $(SRC_PATH)/common.mak
|
||||
|
||||
@@ -153,16 +154,25 @@ clean::
|
||||
$(RM) $(ALLPROGS) $(ALLPROGS_G)
|
||||
$(RM) $(CLEANSUFFIXES)
|
||||
$(RM) $(CLEANSUFFIXES:%=tools/%)
|
||||
$(RM) coverage.info
|
||||
$(RM) -r coverage-html
|
||||
$(RM) -rf coverage.info lcov
|
||||
|
||||
distclean::
|
||||
$(RM) $(DISTCLEANSUFFIXES)
|
||||
$(RM) config.* .config libavutil/avconfig.h .version version.h libavcodec/codec_names.h
|
||||
$(RM) config.* .version version.h libavutil/avconfig.h libavcodec/codec_names.h
|
||||
|
||||
config:
|
||||
$(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)
|
||||
|
||||
# Without the sed genthml thinks "libavutil" and "./libavutil" are two different things
|
||||
coverage.info: $(wildcard *.gcda *.gcno */*.gcda */*.gcno */*/*.gcda */*/*.gcno)
|
||||
$(Q)lcov -c -d . -b . | sed -e 's#/./#/#g' > $@
|
||||
|
||||
coverage-html: coverage.info
|
||||
$(Q)mkdir -p $@
|
||||
$(Q)genhtml -o $@ $<
|
||||
$(Q)touch $@
|
||||
|
||||
check: all alltools examples testprogs fate
|
||||
|
||||
include $(SRC_PATH)/doc/Makefile
|
||||
|
||||
449
cmdutils.c
449
cmdutils.c
@@ -36,7 +36,9 @@
|
||||
#include "libavresample/avresample.h"
|
||||
#include "libswscale/swscale.h"
|
||||
#include "libswresample/swresample.h"
|
||||
#if CONFIG_POSTPROC
|
||||
#include "libpostproc/postprocess.h"
|
||||
#endif
|
||||
#include "libavutil/avassert.h"
|
||||
#include "libavutil/avstring.h"
|
||||
#include "libavutil/bprint.h"
|
||||
@@ -47,7 +49,6 @@
|
||||
#include "libavutil/eval.h"
|
||||
#include "libavutil/dict.h"
|
||||
#include "libavutil/opt.h"
|
||||
#include "libavutil/cpu.h"
|
||||
#include "cmdutils.h"
|
||||
#include "version.h"
|
||||
#if CONFIG_NETWORK
|
||||
@@ -57,16 +58,12 @@
|
||||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
#endif
|
||||
#if CONFIG_OPENCL
|
||||
#include "libavutil/opencl.h"
|
||||
#endif
|
||||
|
||||
|
||||
static int init_report(const char *env);
|
||||
|
||||
struct SwsContext *sws_opts;
|
||||
AVDictionary *swr_opts;
|
||||
AVDictionary *format_opts, *codec_opts, *resample_opts;
|
||||
SwrContext *swr_opts;
|
||||
AVDictionary *format_opts, *codec_opts;
|
||||
|
||||
const int this_year = 2013;
|
||||
|
||||
@@ -78,6 +75,9 @@ void init_opts(void)
|
||||
if(CONFIG_SWSCALE)
|
||||
sws_opts = sws_getContext(16, 16, 0, 16, 16, 0, SWS_BICUBIC,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
if(CONFIG_SWRESAMPLE)
|
||||
swr_opts = swr_alloc();
|
||||
}
|
||||
|
||||
void uninit_opts(void)
|
||||
@@ -87,10 +87,11 @@ void uninit_opts(void)
|
||||
sws_opts = NULL;
|
||||
#endif
|
||||
|
||||
av_dict_free(&swr_opts);
|
||||
if(CONFIG_SWRESAMPLE)
|
||||
swr_free(&swr_opts);
|
||||
|
||||
av_dict_free(&format_opts);
|
||||
av_dict_free(&codec_opts);
|
||||
av_dict_free(&resample_opts);
|
||||
}
|
||||
|
||||
void log_callback_help(void *ptr, int level, const char *fmt, va_list vl)
|
||||
@@ -112,21 +113,6 @@ static void log_callback_report(void *ptr, int level, const char *fmt, va_list v
|
||||
fflush(report_file);
|
||||
}
|
||||
|
||||
static void (*program_exit)(int ret);
|
||||
|
||||
void register_exit(void (*cb)(int ret))
|
||||
{
|
||||
program_exit = cb;
|
||||
}
|
||||
|
||||
void exit_program(int ret)
|
||||
{
|
||||
if (program_exit)
|
||||
program_exit(ret);
|
||||
|
||||
exit(ret);
|
||||
}
|
||||
|
||||
double parse_number_or_die(const char *context, const char *numstr, int type,
|
||||
double min, double max)
|
||||
{
|
||||
@@ -144,7 +130,7 @@ double parse_number_or_die(const char *context, const char *numstr, int type,
|
||||
else
|
||||
return d;
|
||||
av_log(NULL, AV_LOG_FATAL, error, context, numstr, min, max);
|
||||
exit_program(1);
|
||||
exit(1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -155,7 +141,7 @@ int64_t parse_time_or_die(const char *context, const char *timestr,
|
||||
if (av_parse_time(&us, timestr, is_duration) < 0) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Invalid %s specification for %s: %s\n",
|
||||
is_duration ? "duration" : "date", context, timestr);
|
||||
exit_program(1);
|
||||
exit(1);
|
||||
}
|
||||
return us;
|
||||
}
|
||||
@@ -214,10 +200,7 @@ static const OptionDef *find_option(const OptionDef *po, const char *name)
|
||||
return po;
|
||||
}
|
||||
|
||||
/* _WIN32 means using the windows libc - cygwin doesn't define that
|
||||
* by default. HAVE_COMMANDLINETOARGVW is true on cygwin, while
|
||||
* it doesn't provide the actual command line via GetCommandLineW(). */
|
||||
#if HAVE_COMMANDLINETOARGVW && defined(_WIN32)
|
||||
#if HAVE_COMMANDLINETOARGVW
|
||||
#include <windows.h>
|
||||
#include <shellapi.h>
|
||||
/* Will be leaked on exit */
|
||||
@@ -301,7 +284,7 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt,
|
||||
if (po->flags & OPT_STRING) {
|
||||
char *str;
|
||||
str = av_strdup(arg);
|
||||
av_freep(dst);
|
||||
// av_freep(dst);
|
||||
*(char **)dst = str;
|
||||
} else if (po->flags & OPT_BOOL || po->flags & OPT_INT) {
|
||||
*(int *)dst = parse_number_or_die(opt, arg, OPT_INT64, INT_MIN, INT_MAX);
|
||||
@@ -317,13 +300,12 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt,
|
||||
int ret = po->u.func_arg(optctx, opt, arg);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR,
|
||||
"Failed to set value '%s' for option '%s': %s\n",
|
||||
arg, opt, av_err2str(ret));
|
||||
"Failed to set value '%s' for option '%s'\n", arg, opt);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
if (po->flags & OPT_EXIT)
|
||||
exit_program(0);
|
||||
exit(0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -383,7 +365,7 @@ void parse_options(void *optctx, int argc, char **argv, const OptionDef *options
|
||||
opt++;
|
||||
|
||||
if ((ret = parse_option(optctx, opt, argv[optindex], options)) < 0)
|
||||
exit_program(1);
|
||||
exit(1);
|
||||
optindex += ret;
|
||||
} else {
|
||||
if (parse_arg_function)
|
||||
@@ -402,16 +384,6 @@ int parse_optgroup(void *optctx, OptionGroup *g)
|
||||
for (i = 0; i < g->nb_opts; i++) {
|
||||
Option *o = &g->opts[i];
|
||||
|
||||
if (g->group_def->flags &&
|
||||
!(g->group_def->flags & o->opt->flags)) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Option %s (%s) cannot be applied to "
|
||||
"%s %s -- you are trying to apply an input option to an "
|
||||
"output file or vice versa. Move this option before the "
|
||||
"file it belongs to.\n", o->key, o->opt->help,
|
||||
g->group_def->name, g->arg);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
av_log(NULL, AV_LOG_DEBUG, "Applying option %s (%s) with argument %s.\n",
|
||||
o->key, o->opt->help, o->val);
|
||||
|
||||
@@ -498,15 +470,6 @@ void parse_loglevel(int argc, char **argv, const OptionDef *options)
|
||||
}
|
||||
}
|
||||
|
||||
static const AVOption *opt_find(void *obj, const char *name, const char *unit,
|
||||
int opt_flags, int search_flags)
|
||||
{
|
||||
const AVOption *o = av_opt_find(obj, name, unit, opt_flags, search_flags);
|
||||
if(o && !o->flags)
|
||||
return NULL;
|
||||
return o;
|
||||
}
|
||||
|
||||
#define FLAGS (o->type == AV_OPT_TYPE_FLAGS) ? AV_DICT_APPEND : 0
|
||||
int opt_default(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
@@ -515,9 +478,6 @@ int opt_default(void *optctx, const char *opt, const char *arg)
|
||||
char opt_stripped[128];
|
||||
const char *p;
|
||||
const AVClass *cc = avcodec_get_class(), *fc = avformat_get_class();
|
||||
#if CONFIG_AVRESAMPLE
|
||||
const AVClass *rc = avresample_get_class();
|
||||
#endif
|
||||
const AVClass *sc, *swr_class;
|
||||
|
||||
if (!strcmp(opt, "debug") || !strcmp(opt, "fdebug"))
|
||||
@@ -527,23 +487,23 @@ int opt_default(void *optctx, const char *opt, const char *arg)
|
||||
p = opt + strlen(opt);
|
||||
av_strlcpy(opt_stripped, opt, FFMIN(sizeof(opt_stripped), p - opt + 1));
|
||||
|
||||
if ((o = opt_find(&cc, opt_stripped, NULL, 0,
|
||||
if ((o = av_opt_find(&cc, opt_stripped, NULL, 0,
|
||||
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)) ||
|
||||
((opt[0] == 'v' || opt[0] == 'a' || opt[0] == 's') &&
|
||||
(o = opt_find(&cc, opt + 1, NULL, 0, AV_OPT_SEARCH_FAKE_OBJ)))) {
|
||||
(o = av_opt_find(&cc, opt + 1, NULL, 0, AV_OPT_SEARCH_FAKE_OBJ)))) {
|
||||
av_dict_set(&codec_opts, opt, arg, FLAGS);
|
||||
consumed = 1;
|
||||
}
|
||||
if ((o = opt_find(&fc, opt, NULL, 0,
|
||||
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {
|
||||
if ((o = av_opt_find(&fc, opt, NULL, 0,
|
||||
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {
|
||||
av_dict_set(&format_opts, opt, arg, FLAGS);
|
||||
if (consumed)
|
||||
av_log(NULL, AV_LOG_VERBOSE, "Routing option %s to both codec and muxer layer\n", opt);
|
||||
if(consumed)
|
||||
av_log(NULL, AV_LOG_VERBOSE, "Routing %s to codec and muxer layer\n", opt);
|
||||
consumed = 1;
|
||||
}
|
||||
#if CONFIG_SWSCALE
|
||||
sc = sws_get_class();
|
||||
if (!consumed && opt_find(&sc, opt, NULL, 0,
|
||||
if (!consumed && av_opt_find(&sc, opt, NULL, 0,
|
||||
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)) {
|
||||
// XXX we only support sws_flags, not arbitrary sws options
|
||||
int ret = av_opt_set(sws_opts, opt, arg, 0);
|
||||
@@ -556,23 +516,13 @@ int opt_default(void *optctx, const char *opt, const char *arg)
|
||||
#endif
|
||||
#if CONFIG_SWRESAMPLE
|
||||
swr_class = swr_get_class();
|
||||
if (!consumed && (o=opt_find(&swr_class, opt, NULL, 0,
|
||||
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {
|
||||
struct SwrContext *swr = swr_alloc();
|
||||
int ret = av_opt_set(swr, opt, arg, 0);
|
||||
swr_free(&swr);
|
||||
if (!consumed && av_opt_find(&swr_class, opt, NULL, 0,
|
||||
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)) {
|
||||
int ret = av_opt_set(swr_opts, opt, arg, 0);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Error setting option %s.\n", opt);
|
||||
return ret;
|
||||
}
|
||||
av_dict_set(&swr_opts, opt, arg, FLAGS);
|
||||
consumed = 1;
|
||||
}
|
||||
#endif
|
||||
#if CONFIG_AVRESAMPLE
|
||||
if ((o=opt_find(&rc, opt, NULL, 0,
|
||||
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {
|
||||
av_dict_set(&resample_opts, opt, arg, FLAGS);
|
||||
consumed = 1;
|
||||
}
|
||||
#endif
|
||||
@@ -625,11 +575,9 @@ static void finish_group(OptionParseContext *octx, int group_idx,
|
||||
g->swr_opts = swr_opts;
|
||||
g->codec_opts = codec_opts;
|
||||
g->format_opts = format_opts;
|
||||
g->resample_opts = resample_opts;
|
||||
|
||||
codec_opts = NULL;
|
||||
format_opts = NULL;
|
||||
resample_opts = NULL;
|
||||
#if CONFIG_SWSCALE
|
||||
sws_opts = NULL;
|
||||
#endif
|
||||
@@ -665,7 +613,7 @@ static void init_parse_context(OptionParseContext *octx,
|
||||
octx->nb_groups = nb_groups;
|
||||
octx->groups = av_mallocz(sizeof(*octx->groups) * octx->nb_groups);
|
||||
if (!octx->groups)
|
||||
exit_program(1);
|
||||
exit(1);
|
||||
|
||||
for (i = 0; i < octx->nb_groups; i++)
|
||||
octx->groups[i].group_def = &groups[i];
|
||||
@@ -687,11 +635,11 @@ void uninit_parse_context(OptionParseContext *octx)
|
||||
av_freep(&l->groups[j].opts);
|
||||
av_dict_free(&l->groups[j].codec_opts);
|
||||
av_dict_free(&l->groups[j].format_opts);
|
||||
av_dict_free(&l->groups[j].resample_opts);
|
||||
#if CONFIG_SWSCALE
|
||||
sws_freeContext(l->groups[j].sws_opts);
|
||||
#endif
|
||||
av_dict_free(&l->groups[j].swr_opts);
|
||||
if(CONFIG_SWRESAMPLE)
|
||||
swr_free(&l->groups[j].swr_opts);
|
||||
}
|
||||
av_freep(&l->groups);
|
||||
}
|
||||
@@ -708,7 +656,6 @@ int split_commandline(OptionParseContext *octx, int argc, char *argv[],
|
||||
const OptionGroupDef *groups, int nb_groups)
|
||||
{
|
||||
int optindex = 1;
|
||||
int dashdash = -2;
|
||||
|
||||
/* perform system-dependent conversions for arguments list */
|
||||
prepare_app_arguments(&argc, &argv);
|
||||
@@ -723,12 +670,8 @@ int split_commandline(OptionParseContext *octx, int argc, char *argv[],
|
||||
|
||||
av_log(NULL, AV_LOG_DEBUG, "Reading option '%s' ...", opt);
|
||||
|
||||
if (opt[0] == '-' && opt[1] == '-' && !opt[2]) {
|
||||
dashdash = optindex;
|
||||
continue;
|
||||
}
|
||||
/* unnamed group separators, e.g. output filename */
|
||||
if (opt[0] != '-' || !opt[1] || dashdash+1 == optindex) {
|
||||
if (opt[0] != '-' || !opt[1]) {
|
||||
finish_group(octx, 0, opt);
|
||||
av_log(NULL, AV_LOG_DEBUG, " matched as %s.\n", groups[0].name);
|
||||
continue;
|
||||
@@ -800,7 +743,7 @@ do { \
|
||||
return AVERROR_OPTION_NOT_FOUND;
|
||||
}
|
||||
|
||||
if (octx->cur_group.nb_opts || codec_opts || format_opts || resample_opts)
|
||||
if (octx->cur_group.nb_opts || codec_opts || format_opts)
|
||||
av_log(NULL, AV_LOG_WARNING, "Trailing options were found on the "
|
||||
"commandline.\n");
|
||||
|
||||
@@ -809,18 +752,6 @@ do { \
|
||||
return 0;
|
||||
}
|
||||
|
||||
int opt_cpuflags(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
int ret;
|
||||
unsigned flags = av_get_cpu_flags();
|
||||
|
||||
if ((ret = av_parse_cpu_caps(&flags, arg)) < 0)
|
||||
return ret;
|
||||
|
||||
av_force_cpu_flags(flags);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int opt_loglevel(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
const struct { const char *name; int level; } log_levels[] = {
|
||||
@@ -837,13 +768,6 @@ int opt_loglevel(void *optctx, const char *opt, const char *arg)
|
||||
int level;
|
||||
int i;
|
||||
|
||||
tail = strstr(arg, "repeat");
|
||||
av_log_set_flags(tail ? 0 : AV_LOG_SKIP_REPEATED);
|
||||
if (tail == arg)
|
||||
arg += 6 + (arg[6]=='+');
|
||||
if(tail && !*arg)
|
||||
return 0;
|
||||
|
||||
for (i = 0; i < FF_ARRAY_ELEMS(log_levels); i++) {
|
||||
if (!strcmp(log_levels[i].name, arg)) {
|
||||
av_log_set_level(log_levels[i].level);
|
||||
@@ -857,7 +781,7 @@ int opt_loglevel(void *optctx, const char *opt, const char *arg)
|
||||
"Possible levels are numbers or:\n", arg);
|
||||
for (i = 0; i < FF_ARRAY_ELEMS(log_levels); i++)
|
||||
av_log(NULL, AV_LOG_FATAL, "\"%s\"\n", log_levels[i].name);
|
||||
exit_program(1);
|
||||
exit(1);
|
||||
}
|
||||
av_log_set_level(level);
|
||||
return 0;
|
||||
@@ -950,6 +874,7 @@ static int init_report(const char *env)
|
||||
tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
|
||||
tm->tm_hour, tm->tm_min, tm->tm_sec,
|
||||
filename.str);
|
||||
av_log_set_level(FFMAX(av_log_get_level(), AV_LOG_VERBOSE));
|
||||
av_bprint_finalize(&filename, NULL);
|
||||
return 0;
|
||||
}
|
||||
@@ -967,12 +892,24 @@ int opt_max_alloc(void *optctx, const char *opt, const char *arg)
|
||||
max = strtol(arg, &tail, 10);
|
||||
if (*tail) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Invalid max_alloc \"%s\".\n", arg);
|
||||
exit_program(1);
|
||||
exit(1);
|
||||
}
|
||||
av_max_alloc(max);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int opt_cpuflags(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
int ret;
|
||||
unsigned flags = av_get_cpu_flags();
|
||||
|
||||
if ((ret = av_parse_cpu_caps(&flags, arg)) < 0)
|
||||
return ret;
|
||||
|
||||
av_force_cpu_flags(flags);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int opt_timelimit(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
#if HAVE_SETRLIMIT
|
||||
@@ -986,26 +923,6 @@ int opt_timelimit(void *optctx, const char *opt, const char *arg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if CONFIG_OPENCL
|
||||
int opt_opencl(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
char *key, *value;
|
||||
const char *opts = arg;
|
||||
int ret = 0;
|
||||
while (*opts) {
|
||||
ret = av_opt_get_key_value(&opts, "=", ":", 0, &key, &value);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
ret = av_opencl_set_option(key, value);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
if (*opts)
|
||||
opts++;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
void print_error(const char *filename, int err)
|
||||
{
|
||||
char errbuf[128];
|
||||
@@ -1058,10 +975,12 @@ static void print_all_libs_info(int flags, int level)
|
||||
PRINT_LIB_INFO(avformat, AVFORMAT, flags, level);
|
||||
PRINT_LIB_INFO(avdevice, AVDEVICE, flags, level);
|
||||
PRINT_LIB_INFO(avfilter, AVFILTER, flags, level);
|
||||
PRINT_LIB_INFO(avresample, AVRESAMPLE, flags, level);
|
||||
// PRINT_LIB_INFO(avresample, AVRESAMPLE, flags, level);
|
||||
PRINT_LIB_INFO(swscale, SWSCALE, flags, level);
|
||||
PRINT_LIB_INFO(swresample,SWRESAMPLE, flags, level);
|
||||
#if CONFIG_POSTPROC
|
||||
PRINT_LIB_INFO(postproc, POSTPROC, flags, level);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void print_program_info(int flags, int level)
|
||||
@@ -1241,8 +1160,7 @@ static void print_codec(const AVCodec *c)
|
||||
printf("%s %s [%s]:\n", encoder ? "Encoder" : "Decoder", c->name,
|
||||
c->long_name ? c->long_name : "");
|
||||
|
||||
if (c->type == AVMEDIA_TYPE_VIDEO ||
|
||||
c->type == AVMEDIA_TYPE_AUDIO) {
|
||||
if (c->type == AVMEDIA_TYPE_VIDEO) {
|
||||
printf(" Threading capabilities: ");
|
||||
switch (c->capabilities & (CODEC_CAP_FRAME_THREADS |
|
||||
CODEC_CAP_SLICE_THREADS)) {
|
||||
@@ -1323,7 +1241,7 @@ static unsigned get_codecs_sorted(const AVCodecDescriptor ***rcodecs)
|
||||
nb_codecs++;
|
||||
if (!(codecs = av_calloc(nb_codecs, sizeof(*codecs)))) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Out of memory\n");
|
||||
exit_program(1);
|
||||
exit(1);
|
||||
}
|
||||
desc = NULL;
|
||||
while ((desc = avcodec_descriptor_next(desc)))
|
||||
@@ -1476,60 +1394,36 @@ int show_protocols(void *optctx, const char *opt, const char *arg)
|
||||
|
||||
int show_filters(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
const AVFilter av_unused(*filter) = NULL;
|
||||
AVFilter av_unused(**filter) = NULL;
|
||||
char descr[64], *descr_cur;
|
||||
int i, j;
|
||||
const AVFilterPad *pad;
|
||||
|
||||
printf("Filters:\n"
|
||||
" T.. = Timeline support\n"
|
||||
" .S. = Slice threading\n"
|
||||
" ..C = Commmand support\n"
|
||||
" A = Audio input/output\n"
|
||||
" V = Video input/output\n"
|
||||
" N = Dynamic number and/or type of input/output\n"
|
||||
" | = Source or sink filter\n");
|
||||
printf("Filters:\n");
|
||||
#if CONFIG_AVFILTER
|
||||
while ((filter = avfilter_next(filter))) {
|
||||
while ((filter = av_filter_next(filter)) && *filter) {
|
||||
descr_cur = descr;
|
||||
for (i = 0; i < 2; i++) {
|
||||
if (i) {
|
||||
*(descr_cur++) = '-';
|
||||
*(descr_cur++) = '>';
|
||||
}
|
||||
pad = i ? filter->outputs : filter->inputs;
|
||||
pad = i ? (*filter)->outputs : (*filter)->inputs;
|
||||
for (j = 0; pad && pad[j].name; j++) {
|
||||
if (descr_cur >= descr + sizeof(descr) - 4)
|
||||
break;
|
||||
*(descr_cur++) = get_media_type_char(pad[j].type);
|
||||
}
|
||||
if (!j)
|
||||
*(descr_cur++) = ((!i && (filter->flags & AVFILTER_FLAG_DYNAMIC_INPUTS)) ||
|
||||
( i && (filter->flags & AVFILTER_FLAG_DYNAMIC_OUTPUTS))) ? 'N' : '|';
|
||||
*(descr_cur++) = '|';
|
||||
}
|
||||
*descr_cur = 0;
|
||||
printf(" %c%c%c %-16s %-10s %s\n",
|
||||
filter->flags & AVFILTER_FLAG_SUPPORT_TIMELINE ? 'T' : '.',
|
||||
filter->flags & AVFILTER_FLAG_SLICE_THREADS ? 'S' : '.',
|
||||
filter->process_command ? 'C' : '.',
|
||||
filter->name, descr, filter->description);
|
||||
printf("%-16s %-10s %s\n", (*filter)->name, descr, (*filter)->description);
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
void show_colors(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
const char *name;
|
||||
const uint8_t *rgb;
|
||||
int i;
|
||||
|
||||
printf("%-32s #RRGGBB\n", "name");
|
||||
|
||||
for (i = 0; name = av_get_known_color_name(i, &rgb); i++)
|
||||
printf("%-32s #%02x%02x%02x\n", name, rgb[0], rgb[1], rgb[2]);
|
||||
}
|
||||
|
||||
int show_pix_fmts(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
const AVPixFmtDescriptor *pix_desc = NULL;
|
||||
@@ -1551,11 +1445,11 @@ int show_pix_fmts(void *optctx, const char *opt, const char *arg)
|
||||
while ((pix_desc = av_pix_fmt_desc_next(pix_desc))) {
|
||||
enum AVPixelFormat pix_fmt = av_pix_fmt_desc_get_id(pix_desc);
|
||||
printf("%c%c%c%c%c %-16s %d %2d\n",
|
||||
sws_isSupportedInput (pix_fmt) ? 'I' : '.',
|
||||
sws_isSupportedOutput(pix_fmt) ? 'O' : '.',
|
||||
pix_desc->flags & AV_PIX_FMT_FLAG_HWACCEL ? 'H' : '.',
|
||||
pix_desc->flags & AV_PIX_FMT_FLAG_PAL ? 'P' : '.',
|
||||
pix_desc->flags & AV_PIX_FMT_FLAG_BITSTREAM ? 'B' : '.',
|
||||
sws_isSupportedInput (pix_fmt) ? 'I' : '.',
|
||||
sws_isSupportedOutput(pix_fmt) ? 'O' : '.',
|
||||
pix_desc->flags & PIX_FMT_HWACCEL ? 'H' : '.',
|
||||
pix_desc->flags & PIX_FMT_PAL ? 'P' : '.',
|
||||
pix_desc->flags & PIX_FMT_BITSTREAM ? 'B' : '.',
|
||||
pix_desc->name,
|
||||
pix_desc->nb_components,
|
||||
av_get_bits_per_pixel(pix_desc));
|
||||
@@ -1687,62 +1581,6 @@ static void show_help_muxer(const char *name)
|
||||
show_help_children(fmt->priv_class, AV_OPT_FLAG_ENCODING_PARAM);
|
||||
}
|
||||
|
||||
#if CONFIG_AVFILTER
|
||||
static void show_help_filter(const char *name)
|
||||
{
|
||||
#if CONFIG_AVFILTER
|
||||
const AVFilter *f = avfilter_get_by_name(name);
|
||||
int i, count;
|
||||
|
||||
if (!name) {
|
||||
av_log(NULL, AV_LOG_ERROR, "No filter name specified.\n");
|
||||
return;
|
||||
} else if (!f) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Unknown filter '%s'.\n", name);
|
||||
return;
|
||||
}
|
||||
|
||||
printf("Filter %s\n", f->name);
|
||||
if (f->description)
|
||||
printf(" %s\n", f->description);
|
||||
|
||||
if (f->flags & AVFILTER_FLAG_SLICE_THREADS)
|
||||
printf(" slice threading supported\n");
|
||||
|
||||
printf(" Inputs:\n");
|
||||
count = avfilter_pad_count(f->inputs);
|
||||
for (i = 0; i < count; i++) {
|
||||
printf(" #%d: %s (%s)\n", i, avfilter_pad_get_name(f->inputs, i),
|
||||
media_type_string(avfilter_pad_get_type(f->inputs, i)));
|
||||
}
|
||||
if (f->flags & AVFILTER_FLAG_DYNAMIC_INPUTS)
|
||||
printf(" dynamic (depending on the options)\n");
|
||||
else if (!count)
|
||||
printf(" none (source filter)\n");
|
||||
|
||||
printf(" Outputs:\n");
|
||||
count = avfilter_pad_count(f->outputs);
|
||||
for (i = 0; i < count; i++) {
|
||||
printf(" #%d: %s (%s)\n", i, avfilter_pad_get_name(f->outputs, i),
|
||||
media_type_string(avfilter_pad_get_type(f->outputs, i)));
|
||||
}
|
||||
if (f->flags & AVFILTER_FLAG_DYNAMIC_OUTPUTS)
|
||||
printf(" dynamic (depending on the options)\n");
|
||||
else if (!count)
|
||||
printf(" none (sink filter)\n");
|
||||
|
||||
if (f->priv_class)
|
||||
show_help_children(f->priv_class, AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM |
|
||||
AV_OPT_FLAG_AUDIO_PARAM);
|
||||
if (f->flags & AVFILTER_FLAG_SUPPORT_TIMELINE)
|
||||
printf("This filter has support for timeline through the 'enable' option.\n");
|
||||
#else
|
||||
av_log(NULL, AV_LOG_ERROR, "Build without libavfilter; "
|
||||
"can not to satisfy request\n");
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
int show_help(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
char *topic, *par;
|
||||
@@ -1763,10 +1601,6 @@ int show_help(void *optctx, const char *opt, const char *arg)
|
||||
show_help_demuxer(par);
|
||||
} else if (!strcmp(topic, "muxer")) {
|
||||
show_help_muxer(par);
|
||||
#if CONFIG_AVFILTER
|
||||
} else if (!strcmp(topic, "filter")) {
|
||||
show_help_filter(par);
|
||||
#endif
|
||||
} else {
|
||||
show_help_default(topic, par);
|
||||
}
|
||||
@@ -1778,7 +1612,7 @@ int show_help(void *optctx, const char *opt, const char *arg)
|
||||
int read_yesno(void)
|
||||
{
|
||||
int c = getchar();
|
||||
int yesno = (av_toupper(c) == 'Y');
|
||||
int yesno = (toupper(c) == 'Y');
|
||||
|
||||
while (c != '\n' && c != EOF)
|
||||
c = getchar();
|
||||
@@ -1899,8 +1733,10 @@ AVDictionary *filter_codec_opts(AVDictionary *opts, enum AVCodecID codec_id,
|
||||
if (!codec)
|
||||
codec = s->oformat ? avcodec_find_encoder(codec_id)
|
||||
: avcodec_find_decoder(codec_id);
|
||||
if (!codec)
|
||||
return NULL;
|
||||
|
||||
switch (st->codec->codec_type) {
|
||||
switch (codec->type) {
|
||||
case AVMEDIA_TYPE_VIDEO:
|
||||
prefix = 'v';
|
||||
flags |= AV_OPT_FLAG_VIDEO_PARAM;
|
||||
@@ -1966,13 +1802,13 @@ void *grow_array(void *array, int elem_size, int *size, int new_size)
|
||||
{
|
||||
if (new_size >= INT_MAX / elem_size) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Array too big.\n");
|
||||
exit_program(1);
|
||||
exit(1);
|
||||
}
|
||||
if (*size < new_size) {
|
||||
uint8_t *tmp = av_realloc(array, new_size*elem_size);
|
||||
if (!tmp) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Could not alloc buffer.\n");
|
||||
exit_program(1);
|
||||
exit(1);
|
||||
}
|
||||
memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
|
||||
*size = new_size;
|
||||
@@ -1980,3 +1816,150 @@ void *grow_array(void *array, int elem_size, int *size, int new_size)
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
static int alloc_buffer(FrameBuffer **pool, AVCodecContext *s, FrameBuffer **pbuf)
|
||||
{
|
||||
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->pix_fmt);
|
||||
FrameBuffer *buf;
|
||||
int i, ret;
|
||||
int pixel_size;
|
||||
int h_chroma_shift, v_chroma_shift;
|
||||
int edge = 32; // XXX should be avcodec_get_edge_width(), but that fails on svq1
|
||||
int w = s->width, h = s->height;
|
||||
|
||||
if (!desc)
|
||||
return AVERROR(EINVAL);
|
||||
pixel_size = desc->comp[0].step_minus1 + 1;
|
||||
|
||||
buf = av_mallocz(sizeof(*buf));
|
||||
if (!buf)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
avcodec_align_dimensions(s, &w, &h);
|
||||
|
||||
if (!(s->flags & CODEC_FLAG_EMU_EDGE)) {
|
||||
w += 2*edge;
|
||||
h += 2*edge;
|
||||
}
|
||||
|
||||
if ((ret = av_image_alloc(buf->base, buf->linesize, w, h,
|
||||
s->pix_fmt, 32)) < 0) {
|
||||
av_freep(&buf);
|
||||
av_log(s, AV_LOG_ERROR, "alloc_buffer: av_image_alloc() failed\n");
|
||||
return ret;
|
||||
}
|
||||
/* XXX this shouldn't be needed, but some tests break without this line
|
||||
* those decoders are buggy and need to be fixed.
|
||||
* the following tests fail:
|
||||
* cdgraphics, ansi
|
||||
*/
|
||||
memset(buf->base[0], 128, ret);
|
||||
|
||||
avcodec_get_chroma_sub_sample(s->pix_fmt, &h_chroma_shift, &v_chroma_shift);
|
||||
for (i = 0; i < FF_ARRAY_ELEMS(buf->data); i++) {
|
||||
const int h_shift = i==0 ? 0 : h_chroma_shift;
|
||||
const int v_shift = i==0 ? 0 : v_chroma_shift;
|
||||
if ((s->flags & CODEC_FLAG_EMU_EDGE) || !buf->linesize[i] || !buf->base[i])
|
||||
buf->data[i] = buf->base[i];
|
||||
else
|
||||
buf->data[i] = buf->base[i] +
|
||||
FFALIGN((buf->linesize[i]*edge >> v_shift) +
|
||||
(pixel_size*edge >> h_shift), 32);
|
||||
}
|
||||
buf->w = s->width;
|
||||
buf->h = s->height;
|
||||
buf->pix_fmt = s->pix_fmt;
|
||||
buf->pool = pool;
|
||||
|
||||
*pbuf = buf;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int codec_get_buffer(AVCodecContext *s, AVFrame *frame)
|
||||
{
|
||||
FrameBuffer **pool = s->opaque;
|
||||
FrameBuffer *buf;
|
||||
int ret, i;
|
||||
|
||||
if(av_image_check_size(s->width, s->height, 0, s) || s->pix_fmt<0) {
|
||||
av_log(s, AV_LOG_ERROR, "codec_get_buffer: image parameters invalid\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!*pool && (ret = alloc_buffer(pool, s, pool)) < 0)
|
||||
return ret;
|
||||
|
||||
buf = *pool;
|
||||
*pool = buf->next;
|
||||
buf->next = NULL;
|
||||
if (buf->w != s->width || buf->h != s->height || buf->pix_fmt != s->pix_fmt) {
|
||||
av_freep(&buf->base[0]);
|
||||
av_free(buf);
|
||||
if ((ret = alloc_buffer(pool, s, &buf)) < 0)
|
||||
return ret;
|
||||
}
|
||||
av_assert0(!buf->refcount);
|
||||
buf->refcount++;
|
||||
|
||||
frame->opaque = buf;
|
||||
frame->type = FF_BUFFER_TYPE_USER;
|
||||
frame->extended_data = frame->data;
|
||||
|
||||
for (i = 0; i < FF_ARRAY_ELEMS(buf->data); i++) {
|
||||
frame->base[i] = buf->base[i]; // XXX h264.c uses base though it shouldn't
|
||||
frame->data[i] = buf->data[i];
|
||||
frame->linesize[i] = buf->linesize[i];
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void unref_buffer(FrameBuffer *buf)
|
||||
{
|
||||
FrameBuffer **pool = buf->pool;
|
||||
|
||||
av_assert0(buf->refcount > 0);
|
||||
buf->refcount--;
|
||||
if (!buf->refcount) {
|
||||
FrameBuffer *tmp;
|
||||
for(tmp= *pool; tmp; tmp= tmp->next)
|
||||
av_assert1(tmp != buf);
|
||||
|
||||
buf->next = *pool;
|
||||
*pool = buf;
|
||||
}
|
||||
}
|
||||
|
||||
void codec_release_buffer(AVCodecContext *s, AVFrame *frame)
|
||||
{
|
||||
FrameBuffer *buf = frame->opaque;
|
||||
int i;
|
||||
|
||||
if(frame->type!=FF_BUFFER_TYPE_USER) {
|
||||
avcodec_default_release_buffer(s, frame);
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < FF_ARRAY_ELEMS(frame->data); i++)
|
||||
frame->data[i] = NULL;
|
||||
|
||||
unref_buffer(buf);
|
||||
}
|
||||
|
||||
void filter_release_buffer(AVFilterBuffer *fb)
|
||||
{
|
||||
FrameBuffer *buf = fb->priv;
|
||||
av_free(fb);
|
||||
unref_buffer(buf);
|
||||
}
|
||||
|
||||
void free_buffer_pool(FrameBuffer **pool)
|
||||
{
|
||||
FrameBuffer *buf = *pool;
|
||||
while (buf) {
|
||||
*pool = buf->next;
|
||||
av_freep(&buf->base[0]);
|
||||
av_free(buf);
|
||||
buf = *pool;
|
||||
}
|
||||
}
|
||||
|
||||
88
cmdutils.h
88
cmdutils.h
@@ -51,18 +51,8 @@ extern const int this_year;
|
||||
extern AVCodecContext *avcodec_opts[AVMEDIA_TYPE_NB];
|
||||
extern AVFormatContext *avformat_opts;
|
||||
extern struct SwsContext *sws_opts;
|
||||
extern AVDictionary *swr_opts;
|
||||
extern AVDictionary *format_opts, *codec_opts, *resample_opts;
|
||||
|
||||
/**
|
||||
* Register a program-specific cleanup routine.
|
||||
*/
|
||||
void register_exit(void (*cb)(int ret));
|
||||
|
||||
/**
|
||||
* Wraps exit with a program-specific cleanup routine.
|
||||
*/
|
||||
void exit_program(int ret);
|
||||
extern struct SwrContext *swr_opts;
|
||||
extern AVDictionary *format_opts, *codec_opts;
|
||||
|
||||
/**
|
||||
* Initialize the cmdutils option system, in particular
|
||||
@@ -81,11 +71,6 @@ void uninit_opts(void);
|
||||
*/
|
||||
void log_callback_help(void* ptr, int level, const char* fmt, va_list vl);
|
||||
|
||||
/**
|
||||
* Override the cpuflags.
|
||||
*/
|
||||
int opt_cpuflags(void *optctx, const char *opt, const char *arg);
|
||||
|
||||
/**
|
||||
* Fallback for options that are not explicitly handled, these will be
|
||||
* parsed through AVOptions.
|
||||
@@ -101,9 +86,9 @@ int opt_report(const char *opt);
|
||||
|
||||
int opt_max_alloc(void *optctx, const char *opt, const char *arg);
|
||||
|
||||
int opt_codec_debug(void *optctx, const char *opt, const char *arg);
|
||||
int opt_cpuflags(void *optctx, const char *opt, const char *arg);
|
||||
|
||||
int opt_opencl(void *optctx, const char *opt, const char *arg);
|
||||
int opt_codec_debug(void *optctx, const char *opt, const char *arg);
|
||||
|
||||
/**
|
||||
* Limit the execution time.
|
||||
@@ -138,7 +123,7 @@ double parse_number_or_die(const char *context, const char *numstr, int type,
|
||||
* not zero timestr is interpreted as a duration, otherwise as a
|
||||
* date
|
||||
*
|
||||
* @see av_parse_time()
|
||||
* @see parse_date()
|
||||
*/
|
||||
int64_t parse_time_or_die(const char *context, const char *timestr,
|
||||
int is_duration);
|
||||
@@ -177,8 +162,6 @@ typedef struct OptionDef {
|
||||
an int containing element count in the array. */
|
||||
#define OPT_TIME 0x10000
|
||||
#define OPT_DOUBLE 0x20000
|
||||
#define OPT_INPUT 0x40000
|
||||
#define OPT_OUTPUT 0x80000
|
||||
union {
|
||||
void *dst_ptr;
|
||||
int (*func_arg)(void *, const char *, const char *);
|
||||
@@ -259,11 +242,6 @@ typedef struct OptionGroupDef {
|
||||
* are terminated by a non-option argument (e.g. ffmpeg output files)
|
||||
*/
|
||||
const char *sep;
|
||||
/**
|
||||
* Option flags that must be set on each option that is
|
||||
* applied to this group
|
||||
*/
|
||||
int flags;
|
||||
} OptionGroupDef;
|
||||
|
||||
typedef struct OptionGroup {
|
||||
@@ -275,9 +253,8 @@ typedef struct OptionGroup {
|
||||
|
||||
AVDictionary *codec_opts;
|
||||
AVDictionary *format_opts;
|
||||
AVDictionary *resample_opts;
|
||||
struct SwsContext *sws_opts;
|
||||
AVDictionary *swr_opts;
|
||||
struct SwrContext *swr_opts;
|
||||
} OptionGroup;
|
||||
|
||||
/**
|
||||
@@ -488,12 +465,6 @@ int show_layouts(void *optctx, const char *opt, const char *arg);
|
||||
*/
|
||||
int show_sample_fmts(void *optctx, const char *opt, const char *arg);
|
||||
|
||||
/**
|
||||
* Print a listing containing all the color names and values recognized
|
||||
* by the program.
|
||||
*/
|
||||
void show_colors(void *optctx, const char *opt, const char *arg);
|
||||
|
||||
/**
|
||||
* Return a positive value if a line read from standard input
|
||||
* starts with [yY], otherwise return 0.
|
||||
@@ -507,7 +478,7 @@ int read_yesno(void);
|
||||
* @param filename file to read from
|
||||
* @param bufptr location where pointer to buffer is returned
|
||||
* @param size location where size of buffer is returned
|
||||
* @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.
|
||||
*/
|
||||
int cmdutils_read_file(const char *filename, char **bufptr, size_t *size);
|
||||
@@ -545,11 +516,52 @@ FILE *get_preset_file(char *filename, size_t filename_size,
|
||||
*/
|
||||
void *grow_array(void *array, int elem_size, int *size, int new_size);
|
||||
|
||||
#define media_type_string av_get_media_type_string
|
||||
|
||||
#define GROW_ARRAY(array, nb_elems)\
|
||||
array = grow_array(array, sizeof(*array), &nb_elems, nb_elems + 1)
|
||||
|
||||
typedef struct FrameBuffer {
|
||||
uint8_t *base[4];
|
||||
uint8_t *data[4];
|
||||
int linesize[4];
|
||||
|
||||
int h, w;
|
||||
enum AVPixelFormat pix_fmt;
|
||||
|
||||
int refcount;
|
||||
struct FrameBuffer **pool; ///< head of the buffer pool
|
||||
struct FrameBuffer *next;
|
||||
} FrameBuffer;
|
||||
|
||||
/**
|
||||
* Get a frame from the pool. This is intended to be used as a callback for
|
||||
* AVCodecContext.get_buffer.
|
||||
*
|
||||
* @param s codec context. s->opaque must be a pointer to the head of the
|
||||
* buffer pool.
|
||||
* @param frame frame->opaque will be set to point to the FrameBuffer
|
||||
* containing the frame data.
|
||||
*/
|
||||
int codec_get_buffer(AVCodecContext *s, AVFrame *frame);
|
||||
|
||||
/**
|
||||
* A callback to be used for AVCodecContext.release_buffer along with
|
||||
* codec_get_buffer().
|
||||
*/
|
||||
void codec_release_buffer(AVCodecContext *s, AVFrame *frame);
|
||||
|
||||
/**
|
||||
* A callback to be used for AVFilterBuffer.free.
|
||||
* @param fb buffer to free. fb->priv must be a pointer to the FrameBuffer
|
||||
* containing the buffer data.
|
||||
*/
|
||||
void filter_release_buffer(AVFilterBuffer *fb);
|
||||
|
||||
/**
|
||||
* Free all the buffers in the pool. This must be called after all the
|
||||
* buffers have been released.
|
||||
*/
|
||||
void free_buffer_pool(FrameBuffer **pool);
|
||||
|
||||
#define GET_PIX_FMT_NAME(pix_fmt)\
|
||||
const char *name = av_get_pix_fmt_name(pix_fmt);
|
||||
|
||||
|
||||
@@ -14,12 +14,8 @@
|
||||
{ "pix_fmts" , OPT_EXIT, {.func_arg = show_pix_fmts }, "show available pixel formats" },
|
||||
{ "layouts" , OPT_EXIT, {.func_arg = show_layouts }, "show standard channel layouts" },
|
||||
{ "sample_fmts", OPT_EXIT, {.func_arg = show_sample_fmts }, "show available audio sample formats" },
|
||||
{ "colors" , OPT_EXIT, {.func_arg = show_colors }, "show available color names" },
|
||||
{ "loglevel" , HAS_ARG, {.func_arg = opt_loglevel}, "set logging level", "loglevel" },
|
||||
{ "v", HAS_ARG, {.func_arg = opt_loglevel}, "set logging level", "loglevel" },
|
||||
{ "loglevel" , HAS_ARG, {.func_arg = opt_loglevel}, "set libav* logging level", "loglevel" },
|
||||
{ "v", HAS_ARG, {.func_arg = opt_loglevel}, "set libav* logging level", "loglevel" },
|
||||
{ "report" , 0, {(void*)opt_report}, "generate a report" },
|
||||
{ "max_alloc" , HAS_ARG, {.func_arg = opt_max_alloc}, "set maximum size of a single allocated block", "bytes" },
|
||||
{ "cpuflags" , HAS_ARG | OPT_EXPERT, { .func_arg = opt_cpuflags }, "force specific cpu flags", "flags" },
|
||||
#if CONFIG_OPENCL
|
||||
{ "opencl_options", HAS_ARG, {.func_arg = opt_opencl}, "set OpenCL environment options" },
|
||||
#endif
|
||||
{ "cpuflags" , HAS_ARG | OPT_EXPERT, {.func_arg = opt_cpuflags}, "force specific cpu flags", "flags" },
|
||||
|
||||
10
common.mak
10
common.mak
@@ -32,7 +32,7 @@ ASFLAGS := $(CPPFLAGS) $(ASFLAGS)
|
||||
CXXFLAGS += $(CPPFLAGS) $(CFLAGS)
|
||||
YASMFLAGS += $(IFLAGS:%=%/) -Pconfig.asm
|
||||
|
||||
HOSTCCFLAGS = $(IFLAGS) $(HOSTCPPFLAGS) $(HOSTCFLAGS)
|
||||
HOSTCCFLAGS = $(IFLAGS) $(HOSTCFLAGS)
|
||||
LDFLAGS := $(ALLFFLIBS:%=$(LD_PATH)lib%) $(LDFLAGS)
|
||||
|
||||
define COMPILE
|
||||
@@ -99,10 +99,8 @@ TOOLOBJS := $(TOOLS:%=tools/%.o)
|
||||
TOOLS := $(TOOLS:%=tools/%$(EXESUF))
|
||||
HEADERS += $(HEADERS-yes)
|
||||
|
||||
PATH_LIBNAME = $(foreach NAME,$(1),lib$(NAME)/$($(CONFIG_SHARED:yes=S)LIBNAME))
|
||||
DEP_LIBS := $(foreach lib,$(FFLIBS),$(call PATH_LIBNAME,$(lib)))
|
||||
DEP_LIBS := $(foreach NAME,$(FFLIBS),lib$(NAME)/$($(CONFIG_SHARED:yes=S)LIBNAME))
|
||||
|
||||
SRC_DIR := $(SRC_PATH)/lib$(NAME)
|
||||
ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h))
|
||||
SKIPHEADERS += $(ARCH_HEADERS:%=$(ARCH)/%) $(SKIPHEADERS-)
|
||||
SKIPHEADERS := $(SKIPHEADERS:%=$(SUBDIR)%)
|
||||
@@ -119,12 +117,12 @@ $(HOSTPROGS): %$(HOSTEXESUF): %.o
|
||||
$(HOSTLD) $(HOSTLDFLAGS) $(HOSTLD_O) $< $(HOSTLIBS)
|
||||
|
||||
$(OBJS): | $(sort $(dir $(OBJS)))
|
||||
$(HOBJS): | $(sort $(dir $(HOBJS)))
|
||||
$(HOSTOBJS): | $(sort $(dir $(HOSTOBJS)))
|
||||
$(TESTOBJS): | $(sort $(dir $(TESTOBJS)))
|
||||
$(HOBJS): | $(sort $(dir $(HOBJS)))
|
||||
$(TOOLOBJS): | tools
|
||||
|
||||
OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(TESTOBJS))
|
||||
OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOSTOBJS) $(TESTOBJS) $(HOBJS))
|
||||
|
||||
CLEANSUFFIXES = *.d *.o *~ *.h.c *.map *.ver *.ho *.gcno *.gcda
|
||||
DISTCLEANSUFFIXES = *.pc
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
/*
|
||||
* Work around the class() function in AIX math.h clashing with
|
||||
* identifiers named "class".
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* 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.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef FFMPEG_COMPAT_AIX_MATH_H
|
||||
#define FFMPEG_COMPAT_AIX_MATH_H
|
||||
|
||||
#define class class_in_math_h_causes_problems
|
||||
|
||||
#include_next <math.h>
|
||||
|
||||
#undef class
|
||||
|
||||
#endif /* FFMPEG_COMPAT_AIX_MATH_H */
|
||||
@@ -1,879 +0,0 @@
|
||||
// Avisynth C Interface Version 0.20
|
||||
// Copyright 2003 Kevin Atkinson
|
||||
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit
|
||||
// http://www.gnu.org/copyleft/gpl.html .
|
||||
//
|
||||
// As a special exception, I give you permission to link to the
|
||||
// Avisynth C interface with independent modules that communicate with
|
||||
// the Avisynth C interface solely through the interfaces defined in
|
||||
// avisynth_c.h, regardless of the license terms of these independent
|
||||
// modules, and to copy and distribute the resulting combined work
|
||||
// under terms of your choice, provided that every copy of the
|
||||
// combined work is accompanied by a complete copy of the source code
|
||||
// of the Avisynth C interface and Avisynth itself (with the version
|
||||
// used to produce the combined work), being distributed under the
|
||||
// terms of the GNU General Public License plus this exception. An
|
||||
// independent module is a module which is not derived from or based
|
||||
// on Avisynth C Interface, such as 3rd-party filters, import and
|
||||
// export plugins, or graphical user interfaces.
|
||||
|
||||
// NOTE: this is a partial update of the Avisynth C interface to recognize
|
||||
// new color spaces added in Avisynth 2.60. By no means is this document
|
||||
// completely Avisynth 2.60 compliant.
|
||||
|
||||
#ifndef __AVISYNTH_C__
|
||||
#define __AVISYNTH_C__
|
||||
|
||||
#ifdef __cplusplus
|
||||
# define EXTERN_C extern "C"
|
||||
#else
|
||||
# define EXTERN_C
|
||||
#endif
|
||||
|
||||
#define AVSC_USE_STDCALL 1
|
||||
|
||||
#ifndef AVSC_USE_STDCALL
|
||||
# define AVSC_CC __cdecl
|
||||
#else
|
||||
# define AVSC_CC __stdcall
|
||||
#endif
|
||||
|
||||
#define AVSC_INLINE static __inline
|
||||
|
||||
#ifdef AVISYNTH_C_EXPORTS
|
||||
# define AVSC_EXPORT EXTERN_C
|
||||
# define AVSC_API(ret, name) EXTERN_C __declspec(dllexport) ret AVSC_CC name
|
||||
#else
|
||||
# define AVSC_EXPORT EXTERN_C __declspec(dllexport)
|
||||
# ifndef AVSC_NO_DECLSPEC
|
||||
# define AVSC_API(ret, name) EXTERN_C __declspec(dllimport) ret AVSC_CC name
|
||||
# else
|
||||
# define AVSC_API(ret, name) typedef ret (AVSC_CC *name##_func)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
typedef unsigned char BYTE;
|
||||
#ifdef __GNUC__
|
||||
typedef long long int INT64;
|
||||
#else
|
||||
typedef __int64 INT64;
|
||||
#endif
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Constants
|
||||
//
|
||||
|
||||
#ifndef __AVISYNTH_H__
|
||||
enum { AVISYNTH_INTERFACE_VERSION = 4 };
|
||||
#endif
|
||||
|
||||
enum {AVS_SAMPLE_INT8 = 1<<0,
|
||||
AVS_SAMPLE_INT16 = 1<<1,
|
||||
AVS_SAMPLE_INT24 = 1<<2,
|
||||
AVS_SAMPLE_INT32 = 1<<3,
|
||||
AVS_SAMPLE_FLOAT = 1<<4};
|
||||
|
||||
enum {AVS_PLANAR_Y=1<<0,
|
||||
AVS_PLANAR_U=1<<1,
|
||||
AVS_PLANAR_V=1<<2,
|
||||
AVS_PLANAR_ALIGNED=1<<3,
|
||||
AVS_PLANAR_Y_ALIGNED=AVS_PLANAR_Y|AVS_PLANAR_ALIGNED,
|
||||
AVS_PLANAR_U_ALIGNED=AVS_PLANAR_U|AVS_PLANAR_ALIGNED,
|
||||
AVS_PLANAR_V_ALIGNED=AVS_PLANAR_V|AVS_PLANAR_ALIGNED,
|
||||
AVS_PLANAR_A=1<<4,
|
||||
AVS_PLANAR_R=1<<5,
|
||||
AVS_PLANAR_G=1<<6,
|
||||
AVS_PLANAR_B=1<<7,
|
||||
AVS_PLANAR_A_ALIGNED=AVS_PLANAR_A|AVS_PLANAR_ALIGNED,
|
||||
AVS_PLANAR_R_ALIGNED=AVS_PLANAR_R|AVS_PLANAR_ALIGNED,
|
||||
AVS_PLANAR_G_ALIGNED=AVS_PLANAR_G|AVS_PLANAR_ALIGNED,
|
||||
AVS_PLANAR_B_ALIGNED=AVS_PLANAR_B|AVS_PLANAR_ALIGNED};
|
||||
|
||||
// Colorspace properties.
|
||||
enum {AVS_CS_BGR = 1<<28,
|
||||
AVS_CS_YUV = 1<<29,
|
||||
AVS_CS_INTERLEAVED = 1<<30,
|
||||
AVS_CS_PLANAR = 1<<31,
|
||||
|
||||
AVS_CS_SHIFT_SUB_WIDTH = 0,
|
||||
AVS_CS_SHIFT_SUB_HEIGHT = 1 << 3,
|
||||
AVS_CS_SHIFT_SAMPLE_BITS = 1 << 4,
|
||||
|
||||
AVS_CS_SUB_WIDTH_MASK = 7 << AVS_CS_SHIFT_SUB_WIDTH,
|
||||
AVS_CS_SUB_WIDTH_1 = 3 << AVS_CS_SHIFT_SUB_WIDTH, // YV24
|
||||
AVS_CS_SUB_WIDTH_2 = 0 << AVS_CS_SHIFT_SUB_WIDTH, // YV12, I420, YV16
|
||||
AVS_CS_SUB_WIDTH_4 = 1 << AVS_CS_SHIFT_SUB_WIDTH, // YUV9, YV411
|
||||
|
||||
AVS_CS_VPLANEFIRST = 1 << 3, // YV12, YV16, YV24, YV411, YUV9
|
||||
AVS_CS_UPLANEFIRST = 1 << 4, // I420
|
||||
|
||||
AVS_CS_SUB_HEIGHT_MASK = 7 << AVS_CS_SHIFT_SUB_HEIGHT,
|
||||
AVS_CS_SUB_HEIGHT_1 = 3 << AVS_CS_SHIFT_SUB_HEIGHT, // YV16, YV24, YV411
|
||||
AVS_CS_SUB_HEIGHT_2 = 0 << AVS_CS_SHIFT_SUB_HEIGHT, // YV12, I420
|
||||
AVS_CS_SUB_HEIGHT_4 = 1 << AVS_CS_SHIFT_SUB_HEIGHT, // YUV9
|
||||
|
||||
AVS_CS_SAMPLE_BITS_MASK = 7 << AVS_CS_SHIFT_SAMPLE_BITS,
|
||||
AVS_CS_SAMPLE_BITS_8 = 0 << AVS_CS_SHIFT_SAMPLE_BITS,
|
||||
AVS_CS_SAMPLE_BITS_16 = 1 << AVS_CS_SHIFT_SAMPLE_BITS,
|
||||
AVS_CS_SAMPLE_BITS_32 = 2 << AVS_CS_SHIFT_SAMPLE_BITS,
|
||||
|
||||
AVS_CS_PLANAR_MASK = AVS_CS_PLANAR | AVS_CS_INTERLEAVED | AVS_CS_YUV | AVS_CS_BGR | AVS_CS_SAMPLE_BITS_MASK | AVS_CS_SUB_HEIGHT_MASK | AVS_CS_SUB_WIDTH_MASK,
|
||||
AVS_CS_PLANAR_FILTER = ~( AVS_CS_VPLANEFIRST | AVS_CS_UPLANEFIRST )};
|
||||
|
||||
// Specific colorformats
|
||||
enum {
|
||||
AVS_CS_UNKNOWN = 0,
|
||||
AVS_CS_BGR24 = 1<<0 | AVS_CS_BGR | AVS_CS_INTERLEAVED,
|
||||
AVS_CS_BGR32 = 1<<1 | AVS_CS_BGR | AVS_CS_INTERLEAVED,
|
||||
AVS_CS_YUY2 = 1<<2 | AVS_CS_YUV | AVS_CS_INTERLEAVED,
|
||||
// AVS_CS_YV12 = 1<<3 Reserved
|
||||
// AVS_CS_I420 = 1<<4 Reserved
|
||||
AVS_CS_RAW32 = 1<<5 | AVS_CS_INTERLEAVED,
|
||||
|
||||
AVS_CS_YV24 = AVS_CS_PLANAR | AVS_CS_YUV | AVS_CS_SAMPLE_BITS_8 | AVS_CS_VPLANEFIRST | AVS_CS_SUB_HEIGHT_1 | AVS_CS_SUB_WIDTH_1, // YVU 4:4:4 planar
|
||||
AVS_CS_YV16 = AVS_CS_PLANAR | AVS_CS_YUV | AVS_CS_SAMPLE_BITS_8 | AVS_CS_VPLANEFIRST | AVS_CS_SUB_HEIGHT_1 | AVS_CS_SUB_WIDTH_2, // YVU 4:2:2 planar
|
||||
AVS_CS_YV12 = AVS_CS_PLANAR | AVS_CS_YUV | AVS_CS_SAMPLE_BITS_8 | AVS_CS_VPLANEFIRST | AVS_CS_SUB_HEIGHT_2 | AVS_CS_SUB_WIDTH_2, // YVU 4:2:0 planar
|
||||
AVS_CS_I420 = AVS_CS_PLANAR | AVS_CS_YUV | AVS_CS_SAMPLE_BITS_8 | AVS_CS_UPLANEFIRST | AVS_CS_SUB_HEIGHT_2 | AVS_CS_SUB_WIDTH_2, // YUV 4:2:0 planar
|
||||
AVS_CS_IYUV = AVS_CS_I420,
|
||||
AVS_CS_YV411 = AVS_CS_PLANAR | AVS_CS_YUV | AVS_CS_SAMPLE_BITS_8 | AVS_CS_VPLANEFIRST | AVS_CS_SUB_HEIGHT_1 | AVS_CS_SUB_WIDTH_4, // YVU 4:1:1 planar
|
||||
AVS_CS_YUV9 = AVS_CS_PLANAR | AVS_CS_YUV | AVS_CS_SAMPLE_BITS_8 | AVS_CS_VPLANEFIRST | AVS_CS_SUB_HEIGHT_4 | AVS_CS_SUB_WIDTH_4, // YVU 4:1:0 planar
|
||||
AVS_CS_Y8 = AVS_CS_PLANAR | AVS_CS_INTERLEAVED | AVS_CS_YUV | AVS_CS_SAMPLE_BITS_8 // Y 4:0:0 planar
|
||||
};
|
||||
|
||||
enum {
|
||||
AVS_IT_BFF = 1<<0,
|
||||
AVS_IT_TFF = 1<<1,
|
||||
AVS_IT_FIELDBASED = 1<<2};
|
||||
|
||||
enum {
|
||||
AVS_FILTER_TYPE=1,
|
||||
AVS_FILTER_INPUT_COLORSPACE=2,
|
||||
AVS_FILTER_OUTPUT_TYPE=9,
|
||||
AVS_FILTER_NAME=4,
|
||||
AVS_FILTER_AUTHOR=5,
|
||||
AVS_FILTER_VERSION=6,
|
||||
AVS_FILTER_ARGS=7,
|
||||
AVS_FILTER_ARGS_INFO=8,
|
||||
AVS_FILTER_ARGS_DESCRIPTION=10,
|
||||
AVS_FILTER_DESCRIPTION=11};
|
||||
|
||||
enum { //SUBTYPES
|
||||
AVS_FILTER_TYPE_AUDIO=1,
|
||||
AVS_FILTER_TYPE_VIDEO=2,
|
||||
AVS_FILTER_OUTPUT_TYPE_SAME=3,
|
||||
AVS_FILTER_OUTPUT_TYPE_DIFFERENT=4};
|
||||
|
||||
enum {
|
||||
AVS_CACHE_NOTHING=0,
|
||||
AVS_CACHE_RANGE=1,
|
||||
AVS_CACHE_ALL=2,
|
||||
AVS_CACHE_AUDIO=3,
|
||||
AVS_CACHE_AUDIO_NONE=4,
|
||||
AVS_CACHE_AUDIO_AUTO=5
|
||||
};
|
||||
|
||||
#define AVS_FRAME_ALIGN 16
|
||||
|
||||
typedef struct AVS_Clip AVS_Clip;
|
||||
typedef struct AVS_ScriptEnvironment AVS_ScriptEnvironment;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// AVS_VideoInfo
|
||||
//
|
||||
|
||||
// AVS_VideoInfo is layed out identicly to VideoInfo
|
||||
typedef struct AVS_VideoInfo {
|
||||
int width, height; // width=0 means no video
|
||||
unsigned fps_numerator, fps_denominator;
|
||||
int num_frames;
|
||||
|
||||
int pixel_type;
|
||||
|
||||
int audio_samples_per_second; // 0 means no audio
|
||||
int sample_type;
|
||||
INT64 num_audio_samples;
|
||||
int nchannels;
|
||||
|
||||
// Imagetype properties
|
||||
|
||||
int image_type;
|
||||
} AVS_VideoInfo;
|
||||
|
||||
// useful functions of the above
|
||||
AVSC_INLINE int avs_has_video(const AVS_VideoInfo * p)
|
||||
{ return (p->width!=0); }
|
||||
|
||||
AVSC_INLINE int avs_has_audio(const AVS_VideoInfo * p)
|
||||
{ return (p->audio_samples_per_second!=0); }
|
||||
|
||||
AVSC_INLINE int avs_is_rgb(const AVS_VideoInfo * p)
|
||||
{ return !!(p->pixel_type&AVS_CS_BGR); }
|
||||
|
||||
AVSC_INLINE int avs_is_rgb24(const AVS_VideoInfo * p)
|
||||
{ return (p->pixel_type&AVS_CS_BGR24)==AVS_CS_BGR24; } // Clear out additional properties
|
||||
|
||||
AVSC_INLINE int avs_is_rgb32(const AVS_VideoInfo * p)
|
||||
{ return (p->pixel_type & AVS_CS_BGR32) == AVS_CS_BGR32 ; }
|
||||
|
||||
AVSC_INLINE int avs_is_yuv(const AVS_VideoInfo * p)
|
||||
{ return !!(p->pixel_type&AVS_CS_YUV ); }
|
||||
|
||||
AVSC_INLINE int avs_is_yuy2(const AVS_VideoInfo * p)
|
||||
{ return (p->pixel_type & AVS_CS_YUY2) == AVS_CS_YUY2; }
|
||||
|
||||
AVSC_INLINE int avs_is_yv24(const AVS_VideoInfo * p)
|
||||
{ return (p->pixel_type & AVS_CS_PLANAR_MASK) == (AVS_CS_YV24 & AVS_CS_PLANAR_FILTER); }
|
||||
|
||||
AVSC_INLINE int avs_is_yv16(const AVS_VideoInfo * p)
|
||||
{ return (p->pixel_type & AVS_CS_PLANAR_MASK) == (AVS_CS_YV16 & AVS_CS_PLANAR_FILTER); }
|
||||
|
||||
AVSC_INLINE int avs_is_yv12(const AVS_VideoInfo * p)
|
||||
{ return (p->pixel_type & AVS_CS_PLANAR_MASK) == (AVS_CS_YV12 & AVS_CS_PLANAR_FILTER); }
|
||||
|
||||
AVSC_INLINE int avs_is_yv411(const AVS_VideoInfo * p)
|
||||
{ return (p->pixel_type & AVS_CS_PLANAR_MASK) == (AVS_CS_YV411 & AVS_CS_PLANAR_FILTER); }
|
||||
|
||||
AVSC_INLINE int avs_is_y8(const AVS_VideoInfo * p)
|
||||
{ return (p->pixel_type & AVS_CS_PLANAR_MASK) == (AVS_CS_Y8 & AVS_CS_PLANAR_FILTER); }
|
||||
|
||||
AVSC_INLINE int avs_is_property(const AVS_VideoInfo * p, int property)
|
||||
{ return ((p->pixel_type & property)==property ); }
|
||||
|
||||
AVSC_INLINE int avs_is_planar(const AVS_VideoInfo * p)
|
||||
{ return !!(p->pixel_type & AVS_CS_PLANAR); }
|
||||
|
||||
AVSC_INLINE int avs_is_color_space(const AVS_VideoInfo * p, int c_space)
|
||||
{ return avs_is_planar(p) ? ((p->pixel_type & AVS_CS_PLANAR_MASK) == (c_space & AVS_CS_PLANAR_FILTER)) : ((p->pixel_type & c_space) == c_space); }
|
||||
|
||||
AVSC_INLINE int avs_is_field_based(const AVS_VideoInfo * p)
|
||||
{ return !!(p->image_type & AVS_IT_FIELDBASED); }
|
||||
|
||||
AVSC_INLINE int avs_is_parity_known(const AVS_VideoInfo * p)
|
||||
{ return ((p->image_type & AVS_IT_FIELDBASED)&&(p->image_type & (AVS_IT_BFF | AVS_IT_TFF))); }
|
||||
|
||||
AVSC_INLINE int avs_is_bff(const AVS_VideoInfo * p)
|
||||
{ return !!(p->image_type & AVS_IT_BFF); }
|
||||
|
||||
AVSC_INLINE int avs_is_tff(const AVS_VideoInfo * p)
|
||||
{ return !!(p->image_type & AVS_IT_TFF); }
|
||||
|
||||
AVSC_INLINE int avs_bits_per_pixel(const AVS_VideoInfo * p)
|
||||
{
|
||||
switch (p->pixel_type) {
|
||||
case AVS_CS_BGR24: return 24;
|
||||
case AVS_CS_BGR32: return 32;
|
||||
case AVS_CS_YUY2: return 16;
|
||||
case AVS_CS_YV12:
|
||||
case AVS_CS_I420: return 12;
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
AVSC_INLINE int avs_bytes_from_pixels(const AVS_VideoInfo * p, int pixels)
|
||||
{ return pixels * (avs_bits_per_pixel(p)>>3); } // Will work on planar images, but will return only luma planes
|
||||
|
||||
AVSC_INLINE int avs_row_size(const AVS_VideoInfo * p)
|
||||
{ return avs_bytes_from_pixels(p,p->width); } // Also only returns first plane on planar images
|
||||
|
||||
AVSC_INLINE int avs_bmp_size(const AVS_VideoInfo * vi)
|
||||
{ if (avs_is_planar(vi)) {int p = vi->height * ((avs_row_size(vi)+3) & ~3); p+=p>>1; return p; } return vi->height * ((avs_row_size(vi)+3) & ~3); }
|
||||
|
||||
AVSC_INLINE int avs_samples_per_second(const AVS_VideoInfo * p)
|
||||
{ return p->audio_samples_per_second; }
|
||||
|
||||
|
||||
AVSC_INLINE int avs_bytes_per_channel_sample(const AVS_VideoInfo * p)
|
||||
{
|
||||
switch (p->sample_type) {
|
||||
case AVS_SAMPLE_INT8: return sizeof(signed char);
|
||||
case AVS_SAMPLE_INT16: return sizeof(signed short);
|
||||
case AVS_SAMPLE_INT24: return 3;
|
||||
case AVS_SAMPLE_INT32: return sizeof(signed int);
|
||||
case AVS_SAMPLE_FLOAT: return sizeof(float);
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
AVSC_INLINE int avs_bytes_per_audio_sample(const AVS_VideoInfo * p)
|
||||
{ return p->nchannels*avs_bytes_per_channel_sample(p);}
|
||||
|
||||
AVSC_INLINE INT64 avs_audio_samples_from_frames(const AVS_VideoInfo * p, INT64 frames)
|
||||
{ return ((INT64)(frames) * p->audio_samples_per_second * p->fps_denominator / p->fps_numerator); }
|
||||
|
||||
AVSC_INLINE int avs_frames_from_audio_samples(const AVS_VideoInfo * p, INT64 samples)
|
||||
{ return (int)(samples * (INT64)p->fps_numerator / (INT64)p->fps_denominator / (INT64)p->audio_samples_per_second); }
|
||||
|
||||
AVSC_INLINE INT64 avs_audio_samples_from_bytes(const AVS_VideoInfo * p, INT64 bytes)
|
||||
{ return bytes / avs_bytes_per_audio_sample(p); }
|
||||
|
||||
AVSC_INLINE INT64 avs_bytes_from_audio_samples(const AVS_VideoInfo * p, INT64 samples)
|
||||
{ return samples * avs_bytes_per_audio_sample(p); }
|
||||
|
||||
AVSC_INLINE int avs_audio_channels(const AVS_VideoInfo * p)
|
||||
{ return p->nchannels; }
|
||||
|
||||
AVSC_INLINE int avs_sample_type(const AVS_VideoInfo * p)
|
||||
{ return p->sample_type;}
|
||||
|
||||
// useful mutator
|
||||
AVSC_INLINE void avs_set_property(AVS_VideoInfo * p, int property)
|
||||
{ p->image_type|=property; }
|
||||
|
||||
AVSC_INLINE void avs_clear_property(AVS_VideoInfo * p, int property)
|
||||
{ p->image_type&=~property; }
|
||||
|
||||
AVSC_INLINE void avs_set_field_based(AVS_VideoInfo * p, int isfieldbased)
|
||||
{ if (isfieldbased) p->image_type|=AVS_IT_FIELDBASED; else p->image_type&=~AVS_IT_FIELDBASED; }
|
||||
|
||||
AVSC_INLINE void avs_set_fps(AVS_VideoInfo * p, unsigned numerator, unsigned denominator)
|
||||
{
|
||||
unsigned x=numerator, y=denominator;
|
||||
while (y) { // find gcd
|
||||
unsigned t = x%y; x = y; y = t;
|
||||
}
|
||||
p->fps_numerator = numerator/x;
|
||||
p->fps_denominator = denominator/x;
|
||||
}
|
||||
|
||||
AVSC_INLINE int avs_is_same_colorspace(AVS_VideoInfo * x, AVS_VideoInfo * y)
|
||||
{
|
||||
return (x->pixel_type == y->pixel_type)
|
||||
|| (avs_is_yv12(x) && avs_is_yv12(y));
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// AVS_VideoFrame
|
||||
//
|
||||
|
||||
// VideoFrameBuffer holds information about a memory block which is used
|
||||
// for video data. For efficiency, instances of this class are not deleted
|
||||
// when the refcount reaches zero; instead they're stored in a linked list
|
||||
// to be reused. The instances are deleted when the corresponding AVS
|
||||
// file is closed.
|
||||
|
||||
// AVS_VideoFrameBuffer is layed out identicly to VideoFrameBuffer
|
||||
// DO NOT USE THIS STRUCTURE DIRECTLY
|
||||
typedef struct AVS_VideoFrameBuffer {
|
||||
BYTE * data;
|
||||
int data_size;
|
||||
// sequence_number is incremented every time the buffer is changed, so
|
||||
// that stale views can tell they're no longer valid.
|
||||
volatile long sequence_number;
|
||||
|
||||
volatile long refcount;
|
||||
} AVS_VideoFrameBuffer;
|
||||
|
||||
// VideoFrame holds a "window" into a VideoFrameBuffer.
|
||||
|
||||
// AVS_VideoFrame is layed out identicly to IVideoFrame
|
||||
// DO NOT USE THIS STRUCTURE DIRECTLY
|
||||
typedef struct AVS_VideoFrame {
|
||||
volatile long refcount;
|
||||
AVS_VideoFrameBuffer * vfb;
|
||||
int offset, pitch, row_size, height, offsetU, offsetV, pitchUV; // U&V offsets are from top of picture.
|
||||
int row_sizeUV, heightUV;
|
||||
} AVS_VideoFrame;
|
||||
|
||||
// Access functions for AVS_VideoFrame
|
||||
AVSC_INLINE int avs_get_pitch(const AVS_VideoFrame * p) {
|
||||
return p->pitch;}
|
||||
|
||||
AVSC_INLINE int avs_get_pitch_p(const AVS_VideoFrame * p, int plane) {
|
||||
switch (plane) {
|
||||
case AVS_PLANAR_U: case AVS_PLANAR_V: return p->pitchUV;}
|
||||
return p->pitch;}
|
||||
|
||||
AVSC_INLINE int avs_get_row_size(const AVS_VideoFrame * p) {
|
||||
return p->row_size; }
|
||||
|
||||
AVSC_INLINE int avs_get_row_size_p(const AVS_VideoFrame * p, int plane) {
|
||||
int r;
|
||||
switch (plane) {
|
||||
case AVS_PLANAR_U: case AVS_PLANAR_V:
|
||||
if (p->pitchUV) return p->row_sizeUV;
|
||||
else return 0;
|
||||
case AVS_PLANAR_U_ALIGNED: case AVS_PLANAR_V_ALIGNED:
|
||||
if (p->pitchUV) {
|
||||
r = (p->row_sizeUV+AVS_FRAME_ALIGN-1)&(~(AVS_FRAME_ALIGN-1)); // Aligned rowsize
|
||||
if (r < p->pitchUV)
|
||||
return r;
|
||||
return p->row_sizeUV;
|
||||
} else return 0;
|
||||
case AVS_PLANAR_Y_ALIGNED:
|
||||
r = (p->row_size+AVS_FRAME_ALIGN-1)&(~(AVS_FRAME_ALIGN-1)); // Aligned rowsize
|
||||
if (r <= p->pitch)
|
||||
return r;
|
||||
return p->row_size;
|
||||
}
|
||||
return p->row_size;
|
||||
}
|
||||
|
||||
AVSC_INLINE int avs_get_height(const AVS_VideoFrame * p) {
|
||||
return p->height;}
|
||||
|
||||
AVSC_INLINE int avs_get_height_p(const AVS_VideoFrame * p, int plane) {
|
||||
switch (plane) {
|
||||
case AVS_PLANAR_U: case AVS_PLANAR_V:
|
||||
if (p->pitchUV) return p->heightUV;
|
||||
return 0;
|
||||
}
|
||||
return p->height;}
|
||||
|
||||
AVSC_INLINE const BYTE* avs_get_read_ptr(const AVS_VideoFrame * p) {
|
||||
return p->vfb->data + p->offset;}
|
||||
|
||||
AVSC_INLINE const BYTE* avs_get_read_ptr_p(const AVS_VideoFrame * p, int plane)
|
||||
{
|
||||
switch (plane) {
|
||||
case AVS_PLANAR_U: return p->vfb->data + p->offsetU;
|
||||
case AVS_PLANAR_V: return p->vfb->data + p->offsetV;
|
||||
default: return p->vfb->data + p->offset;}
|
||||
}
|
||||
|
||||
AVSC_INLINE int avs_is_writable(const AVS_VideoFrame * p) {
|
||||
return (p->refcount == 1 && p->vfb->refcount == 1);}
|
||||
|
||||
AVSC_INLINE BYTE* avs_get_write_ptr(const AVS_VideoFrame * p)
|
||||
{
|
||||
if (avs_is_writable(p)) {
|
||||
++p->vfb->sequence_number;
|
||||
return p->vfb->data + p->offset;
|
||||
} else
|
||||
return 0;
|
||||
}
|
||||
|
||||
AVSC_INLINE BYTE* avs_get_write_ptr_p(const AVS_VideoFrame * p, int plane)
|
||||
{
|
||||
if (plane==AVS_PLANAR_Y && avs_is_writable(p)) {
|
||||
++p->vfb->sequence_number;
|
||||
return p->vfb->data + p->offset;
|
||||
} else if (plane==AVS_PLANAR_Y) {
|
||||
return 0;
|
||||
} else {
|
||||
switch (plane) {
|
||||
case AVS_PLANAR_U: return p->vfb->data + p->offsetU;
|
||||
case AVS_PLANAR_V: return p->vfb->data + p->offsetV;
|
||||
default: return p->vfb->data + p->offset;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
AVSC_API(void, avs_release_video_frame)(AVS_VideoFrame *);
|
||||
// makes a shallow copy of a video frame
|
||||
AVSC_API(AVS_VideoFrame *, avs_copy_video_frame)(AVS_VideoFrame *);
|
||||
|
||||
#ifndef AVSC_NO_DECLSPEC
|
||||
AVSC_INLINE void avs_release_frame(AVS_VideoFrame * f)
|
||||
{avs_release_video_frame(f);}
|
||||
AVSC_INLINE AVS_VideoFrame * avs_copy_frame(AVS_VideoFrame * f)
|
||||
{return avs_copy_video_frame(f);}
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// AVS_Value
|
||||
//
|
||||
|
||||
// Treat AVS_Value as a fat pointer. That is use avs_copy_value
|
||||
// and avs_release_value appropiaty as you would if AVS_Value was
|
||||
// a pointer.
|
||||
|
||||
// To maintain source code compatibility with future versions of the
|
||||
// avisynth_c API don't use the AVS_Value directly. Use the helper
|
||||
// functions below.
|
||||
|
||||
// AVS_Value is layed out identicly to AVSValue
|
||||
typedef struct AVS_Value AVS_Value;
|
||||
struct AVS_Value {
|
||||
short type; // 'a'rray, 'c'lip, 'b'ool, 'i'nt, 'f'loat, 's'tring, 'v'oid, or 'l'ong
|
||||
// for some function e'rror
|
||||
short array_size;
|
||||
union {
|
||||
void * clip; // do not use directly, use avs_take_clip
|
||||
char boolean;
|
||||
int integer;
|
||||
float floating_pt;
|
||||
const char * string;
|
||||
const AVS_Value * array;
|
||||
} d;
|
||||
};
|
||||
|
||||
// AVS_Value should be initilized with avs_void.
|
||||
// Should also set to avs_void after the value is released
|
||||
// with avs_copy_value. Consider it the equalvent of setting
|
||||
// a pointer to NULL
|
||||
static const AVS_Value avs_void = {'v'};
|
||||
|
||||
AVSC_API(void, avs_copy_value)(AVS_Value * dest, AVS_Value src);
|
||||
AVSC_API(void, avs_release_value)(AVS_Value);
|
||||
|
||||
AVSC_INLINE int avs_defined(AVS_Value v) { return v.type != 'v'; }
|
||||
AVSC_INLINE int avs_is_clip(AVS_Value v) { return v.type == 'c'; }
|
||||
AVSC_INLINE int avs_is_bool(AVS_Value v) { return v.type == 'b'; }
|
||||
AVSC_INLINE int avs_is_int(AVS_Value v) { return v.type == 'i'; }
|
||||
AVSC_INLINE int avs_is_float(AVS_Value v) { return v.type == 'f' || v.type == 'i'; }
|
||||
AVSC_INLINE int avs_is_string(AVS_Value v) { return v.type == 's'; }
|
||||
AVSC_INLINE int avs_is_array(AVS_Value v) { return v.type == 'a'; }
|
||||
AVSC_INLINE int avs_is_error(AVS_Value v) { return v.type == 'e'; }
|
||||
|
||||
AVSC_API(AVS_Clip *, avs_take_clip)(AVS_Value, AVS_ScriptEnvironment *);
|
||||
AVSC_API(void, avs_set_to_clip)(AVS_Value *, AVS_Clip *);
|
||||
|
||||
AVSC_INLINE int avs_as_bool(AVS_Value v)
|
||||
{ return v.d.boolean; }
|
||||
AVSC_INLINE int avs_as_int(AVS_Value v)
|
||||
{ return v.d.integer; }
|
||||
AVSC_INLINE const char * avs_as_string(AVS_Value v)
|
||||
{ return avs_is_error(v) || avs_is_string(v) ? v.d.string : 0; }
|
||||
AVSC_INLINE double avs_as_float(AVS_Value v)
|
||||
{ return avs_is_int(v) ? v.d.integer : v.d.floating_pt; }
|
||||
AVSC_INLINE const char * avs_as_error(AVS_Value v)
|
||||
{ return avs_is_error(v) ? v.d.string : 0; }
|
||||
AVSC_INLINE const AVS_Value * avs_as_array(AVS_Value v)
|
||||
{ return v.d.array; }
|
||||
AVSC_INLINE int avs_array_size(AVS_Value v)
|
||||
{ return avs_is_array(v) ? v.array_size : 1; }
|
||||
AVSC_INLINE AVS_Value avs_array_elt(AVS_Value v, int index)
|
||||
{ return avs_is_array(v) ? v.d.array[index] : v; }
|
||||
|
||||
// only use these functions on an AVS_Value that does not already have
|
||||
// an active value. Remember, treat AVS_Value as a fat pointer.
|
||||
AVSC_INLINE AVS_Value avs_new_value_bool(int v0)
|
||||
{ AVS_Value v; v.type = 'b'; v.d.boolean = v0 == 0 ? 0 : 1; return v; }
|
||||
AVSC_INLINE AVS_Value avs_new_value_int(int v0)
|
||||
{ AVS_Value v; v.type = 'i'; v.d.integer = v0; return v; }
|
||||
AVSC_INLINE AVS_Value avs_new_value_string(const char * v0)
|
||||
{ AVS_Value v; v.type = 's'; v.d.string = v0; return v; }
|
||||
AVSC_INLINE AVS_Value avs_new_value_float(float v0)
|
||||
{ AVS_Value v; v.type = 'f'; v.d.floating_pt = v0; return v;}
|
||||
AVSC_INLINE AVS_Value avs_new_value_error(const char * v0)
|
||||
{ AVS_Value v; v.type = 'e'; v.d.string = v0; return v; }
|
||||
#ifndef AVSC_NO_DECLSPEC
|
||||
AVSC_INLINE AVS_Value avs_new_value_clip(AVS_Clip * v0)
|
||||
{ AVS_Value v; avs_set_to_clip(&v, v0); return v; }
|
||||
#endif
|
||||
AVSC_INLINE AVS_Value avs_new_value_array(AVS_Value * v0, int size)
|
||||
{ AVS_Value v; v.type = 'a'; v.d.array = v0; v.array_size = size; return v; }
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// AVS_Clip
|
||||
//
|
||||
|
||||
AVSC_API(void, avs_release_clip)(AVS_Clip *);
|
||||
AVSC_API(AVS_Clip *, avs_copy_clip)(AVS_Clip *);
|
||||
|
||||
AVSC_API(const char *, avs_clip_get_error)(AVS_Clip *); // return 0 if no error
|
||||
|
||||
AVSC_API(const AVS_VideoInfo *, avs_get_video_info)(AVS_Clip *);
|
||||
|
||||
AVSC_API(int, avs_get_version)(AVS_Clip *);
|
||||
|
||||
AVSC_API(AVS_VideoFrame *, avs_get_frame)(AVS_Clip *, int n);
|
||||
// The returned video frame must be released with avs_release_video_frame
|
||||
|
||||
AVSC_API(int, avs_get_parity)(AVS_Clip *, int n);
|
||||
// return field parity if field_based, else parity of first field in frame
|
||||
|
||||
AVSC_API(int, avs_get_audio)(AVS_Clip *, void * buf,
|
||||
INT64 start, INT64 count);
|
||||
// start and count are in samples
|
||||
|
||||
AVSC_API(int, avs_set_cache_hints)(AVS_Clip *,
|
||||
int cachehints, int frame_range);
|
||||
|
||||
// This is the callback type used by avs_add_function
|
||||
typedef AVS_Value (AVSC_CC * AVS_ApplyFunc)
|
||||
(AVS_ScriptEnvironment *, AVS_Value args, void * user_data);
|
||||
|
||||
typedef struct AVS_FilterInfo AVS_FilterInfo;
|
||||
struct AVS_FilterInfo
|
||||
{
|
||||
// these members should not be modified outside of the AVS_ApplyFunc callback
|
||||
AVS_Clip * child;
|
||||
AVS_VideoInfo vi;
|
||||
AVS_ScriptEnvironment * env;
|
||||
AVS_VideoFrame * (AVSC_CC * get_frame)(AVS_FilterInfo *, int n);
|
||||
int (AVSC_CC * get_parity)(AVS_FilterInfo *, int n);
|
||||
int (AVSC_CC * get_audio)(AVS_FilterInfo *, void * buf,
|
||||
INT64 start, INT64 count);
|
||||
int (AVSC_CC * set_cache_hints)(AVS_FilterInfo *, int cachehints,
|
||||
int frame_range);
|
||||
void (AVSC_CC * free_filter)(AVS_FilterInfo *);
|
||||
|
||||
// Should be set when ever there is an error to report.
|
||||
// It is cleared before any of the above methods are called
|
||||
const char * error;
|
||||
// this is to store whatever and may be modified at will
|
||||
void * user_data;
|
||||
};
|
||||
|
||||
// Create a new filter
|
||||
// fi is set to point to the AVS_FilterInfo so that you can
|
||||
// modify it once it is initilized.
|
||||
// store_child should generally be set to true. If it is not
|
||||
// set than ALL methods (the function pointers) must be defined
|
||||
// If it is set than you do not need to worry about freeing the child
|
||||
// clip.
|
||||
AVSC_API(AVS_Clip *, avs_new_c_filter)(AVS_ScriptEnvironment * e,
|
||||
AVS_FilterInfo * * fi,
|
||||
AVS_Value child, int store_child);
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// AVS_ScriptEnvironment
|
||||
//
|
||||
|
||||
// For GetCPUFlags. These are backwards-compatible with those in VirtualDub.
|
||||
enum {
|
||||
/* slowest CPU to support extension */
|
||||
AVS_CPU_FORCE = 0x01, // N/A
|
||||
AVS_CPU_FPU = 0x02, // 386/486DX
|
||||
AVS_CPU_MMX = 0x04, // P55C, K6, PII
|
||||
AVS_CPU_INTEGER_SSE = 0x08, // PIII, Athlon
|
||||
AVS_CPU_SSE = 0x10, // PIII, Athlon XP/MP
|
||||
AVS_CPU_SSE2 = 0x20, // PIV, Hammer
|
||||
AVS_CPU_3DNOW = 0x40, // K6-2
|
||||
AVS_CPU_3DNOW_EXT = 0x80, // Athlon
|
||||
AVS_CPU_X86_64 = 0xA0, // Hammer (note: equiv. to 3DNow + SSE2,
|
||||
// which only Hammer will have anyway)
|
||||
AVS_CPUF_SSE3 = 0x100, // PIV+, K8 Venice
|
||||
AVS_CPUF_SSSE3 = 0x200, // Core 2
|
||||
AVS_CPUF_SSE4 = 0x400, // Penryn, Wolfdale, Yorkfield
|
||||
AVS_CPUF_SSE4_1 = 0x400,
|
||||
AVS_CPUF_SSE4_2 = 0x800, // Nehalem
|
||||
};
|
||||
|
||||
AVSC_API(const char *, avs_get_error)(AVS_ScriptEnvironment *); // return 0 if no error
|
||||
|
||||
AVSC_API(long, avs_get_cpu_flags)(AVS_ScriptEnvironment *);
|
||||
AVSC_API(int, avs_check_version)(AVS_ScriptEnvironment *, int version);
|
||||
|
||||
AVSC_API(char *, avs_save_string)(AVS_ScriptEnvironment *, const char* s, int length);
|
||||
AVSC_API(char *, avs_sprintf)(AVS_ScriptEnvironment *, const char * fmt, ...);
|
||||
|
||||
AVSC_API(char *, avs_vsprintf)(AVS_ScriptEnvironment *, const char * fmt, void* val);
|
||||
// note: val is really a va_list; I hope everyone typedefs va_list to a pointer
|
||||
|
||||
AVSC_API(int, avs_add_function)(AVS_ScriptEnvironment *,
|
||||
const char * name, const char * params,
|
||||
AVS_ApplyFunc apply, void * user_data);
|
||||
|
||||
AVSC_API(int, avs_function_exists)(AVS_ScriptEnvironment *, const char * name);
|
||||
|
||||
AVSC_API(AVS_Value, avs_invoke)(AVS_ScriptEnvironment *, const char * name,
|
||||
AVS_Value args, const char** arg_names);
|
||||
// The returned value must be be released with avs_release_value
|
||||
|
||||
AVSC_API(AVS_Value, avs_get_var)(AVS_ScriptEnvironment *, const char* name);
|
||||
// The returned value must be be released with avs_release_value
|
||||
|
||||
AVSC_API(int, avs_set_var)(AVS_ScriptEnvironment *, const char* name, AVS_Value val);
|
||||
|
||||
AVSC_API(int, avs_set_global_var)(AVS_ScriptEnvironment *, const char* name, const AVS_Value val);
|
||||
|
||||
//void avs_push_context(AVS_ScriptEnvironment *, int level=0);
|
||||
//void avs_pop_context(AVS_ScriptEnvironment *);
|
||||
|
||||
AVSC_API(AVS_VideoFrame *, avs_new_video_frame_a)(AVS_ScriptEnvironment *,
|
||||
const AVS_VideoInfo * vi, int align);
|
||||
// align should be at least 16
|
||||
|
||||
#ifndef AVSC_NO_DECLSPEC
|
||||
AVSC_INLINE
|
||||
AVS_VideoFrame * avs_new_video_frame(AVS_ScriptEnvironment * env,
|
||||
const AVS_VideoInfo * vi)
|
||||
{return avs_new_video_frame_a(env,vi,AVS_FRAME_ALIGN);}
|
||||
|
||||
AVSC_INLINE
|
||||
AVS_VideoFrame * avs_new_frame(AVS_ScriptEnvironment * env,
|
||||
const AVS_VideoInfo * vi)
|
||||
{return avs_new_video_frame_a(env,vi,AVS_FRAME_ALIGN);}
|
||||
#endif
|
||||
|
||||
|
||||
AVSC_API(int, avs_make_writable)(AVS_ScriptEnvironment *, AVS_VideoFrame * * pvf);
|
||||
|
||||
AVSC_API(void, avs_bit_blt)(AVS_ScriptEnvironment *, BYTE* dstp, int dst_pitch, const BYTE* srcp, int src_pitch, int row_size, int height);
|
||||
|
||||
typedef void (AVSC_CC *AVS_ShutdownFunc)(void* user_data, AVS_ScriptEnvironment * env);
|
||||
AVSC_API(void, avs_at_exit)(AVS_ScriptEnvironment *, AVS_ShutdownFunc function, void * user_data);
|
||||
|
||||
AVSC_API(AVS_VideoFrame *, avs_subframe)(AVS_ScriptEnvironment *, AVS_VideoFrame * src, int rel_offset, int new_pitch, int new_row_size, int new_height);
|
||||
// The returned video frame must be be released
|
||||
|
||||
AVSC_API(int, avs_set_memory_max)(AVS_ScriptEnvironment *, int mem);
|
||||
|
||||
AVSC_API(int, avs_set_working_dir)(AVS_ScriptEnvironment *, const char * newdir);
|
||||
|
||||
// avisynth.dll exports this; it's a way to use it as a library, without
|
||||
// writing an AVS script or without going through AVIFile.
|
||||
AVSC_API(AVS_ScriptEnvironment *, avs_create_script_environment)(int version);
|
||||
|
||||
// this symbol is the entry point for the plugin and must
|
||||
// be defined
|
||||
AVSC_EXPORT
|
||||
const char * AVSC_CC avisynth_c_plugin_init(AVS_ScriptEnvironment* env);
|
||||
|
||||
|
||||
AVSC_API(void, avs_delete_script_environment)(AVS_ScriptEnvironment *);
|
||||
|
||||
|
||||
AVSC_API(AVS_VideoFrame *, avs_subframe_planar)(AVS_ScriptEnvironment *, AVS_VideoFrame * src, int rel_offset, int new_pitch, int new_row_size, int new_height, int rel_offsetU, int rel_offsetV, int new_pitchUV);
|
||||
// The returned video frame must be be released
|
||||
|
||||
#ifdef AVSC_NO_DECLSPEC
|
||||
// use LoadLibrary and related functions to dynamically load Avisynth instead of declspec(dllimport)
|
||||
/*
|
||||
The following functions needs to have been declared, probably from windows.h
|
||||
|
||||
void* malloc(size_t)
|
||||
void free(void*);
|
||||
|
||||
HMODULE LoadLibrary(const char*);
|
||||
void* GetProcAddress(HMODULE, const char*);
|
||||
FreeLibrary(HMODULE);
|
||||
*/
|
||||
|
||||
|
||||
typedef struct AVS_Library AVS_Library;
|
||||
|
||||
#define AVSC_DECLARE_FUNC(name) name##_func name
|
||||
|
||||
struct AVS_Library {
|
||||
HMODULE handle;
|
||||
|
||||
AVSC_DECLARE_FUNC(avs_add_function);
|
||||
AVSC_DECLARE_FUNC(avs_at_exit);
|
||||
AVSC_DECLARE_FUNC(avs_bit_blt);
|
||||
AVSC_DECLARE_FUNC(avs_check_version);
|
||||
AVSC_DECLARE_FUNC(avs_clip_get_error);
|
||||
AVSC_DECLARE_FUNC(avs_copy_clip);
|
||||
AVSC_DECLARE_FUNC(avs_copy_value);
|
||||
AVSC_DECLARE_FUNC(avs_copy_video_frame);
|
||||
AVSC_DECLARE_FUNC(avs_create_script_environment);
|
||||
AVSC_DECLARE_FUNC(avs_delete_script_environment);
|
||||
AVSC_DECLARE_FUNC(avs_function_exists);
|
||||
AVSC_DECLARE_FUNC(avs_get_audio);
|
||||
AVSC_DECLARE_FUNC(avs_get_cpu_flags);
|
||||
AVSC_DECLARE_FUNC(avs_get_error);
|
||||
AVSC_DECLARE_FUNC(avs_get_frame);
|
||||
AVSC_DECLARE_FUNC(avs_get_parity);
|
||||
AVSC_DECLARE_FUNC(avs_get_var);
|
||||
AVSC_DECLARE_FUNC(avs_get_version);
|
||||
AVSC_DECLARE_FUNC(avs_get_video_info);
|
||||
AVSC_DECLARE_FUNC(avs_invoke);
|
||||
AVSC_DECLARE_FUNC(avs_make_writable);
|
||||
AVSC_DECLARE_FUNC(avs_new_c_filter);
|
||||
AVSC_DECLARE_FUNC(avs_new_video_frame_a);
|
||||
AVSC_DECLARE_FUNC(avs_release_clip);
|
||||
AVSC_DECLARE_FUNC(avs_release_value);
|
||||
AVSC_DECLARE_FUNC(avs_release_video_frame);
|
||||
AVSC_DECLARE_FUNC(avs_save_string);
|
||||
AVSC_DECLARE_FUNC(avs_set_cache_hints);
|
||||
AVSC_DECLARE_FUNC(avs_set_global_var);
|
||||
AVSC_DECLARE_FUNC(avs_set_memory_max);
|
||||
AVSC_DECLARE_FUNC(avs_set_to_clip);
|
||||
AVSC_DECLARE_FUNC(avs_set_var);
|
||||
AVSC_DECLARE_FUNC(avs_set_working_dir);
|
||||
AVSC_DECLARE_FUNC(avs_sprintf);
|
||||
AVSC_DECLARE_FUNC(avs_subframe);
|
||||
AVSC_DECLARE_FUNC(avs_subframe_planar);
|
||||
AVSC_DECLARE_FUNC(avs_take_clip);
|
||||
AVSC_DECLARE_FUNC(avs_vsprintf);
|
||||
};
|
||||
|
||||
#undef AVSC_DECLARE_FUNC
|
||||
|
||||
|
||||
AVSC_INLINE AVS_Library * avs_load_library() {
|
||||
AVS_Library *library = (AVS_Library *)malloc(sizeof(AVS_Library));
|
||||
if (library == NULL)
|
||||
return NULL;
|
||||
library->handle = LoadLibrary("avisynth");
|
||||
if (library->handle == NULL)
|
||||
goto fail;
|
||||
|
||||
#define __AVSC_STRINGIFY(x) #x
|
||||
#define AVSC_STRINGIFY(x) __AVSC_STRINGIFY(x)
|
||||
#define AVSC_LOAD_FUNC(name) {\
|
||||
library->name = (name##_func) GetProcAddress(library->handle, AVSC_STRINGIFY(name));\
|
||||
if (library->name == NULL)\
|
||||
goto fail;\
|
||||
}
|
||||
|
||||
AVSC_LOAD_FUNC(avs_add_function);
|
||||
AVSC_LOAD_FUNC(avs_at_exit);
|
||||
AVSC_LOAD_FUNC(avs_bit_blt);
|
||||
AVSC_LOAD_FUNC(avs_check_version);
|
||||
AVSC_LOAD_FUNC(avs_clip_get_error);
|
||||
AVSC_LOAD_FUNC(avs_copy_clip);
|
||||
AVSC_LOAD_FUNC(avs_copy_value);
|
||||
AVSC_LOAD_FUNC(avs_copy_video_frame);
|
||||
AVSC_LOAD_FUNC(avs_create_script_environment);
|
||||
AVSC_LOAD_FUNC(avs_delete_script_environment);
|
||||
AVSC_LOAD_FUNC(avs_function_exists);
|
||||
AVSC_LOAD_FUNC(avs_get_audio);
|
||||
AVSC_LOAD_FUNC(avs_get_cpu_flags);
|
||||
AVSC_LOAD_FUNC(avs_get_error);
|
||||
AVSC_LOAD_FUNC(avs_get_frame);
|
||||
AVSC_LOAD_FUNC(avs_get_parity);
|
||||
AVSC_LOAD_FUNC(avs_get_var);
|
||||
AVSC_LOAD_FUNC(avs_get_version);
|
||||
AVSC_LOAD_FUNC(avs_get_video_info);
|
||||
AVSC_LOAD_FUNC(avs_invoke);
|
||||
AVSC_LOAD_FUNC(avs_make_writable);
|
||||
AVSC_LOAD_FUNC(avs_new_c_filter);
|
||||
AVSC_LOAD_FUNC(avs_new_video_frame_a);
|
||||
AVSC_LOAD_FUNC(avs_release_clip);
|
||||
AVSC_LOAD_FUNC(avs_release_value);
|
||||
AVSC_LOAD_FUNC(avs_release_video_frame);
|
||||
AVSC_LOAD_FUNC(avs_save_string);
|
||||
AVSC_LOAD_FUNC(avs_set_cache_hints);
|
||||
AVSC_LOAD_FUNC(avs_set_global_var);
|
||||
AVSC_LOAD_FUNC(avs_set_memory_max);
|
||||
AVSC_LOAD_FUNC(avs_set_to_clip);
|
||||
AVSC_LOAD_FUNC(avs_set_var);
|
||||
AVSC_LOAD_FUNC(avs_set_working_dir);
|
||||
AVSC_LOAD_FUNC(avs_sprintf);
|
||||
AVSC_LOAD_FUNC(avs_subframe);
|
||||
AVSC_LOAD_FUNC(avs_subframe_planar);
|
||||
AVSC_LOAD_FUNC(avs_take_clip);
|
||||
AVSC_LOAD_FUNC(avs_vsprintf);
|
||||
|
||||
#undef __AVSC_STRINGIFY
|
||||
#undef AVSC_STRINGIFY
|
||||
#undef AVSC_LOAD_FUNC
|
||||
|
||||
return library;
|
||||
|
||||
fail:
|
||||
free(library);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
AVSC_INLINE void avs_free_library(AVS_Library *library) {
|
||||
if (library == NULL)
|
||||
return;
|
||||
FreeLibrary(library->handle);
|
||||
free(library);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,68 +0,0 @@
|
||||
// Copyright (c) 2011 FFmpegSource Project
|
||||
//
|
||||
// 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.
|
||||
|
||||
/* these are defines/functions that are used and were changed in the switch to 2.6
|
||||
* and are needed to maintain full compatility with 2.5 */
|
||||
|
||||
enum {
|
||||
AVS_CS_YV12_25 = 1<<3 | AVS_CS_YUV | AVS_CS_PLANAR, // y-v-u, planar
|
||||
AVS_CS_I420_25 = 1<<4 | AVS_CS_YUV | AVS_CS_PLANAR, // y-u-v, planar
|
||||
};
|
||||
|
||||
AVSC_INLINE int avs_get_height_p_25(const AVS_VideoFrame * p, int plane) {
|
||||
switch (plane)
|
||||
{
|
||||
case AVS_PLANAR_U: case AVS_PLANAR_V:
|
||||
if (p->pitchUV)
|
||||
return p->height>>1;
|
||||
return 0;
|
||||
}
|
||||
return p->height;}
|
||||
|
||||
AVSC_INLINE int avs_get_row_size_p_25(const AVS_VideoFrame * p, int plane) {
|
||||
int r;
|
||||
switch (plane)
|
||||
{
|
||||
case AVS_PLANAR_U: case AVS_PLANAR_V:
|
||||
if (p->pitchUV)
|
||||
return p->row_size>>1;
|
||||
else
|
||||
return 0;
|
||||
case AVS_PLANAR_U_ALIGNED: case AVS_PLANAR_V_ALIGNED:
|
||||
if (p->pitchUV)
|
||||
{
|
||||
r = ((p->row_size+AVS_FRAME_ALIGN-1)&(~(AVS_FRAME_ALIGN-1)) )>>1; // Aligned rowsize
|
||||
if (r < p->pitchUV)
|
||||
return r;
|
||||
return p->row_size>>1;
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
case AVS_PLANAR_Y_ALIGNED:
|
||||
r = (p->row_size+AVS_FRAME_ALIGN-1)&(~(AVS_FRAME_ALIGN-1)); // Aligned rowsize
|
||||
if (r <= p->pitch)
|
||||
return r;
|
||||
return p->row_size;
|
||||
}
|
||||
return p->row_size;
|
||||
}
|
||||
|
||||
AVSC_INLINE int avs_is_yv12_25(const AVS_VideoInfo * p)
|
||||
{ return ((p->pixel_type & AVS_CS_YV12_25) == AVS_CS_YV12_25)||((p->pixel_type & AVS_CS_I420_25) == AVS_CS_I420_25); }
|
||||
@@ -1,727 +0,0 @@
|
||||
// Avisynth C Interface Version 0.20
|
||||
// Copyright 2003 Kevin Atkinson
|
||||
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit
|
||||
// http://www.gnu.org/copyleft/gpl.html .
|
||||
//
|
||||
// As a special exception, I give you permission to link to the
|
||||
// Avisynth C interface with independent modules that communicate with
|
||||
// the Avisynth C interface solely through the interfaces defined in
|
||||
// avisynth_c.h, regardless of the license terms of these independent
|
||||
// modules, and to copy and distribute the resulting combined work
|
||||
// under terms of your choice, provided that every copy of the
|
||||
// combined work is accompanied by a complete copy of the source code
|
||||
// of the Avisynth C interface and Avisynth itself (with the version
|
||||
// used to produce the combined work), being distributed under the
|
||||
// terms of the GNU General Public License plus this exception. An
|
||||
// independent module is a module which is not derived from or based
|
||||
// on Avisynth C Interface, such as 3rd-party filters, import and
|
||||
// export plugins, or graphical user interfaces.
|
||||
|
||||
#ifndef __AVXSYNTH_C__
|
||||
#define __AVXSYNTH_C__
|
||||
|
||||
#include "windowsPorts/windows2linux.h"
|
||||
#include <stdarg.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
# define EXTERN_C extern "C"
|
||||
#else
|
||||
# define EXTERN_C
|
||||
#endif
|
||||
|
||||
#define AVSC_USE_STDCALL 1
|
||||
|
||||
#ifndef AVSC_USE_STDCALL
|
||||
# define AVSC_CC __cdecl
|
||||
#else
|
||||
# define AVSC_CC __stdcall
|
||||
#endif
|
||||
|
||||
#define AVSC_INLINE static __inline
|
||||
|
||||
#ifdef AVISYNTH_C_EXPORTS
|
||||
# define AVSC_EXPORT EXTERN_C
|
||||
# define AVSC_API(ret, name) EXTERN_C __declspec(dllexport) ret AVSC_CC name
|
||||
#else
|
||||
# define AVSC_EXPORT EXTERN_C __declspec(dllexport)
|
||||
# ifndef AVSC_NO_DECLSPEC
|
||||
# define AVSC_API(ret, name) EXTERN_C __declspec(dllimport) ret AVSC_CC name
|
||||
# else
|
||||
# define AVSC_API(ret, name) typedef ret (AVSC_CC *name##_func)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
typedef long long int INT64;
|
||||
#else
|
||||
typedef __int64 INT64;
|
||||
#endif
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Constants
|
||||
//
|
||||
|
||||
#ifndef __AVXSYNTH_H__
|
||||
enum { AVISYNTH_INTERFACE_VERSION = 3 };
|
||||
#endif
|
||||
|
||||
enum {AVS_SAMPLE_INT8 = 1<<0,
|
||||
AVS_SAMPLE_INT16 = 1<<1,
|
||||
AVS_SAMPLE_INT24 = 1<<2,
|
||||
AVS_SAMPLE_INT32 = 1<<3,
|
||||
AVS_SAMPLE_FLOAT = 1<<4};
|
||||
|
||||
enum {AVS_PLANAR_Y=1<<0,
|
||||
AVS_PLANAR_U=1<<1,
|
||||
AVS_PLANAR_V=1<<2,
|
||||
AVS_PLANAR_ALIGNED=1<<3,
|
||||
AVS_PLANAR_Y_ALIGNED=AVS_PLANAR_Y|AVS_PLANAR_ALIGNED,
|
||||
AVS_PLANAR_U_ALIGNED=AVS_PLANAR_U|AVS_PLANAR_ALIGNED,
|
||||
AVS_PLANAR_V_ALIGNED=AVS_PLANAR_V|AVS_PLANAR_ALIGNED};
|
||||
|
||||
// Colorspace properties.
|
||||
enum {AVS_CS_BGR = 1<<28,
|
||||
AVS_CS_YUV = 1<<29,
|
||||
AVS_CS_INTERLEAVED = 1<<30,
|
||||
AVS_CS_PLANAR = 1<<31};
|
||||
|
||||
// Specific colorformats
|
||||
enum {
|
||||
AVS_CS_UNKNOWN = 0,
|
||||
AVS_CS_BGR24 = 1<<0 | AVS_CS_BGR | AVS_CS_INTERLEAVED,
|
||||
AVS_CS_BGR32 = 1<<1 | AVS_CS_BGR | AVS_CS_INTERLEAVED,
|
||||
AVS_CS_YUY2 = 1<<2 | AVS_CS_YUV | AVS_CS_INTERLEAVED,
|
||||
AVS_CS_YV12 = 1<<3 | AVS_CS_YUV | AVS_CS_PLANAR, // y-v-u, planar
|
||||
AVS_CS_I420 = 1<<4 | AVS_CS_YUV | AVS_CS_PLANAR, // y-u-v, planar
|
||||
AVS_CS_IYUV = 1<<4 | AVS_CS_YUV | AVS_CS_PLANAR // same as above
|
||||
};
|
||||
|
||||
enum {
|
||||
AVS_IT_BFF = 1<<0,
|
||||
AVS_IT_TFF = 1<<1,
|
||||
AVS_IT_FIELDBASED = 1<<2};
|
||||
|
||||
enum {
|
||||
AVS_FILTER_TYPE=1,
|
||||
AVS_FILTER_INPUT_COLORSPACE=2,
|
||||
AVS_FILTER_OUTPUT_TYPE=9,
|
||||
AVS_FILTER_NAME=4,
|
||||
AVS_FILTER_AUTHOR=5,
|
||||
AVS_FILTER_VERSION=6,
|
||||
AVS_FILTER_ARGS=7,
|
||||
AVS_FILTER_ARGS_INFO=8,
|
||||
AVS_FILTER_ARGS_DESCRIPTION=10,
|
||||
AVS_FILTER_DESCRIPTION=11};
|
||||
|
||||
enum { //SUBTYPES
|
||||
AVS_FILTER_TYPE_AUDIO=1,
|
||||
AVS_FILTER_TYPE_VIDEO=2,
|
||||
AVS_FILTER_OUTPUT_TYPE_SAME=3,
|
||||
AVS_FILTER_OUTPUT_TYPE_DIFFERENT=4};
|
||||
|
||||
enum {
|
||||
AVS_CACHE_NOTHING=0,
|
||||
AVS_CACHE_RANGE=1,
|
||||
AVS_CACHE_ALL=2,
|
||||
AVS_CACHE_AUDIO=3,
|
||||
AVS_CACHE_AUDIO_NONE=4,
|
||||
AVS_CACHE_AUDIO_AUTO=5
|
||||
};
|
||||
|
||||
#define AVS_FRAME_ALIGN 16
|
||||
|
||||
typedef struct AVS_Clip AVS_Clip;
|
||||
typedef struct AVS_ScriptEnvironment AVS_ScriptEnvironment;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// AVS_VideoInfo
|
||||
//
|
||||
|
||||
// AVS_VideoInfo is layed out identicly to VideoInfo
|
||||
typedef struct AVS_VideoInfo {
|
||||
int width, height; // width=0 means no video
|
||||
unsigned fps_numerator, fps_denominator;
|
||||
int num_frames;
|
||||
|
||||
int pixel_type;
|
||||
|
||||
int audio_samples_per_second; // 0 means no audio
|
||||
int sample_type;
|
||||
INT64 num_audio_samples;
|
||||
int nchannels;
|
||||
|
||||
// Imagetype properties
|
||||
|
||||
int image_type;
|
||||
} AVS_VideoInfo;
|
||||
|
||||
// useful functions of the above
|
||||
AVSC_INLINE int avs_has_video(const AVS_VideoInfo * p)
|
||||
{ return (p->width!=0); }
|
||||
|
||||
AVSC_INLINE int avs_has_audio(const AVS_VideoInfo * p)
|
||||
{ return (p->audio_samples_per_second!=0); }
|
||||
|
||||
AVSC_INLINE int avs_is_rgb(const AVS_VideoInfo * p)
|
||||
{ return !!(p->pixel_type&AVS_CS_BGR); }
|
||||
|
||||
AVSC_INLINE int avs_is_rgb24(const AVS_VideoInfo * p)
|
||||
{ return (p->pixel_type&AVS_CS_BGR24)==AVS_CS_BGR24; } // Clear out additional properties
|
||||
|
||||
AVSC_INLINE int avs_is_rgb32(const AVS_VideoInfo * p)
|
||||
{ return (p->pixel_type & AVS_CS_BGR32) == AVS_CS_BGR32 ; }
|
||||
|
||||
AVSC_INLINE int avs_is_yuv(const AVS_VideoInfo * p)
|
||||
{ return !!(p->pixel_type&AVS_CS_YUV ); }
|
||||
|
||||
AVSC_INLINE int avs_is_yuy2(const AVS_VideoInfo * p)
|
||||
{ return (p->pixel_type & AVS_CS_YUY2) == AVS_CS_YUY2; }
|
||||
|
||||
AVSC_INLINE int avs_is_yv12(const AVS_VideoInfo * p)
|
||||
{ return ((p->pixel_type & AVS_CS_YV12) == AVS_CS_YV12)||((p->pixel_type & AVS_CS_I420) == AVS_CS_I420); }
|
||||
|
||||
AVSC_INLINE int avs_is_color_space(const AVS_VideoInfo * p, int c_space)
|
||||
{ return ((p->pixel_type & c_space) == c_space); }
|
||||
|
||||
AVSC_INLINE int avs_is_property(const AVS_VideoInfo * p, int property)
|
||||
{ return ((p->pixel_type & property)==property ); }
|
||||
|
||||
AVSC_INLINE int avs_is_planar(const AVS_VideoInfo * p)
|
||||
{ return !!(p->pixel_type & AVS_CS_PLANAR); }
|
||||
|
||||
AVSC_INLINE int avs_is_field_based(const AVS_VideoInfo * p)
|
||||
{ return !!(p->image_type & AVS_IT_FIELDBASED); }
|
||||
|
||||
AVSC_INLINE int avs_is_parity_known(const AVS_VideoInfo * p)
|
||||
{ return ((p->image_type & AVS_IT_FIELDBASED)&&(p->image_type & (AVS_IT_BFF | AVS_IT_TFF))); }
|
||||
|
||||
AVSC_INLINE int avs_is_bff(const AVS_VideoInfo * p)
|
||||
{ return !!(p->image_type & AVS_IT_BFF); }
|
||||
|
||||
AVSC_INLINE int avs_is_tff(const AVS_VideoInfo * p)
|
||||
{ return !!(p->image_type & AVS_IT_TFF); }
|
||||
|
||||
AVSC_INLINE int avs_bits_per_pixel(const AVS_VideoInfo * p)
|
||||
{
|
||||
switch (p->pixel_type) {
|
||||
case AVS_CS_BGR24: return 24;
|
||||
case AVS_CS_BGR32: return 32;
|
||||
case AVS_CS_YUY2: return 16;
|
||||
case AVS_CS_YV12:
|
||||
case AVS_CS_I420: return 12;
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
AVSC_INLINE int avs_bytes_from_pixels(const AVS_VideoInfo * p, int pixels)
|
||||
{ return pixels * (avs_bits_per_pixel(p)>>3); } // Will work on planar images, but will return only luma planes
|
||||
|
||||
AVSC_INLINE int avs_row_size(const AVS_VideoInfo * p)
|
||||
{ return avs_bytes_from_pixels(p,p->width); } // Also only returns first plane on planar images
|
||||
|
||||
AVSC_INLINE int avs_bmp_size(const AVS_VideoInfo * vi)
|
||||
{ if (avs_is_planar(vi)) {int p = vi->height * ((avs_row_size(vi)+3) & ~3); p+=p>>1; return p; } return vi->height * ((avs_row_size(vi)+3) & ~3); }
|
||||
|
||||
AVSC_INLINE int avs_samples_per_second(const AVS_VideoInfo * p)
|
||||
{ return p->audio_samples_per_second; }
|
||||
|
||||
|
||||
AVSC_INLINE int avs_bytes_per_channel_sample(const AVS_VideoInfo * p)
|
||||
{
|
||||
switch (p->sample_type) {
|
||||
case AVS_SAMPLE_INT8: return sizeof(signed char);
|
||||
case AVS_SAMPLE_INT16: return sizeof(signed short);
|
||||
case AVS_SAMPLE_INT24: return 3;
|
||||
case AVS_SAMPLE_INT32: return sizeof(signed int);
|
||||
case AVS_SAMPLE_FLOAT: return sizeof(float);
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
AVSC_INLINE int avs_bytes_per_audio_sample(const AVS_VideoInfo * p)
|
||||
{ return p->nchannels*avs_bytes_per_channel_sample(p);}
|
||||
|
||||
AVSC_INLINE INT64 avs_audio_samples_from_frames(const AVS_VideoInfo * p, INT64 frames)
|
||||
{ return ((INT64)(frames) * p->audio_samples_per_second * p->fps_denominator / p->fps_numerator); }
|
||||
|
||||
AVSC_INLINE int avs_frames_from_audio_samples(const AVS_VideoInfo * p, INT64 samples)
|
||||
{ return (int)(samples * (INT64)p->fps_numerator / (INT64)p->fps_denominator / (INT64)p->audio_samples_per_second); }
|
||||
|
||||
AVSC_INLINE INT64 avs_audio_samples_from_bytes(const AVS_VideoInfo * p, INT64 bytes)
|
||||
{ return bytes / avs_bytes_per_audio_sample(p); }
|
||||
|
||||
AVSC_INLINE INT64 avs_bytes_from_audio_samples(const AVS_VideoInfo * p, INT64 samples)
|
||||
{ return samples * avs_bytes_per_audio_sample(p); }
|
||||
|
||||
AVSC_INLINE int avs_audio_channels(const AVS_VideoInfo * p)
|
||||
{ return p->nchannels; }
|
||||
|
||||
AVSC_INLINE int avs_sample_type(const AVS_VideoInfo * p)
|
||||
{ return p->sample_type;}
|
||||
|
||||
// useful mutator
|
||||
AVSC_INLINE void avs_set_property(AVS_VideoInfo * p, int property)
|
||||
{ p->image_type|=property; }
|
||||
|
||||
AVSC_INLINE void avs_clear_property(AVS_VideoInfo * p, int property)
|
||||
{ p->image_type&=~property; }
|
||||
|
||||
AVSC_INLINE void avs_set_field_based(AVS_VideoInfo * p, int isfieldbased)
|
||||
{ if (isfieldbased) p->image_type|=AVS_IT_FIELDBASED; else p->image_type&=~AVS_IT_FIELDBASED; }
|
||||
|
||||
AVSC_INLINE void avs_set_fps(AVS_VideoInfo * p, unsigned numerator, unsigned denominator)
|
||||
{
|
||||
unsigned x=numerator, y=denominator;
|
||||
while (y) { // find gcd
|
||||
unsigned t = x%y; x = y; y = t;
|
||||
}
|
||||
p->fps_numerator = numerator/x;
|
||||
p->fps_denominator = denominator/x;
|
||||
}
|
||||
|
||||
AVSC_INLINE int avs_is_same_colorspace(AVS_VideoInfo * x, AVS_VideoInfo * y)
|
||||
{
|
||||
return (x->pixel_type == y->pixel_type)
|
||||
|| (avs_is_yv12(x) && avs_is_yv12(y));
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// AVS_VideoFrame
|
||||
//
|
||||
|
||||
// VideoFrameBuffer holds information about a memory block which is used
|
||||
// for video data. For efficiency, instances of this class are not deleted
|
||||
// when the refcount reaches zero; instead they're stored in a linked list
|
||||
// to be reused. The instances are deleted when the corresponding AVS
|
||||
// file is closed.
|
||||
|
||||
// AVS_VideoFrameBuffer is layed out identicly to VideoFrameBuffer
|
||||
// DO NOT USE THIS STRUCTURE DIRECTLY
|
||||
typedef struct AVS_VideoFrameBuffer {
|
||||
unsigned char * data;
|
||||
int data_size;
|
||||
// sequence_number is incremented every time the buffer is changed, so
|
||||
// that stale views can tell they're no longer valid.
|
||||
long sequence_number;
|
||||
|
||||
long refcount;
|
||||
} AVS_VideoFrameBuffer;
|
||||
|
||||
// VideoFrame holds a "window" into a VideoFrameBuffer.
|
||||
|
||||
// AVS_VideoFrame is layed out identicly to IVideoFrame
|
||||
// DO NOT USE THIS STRUCTURE DIRECTLY
|
||||
typedef struct AVS_VideoFrame {
|
||||
int refcount;
|
||||
AVS_VideoFrameBuffer * vfb;
|
||||
int offset, pitch, row_size, height, offsetU, offsetV, pitchUV; // U&V offsets are from top of picture.
|
||||
} AVS_VideoFrame;
|
||||
|
||||
// Access functions for AVS_VideoFrame
|
||||
AVSC_INLINE int avs_get_pitch(const AVS_VideoFrame * p) {
|
||||
return p->pitch;}
|
||||
|
||||
AVSC_INLINE int avs_get_pitch_p(const AVS_VideoFrame * p, int plane) {
|
||||
switch (plane) {
|
||||
case AVS_PLANAR_U: case AVS_PLANAR_V: return p->pitchUV;}
|
||||
return p->pitch;}
|
||||
|
||||
AVSC_INLINE int avs_get_row_size(const AVS_VideoFrame * p) {
|
||||
return p->row_size; }
|
||||
|
||||
AVSC_INLINE int avs_get_row_size_p(const AVS_VideoFrame * p, int plane) {
|
||||
int r;
|
||||
switch (plane) {
|
||||
case AVS_PLANAR_U: case AVS_PLANAR_V:
|
||||
if (p->pitchUV) return p->row_size>>1;
|
||||
else return 0;
|
||||
case AVS_PLANAR_U_ALIGNED: case AVS_PLANAR_V_ALIGNED:
|
||||
if (p->pitchUV) {
|
||||
r = ((p->row_size+AVS_FRAME_ALIGN-1)&(~(AVS_FRAME_ALIGN-1)) )>>1; // Aligned rowsize
|
||||
if (r < p->pitchUV)
|
||||
return r;
|
||||
return p->row_size>>1;
|
||||
} else return 0;
|
||||
case AVS_PLANAR_Y_ALIGNED:
|
||||
r = (p->row_size+AVS_FRAME_ALIGN-1)&(~(AVS_FRAME_ALIGN-1)); // Aligned rowsize
|
||||
if (r <= p->pitch)
|
||||
return r;
|
||||
return p->row_size;
|
||||
}
|
||||
return p->row_size;
|
||||
}
|
||||
|
||||
AVSC_INLINE int avs_get_height(const AVS_VideoFrame * p) {
|
||||
return p->height;}
|
||||
|
||||
AVSC_INLINE int avs_get_height_p(const AVS_VideoFrame * p, int plane) {
|
||||
switch (plane) {
|
||||
case AVS_PLANAR_U: case AVS_PLANAR_V:
|
||||
if (p->pitchUV) return p->height>>1;
|
||||
return 0;
|
||||
}
|
||||
return p->height;}
|
||||
|
||||
AVSC_INLINE const unsigned char* avs_get_read_ptr(const AVS_VideoFrame * p) {
|
||||
return p->vfb->data + p->offset;}
|
||||
|
||||
AVSC_INLINE const unsigned char* avs_get_read_ptr_p(const AVS_VideoFrame * p, int plane)
|
||||
{
|
||||
switch (plane) {
|
||||
case AVS_PLANAR_U: return p->vfb->data + p->offsetU;
|
||||
case AVS_PLANAR_V: return p->vfb->data + p->offsetV;
|
||||
default: return p->vfb->data + p->offset;}
|
||||
}
|
||||
|
||||
AVSC_INLINE int avs_is_writable(const AVS_VideoFrame * p) {
|
||||
return (p->refcount == 1 && p->vfb->refcount == 1);}
|
||||
|
||||
AVSC_INLINE unsigned char* avs_get_write_ptr(const AVS_VideoFrame * p)
|
||||
{
|
||||
if (avs_is_writable(p)) {
|
||||
++p->vfb->sequence_number;
|
||||
return p->vfb->data + p->offset;
|
||||
} else
|
||||
return 0;
|
||||
}
|
||||
|
||||
AVSC_INLINE unsigned char* avs_get_write_ptr_p(const AVS_VideoFrame * p, int plane)
|
||||
{
|
||||
if (plane==AVS_PLANAR_Y && avs_is_writable(p)) {
|
||||
++p->vfb->sequence_number;
|
||||
return p->vfb->data + p->offset;
|
||||
} else if (plane==AVS_PLANAR_Y) {
|
||||
return 0;
|
||||
} else {
|
||||
switch (plane) {
|
||||
case AVS_PLANAR_U: return p->vfb->data + p->offsetU;
|
||||
case AVS_PLANAR_V: return p->vfb->data + p->offsetV;
|
||||
default: return p->vfb->data + p->offset;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if defined __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif // __cplusplus
|
||||
AVSC_API(void, avs_release_video_frame)(AVS_VideoFrame *);
|
||||
// makes a shallow copy of a video frame
|
||||
AVSC_API(AVS_VideoFrame *, avs_copy_video_frame)(AVS_VideoFrame *);
|
||||
#if defined __cplusplus
|
||||
}
|
||||
#endif // __cplusplus
|
||||
|
||||
#ifndef AVSC_NO_DECLSPEC
|
||||
AVSC_INLINE void avs_release_frame(AVS_VideoFrame * f)
|
||||
{avs_release_video_frame(f);}
|
||||
AVSC_INLINE AVS_VideoFrame * avs_copy_frame(AVS_VideoFrame * f)
|
||||
{return avs_copy_video_frame(f);}
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// AVS_Value
|
||||
//
|
||||
|
||||
// Treat AVS_Value as a fat pointer. That is use avs_copy_value
|
||||
// and avs_release_value appropiaty as you would if AVS_Value was
|
||||
// a pointer.
|
||||
|
||||
// To maintain source code compatibility with future versions of the
|
||||
// avisynth_c API don't use the AVS_Value directly. Use the helper
|
||||
// functions below.
|
||||
|
||||
// AVS_Value is layed out identicly to AVSValue
|
||||
typedef struct AVS_Value AVS_Value;
|
||||
struct AVS_Value {
|
||||
short type; // 'a'rray, 'c'lip, 'b'ool, 'i'nt, 'f'loat, 's'tring, 'v'oid, or 'l'ong
|
||||
// for some function e'rror
|
||||
short array_size;
|
||||
union {
|
||||
void * clip; // do not use directly, use avs_take_clip
|
||||
char boolean;
|
||||
int integer;
|
||||
INT64 integer64; // match addition of __int64 to avxplugin.h
|
||||
float floating_pt;
|
||||
const char * string;
|
||||
const AVS_Value * array;
|
||||
} d;
|
||||
};
|
||||
|
||||
// AVS_Value should be initilized with avs_void.
|
||||
// Should also set to avs_void after the value is released
|
||||
// with avs_copy_value. Consider it the equalvent of setting
|
||||
// a pointer to NULL
|
||||
static const AVS_Value avs_void = {'v'};
|
||||
|
||||
AVSC_API(void, avs_copy_value)(AVS_Value * dest, AVS_Value src);
|
||||
AVSC_API(void, avs_release_value)(AVS_Value);
|
||||
|
||||
AVSC_INLINE int avs_defined(AVS_Value v) { return v.type != 'v'; }
|
||||
AVSC_INLINE int avs_is_clip(AVS_Value v) { return v.type == 'c'; }
|
||||
AVSC_INLINE int avs_is_bool(AVS_Value v) { return v.type == 'b'; }
|
||||
AVSC_INLINE int avs_is_int(AVS_Value v) { return v.type == 'i'; }
|
||||
AVSC_INLINE int avs_is_float(AVS_Value v) { return v.type == 'f' || v.type == 'i'; }
|
||||
AVSC_INLINE int avs_is_string(AVS_Value v) { return v.type == 's'; }
|
||||
AVSC_INLINE int avs_is_array(AVS_Value v) { return v.type == 'a'; }
|
||||
AVSC_INLINE int avs_is_error(AVS_Value v) { return v.type == 'e'; }
|
||||
|
||||
#if defined __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif // __cplusplus
|
||||
AVSC_API(AVS_Clip *, avs_take_clip)(AVS_Value, AVS_ScriptEnvironment *);
|
||||
AVSC_API(void, avs_set_to_clip)(AVS_Value *, AVS_Clip *);
|
||||
#if defined __cplusplus
|
||||
}
|
||||
#endif // __cplusplus
|
||||
|
||||
AVSC_INLINE int avs_as_bool(AVS_Value v)
|
||||
{ return v.d.boolean; }
|
||||
AVSC_INLINE int avs_as_int(AVS_Value v)
|
||||
{ return v.d.integer; }
|
||||
AVSC_INLINE const char * avs_as_string(AVS_Value v)
|
||||
{ return avs_is_error(v) || avs_is_string(v) ? v.d.string : 0; }
|
||||
AVSC_INLINE double avs_as_float(AVS_Value v)
|
||||
{ return avs_is_int(v) ? v.d.integer : v.d.floating_pt; }
|
||||
AVSC_INLINE const char * avs_as_error(AVS_Value v)
|
||||
{ return avs_is_error(v) ? v.d.string : 0; }
|
||||
AVSC_INLINE const AVS_Value * avs_as_array(AVS_Value v)
|
||||
{ return v.d.array; }
|
||||
AVSC_INLINE int avs_array_size(AVS_Value v)
|
||||
{ return avs_is_array(v) ? v.array_size : 1; }
|
||||
AVSC_INLINE AVS_Value avs_array_elt(AVS_Value v, int index)
|
||||
{ return avs_is_array(v) ? v.d.array[index] : v; }
|
||||
|
||||
// only use these functions on am AVS_Value that does not already have
|
||||
// an active value. Remember, treat AVS_Value as a fat pointer.
|
||||
AVSC_INLINE AVS_Value avs_new_value_bool(int v0)
|
||||
{ AVS_Value v; v.type = 'b'; v.d.boolean = v0 == 0 ? 0 : 1; return v; }
|
||||
AVSC_INLINE AVS_Value avs_new_value_int(int v0)
|
||||
{ AVS_Value v; v.type = 'i'; v.d.integer = v0; return v; }
|
||||
AVSC_INLINE AVS_Value avs_new_value_string(const char * v0)
|
||||
{ AVS_Value v; v.type = 's'; v.d.string = v0; return v; }
|
||||
AVSC_INLINE AVS_Value avs_new_value_float(float v0)
|
||||
{ AVS_Value v; v.type = 'f'; v.d.floating_pt = v0; return v;}
|
||||
AVSC_INLINE AVS_Value avs_new_value_error(const char * v0)
|
||||
{ AVS_Value v; v.type = 'e'; v.d.string = v0; return v; }
|
||||
#ifndef AVSC_NO_DECLSPEC
|
||||
AVSC_INLINE AVS_Value avs_new_value_clip(AVS_Clip * v0)
|
||||
{ AVS_Value v; avs_set_to_clip(&v, v0); return v; }
|
||||
#endif
|
||||
AVSC_INLINE AVS_Value avs_new_value_array(AVS_Value * v0, int size)
|
||||
{ AVS_Value v; v.type = 'a'; v.d.array = v0; v.array_size = size; return v; }
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// AVS_Clip
|
||||
//
|
||||
#if defined __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif // __cplusplus
|
||||
AVSC_API(void, avs_release_clip)(AVS_Clip *);
|
||||
AVSC_API(AVS_Clip *, avs_copy_clip)(AVS_Clip *);
|
||||
|
||||
AVSC_API(const char *, avs_clip_get_error)(AVS_Clip *); // return 0 if no error
|
||||
|
||||
AVSC_API(const AVS_VideoInfo *, avs_get_video_info)(AVS_Clip *);
|
||||
|
||||
AVSC_API(int, avs_get_version)(AVS_Clip *);
|
||||
|
||||
AVSC_API(AVS_VideoFrame *, avs_get_frame)(AVS_Clip *, int n);
|
||||
// The returned video frame must be released with avs_release_video_frame
|
||||
|
||||
AVSC_API(int, avs_get_parity)(AVS_Clip *, int n);
|
||||
// return field parity if field_based, else parity of first field in frame
|
||||
|
||||
AVSC_API(int, avs_get_audio)(AVS_Clip *, void * buf,
|
||||
INT64 start, INT64 count);
|
||||
// start and count are in samples
|
||||
|
||||
AVSC_API(int, avs_set_cache_hints)(AVS_Clip *,
|
||||
int cachehints, size_t frame_range);
|
||||
#if defined __cplusplus
|
||||
}
|
||||
#endif // __cplusplus
|
||||
|
||||
// This is the callback type used by avs_add_function
|
||||
typedef AVS_Value (AVSC_CC * AVS_ApplyFunc)
|
||||
(AVS_ScriptEnvironment *, AVS_Value args, void * user_data);
|
||||
|
||||
typedef struct AVS_FilterInfo AVS_FilterInfo;
|
||||
struct AVS_FilterInfo
|
||||
{
|
||||
// these members should not be modified outside of the AVS_ApplyFunc callback
|
||||
AVS_Clip * child;
|
||||
AVS_VideoInfo vi;
|
||||
AVS_ScriptEnvironment * env;
|
||||
AVS_VideoFrame * (AVSC_CC * get_frame)(AVS_FilterInfo *, int n);
|
||||
int (AVSC_CC * get_parity)(AVS_FilterInfo *, int n);
|
||||
int (AVSC_CC * get_audio)(AVS_FilterInfo *, void * buf,
|
||||
INT64 start, INT64 count);
|
||||
int (AVSC_CC * set_cache_hints)(AVS_FilterInfo *, int cachehints,
|
||||
int frame_range);
|
||||
void (AVSC_CC * free_filter)(AVS_FilterInfo *);
|
||||
|
||||
// Should be set when ever there is an error to report.
|
||||
// It is cleared before any of the above methods are called
|
||||
const char * error;
|
||||
// this is to store whatever and may be modified at will
|
||||
void * user_data;
|
||||
};
|
||||
|
||||
// Create a new filter
|
||||
// fi is set to point to the AVS_FilterInfo so that you can
|
||||
// modify it once it is initilized.
|
||||
// store_child should generally be set to true. If it is not
|
||||
// set than ALL methods (the function pointers) must be defined
|
||||
// If it is set than you do not need to worry about freeing the child
|
||||
// clip.
|
||||
#if defined __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif // __cplusplus
|
||||
AVSC_API(AVS_Clip *, avs_new_c_filter)(AVS_ScriptEnvironment * e,
|
||||
AVS_FilterInfo * * fi,
|
||||
AVS_Value child, int store_child);
|
||||
#if defined __cplusplus
|
||||
}
|
||||
#endif // __cplusplus
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// AVS_ScriptEnvironment
|
||||
//
|
||||
|
||||
// For GetCPUFlags. These are backwards-compatible with those in VirtualDub.
|
||||
enum {
|
||||
/* slowest CPU to support extension */
|
||||
AVS_CPU_FORCE = 0x01, // N/A
|
||||
AVS_CPU_FPU = 0x02, // 386/486DX
|
||||
AVS_CPU_MMX = 0x04, // P55C, K6, PII
|
||||
AVS_CPU_INTEGER_SSE = 0x08, // PIII, Athlon
|
||||
AVS_CPU_SSE = 0x10, // PIII, Athlon XP/MP
|
||||
AVS_CPU_SSE2 = 0x20, // PIV, Hammer
|
||||
AVS_CPU_3DNOW = 0x40, // K6-2
|
||||
AVS_CPU_3DNOW_EXT = 0x80, // Athlon
|
||||
AVS_CPU_X86_64 = 0xA0, // Hammer (note: equiv. to 3DNow + SSE2,
|
||||
// which only Hammer will have anyway)
|
||||
};
|
||||
|
||||
#if defined __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif // __cplusplus
|
||||
AVSC_API(const char *, avs_get_error)(AVS_ScriptEnvironment *); // return 0 if no error
|
||||
|
||||
AVSC_API(long, avs_get_cpu_flags)(AVS_ScriptEnvironment *);
|
||||
AVSC_API(int, avs_check_version)(AVS_ScriptEnvironment *, int version);
|
||||
|
||||
AVSC_API(char *, avs_save_string)(AVS_ScriptEnvironment *, const char* s, int length);
|
||||
AVSC_API(char *, avs_sprintf)(AVS_ScriptEnvironment *, const char * fmt, ...);
|
||||
|
||||
AVSC_API(char *, avs_vsprintf)(AVS_ScriptEnvironment *, const char * fmt, va_list val);
|
||||
// note: val is really a va_list; I hope everyone typedefs va_list to a pointer
|
||||
|
||||
AVSC_API(int, avs_add_function)(AVS_ScriptEnvironment *,
|
||||
const char * name, const char * params,
|
||||
AVS_ApplyFunc apply, void * user_data);
|
||||
|
||||
AVSC_API(int, avs_function_exists)(AVS_ScriptEnvironment *, const char * name);
|
||||
|
||||
AVSC_API(AVS_Value, avs_invoke)(AVS_ScriptEnvironment *, const char * name,
|
||||
AVS_Value args, const char** arg_names);
|
||||
// The returned value must be be released with avs_release_value
|
||||
|
||||
AVSC_API(AVS_Value, avs_get_var)(AVS_ScriptEnvironment *, const char* name);
|
||||
// The returned value must be be released with avs_release_value
|
||||
|
||||
AVSC_API(int, avs_set_var)(AVS_ScriptEnvironment *, const char* name, AVS_Value val);
|
||||
|
||||
AVSC_API(int, avs_set_global_var)(AVS_ScriptEnvironment *, const char* name, const AVS_Value val);
|
||||
|
||||
//void avs_push_context(AVS_ScriptEnvironment *, int level=0);
|
||||
//void avs_pop_context(AVS_ScriptEnvironment *);
|
||||
|
||||
AVSC_API(AVS_VideoFrame *, avs_new_video_frame_a)(AVS_ScriptEnvironment *,
|
||||
const AVS_VideoInfo * vi, int align);
|
||||
// align should be at least 16
|
||||
#if defined __cplusplus
|
||||
}
|
||||
#endif // __cplusplus
|
||||
|
||||
#ifndef AVSC_NO_DECLSPEC
|
||||
AVSC_INLINE
|
||||
AVS_VideoFrame * avs_new_video_frame(AVS_ScriptEnvironment * env,
|
||||
const AVS_VideoInfo * vi)
|
||||
{return avs_new_video_frame_a(env,vi,AVS_FRAME_ALIGN);}
|
||||
|
||||
AVSC_INLINE
|
||||
AVS_VideoFrame * avs_new_frame(AVS_ScriptEnvironment * env,
|
||||
const AVS_VideoInfo * vi)
|
||||
{return avs_new_video_frame_a(env,vi,AVS_FRAME_ALIGN);}
|
||||
#endif
|
||||
|
||||
#if defined __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif // __cplusplus
|
||||
AVSC_API(int, avs_make_writable)(AVS_ScriptEnvironment *, AVS_VideoFrame * * pvf);
|
||||
|
||||
AVSC_API(void, avs_bit_blt)(AVS_ScriptEnvironment *, unsigned char* dstp, int dst_pitch, const unsigned char* srcp, int src_pitch, int row_size, int height);
|
||||
|
||||
typedef void (AVSC_CC *AVS_ShutdownFunc)(void* user_data, AVS_ScriptEnvironment * env);
|
||||
AVSC_API(void, avs_at_exit)(AVS_ScriptEnvironment *, AVS_ShutdownFunc function, void * user_data);
|
||||
|
||||
AVSC_API(AVS_VideoFrame *, avs_subframe)(AVS_ScriptEnvironment *, AVS_VideoFrame * src, int rel_offset, int new_pitch, int new_row_size, int new_height);
|
||||
// The returned video frame must be be released
|
||||
|
||||
AVSC_API(int, avs_set_memory_max)(AVS_ScriptEnvironment *, int mem);
|
||||
|
||||
AVSC_API(int, avs_set_working_dir)(AVS_ScriptEnvironment *, const char * newdir);
|
||||
|
||||
// avisynth.dll exports this; it's a way to use it as a library, without
|
||||
// writing an AVS script or without going through AVIFile.
|
||||
AVSC_API(AVS_ScriptEnvironment *, avs_create_script_environment)(int version);
|
||||
#if defined __cplusplus
|
||||
}
|
||||
#endif // __cplusplus
|
||||
|
||||
// this symbol is the entry point for the plugin and must
|
||||
// be defined
|
||||
AVSC_EXPORT
|
||||
const char * AVSC_CC avisynth_c_plugin_init(AVS_ScriptEnvironment* env);
|
||||
|
||||
|
||||
#if defined __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif // __cplusplus
|
||||
AVSC_API(void, avs_delete_script_environment)(AVS_ScriptEnvironment *);
|
||||
|
||||
|
||||
AVSC_API(AVS_VideoFrame *, avs_subframe_planar)(AVS_ScriptEnvironment *, AVS_VideoFrame * src, int rel_offset, int new_pitch, int new_row_size, int new_height, int rel_offsetU, int rel_offsetV, int new_pitchUV);
|
||||
// The returned video frame must be be released
|
||||
#if defined __cplusplus
|
||||
}
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif //__AVXSYNTH_C__
|
||||
@@ -1,85 +0,0 @@
|
||||
#ifndef __DATA_TYPE_CONVERSIONS_H__
|
||||
#define __DATA_TYPE_CONVERSIONS_H__
|
||||
|
||||
#include <stdint.h>
|
||||
#include <wchar.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
namespace avxsynth {
|
||||
#endif // __cplusplus
|
||||
|
||||
typedef int64_t __int64;
|
||||
typedef int32_t __int32;
|
||||
#ifdef __cplusplus
|
||||
typedef bool BOOL;
|
||||
#else
|
||||
typedef uint32_t BOOL;
|
||||
#endif // __cplusplus
|
||||
typedef void* HMODULE;
|
||||
typedef void* LPVOID;
|
||||
typedef void* PVOID;
|
||||
typedef PVOID HANDLE;
|
||||
typedef HANDLE HWND;
|
||||
typedef HANDLE HINSTANCE;
|
||||
typedef void* HDC;
|
||||
typedef void* HBITMAP;
|
||||
typedef void* HICON;
|
||||
typedef void* HFONT;
|
||||
typedef void* HGDIOBJ;
|
||||
typedef void* HBRUSH;
|
||||
typedef void* HMMIO;
|
||||
typedef void* HACMSTREAM;
|
||||
typedef void* HACMDRIVER;
|
||||
typedef void* HIC;
|
||||
typedef void* HACMOBJ;
|
||||
typedef HACMSTREAM* LPHACMSTREAM;
|
||||
typedef void* HACMDRIVERID;
|
||||
typedef void* LPHACMDRIVER;
|
||||
typedef unsigned char BYTE;
|
||||
typedef BYTE* LPBYTE;
|
||||
typedef char TCHAR;
|
||||
typedef TCHAR* LPTSTR;
|
||||
typedef const TCHAR* LPCTSTR;
|
||||
typedef char* LPSTR;
|
||||
typedef LPSTR LPOLESTR;
|
||||
typedef const char* LPCSTR;
|
||||
typedef LPCSTR LPCOLESTR;
|
||||
typedef wchar_t WCHAR;
|
||||
typedef unsigned short WORD;
|
||||
typedef unsigned int UINT;
|
||||
typedef UINT MMRESULT;
|
||||
typedef uint32_t DWORD;
|
||||
typedef DWORD COLORREF;
|
||||
typedef DWORD FOURCC;
|
||||
typedef DWORD HRESULT;
|
||||
typedef DWORD* LPDWORD;
|
||||
typedef DWORD* DWORD_PTR;
|
||||
typedef int32_t LONG;
|
||||
typedef int32_t* LONG_PTR;
|
||||
typedef LONG_PTR LRESULT;
|
||||
typedef uint32_t ULONG;
|
||||
typedef uint32_t* ULONG_PTR;
|
||||
//typedef __int64_t intptr_t;
|
||||
typedef uint64_t _fsize_t;
|
||||
|
||||
|
||||
//
|
||||
// Structures
|
||||
//
|
||||
|
||||
typedef struct _GUID {
|
||||
DWORD Data1;
|
||||
WORD Data2;
|
||||
WORD Data3;
|
||||
BYTE Data4[8];
|
||||
} GUID;
|
||||
|
||||
typedef GUID REFIID;
|
||||
typedef GUID CLSID;
|
||||
typedef CLSID* LPCLSID;
|
||||
typedef GUID IID;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}; // namespace avxsynth
|
||||
#endif // __cplusplus
|
||||
#endif // __DATA_TYPE_CONVERSIONS_H__
|
||||
@@ -1,77 +0,0 @@
|
||||
#ifndef __WINDOWS2LINUX_H__
|
||||
#define __WINDOWS2LINUX_H__
|
||||
|
||||
/*
|
||||
* LINUX SPECIFIC DEFINITIONS
|
||||
*/
|
||||
//
|
||||
// Data types conversions
|
||||
//
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "basicDataTypeConversions.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
namespace avxsynth {
|
||||
#endif // __cplusplus
|
||||
//
|
||||
// purposefully define the following MSFT definitions
|
||||
// to mean nothing (as they do not mean anything on Linux)
|
||||
//
|
||||
#define __stdcall
|
||||
#define __cdecl
|
||||
#define noreturn
|
||||
#define __declspec(x)
|
||||
#define STDAPI extern "C" HRESULT
|
||||
#define STDMETHODIMP HRESULT __stdcall
|
||||
#define STDMETHODIMP_(x) x __stdcall
|
||||
|
||||
#define STDMETHOD(x) virtual HRESULT x
|
||||
#define STDMETHOD_(a, x) virtual a x
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE true
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE false
|
||||
#endif
|
||||
|
||||
#define S_OK (0x00000000)
|
||||
#define S_FALSE (0x00000001)
|
||||
#define E_NOINTERFACE (0X80004002)
|
||||
#define E_POINTER (0x80004003)
|
||||
#define E_FAIL (0x80004005)
|
||||
#define E_OUTOFMEMORY (0x8007000E)
|
||||
|
||||
#define INVALID_HANDLE_VALUE ((HANDLE)((LONG_PTR)-1))
|
||||
#define FAILED(hr) ((hr) & 0x80000000)
|
||||
#define SUCCEEDED(hr) (!FAILED(hr))
|
||||
|
||||
|
||||
//
|
||||
// Functions
|
||||
//
|
||||
#define MAKEDWORD(a,b,c,d) ((a << 24) | (b << 16) | (c << 8) | (d))
|
||||
#define MAKEWORD(a,b) ((a << 8) | (b))
|
||||
|
||||
#define lstrlen strlen
|
||||
#define lstrcpy strcpy
|
||||
#define lstrcmpi strcasecmp
|
||||
#define _stricmp strcasecmp
|
||||
#define InterlockedIncrement(x) __sync_fetch_and_add((x), 1)
|
||||
#define InterlockedDecrement(x) __sync_fetch_and_sub((x), 1)
|
||||
// Windows uses (new, old) ordering but GCC has (old, new)
|
||||
#define InterlockedCompareExchange(x,y,z) __sync_val_compare_and_swap(x,z,y)
|
||||
|
||||
#define UInt32x32To64(a, b) ( (uint64_t) ( ((uint64_t)((uint32_t)(a))) * ((uint32_t)(b)) ) )
|
||||
#define Int64ShrlMod32(a, b) ( (uint64_t) ( (uint64_t)(a) >> (b) ) )
|
||||
#define Int32x32To64(a, b) ((__int64)(((__int64)((long)(a))) * ((long)(b))))
|
||||
|
||||
#define MulDiv(nNumber, nNumerator, nDenominator) (int32_t) (((int64_t) (nNumber) * (int64_t) (nNumerator) + (int64_t) ((nDenominator)/2)) / (int64_t) (nDenominator))
|
||||
|
||||
#ifdef __cplusplus
|
||||
}; // namespace avxsynth
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif // __WINDOWS2LINUX_H__
|
||||
@@ -19,6 +19,7 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <ctype.h>
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -48,7 +49,7 @@ double avpriv_strtod(const char *nptr, char **endptr)
|
||||
double res;
|
||||
|
||||
/* Skip leading spaces */
|
||||
while (av_isspace(*nptr))
|
||||
while (isspace(*nptr))
|
||||
nptr++;
|
||||
|
||||
if (!av_strncasecmp(nptr, "infinity", 8)) {
|
||||
|
||||
@@ -1,24 +1,3 @@
|
||||
/*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* 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.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef FFMPEG_COMPAT_TMS470_MATH_H
|
||||
#define FFMPEG_COMPAT_TMS470_MATH_H
|
||||
|
||||
#include_next <math.h>
|
||||
|
||||
#undef INFINITY
|
||||
@@ -26,5 +5,3 @@
|
||||
|
||||
#define INFINITY (*(const float*)((const unsigned []){ 0x7f800000 }))
|
||||
#define NAN (*(const float*)((const unsigned []){ 0x7fc00000 }))
|
||||
|
||||
#endif /* FFMPEG_COMPAT_TMS470_MATH_H */
|
||||
|
||||
264
doc/APIchanges
264
doc/APIchanges
@@ -2,10 +2,10 @@ Never assume the API of libav* to be stable unless at least 1 month has passed
|
||||
since the last major version increase or the API was added.
|
||||
|
||||
The last version increases were:
|
||||
libavcodec: 2013-03-xx
|
||||
libavdevice: 2013-03-xx
|
||||
libavcodec: 2012-01-27
|
||||
libavdevice: 2011-04-18
|
||||
libavfilter: 2012-06-22
|
||||
libavformat: 2013-03-xx
|
||||
libavformat: 2012-01-27
|
||||
libavresample: 2012-10-05
|
||||
libpostproc: 2011-04-18
|
||||
libswresample: 2011-09-19
|
||||
@@ -15,167 +15,11 @@ libavutil: 2012-10-22
|
||||
|
||||
API changes, most recent first:
|
||||
|
||||
2013-10-27 - xxxxxxx - lavc 55.39.100 - avcodec.h
|
||||
Add CODEC_CAP_DELAY support to avcodec_decode_subtitle2.
|
||||
|
||||
2013-10-27 - xxxxxxx - lavu 52.48.100 - parseutils.h
|
||||
Add av_get_known_color_name().
|
||||
|
||||
2013-10-17 - xxxxxxx - lavu 52.47.100 - opt.h
|
||||
Add AV_OPT_TYPE_CHANNEL_LAYOUT and channel layout option handlers
|
||||
av_opt_get_channel_layout() and av_opt_set_channel_layout().
|
||||
|
||||
2013-10-xx - xxxxxxx -libswscale 2.5.101 - options.c
|
||||
Change default scaler to bicubic
|
||||
|
||||
2013-10-03 - xxxxxxx - lavc 55.34.100 - avcodec.h
|
||||
Add av_codec_get_max_lowres()
|
||||
|
||||
2013-10-02 - xxxxxxx - lavf 55.19.100 - avformat.h
|
||||
Add audio/video/subtitle AVCodec fields to AVFormatContext to force specific
|
||||
decoders
|
||||
|
||||
2013-08-xx - xxxxxxx - lavfi 3.11.0 - avfilter.h
|
||||
Add AVFilterGraph.execute and AVFilterGraph.opaque for custom slice threading
|
||||
implementations.
|
||||
|
||||
2013-09-21 - xxxxxxx - lavu 52.16.0 - pixfmt.h
|
||||
Add interleaved 4:2:2 8/10-bit formats AV_PIX_FMT_NV16 and
|
||||
AV_PIX_FMT_NV20.
|
||||
|
||||
2013-09-16 - c74c3fb / 3feb3d6 - lavu 52.44.100 / 52.15.0 - mem.h
|
||||
Add av_reallocp.
|
||||
|
||||
2013-09-04 - 3e1f507 - lavc 55.31.101 - avcodec.h
|
||||
avcodec_close() argument can be NULL.
|
||||
|
||||
2013-09-04 - 36cd017 - lavf 55.16.101 - avformat.h
|
||||
avformat_close_input() argument can be NULL and point on NULL.
|
||||
|
||||
2013-08-29 - e31db62 - lavf 55.15.100 - avformat.h
|
||||
Add av_format_get_probe_score().
|
||||
|
||||
2013-08-15 - 1e0e193 - lsws 2.5.100 -
|
||||
Add a sws_dither AVOption, allowing to set the dither algorithm used
|
||||
|
||||
2013-08-xx - xxxxxxx - lavc 55.27.100 - vdpau.h
|
||||
Add a render2 alternative to the render callback function.
|
||||
|
||||
2013-08-xx - xxxxxxx - lavc 55.26.100 - vdpau.h
|
||||
Add allocation function for AVVDPAUContext, allowing
|
||||
to extend it in the future without breaking ABI/API.
|
||||
|
||||
2013-08-10 - 67a580f / 5a9a9d4 - lavc 55.25.100 / 55.16.0 - avcodec.h
|
||||
Extend AVPacket API with av_packet_unref, av_packet_ref,
|
||||
av_packet_move_ref, av_packet_copy_props, av_packet_free_side_data.
|
||||
|
||||
2013-08-05 - 9547e3e / f824535 - lavc 55.22.100 / 55.13.0 - avcodec.h
|
||||
Deprecate the bitstream-related members from struct AVVDPAUContext.
|
||||
The bistream buffers no longer need to be explicitly freed.
|
||||
|
||||
2013-08-05 - 3b805dc / 549294f - lavc 55.21.100 / 55.12.0 - avcodec.h
|
||||
Deprecate the CODEC_CAP_HWACCEL_VDPAU codec capability. Use CODEC_CAP_HWACCEL
|
||||
and select the AV_PIX_FMT_VDPAU format with get_format() instead.
|
||||
|
||||
2013-08-05 - 4ee0984 / a0ad5d0 - lavu 52.41.100 / 52.14.0 - pixfmt.h
|
||||
Deprecate AV_PIX_FMT_VDPAU_*. Use AV_PIX_FMT_VDPAU instead.
|
||||
|
||||
2013-08-02 - 82fdfe8 / a8b1927 - lavc 55.20.100 / 55.11.0 - avcodec.h
|
||||
Add output_picture_number to AVCodecParserContext.
|
||||
|
||||
2013-07-23 - abc8110 - lavc 55.19.100 - avcodec.h
|
||||
Add avcodec_chroma_pos_to_enum()
|
||||
Add avcodec_enum_to_chroma_pos()
|
||||
|
||||
2013-07-03 - 838bd73 - lavfi 3.78.100 - avfilter.h
|
||||
Deprecate avfilter_graph_parse() in favor of the equivalent
|
||||
avfilter_graph_parse_ptr().
|
||||
|
||||
2013-06-24 - af5f9c0 / 95d5246 - lavc 55.17.100 / 55.10.0 - avcodec.h
|
||||
Add MPEG-2 AAC profiles
|
||||
|
||||
2013-06-25 - af5f9c0 / 95d5246 - lavf 55.10.100 - avformat.h
|
||||
Add AV_DISPOSITION_* flags to indicate text track kind.
|
||||
|
||||
2013-06-15 - 99b8cd0 - lavu 52.36.100
|
||||
Add AVRIPEMD:
|
||||
av_ripemd_alloc()
|
||||
av_ripemd_init()
|
||||
av_ripemd_update()
|
||||
av_ripemd_final()
|
||||
|
||||
2013-06-04 - 30b491f / fc962d4 - lavu 52.35.100 / 52.13.0 - mem.h
|
||||
Add av_realloc_array and av_reallocp_array
|
||||
|
||||
2013-05-30 - 682b227 - lavu 52.35.100
|
||||
Add AVSHA512:
|
||||
av_sha512_alloc()
|
||||
av_sha512_init()
|
||||
av_sha512_update()
|
||||
av_sha512_final()
|
||||
|
||||
2013-05-24 - 8d4e969 / 129bb23 - lavfi 3.10.0 / 3.70.100 - avfilter.h
|
||||
Add support for slice multithreading to lavfi. Filters supporting threading
|
||||
are marked with AVFILTER_FLAG_SLICE_THREADS.
|
||||
New fields AVFilterContext.thread_type, AVFilterGraph.thread_type and
|
||||
AVFilterGraph.nb_threads (accessible directly or through AVOptions) may be
|
||||
used to configure multithreading.
|
||||
|
||||
2013-05-24 - fe40a9f / 2a6eaea - lavu 52.12.0 / 52.34.100 - cpu.h
|
||||
Add av_cpu_count() function for getting the number of logical CPUs.
|
||||
|
||||
2013-05-24 - 0c25c39 / b493847 - lavc 55.7.0 / 55.12.100 - avcodec.h
|
||||
Add picture_structure to AVCodecParserContext.
|
||||
|
||||
2013-05-17 - 3a751ea - lavu 52.33.100 - opt.h
|
||||
Add AV_OPT_TYPE_COLOR value to AVOptionType enum.
|
||||
|
||||
2013-05-13 - e398416 - lavu 52.31.100 - mem.h
|
||||
Add av_dynarray2_add().
|
||||
|
||||
2013-05-12 - 1776177 - lavfi 3.65.100
|
||||
Add AVFILTER_FLAG_SUPPORT_TIMELINE* filter flags.
|
||||
|
||||
2013-04-19 - 380cfce - lavc 55.4.100
|
||||
Add AV_CODEC_PROP_TEXT_SUB property for text based subtitles codec.
|
||||
|
||||
2013-04-18 - 7c1a002 - lavf 55.3.100
|
||||
The matroska demuxer can now output proper verbatim ASS packets. It will
|
||||
become the default starting lavf 56.0.100.
|
||||
|
||||
2013-04-10 - af0d270 - lavu 25.26.100 - avutil.h,opt.h
|
||||
Add av_int_list_length()
|
||||
and av_opt_set_int_list().
|
||||
|
||||
2013-03-30 - 5c73645 - lavu 52.24.100 - samplefmt.h
|
||||
Add av_samples_alloc_array_and_samples().
|
||||
|
||||
2013-03-29 - ef7b6b4 - lavf 55.1.100 - avformat.h
|
||||
Add av_guess_frame_rate()
|
||||
|
||||
2013-03-20 - 8d928a9 - lavu 52.22.100 - opt.h
|
||||
Add AV_OPT_TYPE_DURATION value to AVOptionType enum.
|
||||
|
||||
2013-03-17 - 7aa9af5 - lavu 52.20.100 - opt.h
|
||||
Add AV_OPT_TYPE_VIDEO_RATE value to AVOptionType enum.
|
||||
|
||||
2013-03-07 - 9767ec6 - lavu 52.18.100 - avstring.h,bprint.h
|
||||
Add av_escape() and av_bprint_escape() API.
|
||||
|
||||
2013-02-24 - b59cd08 - lavfi 3.41.100 - buffersink.h
|
||||
Add sample_rates field to AVABufferSinkParams.
|
||||
|
||||
2013-01-17 - a1a707f - lavf 54.61.100
|
||||
Add av_codec_get_tag2().
|
||||
|
||||
2013-01-01 - 2eb2e17 - lavfi 3.34.100
|
||||
Add avfilter_get_audio_buffer_ref_from_arrays_channels.
|
||||
|
||||
2012-12-20 - 34de47aa - lavfi 3.29.100 - avfilter.h
|
||||
2012-12-20 - xxxxxxx - lavfi 3.28.100 - avfilter.h
|
||||
Add AVFilterLink.channels, avfilter_link_get_channels()
|
||||
and avfilter_ref_get_channels().
|
||||
|
||||
2012-12-15 - 96d815fc - lavc 54.80.100 - avcodec.h
|
||||
2012-12-15 - 2ada584d - lavc 54.80.100 - avcodec.h
|
||||
Add pkt_size field to AVFrame.
|
||||
|
||||
2012-11-25 - c70ec631 - lavu 52.9.100 - opt.h
|
||||
@@ -288,102 +132,6 @@ API changes, most recent first:
|
||||
2012-03-26 - a67d9cf - lavfi 2.66.100
|
||||
Add avfilter_fill_frame_from_{audio_,}buffer_ref() functions.
|
||||
|
||||
2013-05-15 - ff46809 / e6c4ac7 - lavu 52.32.100 / 52.11.0 - pixdesc.h
|
||||
Replace PIX_FMT_* flags with AV_PIX_FMT_FLAG_*.
|
||||
|
||||
2013-04-03 - 6fc58a8 / 507b1e4 - lavc 55.7.100 / 55.4.0 - avcodec.h
|
||||
Add field_order to AVCodecParserContext.
|
||||
|
||||
2013-04-19 - f4b05cd / 5e83d9a - lavc 55.5.100 / 55.2.0 - avcodec.h
|
||||
Add CODEC_FLAG_UNALIGNED to allow decoders to produce unaligned output.
|
||||
|
||||
2013-04-11 - lavfi 3.53.100 / 3.8.0
|
||||
231fd44 / 38f0c07 - Move all content from avfiltergraph.h to avfilter.h. Deprecate
|
||||
avfilterhraph.h, user applications should include just avfilter.h
|
||||
86070b8 / bc1a985 - Add avfilter_graph_alloc_filter(), deprecate avfilter_open() and
|
||||
avfilter_graph_add_filter().
|
||||
4fde705 / 1113672 - Add AVFilterContext.graph pointing to the AVFilterGraph that contains the
|
||||
filter.
|
||||
710b0aa / 48a5ada - Add avfilter_init_str(), deprecate avfilter_init_filter().
|
||||
46de9ba / 1ba95a9 - Add avfilter_init_dict().
|
||||
16fc24b / 7cdd737 - Add AVFilter.flags field and AVFILTER_FLAG_DYNAMIC_{INPUTS,OUTPUTS} flags.
|
||||
f4db6bf / 7e8fe4b - Add avfilter_pad_count() for counting filter inputs/outputs.
|
||||
835cc0f / fa2a34c - Add avfilter_next(), deprecate av_filter_next().
|
||||
Deprecate avfilter_uninit().
|
||||
|
||||
2013-04-09 - lavfi 3.51.100 / 3.7.0 - avfilter.h
|
||||
0594ef0 / b439c99 - Add AVFilter.priv_class for exporting filter options through the
|
||||
AVOptions API in the similar way private options work in lavc and lavf.
|
||||
44d4488 / 8114c10 - Add avfilter_get_class().
|
||||
Switch all filters to use AVOptions.
|
||||
|
||||
2013-03-19 - 17ebef2 / 2c328a9 - lavu 52.20.100 / 52.9.0 - pixdesc.h
|
||||
Add av_pix_fmt_count_planes() function for counting planes in a pixel format.
|
||||
|
||||
2013-03-16 - ecade98 / 42c7c61 - lavfi 3.47.100 / 3.6.0
|
||||
Add AVFilterGraph.nb_filters, deprecate AVFilterGraph.filter_count.
|
||||
|
||||
2013-03-08 - Reference counted buffers - lavu 52.8.0, lavc 55.0.100 / 55.0.0, lavf 55.0.100 / 55.0.0,
|
||||
lavd 54.4.100 / 54.0.0, lavfi 3.5.0
|
||||
36099df / 8e401db, 532f31a / 1cec062 - add a new API for reference counted buffers and buffer
|
||||
pools (new header libavutil/buffer.h).
|
||||
2653e12 / 1afddbe - add AVPacket.buf to allow reference counting for the AVPacket data.
|
||||
Add av_packet_from_data() function for constructing packets from
|
||||
av_malloc()ed data.
|
||||
c4e8821 / 7ecc2d4 - move AVFrame from lavc to lavu (new header libavutil/frame.h), add
|
||||
AVFrame.buf/extended_buf to allow reference counting for the AVFrame
|
||||
data. Add new API for working with reference-counted AVFrames.
|
||||
80e9e63 / 759001c - add the refcounted_frames field to AVCodecContext to make audio and
|
||||
video decoders return reference-counted frames. Add get_buffer2()
|
||||
callback to AVCodecContext which allocates reference-counted frames.
|
||||
Add avcodec_default_get_buffer2() as the default get_buffer2()
|
||||
implementation.
|
||||
Deprecate AVCodecContext.get_buffer() / release_buffer() /
|
||||
reget_buffer(), avcodec_default_get_buffer(),
|
||||
avcodec_default_reget_buffer(), avcodec_default_release_buffer().
|
||||
Remove avcodec_default_free_buffers(), which should not have ever
|
||||
been called from outside of lavc.
|
||||
Deprecate the following AVFrame fields:
|
||||
* base -- is now stored in AVBufferRef
|
||||
* reference, type, buffer_hints -- are unnecessary in the new API
|
||||
* hwaccel_picture_private, owner, thread_opaque -- should not
|
||||
have been acessed from outside of lavc
|
||||
* qscale_table, qstride, qscale_type, mbskip_table, motion_val,
|
||||
mb_type, dct_coeff, ref_index -- mpegvideo-specific tables,
|
||||
which are not exported anymore.
|
||||
a05a44e / 7e35037 - switch libavfilter to use AVFrame instead of AVFilterBufferRef. Add
|
||||
av_buffersrc_add_frame(), deprecate av_buffersrc_buffer().
|
||||
Add av_buffersink_get_frame() and av_buffersink_get_samples(),
|
||||
deprecate av_buffersink_read() and av_buffersink_read_samples().
|
||||
Deprecate AVFilterBufferRef and all functions for working with it.
|
||||
|
||||
2013-03-17 - 6c17ff8 / 12c5c1d - lavu 52.19.100 / 52.8.0 - avstring.h
|
||||
Add av_isdigit, av_isgraph, av_isspace, av_isxdigit.
|
||||
|
||||
2013-02-23 - 71cf094 / 9f12235 - lavfi 3.40.100 / 3.4.0 - avfiltergraph.h
|
||||
Add resample_lavr_opts to AVFilterGraph for setting libavresample options
|
||||
for auto-inserted resample filters.
|
||||
|
||||
2013-01-25 - e7e14bc / 38c1466 - lavu 52.17.100 / 52.7.0 - dict.h
|
||||
Add av_dict_parse_string() to set multiple key/value pairs at once from a
|
||||
string.
|
||||
|
||||
2013-01-25 - 25be630 / b85a5e8 - lavu 52.16.100 / 52.6.0 - avstring.h
|
||||
Add av_strnstr()
|
||||
|
||||
2013-01-15 - e7e0186 / 8ee288d - lavu 52.15.100 / 52.5.0 - hmac.h
|
||||
Add AVHMAC.
|
||||
|
||||
2013-01-13 - 8ee7b38 / 44e065d - lavc 54.87.100 / 54.36.0 - vdpau.h
|
||||
Add AVVDPAUContext struct for VDPAU hardware-accelerated decoding.
|
||||
|
||||
2013-01-12 - dae382b / 169fb94 - lavu 52.14.100 / 52.4.0 - pixdesc.h
|
||||
Add AV_PIX_FMT_VDPAU flag.
|
||||
|
||||
2013-01-07 - 249fca3 / 074a00d - lavr 1.1.0
|
||||
Add avresample_set_channel_mapping() for input channel reordering,
|
||||
duplication, and silencing.
|
||||
|
||||
2012-12-29 - 2ce43b3 / d8fd06c - lavu 52.13.100 / 52.3.0 - avstring.h
|
||||
Add av_basename() and av_dirname().
|
||||
|
||||
@@ -462,7 +210,7 @@ lavd 54.4.100 / 54.0.0, lavfi 3.5.0
|
||||
2012-07-29 - 7c26761 / 681ed00 - lavf 54.22.100 / 54.13.0 - avformat.h
|
||||
Add AVFMT_FLAG_NOBUFFER for low latency use cases.
|
||||
|
||||
2012-07-10 - fbe0245 / f3e5e6f - lavu 51.65.100 / 51.37.0
|
||||
2012-07-10 - 5fade8a - lavu 51.37.0
|
||||
Add av_malloc_array() and av_mallocz_array()
|
||||
|
||||
2012-06-22 - e847f41 / d3d3a32 - lavu 51.61.100 / 51.34.0
|
||||
|
||||
10
doc/Doxyfile
10
doc/Doxyfile
@@ -31,9 +31,9 @@ PROJECT_NAME = FFmpeg
|
||||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER = 2.1.1
|
||||
PROJECT_NUMBER = 1.1.7
|
||||
|
||||
# With the PROJECT_LOGO tag one can specify a logo or icon that is included
|
||||
# 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.
|
||||
@@ -277,7 +277,7 @@ SUBGROUPING = YES
|
||||
# be useful for C code in case the coding convention dictates that all compound
|
||||
# types are typedef'ed and only the typedef is referenced, never the tag name.
|
||||
|
||||
TYPEDEF_HIDES_STRUCT = YES
|
||||
TYPEDEF_HIDES_STRUCT = NO
|
||||
|
||||
# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
|
||||
# determine which symbols to keep in memory and which to flush to disk.
|
||||
@@ -409,7 +409,7 @@ INLINE_INFO = YES
|
||||
# alphabetically by member name. If set to NO the members will appear in
|
||||
# declaration order.
|
||||
|
||||
SORT_MEMBER_DOCS = NO
|
||||
SORT_MEMBER_DOCS = YES
|
||||
|
||||
# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
|
||||
# brief documentation of file, namespace and class members alphabetically
|
||||
@@ -709,7 +709,7 @@ INLINE_SOURCES = NO
|
||||
# doxygen to hide any special comment blocks from generated source code
|
||||
# fragments. Normal C and C++ comments will always remain visible.
|
||||
|
||||
STRIP_CODE_COMMENTS = NO
|
||||
STRIP_CODE_COMMENTS = YES
|
||||
|
||||
# If the REFERENCED_BY_RELATION tag is set to YES
|
||||
# then for each documented function all documented
|
||||
|
||||
54
doc/Makefile
54
doc/Makefile
@@ -6,6 +6,7 @@ LIBRARIES-$(CONFIG_AVFORMAT) += libavformat
|
||||
LIBRARIES-$(CONFIG_AVDEVICE) += libavdevice
|
||||
LIBRARIES-$(CONFIG_AVFILTER) += libavfilter
|
||||
|
||||
COMPONENTS-yes = $(PROGS-yes)
|
||||
COMPONENTS-$(CONFIG_AVUTIL) += ffmpeg-utils
|
||||
COMPONENTS-$(CONFIG_SWSCALE) += ffmpeg-scaler
|
||||
COMPONENTS-$(CONFIG_SWRESAMPLE) += ffmpeg-resampler
|
||||
@@ -14,11 +15,9 @@ COMPONENTS-$(CONFIG_AVFORMAT) += ffmpeg-formats ffmpeg-protocols
|
||||
COMPONENTS-$(CONFIG_AVDEVICE) += ffmpeg-devices
|
||||
COMPONENTS-$(CONFIG_AVFILTER) += ffmpeg-filters
|
||||
|
||||
MANPAGES1 = $(PROGS-yes:%=doc/%.1) $(PROGS-yes:%=doc/%-all.1) $(COMPONENTS-yes:%=doc/%.1)
|
||||
MANPAGES3 = $(LIBRARIES-yes:%=doc/%.3)
|
||||
MANPAGES = $(MANPAGES1) $(MANPAGES3)
|
||||
PODPAGES = $(PROGS-yes:%=doc/%.pod) $(PROGS-yes:%=doc/%-all.pod) $(COMPONENTS-yes:%=doc/%.pod) $(LIBRARIES-yes:%=doc/%.pod)
|
||||
HTMLPAGES = $(PROGS-yes:%=doc/%.html) $(PROGS-yes:%=doc/%-all.html) $(COMPONENTS-yes:%=doc/%.html) $(LIBRARIES-yes:%=doc/%.html) \
|
||||
MANPAGES = $(COMPONENTS-yes:%=doc/%.1) $(LIBRARIES-yes:%=doc/%.3)
|
||||
PODPAGES = $(COMPONENTS-yes:%=doc/%.pod) $(LIBRARIES-yes:%=doc/%.pod)
|
||||
HTMLPAGES = $(COMPONENTS-yes:%=doc/%.html) $(LIBRARIES-yes:%=doc/%.html) \
|
||||
doc/developer.html \
|
||||
doc/faq.html \
|
||||
doc/fate.html \
|
||||
@@ -60,22 +59,12 @@ $(GENTEXI): doc/avoptions_%.texi: doc/print_options$(HOSTEXESUF)
|
||||
doc/%.html: TAG = HTML
|
||||
doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
|
||||
$(Q)$(TEXIDEP)
|
||||
$(M)texi2html -I doc -monolithic --D=config-not-all --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
|
||||
|
||||
doc/%-all.html: TAG = HTML
|
||||
doc/%-all.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
|
||||
$(Q)$(TEXIDEP)
|
||||
$(M)texi2html -I doc -monolithic --D=config-all --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
|
||||
$(M)texi2html -I doc -monolithic --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
|
||||
|
||||
doc/%.pod: TAG = POD
|
||||
doc/%.pod: doc/%.texi $(SRC_PATH)/doc/texi2pod.pl $(GENTEXI)
|
||||
doc/%.pod: doc/%.texi $(GENTEXI)
|
||||
$(Q)$(TEXIDEP)
|
||||
$(M)perl $(SRC_PATH)/doc/texi2pod.pl -Dconfig-not-all=yes -Idoc $< $@
|
||||
|
||||
doc/%-all.pod: TAG = POD
|
||||
doc/%-all.pod: doc/%.texi $(SRC_PATH)/doc/texi2pod.pl $(GENTEXI)
|
||||
$(Q)$(TEXIDEP)
|
||||
$(M)perl $(SRC_PATH)/doc/texi2pod.pl -Dconfig-all=yes -Idoc $< $@
|
||||
$(M)perl $(SRC_PATH)/doc/texi2pod.pl -Idoc $< $@
|
||||
|
||||
doc/%.1 doc/%.3: TAG = MAN
|
||||
doc/%.1: doc/%.pod $(GENTEXI)
|
||||
@@ -88,46 +77,23 @@ $(DOCS) doc/doxy/html: | doc/
|
||||
doc/doxy/html: $(SRC_PATH)/doc/Doxyfile $(INSTHEADERS)
|
||||
$(M)$(SRC_PATH)/doc/doxy-wrapper.sh $(SRC_PATH) $^
|
||||
|
||||
install-doc: install-html install-man
|
||||
|
||||
install-html:
|
||||
|
||||
install-man:
|
||||
|
||||
ifdef CONFIG_HTMLPAGES
|
||||
install-progs-$(CONFIG_DOC): install-html
|
||||
|
||||
install-html: $(HTMLPAGES)
|
||||
$(Q)mkdir -p "$(DOCDIR)"
|
||||
$(INSTALL) -m 644 $(HTMLPAGES) "$(DOCDIR)"
|
||||
endif
|
||||
|
||||
ifdef CONFIG_MANPAGES
|
||||
install-progs-$(CONFIG_DOC): install-man
|
||||
|
||||
install-man: $(MANPAGES)
|
||||
$(Q)mkdir -p "$(MANDIR)/man1"
|
||||
$(INSTALL) -m 644 $(MANPAGES1) "$(MANDIR)/man1"
|
||||
$(Q)mkdir -p "$(MANDIR)/man3"
|
||||
$(INSTALL) -m 644 $(MANPAGES3) "$(MANDIR)/man3"
|
||||
$(INSTALL) -m 644 $(MANPAGES) "$(MANDIR)/man1"
|
||||
endif
|
||||
|
||||
uninstall: uninstall-doc
|
||||
|
||||
uninstall-doc: uninstall-html uninstall-man
|
||||
|
||||
uninstall-html:
|
||||
$(RM) -r "$(DOCDIR)"
|
||||
uninstall: uninstall-man
|
||||
|
||||
uninstall-man:
|
||||
$(RM) $(addprefix "$(MANDIR)/man1/",$(PROGS-yes:%=%.1) $(PROGS-yes:%=%-all.1) $(COMPONENTS-yes:%=%.1))
|
||||
$(RM) $(addprefix "$(MANDIR)/man3/",$(LIBRARIES-yes:%=%.3))
|
||||
$(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
|
||||
|
||||
clean:: docclean
|
||||
|
||||
distclean:: docclean
|
||||
$(RM) doc/config.texi
|
||||
|
||||
docclean:
|
||||
$(RM) $(TXTPAGES) doc/*.html doc/*.pod doc/*.1 doc/*.3 $(CLEANSUFFIXES:%=doc/%) doc/avoptions_*.texi
|
||||
$(RM) -r doc/doxy/html
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Release Notes
|
||||
=============
|
||||
|
||||
* 2.1 "Fourier" October, 2013
|
||||
* 1.1 "Fire Flower" January, 2013
|
||||
|
||||
|
||||
General notes
|
||||
@@ -14,3 +14,12 @@ accepted. If you are experiencing issues with any formally released version of
|
||||
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
|
||||
guidelines.
|
||||
|
||||
Of big interest to our Windows users, FFmpeg now supports building with the MSVC
|
||||
compiler. Since MSVC does not support C99 features used extensively by FFmpeg,
|
||||
this has been accomplished using a converter that turns C99 code to C89. See the
|
||||
platform-specific documentation for more detailed documentation on building
|
||||
FFmpeg with MSVC.
|
||||
|
||||
The used output sample format for several audio decoders has changed, make
|
||||
sure you always check/use AVCodecContext.sample_fmt or AVFrame.format.
|
||||
|
||||
@@ -1,33 +1,32 @@
|
||||
All the numerical options, if not specified otherwise, accept a string
|
||||
representing a number as input, which may be followed by one of the SI
|
||||
unit prefixes, for example: 'K', 'M', or 'G'.
|
||||
|
||||
If 'i' is appended to the SI unit prefix, the complete prefix will be
|
||||
interpreted as a unit prefix for binary multiplies, which are based on
|
||||
powers of 1024 instead of powers of 1000. Appending 'B' to the SI unit
|
||||
prefix multiplies the value by 8. This allows using, for example:
|
||||
'KB', 'MiB', 'G' and 'B' as number suffixes.
|
||||
All the numerical options, if not specified otherwise, accept in input
|
||||
a string representing a number, which may contain one of the
|
||||
SI unit prefixes, for example 'K', 'M', 'G'.
|
||||
If 'i' is appended after the prefix, binary prefixes are used,
|
||||
which are based on powers of 1024 instead of powers of 1000.
|
||||
The 'B' postfix multiplies the value by 8, and can be
|
||||
appended after a unit prefix or used alone. This allows using for
|
||||
example 'KB', 'MiB', 'G' and 'B' as number 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
|
||||
the option name with "no". For example using "-nofoo"
|
||||
will set the boolean option with name "foo" to false.
|
||||
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) a given option belongs to.
|
||||
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} contains the
|
||||
@code{a:1} stream specifier, which matches the second audio stream. Therefore, it
|
||||
separated from it by a colon. E.g. @code{-codec:a:1 ac3} option contains
|
||||
@code{a:1} stream specifier, which matches the second audio stream. Therefore it
|
||||
would select the ac3 codec for the second audio stream.
|
||||
|
||||
A stream specifier can match several streams, so that the option is applied to all
|
||||
A stream specifier can match several streams, 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}
|
||||
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:
|
||||
@@ -36,21 +35,20 @@ Possible forms of stream specifiers are:
|
||||
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 following: 'v' for video, 'a' for audio, 's' for subtitle,
|
||||
'd' for data, and 't' for attachments. If @var{stream_index} is given, then it matches
|
||||
stream number @var{stream_index} of this type. Otherwise, it matches all
|
||||
@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 it matches the stream with number @var{stream_index}
|
||||
in the program with the id @var{program_id}. Otherwise, it matches all streams in the
|
||||
program.
|
||||
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.
|
||||
@item #@var{stream_id}
|
||||
Matches the stream by a format-specific ID.
|
||||
Matches the stream by format-specific ID.
|
||||
@end table
|
||||
|
||||
@section Generic options
|
||||
|
||||
These options are shared amongst the ff* tools.
|
||||
These options are shared amongst the av* tools.
|
||||
|
||||
@table @option
|
||||
|
||||
@@ -59,18 +57,10 @@ Show license.
|
||||
|
||||
@item -h, -?, -help, --help [@var{arg}]
|
||||
Show help. An optional parameter may be specified to print help about a specific
|
||||
item. If no argument is specified, only basic (non advanced) tool
|
||||
options are shown.
|
||||
item.
|
||||
|
||||
Possible values of @var{arg} are:
|
||||
@table @option
|
||||
@item long
|
||||
Print advanced tool options in addition to the basic tool options.
|
||||
|
||||
@item full
|
||||
Print complete list of options, including shared and private options
|
||||
for encoders, decoders, demuxers, muxers, filters, etc.
|
||||
|
||||
@item decoder=@var{decoder_name}
|
||||
Print detailed information about the decoder named @var{decoder_name}. Use the
|
||||
@option{-decoders} option to get a list of all decoders.
|
||||
@@ -87,9 +77,6 @@ Print detailed information about the demuxer named @var{demuxer_name}. Use the
|
||||
Print detailed information about the muxer named @var{muxer_name}. Use the
|
||||
@option{-formats} option to get a list of all muxers and demuxers.
|
||||
|
||||
@item filter=@var{filter_name}
|
||||
Print detailed information about the filter name @var{filter_name}. Use the
|
||||
@option{-filters} option to get a list of all filters.
|
||||
@end table
|
||||
|
||||
@item -version
|
||||
@@ -98,6 +85,14 @@ 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 all codecs known to libavcodec.
|
||||
|
||||
@@ -128,39 +123,18 @@ Show available sample formats.
|
||||
@item -layouts
|
||||
Show channel names and standard channel layouts.
|
||||
|
||||
@item -colors
|
||||
Show recognized color names.
|
||||
|
||||
@item -loglevel [repeat+]@var{loglevel} | -v [repeat+]@var{loglevel}
|
||||
@item -loglevel @var{loglevel} | -v @var{loglevel}
|
||||
Set the logging level used by the library.
|
||||
Adding "repeat+" indicates that repeated log output should not be compressed
|
||||
to the first line and the "Last message repeated n times" line will be
|
||||
omitted. "repeat" can also be used alone.
|
||||
If "repeat" is used alone, and with no prior loglevel set, the default
|
||||
loglevel will be used. If multiple loglevel parameters are given, using
|
||||
'repeat' will not change the loglevel.
|
||||
@var{loglevel} is a number or a string containing one of the following values:
|
||||
@table @samp
|
||||
@item quiet
|
||||
Show nothing at all; be silent.
|
||||
@item panic
|
||||
Only show fatal errors which could lead the process to crash, such as
|
||||
and assert failure. This is not currently used for anything.
|
||||
@item fatal
|
||||
Only show fatal errors. These are errors after which the process absolutely
|
||||
cannot continue after.
|
||||
@item error
|
||||
Show all errors, including ones which can be recovered from.
|
||||
@item warning
|
||||
Show all warnings and errors. Any message related to possibly
|
||||
incorrect or unexpected events will be shown.
|
||||
@item info
|
||||
Show informative messages during processing. This is in addition to
|
||||
warnings and errors. This is the default value.
|
||||
@item verbose
|
||||
Same as @code{info}, except more verbose.
|
||||
@item debug
|
||||
Show everything, including debugging information.
|
||||
@end table
|
||||
|
||||
By default the program logs to stderr, if coloring is supported by the
|
||||
@@ -202,61 +176,7 @@ ffmpeg -cpuflags -sse+mmx ...
|
||||
ffmpeg -cpuflags mmx ...
|
||||
ffmpeg -cpuflags 0 ...
|
||||
@end example
|
||||
Possible flags for this option are:
|
||||
@table @samp
|
||||
@item x86
|
||||
@table @samp
|
||||
@item mmx
|
||||
@item mmxext
|
||||
@item sse
|
||||
@item sse2
|
||||
@item sse2slow
|
||||
@item sse3
|
||||
@item sse3slow
|
||||
@item ssse3
|
||||
@item atom
|
||||
@item sse4.1
|
||||
@item sse4.2
|
||||
@item avx
|
||||
@item xop
|
||||
@item fma4
|
||||
@item 3dnow
|
||||
@item 3dnowext
|
||||
@item cmov
|
||||
@end table
|
||||
@item ARM
|
||||
@table @samp
|
||||
@item armv5te
|
||||
@item armv6
|
||||
@item armv6t2
|
||||
@item vfp
|
||||
@item vfpv3
|
||||
@item neon
|
||||
@end table
|
||||
@item PowerPC
|
||||
@table @samp
|
||||
@item altivec
|
||||
@end table
|
||||
@item Specific Processors
|
||||
@table @samp
|
||||
@item pentium2
|
||||
@item pentium3
|
||||
@item pentium4
|
||||
@item k6
|
||||
@item k62
|
||||
@item athlon
|
||||
@item athlonxp
|
||||
@item k8
|
||||
@end table
|
||||
@end table
|
||||
|
||||
@item -opencl_options options (@emph{global})
|
||||
Set OpenCL environment options. This option is only available when
|
||||
FFmpeg has been compiled with @code{--enable-opencl}.
|
||||
|
||||
@var{options} must be a list of @var{key}=@var{value} option pairs
|
||||
separated by ':'. See the ``OpenCL Options'' section in the
|
||||
ffmpeg-utils manual for the list of supported options.
|
||||
@end table
|
||||
|
||||
@section AVOptions
|
||||
@@ -281,12 +201,11 @@ muxer:
|
||||
ffmpeg -i input.flac -id3v2_version 3 out.mp3
|
||||
@end example
|
||||
|
||||
All codec AVOptions are per-stream, and thus a stream specifier
|
||||
should be attached to them.
|
||||
All codec AVOptions are obviously per-stream, so the chapter on stream
|
||||
specifiers applies to them
|
||||
|
||||
Note: the @option{-nooption} syntax cannot be used for boolean
|
||||
AVOptions, use @option{-option 0}/@option{-option 1}.
|
||||
Note @option{-nooption} syntax cannot be used for boolean AVOptions,
|
||||
use @option{-option 0}/@option{-option 1}.
|
||||
|
||||
Note: the 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.
|
||||
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.
|
||||
@@ -17,46 +17,9 @@ Below is a description of the currently available bitstream filters.
|
||||
|
||||
@section aac_adtstoasc
|
||||
|
||||
Convert MPEG-2/4 AAC ADTS to MPEG-4 Audio Specific Configuration
|
||||
bitstream filter.
|
||||
|
||||
This filter creates an MPEG-4 AudioSpecificConfig from an MPEG-2/4
|
||||
ADTS header and removes the ADTS header.
|
||||
|
||||
This is required for example when copying an AAC stream from a raw
|
||||
ADTS AAC container to a FLV or a MOV/MP4 file.
|
||||
|
||||
@section chomp
|
||||
|
||||
Remove zero padding at the end of a packet.
|
||||
|
||||
@section dump_extra
|
||||
|
||||
Add extradata to the beginning of the filtered packets.
|
||||
|
||||
The additional argument specifies which packets should be filtered.
|
||||
It accepts the values:
|
||||
@table @samp
|
||||
@item a
|
||||
add extradata to all key packets, but only if @var{local_header} is
|
||||
set in the @option{flags2} codec context field
|
||||
|
||||
@item k
|
||||
add extradata to all key packets
|
||||
|
||||
@item e
|
||||
add extradata to all packets
|
||||
@end table
|
||||
|
||||
If not specified it is assumed @samp{k}.
|
||||
|
||||
For example the following @command{ffmpeg} command forces a global
|
||||
header (thus disabling individual packet headers) in the H.264 packets
|
||||
generated by the @code{libx264} encoder, but corrects them by adding
|
||||
the header stored in extradata to the key packets:
|
||||
@example
|
||||
ffmpeg -i INPUT -map 0 -flags:v +global_header -c:v libx264 -bsf:v dump_extra out.ts
|
||||
@end example
|
||||
@section dump_extradata
|
||||
|
||||
@section h264_mp4toannexb
|
||||
|
||||
@@ -123,6 +86,6 @@ ffmpeg -i frame_%d.jpg -c:v copy rotated.avi
|
||||
|
||||
@section noise
|
||||
|
||||
@section remove_extra
|
||||
@section remove_extradata
|
||||
|
||||
@c man end BITSTREAM FILTERS
|
||||
|
||||
1087
doc/codecs.texi
1087
doc/codecs.texi
File diff suppressed because it is too large
Load Diff
@@ -62,7 +62,7 @@ documented.
|
||||
|
||||
@section libcelt
|
||||
|
||||
libcelt decoder wrapper.
|
||||
libcelt decoder wrapper
|
||||
|
||||
libcelt allows libavcodec to decode the Xiph CELT ultra-low delay audio codec.
|
||||
Requires the presence of the libcelt headers and library during configuration.
|
||||
@@ -70,7 +70,7 @@ You need to explicitly configure the build with @code{--enable-libcelt}.
|
||||
|
||||
@section libgsm
|
||||
|
||||
libgsm decoder wrapper.
|
||||
libgsm decoder wrapper
|
||||
|
||||
libgsm allows libavcodec to decode the GSM full rate audio codec. Requires
|
||||
the presence of the libgsm headers and library during configuration. You need
|
||||
@@ -80,7 +80,7 @@ This decoder supports both the ordinary GSM and the Microsoft variant.
|
||||
|
||||
@section libilbc
|
||||
|
||||
libilbc decoder wrapper.
|
||||
libilbc decoder wrapper
|
||||
|
||||
libilbc allows libavcodec to decode the Internet Low Bitrate Codec (iLBC)
|
||||
audio codec. Requires the presence of the libilbc headers and library during
|
||||
@@ -101,7 +101,7 @@ value is 0 (disabled).
|
||||
|
||||
@section libopencore-amrnb
|
||||
|
||||
libopencore-amrnb decoder wrapper.
|
||||
libopencore-amrnb decoder wrapper
|
||||
|
||||
libopencore-amrnb allows libavcodec to decode the Adaptive Multi-Rate
|
||||
Narrowband audio codec. Using it requires the presence of the
|
||||
@@ -158,45 +158,4 @@ ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1,
|
||||
7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b}.
|
||||
@end table
|
||||
|
||||
@section libzvbi-teletext
|
||||
|
||||
Libzvbi allows libavcodec to decode DVB teletext pages and DVB teletext
|
||||
subtitles. Requires the presence of the libzvbi headers and library during
|
||||
configuration. You need to explicitly configure the build with
|
||||
@code{--enable-libzvbi}.
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
@item txt_page
|
||||
List of teletext page numbers to decode. You may use the special * string to
|
||||
match all pages. Pages that do not match the specified list are dropped.
|
||||
Default value is *.
|
||||
@item txt_chop_top
|
||||
Discards the top teletext line. Default value is 1.
|
||||
@item txt_format
|
||||
Specifies the format of the decoded subtitles. The teletext decoder is capable
|
||||
of decoding the teletext pages to bitmaps or to simple text, you should use
|
||||
"bitmap" for teletext pages, because certain graphics and colors cannot be
|
||||
expressed in simple text. You might use "text" for teletext based subtitles if
|
||||
your application can handle simple text based subtitles. Default value is
|
||||
bitmap.
|
||||
@item txt_left
|
||||
X offset of generated bitmaps, default is 0.
|
||||
@item txt_top
|
||||
Y offset of generated bitmaps, default is 0.
|
||||
@item txt_chop_spaces
|
||||
Chops leading and trailing spaces and removes empty lines from the generated
|
||||
text. This option is useful for teletext based subtitles where empty spaces may
|
||||
be present at the start or at the end of the lines or empty lines may be
|
||||
present between the subtitle lines because of double-sized teletext charactes.
|
||||
Default value is 1.
|
||||
@item txt_duration
|
||||
Sets the display duration of the decoded teletext pages or subtitles in
|
||||
miliseconds. Default value is 30000 which is 30 seconds.
|
||||
@item txt_transparent
|
||||
Force transparent background of the generated teletext bitmaps. Default value
|
||||
is 0 which means an opaque (black) background.
|
||||
@end table
|
||||
|
||||
@c man end SUBTILES DECODERS
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
a.summary-letter {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #2D6198;
|
||||
}
|
||||
@@ -49,16 +45,11 @@ body {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
h1 a, h2 a, h3 a, h4 a {
|
||||
text-decoration: inherit;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4 {
|
||||
h1, h2, h3 {
|
||||
padding-left: 0.4em;
|
||||
border-radius: 4px;
|
||||
padding-bottom: 0.25em;
|
||||
padding-top: 0.25em;
|
||||
padding-bottom: 0.2em;
|
||||
padding-top: 0.2em;
|
||||
border: 1px solid #6A996A;
|
||||
}
|
||||
|
||||
@@ -72,22 +63,15 @@ h1 {
|
||||
|
||||
h2 {
|
||||
color: #313131;
|
||||
font-size: 1.0em;
|
||||
font-size: 0.9em;
|
||||
background-color: #ABE3AB;
|
||||
}
|
||||
|
||||
h3 {
|
||||
color: #313131;
|
||||
font-size: 0.9em;
|
||||
margin-bottom: -6px;
|
||||
background-color: #BBF3BB;
|
||||
}
|
||||
|
||||
h4 {
|
||||
color: #313131;
|
||||
font-size: 0.8em;
|
||||
margin-bottom: -8px;
|
||||
background-color: #D1FDD1;
|
||||
background-color: #BBF3BB;
|
||||
}
|
||||
|
||||
img {
|
||||
|
||||
@@ -1,155 +1,23 @@
|
||||
@chapter Demuxers
|
||||
@c man begin DEMUXERS
|
||||
|
||||
Demuxers are configured elements in FFmpeg that can read the
|
||||
Demuxers are configured elements in FFmpeg which allow to read the
|
||||
multimedia streams from a particular type of file.
|
||||
|
||||
When you configure your FFmpeg build, all the supported demuxers
|
||||
are enabled by default. You can list all available ones using the
|
||||
configure option @code{--list-demuxers}.
|
||||
configure option "--list-demuxers".
|
||||
|
||||
You can disable all the demuxers using the configure option
|
||||
@code{--disable-demuxers}, and selectively enable a single demuxer with
|
||||
the option @code{--enable-demuxer=@var{DEMUXER}}, or disable it
|
||||
with the option @code{--disable-demuxer=@var{DEMUXER}}.
|
||||
"--disable-demuxers", and selectively enable a single demuxer with
|
||||
the option "--enable-demuxer=@var{DEMUXER}", or disable it
|
||||
with the option "--disable-demuxer=@var{DEMUXER}".
|
||||
|
||||
The option @code{-formats} of the ff* tools will display the list of
|
||||
The option "-formats" of the ff* tools will display the list of
|
||||
enabled demuxers.
|
||||
|
||||
The description of some of the currently available demuxers follows.
|
||||
|
||||
@section applehttp
|
||||
|
||||
Apple HTTP Live Streaming demuxer.
|
||||
|
||||
This demuxer presents all AVStreams from all variant streams.
|
||||
The id field is set to the bitrate variant index number. By setting
|
||||
the discard flags on AVStreams (by pressing 'a' or 'v' in ffplay),
|
||||
the caller can decide which variant streams to actually receive.
|
||||
The total bitrate of the variant that the stream belongs to is
|
||||
available in a metadata key named "variant_bitrate".
|
||||
|
||||
@section asf
|
||||
|
||||
Advanced Systems Format demuxer.
|
||||
|
||||
This demuxer is used to demux ASF files and MMS network streams.
|
||||
|
||||
@table @option
|
||||
@item -no_resync_search @var{bool}
|
||||
Do not try to resynchronize by looking for a certain optional start code.
|
||||
@end table
|
||||
|
||||
@anchor{concat}
|
||||
@section concat
|
||||
|
||||
Virtual concatenation script demuxer.
|
||||
|
||||
This demuxer reads a list of files and other directives from a text file and
|
||||
demuxes them one after the other, as if all their packet had been muxed
|
||||
together.
|
||||
|
||||
The timestamps in the files are adjusted so that the first file starts at 0
|
||||
and each next file starts where the previous one finishes. Note that it is
|
||||
done globally and may cause gaps if all streams do not have exactly the same
|
||||
length.
|
||||
|
||||
All files must have the same streams (same codecs, same time base, etc.).
|
||||
|
||||
The duration of each file is used to adjust the timestamps of the next file:
|
||||
if the duration is incorrect (because it was computed using the bit-rate or
|
||||
because the file is truncated, for example), it can cause artifacts. The
|
||||
@code{duration} directive can be used to override the duration stored in
|
||||
each file.
|
||||
|
||||
@subsection Syntax
|
||||
|
||||
The script is a text file in extended-ASCII, with one directive per line.
|
||||
Empty lines, leading spaces and lines starting with '#' are ignored. The
|
||||
following directive is recognized:
|
||||
|
||||
@table @option
|
||||
|
||||
@item @code{file @var{path}}
|
||||
Path to a file to read; special characters and spaces must be escaped with
|
||||
backslash or single quotes.
|
||||
|
||||
All subsequent directives apply to that file.
|
||||
|
||||
@item @code{ffconcat version 1.0}
|
||||
Identify the script type and version. It also sets the @option{safe} option
|
||||
to 1 if it was to its default -1.
|
||||
|
||||
To make FFmpeg recognize the format automatically, this directive must
|
||||
appears exactly as is (no extra space or byte-order-mark) on the very first
|
||||
line of the script.
|
||||
|
||||
@item @code{duration @var{dur}}
|
||||
Duration of the file. This information can be specified from the file;
|
||||
specifying it here may be more efficient or help if the information from the
|
||||
file is not available or accurate.
|
||||
|
||||
If the duration is set for all files, then it is possible to seek in the
|
||||
whole concatenated video.
|
||||
|
||||
@end table
|
||||
|
||||
@subsection Options
|
||||
|
||||
This demuxer accepts the following option:
|
||||
|
||||
@table @option
|
||||
|
||||
@item safe
|
||||
If set to 1, reject unsafe file paths. A file path is considered safe if it
|
||||
does not contain a protocol specification and is relative and all components
|
||||
only contain characters from the portable character set (letters, digits,
|
||||
period, underscore and hyphen) and have no period at the beginning of a
|
||||
component.
|
||||
|
||||
If set to 0, any file name is accepted.
|
||||
|
||||
The default is -1, it is equivalent to 1 if the format was automatically
|
||||
probed and 0 otherwise.
|
||||
|
||||
@end table
|
||||
|
||||
@section flv
|
||||
|
||||
Adobe Flash Video Format demuxer.
|
||||
|
||||
This demuxer is used to demux FLV files and RTMP network streams.
|
||||
|
||||
@table @option
|
||||
@item -flv_metadata @var{bool}
|
||||
Allocate the streams according to the onMetaData array content.
|
||||
@end table
|
||||
|
||||
@section libgme
|
||||
|
||||
The Game Music Emu library is a collection of video game music file emulators.
|
||||
|
||||
See @url{http://code.google.com/p/game-music-emu/} for more information.
|
||||
|
||||
Some files have multiple tracks. The demuxer will pick the first track by
|
||||
default. The @option{track_index} option can be used to select a different
|
||||
track. Track indexes start at 0. The demuxer exports the number of tracks as
|
||||
@var{tracks} meta data entry.
|
||||
|
||||
For very large files, the @option{max_size} option may have to be adjusted.
|
||||
|
||||
@section libquvi
|
||||
|
||||
Play media from Internet services using the quvi project.
|
||||
|
||||
The demuxer accepts a @option{format} option to request a specific quality. It
|
||||
is by default set to @var{best}.
|
||||
|
||||
See @url{http://quvi.sourceforge.net/} for more information.
|
||||
|
||||
FFmpeg needs to be built with @code{--enable-libquvi} for this demuxer to be
|
||||
enabled.
|
||||
|
||||
@section image2
|
||||
|
||||
Image file demuxer.
|
||||
@@ -167,7 +35,7 @@ same for all the files in the sequence.
|
||||
This demuxer accepts the following options:
|
||||
@table @option
|
||||
@item framerate
|
||||
Set the frame rate for the video stream. It defaults to 25.
|
||||
Set the framerate for the video stream. It defaults to 25.
|
||||
@item loop
|
||||
If set to 1, loop over the input. Default value is 0.
|
||||
@item pattern_type
|
||||
@@ -245,10 +113,6 @@ to read from. Default value is 0.
|
||||
Set the index interval range to check when looking for the first image
|
||||
file in the sequence, starting from @var{start_number}. Default value
|
||||
is 5.
|
||||
@item ts_from_file
|
||||
If set to 1, will set frame timestamp to modification time of image file. Note
|
||||
that monotonity of timestamps is not provided: images go in the same order as
|
||||
without this option. Default value is 0.
|
||||
@item video_size
|
||||
Set the video size of the images to read. If not specified the video
|
||||
size is guessed from the first image file in the sequence.
|
||||
@@ -262,64 +126,33 @@ Use @command{ffmpeg} for creating a video from the images in the file
|
||||
sequence @file{img-001.jpeg}, @file{img-002.jpeg}, ..., assuming an
|
||||
input frame rate of 10 frames per second:
|
||||
@example
|
||||
ffmpeg -framerate 10 -i 'img-%03d.jpeg' out.mkv
|
||||
ffmpeg -i 'img-%03d.jpeg' -r 10 out.mkv
|
||||
@end example
|
||||
|
||||
@item
|
||||
As above, but start by reading from a file with index 100 in the sequence:
|
||||
@example
|
||||
ffmpeg -framerate 10 -start_number 100 -i 'img-%03d.jpeg' out.mkv
|
||||
ffmpeg -start_number 100 -i 'img-%03d.jpeg' -r 10 out.mkv
|
||||
@end example
|
||||
|
||||
@item
|
||||
Read images matching the "*.png" glob pattern , that is all the files
|
||||
terminating with the ".png" suffix:
|
||||
@example
|
||||
ffmpeg -framerate 10 -pattern_type glob -i "*.png" out.mkv
|
||||
ffmpeg -pattern_type glob -i "*.png" -r 10 out.mkv
|
||||
@end example
|
||||
@end itemize
|
||||
|
||||
@section mpegts
|
||||
@section applehttp
|
||||
|
||||
MPEG-2 transport stream demuxer.
|
||||
Apple HTTP Live Streaming demuxer.
|
||||
|
||||
@table @option
|
||||
|
||||
@item fix_teletext_pts
|
||||
Overrides teletext packet PTS and DTS values with the timestamps calculated
|
||||
from the PCR of the first program which the teletext stream is part of and is
|
||||
not discarded. Default value is 1, set this option to 0 if you want your
|
||||
teletext packet PTS and DTS values untouched.
|
||||
@end table
|
||||
|
||||
@section rawvideo
|
||||
|
||||
Raw video demuxer.
|
||||
|
||||
This demuxer allows to read raw video data. Since there is no header
|
||||
specifying the assumed video parameters, the user must specify them
|
||||
in order to be able to decode the data correctly.
|
||||
|
||||
This demuxer accepts the following options:
|
||||
@table @option
|
||||
|
||||
@item framerate
|
||||
Set input video frame rate. Default value is 25.
|
||||
|
||||
@item pixel_format
|
||||
Set the input video pixel format. Default value is @code{yuv420p}.
|
||||
|
||||
@item video_size
|
||||
Set the input video size. This value must be specified explicitly.
|
||||
@end table
|
||||
|
||||
For example to read a rawvideo file @file{input.raw} with
|
||||
@command{ffplay}, assuming a pixel format of @code{rgb24}, a video
|
||||
size of @code{320x240}, and a frame rate of 10 images per second, use
|
||||
the command:
|
||||
@example
|
||||
ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw
|
||||
@end example
|
||||
This demuxer presents all AVStreams from all variant streams.
|
||||
The id field is set to the bitrate variant index number. By setting
|
||||
the discard flags on AVStreams (by pressing 'a' or 'v' in ffplay),
|
||||
the caller can decide which variant streams to actually receive.
|
||||
The total bitrate of the variant that the stream belongs to is
|
||||
available in a metadata key named "variant_bitrate".
|
||||
|
||||
@section sbg
|
||||
|
||||
@@ -351,6 +184,37 @@ 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.
|
||||
|
||||
@section concat
|
||||
|
||||
Virtual concatenation script demuxer.
|
||||
|
||||
This demuxer reads a list of files and other directives from a text file and
|
||||
demuxes them one after the other, as if all their packet had been muxed
|
||||
together.
|
||||
|
||||
The timestamps in the files are adjusted so that the first file starts at 0
|
||||
and each next file starts where the previous one finishes. Note that it is
|
||||
done globally and may cause gaps if all streams do not have exactly the same
|
||||
length.
|
||||
|
||||
All files must have the same streams (same codecs, same time base, etc.).
|
||||
|
||||
This script format can currently not be probed, it must be specified explicitly.
|
||||
|
||||
@subsection Syntax
|
||||
|
||||
The script is a text file in extended-ASCII, with one directive per line.
|
||||
Empty lines, leading spaces and lines starting with '#' are ignored. The
|
||||
following directive is recognized:
|
||||
|
||||
@table @option
|
||||
|
||||
@item @code{file @var{path}}
|
||||
Path to a file to read; special characters and spaces must be escaped with
|
||||
backslash or single quotes.
|
||||
|
||||
@end table
|
||||
|
||||
@section tedcaptions
|
||||
|
||||
JSON captions used for @url{http://www.ted.com/, TED Talks}.
|
||||
@@ -372,4 +236,4 @@ Example: convert the captions to a format most players understand:
|
||||
ffmpeg -i http://www.ted.com/talks/subtitles/id/1/lang/en talk1-en.srt
|
||||
@end example
|
||||
|
||||
@c man end DEMUXERS
|
||||
@c man end INPUT DEVICES
|
||||
|
||||
@@ -11,23 +11,29 @@
|
||||
|
||||
@chapter Developers Guide
|
||||
|
||||
@section Notes for external developers
|
||||
@section API
|
||||
@itemize @bullet
|
||||
@item libavcodec is the library containing the codecs (both encoding and
|
||||
decoding). Look at @file{doc/examples/decoding_encoding.c} to see how to use
|
||||
it.
|
||||
|
||||
This document is mostly useful for internal FFmpeg developers.
|
||||
External developers who need to use the API in their application should
|
||||
refer to the API doxygen documentation in the public headers, and
|
||||
check the examples in @file{doc/examples} and in the source code to
|
||||
see how the public API is employed.
|
||||
@item libavformat is the library containing the file format handling (mux and
|
||||
demux code for several formats). Look at @file{ffplay.c} to use it in a
|
||||
player. See @file{doc/examples/muxing.c} to use it to generate audio or video
|
||||
streams.
|
||||
|
||||
You can use the FFmpeg libraries in your commercial program, but you
|
||||
are encouraged to @emph{publish any patch you make}. In this case the
|
||||
best way to proceed is to send your patches to the ffmpeg-devel
|
||||
mailing list following the guidelines illustrated in the remainder of
|
||||
this document.
|
||||
@end itemize
|
||||
|
||||
For more detailed legal information about the use of FFmpeg in
|
||||
external programs read the @file{LICENSE} file in the source tree and
|
||||
consult @url{http://ffmpeg.org/legal.html}.
|
||||
@section Integrating libavcodec or libavformat in your program
|
||||
|
||||
You can integrate all the source code of the libraries to link them
|
||||
statically to avoid any version problem. All you need is to provide a
|
||||
'config.mak' and a 'config.h' in the parent directory. See the defines
|
||||
generated by ./configure to understand what is needed.
|
||||
|
||||
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
|
||||
to send your patches to the FFmpeg mailing list.
|
||||
|
||||
@section Contributing
|
||||
|
||||
@@ -51,16 +57,13 @@ and should try to fix issues their commit causes.
|
||||
@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.
|
||||
@@ -114,17 +117,13 @@ int myfunc(int my_parameter)
|
||||
|
||||
FFmpeg is programmed in the ISO C90 language with a few additional
|
||||
features from ISO C99, namely:
|
||||
|
||||
@itemize @bullet
|
||||
@item
|
||||
the @samp{inline} keyword;
|
||||
|
||||
@item
|
||||
@samp{//} comments;
|
||||
|
||||
@item
|
||||
designated struct initializers (@samp{struct s x = @{ .i = 17 @};})
|
||||
|
||||
@item
|
||||
compound literals (@samp{x = (struct s) @{ 17, 23 @};})
|
||||
@end itemize
|
||||
@@ -136,72 +135,46 @@ clarity and performance.
|
||||
All code must compile with recent versions of GCC and a number of other
|
||||
currently supported compilers. To ensure compatibility, please do not use
|
||||
additional C99 features or GCC extensions. Especially watch out for:
|
||||
|
||||
@itemize @bullet
|
||||
@item
|
||||
mixing statements and declarations;
|
||||
|
||||
@item
|
||||
@samp{long long} (use @samp{int64_t} instead);
|
||||
|
||||
@item
|
||||
@samp{__attribute__} not protected by @samp{#ifdef __GNUC__} or similar;
|
||||
|
||||
@item
|
||||
GCC statement expressions (@samp{(x = (@{ int y = 4; y; @})}).
|
||||
@end itemize
|
||||
|
||||
@subsection Naming conventions
|
||||
All names should be composed with underscores (_), not CamelCase. For example,
|
||||
@samp{avfilter_get_video_buffer} is an acceptable function name and
|
||||
@samp{AVFilterGetVideo} is not. The exception from this are type names, like
|
||||
All names are using underscores (_), not CamelCase. For example, @samp{avfilter_get_video_buffer} is
|
||||
a valid function name and @samp{AVFilterGetVideo} is not. The exception from this are type names, like
|
||||
for example structs and enums; they should always be in the CamelCase
|
||||
|
||||
There are the following conventions for naming variables and functions:
|
||||
|
||||
There are following conventions for naming variables and functions:
|
||||
@itemize @bullet
|
||||
@item
|
||||
For local variables no prefix is required.
|
||||
|
||||
@item
|
||||
For file-scope variables and functions declared as @code{static}, no prefix
|
||||
is required.
|
||||
|
||||
For variables and functions declared as @code{static} no prefixes are required.
|
||||
@item
|
||||
For variables and functions visible outside of file scope, but only used
|
||||
internally by a library, an @code{ff_} prefix should be used,
|
||||
e.g. @samp{ff_w64_demuxer}.
|
||||
|
||||
For variables and functions used internally by the library, @code{ff_} prefix
|
||||
should be used.
|
||||
For example, @samp{ff_w64_demuxer}.
|
||||
@item
|
||||
For variables and functions visible outside of file scope, used internally
|
||||
across multiple libraries, use @code{avpriv_} as prefix, for example,
|
||||
@samp{avpriv_aac_parse_header}.
|
||||
|
||||
For variables and functions used internally across multiple libraries, use
|
||||
@code{avpriv_}. For example, @samp{avpriv_aac_parse_header}.
|
||||
@item
|
||||
Each library has its own prefix for public symbols, in addition to the
|
||||
commonly used @code{av_} (@code{avformat_} for libavformat,
|
||||
@code{avcodec_} for libavcodec, @code{swr_} for libswresample, etc).
|
||||
Check the existing code and choose names accordingly.
|
||||
Note that some symbols without these prefixes are also exported for
|
||||
retro-compatibility reasons. These exceptions are declared in the
|
||||
@code{lib<name>/lib<name>.v} files.
|
||||
For exported names, each library has its own prefixes. Just check the existing
|
||||
code and name accordingly.
|
||||
@end itemize
|
||||
|
||||
Furthermore, name space reserved for the system should not be invaded.
|
||||
Identifiers ending in @code{_t} are reserved by
|
||||
@url{http://pubs.opengroup.org/onlinepubs/007904975/functions/xsh_chap02_02.html#tag_02_02_02, POSIX}.
|
||||
Also avoid names starting with @code{__} or @code{_} followed by an uppercase
|
||||
letter as they are reserved by the C standard. Names starting with @code{_}
|
||||
are reserved at the file level and may not be used for externally visible
|
||||
symbols. If in doubt, just avoid names starting with @code{_} altogether.
|
||||
|
||||
@subsection Miscellaneous conventions
|
||||
|
||||
@itemize @bullet
|
||||
@item
|
||||
fprintf and printf are forbidden in libavformat and libavcodec,
|
||||
please use av_log() instead.
|
||||
|
||||
@item
|
||||
Casts should be used only when necessary. Unneeded parentheses
|
||||
should also be avoided if they don't make the code easier to understand.
|
||||
@@ -244,158 +217,125 @@ For Emacs, add these roughly equivalent lines to your @file{.emacs.d/init.el}:
|
||||
|
||||
@enumerate
|
||||
@item
|
||||
Contributions should be licensed under the
|
||||
@uref{http://www.gnu.org/licenses/lgpl-2.1.html, LGPL 2.1},
|
||||
including an "or any later version" clause, or, if you prefer
|
||||
a gift-style license, the
|
||||
@uref{http://www.isc.org/software/license/, ISC} or
|
||||
@uref{http://mit-license.org/, MIT} license.
|
||||
@uref{http://www.gnu.org/licenses/gpl-2.0.html, GPL 2} including
|
||||
an "or any later version" clause is also acceptable, but LGPL is
|
||||
preferred.
|
||||
If you add a new file, give it a proper license header. Do not copy and
|
||||
paste it from a random place, use an existing file as template.
|
||||
|
||||
Contributions should be licensed under the LGPL 2.1, including an
|
||||
"or any later version" clause, or the MIT license. GPL 2 including
|
||||
an "or any later version" clause is also acceptable, but LGPL is
|
||||
preferred.
|
||||
@item
|
||||
You must not commit code which breaks FFmpeg! (Meaning unfinished but
|
||||
enabled code which breaks compilation or compiles but does not work or
|
||||
breaks the regression tests)
|
||||
You can commit unfinished stuff (for testing etc), but it must be disabled
|
||||
(#ifdef etc) by default so it does not interfere with other developers'
|
||||
work.
|
||||
|
||||
You must not commit code which breaks FFmpeg! (Meaning unfinished but
|
||||
enabled code which breaks compilation or compiles but does not work or
|
||||
breaks the regression tests)
|
||||
You can commit unfinished stuff (for testing etc), but it must be disabled
|
||||
(#ifdef etc) by default so it does not interfere with other developers'
|
||||
work.
|
||||
@item
|
||||
The commit message should have a short first line in the form of
|
||||
a @samp{topic: short description} as a header, separated by a newline
|
||||
from the body consisting of an explanation of why the change is necessary.
|
||||
If the commit fixes a known bug on the bug tracker, the commit message
|
||||
should include its bug ID. Referring to the issue on the bug tracker does
|
||||
not exempt you from writing an excerpt of the bug in the commit message.
|
||||
|
||||
You do not have to over-test things. If it works for you, and you think it
|
||||
should work for others, then commit. If your code has problems
|
||||
(portability, triggers compiler bugs, unusual environment etc) they will be
|
||||
reported and eventually fixed.
|
||||
@item
|
||||
You do not have to over-test things. If it works for you, and you think it
|
||||
should work for others, then commit. If your code has problems
|
||||
(portability, triggers compiler bugs, unusual environment etc) they will be
|
||||
reported and eventually fixed.
|
||||
|
||||
Do not commit unrelated changes together, split them into self-contained
|
||||
pieces. Also do not forget that if part B depends on part A, but A does not
|
||||
depend on B, then A can and should be committed first and separate from B.
|
||||
Keeping changes well split into self-contained parts makes reviewing and
|
||||
understanding them on the commit log mailing list easier. This also helps
|
||||
in case of debugging later on.
|
||||
Also if you have doubts about splitting or not splitting, do not hesitate to
|
||||
ask/discuss it on the developer mailing list.
|
||||
@item
|
||||
Do not commit unrelated changes together, split them into self-contained
|
||||
pieces. Also do not forget that if part B depends on part A, but A does not
|
||||
depend on B, then A can and should be committed first and separate from B.
|
||||
Keeping changes well split into self-contained parts makes reviewing and
|
||||
understanding them on the commit log mailing list easier. This also helps
|
||||
in case of debugging later on.
|
||||
Also if you have doubts about splitting or not splitting, do not hesitate to
|
||||
ask/discuss it on the developer mailing list.
|
||||
Do not change behavior of the programs (renaming options etc) or public
|
||||
API or ABI without first discussing it on the ffmpeg-devel mailing list.
|
||||
Do not remove functionality from the code. Just improve!
|
||||
|
||||
Note: Redundant code can be removed.
|
||||
@item
|
||||
Do not change behavior of the programs (renaming options etc) or public
|
||||
API or ABI without first discussing it on the ffmpeg-devel mailing list.
|
||||
Do not remove functionality from the code. Just improve!
|
||||
|
||||
Note: Redundant code can be removed.
|
||||
|
||||
Do not commit changes to the build system (Makefiles, configure script)
|
||||
which change behavior, defaults etc, without asking first. The same
|
||||
applies to compiler warning fixes, trivial looking fixes and to code
|
||||
maintained by other developers. We usually have a reason for doing things
|
||||
the way we do. Send your changes as patches to the ffmpeg-devel mailing
|
||||
list, and if the code maintainers say OK, you may commit. This does not
|
||||
apply to files you wrote and/or maintain.
|
||||
@item
|
||||
Do not commit changes to the build system (Makefiles, configure script)
|
||||
which change behavior, defaults etc, without asking first. The same
|
||||
applies to compiler warning fixes, trivial looking fixes and to code
|
||||
maintained by other developers. We usually have a reason for doing things
|
||||
the way we do. Send your changes as patches to the ffmpeg-devel mailing
|
||||
list, and if the code maintainers say OK, you may commit. This does not
|
||||
apply to files you wrote and/or maintain.
|
||||
We refuse source indentation and other cosmetic changes if they are mixed
|
||||
with functional changes, such commits will be rejected and removed. Every
|
||||
developer has his own indentation style, you should not change it. Of course
|
||||
if you (re)write something, you can use your own style, even though we would
|
||||
prefer if the indentation throughout FFmpeg was consistent (Many projects
|
||||
force a given indentation style - we do not.). If you really need to make
|
||||
indentation changes (try to avoid this), separate them strictly from real
|
||||
changes.
|
||||
|
||||
NOTE: If you had to put if()@{ .. @} over a large (> 5 lines) chunk of code,
|
||||
then either do NOT change the indentation of the inner part within (do not
|
||||
move it to the right)! or do so in a separate commit
|
||||
@item
|
||||
We refuse source indentation and other cosmetic changes if they are mixed
|
||||
with functional changes, such commits will be rejected and removed. Every
|
||||
developer has his own indentation style, you should not change it. Of course
|
||||
if you (re)write something, you can use your own style, even though we would
|
||||
prefer if the indentation throughout FFmpeg was consistent (Many projects
|
||||
force a given indentation style - we do not.). If you really need to make
|
||||
indentation changes (try to avoid this), separate them strictly from real
|
||||
changes.
|
||||
|
||||
NOTE: If you had to put if()@{ .. @} over a large (> 5 lines) chunk of code,
|
||||
then either do NOT change the indentation of the inner part within (do not
|
||||
move it to the right)! or do so in a separate commit
|
||||
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
|
||||
particular bug. Comments such as "fixed!" or "Changed it." are unacceptable.
|
||||
Recommended format:
|
||||
area changed: Short 1 line description
|
||||
|
||||
details describing what and why and giving references.
|
||||
@item
|
||||
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
|
||||
particular bug. Comments such as "fixed!" or "Changed it." are unacceptable.
|
||||
Recommended format:
|
||||
area changed: Short 1 line description
|
||||
|
||||
details describing what and why and giving references.
|
||||
|
||||
Make sure the author of the commit is set correctly. (see git commit --author)
|
||||
If you apply a patch, send an
|
||||
answer to ffmpeg-devel (or wherever you got the patch from) saying that
|
||||
you applied the patch.
|
||||
@item
|
||||
Make sure the author of the commit is set correctly. (see git commit --author)
|
||||
If you apply a patch, send an
|
||||
answer to ffmpeg-devel (or wherever you got the patch from) saying that
|
||||
you applied the patch.
|
||||
|
||||
When applying patches that have been discussed (at length) on the mailing
|
||||
list, reference the thread in the log message.
|
||||
@item
|
||||
When applying patches that have been discussed (at length) on the mailing
|
||||
list, reference the thread in the log message.
|
||||
|
||||
Do NOT commit to code actively maintained by others without permission.
|
||||
Send a patch to ffmpeg-devel instead. If no one answers within a reasonable
|
||||
timeframe (12h for build failures and security fixes, 3 days small changes,
|
||||
1 week for big patches) then commit your patch if you think it is OK.
|
||||
Also note, the maintainer can simply ask for more time to review!
|
||||
@item
|
||||
Do NOT commit to code actively maintained by others without permission.
|
||||
Send a patch to ffmpeg-devel instead. If no one answers within a reasonable
|
||||
timeframe (12h for build failures and security fixes, 3 days small changes,
|
||||
1 week for big patches) then commit your patch if you think it is OK.
|
||||
Also note, the maintainer can simply ask for more time to review!
|
||||
|
||||
Subscribe to the ffmpeg-cvslog mailing list. The diffs of all commits
|
||||
are sent there and reviewed by all the other developers. Bugs and possible
|
||||
improvements or general questions regarding commits are discussed there. We
|
||||
expect you to react if problems with your code are uncovered.
|
||||
@item
|
||||
Subscribe to the ffmpeg-cvslog mailing list. The diffs of all commits
|
||||
are sent there and reviewed by all the other developers. Bugs and possible
|
||||
improvements or general questions regarding commits are discussed there. We
|
||||
expect you to react if problems with your code are uncovered.
|
||||
|
||||
Update the documentation if you change behavior or add features. If you are
|
||||
unsure how best to do this, send a patch to ffmpeg-devel, the documentation
|
||||
maintainer(s) will review and commit your stuff.
|
||||
@item
|
||||
Update the documentation if you change behavior or add features. If you are
|
||||
unsure how best to do this, send a patch to ffmpeg-devel, the documentation
|
||||
maintainer(s) will review and commit your stuff.
|
||||
|
||||
Try to keep important discussions and requests (also) on the public
|
||||
developer mailing list, so that all developers can benefit from them.
|
||||
@item
|
||||
Try to keep important discussions and requests (also) on the public
|
||||
developer mailing list, so that all developers can benefit from them.
|
||||
|
||||
Never write to unallocated memory, never write over the end of arrays,
|
||||
always check values read from some untrusted source before using them
|
||||
as array index or other risky things.
|
||||
@item
|
||||
Never write to unallocated memory, never write over the end of arrays,
|
||||
always check values read from some untrusted source before using them
|
||||
as array index or other risky things.
|
||||
|
||||
Remember to check if you need to bump versions for the specific libav*
|
||||
parts (libavutil, libavcodec, libavformat) you are changing. You need
|
||||
to change the version integer.
|
||||
Incrementing the first component means no backward compatibility to
|
||||
previous versions (e.g. removal of a function from the public API).
|
||||
Incrementing the second component means backward compatible change
|
||||
(e.g. addition of a function to the public API or extension of an
|
||||
existing data structure).
|
||||
Incrementing the third component means a noteworthy binary compatible
|
||||
change (e.g. encoder bug fix that matters for the decoder). The third
|
||||
component always starts at 100 to distinguish FFmpeg from Libav.
|
||||
@item
|
||||
Remember to check if you need to bump versions for the specific libav*
|
||||
parts (libavutil, libavcodec, libavformat) you are changing. You need
|
||||
to change the version integer.
|
||||
Incrementing the first component means no backward compatibility to
|
||||
previous versions (e.g. removal of a function from the public API).
|
||||
Incrementing the second component means backward compatible change
|
||||
(e.g. addition of a function to the public API or extension of an
|
||||
existing data structure).
|
||||
Incrementing the third component means a noteworthy binary compatible
|
||||
change (e.g. encoder bug fix that matters for the decoder). The third
|
||||
component always starts at 100 to distinguish FFmpeg from Libav.
|
||||
|
||||
Compiler warnings indicate potential bugs or code with bad style. If a type of
|
||||
warning always points to correct and clean code, that warning should
|
||||
be disabled, not the code changed.
|
||||
Thus the remaining warnings can either be bugs or correct code.
|
||||
If it is a bug, the bug has to be fixed. If it is not, the code should
|
||||
be changed to not generate a warning unless that causes a slowdown
|
||||
or obfuscates the code.
|
||||
@item
|
||||
Compiler warnings indicate potential bugs or code with bad style. If a type of
|
||||
warning always points to correct and clean code, that warning should
|
||||
be disabled, not the code changed.
|
||||
Thus the remaining warnings can either be bugs or correct code.
|
||||
If it is a bug, the bug has to be fixed. If it is not, the code should
|
||||
be changed to not generate a warning unless that causes a slowdown
|
||||
or obfuscates the code.
|
||||
|
||||
@item
|
||||
Make sure that no parts of the codebase that you maintain are missing from the
|
||||
@file{MAINTAINERS} file. If something that you want to maintain is missing add it with
|
||||
your name after it.
|
||||
If at some point you no longer want to maintain some code, then please help
|
||||
finding a new maintainer and also don't forget updating the @file{MAINTAINERS} file.
|
||||
If you add a new file, give it a proper license header. Do not copy and
|
||||
paste it from a random place, use an existing file as template.
|
||||
@end enumerate
|
||||
|
||||
We think our rules are not too hard. If you have comments, contact us.
|
||||
|
||||
Note, these rules are mostly borrowed from the MPlayer project.
|
||||
|
||||
@anchor{Submitting patches}
|
||||
@section Submitting patches
|
||||
|
||||
@@ -418,6 +358,11 @@ The tool is located in the tools directory.
|
||||
Run the @ref{Regression tests} before submitting a patch in order to verify
|
||||
it does not cause unexpected problems.
|
||||
|
||||
Patches should be posted as base64 encoded attachments (or any other
|
||||
encoding which ensures that the patch will not be trashed during
|
||||
transmission) to the ffmpeg-devel mailing list, see
|
||||
@url{http://lists.ffmpeg.org/mailman/listinfo/ffmpeg-devel}
|
||||
|
||||
It also helps quite a bit if you tell us what the patch does (for example
|
||||
'replaces lrint by lrintf'), and why (for example '*BSD isn't C99 compliant
|
||||
and has no lrint()')
|
||||
@@ -425,13 +370,6 @@ and has no lrint()')
|
||||
Also please if you send several patches, send each patch as a separate mail,
|
||||
do not attach several unrelated patches to the same mail.
|
||||
|
||||
Patches should be posted to the
|
||||
@uref{http://lists.ffmpeg.org/mailman/listinfo/ffmpeg-devel, ffmpeg-devel}
|
||||
mailing list. Use @code{git send-email} when possible since it will properly
|
||||
send patches without requiring extra care. If you cannot, then send patches
|
||||
as base64-encoded attachments, so your patch is not trashed during
|
||||
transmission.
|
||||
|
||||
Your patch will be reviewed on the mailing list. You will likely be asked
|
||||
to make some changes and are expected to send in an improved version that
|
||||
incorporates the requests from the review. This process may go through
|
||||
@@ -446,51 +384,40 @@ send a reminder by email. Your patch should eventually be dealt with.
|
||||
|
||||
@enumerate
|
||||
@item
|
||||
Did you use av_cold for codec initialization and close functions?
|
||||
|
||||
Did you use av_cold for codec initialization and close functions?
|
||||
@item
|
||||
Did you add a long_name under NULL_IF_CONFIG_SMALL to the AVCodec or
|
||||
AVInputFormat/AVOutputFormat struct?
|
||||
|
||||
Did you add a long_name under NULL_IF_CONFIG_SMALL to the AVCodec or
|
||||
AVInputFormat/AVOutputFormat struct?
|
||||
@item
|
||||
Did you bump the minor version number (and reset the micro version
|
||||
number) in @file{libavcodec/version.h} or @file{libavformat/version.h}?
|
||||
|
||||
Did you bump the minor version number (and reset the micro version
|
||||
number) in @file{libavcodec/version.h} or @file{libavformat/version.h}?
|
||||
@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
|
||||
Did you add the AVCodecID to @file{avcodec.h}?
|
||||
When adding new codec IDs, also add an entry to the codec descriptor
|
||||
list in @file{libavcodec/codec_desc.c}.
|
||||
|
||||
Did you add the AVCodecID to @file{avcodec.h}?
|
||||
When adding new codec IDs, also add an entry to the codec descriptor
|
||||
list in @file{libavcodec/codec_desc.c}.
|
||||
@item
|
||||
If it has a FourCC, did you add it to @file{libavformat/riff.c},
|
||||
even if it is only a decoder?
|
||||
|
||||
If it has a fourCC, did you add it to @file{libavformat/riff.c},
|
||||
even if it is only a decoder?
|
||||
@item
|
||||
Did you add a rule to compile the appropriate files in the Makefile?
|
||||
Remember to do this even if you're just adding a format to a file that is
|
||||
already being compiled by some other rule, like a raw demuxer.
|
||||
|
||||
Did you add a rule to compile the appropriate files in the Makefile?
|
||||
Remember to do this even if you're just adding a format to a file that is
|
||||
already being compiled by some other rule, like a raw demuxer.
|
||||
@item
|
||||
Did you add an entry to the table of supported formats or codecs in
|
||||
@file{doc/general.texi}?
|
||||
|
||||
Did you add an entry to the table of supported formats or codecs in
|
||||
@file{doc/general.texi}?
|
||||
@item
|
||||
Did you add an entry in the Changelog?
|
||||
|
||||
Did you add an entry in the Changelog?
|
||||
@item
|
||||
If it depends on a parser or a library, did you add that dependency in
|
||||
configure?
|
||||
|
||||
If it depends on a parser or a library, did you add that dependency in
|
||||
configure?
|
||||
@item
|
||||
Did you @code{git add} the appropriate files before committing?
|
||||
|
||||
Did you @code{git add} the appropriate files before committing?
|
||||
@item
|
||||
Did you make sure it compiles standalone, i.e. with
|
||||
@code{configure --disable-everything --enable-decoder=foo}
|
||||
(or @code{--enable-demuxer} or whatever your component is)?
|
||||
Did you make sure it compiles standalone, i.e. with
|
||||
@code{configure --disable-everything --enable-decoder=foo}
|
||||
(or @code{--enable-demuxer} or whatever your component is)?
|
||||
@end enumerate
|
||||
|
||||
|
||||
@@ -498,109 +425,77 @@ Did you make sure it compiles standalone, i.e. with
|
||||
|
||||
@enumerate
|
||||
@item
|
||||
Does @code{make fate} pass with the patch applied?
|
||||
|
||||
Does @code{make fate} pass with the patch applied?
|
||||
@item
|
||||
Was the patch generated with git format-patch or send-email?
|
||||
|
||||
Was the patch generated with git format-patch or send-email?
|
||||
@item
|
||||
Did you sign off your patch? (git commit -s)
|
||||
See @url{http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob_plain;f=Documentation/SubmittingPatches} for the meaning
|
||||
of sign off.
|
||||
|
||||
Did you sign off your patch? (git commit -s)
|
||||
See @url{http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob_plain;f=Documentation/SubmittingPatches} for the meaning
|
||||
of sign off.
|
||||
@item
|
||||
Did you provide a clear git commit log message?
|
||||
|
||||
Did you provide a clear git commit log message?
|
||||
@item
|
||||
Is the patch against latest FFmpeg git master branch?
|
||||
|
||||
Is the patch against latest FFmpeg git master branch?
|
||||
@item
|
||||
Are you subscribed to ffmpeg-devel?
|
||||
(the list is subscribers only due to spam)
|
||||
|
||||
Are you subscribed to ffmpeg-devel?
|
||||
(the list is subscribers only due to spam)
|
||||
@item
|
||||
Have you checked that the changes are minimal, so that the same cannot be
|
||||
achieved with a smaller patch and/or simpler final code?
|
||||
|
||||
Have you checked that the changes are minimal, so that the same cannot be
|
||||
achieved with a smaller patch and/or simpler final code?
|
||||
@item
|
||||
If the change is to speed critical code, did you benchmark it?
|
||||
|
||||
If the change is to speed critical code, did you benchmark it?
|
||||
@item
|
||||
If you did any benchmarks, did you provide them in the mail?
|
||||
|
||||
If you did any benchmarks, did you provide them in the mail?
|
||||
@item
|
||||
Have you checked that the patch does not introduce buffer overflows or
|
||||
other security issues?
|
||||
|
||||
Have you checked that the patch does not introduce buffer overflows or
|
||||
other security issues?
|
||||
@item
|
||||
Did you test your decoder or demuxer against damaged data? If no, see
|
||||
tools/trasher, the noise bitstream filter, and
|
||||
@uref{http://caca.zoy.org/wiki/zzuf, zzuf}. Your decoder or demuxer
|
||||
should not crash, end in a (near) infinite loop, or allocate ridiculous
|
||||
amounts of memory when fed damaged data.
|
||||
|
||||
Did you test your decoder or demuxer against damaged data? If no, see
|
||||
tools/trasher and the noise bitstream filter. Your decoder or demuxer
|
||||
should not crash or end in a (near) infinite loop when fed damaged data.
|
||||
@item
|
||||
Does the patch not mix functional and cosmetic changes?
|
||||
|
||||
Does the patch not mix functional and cosmetic changes?
|
||||
@item
|
||||
Did you add tabs or trailing whitespace to the code? Both are forbidden.
|
||||
|
||||
Did you add tabs or trailing whitespace to the code? Both are forbidden.
|
||||
@item
|
||||
Is the patch attached to the email you send?
|
||||
|
||||
Is the patch attached to the email you send?
|
||||
@item
|
||||
Is the mime type of the patch correct? It should be text/x-diff or
|
||||
text/x-patch or at least text/plain and not application/octet-stream.
|
||||
|
||||
Is the mime type of the patch correct? It should be text/x-diff or
|
||||
text/x-patch or at least text/plain and not application/octet-stream.
|
||||
@item
|
||||
If the patch fixes a bug, did you provide a verbose analysis of the bug?
|
||||
|
||||
If the patch fixes a bug, did you provide a verbose analysis of the bug?
|
||||
@item
|
||||
If the patch fixes a bug, did you provide enough information, including
|
||||
a sample, so the bug can be reproduced and the fix can be verified?
|
||||
Note please do not attach samples >100k to mails but rather provide a
|
||||
URL, you can upload to ftp://upload.ffmpeg.org
|
||||
|
||||
If the patch fixes a bug, did you provide enough information, including
|
||||
a sample, so the bug can be reproduced and the fix can be verified?
|
||||
Note please do not attach samples >100k to mails but rather provide a
|
||||
URL, you can upload to ftp://upload.ffmpeg.org
|
||||
@item
|
||||
Did you provide a verbose summary about what the patch does change?
|
||||
|
||||
Did you provide a verbose summary about what the patch does change?
|
||||
@item
|
||||
Did you provide a verbose explanation why it changes things like it does?
|
||||
|
||||
Did you provide a verbose explanation why it changes things like it does?
|
||||
@item
|
||||
Did you provide a verbose summary of the user visible advantages and
|
||||
disadvantages if the patch is applied?
|
||||
|
||||
Did you provide a verbose summary of the user visible advantages and
|
||||
disadvantages if the patch is applied?
|
||||
@item
|
||||
Did you provide an example so we can verify the new feature added by the
|
||||
patch easily?
|
||||
|
||||
Did you provide an example so we can verify the new feature added by the
|
||||
patch easily?
|
||||
@item
|
||||
If you added a new file, did you insert a license header? It should be
|
||||
taken from FFmpeg, not randomly copied and pasted from somewhere else.
|
||||
|
||||
If you added a new file, did you insert a license header? It should be
|
||||
taken from FFmpeg, not randomly copied and pasted from somewhere else.
|
||||
@item
|
||||
You should maintain alphabetical order in alphabetically ordered lists as
|
||||
long as doing so does not break API/ABI compatibility.
|
||||
|
||||
You should maintain alphabetical order in alphabetically ordered lists as
|
||||
long as doing so does not break API/ABI compatibility.
|
||||
@item
|
||||
Lines with similar content should be aligned vertically when doing so
|
||||
improves readability.
|
||||
|
||||
Lines with similar content should be aligned vertically when doing so
|
||||
improves readability.
|
||||
@item
|
||||
Consider to add a regression test for your code.
|
||||
|
||||
Consider to add a regression test for your code.
|
||||
@item
|
||||
If you added YASM code please check that things still work with --disable-yasm
|
||||
|
||||
If you added YASM code please check that things still work with --disable-yasm
|
||||
@item
|
||||
Make sure you check the return values of function and return appropriate
|
||||
error codes. Especially memory allocation functions like @code{av_malloc()}
|
||||
are notoriously left unchecked, which is a serious problem.
|
||||
|
||||
@item
|
||||
Test your code with valgrind and or Address Sanitizer to ensure it's free
|
||||
of leaks, out of array accesses, etc.
|
||||
Make sure you check the return values of function and return appropriate
|
||||
error codes. Especially memory allocation functions like @code{av_malloc()}
|
||||
are notoriously left unchecked, which is a serious problem.
|
||||
@end enumerate
|
||||
|
||||
@section Patch review process
|
||||
@@ -653,145 +548,4 @@ message or introductionary message for the patch series that you post to
|
||||
the ffmpeg-devel mailing list, a direct link to download the sample media.
|
||||
|
||||
|
||||
@subsection Visualizing Test Coverage
|
||||
|
||||
The FFmpeg build system allows visualizing the test coverage in an easy
|
||||
manner with the coverage tools @code{gcov}/@code{lcov}. This involves
|
||||
the following steps:
|
||||
|
||||
@enumerate
|
||||
@item
|
||||
Configure to compile with instrumentation enabled:
|
||||
@code{configure --toolchain=gcov}.
|
||||
|
||||
@item
|
||||
Run your test case, either manually or via FATE. This can be either
|
||||
the full FATE regression suite, or any arbitrary invocation of any
|
||||
front-end tool provided by FFmpeg, in any combination.
|
||||
|
||||
@item
|
||||
Run @code{make lcov} to generate coverage data in HTML format.
|
||||
|
||||
@item
|
||||
View @code{lcov/index.html} in your preferred HTML viewer.
|
||||
@end enumerate
|
||||
|
||||
You can use the command @code{make lcov-reset} to reset the coverage
|
||||
measurements. You will need to rerun @code{make lcov} after running a
|
||||
new test.
|
||||
|
||||
@subsection Using Valgrind
|
||||
|
||||
The configure script provides a shortcut for using valgrind to spot bugs
|
||||
related to memory handling. Just add the option
|
||||
@code{--toolchain=valgrind-memcheck} or @code{--toolchain=valgrind-massif}
|
||||
to your configure line, and reasonable defaults will be set for running
|
||||
FATE under the supervision of either the @strong{memcheck} or the
|
||||
@strong{massif} tool of the valgrind suite.
|
||||
|
||||
In case you need finer control over how valgrind is invoked, use the
|
||||
@code{--target-exec='valgrind <your_custom_valgrind_options>} option in
|
||||
your configure line instead.
|
||||
|
||||
@anchor{Release process}
|
||||
@section Release process
|
||||
|
||||
FFmpeg maintains a set of @strong{release branches}, which are the
|
||||
recommended deliverable for system integrators and distributors (such as
|
||||
Linux distributions, etc.). At regular times, a @strong{release
|
||||
manager} prepares, tests and publishes tarballs on the
|
||||
@url{http://ffmpeg.org} website.
|
||||
|
||||
There are two kinds of releases:
|
||||
|
||||
@enumerate
|
||||
@item
|
||||
@strong{Major releases} always include the latest and greatest
|
||||
features and functionality.
|
||||
|
||||
@item
|
||||
@strong{Point releases} are cut from @strong{release} branches,
|
||||
which are named @code{release/X}, with @code{X} being the release
|
||||
version number.
|
||||
@end enumerate
|
||||
|
||||
Note that we promise to our users that shared libraries from any FFmpeg
|
||||
release never break programs that have been @strong{compiled} against
|
||||
previous versions of @strong{the same release series} in any case!
|
||||
|
||||
However, from time to time, we do make API changes that require adaptations
|
||||
in applications. Such changes are only allowed in (new) major releases and
|
||||
require further steps such as bumping library version numbers and/or
|
||||
adjustments to the symbol versioning file. Please discuss such changes
|
||||
on the @strong{ffmpeg-devel} mailing list in time to allow forward planning.
|
||||
|
||||
@anchor{Criteria for Point Releases}
|
||||
@subsection Criteria for Point Releases
|
||||
|
||||
Changes that match the following criteria are valid candidates for
|
||||
inclusion into a point release:
|
||||
|
||||
@enumerate
|
||||
@item
|
||||
Fixes a security issue, preferably identified by a @strong{CVE
|
||||
number} issued by @url{http://cve.mitre.org/}.
|
||||
|
||||
@item
|
||||
Fixes a documented bug in @url{https://trac.ffmpeg.org}.
|
||||
|
||||
@item
|
||||
Improves the included documentation.
|
||||
|
||||
@item
|
||||
Retains both source code and binary compatibility with previous
|
||||
point releases of the same release branch.
|
||||
@end enumerate
|
||||
|
||||
The order for checking the rules is (1 OR 2 OR 3) AND 4.
|
||||
|
||||
|
||||
@subsection Release Checklist
|
||||
|
||||
The release process involves the following steps:
|
||||
|
||||
@enumerate
|
||||
@item
|
||||
Ensure that the @file{RELEASE} file contains the version number for
|
||||
the upcoming release.
|
||||
|
||||
@item
|
||||
Add the release at @url{https://trac.ffmpeg.org/admin/ticket/versions}.
|
||||
|
||||
@item
|
||||
Announce the intent to do a release to the mailing list.
|
||||
|
||||
@item
|
||||
Make sure all relevant security fixes have been backported. See
|
||||
@url{https://ffmpeg.org/security.html}.
|
||||
|
||||
@item
|
||||
Ensure that the FATE regression suite still passes in the release
|
||||
branch on at least @strong{i386} and @strong{amd64}
|
||||
(cf. @ref{Regression tests}).
|
||||
|
||||
@item
|
||||
Prepare the release tarballs in @code{bz2} and @code{gz} formats, and
|
||||
supplementing files that contain @code{gpg} signatures
|
||||
|
||||
@item
|
||||
Publish the tarballs at @url{http://ffmpeg.org/releases}. Create and
|
||||
push an annotated tag in the form @code{nX}, with @code{X}
|
||||
containing the version number.
|
||||
|
||||
@item
|
||||
Propose and send a patch to the @strong{ffmpeg-devel} mailing list
|
||||
with a news entry for the website.
|
||||
|
||||
@item
|
||||
Publish the news entry.
|
||||
|
||||
@item
|
||||
Send announcement to the mailing list.
|
||||
@end enumerate
|
||||
|
||||
@bye
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
@chapter Device Options
|
||||
@c man begin DEVICE OPTIONS
|
||||
|
||||
The libavdevice library provides the same interface as
|
||||
libavformat. Namely, an input device is considered like a demuxer, and
|
||||
an output device like a muxer, and the interface and generic device
|
||||
options are the same provided by libavformat (see the ffmpeg-formats
|
||||
manual).
|
||||
|
||||
In addition each input or output device may support so-called private
|
||||
options, which are specific for that component.
|
||||
|
||||
Options may be set by specifying -@var{option} @var{value} in the
|
||||
FFmpeg tools, or by setting the value explicitly in the device
|
||||
@code{AVFormatContext} options or using the @file{libavutil/opt.h} API
|
||||
for programmatic use.
|
||||
|
||||
@c man end DEVICE OPTIONS
|
||||
|
||||
@include indevs.texi
|
||||
@include outdevs.texi
|
||||
@@ -71,7 +71,7 @@ Force middle/side encoding.
|
||||
Set AAC encoder coding method. Possible values:
|
||||
|
||||
@table @samp
|
||||
@item faac
|
||||
@item 0
|
||||
FAAC-inspired method.
|
||||
|
||||
This method is a simplified reimplementation of the method used in FAAC, which
|
||||
@@ -82,13 +82,13 @@ distortion below threshold band by band.
|
||||
The quality of this method is comparable to the two loop searching method
|
||||
descibed below, but somewhat a little better and slower.
|
||||
|
||||
@item anmr
|
||||
@item 1
|
||||
Average noise to mask ratio (ANMR) trellis-based solution.
|
||||
|
||||
This has a theoretic best quality out of all the coding methods, but at the
|
||||
cost of the slowest speed.
|
||||
|
||||
@item twoloop
|
||||
@item 2
|
||||
Two loop searching (TLS) method.
|
||||
|
||||
This method first sets quantizers depending on band thresholds and then tries
|
||||
@@ -97,7 +97,7 @@ all quantizers and adjusting some individual quantizer a little.
|
||||
|
||||
This method produces similar quality with the FAAC method and is the default.
|
||||
|
||||
@item fast
|
||||
@item 3
|
||||
Constant quantizer method.
|
||||
|
||||
This method sets a constant quantizer for all bands. This is the fastest of all
|
||||
@@ -107,6 +107,13 @@ the methods, yet produces the worst quality.
|
||||
|
||||
@end table
|
||||
|
||||
@subsection Tips and Tricks
|
||||
|
||||
According to some reports
|
||||
(e.g. @url{http://d.hatena.ne.jp/kamedo2/20120729/1343545890}), setting the
|
||||
@option{cutoff} option to 15000 Hz greatly improves the quality of the output
|
||||
quality. As a result, we encourage you to do the same.
|
||||
|
||||
@section ac3 and ac3_fixed
|
||||
|
||||
AC-3 audio encoders.
|
||||
@@ -494,18 +501,14 @@ Selected by Encoder (default)
|
||||
|
||||
@end table
|
||||
|
||||
@anchor{libmp3lame}
|
||||
@section libmp3lame
|
||||
|
||||
LAME (Lame Ain't an MP3 Encoder) MP3 encoder wrapper.
|
||||
LAME (Lame Ain't an MP3 Encoder) MP3 encoder wrapper
|
||||
|
||||
Requires the presence of the libmp3lame headers and library during
|
||||
configuration. You need to explicitly configure the build with
|
||||
@code{--enable-libmp3lame}.
|
||||
|
||||
See @ref{libshine} for a fixed-point MP3 encoder, although with a
|
||||
lower quality.
|
||||
|
||||
@subsection Options
|
||||
|
||||
The following options are supported by the libmp3lame wrapper. The
|
||||
@@ -531,10 +534,6 @@ Enable use of bit reservoir when set to 1. Default value is 1. LAME
|
||||
has this enabled by default, but can be overriden by use
|
||||
@option{--nores} option.
|
||||
|
||||
@item joint_stereo (@emph{-m j})
|
||||
Enable the encoder to use (on a frame by frame basis) either L/R
|
||||
stereo or mid/side stereo. Default value is 1.
|
||||
|
||||
@end table
|
||||
|
||||
@section libopencore-amrnb
|
||||
@@ -574,45 +573,9 @@ default value is 0 (disabled).
|
||||
|
||||
@end table
|
||||
|
||||
@anchor{libshine}
|
||||
@section libshine
|
||||
|
||||
Shine Fixed-Point MP3 encoder wrapper.
|
||||
|
||||
Shine is a fixed-point MP3 encoder. It has a far better performance on
|
||||
platforms without an FPU, e.g. armel CPUs, and some phones and tablets.
|
||||
However, as it is more targeted on performance than quality, it is not on par
|
||||
with LAME and other production-grade encoders quality-wise. Also, according to
|
||||
the project's homepage, this encoder may not be free of bugs as the code was
|
||||
written a long time ago and the project was dead for at least 5 years.
|
||||
|
||||
This encoder only supports stereo and mono input. This is also CBR-only.
|
||||
|
||||
The original project (last updated in early 2007) is at
|
||||
@url{http://sourceforge.net/projects/libshine-fxp/}. We only support the
|
||||
updated fork by the Savonet/Liquidsoap project at @url{https://github.com/savonet/shine}.
|
||||
|
||||
Requires the presence of the libshine headers and library during
|
||||
configuration. You need to explicitly configure the build with
|
||||
@code{--enable-libshine}.
|
||||
|
||||
See also @ref{libmp3lame}.
|
||||
|
||||
@subsection Options
|
||||
|
||||
The following options are supported by the libshine wrapper. The
|
||||
@command{shineenc}-equivalent of the options are listed in parentheses.
|
||||
|
||||
@table @option
|
||||
@item b (@emph{-b})
|
||||
Set bitrate expressed in bits/s for CBR. @command{shineenc} @option{-b} option
|
||||
is expressed in kilobits/s.
|
||||
|
||||
@end table
|
||||
|
||||
@section libtwolame
|
||||
|
||||
TwoLAME MP2 encoder wrapper.
|
||||
TwoLAME MP2 encoder wrapper
|
||||
|
||||
Requires the presence of the libtwolame headers and library during
|
||||
configuration. You need to explicitly configure the build with
|
||||
@@ -678,7 +641,7 @@ Set MPEG audio original flag when set to 1. The default value is 0
|
||||
@anchor{libvo-aacenc}
|
||||
@section libvo-aacenc
|
||||
|
||||
VisualOn AAC encoder.
|
||||
VisualOn AAC encoder
|
||||
|
||||
Requires the presence of the libvo-aacenc headers and library during
|
||||
configuration. You need to explicitly configure the build with
|
||||
@@ -702,7 +665,7 @@ Set bit rate in bits/s.
|
||||
|
||||
@section libvo-amrwbenc
|
||||
|
||||
VisualOn Adaptive Multi-Rate Wideband encoder.
|
||||
VisualOn Adaptive Multi-Rate Wideband encoder
|
||||
|
||||
Requires the presence of the libvo-amrwbenc headers and library during
|
||||
configuration. You need to explicitly configure the build with
|
||||
@@ -811,87 +774,6 @@ respectively. The default is 0 (cutoff disabled).
|
||||
|
||||
@end table
|
||||
|
||||
@section libvorbis
|
||||
|
||||
libvorbis encoder wrapper.
|
||||
|
||||
Requires the presence of the libvorbisenc headers and library during
|
||||
configuration. You need to explicitly configure the build with
|
||||
@code{--enable-libvorbis}.
|
||||
|
||||
@subsection Options
|
||||
|
||||
The following options are supported by the libvorbis wrapper. The
|
||||
@command{oggenc}-equivalent of the options are listed in parentheses.
|
||||
|
||||
To get a more accurate and extensive documentation of the libvorbis
|
||||
options, consult the libvorbisenc's and @command{oggenc}'s documentations.
|
||||
See @url{http://xiph.org/vorbis/},
|
||||
@url{http://wiki.xiph.org/Vorbis-tools}, and oggenc(1).
|
||||
|
||||
@table @option
|
||||
@item b (@emph{-b})
|
||||
Set bitrate expressed in bits/s for ABR. @command{oggenc} @option{-b} is
|
||||
expressed in kilobits/s.
|
||||
|
||||
@item q (@emph{-q})
|
||||
Set constant quality setting for VBR. The value should be a float
|
||||
number in the range of -1.0 to 10.0. The higher the value, the better
|
||||
the quality. The default value is @samp{3.0}.
|
||||
|
||||
This option is valid only using the @command{ffmpeg} command-line tool.
|
||||
For library interface users, use @option{global_quality}.
|
||||
|
||||
@item cutoff (@emph{--advanced-encode-option lowpass_frequency=N})
|
||||
Set cutoff bandwidth in Hz, a value of 0 disables cutoff. @command{oggenc}'s
|
||||
related option is expressed in kHz. The default value is @samp{0} (cutoff
|
||||
disabled).
|
||||
|
||||
@item minrate (@emph{-m})
|
||||
Set minimum bitrate expressed in bits/s. @command{oggenc} @option{-m} is
|
||||
expressed in kilobits/s.
|
||||
|
||||
@item maxrate (@emph{-M})
|
||||
Set maximum bitrate expressed in bits/s. @command{oggenc} @option{-M} is
|
||||
expressed in kilobits/s. This only has effect on ABR mode.
|
||||
|
||||
@item iblock (@emph{--advanced-encode-option impulse_noisetune=N})
|
||||
Set noise floor bias for impulse blocks. The value is a float number from
|
||||
-15.0 to 0.0. A negative bias instructs the encoder to pay special attention
|
||||
to the crispness of transients in the encoded audio. The tradeoff for better
|
||||
transient response is a higher bitrate.
|
||||
|
||||
@end table
|
||||
|
||||
@section libwavpack
|
||||
|
||||
A wrapper providing WavPack encoding through libwavpack.
|
||||
|
||||
Only lossless mode using 32-bit integer samples is supported currently.
|
||||
The @option{compression_level} option can be used to control speed vs.
|
||||
compression tradeoff, with the values mapped to libwavpack as follows:
|
||||
|
||||
@table @option
|
||||
|
||||
@item 0
|
||||
Fast mode - corresponding to the wavpack @option{-f} option.
|
||||
|
||||
@item 1
|
||||
Normal (default) settings.
|
||||
|
||||
@item 2
|
||||
High quality - corresponding to the wavpack @option{-h} option.
|
||||
|
||||
@item 3
|
||||
Very high quality - corresponding to the wavpack @option{-hh} option.
|
||||
|
||||
@item 4-8
|
||||
Same as 3, but with extra processing enabled - corresponding to the wavpack
|
||||
@option{-x} option. I.e. 4 is the same as @option{-x2} and 8 is the same as
|
||||
@option{-x6}.
|
||||
|
||||
@end table
|
||||
|
||||
@c man end AUDIO ENCODERS
|
||||
|
||||
@chapter Video Encoders
|
||||
@@ -1061,350 +943,57 @@ For more information about libvpx see:
|
||||
|
||||
@section libx264
|
||||
|
||||
x264 H.264/MPEG-4 AVC encoder wrapper.
|
||||
H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 format supported through
|
||||
libx264.
|
||||
|
||||
This encoder requires the presence of the libx264 headers and library
|
||||
during configuration. You need to explicitly configure the build with
|
||||
Requires the presence of the libx264 headers and library during
|
||||
configuration. You need to explicitly configure the build with
|
||||
@code{--enable-libx264}.
|
||||
|
||||
libx264 supports an impressive number of features, including 8x8 and
|
||||
4x4 adaptive spatial transform, adaptive B-frame placement, CAVLC/CABAC
|
||||
entropy coding, interlacing (MBAFF), lossless mode, psy optimizations
|
||||
for detail retention (adaptive quantization, psy-RD, psy-trellis).
|
||||
|
||||
Many libx264 encoder options are mapped to FFmpeg global codec
|
||||
options, while unique encoder options are provided through private
|
||||
options. Additionally the @option{x264opts} and @option{x264-params}
|
||||
private options allows to pass a list of key=value tuples as accepted
|
||||
by the libx264 @code{x264_param_parse} function.
|
||||
|
||||
The x264 project website is at
|
||||
@url{http://www.videolan.org/developers/x264.html}.
|
||||
|
||||
@subsection Options
|
||||
|
||||
The following options are supported by the libx264 wrapper. The
|
||||
@command{x264}-equivalent options or values are listed in parentheses
|
||||
for easy migration.
|
||||
|
||||
To reduce the duplication of documentation, only the private options
|
||||
and some others requiring special attention are documented here. For
|
||||
the documentation of the undocumented generic options, see
|
||||
@ref{codec-options,,the Codec Options chapter}.
|
||||
|
||||
To get a more accurate and extensive documentation of the libx264
|
||||
options, invoke the command @command{x264 --full-help} or consult
|
||||
the libx264 documentation.
|
||||
|
||||
@table @option
|
||||
@item b (@emph{bitrate})
|
||||
Set bitrate in bits/s. Note that FFmpeg's @option{b} option is
|
||||
expressed in bits/s, while @command{x264}'s @option{bitrate} is in
|
||||
kilobits/s.
|
||||
|
||||
@item bf (@emph{bframes})
|
||||
|
||||
@item g (@emph{keyint})
|
||||
|
||||
@item qmax (@emph{qpmax})
|
||||
|
||||
@item qmin (@emph{qpmin})
|
||||
|
||||
@item qdiff (@emph{qpstep})
|
||||
|
||||
@item qblur (@emph{qblur})
|
||||
|
||||
@item qcomp (@emph{qcomp})
|
||||
|
||||
@item refs (@emph{ref})
|
||||
|
||||
@item sc_threshold (@emph{scenecut})
|
||||
|
||||
@item trellis (@emph{trellis})
|
||||
|
||||
@item nr (@emph{nr})
|
||||
|
||||
@item me_range (@emph{merange})
|
||||
|
||||
@item me_method (@emph{me})
|
||||
Set motion estimation method. Possible values in the decreasing order
|
||||
of speed:
|
||||
|
||||
@table @samp
|
||||
@item dia (@emph{dia})
|
||||
@item epzs (@emph{dia})
|
||||
Diamond search with radius 1 (fastest). @samp{epzs} is an alias for
|
||||
@samp{dia}.
|
||||
@item hex (@emph{hex})
|
||||
Hexagonal search with radius 2.
|
||||
@item umh (@emph{umh})
|
||||
Uneven multi-hexagon search.
|
||||
@item esa (@emph{esa})
|
||||
Exhaustive search.
|
||||
@item tesa (@emph{tesa})
|
||||
Hadamard exhaustive search (slowest).
|
||||
@end table
|
||||
|
||||
@item subq (@emph{subme})
|
||||
|
||||
@item b_strategy (@emph{b-adapt})
|
||||
|
||||
@item keyint_min (@emph{min-keyint})
|
||||
|
||||
@item coder
|
||||
Set entropy encoder. Possible values:
|
||||
|
||||
@table @samp
|
||||
@item ac
|
||||
Enable CABAC.
|
||||
|
||||
@item vlc
|
||||
Enable CAVLC and disable CABAC. It generates the same effect as
|
||||
@command{x264}'s @option{--no-cabac} option.
|
||||
@end table
|
||||
|
||||
@item cmp
|
||||
Set full pixel motion estimation comparation algorithm. Possible values:
|
||||
|
||||
@table @samp
|
||||
@item chroma
|
||||
Enable chroma in motion estimation.
|
||||
|
||||
@item sad
|
||||
Ignore chroma in motion estimation. It generates the same effect as
|
||||
@command{x264}'s @option{--no-chroma-me} option.
|
||||
@end table
|
||||
|
||||
@item threads (@emph{threads})
|
||||
|
||||
@item thread_type
|
||||
Set multithreading technique. Possible values:
|
||||
|
||||
@table @samp
|
||||
@item slice
|
||||
Slice-based multithreading. It generates the same effect as
|
||||
@command{x264}'s @option{--sliced-threads} option.
|
||||
@item frame
|
||||
Frame-based multithreading.
|
||||
@end table
|
||||
|
||||
@item flags
|
||||
Set encoding flags. It can be used to disable closed GOP and enable
|
||||
open GOP by setting it to @code{-cgop}. The result is similar to
|
||||
the behavior of @command{x264}'s @option{--open-gop} option.
|
||||
|
||||
@item rc_init_occupancy (@emph{vbv-init})
|
||||
|
||||
@item preset (@emph{preset})
|
||||
@item preset @var{preset_name}
|
||||
Set the encoding preset.
|
||||
|
||||
@item tune (@emph{tune})
|
||||
Set tuning of the encoding params.
|
||||
@item tune @var{tune_name}
|
||||
Tune the encoding params.
|
||||
|
||||
@item profile (@emph{profile})
|
||||
@item fastfirstpass @var{bool}
|
||||
Use fast settings when encoding first pass, default value is 1.
|
||||
|
||||
@item profile @var{profile_name}
|
||||
Set profile restrictions.
|
||||
|
||||
@item fastfirstpass
|
||||
Enable fast settings when encoding first pass, when set to 1. When set
|
||||
to 0, it has the same effect of @command{x264}'s
|
||||
@option{--slow-firstpass} option.
|
||||
@item level @var{level}
|
||||
Specify level (as defined by Annex A).
|
||||
Deprecated in favor of @var{x264opts}.
|
||||
|
||||
@item crf (@emph{crf})
|
||||
Set the quality for constant quality mode.
|
||||
@item passlogfile @var{filename}
|
||||
Specify filename for 2 pass stats.
|
||||
Deprecated in favor of @var{x264opts} (see @var{stats} libx264 option).
|
||||
|
||||
@item crf_max (@emph{crf-max})
|
||||
In CRF mode, prevents VBV from lowering quality beyond this point.
|
||||
@item wpredp @var{wpred_type}
|
||||
Specify Weighted prediction for P-frames.
|
||||
Deprecated in favor of @var{x264opts} (see @var{weightp} libx264 option).
|
||||
|
||||
@item qp (@emph{qp})
|
||||
Set constant quantization rate control method parameter.
|
||||
@item x264opts @var{options}
|
||||
Allow to set any x264 option, see @code{x264 --fullhelp} for a list.
|
||||
|
||||
@item aq-mode (@emph{aq-mode})
|
||||
Set AQ method. Possible values:
|
||||
|
||||
@table @samp
|
||||
@item none (@emph{0})
|
||||
Disabled.
|
||||
|
||||
@item variance (@emph{1})
|
||||
Variance AQ (complexity mask).
|
||||
|
||||
@item autovariance (@emph{2})
|
||||
Auto-variance AQ (experimental).
|
||||
@end table
|
||||
|
||||
@item aq-strength (@emph{aq-strength})
|
||||
Set AQ strength, reduce blocking and blurring in flat and textured areas.
|
||||
|
||||
@item psy
|
||||
Use psychovisual optimizations when set to 1. When set to 0, it has the
|
||||
same effect as @command{x264}'s @option{--no-psy} option.
|
||||
|
||||
@item psy-rd (@emph{psy-rd})
|
||||
Set strength of psychovisual optimization, in
|
||||
@var{psy-rd}:@var{psy-trellis} format.
|
||||
|
||||
@item rc-lookahead (@emph{rc-lookahead})
|
||||
Set number of frames to look ahead for frametype and ratecontrol.
|
||||
|
||||
@item weightb
|
||||
Enable weighted prediction for B-frames when set to 1. When set to 0,
|
||||
it has the same effect as @command{x264}'s @option{--no-weightb} option.
|
||||
|
||||
@item weightp (@emph{weightp})
|
||||
Set weighted prediction method for P-frames. Possible values:
|
||||
|
||||
@table @samp
|
||||
@item none (@emph{0})
|
||||
Disabled
|
||||
@item simple (@emph{1})
|
||||
Enable only weighted refs
|
||||
@item smart (@emph{2})
|
||||
Enable both weighted refs and duplicates
|
||||
@end table
|
||||
|
||||
@item ssim (@emph{ssim})
|
||||
Enable calculation and printing SSIM stats after the encoding.
|
||||
|
||||
@item intra-refresh (@emph{intra-refresh})
|
||||
Enable the use of Periodic Intra Refresh instead of IDR frames when set
|
||||
to 1.
|
||||
|
||||
@item bluray-compat (@emph{bluray-compat})
|
||||
Configure the encoder to be compatible with the bluray standard.
|
||||
It is a shorthand for setting "bluray-compat=1 force-cfr=1".
|
||||
|
||||
@item b-bias (@emph{b-bias})
|
||||
Set the influence on how often B-frames are used.
|
||||
|
||||
@item b-pyramid (@emph{b-pyramid})
|
||||
Set method for keeping of some B-frames as references. Possible values:
|
||||
|
||||
@table @samp
|
||||
@item none (@emph{none})
|
||||
Disabled.
|
||||
@item strict (@emph{strict})
|
||||
Strictly hierarchical pyramid.
|
||||
@item normal (@emph{normal})
|
||||
Non-strict (not Blu-ray compatible).
|
||||
@end table
|
||||
|
||||
@item mixed-refs
|
||||
Enable the use of one reference per partition, as opposed to one
|
||||
reference per macroblock when set to 1. When set to 0, it has the
|
||||
same effect as @command{x264}'s @option{--no-mixed-refs} option.
|
||||
|
||||
@item 8x8dct
|
||||
Enable adaptive spatial transform (high profile 8x8 transform)
|
||||
when set to 1. When set to 0, it has the same effect as
|
||||
@command{x264}'s @option{--no-8x8dct} option.
|
||||
|
||||
@item fast-pskip
|
||||
Enable early SKIP detection on P-frames when set to 1. When set
|
||||
to 0, it has the same effect as @command{x264}'s
|
||||
@option{--no-fast-pskip} option.
|
||||
|
||||
@item aud (@emph{aud})
|
||||
Enable use of access unit delimiters when set to 1.
|
||||
|
||||
@item mbtree
|
||||
Enable use macroblock tree ratecontrol when set to 1. When set
|
||||
to 0, it has the same effect as @command{x264}'s
|
||||
@option{--no-mbtree} option.
|
||||
|
||||
@item deblock (@emph{deblock})
|
||||
Set loop filter parameters, in @var{alpha}:@var{beta} form.
|
||||
|
||||
@item cplxblur (@emph{cplxblur})
|
||||
Set fluctuations reduction in QP (before curve compression).
|
||||
|
||||
@item partitions (@emph{partitions})
|
||||
Set partitions to consider as a comma-separated list of. Possible
|
||||
values in the list:
|
||||
|
||||
@table @samp
|
||||
@item p8x8
|
||||
8x8 P-frame partition.
|
||||
@item p4x4
|
||||
4x4 P-frame partition.
|
||||
@item b8x8
|
||||
4x4 B-frame partition.
|
||||
@item i8x8
|
||||
8x8 I-frame partition.
|
||||
@item i4x4
|
||||
4x4 I-frame partition.
|
||||
(Enabling @samp{p4x4} requires @samp{p8x8} to be enabled. Enabling
|
||||
@samp{i8x8} requires adaptive spatial transform (@option{8x8dct}
|
||||
option) to be enabled.)
|
||||
@item none (@emph{none})
|
||||
Do not consider any partitions.
|
||||
@item all (@emph{all})
|
||||
Consider every partition.
|
||||
@end table
|
||||
|
||||
@item direct-pred (@emph{direct})
|
||||
Set direct MV prediction mode. Possible values:
|
||||
|
||||
@table @samp
|
||||
@item none (@emph{none})
|
||||
Disable MV prediction.
|
||||
@item spatial (@emph{spatial})
|
||||
Enable spatial predicting.
|
||||
@item temporal (@emph{temporal})
|
||||
Enable temporal predicting.
|
||||
@item auto (@emph{auto})
|
||||
Automatically decided.
|
||||
@end table
|
||||
|
||||
@item slice-max-size (@emph{slice-max-size})
|
||||
Set the limit of the size of each slice in bytes. If not specified
|
||||
but RTP payload size (@option{ps}) is specified, that is used.
|
||||
|
||||
@item stats (@emph{stats})
|
||||
Set the file name for multi-pass stats.
|
||||
|
||||
@item nal-hrd (@emph{nal-hrd})
|
||||
Set signal HRD information (requires @option{vbv-bufsize} to be set).
|
||||
Possible values:
|
||||
|
||||
@table @samp
|
||||
@item none (@emph{none})
|
||||
Disable HRD information signaling.
|
||||
@item vbr (@emph{vbr})
|
||||
Variable bit rate.
|
||||
@item cbr (@emph{cbr})
|
||||
Constant bit rate (not allowed in MP4 container).
|
||||
@end table
|
||||
|
||||
@item x264opts (N.A.)
|
||||
Set any x264 option, see @command{x264 --fullhelp} for a list.
|
||||
|
||||
Argument is a list of @var{key}=@var{value} couples separated by
|
||||
@var{options} is a list of @var{key}=@var{value} couples separated by
|
||||
":". In @var{filter} and @var{psy-rd} options that use ":" as a separator
|
||||
themselves, use "," instead. They accept it as well since long ago but this
|
||||
is kept undocumented for some reason.
|
||||
@end table
|
||||
|
||||
For example to specify libx264 encoding options with @command{ffmpeg}:
|
||||
@example
|
||||
ffmpeg -i foo.mpg -vcodec libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
|
||||
@end example
|
||||
|
||||
@item x264-params (N.A.)
|
||||
Override the x264 configuration using a :-separated list of key=value
|
||||
parameters.
|
||||
|
||||
This option is functionally the same as the @option{x264opts}, but is
|
||||
duplicated for compability with the Libav fork.
|
||||
|
||||
For example to specify libx264 encoding options with @command{ffmpeg}:
|
||||
@example
|
||||
ffmpeg -i INPUT -c:v libx264 -x264-params level=30:bframes=0:weightp=0:\
|
||||
cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:analyse=all:me=umh:\
|
||||
no-fast-pskip=1:subq=6:8x8dct=0:trellis=0 OUTPUT
|
||||
@end example
|
||||
@end table
|
||||
|
||||
Encoding ffpresets for common usages are provided so they can be used with the
|
||||
general presets system (e.g. passing the @option{pre} option).
|
||||
For more information about libx264 and the supported options see:
|
||||
@url{http://www.videolan.org/developers/x264.html}
|
||||
|
||||
@section libxvid
|
||||
|
||||
@@ -1517,136 +1106,6 @@ half pixel and quarter pixel refinement for 8x8 blocks, and rate
|
||||
distortion-based search using square pattern.
|
||||
@end table
|
||||
|
||||
@item lumi_aq
|
||||
Enable lumi masking adaptive quantization when set to 1. Default is 0
|
||||
(disabled).
|
||||
|
||||
@item variance_aq
|
||||
Enable variance adaptive quantization when set to 1. Default is 0
|
||||
(disabled).
|
||||
|
||||
When combined with @option{lumi_aq}, the resulting quality will not
|
||||
be better than any of the two specified individually. In other
|
||||
words, the resulting quality will be the worse one of the two
|
||||
effects.
|
||||
|
||||
@item ssim
|
||||
Set structural similarity (SSIM) displaying method. Possible values:
|
||||
|
||||
@table @samp
|
||||
@item off
|
||||
Disable displaying of SSIM information.
|
||||
|
||||
@item avg
|
||||
Output average SSIM at the end of encoding to stdout. The format of
|
||||
showing the average SSIM is:
|
||||
|
||||
@example
|
||||
Average SSIM: %f
|
||||
@end example
|
||||
|
||||
For users who are not familiar with C, %f means a float number, or
|
||||
a decimal (e.g. 0.939232).
|
||||
|
||||
@item frame
|
||||
Output both per-frame SSIM data during encoding and average SSIM at
|
||||
the end of encoding to stdout. The format of per-frame information
|
||||
is:
|
||||
|
||||
@example
|
||||
SSIM: avg: %1.3f min: %1.3f max: %1.3f
|
||||
@end example
|
||||
|
||||
For users who are not familiar with C, %1.3f means a float number
|
||||
rounded to 3 digits after the dot (e.g. 0.932).
|
||||
|
||||
@end table
|
||||
|
||||
@item ssim_acc
|
||||
Set SSIM accuracy. Valid options are integers within the range of
|
||||
0-4, while 0 gives the most accurate result and 4 computes the
|
||||
fastest.
|
||||
|
||||
@end table
|
||||
|
||||
@section png
|
||||
|
||||
PNG image encoder.
|
||||
|
||||
@subsection Private options
|
||||
|
||||
@table @option
|
||||
@item dpi @var{integer}
|
||||
Set physical density of pixels, in dots per inch, unset by default
|
||||
@item dpm @var{integer}
|
||||
Set physical density of pixels, in dots per meter, unset by default
|
||||
@end table
|
||||
|
||||
@section ProRes
|
||||
|
||||
Apple ProRes encoder.
|
||||
|
||||
FFmpeg contains 2 ProRes encoders, the prores-aw and prores-ks encoder.
|
||||
The used encoder can be choosen with the @code{-vcodec} option.
|
||||
|
||||
@subsection Private Options for prores-ks
|
||||
|
||||
@table @option
|
||||
@item profile @var{integer}
|
||||
Select the ProRes profile to encode
|
||||
@table @samp
|
||||
@item proxy
|
||||
@item lt
|
||||
@item standard
|
||||
@item hq
|
||||
@item 4444
|
||||
@end table
|
||||
|
||||
@item quant_mat @var{integer}
|
||||
Select quantization matrix.
|
||||
@table @samp
|
||||
@item auto
|
||||
@item default
|
||||
@item proxy
|
||||
@item lt
|
||||
@item standard
|
||||
@item hq
|
||||
@end table
|
||||
If set to @var{auto}, the matrix matching the profile will be picked.
|
||||
If not set, the matrix providing the highest quality, @var{default}, will be
|
||||
picked.
|
||||
|
||||
@item bits_per_mb @var{integer}
|
||||
How many bits to allot for coding one macroblock. Different profiles use
|
||||
between 200 and 2400 bits per macroblock, the maximum is 8000.
|
||||
|
||||
@item mbs_per_slice @var{integer}
|
||||
Number of macroblocks in each slice (1-8); the default value (8)
|
||||
should be good in almost all situations.
|
||||
|
||||
@item vendor @var{string}
|
||||
Override the 4-byte vendor ID.
|
||||
A custom vendor ID like @var{apl0} would claim the stream was produced by
|
||||
the Apple encoder.
|
||||
|
||||
@item alpha_bits @var{integer}
|
||||
Specify number of bits for alpha component.
|
||||
Possible values are @var{0}, @var{8} and @var{16}.
|
||||
Use @var{0} to disable alpha plane coding.
|
||||
|
||||
@end table
|
||||
|
||||
@subsection Speed considerations
|
||||
|
||||
In the default mode of operation the encoder has to honor frame constraints
|
||||
(i.e. not produc frames with size bigger than requested) while still making
|
||||
output picture as good as possible.
|
||||
A frame containing a lot of small details is harder to compress and the encoder
|
||||
would spend more time searching for appropriate quantizers for each slice.
|
||||
|
||||
Setting a higher @option{bits_per_mb} limit will improve the speed.
|
||||
|
||||
For the fastest encoding speed set the @option{qscale} parameter (4 is the
|
||||
recommended value) and do not set a size constraint.
|
||||
|
||||
@c man end VIDEO ENCODERS
|
||||
|
||||
252
doc/eval.texi
Normal file
252
doc/eval.texi
Normal file
@@ -0,0 +1,252 @@
|
||||
@chapter Expression Evaluation
|
||||
@c man begin EXPRESSION EVALUATION
|
||||
|
||||
When evaluating an arithmetic expression, FFmpeg uses an internal
|
||||
formula evaluator, implemented through the @file{libavutil/eval.h}
|
||||
interface.
|
||||
|
||||
An expression may contain unary, binary operators, constants, and
|
||||
functions.
|
||||
|
||||
Two expressions @var{expr1} and @var{expr2} can be combined to form
|
||||
another expression "@var{expr1};@var{expr2}".
|
||||
@var{expr1} and @var{expr2} are evaluated in turn, and the new
|
||||
expression evaluates to the value of @var{expr2}.
|
||||
|
||||
The following binary operators are available: @code{+}, @code{-},
|
||||
@code{*}, @code{/}, @code{^}.
|
||||
|
||||
The following unary operators are available: @code{+}, @code{-}.
|
||||
|
||||
The following functions are available:
|
||||
@table @option
|
||||
@item sinh(x)
|
||||
Compute hyperbolic sine of @var{x}.
|
||||
|
||||
@item cosh(x)
|
||||
Compute hyperbolic cosine of @var{x}.
|
||||
|
||||
@item tanh(x)
|
||||
Compute hyperbolic tangent of @var{x}.
|
||||
|
||||
@item sin(x)
|
||||
Compute sine of @var{x}.
|
||||
|
||||
@item cos(x)
|
||||
Compute cosine of @var{x}.
|
||||
|
||||
@item tan(x)
|
||||
Compute tangent of @var{x}.
|
||||
|
||||
@item atan(x)
|
||||
Compute arctangent of @var{x}.
|
||||
|
||||
@item asin(x)
|
||||
Compute arcsine of @var{x}.
|
||||
|
||||
@item acos(x)
|
||||
Compute arccosine of @var{x}.
|
||||
|
||||
@item exp(x)
|
||||
Compute exponential of @var{x} (with base @code{e}, the Euler's number).
|
||||
|
||||
@item log(x)
|
||||
Compute natural logarithm of @var{x}.
|
||||
|
||||
@item abs(x)
|
||||
Compute absolute value of @var{x}.
|
||||
|
||||
@item squish(x)
|
||||
Compute expression @code{1/(1 + exp(4*x))}.
|
||||
|
||||
@item gauss(x)
|
||||
Compute Gauss function of @var{x}, corresponding to
|
||||
@code{exp(-x*x/2) / sqrt(2*PI)}.
|
||||
|
||||
@item isinf(x)
|
||||
Return 1.0 if @var{x} is +/-INFINITY, 0.0 otherwise.
|
||||
|
||||
@item isnan(x)
|
||||
Return 1.0 if @var{x} is NAN, 0.0 otherwise.
|
||||
|
||||
@item mod(x, y)
|
||||
Compute the remainder of division of @var{x} by @var{y}.
|
||||
|
||||
@item max(x, y)
|
||||
Return the maximum between @var{x} and @var{y}.
|
||||
|
||||
@item min(x, y)
|
||||
Return the maximum between @var{x} and @var{y}.
|
||||
|
||||
@item eq(x, y)
|
||||
Return 1 if @var{x} and @var{y} are equivalent, 0 otherwise.
|
||||
|
||||
@item gte(x, y)
|
||||
Return 1 if @var{x} is greater than or equal to @var{y}, 0 otherwise.
|
||||
|
||||
@item gt(x, y)
|
||||
Return 1 if @var{x} is greater than @var{y}, 0 otherwise.
|
||||
|
||||
@item lte(x, y)
|
||||
Return 1 if @var{x} is lesser than or equal to @var{y}, 0 otherwise.
|
||||
|
||||
@item lt(x, y)
|
||||
Return 1 if @var{x} is lesser than @var{y}, 0 otherwise.
|
||||
|
||||
@item st(var, expr)
|
||||
Allow to store the value of the expression @var{expr} in an internal
|
||||
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
|
||||
returns the value stored in the internal variable.
|
||||
Note, Variables are currently not shared between expressions.
|
||||
|
||||
@item ld(var)
|
||||
Allow to load the value of the internal variable with number
|
||||
@var{var}, which was previously stored with st(@var{var}, @var{expr}).
|
||||
The function returns the loaded value.
|
||||
|
||||
@item while(cond, expr)
|
||||
Evaluate expression @var{expr} while the expression @var{cond} is
|
||||
non-zero, and returns the value of the last @var{expr} evaluation, or
|
||||
NAN if @var{cond} was always false.
|
||||
|
||||
@item ceil(expr)
|
||||
Round the value of expression @var{expr} upwards to the nearest
|
||||
integer. For example, "ceil(1.5)" is "2.0".
|
||||
|
||||
@item floor(expr)
|
||||
Round the value of expression @var{expr} downwards to the nearest
|
||||
integer. For example, "floor(-1.5)" is "-2.0".
|
||||
|
||||
@item trunc(expr)
|
||||
Round the value of expression @var{expr} towards zero to the nearest
|
||||
integer. For example, "trunc(-1.5)" is "-1.0".
|
||||
|
||||
@item sqrt(expr)
|
||||
Compute the square root of @var{expr}. This is equivalent to
|
||||
"(@var{expr})^.5".
|
||||
|
||||
@item not(expr)
|
||||
Return 1.0 if @var{expr} is zero, 0.0 otherwise.
|
||||
|
||||
@item pow(x, y)
|
||||
Compute the power of @var{x} elevated @var{y}, it is equivalent to
|
||||
"(@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.
|
||||
|
||||
@item taylor(expr, x) taylor(expr, x, id)
|
||||
Evaluate a taylor series at x.
|
||||
expr represents the LD(id)-th derivates of f(x) at 0. If id is not specified
|
||||
then 0 is assumed.
|
||||
note, when you have the derivatives at y instead of 0
|
||||
taylor(expr, x-y) can be used
|
||||
When the series does not converge the results are undefined.
|
||||
|
||||
@item root(expr, max)
|
||||
Finds x where f(x)=0 in the interval 0..max.
|
||||
f() must be continuous or the result is undefined.
|
||||
@end table
|
||||
|
||||
The following constants are available:
|
||||
@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 OR
|
||||
|
||||
and the construct:
|
||||
@example
|
||||
if A then B else C
|
||||
@end example
|
||||
is equivalent to
|
||||
@example
|
||||
if(A,B) + ifnot(A,C)
|
||||
@end example
|
||||
|
||||
In your C code, you can extend the list of unary and binary functions,
|
||||
and define recognized constants, so that they are available for your
|
||||
expressions.
|
||||
|
||||
The evaluator also recognizes the International System number
|
||||
postfixes. 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.
|
||||
|
||||
Follows the list of available International System postfixes, with
|
||||
indication of the corresponding powers of 10 and of 2.
|
||||
@table @option
|
||||
@item y
|
||||
-24 / -80
|
||||
@item z
|
||||
-21 / -70
|
||||
@item a
|
||||
-18 / -60
|
||||
@item f
|
||||
-15 / -50
|
||||
@item p
|
||||
-12 / -40
|
||||
@item n
|
||||
-9 / -30
|
||||
@item u
|
||||
-6 / -20
|
||||
@item m
|
||||
-3 / -10
|
||||
@item c
|
||||
-2
|
||||
@item d
|
||||
-1
|
||||
@item h
|
||||
2
|
||||
@item k
|
||||
3 / 10
|
||||
@item K
|
||||
3 / 10
|
||||
@item M
|
||||
6 / 20
|
||||
@item G
|
||||
9 / 30
|
||||
@item T
|
||||
12 / 40
|
||||
@item P
|
||||
15 / 40
|
||||
@item E
|
||||
18 / 50
|
||||
@item Z
|
||||
21 / 60
|
||||
@item Y
|
||||
24 / 70
|
||||
@end table
|
||||
|
||||
@c man end
|
||||
@@ -7,7 +7,7 @@ FFMPEG_LIBS= libavdevice \
|
||||
libswscale \
|
||||
libavutil \
|
||||
|
||||
CFLAGS += -Wall -g
|
||||
CFLAGS += -Wall -O2 -g
|
||||
CFLAGS := $(shell pkg-config --cflags $(FFMPEG_LIBS)) $(CFLAGS)
|
||||
LDLIBS := $(shell pkg-config --libs $(FFMPEG_LIBS)) $(LDLIBS)
|
||||
|
||||
@@ -25,7 +25,6 @@ OBJS=$(addsuffix .o,$(EXAMPLES))
|
||||
# the following examples make explicit use of the math library
|
||||
decoding_encoding: LDLIBS += -lm
|
||||
muxing: LDLIBS += -lm
|
||||
resampling_audio: LDLIBS += -lm
|
||||
|
||||
.phony: all clean-test clean
|
||||
|
||||
|
||||
@@ -14,5 +14,5 @@ correctly configured.
|
||||
2) Build the examples in-tree
|
||||
|
||||
Assuming you are in the source FFmpeg checkout directory, you need to build
|
||||
FFmpeg (no need to make install in any prefix). Then you can go into
|
||||
FFmpeg (no need to make install in any prefix). Then you can go into the
|
||||
doc/examples and run a command such as PKG_CONFIG_PATH=pc-uninstalled make.
|
||||
|
||||
@@ -79,7 +79,7 @@ static int select_channel_layout(AVCodec *codec)
|
||||
{
|
||||
const uint64_t *p;
|
||||
uint64_t best_ch_layout = 0;
|
||||
int best_nb_channels = 0;
|
||||
int best_nb_channells = 0;
|
||||
|
||||
if (!codec->channel_layouts)
|
||||
return AV_CH_LAYOUT_STEREO;
|
||||
@@ -88,9 +88,9 @@ static int select_channel_layout(AVCodec *codec)
|
||||
while (*p) {
|
||||
int nb_channels = av_get_channel_layout_nb_channels(*p);
|
||||
|
||||
if (nb_channels > best_nb_channels) {
|
||||
if (nb_channels > best_nb_channells) {
|
||||
best_ch_layout = *p;
|
||||
best_nb_channels = nb_channels;
|
||||
best_nb_channells = nb_channels;
|
||||
}
|
||||
p++;
|
||||
}
|
||||
|
||||
@@ -47,6 +47,10 @@ static uint8_t *video_dst_data[4] = {NULL};
|
||||
static int video_dst_linesize[4];
|
||||
static int video_dst_bufsize;
|
||||
|
||||
static uint8_t **audio_dst_data = NULL;
|
||||
static int audio_dst_linesize;
|
||||
static int audio_dst_bufsize;
|
||||
|
||||
static int video_stream_idx = -1, audio_stream_idx = -1;
|
||||
static AVFrame *frame = NULL;
|
||||
static AVPacket pkt;
|
||||
@@ -56,7 +60,6 @@ static int audio_frame_count = 0;
|
||||
static int decode_packet(int *got_frame, int cached)
|
||||
{
|
||||
int ret = 0;
|
||||
int decoded = pkt.size;
|
||||
|
||||
if (pkt.stream_index == video_stream_idx) {
|
||||
/* decode video frame */
|
||||
@@ -88,32 +91,37 @@ static int decode_packet(int *got_frame, int cached)
|
||||
fprintf(stderr, "Error decoding audio frame\n");
|
||||
return ret;
|
||||
}
|
||||
/* Some audio decoders decode only part of the packet, and have to be
|
||||
* called again with the remainder of the packet data.
|
||||
* Sample: fate-suite/lossless-audio/luckynight-partial.shn
|
||||
* Also, some decoders might over-read the packet. */
|
||||
decoded = FFMIN(ret, pkt.size);
|
||||
|
||||
if (*got_frame) {
|
||||
size_t unpadded_linesize = frame->nb_samples * av_get_bytes_per_sample(frame->format);
|
||||
printf("audio_frame%s n:%d nb_samples:%d pts:%s\n",
|
||||
cached ? "(cached)" : "",
|
||||
audio_frame_count++, frame->nb_samples,
|
||||
av_ts2timestr(frame->pts, &audio_dec_ctx->time_base));
|
||||
|
||||
/* Write the raw audio data samples of the first plane. This works
|
||||
* fine for packed formats (e.g. AV_SAMPLE_FMT_S16). However,
|
||||
* most audio decoders output planar audio, which uses a separate
|
||||
* plane of audio samples for each channel (e.g. AV_SAMPLE_FMT_S16P).
|
||||
* In other words, this code will write only the first audio channel
|
||||
* in these cases.
|
||||
* You should use libswresample or libavfilter to convert the frame
|
||||
* to packed data. */
|
||||
fwrite(frame->extended_data[0], 1, unpadded_linesize, audio_dst_file);
|
||||
ret = av_samples_alloc(audio_dst_data, &audio_dst_linesize, frame->channels,
|
||||
frame->nb_samples, frame->format, 1);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Could not allocate audio buffer\n");
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
/* TODO: extend return code of the av_samples_* functions so that this call is not needed */
|
||||
audio_dst_bufsize =
|
||||
av_samples_get_buffer_size(NULL, frame->channels,
|
||||
frame->nb_samples, frame->format, 1);
|
||||
|
||||
/* copy audio data to destination buffer:
|
||||
* this is required since rawaudio expects non aligned data */
|
||||
av_samples_copy(audio_dst_data, frame->data, 0, 0,
|
||||
frame->nb_samples, frame->channels, frame->format);
|
||||
|
||||
/* write to rawaudio file */
|
||||
fwrite(audio_dst_data[0], 1, audio_dst_bufsize, audio_dst_file);
|
||||
av_freep(&audio_dst_data[0]);
|
||||
}
|
||||
}
|
||||
|
||||
return decoded;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int open_codec_context(int *stream_idx,
|
||||
@@ -236,6 +244,8 @@ int main (int argc, char **argv)
|
||||
}
|
||||
|
||||
if (open_codec_context(&audio_stream_idx, fmt_ctx, AVMEDIA_TYPE_AUDIO) >= 0) {
|
||||
int nb_planes;
|
||||
|
||||
audio_stream = fmt_ctx->streams[audio_stream_idx];
|
||||
audio_dec_ctx = audio_stream->codec;
|
||||
audio_dst_file = fopen(audio_dst_filename, "wb");
|
||||
@@ -244,6 +254,15 @@ int main (int argc, char **argv)
|
||||
ret = 1;
|
||||
goto end;
|
||||
}
|
||||
|
||||
nb_planes = av_sample_fmt_is_planar(audio_dec_ctx->sample_fmt) ?
|
||||
audio_dec_ctx->channels : 1;
|
||||
audio_dst_data = av_mallocz(sizeof(uint8_t *) * nb_planes);
|
||||
if (!audio_dst_data) {
|
||||
fprintf(stderr, "Could not allocate audio data buffers\n");
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
/* dump input information to stderr */
|
||||
@@ -273,17 +292,8 @@ int main (int argc, char **argv)
|
||||
printf("Demuxing audio from file '%s' into '%s'\n", src_filename, audio_dst_filename);
|
||||
|
||||
/* read frames from the file */
|
||||
while (av_read_frame(fmt_ctx, &pkt) >= 0) {
|
||||
AVPacket orig_pkt = pkt;
|
||||
do {
|
||||
ret = decode_packet(&got_frame, 0);
|
||||
if (ret < 0)
|
||||
break;
|
||||
pkt.data += ret;
|
||||
pkt.size -= ret;
|
||||
} while (pkt.size > 0);
|
||||
av_free_packet(&orig_pkt);
|
||||
}
|
||||
while (av_read_frame(fmt_ctx, &pkt) >= 0)
|
||||
decode_packet(&got_frame, 0);
|
||||
|
||||
/* flush cached frames */
|
||||
pkt.data = NULL;
|
||||
@@ -302,25 +312,13 @@ int main (int argc, char **argv)
|
||||
}
|
||||
|
||||
if (audio_stream) {
|
||||
enum AVSampleFormat sfmt = audio_dec_ctx->sample_fmt;
|
||||
int n_channels = audio_dec_ctx->channels;
|
||||
const char *fmt;
|
||||
|
||||
if (av_sample_fmt_is_planar(sfmt)) {
|
||||
const char *packed = av_get_sample_fmt_name(sfmt);
|
||||
printf("Warning: the sample format the decoder produced is planar "
|
||||
"(%s). This example will output the first channel only.\n",
|
||||
packed ? packed : "?");
|
||||
sfmt = av_get_packed_sample_fmt(sfmt);
|
||||
n_channels = 1;
|
||||
}
|
||||
|
||||
if ((ret = get_format_from_sample_fmt(&fmt, sfmt)) < 0)
|
||||
if ((ret = get_format_from_sample_fmt(&fmt, audio_dec_ctx->sample_fmt)) < 0)
|
||||
goto end;
|
||||
|
||||
printf("Play the output audio file with the command:\n"
|
||||
"ffplay -f %s -ac %d -ar %d %s\n",
|
||||
fmt, n_channels, audio_dec_ctx->sample_rate,
|
||||
fmt, audio_dec_ctx->channels, audio_dec_ctx->sample_rate,
|
||||
audio_dst_filename);
|
||||
}
|
||||
|
||||
@@ -336,6 +334,7 @@ end:
|
||||
fclose(audio_dst_file);
|
||||
av_free(frame);
|
||||
av_free(video_dst_data[0]);
|
||||
av_free(audio_dst_data);
|
||||
|
||||
return ret < 0;
|
||||
}
|
||||
|
||||
@@ -36,10 +36,9 @@
|
||||
#include <libavfilter/avcodec.h>
|
||||
#include <libavfilter/buffersink.h>
|
||||
#include <libavfilter/buffersrc.h>
|
||||
#include <libavutil/opt.h>
|
||||
|
||||
static const char *filter_descr = "aresample=8000,aformat=sample_fmts=s16:channel_layouts=mono";
|
||||
static const char *player = "ffplay -f s16le -ar 8000 -ac 1 -";
|
||||
const char *filter_descr = "aresample=8000,aconvert=s16:mono";
|
||||
const char *player = "ffplay -f s16le -ar 8000 -ac 1 -";
|
||||
|
||||
static AVFormatContext *fmt_ctx;
|
||||
static AVCodecContext *dec_ctx;
|
||||
@@ -71,7 +70,6 @@ static int open_input_file(const char *filename)
|
||||
}
|
||||
audio_stream_index = ret;
|
||||
dec_ctx = fmt_ctx->streams[audio_stream_index]->codec;
|
||||
av_opt_set_int(dec_ctx, "refcounted_frames", 1, 0);
|
||||
|
||||
/* init the audio decoder */
|
||||
if ((ret = avcodec_open2(dec_ctx, dec, NULL)) < 0) {
|
||||
@@ -87,12 +85,11 @@ static int init_filters(const char *filters_descr)
|
||||
char args[512];
|
||||
int ret;
|
||||
AVFilter *abuffersrc = avfilter_get_by_name("abuffer");
|
||||
AVFilter *abuffersink = avfilter_get_by_name("abuffersink");
|
||||
AVFilter *abuffersink = avfilter_get_by_name("ffabuffersink");
|
||||
AVFilterInOut *outputs = avfilter_inout_alloc();
|
||||
AVFilterInOut *inputs = avfilter_inout_alloc();
|
||||
static const enum AVSampleFormat out_sample_fmts[] = { AV_SAMPLE_FMT_S16, -1 };
|
||||
static const int64_t out_channel_layouts[] = { AV_CH_LAYOUT_MONO, -1 };
|
||||
static const int out_sample_rates[] = { 8000, -1 };
|
||||
const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_S16, -1 };
|
||||
AVABufferSinkParams *abuffersink_params;
|
||||
const AVFilterLink *outlink;
|
||||
AVRational time_base = fmt_ctx->streams[audio_stream_index]->time_base;
|
||||
|
||||
@@ -113,34 +110,16 @@ static int init_filters(const char *filters_descr)
|
||||
}
|
||||
|
||||
/* buffer audio sink: to terminate the filter chain. */
|
||||
abuffersink_params = av_abuffersink_params_alloc();
|
||||
abuffersink_params->sample_fmts = sample_fmts;
|
||||
ret = avfilter_graph_create_filter(&buffersink_ctx, abuffersink, "out",
|
||||
NULL, NULL, filter_graph);
|
||||
NULL, abuffersink_params, filter_graph);
|
||||
av_free(abuffersink_params);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Cannot create audio buffer sink\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = av_opt_set_int_list(buffersink_ctx, "sample_fmts", out_sample_fmts, -1,
|
||||
AV_OPT_SEARCH_CHILDREN);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Cannot set output sample format\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = av_opt_set_int_list(buffersink_ctx, "channel_layouts", out_channel_layouts, -1,
|
||||
AV_OPT_SEARCH_CHILDREN);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Cannot set output channel layout\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = av_opt_set_int_list(buffersink_ctx, "sample_rates", out_sample_rates, -1,
|
||||
AV_OPT_SEARCH_CHILDREN);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Cannot set output sample rate\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Endpoints for the filter graph. */
|
||||
outputs->name = av_strdup("in");
|
||||
outputs->filter_ctx = buffersrc_ctx;
|
||||
@@ -152,7 +131,7 @@ static int init_filters(const char *filters_descr)
|
||||
inputs->pad_idx = 0;
|
||||
inputs->next = NULL;
|
||||
|
||||
if ((ret = avfilter_graph_parse_ptr(filter_graph, filters_descr,
|
||||
if ((ret = avfilter_graph_parse(filter_graph, filters_descr,
|
||||
&inputs, &outputs, NULL)) < 0)
|
||||
return ret;
|
||||
|
||||
@@ -171,10 +150,11 @@ static int init_filters(const char *filters_descr)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void print_frame(const AVFrame *frame)
|
||||
static void print_samplesref(AVFilterBufferRef *samplesref)
|
||||
{
|
||||
const int n = frame->nb_samples * av_get_channel_layout_nb_channels(av_frame_get_channel_layout(frame));
|
||||
const uint16_t *p = (uint16_t*)frame->data[0];
|
||||
const AVFilterBufferRefAudioProps *props = samplesref->audio;
|
||||
const int n = props->nb_samples * av_get_channel_layout_nb_channels(props->channel_layout);
|
||||
const uint16_t *p = (uint16_t*)samplesref->data[0];
|
||||
const uint16_t *p_end = p + n;
|
||||
|
||||
while (p < p_end) {
|
||||
@@ -189,14 +169,9 @@ int main(int argc, char **argv)
|
||||
{
|
||||
int ret;
|
||||
AVPacket packet;
|
||||
AVFrame *frame = av_frame_alloc();
|
||||
AVFrame *filt_frame = av_frame_alloc();
|
||||
AVFrame frame;
|
||||
int got_frame;
|
||||
|
||||
if (!frame || !filt_frame) {
|
||||
perror("Could not allocate frame");
|
||||
exit(1);
|
||||
}
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "Usage: %s file | %s\n", argv[0], player);
|
||||
exit(1);
|
||||
@@ -213,13 +188,14 @@ int main(int argc, char **argv)
|
||||
|
||||
/* read all packets */
|
||||
while (1) {
|
||||
AVFilterBufferRef *samplesref;
|
||||
if ((ret = av_read_frame(fmt_ctx, &packet)) < 0)
|
||||
break;
|
||||
|
||||
if (packet.stream_index == audio_stream_index) {
|
||||
avcodec_get_frame_defaults(frame);
|
||||
avcodec_get_frame_defaults(&frame);
|
||||
got_frame = 0;
|
||||
ret = avcodec_decode_audio4(dec_ctx, frame, &got_frame, &packet);
|
||||
ret = avcodec_decode_audio4(dec_ctx, &frame, &got_frame, &packet);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Error decoding audio\n");
|
||||
continue;
|
||||
@@ -227,20 +203,22 @@ int main(int argc, char **argv)
|
||||
|
||||
if (got_frame) {
|
||||
/* push the audio data from decoded frame into the filtergraph */
|
||||
if (av_buffersrc_add_frame_flags(buffersrc_ctx, frame, 0) < 0) {
|
||||
if (av_buffersrc_add_frame(buffersrc_ctx, &frame, 0) < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Error while feeding the audio filtergraph\n");
|
||||
break;
|
||||
}
|
||||
|
||||
/* pull filtered audio from the filtergraph */
|
||||
while (1) {
|
||||
ret = av_buffersink_get_frame(buffersink_ctx, filt_frame);
|
||||
ret = av_buffersink_get_buffer_ref(buffersink_ctx, &samplesref, 0);
|
||||
if(ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
|
||||
break;
|
||||
if(ret < 0)
|
||||
goto end;
|
||||
print_frame(filt_frame);
|
||||
av_frame_unref(filt_frame);
|
||||
if (samplesref) {
|
||||
print_samplesref(samplesref);
|
||||
avfilter_unref_bufferp(&samplesref);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -251,8 +229,6 @@ end:
|
||||
if (dec_ctx)
|
||||
avcodec_close(dec_ctx);
|
||||
avformat_close_input(&fmt_ctx);
|
||||
av_frame_free(&frame);
|
||||
av_frame_free(&filt_frame);
|
||||
|
||||
if (ret < 0 && ret != AVERROR_EOF) {
|
||||
char buf[1024];
|
||||
|
||||
@@ -85,7 +85,7 @@ 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");
|
||||
AVFilter *buffersink = avfilter_get_by_name("ffbuffersink");
|
||||
AVFilterInOut *outputs = avfilter_inout_alloc();
|
||||
AVFilterInOut *inputs = avfilter_inout_alloc();
|
||||
enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE };
|
||||
@@ -129,7 +129,7 @@ static int init_filters(const char *filters_descr)
|
||||
inputs->pad_idx = 0;
|
||||
inputs->next = NULL;
|
||||
|
||||
if ((ret = avfilter_graph_parse_ptr(filter_graph, filters_descr,
|
||||
if ((ret = avfilter_graph_parse(filter_graph, filters_descr,
|
||||
&inputs, &outputs, NULL)) < 0)
|
||||
return ret;
|
||||
|
||||
@@ -138,33 +138,33 @@ static int init_filters(const char *filters_descr)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void display_frame(const AVFrame *frame, AVRational time_base)
|
||||
static void display_picref(AVFilterBufferRef *picref, AVRational time_base)
|
||||
{
|
||||
int x, y;
|
||||
uint8_t *p0, *p;
|
||||
int64_t delay;
|
||||
|
||||
if (frame->pts != AV_NOPTS_VALUE) {
|
||||
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(frame->pts - last_pts,
|
||||
delay = av_rescale_q(picref->pts - last_pts,
|
||||
time_base, AV_TIME_BASE_Q);
|
||||
if (delay > 0 && delay < 1000000)
|
||||
usleep(delay);
|
||||
}
|
||||
last_pts = frame->pts;
|
||||
last_pts = picref->pts;
|
||||
}
|
||||
|
||||
/* Trivial ASCII grayscale display. */
|
||||
p0 = frame->data[0];
|
||||
p0 = picref->data[0];
|
||||
puts("\033c");
|
||||
for (y = 0; y < frame->height; y++) {
|
||||
for (y = 0; y < picref->video->h; y++) {
|
||||
p = p0;
|
||||
for (x = 0; x < frame->width; x++)
|
||||
for (x = 0; x < picref->video->w; x++)
|
||||
putchar(" .-+#"[*(p++) / 52]);
|
||||
putchar('\n');
|
||||
p0 += frame->linesize[0];
|
||||
p0 += picref->linesize[0];
|
||||
}
|
||||
fflush(stdout);
|
||||
}
|
||||
@@ -173,14 +173,9 @@ int main(int argc, char **argv)
|
||||
{
|
||||
int ret;
|
||||
AVPacket packet;
|
||||
AVFrame *frame = av_frame_alloc();
|
||||
AVFrame *filt_frame = av_frame_alloc();
|
||||
AVFrame frame;
|
||||
int got_frame;
|
||||
|
||||
if (!frame || !filt_frame) {
|
||||
perror("Could not allocate frame");
|
||||
exit(1);
|
||||
}
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "Usage: %s file\n", argv[0]);
|
||||
exit(1);
|
||||
@@ -197,36 +192,40 @@ int main(int argc, char **argv)
|
||||
|
||||
/* 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);
|
||||
avcodec_get_frame_defaults(&frame);
|
||||
got_frame = 0;
|
||||
ret = avcodec_decode_video2(dec_ctx, frame, &got_frame, &packet);
|
||||
ret = avcodec_decode_video2(dec_ctx, &frame, &got_frame, &packet);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Error decoding video\n");
|
||||
break;
|
||||
}
|
||||
|
||||
if (got_frame) {
|
||||
frame->pts = av_frame_get_best_effort_timestamp(frame);
|
||||
frame.pts = av_frame_get_best_effort_timestamp(&frame);
|
||||
|
||||
/* push the decoded frame into the filtergraph */
|
||||
if (av_buffersrc_add_frame_flags(buffersrc_ctx, frame, AV_BUFFERSRC_FLAG_KEEP_REF) < 0) {
|
||||
if (av_buffersrc_add_frame(buffersrc_ctx, &frame, 0) < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Error while feeding the filtergraph\n");
|
||||
break;
|
||||
}
|
||||
|
||||
/* pull filtered frames from the filtergraph */
|
||||
/* pull filtered pictures from the filtergraph */
|
||||
while (1) {
|
||||
ret = av_buffersink_get_frame(buffersink_ctx, filt_frame);
|
||||
ret = av_buffersink_get_buffer_ref(buffersink_ctx, &picref, 0);
|
||||
if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
|
||||
break;
|
||||
if (ret < 0)
|
||||
goto end;
|
||||
display_frame(filt_frame, buffersink_ctx->inputs[0]->time_base);
|
||||
av_frame_unref(filt_frame);
|
||||
|
||||
if (picref) {
|
||||
display_picref(picref, buffersink_ctx->inputs[0]->time_base);
|
||||
avfilter_unref_bufferp(&picref);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -237,8 +236,6 @@ end:
|
||||
if (dec_ctx)
|
||||
avcodec_close(dec_ctx);
|
||||
avformat_close_input(&fmt_ctx);
|
||||
av_frame_free(&frame);
|
||||
av_frame_free(&filt_frame);
|
||||
|
||||
if (ret < 0 && ret != AVERROR_EOF) {
|
||||
char buf[1024];
|
||||
|
||||
@@ -34,11 +34,9 @@
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <libavutil/opt.h>
|
||||
#include <libavutil/mathematics.h>
|
||||
#include <libavformat/avformat.h>
|
||||
#include <libswscale/swscale.h>
|
||||
#include <libswresample/swresample.h>
|
||||
|
||||
/* 5 seconds stream duration */
|
||||
#define STREAM_DURATION 200.0
|
||||
@@ -48,6 +46,13 @@
|
||||
|
||||
static int sws_flags = SWS_BICUBIC;
|
||||
|
||||
/**************************************************************/
|
||||
/* audio output */
|
||||
|
||||
static float t, tincr, tincr2;
|
||||
static int16_t *samples;
|
||||
static int audio_input_frame_size;
|
||||
|
||||
/* Add an output stream. */
|
||||
static AVStream *add_stream(AVFormatContext *oc, AVCodec **codec,
|
||||
enum AVCodecID codec_id)
|
||||
@@ -73,13 +78,15 @@ static AVStream *add_stream(AVFormatContext *oc, AVCodec **codec,
|
||||
|
||||
switch ((*codec)->type) {
|
||||
case AVMEDIA_TYPE_AUDIO:
|
||||
c->sample_fmt = AV_SAMPLE_FMT_FLTP;
|
||||
st->id = 1;
|
||||
c->sample_fmt = AV_SAMPLE_FMT_S16;
|
||||
c->bit_rate = 64000;
|
||||
c->sample_rate = 44100;
|
||||
c->channels = 2;
|
||||
break;
|
||||
|
||||
case AVMEDIA_TYPE_VIDEO:
|
||||
avcodec_get_context_defaults3(c, *codec);
|
||||
c->codec_id = codec_id;
|
||||
|
||||
c->bit_rate = 400000;
|
||||
@@ -121,17 +128,8 @@ static AVStream *add_stream(AVFormatContext *oc, AVCodec **codec,
|
||||
/* audio output */
|
||||
|
||||
static float t, tincr, tincr2;
|
||||
|
||||
static uint8_t **src_samples_data;
|
||||
static int src_samples_linesize;
|
||||
static int src_nb_samples;
|
||||
|
||||
static int max_dst_nb_samples;
|
||||
uint8_t **dst_samples_data;
|
||||
int dst_samples_linesize;
|
||||
int dst_samples_size;
|
||||
|
||||
struct SwrContext *swr_ctx = NULL;
|
||||
static int16_t *samples;
|
||||
static int audio_input_frame_size;
|
||||
|
||||
static void open_audio(AVFormatContext *oc, AVCodec *codec, AVStream *st)
|
||||
{
|
||||
@@ -153,51 +151,17 @@ static void open_audio(AVFormatContext *oc, AVCodec *codec, AVStream *st)
|
||||
/* increment frequency by 110 Hz per second */
|
||||
tincr2 = 2 * M_PI * 110.0 / c->sample_rate / c->sample_rate;
|
||||
|
||||
src_nb_samples = c->codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE ?
|
||||
10000 : c->frame_size;
|
||||
|
||||
ret = av_samples_alloc_array_and_samples(&src_samples_data, &src_samples_linesize, c->channels,
|
||||
src_nb_samples, c->sample_fmt, 0);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Could not allocate source samples\n");
|
||||
if (c->codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE)
|
||||
audio_input_frame_size = 10000;
|
||||
else
|
||||
audio_input_frame_size = c->frame_size;
|
||||
samples = av_malloc(audio_input_frame_size *
|
||||
av_get_bytes_per_sample(c->sample_fmt) *
|
||||
c->channels);
|
||||
if (!samples) {
|
||||
fprintf(stderr, "Could not allocate audio samples buffer\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* create resampler context */
|
||||
if (c->sample_fmt != AV_SAMPLE_FMT_S16) {
|
||||
swr_ctx = swr_alloc();
|
||||
if (!swr_ctx) {
|
||||
fprintf(stderr, "Could not allocate resampler context\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* set options */
|
||||
av_opt_set_int (swr_ctx, "in_channel_count", c->channels, 0);
|
||||
av_opt_set_int (swr_ctx, "in_sample_rate", c->sample_rate, 0);
|
||||
av_opt_set_sample_fmt(swr_ctx, "in_sample_fmt", AV_SAMPLE_FMT_S16, 0);
|
||||
av_opt_set_int (swr_ctx, "out_channel_count", c->channels, 0);
|
||||
av_opt_set_int (swr_ctx, "out_sample_rate", c->sample_rate, 0);
|
||||
av_opt_set_sample_fmt(swr_ctx, "out_sample_fmt", c->sample_fmt, 0);
|
||||
|
||||
/* initialize the resampling context */
|
||||
if ((ret = swr_init(swr_ctx)) < 0) {
|
||||
fprintf(stderr, "Failed to initialize the resampling context\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
/* compute the number of converted samples: buffering is avoided
|
||||
* ensuring that the output buffer will contain at least all the
|
||||
* converted input samples */
|
||||
max_dst_nb_samples = src_nb_samples;
|
||||
ret = av_samples_alloc_array_and_samples(&dst_samples_data, &dst_samples_linesize, c->channels,
|
||||
max_dst_nb_samples, c->sample_fmt, 0);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Could not allocate destination samples\n");
|
||||
exit(1);
|
||||
}
|
||||
dst_samples_size = av_samples_get_buffer_size(NULL, c->channels, max_dst_nb_samples,
|
||||
c->sample_fmt, 0);
|
||||
}
|
||||
|
||||
/* Prepare a 16 bit dummy audio frame of 'frame_size' samples and
|
||||
@@ -222,45 +186,18 @@ static void write_audio_frame(AVFormatContext *oc, AVStream *st)
|
||||
AVCodecContext *c;
|
||||
AVPacket pkt = { 0 }; // data and size must be 0;
|
||||
AVFrame *frame = avcodec_alloc_frame();
|
||||
int got_packet, ret, dst_nb_samples;
|
||||
int got_packet, ret;
|
||||
|
||||
av_init_packet(&pkt);
|
||||
c = st->codec;
|
||||
|
||||
get_audio_frame((int16_t *)src_samples_data[0], src_nb_samples, c->channels);
|
||||
|
||||
/* convert samples from native format to destination codec format, using the resampler */
|
||||
if (swr_ctx) {
|
||||
/* compute destination number of samples */
|
||||
dst_nb_samples = av_rescale_rnd(swr_get_delay(swr_ctx, c->sample_rate) + src_nb_samples,
|
||||
c->sample_rate, c->sample_rate, AV_ROUND_UP);
|
||||
if (dst_nb_samples > max_dst_nb_samples) {
|
||||
av_free(dst_samples_data[0]);
|
||||
ret = av_samples_alloc(dst_samples_data, &dst_samples_linesize, c->channels,
|
||||
dst_nb_samples, c->sample_fmt, 0);
|
||||
if (ret < 0)
|
||||
exit(1);
|
||||
max_dst_nb_samples = dst_nb_samples;
|
||||
dst_samples_size = av_samples_get_buffer_size(NULL, c->channels, dst_nb_samples,
|
||||
c->sample_fmt, 0);
|
||||
}
|
||||
|
||||
/* convert to destination format */
|
||||
ret = swr_convert(swr_ctx,
|
||||
dst_samples_data, dst_nb_samples,
|
||||
(const uint8_t **)src_samples_data, src_nb_samples);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Error while converting\n");
|
||||
exit(1);
|
||||
}
|
||||
} else {
|
||||
dst_samples_data[0] = src_samples_data[0];
|
||||
dst_nb_samples = src_nb_samples;
|
||||
}
|
||||
|
||||
frame->nb_samples = dst_nb_samples;
|
||||
get_audio_frame(samples, audio_input_frame_size, c->channels);
|
||||
frame->nb_samples = audio_input_frame_size;
|
||||
avcodec_fill_audio_frame(frame, c->channels, c->sample_fmt,
|
||||
dst_samples_data[0], dst_samples_size, 0);
|
||||
(uint8_t *)samples,
|
||||
audio_input_frame_size *
|
||||
av_get_bytes_per_sample(c->sample_fmt) *
|
||||
c->channels, 1);
|
||||
|
||||
ret = avcodec_encode_audio2(c, &pkt, frame, &got_packet);
|
||||
if (ret < 0) {
|
||||
@@ -286,8 +223,8 @@ static void write_audio_frame(AVFormatContext *oc, AVStream *st)
|
||||
static void close_audio(AVFormatContext *oc, AVStream *st)
|
||||
{
|
||||
avcodec_close(st->codec);
|
||||
av_free(src_samples_data[0]);
|
||||
av_free(dst_samples_data[0]);
|
||||
|
||||
av_free(samples);
|
||||
}
|
||||
|
||||
/**************************************************************/
|
||||
@@ -406,19 +343,25 @@ static void write_video_frame(AVFormatContext *oc, AVStream *st)
|
||||
|
||||
ret = av_interleaved_write_frame(oc, &pkt);
|
||||
} else {
|
||||
AVPacket pkt = { 0 };
|
||||
int got_packet;
|
||||
av_init_packet(&pkt);
|
||||
|
||||
/* encode the image */
|
||||
ret = avcodec_encode_video2(c, &pkt, frame, &got_packet);
|
||||
AVPacket pkt;
|
||||
int got_output;
|
||||
|
||||
av_init_packet(&pkt);
|
||||
pkt.data = NULL; // packet data will be allocated by the encoder
|
||||
pkt.size = 0;
|
||||
|
||||
ret = avcodec_encode_video2(c, &pkt, frame, &got_output);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Error encoding video frame: %s\n", av_err2str(ret));
|
||||
exit(1);
|
||||
}
|
||||
/* If size is zero, it means the image was buffered. */
|
||||
|
||||
if (!ret && got_packet && pkt.size) {
|
||||
/* If size is zero, it means the image was buffered. */
|
||||
if (got_output) {
|
||||
if (c->coded_frame->key_frame)
|
||||
pkt.flags |= AV_PKT_FLAG_KEY;
|
||||
|
||||
pkt.stream_index = st->index;
|
||||
|
||||
/* Write the compressed frame to the media file. */
|
||||
@@ -452,8 +395,8 @@ int main(int argc, char **argv)
|
||||
AVFormatContext *oc;
|
||||
AVStream *audio_st, *video_st;
|
||||
AVCodec *audio_codec, *video_codec;
|
||||
double audio_time, video_time;
|
||||
int ret;
|
||||
double audio_pts, video_pts;
|
||||
int ret, i;
|
||||
|
||||
/* Initialize libavcodec, and register all codecs and formats. */
|
||||
av_register_all();
|
||||
@@ -525,15 +468,23 @@ int main(int argc, char **argv)
|
||||
frame->pts = 0;
|
||||
for (;;) {
|
||||
/* Compute current audio and video time. */
|
||||
audio_time = audio_st ? audio_st->pts.val * av_q2d(audio_st->time_base) : 0.0;
|
||||
video_time = video_st ? video_st->pts.val * av_q2d(video_st->time_base) : 0.0;
|
||||
if (audio_st)
|
||||
audio_pts = (double)audio_st->pts.val * audio_st->time_base.num / audio_st->time_base.den;
|
||||
else
|
||||
audio_pts = 0.0;
|
||||
|
||||
if ((!audio_st || audio_time >= STREAM_DURATION) &&
|
||||
(!video_st || video_time >= STREAM_DURATION))
|
||||
if (video_st)
|
||||
video_pts = (double)video_st->pts.val * video_st->time_base.num /
|
||||
video_st->time_base.den;
|
||||
else
|
||||
video_pts = 0.0;
|
||||
|
||||
if ((!audio_st || audio_pts >= STREAM_DURATION) &&
|
||||
(!video_st || video_pts >= STREAM_DURATION))
|
||||
break;
|
||||
|
||||
/* write interleaved audio and video frames */
|
||||
if (!video_st || (video_st && audio_st && audio_time < video_time)) {
|
||||
if (!video_st || (video_st && audio_st && audio_pts < video_pts)) {
|
||||
write_audio_frame(oc, audio_st);
|
||||
} else {
|
||||
write_video_frame(oc, video_st);
|
||||
@@ -553,12 +504,18 @@ int main(int argc, char **argv)
|
||||
if (audio_st)
|
||||
close_audio(oc, audio_st);
|
||||
|
||||
/* Free the streams. */
|
||||
for (i = 0; i < oc->nb_streams; i++) {
|
||||
av_freep(&oc->streams[i]->codec);
|
||||
av_freep(&oc->streams[i]);
|
||||
}
|
||||
|
||||
if (!(fmt->flags & AVFMT_NOFILE))
|
||||
/* Close the output file. */
|
||||
avio_close(oc->pb);
|
||||
|
||||
/* free the stream */
|
||||
avformat_free_context(oc);
|
||||
av_free(oc);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -78,6 +78,18 @@ void fill_samples(double *dst, int nb_samples, int nb_channels, int sample_rate,
|
||||
}
|
||||
}
|
||||
|
||||
int alloc_samples_array_and_data(uint8_t ***data, int *linesize, int nb_channels,
|
||||
int nb_samples, enum AVSampleFormat sample_fmt, int align)
|
||||
{
|
||||
int nb_planes = av_sample_fmt_is_planar(sample_fmt) ? nb_channels : 1;
|
||||
|
||||
*data = av_malloc(sizeof(*data) * nb_planes);
|
||||
if (!*data)
|
||||
return AVERROR(ENOMEM);
|
||||
return av_samples_alloc(*data, linesize, nb_channels,
|
||||
nb_samples, sample_fmt, align);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int64_t src_ch_layout = AV_CH_LAYOUT_STEREO, dst_ch_layout = AV_CH_LAYOUT_SURROUND;
|
||||
@@ -137,8 +149,8 @@ int main(int argc, char **argv)
|
||||
/* allocate source and destination samples buffers */
|
||||
|
||||
src_nb_channels = av_get_channel_layout_nb_channels(src_ch_layout);
|
||||
ret = av_samples_alloc_array_and_samples(&src_data, &src_linesize, src_nb_channels,
|
||||
src_nb_samples, src_sample_fmt, 0);
|
||||
ret = alloc_samples_array_and_data(&src_data, &src_linesize, src_nb_channels,
|
||||
src_nb_samples, src_sample_fmt, 0);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Could not allocate source samples\n");
|
||||
goto end;
|
||||
@@ -152,8 +164,8 @@ int main(int argc, char **argv)
|
||||
|
||||
/* buffer is going to be directly written to a rawaudio file, no alignment */
|
||||
dst_nb_channels = av_get_channel_layout_nb_channels(dst_ch_layout);
|
||||
ret = av_samples_alloc_array_and_samples(&dst_data, &dst_linesize, dst_nb_channels,
|
||||
dst_nb_samples, dst_sample_fmt, 0);
|
||||
ret = alloc_samples_array_and_data(&dst_data, &dst_linesize, dst_nb_channels,
|
||||
dst_nb_samples, dst_sample_fmt, 0);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Could not allocate destination samples\n");
|
||||
goto end;
|
||||
|
||||
@@ -107,7 +107,7 @@ int main(int argc, char **argv)
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* buffer is going to be written to rawvideo file, no alignment */
|
||||
/* buffer is going to be written to rawvideo file, no alignmnet */
|
||||
if ((ret = av_image_alloc(dst_data, dst_linesize,
|
||||
dst_w, dst_h, dst_pix_fmt, 1)) < 0) {
|
||||
fprintf(stderr, "Could not allocate destination image\n");
|
||||
|
||||
54
doc/faq.texi
54
doc/faq.texi
@@ -105,7 +105,7 @@ For example, img1.jpg, img2.jpg, img3.jpg,...
|
||||
Then you may run:
|
||||
|
||||
@example
|
||||
ffmpeg -f image2 -i img%d.jpg /tmp/a.mpg
|
||||
ffmpeg -f image2 -i img%d.jpg /tmp/a.mpg
|
||||
@end example
|
||||
|
||||
Notice that @samp{%d} is replaced by the image number.
|
||||
@@ -118,7 +118,7 @@ the sequence. This is useful if your sequence does not start with
|
||||
example will start with @file{img100.jpg}:
|
||||
|
||||
@example
|
||||
ffmpeg -f image2 -start_number 100 -i img%d.jpg /tmp/a.mpg
|
||||
ffmpeg -f image2 -start_number 100 -i img%d.jpg /tmp/a.mpg
|
||||
@end example
|
||||
|
||||
If you have large number of pictures to rename, you can use the
|
||||
@@ -128,7 +128,7 @@ that match @code{*jpg} to the @file{/tmp} directory in the sequence of
|
||||
@file{img001.jpg}, @file{img002.jpg} and so on.
|
||||
|
||||
@example
|
||||
x=1; for i in *jpg; do counter=$(printf %03d $x); ln -s "$i" /tmp/img"$counter".jpg; x=$(($x+1)); done
|
||||
x=1; for i in *jpg; do counter=$(printf %03d $x); ln -s "$i" /tmp/img"$counter".jpg; x=$(($x+1)); done
|
||||
@end example
|
||||
|
||||
If you want to sequence them by oldest modified first, substitute
|
||||
@@ -137,7 +137,7 @@ If you want to sequence them by oldest modified first, substitute
|
||||
Then run:
|
||||
|
||||
@example
|
||||
ffmpeg -f image2 -i /tmp/img%03d.jpg /tmp/a.mpg
|
||||
ffmpeg -f image2 -i /tmp/img%03d.jpg /tmp/a.mpg
|
||||
@end example
|
||||
|
||||
The same logic is used for any image format that ffmpeg reads.
|
||||
@@ -145,7 +145,7 @@ The same logic is used for any image format that ffmpeg reads.
|
||||
You can also use @command{cat} to pipe images to ffmpeg:
|
||||
|
||||
@example
|
||||
cat *.jpg | ffmpeg -f image2pipe -c:v mjpeg -i - output.mpg
|
||||
cat *.jpg | ffmpeg -f image2pipe -c:v mjpeg -i - output.mpg
|
||||
@end example
|
||||
|
||||
@section How do I encode movie to single pictures?
|
||||
@@ -153,7 +153,7 @@ cat *.jpg | ffmpeg -f image2pipe -c:v mjpeg -i - output.mpg
|
||||
Use:
|
||||
|
||||
@example
|
||||
ffmpeg -i movie.mpg movie%d.jpg
|
||||
ffmpeg -i movie.mpg movie%d.jpg
|
||||
@end example
|
||||
|
||||
The @file{movie.mpg} used as input will be converted to
|
||||
@@ -169,7 +169,7 @@ to force the encoding.
|
||||
|
||||
Applying that to the previous example:
|
||||
@example
|
||||
ffmpeg -i movie.mpg -f image2 -c:v mjpeg menu%d.jpg
|
||||
ffmpeg -i movie.mpg -f image2 -c:v mjpeg menu%d.jpg
|
||||
@end example
|
||||
|
||||
Beware that there is no "jpeg" codec. Use "mjpeg" instead.
|
||||
@@ -227,15 +227,15 @@ then you may use any file that DirectShow can read as input.
|
||||
|
||||
Just create an "input.avs" text file with this single line ...
|
||||
@example
|
||||
DirectShowSource("C:\path to your file\yourfile.asf")
|
||||
DirectShowSource("C:\path to your file\yourfile.asf")
|
||||
@end example
|
||||
... and then feed that text file to ffmpeg:
|
||||
@example
|
||||
ffmpeg -i input.avs
|
||||
ffmpeg -i input.avs
|
||||
@end example
|
||||
|
||||
For ANY other help on AviSynth, please visit the
|
||||
@uref{http://www.avisynth.org/, AviSynth homepage}.
|
||||
For ANY other help on Avisynth, please visit the
|
||||
@uref{http://www.avisynth.org/, Avisynth homepage}.
|
||||
|
||||
@section How can I join video files?
|
||||
|
||||
@@ -294,12 +294,8 @@ your format doesn't support file level concatenation.
|
||||
|
||||
@subsection Concatenating using the concat @emph{protocol} (file level)
|
||||
|
||||
FFmpeg has a @url{http://ffmpeg.org/ffmpeg-protocols.html#concat,
|
||||
@code{concat}} protocol designed specifically for that, with examples in the
|
||||
documentation.
|
||||
|
||||
A few multimedia containers (MPEG-1, MPEG-2 PS, DV) allow to concatenate
|
||||
video by merely concatenating the files containing them.
|
||||
video by merely concatenating the files them.
|
||||
|
||||
Hence you may concatenate your multimedia files by first transcoding them to
|
||||
these privileged formats, then using the humble @code{cat} command (or the
|
||||
@@ -393,17 +389,17 @@ Appending @code{:v} to it will do exactly that.
|
||||
Use @option{-dumpgraph -} to find out exactly where the channel layout is
|
||||
lost.
|
||||
|
||||
Most likely, it is through @code{auto-inserted aresample}. Try to understand
|
||||
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{aformat} explicitly in the filtergraph,
|
||||
Then insert the correct @code{aconvert} explicitly in the filter graph,
|
||||
specifying the exact format.
|
||||
|
||||
@example
|
||||
aformat=sample_fmts=s16:channel_layouts=stereo
|
||||
aconvert=s16:stereo:packed
|
||||
@end example
|
||||
|
||||
@section Why does FFmpeg not see the subtitles in my VOB file?
|
||||
@@ -475,10 +471,9 @@ read @uref{http://www.tux.org/lkml/#s15, "Programming Religion"}.
|
||||
|
||||
@section Why are the ffmpeg programs devoid of debugging symbols?
|
||||
|
||||
The build process creates @command{ffmpeg_g}, @command{ffplay_g}, etc. which
|
||||
contain full debug information. Those binaries are stripped to create
|
||||
@command{ffmpeg}, @command{ffplay}, etc. If you need the debug information, use
|
||||
the *_g versions.
|
||||
The build process creates ffmpeg_g, ffplay_g, etc. which contain full debug
|
||||
information. Those binaries are stripped to create ffmpeg, ffplay, etc. If
|
||||
you need the debug information, use the *_g versions.
|
||||
|
||||
@section I do not like the LGPL, can I contribute code under the GPL instead?
|
||||
|
||||
@@ -498,7 +493,7 @@ An easy way to get the full list of required libraries in dependency order
|
||||
is to use @code{pkg-config}.
|
||||
|
||||
@example
|
||||
c99 -o program program.c $(pkg-config --cflags --libs libavformat libavcodec)
|
||||
c99 -o program program.c $(pkg-config --cflags --libs libavformat libavcodec)
|
||||
@end example
|
||||
|
||||
See @file{doc/example/Makefile} and @file{doc/example/pc-uninstalled} for
|
||||
@@ -522,6 +517,10 @@ to use them you have to append -D__STDC_CONSTANT_MACROS to your CXXFLAGS
|
||||
You have to create a custom AVIOContext using @code{avio_alloc_context},
|
||||
see @file{libavformat/aviobuf.c} in FFmpeg and @file{libmpdemux/demux_lavf.c} in MPlayer or MPlayer2 sources.
|
||||
|
||||
@section Where can I find libav* headers for Pascal/Delphi?
|
||||
|
||||
see @url{http://www.iversenit.dk/dev/ffmpeg-headers/}
|
||||
|
||||
@section Where is the documentation about ffv1, msmpeg4, asv1, 4xm?
|
||||
|
||||
see @url{http://www.ffmpeg.org/~michael/}
|
||||
@@ -534,12 +533,11 @@ In this specific case please look at RFC 4629 to see how it should be done.
|
||||
|
||||
@section AVStream.r_frame_rate is wrong, it is much larger than the frame rate.
|
||||
|
||||
@code{r_frame_rate} is NOT the average frame rate, it is the smallest frame rate
|
||||
r_frame_rate is NOT the average frame rate, it is the smallest frame rate
|
||||
that can accurately represent all timestamps. So no, it is not
|
||||
wrong if it is larger than the average!
|
||||
For example, if you have mixed 25 and 30 fps content, then @code{r_frame_rate}
|
||||
will be 150 (it is the least common multiple).
|
||||
If you are looking for the average frame rate, see @code{AVStream.avg_frame_rate}.
|
||||
For example, if you have mixed 25 and 30 fps content, then r_frame_rate
|
||||
will be 150.
|
||||
|
||||
@section Why is @code{make fate} not running all tests?
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ by visiting this website:
|
||||
|
||||
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 their recent contribution. This usually happens on the platforms
|
||||
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
|
||||
@@ -131,12 +131,7 @@ 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:
|
||||
|
||||
@table @option
|
||||
@item RSA
|
||||
d3:f1:83:97:a4:75:2b:a6:fb:d6:e8:aa:81:93:97:51
|
||||
@item ECDSA
|
||||
76:9f:68:32:04:1e:d5:d4:ec:47:3f:dc:fc:18:17:86
|
||||
@end table
|
||||
b1:31:c8:79:3f:04:1d:f8:f2:23:26:5a:fd:55:fa:92
|
||||
|
||||
If you have problems connecting to the FATE server, it may help to try out
|
||||
the @command{ssh} command with one or more @option{-v} options. You should
|
||||
@@ -153,20 +148,20 @@ the synchronisation of the samples directory.
|
||||
|
||||
@table @option
|
||||
@item fate-rsync
|
||||
Download/synchronize sample files to the configured samples directory.
|
||||
Download/synchronize sample files to the configured samples directory.
|
||||
|
||||
@item fate-list
|
||||
Will list all fate/regression test targets.
|
||||
Will list all fate/regression test targets.
|
||||
|
||||
@item fate
|
||||
Run the FATE test suite (requires the fate-suite dataset).
|
||||
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.
|
||||
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
|
||||
@@ -174,28 +169,22 @@ Verbosity level, can be set to 0, 1 or 2.
|
||||
@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.
|
||||
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.
|
||||
|
||||
Specify how many threads to use while running regression tests, it is
|
||||
quite useful to detect thread-related regressions.
|
||||
@item THREAD_TYPE
|
||||
Specify which threading strategy test, either @var{slice} or @var{frame},
|
||||
by default @var{slice+frame}
|
||||
|
||||
Specify which threading strategy test, either @var{slice} or @var{frame},
|
||||
by default @var{slice+frame}
|
||||
@item CPUFLAGS
|
||||
Specify CPU flags.
|
||||
|
||||
Specify CPU flags.
|
||||
@item TARGET_EXEC
|
||||
Specify or override the wrapper used to run the tests.
|
||||
The @var{TARGET_EXEC} option provides a way to run FATE wrapped in
|
||||
@command{valgrind}, @command{qemu-user} or @command{wine} or on remote targets
|
||||
through @command{ssh}.
|
||||
|
||||
@item GEN
|
||||
Set to @var{1} to generate the missing or mismatched references.
|
||||
Specify or override the wrapper used to run the tests.
|
||||
The @var{TARGET_EXEC} option provides a way to run FATE wrapped in
|
||||
@command{valgrind}, @command{qemu-user} or @command{wine} or on remote targets
|
||||
through @command{ssh}.
|
||||
@end table
|
||||
|
||||
@section Examples
|
||||
|
||||
@@ -4,20 +4,16 @@ samples= # path to samples directory
|
||||
workdir= # directory in which to do all the work
|
||||
#fate_recv="ssh -T fate@fate.ffmpeg.org" # command to submit report
|
||||
comment= # optional description
|
||||
build_only= # set to "yes" for a compile-only instance that skips tests
|
||||
|
||||
# the following are optional and map to configure options
|
||||
arch=
|
||||
cpu=
|
||||
cross_prefix=
|
||||
as=
|
||||
cc=
|
||||
ld=
|
||||
target_os=
|
||||
sysroot=
|
||||
target_exec=
|
||||
target_path=
|
||||
target_samples=
|
||||
extra_cflags=
|
||||
extra_ldflags=
|
||||
extra_libs=
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -17,7 +17,27 @@ libavdevice library.
|
||||
|
||||
@c man end DESCRIPTION
|
||||
|
||||
@include devices.texi
|
||||
@chapter Device Options
|
||||
@c man begin DEVICE OPTIONS
|
||||
|
||||
The libavdevice library provides the same interface as
|
||||
libavformat. Namely, an input device is considered like a demuxer, and
|
||||
an output device like a muxer, and the interface and generic device
|
||||
options are the same provided by libavformat (see the ffmpeg-formats
|
||||
manual).
|
||||
|
||||
In addition each input or output device may support so-called private
|
||||
options, which are specific for that component.
|
||||
|
||||
Options may be set by specifying -@var{option} @var{value} in the
|
||||
FFmpeg tools, or by setting the value explicitly in the device
|
||||
@code{AVFormatContext} options or using the @file{libavutil/opt.h} API
|
||||
for programmatic use.
|
||||
|
||||
@c man end DEVICE OPTIONS
|
||||
|
||||
@include indevs.texi
|
||||
@include outdevs.texi
|
||||
|
||||
@chapter See Also
|
||||
|
||||
|
||||
@@ -17,7 +17,142 @@ provided by the libavformat library.
|
||||
|
||||
@c man end DESCRIPTION
|
||||
|
||||
@include formats.texi
|
||||
@chapter Format Options
|
||||
@c man begin FORMAT OPTIONS
|
||||
|
||||
The libavformat library provides some generic global options, which
|
||||
can be set on all the muxers and demuxers. In addition each muxer or
|
||||
demuxer may support so-called private options, which are specific for
|
||||
that component.
|
||||
|
||||
Options may be set by specifying -@var{option} @var{value} in the
|
||||
FFmpeg tools, or by setting the value explicitly in the
|
||||
@code{AVFormatContext} options or using the @file{libavutil/opt.h} API
|
||||
for programmatic use.
|
||||
|
||||
The list of supported options follows:
|
||||
|
||||
@table @option
|
||||
@item avioflags @var{flags} (@emph{input/output})
|
||||
Possible values:
|
||||
@table @samp
|
||||
@item direct
|
||||
Reduce buffering.
|
||||
@end table
|
||||
|
||||
@item probesize @var{integer} (@emph{input})
|
||||
Set probing size in bytes, i.e. the size of the data to analyze to get
|
||||
stream information. A higher value will allow to detect more
|
||||
information in case it is dispersed into the stream, but will increase
|
||||
latency. Must be an integer not lesser than 32. It is 5000000 by default.
|
||||
|
||||
@item packetsize @var{integer} (@emph{output})
|
||||
Set packet size.
|
||||
|
||||
@item fflags @var{flags} (@emph{input/output})
|
||||
Set format flags.
|
||||
|
||||
Possible values:
|
||||
@table @samp
|
||||
@item ignidx
|
||||
Ignore index.
|
||||
@item genpts
|
||||
Generate PTS.
|
||||
@item nofillin
|
||||
Do not fill in missing values that can be exactly calculated.
|
||||
@item noparse
|
||||
Disable AVParsers, this needs @code{+nofillin} too.
|
||||
@item igndts
|
||||
Ignore DTS.
|
||||
@item discardcorrupt
|
||||
Discard corrupted frames.
|
||||
@item sortdts
|
||||
Try to interleave output packets by DTS.
|
||||
@item keepside
|
||||
Do not merge side data.
|
||||
@item latm
|
||||
Enable RTP MP4A-LATM payload.
|
||||
@item nobuffer
|
||||
Reduce the latency introduced by optional buffering
|
||||
@end table
|
||||
|
||||
@item analyzeduration @var{integer} (@emph{input})
|
||||
Specify how many microseconds are analyzed to estimate duration.
|
||||
|
||||
@item cryptokey @var{hexadecimal string} (@emph{input})
|
||||
Set decryption key.
|
||||
|
||||
@item indexmem @var{integer} (@emph{input})
|
||||
Set max memory used for timestamp index (per stream).
|
||||
|
||||
@item rtbufsize @var{integer} (@emph{input})
|
||||
Set max memory used for buffering real-time frames.
|
||||
|
||||
@item fdebug @var{flags} (@emph{input/output})
|
||||
Print specific debug info.
|
||||
|
||||
Possible values:
|
||||
@table @samp
|
||||
@item ts
|
||||
@end table
|
||||
|
||||
@item max_delay @var{integer} (@emph{input/output})
|
||||
Set maximum muxing or demuxing delay in microseconds.
|
||||
|
||||
@item fpsprobesize @var{integer} (@emph{input})
|
||||
Set number of frames used to probe fps.
|
||||
|
||||
@item audio_preload @var{integer} (@emph{output})
|
||||
Set microseconds by which audio packets should be interleaved earlier.
|
||||
|
||||
@item chunk_duration @var{integer} (@emph{output})
|
||||
Set microseconds for each chunk.
|
||||
|
||||
@item chunk_size @var{integer} (@emph{output})
|
||||
Set size in bytes for each chunk.
|
||||
|
||||
@item err_detect, f_err_detect @var{flags} (@emph{input})
|
||||
Set error detection flags. @code{f_err_detect} is deprecated and
|
||||
should be used only via the @command{ffmpeg} tool.
|
||||
|
||||
Possible values:
|
||||
@table @samp
|
||||
@item crccheck
|
||||
Verify embedded CRCs.
|
||||
@item bitstream
|
||||
Detect bitstream specification deviations.
|
||||
@item buffer
|
||||
Detect improper bitstream length.
|
||||
@item explode
|
||||
Abort decoding on minor error detection.
|
||||
@item careful
|
||||
Consider things that violate the spec and have not been seen in the
|
||||
wild as errors.
|
||||
@item compliant
|
||||
Consider all spec non compliancies as errors.
|
||||
@item aggressive
|
||||
Consider things that a sane encoder should not do as an error.
|
||||
@end table
|
||||
|
||||
@item use_wallclock_as_timestamps @var{integer} (@emph{input})
|
||||
Use wallclock as timestamps.
|
||||
|
||||
@item avoid_negative_ts @var{integer} (@emph{output})
|
||||
Shift timestamps to make them positive. 1 enables, 0 disables, default
|
||||
of -1 enables when required by target format.
|
||||
|
||||
@item skip_initial_bytes @var{integer} (@emph{input})
|
||||
Set number initial bytes to skip. Default is 0.
|
||||
|
||||
@item correct_ts_overflow @var{integer} (@emph{input})
|
||||
Correct single timestamp overflows if set to 1. Default is 1.
|
||||
@end table
|
||||
|
||||
@c man end FORMAT OPTIONS
|
||||
|
||||
@include demuxers.texi
|
||||
@include muxers.texi
|
||||
@include metadata.texi
|
||||
|
||||
@chapter See Also
|
||||
|
||||
|
||||
@@ -12,14 +12,208 @@
|
||||
@chapter Description
|
||||
@c man begin DESCRIPTION
|
||||
|
||||
The FFmpeg resampler provides a high-level interface to the
|
||||
The FFmpeg resampler provides an high-level interface to the
|
||||
libswresample library audio resampling utilities. In particular it
|
||||
allows to perform audio resampling, audio channel layout rematrixing,
|
||||
and convert audio format and packing layout.
|
||||
|
||||
@c man end DESCRIPTION
|
||||
|
||||
@include resampler.texi
|
||||
@chapter Resampler Options
|
||||
@c man begin RESAMPLER OPTIONS
|
||||
|
||||
The audio resampler supports the following named options.
|
||||
|
||||
Options may be set by specifying -@var{option} @var{value} in the
|
||||
FFmpeg tools, @var{option}=@var{value} for the aresample filter,
|
||||
by setting the value explicitly in the
|
||||
@code{SwrContext} options or using the @file{libavutil/opt.h} API for
|
||||
programmatic use.
|
||||
|
||||
@table @option
|
||||
|
||||
@item ich, in_channel_count
|
||||
Set the number of input channels. Default value is 0. Setting this
|
||||
value is not mandatory if the corresponding channel layout
|
||||
@option{in_channel_layout} is set.
|
||||
|
||||
@item och, out_channel_count
|
||||
Set the number of output channels. Default value is 0. Setting this
|
||||
value is not mandatory if the corresponding channel layout
|
||||
@option{out_channel_layout} is set.
|
||||
|
||||
@item uch, used_channel_count
|
||||
Set the number of used channels. Default value is 0. This option is
|
||||
only used for special remapping.
|
||||
|
||||
@item isr, in_sample_rate
|
||||
Set the input sample rate. Default value is 0.
|
||||
|
||||
@item osr, out_sample_rate
|
||||
Set the output sample rate. Default value is 0.
|
||||
|
||||
@item isf, in_sample_fmt
|
||||
Specify the input sample format. It is set by default to @code{none}.
|
||||
|
||||
@item osf, out_sample_fmt
|
||||
Specify the output sample format. It is set by default to @code{none}.
|
||||
|
||||
@item tsf, internal_sample_fmt
|
||||
Set the internal sample format. Default value is @code{none}.
|
||||
|
||||
@item icl, in_channel_layout
|
||||
Set the input channel layout.
|
||||
|
||||
@item ocl, out_channel_layout
|
||||
Set the output channel layout.
|
||||
|
||||
@item clev, center_mix_level
|
||||
Set center mix level. It is a value expressed in deciBel, and must be
|
||||
inclusively included between -32 and +32.
|
||||
|
||||
@item slev, surround_mix_level
|
||||
Set surround mix level. It is a value expressed in deciBel, and must
|
||||
be inclusively included between -32 and +32.
|
||||
|
||||
@item lfe_mix_evel
|
||||
Set LFE mix level.
|
||||
|
||||
@item rmvol, rematrix_volume
|
||||
Set rematrix volume. Default value is 1.0.
|
||||
|
||||
@item flags, swr_flags
|
||||
Set flags used by the converter. Default value is 0.
|
||||
|
||||
It supports the following individual flags:
|
||||
@table @option
|
||||
@item res
|
||||
force resampling
|
||||
@end table
|
||||
|
||||
@item dither_scale
|
||||
Set the dither scale. Default value is 1.
|
||||
|
||||
@item dither_method
|
||||
Set dither method. Default value is 0.
|
||||
|
||||
Supported values:
|
||||
@table @samp
|
||||
@item rectangular
|
||||
select rectangular dither
|
||||
@item triangular
|
||||
select triangular dither
|
||||
@item triangular_hp
|
||||
select triangular dither with high pass
|
||||
@end table
|
||||
|
||||
@item resampler
|
||||
Set resampling engine. Default value is swr.
|
||||
|
||||
Supported values:
|
||||
@table @samp
|
||||
@item swr
|
||||
select the native SW Resampler; filter options precision and cheby are not
|
||||
applicable in this case.
|
||||
@item soxr
|
||||
select the SoX Resampler (where available); compensation, and filter options
|
||||
filter_size, phase_shift, filter_type & kaiser_beta, are not applicable in this
|
||||
case.
|
||||
@end table
|
||||
|
||||
@item filter_size
|
||||
For swr only, set resampling filter size, default value is 32.
|
||||
|
||||
@item phase_shift
|
||||
For swr only, set resampling phase shift, default value is 10, must be included
|
||||
between 0 and 30.
|
||||
|
||||
@item linear_interp
|
||||
Use Linear Interpolation if set to 1, default value is 0.
|
||||
|
||||
@item cutoff
|
||||
Set cutoff frequency (swr: 6dB point; soxr: 0dB point) ratio; must be a float
|
||||
value between 0 and 1. Default value is 0.97 with swr, and 0.91 with soxr
|
||||
(which, with a sample-rate of 44100, preserves the entire audio band to 20kHz).
|
||||
|
||||
@item precision
|
||||
For soxr only, the precision in bits to which the resampled signal will be
|
||||
calculated. The default value of 20 (which, with suitable dithering, is
|
||||
appropriate for a destination bit-depth of 16) gives SoX's 'High Quality'; a
|
||||
value of 28 gives SoX's 'Very High Quality'.
|
||||
|
||||
@item cheby
|
||||
For soxr only, selects passband rolloff none (Chebyshev) & higher-precision
|
||||
approximation for 'irrational' ratios. Default value is 0.
|
||||
|
||||
@item async
|
||||
For swr only, simple 1 parameter audio sync to timestamps using stretching,
|
||||
squeezing, filling and trimming. Setting this to 1 will enable filling and
|
||||
trimming, larger values represent the maximum amount in samples that the data
|
||||
may be stretched or squeezed for each second.
|
||||
Default value is 0, thus no compensation is applied to make the samples match
|
||||
the audio timestamps.
|
||||
|
||||
@item min_comp
|
||||
For swr only, set the minimum difference between timestamps and audio data (in
|
||||
seconds) to trigger stretching/squeezing/filling or trimming of the
|
||||
data to make it match the timestamps. The default is that
|
||||
stretching/squeezing/filling and trimming is disabled
|
||||
(@option{min_comp} = @code{FLT_MAX}).
|
||||
|
||||
@item min_hard_comp
|
||||
For swr only, set the minimum difference between timestamps and audio data (in
|
||||
seconds) to trigger adding/dropping samples to make it match the
|
||||
timestamps. This option effectively is a threshold to select between
|
||||
hard (trim/fill) and soft (squeeze/stretch) compensation. Note that
|
||||
all compensation is by default disabled through @option{min_comp}.
|
||||
The default is 0.1.
|
||||
|
||||
@item comp_duration
|
||||
For swr only, set duration (in seconds) over which data is stretched/squeezed
|
||||
to make it match the timestamps. Must be a non-negative double float value,
|
||||
default value is 1.0.
|
||||
|
||||
@item max_soft_comp
|
||||
For swr only, set maximum factor by which data is stretched/squeezed to make it
|
||||
match the timestamps. Must be a non-negative double float value, default value
|
||||
is 0.
|
||||
|
||||
@item matrix_encoding
|
||||
Select matrixed stereo encoding.
|
||||
|
||||
It accepts the following values:
|
||||
@table @samp
|
||||
@item none
|
||||
select none
|
||||
@item dolby
|
||||
select Dolby
|
||||
@item dplii
|
||||
select Dolby Pro Logic II
|
||||
@end table
|
||||
|
||||
Default value is @code{none}.
|
||||
|
||||
@item filter_type
|
||||
For swr only, select resampling filter type. This only affects resampling
|
||||
operations.
|
||||
|
||||
It accepts the following values:
|
||||
@table @samp
|
||||
@item cubic
|
||||
select cubic
|
||||
@item blackman_nuttall
|
||||
select Blackman Nuttall Windowed Sinc
|
||||
@item kaiser
|
||||
select Kaiser Windowed Sinc
|
||||
@end table
|
||||
|
||||
@item kaiser_beta
|
||||
For swr only, set Kaiser Window Beta value. Must be an integer included between
|
||||
2 and 16, default value is 9.
|
||||
|
||||
@end table
|
||||
|
||||
@c man end RESAMPLER OPTIONS
|
||||
|
||||
@chapter See Also
|
||||
|
||||
|
||||
@@ -12,13 +12,111 @@
|
||||
@chapter Description
|
||||
@c man begin DESCRIPTION
|
||||
|
||||
The FFmpeg rescaler provides a high-level interface to the libswscale
|
||||
The FFmpeg rescaler provides an high-level interface to the libswscale
|
||||
library image conversion utilities. In particular it allows to perform
|
||||
image rescaling and pixel format conversion.
|
||||
|
||||
@c man end DESCRIPTION
|
||||
|
||||
@include scaler.texi
|
||||
@chapter Scaler Options
|
||||
@c man begin SCALER OPTIONS
|
||||
|
||||
The video scaler supports the following named options.
|
||||
|
||||
Options may be set by specifying -@var{option} @var{value} in the
|
||||
FFmpeg tools. For programmatic use, they can be set explicitly in the
|
||||
@code{SwsContext} options or through the @file{libavutil/opt.h} API.
|
||||
|
||||
@table @option
|
||||
|
||||
@item sws_flags
|
||||
Set the scaler flags. This is also used to set the scaling
|
||||
algorithm. Only a single algorithm should be selected.
|
||||
|
||||
It accepts the following values:
|
||||
@table @samp
|
||||
@item fast_bilinear
|
||||
Select fast bilinear scaling algorithm.
|
||||
|
||||
@item bilinear
|
||||
Select bilinear scaling algorithm.
|
||||
|
||||
@item bicubic
|
||||
Select bicubic scaling algorithm.
|
||||
|
||||
@item experimental
|
||||
Select experimental scaling algorithm.
|
||||
|
||||
@item neighbor
|
||||
Select nearest neighbor rescaling algorithm.
|
||||
|
||||
@item area
|
||||
Select averaging area rescaling algorithm.
|
||||
|
||||
@item bicubiclin
|
||||
Select bicubic scaling algorithm for the luma component, bilinear for
|
||||
chroma components.
|
||||
|
||||
@item gauss
|
||||
Select Gaussian rescaling algorithm.
|
||||
|
||||
@item sinc
|
||||
Select sinc rescaling algorithm.
|
||||
|
||||
@item lanczos
|
||||
Select lanczos rescaling algorithm.
|
||||
|
||||
@item spline
|
||||
Select natural bicubic spline rescaling algorithm.
|
||||
|
||||
@item print_info
|
||||
Enable printing/debug logging.
|
||||
|
||||
@item accurate_rnd
|
||||
Enable accurate rounding.
|
||||
|
||||
@item full_chroma_int
|
||||
Enable full chroma interpolation.
|
||||
|
||||
@item full_chroma_inp
|
||||
Select full chroma input.
|
||||
|
||||
@item bitexact
|
||||
Enable bitexact output.
|
||||
@end table
|
||||
|
||||
@item srcw
|
||||
Set source width.
|
||||
|
||||
@item srch
|
||||
Set source height.
|
||||
|
||||
@item dstw
|
||||
Set destination width.
|
||||
|
||||
@item dsth
|
||||
Set destination height.
|
||||
|
||||
@item src_format
|
||||
Set source pixel format (must be expressed as an integer).
|
||||
|
||||
@item dst_format
|
||||
Set destination pixel format (must be expressed as an integer).
|
||||
|
||||
@item src_range
|
||||
Select source range.
|
||||
|
||||
@item dst_range
|
||||
Select destination range.
|
||||
|
||||
@item param0, param1
|
||||
Set scaling algorithm parameters. The specified values are specific of
|
||||
some scaling algorithms and ignored by others. The specified values
|
||||
are floating point number values.
|
||||
|
||||
@end table
|
||||
|
||||
@c man end SCALER OPTIONS
|
||||
|
||||
@chapter See Also
|
||||
|
||||
|
||||
@@ -17,7 +17,8 @@ by the libavutil library.
|
||||
|
||||
@c man end DESCRIPTION
|
||||
|
||||
@include utils.texi
|
||||
@include syntax.texi
|
||||
@include eval.texi
|
||||
|
||||
@chapter See Also
|
||||
|
||||
|
||||
308
doc/ffmpeg.texi
308
doc/ffmpeg.texi
@@ -16,26 +16,26 @@ ffmpeg [@var{global_options}] @{[@var{input_file_options}] -i @file{input_file}@
|
||||
@chapter Description
|
||||
@c man begin DESCRIPTION
|
||||
|
||||
@command{ffmpeg} is a very fast video and audio converter that can also grab from
|
||||
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
|
||||
rates and resize video on the fly with a high quality polyphase filter.
|
||||
|
||||
@command{ffmpeg} reads from an arbitrary number of input "files" (which can be regular
|
||||
ffmpeg reads from an arbitrary number of input "files" (which can be regular
|
||||
files, pipes, network streams, grabbing devices, etc.), specified by the
|
||||
@code{-i} option, and writes to an arbitrary number of output "files", which are
|
||||
specified by a plain output filename. Anything found on the command line which
|
||||
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). The allowed number and/or
|
||||
types of streams may be limited by the container format. Selecting which
|
||||
streams from which inputs will go into which output is either done automatically
|
||||
or with the @code{-map} option (see the Stream selection chapter).
|
||||
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
|
||||
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. Also see the Stream specifiers chapter.
|
||||
fourth stream in the third input file. See also the Stream specifiers chapter.
|
||||
|
||||
As a general rule, options are applied to the next specified
|
||||
file. Therefore, order is important, and you can have the same
|
||||
@@ -50,7 +50,7 @@ options apply ONLY to the next input or output file and are reset between files.
|
||||
|
||||
@itemize
|
||||
@item
|
||||
To set the video bitrate of the output file to 64 kbit/s:
|
||||
To set the video bitrate of the output file to 64kbit/s:
|
||||
@example
|
||||
ffmpeg -i input.avi -b:v 64k -bufsize 64k output.avi
|
||||
@end example
|
||||
@@ -96,14 +96,14 @@ tracking lowest timestamp on any active input stream.
|
||||
Encoded packets are then passed to the decoder (unless streamcopy is selected
|
||||
for the stream, see further for a description). The decoder produces
|
||||
uncompressed frames (raw video/PCM audio/...) which can be processed further by
|
||||
filtering (see next section). After filtering, the frames are passed to the
|
||||
encoder, which encodes them and outputs encoded packets. Finally those are
|
||||
filtering (see next section). After filtering the frames are passed to the
|
||||
encoder, which encodes them and outputs encoded packets again. Finally those are
|
||||
passed to the muxer, which writes the encoded packets to the output file.
|
||||
|
||||
@section Filtering
|
||||
Before encoding, @command{ffmpeg} can process raw audio and video frames using
|
||||
filters from the libavfilter library. Several chained filters form a filter
|
||||
graph. @command{ffmpeg} distinguishes between two types of filtergraphs:
|
||||
graph. @command{ffmpeg} distinguishes between two types of filtergraphs -
|
||||
simple and complex.
|
||||
|
||||
@subsection Simple filtergraphs
|
||||
@@ -139,7 +139,7 @@ only sets timestamps and otherwise passes the frames unchanged.
|
||||
|
||||
@subsection Complex filtergraphs
|
||||
Complex filtergraphs are those which cannot be described as simply a linear
|
||||
processing chain applied to one stream. This is the case, for example, when the graph has
|
||||
processing chain applied to one stream. This is the case e.g. when the graph has
|
||||
more than one input and/or output, or when output stream type is different from
|
||||
input. They can be represented with the following diagram:
|
||||
|
||||
@@ -164,11 +164,9 @@ input. They can be represented with the following diagram:
|
||||
@end example
|
||||
|
||||
Complex filtergraphs are configured with the @option{-filter_complex} option.
|
||||
Note that this option is global, since a complex filtergraph, by its nature,
|
||||
Note that this option is global, since a complex filtergraph by its nature
|
||||
cannot be unambiguously associated with a single stream or file.
|
||||
|
||||
The @option{-lavfi} option is equivalent to @option{-filter_complex}.
|
||||
|
||||
A trivial example of a complex filtergraph is the @code{overlay} filter, which
|
||||
has two video inputs and one video output, containing one video overlaid on top
|
||||
of the other. Its audio counterpart is the @code{amix} filter.
|
||||
@@ -178,7 +176,7 @@ Stream copy is a mode selected by supplying the @code{copy} parameter to the
|
||||
@option{-codec} option. It makes @command{ffmpeg} omit the decoding and encoding
|
||||
step for the specified stream, so it does only demuxing and muxing. It is useful
|
||||
for changing the container format or modifying container-level metadata. The
|
||||
diagram above will, in this case, simplify to this:
|
||||
diagram above will in this case simplify to this:
|
||||
|
||||
@example
|
||||
_______ ______________ ________
|
||||
@@ -190,7 +188,7 @@ diagram above will, in this case, simplify to this:
|
||||
@end example
|
||||
|
||||
Since there is no decoding or encoding, it is very fast and there is no quality
|
||||
loss. However, it might not work in some cases because of many factors. Applying
|
||||
loss. However it might not work in some cases because of many factors. Applying
|
||||
filters is obviously also impossible, since filters work on uncompressed data.
|
||||
|
||||
@c man end DETAILED DESCRIPTION
|
||||
@@ -198,14 +196,14 @@ filters is obviously also impossible, since filters work on uncompressed data.
|
||||
@chapter Stream selection
|
||||
@c man begin STREAM SELECTION
|
||||
|
||||
By default, @command{ffmpeg} includes only one stream of each type (video, audio, subtitle)
|
||||
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, it is the stream with the most channels, for
|
||||
subtitles, it is the first subtitle stream. In the case where several streams of
|
||||
the same type rate equally, the stream with the lowest index is chosen.
|
||||
"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 the @code{-vn/-an/-sn} options. For
|
||||
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.
|
||||
|
||||
@@ -214,7 +212,7 @@ described.
|
||||
@chapter Options
|
||||
@c man begin OPTIONS
|
||||
|
||||
@include fftools-common-opts.texi
|
||||
@include avtools-common-opts.texi
|
||||
|
||||
@section Main options
|
||||
|
||||
@@ -222,7 +220,7 @@ described.
|
||||
|
||||
@item -f @var{fmt} (@emph{input/output})
|
||||
Force input or output file format. The format is normally auto detected for input
|
||||
files and guessed from the file extension for output files, so this option is not
|
||||
files and guessed from file extension for output files, so this option is not
|
||||
needed in most cases.
|
||||
|
||||
@item -i @var{filename} (@emph{input})
|
||||
@@ -232,8 +230,7 @@ input file name
|
||||
Overwrite output files without asking.
|
||||
|
||||
@item -n (@emph{global})
|
||||
Do not overwrite output files, and exit immediately if a specified
|
||||
output file already exists.
|
||||
Do not overwrite output files but exit if file exists.
|
||||
|
||||
@item -c[:@var{stream_specifier}] @var{codec} (@emph{input/output,per-stream})
|
||||
@itemx -codec[:@var{stream_specifier}] @var{codec} (@emph{input/output,per-stream})
|
||||
@@ -259,28 +256,14 @@ libx264, and the 138th audio, which will be encoded with libvorbis.
|
||||
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.
|
||||
|
||||
-to and -t are mutually exclusive and -t has priority.
|
||||
|
||||
@item -to @var{position} (@emph{output})
|
||||
Stop writing the output at @var{position}.
|
||||
@var{position} may be a number in seconds, or in @code{hh:mm:ss[.xxx]} form.
|
||||
|
||||
-to and -t are mutually exclusive and -t has priority.
|
||||
|
||||
@item -fs @var{limit_size} (@emph{output})
|
||||
Set the file size limit, expressed in bytes.
|
||||
|
||||
@item -ss @var{position} (@emph{input/output})
|
||||
When used as an input option (before @code{-i}), seeks in this input file to
|
||||
@var{position}. Note the in most formats it is not possible to seek exactly, so
|
||||
@command{ffmpeg} will seek to the closest seek point before @var{position}.
|
||||
When transcoding and @option{-accurate_seek} is enabled (the default), this
|
||||
extra segment between the seek point and @var{position} will be decoded and
|
||||
discarded. When doing stream copy or when @option{-noaccurate_seek} is used, it
|
||||
will be preserved.
|
||||
|
||||
When used as an output option (before an output filename), decodes but discards
|
||||
input until the timestamps reach @var{position}.
|
||||
@var{position}. When used as an output option (before an output filename),
|
||||
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.
|
||||
|
||||
@@ -351,32 +334,18 @@ Stop writing to the stream after @var{framecount} frames.
|
||||
Use fixed quality scale (VBR). The meaning of @var{q} is
|
||||
codec-dependent.
|
||||
|
||||
@anchor{filter_option}
|
||||
@item -filter[:@var{stream_specifier}] @var{filtergraph} (@emph{output,per-stream})
|
||||
Create the filtergraph specified by @var{filtergraph} and use it to
|
||||
filter the stream.
|
||||
|
||||
@var{filtergraph} is a description of the filtergraph to apply to
|
||||
the stream, and must have a single input and a single output of the
|
||||
same type of the stream. In the filtergraph, the input is associated
|
||||
to the label @code{in}, and the output to the label @code{out}. See
|
||||
the ffmpeg-filters manual for more information about the filtergraph
|
||||
syntax.
|
||||
|
||||
See the @ref{filter_complex_option,,-filter_complex option} if you
|
||||
want to create filtergraphs with multiple inputs and/or outputs.
|
||||
|
||||
@item -filter_script[:@var{stream_specifier}] @var{filename} (@emph{output,per-stream})
|
||||
This option is similar to @option{-filter}, the only difference is that its
|
||||
argument is the name of the file from which a filtergraph description is to be
|
||||
read.
|
||||
@item -filter[:@var{stream_specifier}] @var{filter_graph} (@emph{output,per-stream})
|
||||
@var{filter_graph} is a description of the filter graph to apply to
|
||||
the stream. Use @code{-filters} to show all the available filters
|
||||
(including also sources and sinks).
|
||||
|
||||
See also the @option{-filter_complex} option if you want to create filter graphs
|
||||
with multiple inputs and/or outputs.
|
||||
@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. It is on by default, to explicitly
|
||||
disable it you need to specify @code{-nostats}.
|
||||
Print encoding progress/statistics. On by default.
|
||||
|
||||
@item -progress @var{url} (@emph{global})
|
||||
Send program-friendly progress information to @var{url}.
|
||||
@@ -426,11 +395,11 @@ will be used.
|
||||
|
||||
E.g. to extract the first attachment to a file named 'out.ttf':
|
||||
@example
|
||||
ffmpeg -dump_attachment:t:0 out.ttf -i INPUT
|
||||
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 "" -i INPUT
|
||||
ffmpeg -dump_attachment:t "" INPUT
|
||||
@end example
|
||||
|
||||
Technical note -- attachments are implemented as codec extradata, so this
|
||||
@@ -474,9 +443,20 @@ form @var{num}:@var{den}, where @var{num} and @var{den} are the
|
||||
numerator and denominator of the aspect ratio. For example "4:3",
|
||||
"16:9", "1.3333", and "1.7777" are valid argument values.
|
||||
|
||||
If used together with @option{-vcodec copy}, it will affect the aspect ratio
|
||||
stored at container level, but not the aspect ratio stored in encoded
|
||||
frames, if it exists.
|
||||
@item -croptop @var{size}
|
||||
@item -cropbottom @var{size}
|
||||
@item -cropleft @var{size}
|
||||
@item -cropright @var{size}
|
||||
All the crop options have been removed. Use -vf
|
||||
crop=width:height:x:y instead.
|
||||
|
||||
@item -padtop @var{size}
|
||||
@item -padbottom @var{size}
|
||||
@item -padleft @var{size}
|
||||
@item -padright @var{size}
|
||||
@item -padcolor @var{hex_color}
|
||||
All the pad options have been removed. Use -vf
|
||||
pad=width:height:x:y:color instead.
|
||||
|
||||
@item -vn (@emph{output})
|
||||
Disable video recording.
|
||||
@@ -506,11 +486,12 @@ stream
|
||||
@item -vlang @var{code}
|
||||
Set the ISO 639 language code (3 letters) of the current video stream.
|
||||
|
||||
@item -vf @var{filtergraph} (@emph{output})
|
||||
Create the filtergraph specified by @var{filtergraph} and use it to
|
||||
filter the stream.
|
||||
@item -vf @var{filter_graph} (@emph{output})
|
||||
@var{filter_graph} is a description of the filter graph to apply to
|
||||
the input video.
|
||||
Use the option "-filters" to show all the available filters (including
|
||||
also sources and sinks). This is an alias for @code{-filter:v}.
|
||||
|
||||
This is an alias for @code{-filter:v}, see the @ref{filter_option,,-filter option}.
|
||||
@end table
|
||||
|
||||
@section Advanced Video Options
|
||||
@@ -523,7 +504,7 @@ If the selected pixel format can not be selected, ffmpeg will print a
|
||||
warning and select the best pixel format supported by the encoder.
|
||||
If @var{pix_fmt} is prefixed by a @code{+}, ffmpeg will exit with an error
|
||||
if the requested pixel format can not be selected, and automatic conversions
|
||||
inside filtergraphs are disabled.
|
||||
inside filter graphs are disabled.
|
||||
If @var{pix_fmt} is a single @code{+}, ffmpeg selects the same pixel format
|
||||
as the input (or graph output) and automatic conversions are disabled.
|
||||
|
||||
@@ -538,6 +519,10 @@ list separated with slashes. Two first values are the beginning and
|
||||
end frame numbers, last one is quantizer to use if positive, or quality
|
||||
factor if negative.
|
||||
|
||||
@item -deinterlace
|
||||
Deinterlace pictures.
|
||||
This option is deprecated since the deinterlacing is very low quality.
|
||||
Use the yadif filter with @code{-filter:v yadif}.
|
||||
@item -ilme
|
||||
Force interlacing support in encoder (MPEG-2 and MPEG-4 only).
|
||||
Use this option if your input file is interlaced and you want
|
||||
@@ -560,58 +545,12 @@ Force video tag/fourcc. This is an alias for @code{-tag:v}.
|
||||
Show QP histogram
|
||||
@item -vbsf @var{bitstream_filter}
|
||||
Deprecated see -bsf
|
||||
|
||||
@item -force_key_frames[:@var{stream_specifier}] @var{time}[,@var{time}...] (@emph{output,per-stream})
|
||||
@item -force_key_frames[:@var{stream_specifier}] expr:@var{expr} (@emph{output,per-stream})
|
||||
Force key frames at the specified timestamps, more precisely at the first
|
||||
frames after each specified time.
|
||||
|
||||
If the argument is prefixed with @code{expr:}, the string @var{expr}
|
||||
is interpreted like an expression and is evaluated for each frame. A
|
||||
key frame is forced in case the evaluation is non-zero.
|
||||
|
||||
If one of the times is "@code{chapters}[@var{delta}]", it is expanded into
|
||||
the time of the beginning of all chapters in the file, shifted by
|
||||
@var{delta}, expressed as a time in seconds.
|
||||
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.
|
||||
|
||||
For example, to insert a key frame at 5 minutes, plus key frames 0.1 second
|
||||
before the beginning of every chapter:
|
||||
@example
|
||||
-force_key_frames 0:05:00,chapters-0.1
|
||||
@end example
|
||||
|
||||
The expression in @var{expr} can contain the following constants:
|
||||
@table @option
|
||||
@item n
|
||||
the number of current processed frame, starting from 0
|
||||
@item n_forced
|
||||
the number of forced frames
|
||||
@item prev_forced_n
|
||||
the number of the previous forced frame, it is @code{NAN} when no
|
||||
keyframe was forced yet
|
||||
@item prev_forced_t
|
||||
the time of the previous forced frame, it is @code{NAN} when no
|
||||
keyframe was forced yet
|
||||
@item t
|
||||
the time of the current processed frame
|
||||
@end table
|
||||
|
||||
For example to force a key frame every 5 seconds, you can specify:
|
||||
@example
|
||||
-force_key_frames expr:gte(t,n_forced*5)
|
||||
@end example
|
||||
|
||||
To force a key frame 5 seconds after the time of the last forced one,
|
||||
starting from second 13:
|
||||
@example
|
||||
-force_key_frames expr:if(isnan(prev_forced_t),gte(t,13),gte(t,prev_forced_t+5))
|
||||
@end example
|
||||
|
||||
Note that forcing too many keyframes is very harmful for the lookahead
|
||||
algorithms of certain encoders: using fixed-GOP options or similar
|
||||
would be more efficient.
|
||||
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
|
||||
@@ -642,12 +581,11 @@ Set the audio codec. This is an alias for @code{-codec:a}.
|
||||
@item -sample_fmt[:@var{stream_specifier}] @var{sample_fmt} (@emph{output,per-stream})
|
||||
Set the audio sample format. Use @code{-sample_fmts} to get a list
|
||||
of supported sample formats.
|
||||
|
||||
@item -af @var{filtergraph} (@emph{output})
|
||||
Create the filtergraph specified by @var{filtergraph} and use it to
|
||||
filter the stream.
|
||||
|
||||
This is an alias for @code{-filter:a}, see the @ref{filter_option,,-filter option}.
|
||||
@item -af @var{filter_graph} (@emph{output})
|
||||
@var{filter_graph} is a description of the filter graph to apply to
|
||||
the input audio.
|
||||
Use the option "-filters" to show all the available filters (including
|
||||
also sources and sinks). This is an alias for @code{-filter:a}.
|
||||
@end table
|
||||
|
||||
@section Advanced Audio options:
|
||||
@@ -657,12 +595,6 @@ This is an alias for @code{-filter:a}, see the @ref{filter_option,,-filter optio
|
||||
Force audio tag/fourcc. This is an alias for @code{-tag:a}.
|
||||
@item -absf @var{bitstream_filter}
|
||||
Deprecated, see -bsf
|
||||
@item -guess_layout_max @var{channels} (@emph{input,per-stream})
|
||||
If some input channel layout is not known, try to guess only if it
|
||||
corresponds to at most the specified number of channels. For example, 2
|
||||
tells to @command{ffmpeg} to recognize 1 channel as mono and 2 channels as
|
||||
stereo but not 6 channels as 5.1. The default is to always try to guess. Use
|
||||
0 to disable all guessing.
|
||||
@end table
|
||||
|
||||
@section Subtitle options:
|
||||
@@ -695,9 +627,6 @@ Note that this option will delay the output of all data until the next
|
||||
subtitle packet is decoded: it may increase memory consumption and latency a
|
||||
lot.
|
||||
|
||||
@item -canvas_size @var{size}
|
||||
Set the size of the canvas used to render subtitles.
|
||||
|
||||
@end table
|
||||
|
||||
@section Advanced options
|
||||
@@ -877,12 +806,13 @@ Dump each input packet to stderr.
|
||||
When dumping packets, also dump the payload.
|
||||
@item -re (@emph{input})
|
||||
Read input at native frame rate. Mainly used to simulate a grab device.
|
||||
or live input stream (e.g. when reading from a file). Should not be used
|
||||
with actual grab devices or live input streams (where it can cause packet
|
||||
loss).
|
||||
By default @command{ffmpeg} attempts to read the input(s) as fast as possible.
|
||||
This option will slow down the reading of the input(s) to the native frame rate
|
||||
of the input(s). It is useful for real-time output (e.g. live streaming).
|
||||
of the input(s). It is useful for real-time output (e.g. live streaming). If
|
||||
your input(s) is coming from some other live streaming source (through HTTP or
|
||||
UDP for example) the server might already be in real-time, thus the option will
|
||||
likely not be required. On the other hand, this is meaningful if your input(s)
|
||||
is a file you are trying to push in real-time.
|
||||
@item -loop_input
|
||||
Loop over the input stream. Currently it works only for image
|
||||
streams. This option is used for automatic FFserver testing.
|
||||
@@ -901,7 +831,7 @@ Newly added values will have to be specified as strings always.
|
||||
Each frame is passed with its timestamp from the demuxer to the muxer.
|
||||
@item 1, cfr
|
||||
Frames will be duplicated and dropped to achieve exactly the requested
|
||||
constant frame rate.
|
||||
constant framerate.
|
||||
@item 2, vfr
|
||||
Frames are passed through with their timestamp or dropped so as to
|
||||
prevent 2 frames from having the same timestamp.
|
||||
@@ -913,10 +843,6 @@ Chooses between 1 and 2 depending on muxer capabilities. This is the
|
||||
default method.
|
||||
@end table
|
||||
|
||||
Note that the timestamps may be further modified by the muxer, after this.
|
||||
For example, in the case that the format option @option{avoid_negative_ts}
|
||||
is enabled.
|
||||
|
||||
With -map you can select from which stream the timestamps should be
|
||||
taken. You can leave either video or audio unchanged and sync the
|
||||
remaining stream(s) to the unchanged one.
|
||||
@@ -926,11 +852,6 @@ Audio sync method. "Stretches/squeezes" the audio stream to match the timestamps
|
||||
the parameter is the maximum samples per second by which the audio is changed.
|
||||
-async 1 is a special case where only the start of the audio stream is corrected
|
||||
without any later correction.
|
||||
|
||||
Note that the timestamps may be further modified by the muxer, after this.
|
||||
For example, in the case that the format option @option{avoid_negative_ts}
|
||||
is enabled.
|
||||
|
||||
This option has been deprecated. Use the @code{aresample} audio filter instead.
|
||||
|
||||
@item -copyts
|
||||
@@ -939,8 +860,7 @@ to sanitize them. In particular, do not remove the initial start time
|
||||
offset value.
|
||||
|
||||
Note that, depending on the @option{vsync} option or on specific muxer
|
||||
processing (e.g. in case the format option @option{avoid_negative_ts}
|
||||
is enabled) the output timestamps may mismatch with the input
|
||||
processing, the output timestamps may mismatch with the input
|
||||
timestamps even when this option is selected.
|
||||
|
||||
@item -copytb @var{mode}
|
||||
@@ -1008,12 +928,11 @@ Specify Timecode for writing. @var{SEP} is ':' for non drop timecode and ';'
|
||||
ffmpeg -i input.mpg -timecode 01:02:03.04 -r 30000/1001 -s ntsc output.mpg
|
||||
@end example
|
||||
|
||||
@anchor{filter_complex_option}
|
||||
@item -filter_complex @var{filtergraph} (@emph{global})
|
||||
Define a complex filtergraph, i.e. one with arbitrary number of inputs and/or
|
||||
Define a complex filter graph, i.e. one with arbitrary number of inputs and/or
|
||||
outputs. For simple graphs -- those with one input and one output of the same
|
||||
type -- see the @option{-filter} options. @var{filtergraph} is a description of
|
||||
the filtergraph, as described in the ``Filtergraph syntax'' section of the
|
||||
the filter graph, as described in the ``Filtergraph syntax'' section of the
|
||||
ffmpeg-filters manual.
|
||||
|
||||
Input link labels must refer to input streams using the
|
||||
@@ -1053,32 +972,8 @@ ffmpeg -i video.mkv -i image.png -filter_complex 'overlay' out.mkv
|
||||
|
||||
To generate 5 seconds of pure red video using lavfi @code{color} source:
|
||||
@example
|
||||
ffmpeg -filter_complex 'color=c=red' -t 5 out.mkv
|
||||
ffmpeg -filter_complex 'color=red' -t 5 out.mkv
|
||||
@end example
|
||||
|
||||
@item -lavfi @var{filtergraph} (@emph{global})
|
||||
Define a complex filtergraph, i.e. one with arbitrary number of inputs and/or
|
||||
outputs. Equivalent to @option{-filter_complex}.
|
||||
|
||||
@item -filter_complex_script @var{filename} (@emph{global})
|
||||
This option is similar to @option{-filter_complex}, the only difference is that
|
||||
its argument is the name of the file from which a complex filtergraph
|
||||
description is to be read.
|
||||
|
||||
@item -accurate_seek (@emph{input})
|
||||
This option enables or disables accurate seeking in input files with the
|
||||
@option{-ss} option. It is enabled by default, so seeking is accurate when
|
||||
transcoding. Use @option{-noaccurate_seek} to disable it, which may be useful
|
||||
e.g. when copying some streams and transcoding the others.
|
||||
|
||||
@item -override_ffserver (@emph{global})
|
||||
Overrides the input specifications from ffserver. Using this option you can
|
||||
map any input stream to ffserver and control many aspects of the encoding from
|
||||
ffmpeg. Without this option ffmpeg will transmit to ffserver what is requested by
|
||||
ffserver.
|
||||
The option is intended for cases where features are needed that cannot be
|
||||
specified to ffserver but can be to ffmpeg.
|
||||
|
||||
@end table
|
||||
|
||||
As a special exception, you can use a bitmap subtitle stream as input: it
|
||||
@@ -1136,7 +1031,7 @@ then it will search for the file @file{libvpx-1080p.ffpreset}.
|
||||
|
||||
@itemize
|
||||
@item
|
||||
For streaming at very low bitrates, use a low frame rate
|
||||
For streaming at very low bitrate application, use a low frame rate
|
||||
and a small GOP size. This is especially true for RealVideo where
|
||||
the Linux player does not seem to be very fast, so it can miss
|
||||
frames. An example is:
|
||||
@@ -1215,14 +1110,14 @@ standard mixer.
|
||||
Grab the X11 display with ffmpeg via
|
||||
|
||||
@example
|
||||
ffmpeg -f x11grab -video_size cif -framerate 25 -i :0.0 /tmp/out.mpg
|
||||
ffmpeg -f x11grab -s cif -r 25 -i :0.0 /tmp/out.mpg
|
||||
@end example
|
||||
|
||||
0.0 is display.screen number of your X11 server, same as
|
||||
the DISPLAY environment variable.
|
||||
|
||||
@example
|
||||
ffmpeg -f x11grab -video_size cif -framerate 25 -i :0.0+10,20 /tmp/out.mpg
|
||||
ffmpeg -f x11grab -s cif -r 25 -i :0.0+10,20 /tmp/out.mpg
|
||||
@end example
|
||||
|
||||
0.0 is display.screen number of your X11 server, same as the DISPLAY environment
|
||||
@@ -1381,48 +1276,15 @@ ffmpeg -i src.ext -lmax 21*QP2LAMBDA dst.ext
|
||||
@end itemize
|
||||
@c man end EXAMPLES
|
||||
|
||||
@include config.texi
|
||||
@ifset config-all
|
||||
@ifset config-avutil
|
||||
@include utils.texi
|
||||
@end ifset
|
||||
@ifset config-avcodec
|
||||
@include codecs.texi
|
||||
@include bitstream_filters.texi
|
||||
@end ifset
|
||||
@ifset config-avformat
|
||||
@include formats.texi
|
||||
@include protocols.texi
|
||||
@end ifset
|
||||
@ifset config-avdevice
|
||||
@include devices.texi
|
||||
@end ifset
|
||||
@ifset config-swresample
|
||||
@include resampler.texi
|
||||
@end ifset
|
||||
@ifset config-swscale
|
||||
@include scaler.texi
|
||||
@end ifset
|
||||
@ifset config-avfilter
|
||||
@include filters.texi
|
||||
@end ifset
|
||||
@end ifset
|
||||
|
||||
@chapter See Also
|
||||
|
||||
@ifhtml
|
||||
@ifset config-all
|
||||
@url{ffmpeg.html,ffmpeg}
|
||||
@end ifset
|
||||
@ifset config-not-all
|
||||
@url{ffmpeg-all.html,ffmpeg-all},
|
||||
@end ifset
|
||||
@url{ffplay.html,ffplay}, @url{ffprobe.html,ffprobe}, @url{ffserver.html,ffserver},
|
||||
@url{ffmpeg-utils.html,ffmpeg-utils},
|
||||
@url{ffmpeg-scaler.html,ffmpeg-scaler},
|
||||
@url{ffmpeg-resampler.html,ffmpeg-resampler},
|
||||
@url{ffmpeg-codecs.html,ffmpeg-codecs},
|
||||
@url{ffmpeg-bitstream-filters.html,ffmpeg-bitstream-filters},
|
||||
@url{ffmpeg-bitstream-filters,ffmpeg-bitstream-filters},
|
||||
@url{ffmpeg-formats.html,ffmpeg-formats},
|
||||
@url{ffmpeg-devices.html,ffmpeg-devices},
|
||||
@url{ffmpeg-protocols.html,ffmpeg-protocols},
|
||||
@@ -1430,12 +1292,6 @@ ffmpeg -i src.ext -lmax 21*QP2LAMBDA dst.ext
|
||||
@end ifhtml
|
||||
|
||||
@ifnothtml
|
||||
@ifset config-all
|
||||
ffmpeg(1),
|
||||
@end ifset
|
||||
@ifset config-not-all
|
||||
ffmpeg-all(1),
|
||||
@end ifset
|
||||
ffplay(1), ffprobe(1), ffserver(1),
|
||||
ffmpeg-utils(1), ffmpeg-scaler(1), ffmpeg-resampler(1),
|
||||
ffmpeg-codecs(1), ffmpeg-bitstream-filters(1), ffmpeg-formats(1),
|
||||
|
||||
@@ -24,7 +24,7 @@ various FFmpeg APIs.
|
||||
@chapter Options
|
||||
@c man begin OPTIONS
|
||||
|
||||
@include fftools-common-opts.texi
|
||||
@include avtools-common-opts.texi
|
||||
|
||||
@section Main options
|
||||
|
||||
@@ -73,22 +73,11 @@ Default value is "video", if video is not present or cannot be played
|
||||
You can interactively cycle through the available show modes by
|
||||
pressing the key @key{w}.
|
||||
|
||||
@item -vf @var{filtergraph}
|
||||
Create the filtergraph specified by @var{filtergraph} and use it to
|
||||
filter the video stream.
|
||||
|
||||
@var{filtergraph} is a description of the filtergraph to apply to
|
||||
the stream, and must have a single video input and a single video
|
||||
output. In the filtergraph, the input is associated to the label
|
||||
@code{in}, and the output to the label @code{out}. See the
|
||||
ffmpeg-filters manual for more information about the filtergraph
|
||||
syntax.
|
||||
|
||||
@item -af @var{filtergraph}
|
||||
@var{filtergraph} is a description of the filtergraph to apply to
|
||||
the input audio.
|
||||
@item -vf @var{filter_graph}
|
||||
@var{filter_graph} is a description of the filter graph to apply to
|
||||
the input video.
|
||||
Use the option "-filters" to show all the available filters (including
|
||||
sources and sinks).
|
||||
also sources and sinks).
|
||||
|
||||
@item -i @var{input_file}
|
||||
Read @var{input_file}.
|
||||
@@ -99,13 +88,9 @@ Read @var{input_file}.
|
||||
@item -pix_fmt @var{format}
|
||||
Set pixel format.
|
||||
This option has been deprecated in favor of private options, try -pixel_format.
|
||||
|
||||
@item -stats
|
||||
Print several playback statistics, in particular show the stream
|
||||
duration, the codec parameters, the current position in the stream and
|
||||
the audio/video synchronisation drift. It is on by default, to
|
||||
explicitly disable it you need to specify @code{-nostats}.
|
||||
|
||||
Show the stream duration, the codec parameters, the current position in
|
||||
the stream and the audio/video synchronisation drift.
|
||||
@item -bug
|
||||
Work around bugs.
|
||||
@item -fast
|
||||
@@ -174,16 +159,13 @@ Toggle full screen.
|
||||
Pause.
|
||||
|
||||
@item a
|
||||
Cycle audio channel in the curret program.
|
||||
Cycle audio channel.
|
||||
|
||||
@item v
|
||||
Cycle video channel.
|
||||
|
||||
@item t
|
||||
Cycle subtitle channel in the current program.
|
||||
|
||||
@item c
|
||||
Cycle program.
|
||||
Cycle subtitle channel.
|
||||
|
||||
@item w
|
||||
Show audio waves.
|
||||
@@ -204,48 +186,15 @@ Seek to percentage in file corresponding to fraction of width.
|
||||
|
||||
@c man end
|
||||
|
||||
@include config.texi
|
||||
@ifset config-all
|
||||
@ifset config-avutil
|
||||
@include utils.texi
|
||||
@end ifset
|
||||
@ifset config-avcodec
|
||||
@include codecs.texi
|
||||
@include bitstream_filters.texi
|
||||
@end ifset
|
||||
@ifset config-avformat
|
||||
@include formats.texi
|
||||
@include protocols.texi
|
||||
@end ifset
|
||||
@ifset config-avdevice
|
||||
@include devices.texi
|
||||
@end ifset
|
||||
@ifset config-swresample
|
||||
@include resampler.texi
|
||||
@end ifset
|
||||
@ifset config-swscale
|
||||
@include scaler.texi
|
||||
@end ifset
|
||||
@ifset config-avfilter
|
||||
@include filters.texi
|
||||
@end ifset
|
||||
@end ifset
|
||||
|
||||
@chapter See Also
|
||||
|
||||
@ifhtml
|
||||
@ifset config-all
|
||||
@url{ffplay.html,ffplay},
|
||||
@end ifset
|
||||
@ifset config-not-all
|
||||
@url{ffplay-all.html,ffmpeg-all},
|
||||
@end ifset
|
||||
@url{ffmpeg.html,ffmpeg}, @url{ffprobe.html,ffprobe}, @url{ffserver.html,ffserver},
|
||||
@url{ffmpeg-utils.html,ffmpeg-utils},
|
||||
@url{ffmpeg-scaler.html,ffmpeg-scaler},
|
||||
@url{ffmpeg-resampler.html,ffmpeg-resampler},
|
||||
@url{ffmpeg-codecs.html,ffmpeg-codecs},
|
||||
@url{ffmpeg-bitstream-filters.html,ffmpeg-bitstream-filters},
|
||||
@url{ffmpeg-bitstream-filters,ffmpeg-bitstream-filters},
|
||||
@url{ffmpeg-formats.html,ffmpeg-formats},
|
||||
@url{ffmpeg-devices.html,ffmpeg-devices},
|
||||
@url{ffmpeg-protocols.html,ffmpeg-protocols},
|
||||
@@ -253,12 +202,6 @@ Seek to percentage in file corresponding to fraction of width.
|
||||
@end ifhtml
|
||||
|
||||
@ifnothtml
|
||||
@ifset config-all
|
||||
ffplay(1),
|
||||
@end ifset
|
||||
@ifset config-not-all
|
||||
ffplay-all(1),
|
||||
@end ifset
|
||||
ffmpeg(1), ffprobe(1), ffserver(1),
|
||||
ffmpeg-utils(1), ffmpeg-scaler(1), ffmpeg-resampler(1),
|
||||
ffmpeg-codecs(1), ffmpeg-bitstream-filters(1), ffmpeg-formats(1),
|
||||
|
||||
130
doc/ffprobe.texi
130
doc/ffprobe.texi
@@ -44,15 +44,14 @@ name (which may be shared by other sections), and an unique
|
||||
name. See the output of @option{sections}.
|
||||
|
||||
Metadata tags stored in the container or in the streams are recognized
|
||||
and printed in the corresponding "FORMAT", "STREAM" or "PROGRAM_STREAM"
|
||||
section.
|
||||
and printed in the corresponding "FORMAT" or "STREAM" section.
|
||||
|
||||
@c man end
|
||||
|
||||
@chapter Options
|
||||
@c man begin OPTIONS
|
||||
|
||||
@include fftools-common-opts.texi
|
||||
@include avtools-common-opts.texi
|
||||
|
||||
@section Main options
|
||||
|
||||
@@ -113,7 +112,7 @@ ffprobe -show_packets -select_streams v:1 INPUT
|
||||
@end example
|
||||
|
||||
@item -show_data
|
||||
Show payload data, as a hexadecimal and ASCII dump. Coupled with
|
||||
Show payload data, as an hexadecimal and ASCII dump. Coupled with
|
||||
@option{-show_packets}, it will dump the packets' data. Coupled with
|
||||
@option{-show_streams}, it will dump the codec extradata.
|
||||
|
||||
@@ -210,18 +209,6 @@ multimedia stream.
|
||||
Each media stream information is printed within a dedicated section
|
||||
with name "STREAM".
|
||||
|
||||
@item -show_programs
|
||||
Show information about programs and their streams contained in the input
|
||||
multimedia stream.
|
||||
|
||||
Each media stream information is printed within a dedicated section
|
||||
with name "PROGRAM_STREAM".
|
||||
|
||||
@item -show_chapters
|
||||
Show information about chapters stored in the format.
|
||||
|
||||
Each chapter is printed within a dedicated section with name "CHAPTER".
|
||||
|
||||
@item -count_frames
|
||||
Count the number of frames per stream and report it in the
|
||||
corresponding stream section.
|
||||
@@ -230,70 +217,6 @@ corresponding stream section.
|
||||
Count the number of packets per stream and report it in the
|
||||
corresponding stream section.
|
||||
|
||||
@item -read_intervals @var{read_intervals}
|
||||
|
||||
Read only the specified intervals. @var{read_intervals} must be a
|
||||
sequence of interval specifications separated by ",".
|
||||
@command{ffprobe} will seek to the interval starting point, and will
|
||||
continue reading from that.
|
||||
|
||||
Each interval is specified by two optional parts, separated by "%".
|
||||
|
||||
The first part specifies the interval start position. It is
|
||||
interpreted as an abolute position, or as a relative offset from the
|
||||
current position if it is preceded by the "+" character. If this first
|
||||
part is not specified, no seeking will be performed when reading this
|
||||
interval.
|
||||
|
||||
The second part specifies the interval end position. It is interpreted
|
||||
as an absolute position, or as a relative offset from the current
|
||||
position if it is preceded by the "+" character. If the offset
|
||||
specification starts with "#", it is interpreted as the number of
|
||||
packets to read (not including the flushing packets) from the interval
|
||||
start. If no second part is specified, the program will read until the
|
||||
end of the input.
|
||||
|
||||
Note that seeking is not accurate, thus the actual interval start
|
||||
point may be different from the specified position. Also, when an
|
||||
interval duration is specified, the absolute end time will be computed
|
||||
by adding the duration to the interval start point found by seeking
|
||||
the file, rather than to the specified start value.
|
||||
|
||||
The formal syntax is given by:
|
||||
@example
|
||||
@var{INTERVAL} ::= [@var{START}|+@var{START_OFFSET}][%[@var{END}|+@var{END_OFFSET}]]
|
||||
@var{INTERVALS} ::= @var{INTERVAL}[,@var{INTERVALS}]
|
||||
@end example
|
||||
|
||||
A few examples follow.
|
||||
@itemize
|
||||
@item
|
||||
Seek to time 10, read packets until 20 seconds after the found seek
|
||||
point, then seek to position @code{01:30} (1 minute and thirty
|
||||
seconds) and read packets until position @code{01:45}.
|
||||
@example
|
||||
10%+20,01:30%01:45
|
||||
@end example
|
||||
|
||||
@item
|
||||
Read only 42 packets after seeking to position @code{01:23}:
|
||||
@example
|
||||
01:23%+#42
|
||||
@end example
|
||||
|
||||
@item
|
||||
Read only the first 20 seconds from the start:
|
||||
@example
|
||||
%+20
|
||||
@end example
|
||||
|
||||
@item
|
||||
Read from the start until position @code{02:30}:
|
||||
@example
|
||||
%02:30
|
||||
@end example
|
||||
@end itemize
|
||||
|
||||
@item -show_private_data, -private
|
||||
Show private data, that is data depending on the format of the
|
||||
particular shown element.
|
||||
@@ -351,8 +274,8 @@ keyN=valN
|
||||
[/SECTION]
|
||||
@end example
|
||||
|
||||
Metadata tags are printed as a line in the corresponding FORMAT, STREAM or
|
||||
PROGRAM_STREAM section, and are prefixed by the string "TAG:".
|
||||
Metadata tags are printed as a line in the corresponding FORMAT or
|
||||
STREAM section, and are prefixed by the string "TAG:".
|
||||
|
||||
A description of the accepted options follows.
|
||||
|
||||
@@ -564,48 +487,15 @@ DV, GXF and AVI timecodes are available in format metadata
|
||||
@end itemize
|
||||
@c man end TIMECODE
|
||||
|
||||
@include config.texi
|
||||
@ifset config-all
|
||||
@ifset config-avutil
|
||||
@include utils.texi
|
||||
@end ifset
|
||||
@ifset config-avcodec
|
||||
@include codecs.texi
|
||||
@include bitstream_filters.texi
|
||||
@end ifset
|
||||
@ifset config-avformat
|
||||
@include formats.texi
|
||||
@include protocols.texi
|
||||
@end ifset
|
||||
@ifset config-avdevice
|
||||
@include devices.texi
|
||||
@end ifset
|
||||
@ifset config-swresample
|
||||
@include resampler.texi
|
||||
@end ifset
|
||||
@ifset config-swscale
|
||||
@include scaler.texi
|
||||
@end ifset
|
||||
@ifset config-avfilter
|
||||
@include filters.texi
|
||||
@end ifset
|
||||
@end ifset
|
||||
|
||||
@chapter See Also
|
||||
|
||||
@ifhtml
|
||||
@ifset config-all
|
||||
@url{ffprobe.html,ffprobe},
|
||||
@end ifset
|
||||
@ifset config-not-all
|
||||
@url{ffprobe-all.html,ffprobe-all},
|
||||
@end ifset
|
||||
@url{ffmpeg.html,ffmpeg}, @url{ffplay.html,ffplay}, @url{ffserver.html,ffserver},
|
||||
@url{ffplay.html,ffmpeg}, @url{ffprobe.html,ffprobe}, @url{ffserver.html,ffserver},
|
||||
@url{ffmpeg-utils.html,ffmpeg-utils},
|
||||
@url{ffmpeg-scaler.html,ffmpeg-scaler},
|
||||
@url{ffmpeg-resampler.html,ffmpeg-resampler},
|
||||
@url{ffmpeg-codecs.html,ffmpeg-codecs},
|
||||
@url{ffmpeg-bitstream-filters.html,ffmpeg-bitstream-filters},
|
||||
@url{ffmpeg-bitstream-filters,ffmpeg-bitstream-filters},
|
||||
@url{ffmpeg-formats.html,ffmpeg-formats},
|
||||
@url{ffmpeg-devices.html,ffmpeg-devices},
|
||||
@url{ffmpeg-protocols.html,ffmpeg-protocols},
|
||||
@@ -613,12 +503,6 @@ DV, GXF and AVI timecodes are available in format metadata
|
||||
@end ifhtml
|
||||
|
||||
@ifnothtml
|
||||
@ifset config-all
|
||||
ffprobe(1),
|
||||
@end ifset
|
||||
@ifset config-not-all
|
||||
ffprobe-all(1),
|
||||
@end ifset
|
||||
ffmpeg(1), ffplay(1), ffserver(1),
|
||||
ffmpeg-utils(1), ffmpeg-scaler(1), ffmpeg-resampler(1),
|
||||
ffmpeg-codecs(1), ffmpeg-bitstream-filters(1), ffmpeg-formats(1),
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
<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="programs" type="ffprobe:programsType" minOccurs="0" maxOccurs="1" />
|
||||
<xsd:element name="chapters" type="ffprobe:chaptersType" 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" />
|
||||
@@ -80,6 +78,7 @@
|
||||
<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">
|
||||
@@ -88,12 +87,6 @@
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="programsType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="program" type="ffprobe:programType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="streamDispositionType">
|
||||
<xsd:attribute name="default" type="xsd:int" use="required" />
|
||||
<xsd:attribute name="dub" type="xsd:int" use="required" />
|
||||
@@ -110,8 +103,8 @@
|
||||
|
||||
<xsd:complexType name="streamType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="disposition" type="ffprobe:streamDispositionType" minOccurs="0" maxOccurs="1"/>
|
||||
<xsd:element name="tag" type="ffprobe:tagType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xsd:element name="disposition" type="ffprobe:streamDispositionType" minOccurs="0" maxOccurs="1"/>
|
||||
</xsd:sequence>
|
||||
|
||||
<xsd:attribute name="index" type="xsd:int" use="required"/>
|
||||
@@ -138,7 +131,6 @@
|
||||
<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="channel_layout" type="xsd:string"/>
|
||||
<xsd:attribute name="bits_per_sample" type="xsd:int"/>
|
||||
|
||||
<xsd:attribute name="id" type="xsd:string"/>
|
||||
@@ -155,23 +147,6 @@
|
||||
<xsd:attribute name="nb_read_packets" type="xsd:int"/>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="programType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="tag" type="ffprobe:tagType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xsd:element name="streams" type="ffprobe:streamsType" minOccurs="0" maxOccurs="1"/>
|
||||
</xsd:sequence>
|
||||
|
||||
<xsd:attribute name="program_id" type="xsd:int" use="required"/>
|
||||
<xsd:attribute name="program_num" type="xsd:int" use="required"/>
|
||||
<xsd:attribute name="nb_streams" type="xsd:int" use="required"/>
|
||||
<xsd:attribute name="start_time" type="xsd:float"/>
|
||||
<xsd:attribute name="start_pts" type="xsd:long"/>
|
||||
<xsd:attribute name="end_time" type="xsd:float"/>
|
||||
<xsd:attribute name="end_pts" type="xsd:long"/>
|
||||
<xsd:attribute name="pmt_pid" type="xsd:int" use="required"/>
|
||||
<xsd:attribute name="pcr_pid" type="xsd:int" use="required"/>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="formatType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="tag" type="ffprobe:tagType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
@@ -179,14 +154,12 @@
|
||||
|
||||
<xsd:attribute name="filename" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="nb_streams" type="xsd:int" use="required"/>
|
||||
<xsd:attribute name="nb_programs" type="xsd:int" use="required"/>
|
||||
<xsd:attribute name="format_name" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="format_long_name" type="xsd:string"/>
|
||||
<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:attribute name="probe_score" type="xsd:int"/>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="tagType">
|
||||
@@ -209,25 +182,6 @@
|
||||
<xsd:attribute name="configuration" type="xsd:string" use="required"/>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="chaptersType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="chapter" type="ffprobe:chapterType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="chapterType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="tag" type="ffprobe:tagType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xsd:sequence>
|
||||
|
||||
<xsd:attribute name="id" type="xsd:int" use="required"/>
|
||||
<xsd:attribute name="time_base" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="start" type="xsd:int" use="required"/>
|
||||
<xsd:attribute name="start_time" type="xsd:float"/>
|
||||
<xsd:attribute name="end" type="xsd:int" use="required"/>
|
||||
<xsd:attribute name="end_time" type="xsd:float" 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"/>
|
||||
|
||||
@@ -16,28 +16,34 @@ ffserver [@var{options}]
|
||||
@chapter Description
|
||||
@c man begin DESCRIPTION
|
||||
|
||||
@command{ffserver} is a streaming server for both audio and video. It
|
||||
supports 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 specify a big enough feed storage in
|
||||
@file{ffserver.conf}).
|
||||
ffserver is a streaming server for both audio and video. It supports
|
||||
|
||||
@command{ffserver} receives prerecorded files or FFM streams from some
|
||||
@command{ffmpeg} instance as input, then streams them over
|
||||
RTP/RTSP/HTTP.
|
||||
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
|
||||
specify a big enough feed storage in ffserver.conf).
|
||||
|
||||
An @command{ffserver} instance will listen on some port as specified
|
||||
in the configuration file. You can launch one or more instances of
|
||||
@command{ffmpeg} and send one or more FFM streams to the port where
|
||||
ffserver is expecting to receive them. Alternately, you can make
|
||||
@command{ffserver} launch such @command{ffmpeg} instances at startup.
|
||||
This documentation covers only the streaming aspects of ffserver /
|
||||
ffmpeg. All questions about parameters for ffmpeg, codec questions,
|
||||
etc. are not covered here. Read @file{ffmpeg.html} for more
|
||||
information.
|
||||
|
||||
Input streams are called feeds, and each one is specified by a
|
||||
@code{<Feed>} section in the configuration file.
|
||||
@section How does it work?
|
||||
|
||||
ffserver receives prerecorded files or FFM streams from some ffmpeg
|
||||
instance as input, then streams them over RTP/RTSP/HTTP.
|
||||
|
||||
An ffserver instance will listen on some port as specified in the
|
||||
configuration file. You can launch one or more instances of ffmpeg and
|
||||
send one or more FFM streams to the port where ffserver is expecting
|
||||
to receive them. Alternately, you can make ffserver launch such ffmpeg
|
||||
instances at startup.
|
||||
|
||||
Input streams are called feeds, and each one is specified by a <Feed>
|
||||
section in the configuration file.
|
||||
|
||||
For each feed you can have different output streams in various
|
||||
formats, each one specified by a @code{<Stream>} section in the
|
||||
configuration file.
|
||||
formats, each one specified by a <Stream> section in the configuration
|
||||
file.
|
||||
|
||||
@section Status stream
|
||||
|
||||
@@ -73,6 +79,14 @@ web server can be used to serve up the files just as well.
|
||||
It can stream prerecorded video from .ffm files, though it is somewhat tricky
|
||||
to make it work correctly.
|
||||
|
||||
@section What do I need?
|
||||
|
||||
I use Linux on a 900 MHz Duron with a cheap Bt848 based TV capture card. I'm
|
||||
using stock Linux 2.4.17 with the stock drivers. [Actually that isn't true,
|
||||
I needed some special drivers for my motherboard-based sound card.]
|
||||
|
||||
I understand that FreeBSD systems work just fine as well.
|
||||
|
||||
@section How do I make it work?
|
||||
|
||||
First, build the kit. It *really* helps to have installed LAME first. Then when
|
||||
@@ -221,7 +235,7 @@ of an infinite movie or a whole movie.
|
||||
|
||||
FFM is version specific, and there is limited compatibility of FFM files
|
||||
generated by one version of ffmpeg/ffserver and another version of
|
||||
ffmpeg/ffserver. It may work but it is not guaranteed to work.
|
||||
ffmpeg/ffserver. It may work but its not guaranteed to work.
|
||||
|
||||
FFM2 is extensible while maintaining compatibility and should work between
|
||||
differing versions of tools. FFM2 is the default.
|
||||
@@ -229,7 +243,7 @@ differing versions of tools. FFM2 is the default.
|
||||
@chapter Options
|
||||
@c man begin OPTIONS
|
||||
|
||||
@include fftools-common-opts.texi
|
||||
@include avtools-common-opts.texi
|
||||
|
||||
@section Main options
|
||||
|
||||
@@ -246,49 +260,16 @@ messages to stdout.
|
||||
@end table
|
||||
@c man end
|
||||
|
||||
@include config.texi
|
||||
@ifset config-all
|
||||
@ifset config-avutil
|
||||
@include utils.texi
|
||||
@end ifset
|
||||
@ifset config-avcodec
|
||||
@include codecs.texi
|
||||
@include bitstream_filters.texi
|
||||
@end ifset
|
||||
@ifset config-avformat
|
||||
@include formats.texi
|
||||
@include protocols.texi
|
||||
@end ifset
|
||||
@ifset config-avdevice
|
||||
@include devices.texi
|
||||
@end ifset
|
||||
@ifset config-swresample
|
||||
@include resampler.texi
|
||||
@end ifset
|
||||
@ifset config-swscale
|
||||
@include scaler.texi
|
||||
@end ifset
|
||||
@ifset config-avfilter
|
||||
@include filters.texi
|
||||
@end ifset
|
||||
@end ifset
|
||||
|
||||
@chapter See Also
|
||||
|
||||
@ifhtml
|
||||
@ifset config-all
|
||||
@url{ffserver.html,ffserver},
|
||||
@end ifset
|
||||
@ifset config-not-all
|
||||
@url{ffserver-all.html,ffserver-all},
|
||||
@end ifset
|
||||
the @file{doc/ffserver.conf} example,
|
||||
The @file{doc/ffserver.conf} example,
|
||||
@url{ffmpeg.html,ffmpeg}, @url{ffplay.html,ffplay}, @url{ffprobe.html,ffprobe},
|
||||
@url{ffmpeg-utils.html,ffmpeg-utils},
|
||||
@url{ffmpeg-scaler.html,ffmpeg-scaler},
|
||||
@url{ffmpeg-resampler.html,ffmpeg-resampler},
|
||||
@url{ffmpeg-codecs.html,ffmpeg-codecs},
|
||||
@url{ffmpeg-bitstream-filters.html,ffmpeg-bitstream-filters},
|
||||
@url{ffmpeg-bitstream-filters,ffmpeg-bitstream-filters},
|
||||
@url{ffmpeg-formats.html,ffmpeg-formats},
|
||||
@url{ffmpeg-devices.html,ffmpeg-devices},
|
||||
@url{ffmpeg-protocols.html,ffmpeg-protocols},
|
||||
@@ -296,13 +277,7 @@ the @file{doc/ffserver.conf} example,
|
||||
@end ifhtml
|
||||
|
||||
@ifnothtml
|
||||
@ifset config-all
|
||||
ffserver(1),
|
||||
@end ifset
|
||||
@ifset config-not-all
|
||||
ffserver-all(1),
|
||||
@end ifset
|
||||
the @file{doc/ffserver.conf} example, ffmpeg(1), ffplay(1), ffprobe(1),
|
||||
The @file{doc/ffserver.conf} example, ffmpeg(1), ffplay(1), ffprobe(1),
|
||||
ffmpeg-utils(1), ffmpeg-scaler(1), ffmpeg-resampler(1),
|
||||
ffmpeg-codecs(1), ffmpeg-bitstream-filters(1), ffmpeg-formats(1),
|
||||
ffmpeg-devices(1), ffmpeg-protocols(1), ffmpeg-filters(1)
|
||||
|
||||
@@ -15,13 +15,13 @@ Format negotiation
|
||||
the list of supported formats.
|
||||
|
||||
For video links, that means pixel format. For audio links, that means
|
||||
channel layout, sample format (the sample packing is implied by the sample
|
||||
format) and sample rate.
|
||||
channel layout, and sample format (the sample packing is implied by the
|
||||
sample format).
|
||||
|
||||
The lists are not just lists, they are references to shared objects. When
|
||||
the negotiation mechanism computes the intersection of the formats
|
||||
supported at each end of a link, all references to both lists are replaced
|
||||
with a reference to the intersection. And when a single format is
|
||||
supported at each ends of a link, all references to both lists are
|
||||
replaced with a reference to the intersection. And when a single format is
|
||||
eventually chosen for a link amongst the remaining list, again, all
|
||||
references to the list are updated.
|
||||
|
||||
@@ -29,11 +29,6 @@ Format negotiation
|
||||
same format amongst a supported list, all it has to do is use a reference
|
||||
to the same list of formats.
|
||||
|
||||
query_formats can leave some formats unset and return AVERROR(EAGAIN) to
|
||||
cause the negotiation mechanism to try again later. That can be used by
|
||||
filters with complex requirements to use the format negotiated on one link
|
||||
to set the formats supported on another.
|
||||
|
||||
|
||||
Buffer references ownership and permissions
|
||||
===========================================
|
||||
@@ -73,15 +68,15 @@ Buffer references ownership and permissions
|
||||
|
||||
Here are the (fairly obvious) rules for reference ownership:
|
||||
|
||||
* A reference received by the filter_frame method (or its start_frame
|
||||
deprecated version) belongs to the corresponding filter.
|
||||
* A reference received by the start_frame or filter_frame method
|
||||
belong to the corresponding filter.
|
||||
|
||||
Special exception: for video references: the reference may be used
|
||||
internally for automatic copying and must not be destroyed before
|
||||
end_frame; it can be given away to ff_start_frame.
|
||||
|
||||
* A reference passed to ff_filter_frame (or the deprecated
|
||||
ff_start_frame) is given away and must no longer be used.
|
||||
* A reference passed to ff_start_frame or ff_filter_frame is given
|
||||
away and must no longer be used.
|
||||
|
||||
* A reference created with avfilter_ref_buffer belongs to the code that
|
||||
created it.
|
||||
@@ -95,11 +90,27 @@ Buffer references ownership and permissions
|
||||
Link reference fields
|
||||
---------------------
|
||||
|
||||
The AVFilterLink structure has a few AVFilterBufferRef fields. The
|
||||
cur_buf and out_buf were used with the deprecated
|
||||
start_frame/draw_slice/end_frame API and should no longer be used.
|
||||
src_buf, cur_buf_copy and partial_buf are used by libavfilter internally
|
||||
and must not be accessed by filters.
|
||||
The AVFilterLink structure has a few AVFilterBufferRef fields. Here are
|
||||
the rules to handle them:
|
||||
|
||||
* cur_buf is set before the start_frame and filter_frame methods to
|
||||
the same reference given as argument to the methods and belongs to the
|
||||
destination filter of the link. If it has not been cleared after
|
||||
end_frame or filter_frame, libavfilter will automatically destroy
|
||||
the reference; therefore, any filter that needs to keep the reference
|
||||
for longer must set cur_buf to NULL.
|
||||
|
||||
* out_buf belongs to the source filter of the link and can be used to
|
||||
store a reference to the buffer that has been sent to the destination.
|
||||
If it is not NULL after end_frame or filter_frame, libavfilter will
|
||||
automatically destroy the reference.
|
||||
|
||||
If a video input pad does not have a start_frame method, the default
|
||||
method will request a buffer on the first output of the filter, store
|
||||
the reference in out_buf and push a second reference to the output.
|
||||
|
||||
* src_buf, cur_buf_copy and partial_buf are used by libavfilter
|
||||
internally and must not be accessed by filters.
|
||||
|
||||
Reference permissions
|
||||
---------------------
|
||||
@@ -108,10 +119,8 @@ Buffer references ownership and permissions
|
||||
the code that owns the reference is allowed to do to the buffer data.
|
||||
Different references for the same buffer can have different permissions.
|
||||
|
||||
For video filters that implement the deprecated
|
||||
start_frame/draw_slice/end_frame API, the permissions only apply to the
|
||||
parts of the buffer that have already been covered by the draw_slice
|
||||
method.
|
||||
For video filters, the permissions only apply to the parts of the buffer
|
||||
that have already been covered by the draw_slice method.
|
||||
|
||||
The value is a binary OR of the following constants:
|
||||
|
||||
@@ -166,13 +175,13 @@ Buffer references ownership and permissions
|
||||
WRITE permission.
|
||||
|
||||
* Filters that read their input to produce a new frame on output (like
|
||||
scale) need the READ permission on input and must request a buffer
|
||||
scale) need the READ permission on input and and must request a buffer
|
||||
with the WRITE permission.
|
||||
|
||||
* Filters that intend to keep a reference after the filtering process
|
||||
is finished (after filter_frame returns) must have the PRESERVE
|
||||
permission on it and remove the WRITE permission if they create a new
|
||||
reference to give it away.
|
||||
is finished (after end_frame or filter_frame returns) must have the
|
||||
PRESERVE permission on it and remove the WRITE permission if they
|
||||
create a new reference to give it away.
|
||||
|
||||
* Filters that intend to modify a reference they have kept after the end
|
||||
of the filtering process need the REUSE2 permission and must remove
|
||||
@@ -189,11 +198,11 @@ Frame scheduling
|
||||
Simple filters that output one frame for each input frame should not have
|
||||
to worry about it.
|
||||
|
||||
filter_frame
|
||||
------------
|
||||
start_frame / filter_frame
|
||||
----------------------------
|
||||
|
||||
This method is called when a frame is pushed to the filter's input. It
|
||||
can be called at any time except in a reentrant way.
|
||||
These methods are called when a frame is pushed to the filter's input.
|
||||
They can be called at any time except in a reentrant way.
|
||||
|
||||
If the input frame is enough to produce output, then the filter should
|
||||
push the output frames on the output link immediately.
|
||||
@@ -204,7 +213,7 @@ Frame scheduling
|
||||
filter; these buffered frames must be flushed immediately if a new input
|
||||
produces new output.
|
||||
|
||||
(Example: frame rate-doubling filter: filter_frame must (1) flush the
|
||||
(Example: framerate-doubling filter: start_frame must (1) flush the
|
||||
second copy of the previous frame, if it is still there, (2) push the
|
||||
first copy of the incoming frame, (3) keep the second copy for later.)
|
||||
|
||||
@@ -224,8 +233,8 @@ Frame scheduling
|
||||
|
||||
This method is called when a frame is wanted on an output.
|
||||
|
||||
For an input, it should directly call filter_frame on the corresponding
|
||||
output.
|
||||
For an input, it should directly call start_frame or filter_frame on
|
||||
the corresponding output.
|
||||
|
||||
For a filter, if there are queued frames already ready, one of these
|
||||
frames should be pushed. If not, the filter should request a frame on
|
||||
@@ -246,7 +255,7 @@ Frame scheduling
|
||||
}
|
||||
while (!frame_pushed) {
|
||||
input = input_where_a_frame_is_most_needed();
|
||||
ret = ff_request_frame(input);
|
||||
ret = avfilter_request_frame(input);
|
||||
if (ret == AVERROR_EOF) {
|
||||
process_eof_on_input();
|
||||
} else if (ret < 0) {
|
||||
@@ -257,14 +266,4 @@ Frame scheduling
|
||||
|
||||
Note that, except for filters that can have queued frames, request_frame
|
||||
does not push frames: it requests them to its input, and as a reaction,
|
||||
the filter_frame method will be called and do the work.
|
||||
|
||||
Legacy API
|
||||
==========
|
||||
|
||||
Until libavfilter 3.23, the filter_frame method was split:
|
||||
|
||||
- for video filters, it was made of start_frame, draw_slice (that could be
|
||||
called several times on distinct parts of the frame) and end_frame;
|
||||
|
||||
- for audio filters, it was called filter_samples.
|
||||
the start_frame / filter_frame method will be called and do the work.
|
||||
|
||||
6571
doc/filters.texi
6571
doc/filters.texi
File diff suppressed because it is too large
Load Diff
188
doc/formats.texi
188
doc/formats.texi
@@ -1,188 +0,0 @@
|
||||
@chapter Format Options
|
||||
@c man begin FORMAT OPTIONS
|
||||
|
||||
The libavformat library provides some generic global options, which
|
||||
can be set on all the muxers and demuxers. In addition each muxer or
|
||||
demuxer may support so-called private options, which are specific for
|
||||
that component.
|
||||
|
||||
Options may be set by specifying -@var{option} @var{value} in the
|
||||
FFmpeg tools, or by setting the value explicitly in the
|
||||
@code{AVFormatContext} options or using the @file{libavutil/opt.h} API
|
||||
for programmatic use.
|
||||
|
||||
The list of supported options follows:
|
||||
|
||||
@table @option
|
||||
@item avioflags @var{flags} (@emph{input/output})
|
||||
Possible values:
|
||||
@table @samp
|
||||
@item direct
|
||||
Reduce buffering.
|
||||
@end table
|
||||
|
||||
@item probesize @var{integer} (@emph{input})
|
||||
Set probing size in bytes, i.e. the size of the data to analyze to get
|
||||
stream information. A higher value will allow to detect more
|
||||
information in case it is dispersed into the stream, but will increase
|
||||
latency. Must be an integer not lesser than 32. It is 5000000 by default.
|
||||
|
||||
@item packetsize @var{integer} (@emph{output})
|
||||
Set packet size.
|
||||
|
||||
@item fflags @var{flags} (@emph{input/output})
|
||||
Set format flags.
|
||||
|
||||
Possible values:
|
||||
@table @samp
|
||||
@item ignidx
|
||||
Ignore index.
|
||||
@item genpts
|
||||
Generate PTS.
|
||||
@item nofillin
|
||||
Do not fill in missing values that can be exactly calculated.
|
||||
@item noparse
|
||||
Disable AVParsers, this needs @code{+nofillin} too.
|
||||
@item igndts
|
||||
Ignore DTS.
|
||||
@item discardcorrupt
|
||||
Discard corrupted frames.
|
||||
@item sortdts
|
||||
Try to interleave output packets by DTS.
|
||||
@item keepside
|
||||
Do not merge side data.
|
||||
@item latm
|
||||
Enable RTP MP4A-LATM payload.
|
||||
@item nobuffer
|
||||
Reduce the latency introduced by optional buffering
|
||||
@end table
|
||||
|
||||
@item seek2any @var{integer} (@emph{input})
|
||||
Allow seeking to non-keyframes on demuxer level when supported if set to 1.
|
||||
Default is 0.
|
||||
|
||||
@item analyzeduration @var{integer} (@emph{input})
|
||||
Specify how many microseconds are analyzed to probe the input. A
|
||||
higher value will allow to detect more accurate information, but will
|
||||
increase latency. It defaults to 5,000,000 microseconds = 5 seconds.
|
||||
|
||||
@item cryptokey @var{hexadecimal string} (@emph{input})
|
||||
Set decryption key.
|
||||
|
||||
@item indexmem @var{integer} (@emph{input})
|
||||
Set max memory used for timestamp index (per stream).
|
||||
|
||||
@item rtbufsize @var{integer} (@emph{input})
|
||||
Set max memory used for buffering real-time frames.
|
||||
|
||||
@item fdebug @var{flags} (@emph{input/output})
|
||||
Print specific debug info.
|
||||
|
||||
Possible values:
|
||||
@table @samp
|
||||
@item ts
|
||||
@end table
|
||||
|
||||
@item max_delay @var{integer} (@emph{input/output})
|
||||
Set maximum muxing or demuxing delay in microseconds.
|
||||
|
||||
@item fpsprobesize @var{integer} (@emph{input})
|
||||
Set number of frames used to probe fps.
|
||||
|
||||
@item audio_preload @var{integer} (@emph{output})
|
||||
Set microseconds by which audio packets should be interleaved earlier.
|
||||
|
||||
@item chunk_duration @var{integer} (@emph{output})
|
||||
Set microseconds for each chunk.
|
||||
|
||||
@item chunk_size @var{integer} (@emph{output})
|
||||
Set size in bytes for each chunk.
|
||||
|
||||
@item err_detect, f_err_detect @var{flags} (@emph{input})
|
||||
Set error detection flags. @code{f_err_detect} is deprecated and
|
||||
should be used only via the @command{ffmpeg} tool.
|
||||
|
||||
Possible values:
|
||||
@table @samp
|
||||
@item crccheck
|
||||
Verify embedded CRCs.
|
||||
@item bitstream
|
||||
Detect bitstream specification deviations.
|
||||
@item buffer
|
||||
Detect improper bitstream length.
|
||||
@item explode
|
||||
Abort decoding on minor error detection.
|
||||
@item careful
|
||||
Consider things that violate the spec and have not been seen in the
|
||||
wild as errors.
|
||||
@item compliant
|
||||
Consider all spec non compliancies as errors.
|
||||
@item aggressive
|
||||
Consider things that a sane encoder should not do as an error.
|
||||
@end table
|
||||
|
||||
@item use_wallclock_as_timestamps @var{integer} (@emph{input})
|
||||
Use wallclock as timestamps.
|
||||
|
||||
@item avoid_negative_ts @var{integer} (@emph{output})
|
||||
Shift timestamps to make them non-negative. A value of 1 enables shifting,
|
||||
a value of 0 disables it, the default value of -1 enables shifting
|
||||
when required by the target format.
|
||||
|
||||
When shifting is enabled, all output timestamps are shifted by the
|
||||
same amount. Audio, video, and subtitles desynching and relative
|
||||
timestamp differences are preserved compared to how they would have
|
||||
been without shifting.
|
||||
|
||||
Also note that this affects only leading negative timestamps, and not
|
||||
non-monotonic negative timestamps.
|
||||
|
||||
@item skip_initial_bytes @var{integer} (@emph{input})
|
||||
Set number of bytes to skip before reading header and frames if set to 1.
|
||||
Default is 0.
|
||||
|
||||
@item correct_ts_overflow @var{integer} (@emph{input})
|
||||
Correct single timestamp overflows if set to 1. Default is 1.
|
||||
|
||||
@item flush_packets @var{integer} (@emph{output})
|
||||
Flush the underlying I/O stream after each packet. Default 1 enables it, and
|
||||
has the effect of reducing the latency; 0 disables it and may slightly
|
||||
increase performance in some cases.
|
||||
@end table
|
||||
|
||||
@c man end FORMAT OPTIONS
|
||||
|
||||
@anchor{Format stream specifiers}
|
||||
@section Format stream specifiers
|
||||
|
||||
Format stream specifiers allow selection of one or more streams that
|
||||
match specific properties.
|
||||
|
||||
Possible forms of stream specifiers are:
|
||||
@table @option
|
||||
@item @var{stream_index}
|
||||
Matches the stream with this index.
|
||||
|
||||
@item @var{stream_type}[:@var{stream_index}]
|
||||
@var{stream_type} is one of following: 'v' for video, 'a' for audio,
|
||||
's' for subtitle, 'd' for data, and 't' for attachments. If
|
||||
@var{stream_index} is given, then it matches the stream number
|
||||
@var{stream_index} of this type. Otherwise, it matches all streams of
|
||||
this type.
|
||||
|
||||
@item p:@var{program_id}[:@var{stream_index}]
|
||||
If @var{stream_index} is given, then it matches the stream with number
|
||||
@var{stream_index} in the program with the id
|
||||
@var{program_id}. Otherwise, it matches all streams in the program.
|
||||
|
||||
@item #@var{stream_id}
|
||||
Matches the stream by a format-specific ID.
|
||||
@end table
|
||||
|
||||
The exact semantics of stream specifiers is defined by the
|
||||
@code{avformat_match_stream_specifier()} function declared in the
|
||||
@file{libavformat/avformat.h} header.
|
||||
|
||||
@include demuxers.texi
|
||||
@include muxers.texi
|
||||
@include metadata.texi
|
||||
@@ -94,20 +94,12 @@ Then pass @code{--enable-libtwolame} to configure to enable it.
|
||||
|
||||
@section libvpx
|
||||
|
||||
FFmpeg can make use of the libvpx library for VP8/VP9 encoding.
|
||||
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 libwavpack
|
||||
|
||||
FFmpeg can make use of the libwavpack library for WavPack encoding.
|
||||
|
||||
Go to @url{http://www.wavpack.com/} and follow the instructions for
|
||||
installing the library. Then pass @code{--enable-libwavpack} to configure to
|
||||
enable it.
|
||||
|
||||
@section x264
|
||||
|
||||
FFmpeg can make use of the x264 library for H.264 encoding.
|
||||
@@ -133,20 +125,6 @@ Go to @url{https://github.com/dekkers/libilbc} and follow the instructions for
|
||||
installing the library. Then pass @code{--enable-libilbc} to configure to
|
||||
enable it.
|
||||
|
||||
@section libzvbi
|
||||
|
||||
libzvbi is a VBI decoding library which can be used by FFmpeg to decode DVB
|
||||
teletext pages and DVB teletext subtitles.
|
||||
|
||||
Go to @url{http://sourceforge.net/projects/zapping/} and follow the instructions for
|
||||
installing the library. Then pass @code{--enable-libzvbi} to configure to
|
||||
enable it.
|
||||
|
||||
@float NOTE
|
||||
libzvbi is licensed under the GNU General 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, Codecs or Features
|
||||
@@ -174,15 +152,13 @@ library:
|
||||
@tab Multimedia format used in game Heart Of Darkness.
|
||||
@item Apple HTTP Live Streaming @tab @tab X
|
||||
@item Artworx Data Format @tab @tab X
|
||||
@item ADP @tab @tab X
|
||||
@tab Audio format used on the Nintendo Gamecube.
|
||||
@item AFC @tab @tab X
|
||||
@tab Audio format used on the Nintendo Gamecube.
|
||||
@item ASF @tab X @tab X
|
||||
@item AST @tab X @tab X
|
||||
@tab Audio format used on the Nintendo Wii.
|
||||
@item AVI @tab X @tab X
|
||||
@item AviSynth @tab @tab X
|
||||
@item AVISynth @tab @tab X
|
||||
@item AVR @tab @tab X
|
||||
@tab Audio format used on Mac.
|
||||
@item AVS @tab @tab X
|
||||
@@ -351,7 +327,7 @@ library:
|
||||
@item raw Shorten @tab @tab X
|
||||
@item raw TAK @tab @tab X
|
||||
@item raw TrueHD @tab X @tab X
|
||||
@item raw VC-1 @tab X @tab X
|
||||
@item raw VC-1 @tab @tab X
|
||||
@item raw PCM A-law @tab X @tab X
|
||||
@item raw PCM mu-law @tab X @tab X
|
||||
@item raw PCM signed 8 bit @tab X @tab X
|
||||
@@ -377,13 +353,11 @@ library:
|
||||
@tab File format used by RED Digital cameras, contains JPEG 2000 frames and PCM audio.
|
||||
@item RealMedia @tab X @tab X
|
||||
@item Redirector @tab @tab X
|
||||
@item RedSpark @tab @tab X
|
||||
@item Renderware TeXture Dictionary @tab @tab X
|
||||
@item RL2 @tab @tab X
|
||||
@tab Audio and video format used in some games by Entertainment Software Partners.
|
||||
@item RPL/ARMovie @tab @tab X
|
||||
@item Lego Mindstorms RSO @tab X @tab X
|
||||
@item RSD @tab @tab X
|
||||
@item RTMP @tab X @tab X
|
||||
@tab Output is performed by publishing stream to RTMP server
|
||||
@item RTP @tab X @tab X
|
||||
@@ -449,6 +423,7 @@ following image formats are supported:
|
||||
@item .Y.U.V @tab X @tab X
|
||||
@tab one raw file per component
|
||||
@item animated GIF @tab X @tab X
|
||||
@tab Only uncompressed GIFs are generated.
|
||||
@item BMP @tab X @tab X
|
||||
@tab Microsoft BMP image
|
||||
@item PIX @tab @tab X
|
||||
@@ -488,8 +463,6 @@ following image formats are supported:
|
||||
@tab YUV, JPEG and some extension is not supported yet.
|
||||
@item Truevision Targa @tab X @tab X
|
||||
@tab Targa (.TGA) image format
|
||||
@item WebP @tab @tab X
|
||||
@tab WebP image format
|
||||
@item XBM @tab X @tab X
|
||||
@tab X BitMap image format
|
||||
@item XFace @tab X @tab X
|
||||
@@ -517,7 +490,6 @@ following image formats are supported:
|
||||
@item AMV Video @tab X @tab X
|
||||
@tab Used in Chinese MP3 players.
|
||||
@item ANSI/ASCII art @tab @tab X
|
||||
@item Apple Intermediate Codec @tab @tab X
|
||||
@item Apple MJPEG-B @tab @tab X
|
||||
@item Apple ProRes @tab X @tab X
|
||||
@item Apple QuickDraw @tab @tab X
|
||||
@@ -600,13 +572,12 @@ following image formats are supported:
|
||||
@tab Sorenson H.263 used in Flash
|
||||
@item Forward Uncompressed @tab @tab X
|
||||
@item Fraps @tab @tab X
|
||||
@item Go2Webinar @tab @tab X
|
||||
@tab fourcc: G2M4
|
||||
@item H.261 @tab X @tab X
|
||||
@item H.263 / H.263-1996 @tab X @tab X
|
||||
@item H.263+ / H.263-1998 / H.263 version 2 @tab X @tab X
|
||||
@item H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 @tab E @tab X
|
||||
@tab encoding supported through external library libx264
|
||||
@item H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (VDPAU acceleration) @tab E @tab X
|
||||
@item HuffYUV @tab X @tab X
|
||||
@item HuffYUV FFmpeg variant @tab X @tab X
|
||||
@item IBM Ultimotion @tab @tab X
|
||||
@@ -659,6 +630,7 @@ following image formats are supported:
|
||||
@item Motion Pixels video @tab @tab X
|
||||
@item MPEG-1 video @tab X @tab X
|
||||
@item MPEG-1/2 video XvMC (X-Video Motion Compensation) @tab @tab X
|
||||
@item MPEG-1/2 video (VDPAU acceleration) @tab @tab X
|
||||
@item MPEG-2 video @tab X @tab X
|
||||
@item MPEG-4 part 2 @tab X @tab X
|
||||
@tab libxvidcore can be used alternatively for encoding.
|
||||
@@ -676,8 +648,6 @@ following image formats are supported:
|
||||
@tab fourcc: VP60,VP61,VP62
|
||||
@item VP8 @tab E @tab X
|
||||
@tab fourcc: VP80, encoding supported through external library libvpx
|
||||
@item VP9 @tab E @tab X
|
||||
@tab encoding supported through external library libvpx
|
||||
@item Pinnacle TARGA CineWave YUV16 @tab @tab X
|
||||
@tab fourcc: Y216
|
||||
@item Prores @tab @tab X
|
||||
@@ -804,11 +774,9 @@ following image formats are supported:
|
||||
@tab Used in some Sega Saturn console games.
|
||||
@item ADPCM IMA Duck DK4 @tab @tab X
|
||||
@tab Used in some Sega Saturn console games.
|
||||
@item ADPCM IMA Radical @tab @tab X
|
||||
@item ADPCM Microsoft @tab X @tab X
|
||||
@item ADPCM MS IMA @tab X @tab X
|
||||
@item ADPCM Nintendo Gamecube AFC @tab @tab X
|
||||
@item ADPCM Nintendo Gamecube DTK @tab @tab X
|
||||
@item ADPCM Nintendo Gamecube THP @tab @tab X
|
||||
@item ADPCM QT IMA @tab X @tab X
|
||||
@item ADPCM SEGA CRI ADX @tab X @tab X
|
||||
@@ -827,8 +795,8 @@ following image formats are supported:
|
||||
@item Amazing Studio PAF Audio @tab @tab X
|
||||
@item Apple lossless audio @tab X @tab X
|
||||
@tab QuickTime fourcc 'alac'
|
||||
@item ATRAC1 @tab @tab X
|
||||
@item ATRAC3 @tab @tab X
|
||||
@item Atrac 1 @tab @tab X
|
||||
@item Atrac 3 @tab @tab X
|
||||
@item Bink Audio @tab @tab X
|
||||
@tab Used in Bink and Smacker files in many games.
|
||||
@item CELT @tab @tab E
|
||||
@@ -851,7 +819,6 @@ following image formats are supported:
|
||||
@item DSP Group TrueSpeech @tab @tab X
|
||||
@item DV audio @tab @tab X
|
||||
@item Enhanced AC-3 @tab X @tab X
|
||||
@item EVRC (Enhanced Variable Rate Codec) @tab @tab X
|
||||
@item FLAC (Free Lossless Audio Codec) @tab X @tab IX
|
||||
@item G.723.1 @tab X @tab X
|
||||
@item G.729 @tab @tab X
|
||||
@@ -868,6 +835,7 @@ following image formats are supported:
|
||||
@item MLP (Meridian Lossless Packing) @tab @tab X
|
||||
@tab Used in DVD-Audio discs.
|
||||
@item Monkey's Audio @tab @tab X
|
||||
@tab Only versions 3.97-3.99 are supported.
|
||||
@item MP1 (MPEG audio layer 1) @tab @tab IX
|
||||
@item MP2 (MPEG audio layer 2) @tab IX @tab IX
|
||||
@tab libtwolame can be used alternatively for encoding.
|
||||
@@ -922,7 +890,7 @@ following image formats are supported:
|
||||
@item Sierra VMD audio @tab @tab X
|
||||
@tab Used in Sierra VMD files.
|
||||
@item Smacker audio @tab @tab X
|
||||
@item SMPTE 302M AES3 audio @tab X @tab X
|
||||
@item SMPTE 302M AES3 audio @tab @tab X
|
||||
@item Sonic @tab X @tab X
|
||||
@tab experimental codec
|
||||
@item Sonic lossless @tab X @tab X
|
||||
@@ -930,7 +898,7 @@ following image formats are supported:
|
||||
@item Speex @tab E @tab E
|
||||
@tab supported through external library libspeex
|
||||
@item TAK (Tom's lossless Audio Kompressor) @tab @tab X
|
||||
@item True Audio (TTA) @tab X @tab X
|
||||
@item True Audio (TTA) @tab @tab X
|
||||
@item TrueHD @tab @tab X
|
||||
@tab Used in HD-DVD and Blu-Ray discs.
|
||||
@item TwinVQ (VQF flavor) @tab @tab X
|
||||
@@ -938,9 +906,7 @@ following image formats are supported:
|
||||
@tab Used in LucasArts SMUSH animations.
|
||||
@item Vorbis @tab E @tab X
|
||||
@tab A native but very primitive encoder exists.
|
||||
@item Voxware MetaSound @tab @tab X
|
||||
@tab imperfect and incomplete support
|
||||
@item WavPack @tab X @tab X
|
||||
@item WavPack @tab @tab X
|
||||
@item Westwood Audio (SND1) @tab @tab X
|
||||
@item Windows Media Audio 1 @tab X @tab X
|
||||
@item Windows Media Audio 2 @tab X @tab X
|
||||
@@ -963,7 +929,6 @@ performance on systems without hardware floating point support).
|
||||
@item 3GPP Timed Text @tab @tab @tab X @tab X
|
||||
@item AQTitle @tab @tab X @tab @tab X
|
||||
@item DVB @tab X @tab X @tab X @tab X
|
||||
@item DVB teletext @tab @tab X @tab @tab E
|
||||
@item DVD @tab X @tab X @tab X @tab X
|
||||
@item JACOsub @tab X @tab X @tab @tab X
|
||||
@item MicroDVD @tab X @tab X @tab @tab X
|
||||
@@ -980,14 +945,12 @@ performance on systems without hardware floating point support).
|
||||
@item TED Talks captions @tab @tab X @tab @tab X
|
||||
@item VobSub (IDX+SUB) @tab @tab X @tab @tab X
|
||||
@item VPlayer @tab @tab X @tab @tab X
|
||||
@item WebVTT @tab X @tab X @tab @tab X
|
||||
@item WebVTT @tab @tab X @tab @tab X
|
||||
@item XSUB @tab @tab @tab X @tab X
|
||||
@end multitable
|
||||
|
||||
@code{X} means that the feature is supported.
|
||||
|
||||
@code{E} means that support is provided through an external library.
|
||||
|
||||
@section Network Protocols
|
||||
|
||||
@multitable @columnfractions .4 .1
|
||||
@@ -1035,7 +998,7 @@ performance on systems without hardware floating point support).
|
||||
@item OSS @tab X @tab X
|
||||
@item Pulseaudio @tab X @tab
|
||||
@item SDL @tab @tab X
|
||||
@item Video4Linux2 @tab X @tab X
|
||||
@item Video4Linux2 @tab X @tab
|
||||
@item VfW capture @tab X @tab
|
||||
@item X11 grabbing @tab X @tab
|
||||
@end multitable
|
||||
|
||||
224
doc/indevs.texi
224
doc/indevs.texi
@@ -86,7 +86,7 @@ fail to open.
|
||||
Set the video size in the captured video.
|
||||
|
||||
@item framerate
|
||||
Set the frame rate in the captured video.
|
||||
Set the framerate in the captured video.
|
||||
|
||||
@item sample_rate
|
||||
Set the sample rate (in Hz) of the captured audio.
|
||||
@@ -485,52 +485,87 @@ For more information about OSS see:
|
||||
|
||||
@section pulse
|
||||
|
||||
PulseAudio input device.
|
||||
pulseaudio input device.
|
||||
|
||||
To enable this output device you need to configure FFmpeg with @code{--enable-libpulse}.
|
||||
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 PulseAudio source devices and their properties you can invoke
|
||||
To list the pulse source devices and their properties you can invoke
|
||||
the command @command{pactl list sources}.
|
||||
|
||||
More information about PulseAudio can be found on @url{http://www.pulseaudio.org}.
|
||||
|
||||
@subsection Options
|
||||
@table @option
|
||||
@item server
|
||||
Connect to a specific PulseAudio server, specified by an IP address.
|
||||
Default server is used when not provided.
|
||||
|
||||
@item name
|
||||
Specify the application name PulseAudio will use when showing active clients,
|
||||
by default it is the @code{LIBAVFORMAT_IDENT} string.
|
||||
|
||||
@item stream_name
|
||||
Specify the stream name PulseAudio will use when showing active streams,
|
||||
by default it is "record".
|
||||
|
||||
@item sample_rate
|
||||
Specify the samplerate in Hz, by default 48kHz is used.
|
||||
|
||||
@item channels
|
||||
Specify the channels in use, by default 2 (stereo) is set.
|
||||
|
||||
@item frame_size
|
||||
Specify the number of bytes per frame, by default it is set to 1024.
|
||||
|
||||
@item fragment_size
|
||||
Specify the minimal buffering fragment in PulseAudio, it will affect the
|
||||
audio latency. By default it is unset.
|
||||
@end table
|
||||
|
||||
@subsection Examples
|
||||
Record a stream from default device:
|
||||
@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
|
||||
|
||||
sndio input device.
|
||||
@@ -548,16 +583,10 @@ command:
|
||||
ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
|
||||
@end example
|
||||
|
||||
@section video4linux2, v4l2
|
||||
@section video4linux2
|
||||
|
||||
Video4Linux2 input video device.
|
||||
|
||||
"v4l2" can be used as alias for "video4linux2".
|
||||
|
||||
If FFmpeg is built with v4l-utils support (by using the
|
||||
@code{--enable-libv4l2} configure option), it is possible to use it with the
|
||||
@code{-use_libv4l2} input device option.
|
||||
|
||||
The name of the device to grab is a file device node, usually Linux
|
||||
systems tend to automatically create such nodes when the device
|
||||
(e.g. an USB webcam) is plugged into the system, and has a name of the
|
||||
@@ -565,10 +594,10 @@ kind @file{/dev/video@var{N}}, where @var{N} is a number associated to
|
||||
the device.
|
||||
|
||||
Video4Linux2 devices usually support a limited set of
|
||||
@var{width}x@var{height} sizes and frame rates. You can check which are
|
||||
@var{width}x@var{height} sizes and framerates. You can check which are
|
||||
supported using @command{-list_formats all} for Video4Linux2 devices.
|
||||
Some devices, like TV cards, support one or more standards. It is possible
|
||||
to list all the supported standards using @command{-list_standards all}.
|
||||
|
||||
Some usage examples of the video4linux2 devices with ffmpeg and ffplay:
|
||||
|
||||
The time base for the timestamps is 1 microsecond. Depending on the kernel
|
||||
version and configuration, the timestamps may be derived from the real time
|
||||
@@ -577,94 +606,19 @@ boot time, unaffected by NTP or manual changes to the clock). The
|
||||
@option{-timestamps abs} or @option{-ts abs} option can be used to force
|
||||
conversion into the real time clock.
|
||||
|
||||
Some usage examples of the video4linux2 device with @command{ffmpeg}
|
||||
and @command{ffplay}:
|
||||
@itemize
|
||||
@item
|
||||
Grab and show the input of a video4linux2 device:
|
||||
Note that if FFmpeg is build with v4l-utils support ("--enable-libv4l2"
|
||||
option), it will always be used.
|
||||
@example
|
||||
# Grab and show the input of a video4linux2 device.
|
||||
ffplay -f video4linux2 -framerate 30 -video_size hd720 /dev/video0
|
||||
@end example
|
||||
|
||||
@item
|
||||
Grab and record the input of a video4linux2 device, leave the
|
||||
frame rate and size as previously set:
|
||||
@example
|
||||
# Grab and record the input of a video4linux2 device, leave the
|
||||
framerate and size as previously set.
|
||||
ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
|
||||
@end example
|
||||
@end itemize
|
||||
|
||||
For more information about Video4Linux, check @url{http://linuxtv.org/}.
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
@item standard
|
||||
Set the standard. Must be the name of a supported standard. To get a
|
||||
list of the supported standards, use the @option{list_standards}
|
||||
option.
|
||||
|
||||
@item channel
|
||||
Set the input channel number. Default to -1, which means using the
|
||||
previously selected channel.
|
||||
|
||||
@item video_size
|
||||
Set the video frame size. The argument must be a string in the form
|
||||
@var{WIDTH}x@var{HEIGHT} or a valid size abbreviation.
|
||||
|
||||
@item pixel_format
|
||||
Select the pixel format (only valid for raw video input).
|
||||
|
||||
@item input_format
|
||||
Set the preferred pixel format (for raw video) or a codec name.
|
||||
This option allows to select the input format, when several are
|
||||
available.
|
||||
|
||||
@item framerate
|
||||
Set the preferred video frame rate.
|
||||
|
||||
@item list_formats
|
||||
List available formats (supported pixel formats, codecs, and frame
|
||||
sizes) and exit.
|
||||
|
||||
Available values are:
|
||||
@table @samp
|
||||
@item all
|
||||
Show all available (compressed and non-compressed) formats.
|
||||
|
||||
@item raw
|
||||
Show only raw video (non-compressed) formats.
|
||||
|
||||
@item compressed
|
||||
Show only compressed formats.
|
||||
@end table
|
||||
|
||||
@item list_standards
|
||||
List supported standards and exit.
|
||||
|
||||
Available values are:
|
||||
@table @samp
|
||||
@item all
|
||||
Show all supported standards.
|
||||
@end table
|
||||
|
||||
@item timestamps, ts
|
||||
Set type of timestamps for grabbed frames.
|
||||
|
||||
Available values are:
|
||||
@table @samp
|
||||
@item default
|
||||
Use timestamps from the kernel.
|
||||
|
||||
@item abs
|
||||
Use absolute timestamps (wall clock).
|
||||
|
||||
@item mono2abs
|
||||
Force conversion from monotonic to absolute timestamps.
|
||||
@end table
|
||||
|
||||
Default value is @code{default}.
|
||||
@end table
|
||||
"v4l" and "v4l2" can be used as aliases for the respective "video4linux" and
|
||||
"video4linux2".
|
||||
|
||||
@section vfwcap
|
||||
|
||||
@@ -701,12 +655,12 @@ properties of your X11 display (e.g. grep for "name" or "dimensions").
|
||||
|
||||
For example to grab from @file{:0.0} using @command{ffmpeg}:
|
||||
@example
|
||||
ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0 out.mpg
|
||||
ffmpeg -f x11grab -r 25 -s cif -i :0.0 out.mpg
|
||||
@end example
|
||||
|
||||
Grab at position @code{10,20}:
|
||||
@example
|
||||
ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
|
||||
ffmpeg -f x11grab -r 25 -s cif -i :0.0+10,20 out.mpg
|
||||
@end example
|
||||
|
||||
@subsection Options
|
||||
@@ -727,17 +681,17 @@ zero) to the edge of region.
|
||||
|
||||
For example:
|
||||
@example
|
||||
ffmpeg -f x11grab -follow_mouse centered -framerate 25 -video_size cif -i :0.0 out.mpg
|
||||
ffmpeg -f x11grab -follow_mouse centered -r 25 -s cif -i :0.0 out.mpg
|
||||
@end example
|
||||
|
||||
To follow only when the mouse pointer reaches within 100 pixels to edge:
|
||||
@example
|
||||
ffmpeg -f x11grab -follow_mouse 100 -framerate 25 -video_size cif -i :0.0 out.mpg
|
||||
ffmpeg -f x11grab -follow_mouse 100 -r 25 -s cif -i :0.0 out.mpg
|
||||
@end example
|
||||
|
||||
@item framerate
|
||||
Set the grabbing frame rate. Default value is @code{ntsc},
|
||||
corresponding to a frame rate of @code{30000/1001}.
|
||||
corresponding to a framerate of @code{30000/1001}.
|
||||
|
||||
@item show_region
|
||||
Show grabbed region on screen.
|
||||
@@ -748,12 +702,12 @@ know what is being grabbed if only a portion of the screen is grabbed.
|
||||
|
||||
For example:
|
||||
@example
|
||||
ffmpeg -f x11grab -show_region 1 -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
|
||||
ffmpeg -f x11grab -show_region 1 -r 25 -s cif -i :0.0+10,20 out.mpg
|
||||
@end example
|
||||
|
||||
With @var{follow_mouse}:
|
||||
@example
|
||||
ffmpeg -f x11grab -follow_mouse centered -show_region 1 -framerate 25 -video_size cif -i :0.0 out.mpg
|
||||
ffmpeg -f x11grab -follow_mouse centered -show_region 1 -r 25 -s cif -i :0.0 out.mpg
|
||||
@end example
|
||||
|
||||
@item video_size
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FFmpeg's bug/feature request tracker manual
|
||||
FFmpeg's bug/patch/feature request tracker manual
|
||||
=================================================
|
||||
|
||||
NOTE: This is a draft.
|
||||
@@ -11,7 +11,7 @@ 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, feature requests and license violations. We
|
||||
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.
|
||||
@@ -28,9 +28,6 @@ http(s)://trac.ffmpeg.org
|
||||
|
||||
Type:
|
||||
-----
|
||||
art
|
||||
Artwork such as photos, music, banners, and logos.
|
||||
|
||||
bug / defect
|
||||
An error, flaw, mistake, failure, or fault in FFmpeg or libav* that
|
||||
prevents it from behaving as intended.
|
||||
@@ -44,18 +41,20 @@ feature request / enhancement
|
||||
license violation
|
||||
ticket to keep track of (L)GPL violations of ffmpeg by others
|
||||
|
||||
sponsoring request
|
||||
Developer requests for hardware, software, specifications, money,
|
||||
refunds, etc.
|
||||
patch
|
||||
A patch as generated by diff which conforms to the patch submission and
|
||||
development policy.
|
||||
|
||||
|
||||
Priority:
|
||||
---------
|
||||
critical
|
||||
Bugs about data loss and security issues.
|
||||
Bugs and patches which deal with data loss and security issues.
|
||||
No feature request can be critical.
|
||||
|
||||
important
|
||||
Bugs which make FFmpeg unusable for a significant number of users.
|
||||
Bugs which make FFmpeg unusable for a significant number of users, and
|
||||
patches fixing them.
|
||||
Examples here might be completely broken MPEG-4 decoding or a build issue
|
||||
on Linux.
|
||||
While broken 4xm decoding or a broken OS/2 build would not be important,
|
||||
@@ -69,7 +68,7 @@ normal
|
||||
|
||||
|
||||
minor
|
||||
Bugs about things like spelling errors, "mp2" instead of
|
||||
Bugs and patches about things like spelling errors, "mp2" instead of
|
||||
"mp3" being shown and such.
|
||||
Feature requests about things few people want or which do not make a big
|
||||
difference.
|
||||
@@ -104,13 +103,13 @@ This state implicates that the bug either has been reproduced or that
|
||||
reproduction is not needed as the bug is already understood.
|
||||
|
||||
|
||||
Type/Status:
|
||||
Type/Status/Substatus:
|
||||
----------
|
||||
*/new
|
||||
Initial state of new bugs and feature requests submitted by
|
||||
*/new/new
|
||||
Initial state of new bugs, patches and feature requests submitted by
|
||||
users.
|
||||
|
||||
*/open
|
||||
*/open/open
|
||||
Issues which have been briefly looked at and which did not look outright
|
||||
invalid.
|
||||
This implicates that no real more detailed state applies yet. Conversely,
|
||||
@@ -118,7 +117,9 @@ Type/Status:
|
||||
looked at.
|
||||
|
||||
*/closed/duplicate
|
||||
Bugs or feature requests which are duplicates.
|
||||
Bugs, patches or feature requests which are duplicates.
|
||||
Note that patches dealing with the same thing in a different way are not
|
||||
duplicates.
|
||||
Note, if you mark something as duplicate, do not forget setting the
|
||||
superseder so bug reports are properly linked.
|
||||
|
||||
@@ -133,7 +134,7 @@ Type/Status:
|
||||
bug/closed/fixed
|
||||
Bugs which have to the best of our knowledge been fixed.
|
||||
|
||||
bug/closed/wontfix
|
||||
bug/closed/wont_fix
|
||||
Bugs which we will not fix. Possible reasons include legality, high
|
||||
complexity for the sake of supporting obscure corner cases, speed loss
|
||||
for similarly esoteric purposes, et cetera.
|
||||
@@ -147,15 +148,33 @@ bug/closed/works_for_me
|
||||
reproduction failed - that is the code seems to work correctly to the
|
||||
best of our knowledge.
|
||||
|
||||
feature_request/closed/fixed
|
||||
patch/open/approved
|
||||
Patches which have been reviewed and approved by a developer.
|
||||
Such patches can be applied anytime by any other developer after some
|
||||
reasonable testing (compile + regression tests + does the patch do
|
||||
what the author claimed).
|
||||
|
||||
patch/open/needs_changes
|
||||
Patches which have been reviewed and need changes to be accepted.
|
||||
|
||||
patch/closed/applied
|
||||
Patches which have been applied.
|
||||
|
||||
patch/closed/rejected
|
||||
Patches which have been rejected.
|
||||
|
||||
feature_request/closed/implemented
|
||||
Feature requests which have been implemented.
|
||||
|
||||
feature_request/closed/wontfix
|
||||
feature_request/closed/wont_implement
|
||||
Feature requests which will not be implemented. The reasons here could
|
||||
be legal, philosophical or others.
|
||||
|
||||
Note, please do not use type-status-substatus combinations other than the
|
||||
above without asking on ffmpeg-dev first!
|
||||
|
||||
Note2, if you provide the requested info do not forget to remove the
|
||||
needs_more_info resolution.
|
||||
needs_more_info substatus.
|
||||
|
||||
Component:
|
||||
----------
|
||||
|
||||
@@ -20,7 +20,7 @@ Specifically, this library performs the following conversions:
|
||||
@itemize
|
||||
@item
|
||||
@emph{Resampling}: is the process of changing the audio rate, for
|
||||
example from a high sample rate of 44100Hz to 8000Hz. Audio
|
||||
example from an high sample rate of 44100Hz to 8000Hz. Audio
|
||||
conversion from high to low sample rate is a lossy process. Several
|
||||
resampling options and algorithms are available.
|
||||
|
||||
|
||||
@@ -65,20 +65,4 @@ title=chapter \#1
|
||||
title=multi\
|
||||
line
|
||||
@end example
|
||||
|
||||
By using the ffmetadata muxer and demuxer it is possible to extract
|
||||
metadata from an input file to an ffmetadata file, and then transcode
|
||||
the file into an output file with the edited ffmetadata file.
|
||||
|
||||
Extracting an ffmetadata file with @file{ffmpeg} goes as follows:
|
||||
@example
|
||||
ffmpeg -i INPUT -f ffmetadata FFMETADATAFILE
|
||||
@end example
|
||||
|
||||
Reinserting edited metadata information from the FFMETADATAFILE file can
|
||||
be done as:
|
||||
@example
|
||||
ffmpeg -i INPUT -i FFMETADATAFILE -map_metadata 1 -codec copy OUTPUT
|
||||
@end example
|
||||
|
||||
@c man end METADATA
|
||||
|
||||
@@ -47,14 +47,7 @@ Files that have MIPS copyright notice in them:
|
||||
* libavutil/mips/
|
||||
float_dsp_mips.c
|
||||
libm_mips.h
|
||||
* libavcodec/
|
||||
fft_fixed_32.c
|
||||
fft_init_table.c
|
||||
fft_table.h
|
||||
mdct_fixed_32.c
|
||||
* libavcodec/mips/
|
||||
aaccoder_mips.c
|
||||
aacpsy_mips.h
|
||||
ac3dsp_mips.c
|
||||
acelp_filters_mips.c
|
||||
acelp_vectors_mips.c
|
||||
@@ -70,6 +63,5 @@ Files that have MIPS copyright notice in them:
|
||||
fft_table.h
|
||||
fft_init_table.c
|
||||
fmtconvert_mips.c
|
||||
iirfilter_mips.c
|
||||
mpegaudiodsp_mips_fixed.c
|
||||
mpegaudiodsp_mips_float.c
|
||||
|
||||
@@ -57,11 +57,6 @@ which re-allocates them for other threads.
|
||||
Add CODEC_CAP_FRAME_THREADS to the codec capabilities. There will be very little
|
||||
speed gain at this point but it should work.
|
||||
|
||||
If there are inter-frame dependencies, so the codec calls
|
||||
ff_thread_report/await_progress(), set AVCodecInternal.allocate_progress. The
|
||||
frames must then be freed with ff_thread_release_buffer().
|
||||
Otherwise leave it at zero and decode directly into the user-supplied frames.
|
||||
|
||||
Call ff_thread_report_progress() after some part of the current picture has decoded.
|
||||
A good place to put this is where draw_horiz_band() is called - add this if it isn't
|
||||
called anywhere, as it's useful too and the implementation is trivial when you're
|
||||
|
||||
384
doc/muxers.texi
384
doc/muxers.texi
@@ -258,15 +258,8 @@ ffmpeg -i in.avi -f image2 -frames:v 1 img.jpeg
|
||||
@end example
|
||||
|
||||
@table @option
|
||||
@item start_number @var{number}
|
||||
Start the sequence from @var{number}. Default value is 1. Must be a
|
||||
non-negative number.
|
||||
|
||||
@item -update @var{number}
|
||||
If @var{number} is nonzero, the filename will always be interpreted as just a
|
||||
filename, not a pattern, and this file will be continuously overwritten with new
|
||||
images.
|
||||
|
||||
@item -start_number @var{number}
|
||||
Start the sequence from @var{number}.
|
||||
@end table
|
||||
|
||||
The image muxer supports the .Y.U.V image file format. This format is
|
||||
@@ -275,90 +268,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
|
||||
'.U' and '.V' files as required.
|
||||
|
||||
@section matroska
|
||||
|
||||
Matroska container muxer.
|
||||
|
||||
This muxer implements the matroska and webm container specs.
|
||||
|
||||
The recognized metadata settings in this muxer are:
|
||||
|
||||
@table @option
|
||||
|
||||
@item title=@var{title name}
|
||||
Name provided to a single track
|
||||
@end table
|
||||
|
||||
@table @option
|
||||
|
||||
@item language=@var{language name}
|
||||
Specifies the language of the track in the Matroska languages form
|
||||
@end table
|
||||
|
||||
@table @option
|
||||
|
||||
@item stereo_mode=@var{mode}
|
||||
Stereo 3D video layout of two views in a single video track
|
||||
@table @option
|
||||
@item mono
|
||||
video is not stereo
|
||||
@item left_right
|
||||
Both views are arranged side by side, Left-eye view is on the left
|
||||
@item bottom_top
|
||||
Both views are arranged in top-bottom orientation, Left-eye view is at bottom
|
||||
@item top_bottom
|
||||
Both views are arranged in top-bottom orientation, Left-eye view is on top
|
||||
@item checkerboard_rl
|
||||
Each view is arranged in a checkerboard interleaved pattern, Left-eye view being first
|
||||
@item checkerboard_lr
|
||||
Each view is arranged in a checkerboard interleaved pattern, Right-eye view being first
|
||||
@item row_interleaved_rl
|
||||
Each view is constituted by a row based interleaving, Right-eye view is first row
|
||||
@item row_interleaved_lr
|
||||
Each view is constituted by a row based interleaving, Left-eye view is first row
|
||||
@item col_interleaved_rl
|
||||
Both views are arranged in a column based interleaving manner, Right-eye view is first column
|
||||
@item col_interleaved_lr
|
||||
Both views are arranged in a column based interleaving manner, Left-eye view is first column
|
||||
@item anaglyph_cyan_red
|
||||
All frames are in anaglyph format viewable through red-cyan filters
|
||||
@item right_left
|
||||
Both views are arranged side by side, Right-eye view is on the left
|
||||
@item anaglyph_green_magenta
|
||||
All frames are in anaglyph format viewable through green-magenta filters
|
||||
@item block_lr
|
||||
Both eyes laced in one Block, Left-eye view is first
|
||||
@item block_rl
|
||||
Both eyes laced in one Block, Right-eye view is first
|
||||
@end table
|
||||
@end table
|
||||
|
||||
For example a 3D WebM clip can be created using the following command line:
|
||||
@example
|
||||
ffmpeg -i sample_left_right_clip.mpg -an -c:v libvpx -metadata stereo_mode=left_right -y stereo_clip.webm
|
||||
@end example
|
||||
|
||||
This muxer supports the following options:
|
||||
|
||||
@table @option
|
||||
|
||||
@item reserve_index_space
|
||||
By default, this muxer writes the index for seeking (called cues in Matroska
|
||||
terms) at the end of the file, because it cannot know in advance how much space
|
||||
to leave for the index at the beginning of the file. However for some use cases
|
||||
-- e.g. streaming where seeking is possible but slow -- it is useful to put the
|
||||
index at the beginning of the file.
|
||||
|
||||
If this option is set to a non-zero value, the muxer will reserve a given amount
|
||||
of space in the file header and then try to write the cues there when the muxing
|
||||
finishes. If the available space does not suffice, muxing will fail. A safe size
|
||||
for most use cases should be about 50kB per hour of video.
|
||||
|
||||
Note that cues are only written if the output is seekable and this option will
|
||||
have no effect if it is not.
|
||||
|
||||
@end table
|
||||
|
||||
@anchor{md5}
|
||||
@section md5
|
||||
|
||||
@@ -451,11 +360,9 @@ pair for each track, making it easier to separate tracks.
|
||||
|
||||
This option is implicitly set when writing ismv (Smooth Streaming) files.
|
||||
@item -movflags faststart
|
||||
Run a second pass moving the index (moov atom) to the beginning of the file.
|
||||
This operation can take a while, and will not work in various situations such
|
||||
Run a second pass moving the moov atom on top of the file. This
|
||||
operation can take a while, and will not work in various situations such
|
||||
as fragmented output, thus it is not enabled by default.
|
||||
@item -movflags rtphint
|
||||
Add RTP hinting tracks to the output file.
|
||||
@end table
|
||||
|
||||
Smooth Streaming content can be pushed in real time to a publishing
|
||||
@@ -464,42 +371,6 @@ point on IIS with this muxer. Example:
|
||||
ffmpeg -re @var{<normal input/transcoding options>} -movflags isml+frag_keyframe -f ismv http://server/publishingpoint.isml/Streams(Encoder1)
|
||||
@end example
|
||||
|
||||
@section mp3
|
||||
|
||||
The MP3 muxer writes a raw MP3 stream with an ID3v2 header at the beginning and
|
||||
optionally an ID3v1 tag at the end. ID3v2.3 and ID3v2.4 are supported, the
|
||||
@code{id3v2_version} option controls which one is used. The legacy ID3v1 tag is
|
||||
not written by default, but may be enabled with the @code{write_id3v1} option.
|
||||
|
||||
For seekable output the muxer also writes a Xing frame at the beginning, which
|
||||
contains the number of frames in the file. It is useful for computing duration
|
||||
of VBR files.
|
||||
|
||||
The muxer supports writing ID3v2 attached pictures (APIC frames). The pictures
|
||||
are supplied to the muxer in form of a video stream with a single packet. There
|
||||
can be any number of those streams, each will correspond to a single APIC frame.
|
||||
The stream metadata tags @var{title} and @var{comment} map to APIC
|
||||
@var{description} and @var{picture type} respectively. See
|
||||
@url{http://id3.org/id3v2.4.0-frames} for allowed picture types.
|
||||
|
||||
Note that the APIC frames must be written at the beginning, so the muxer will
|
||||
buffer the audio frames until it gets all the pictures. It is therefore advised
|
||||
to provide the pictures as soon as possible to avoid excessive buffering.
|
||||
|
||||
Examples:
|
||||
|
||||
Write an mp3 with an ID3v2.3 header and an ID3v1 footer:
|
||||
@example
|
||||
ffmpeg -i INPUT -id3v2_version 3 -write_id3v1 1 out.mp3
|
||||
@end example
|
||||
|
||||
To attach a picture to an mp3 file select both the audio and the picture stream
|
||||
with @code{map}:
|
||||
@example
|
||||
ffmpeg -i input.mp3 -i cover.png -c copy -map 0 -map 1
|
||||
-metadata:s:v title="Album cover" -metadata:s:v comment="Cover (Front)" out.mp3
|
||||
@end example
|
||||
|
||||
@section mpegts
|
||||
|
||||
MPEG transport stream muxer.
|
||||
@@ -522,40 +393,6 @@ Set the service_id (default 0x0001) also known as program in DVB.
|
||||
Set the first PID for PMT (default 0x1000, max 0x1f00).
|
||||
@item -mpegts_start_pid @var{number}
|
||||
Set the first PID for data packets (default 0x0100, max 0x0f00).
|
||||
@item -mpegts_m2ts_mode @var{number}
|
||||
Enable m2ts mode if set to 1. Default value is -1 which disables m2ts mode.
|
||||
@item -muxrate @var{number}
|
||||
Set muxrate.
|
||||
@item -pes_payload_size @var{number}
|
||||
Set minimum PES packet payload in bytes.
|
||||
@item -mpegts_flags @var{flags}
|
||||
Set flags (see below).
|
||||
@item -mpegts_copyts @var{number}
|
||||
Preserve original timestamps, if value is set to 1. Default value is -1, which
|
||||
results in shifting timestamps so that they start from 0.
|
||||
@item -tables_version @var{number}
|
||||
Set PAT, PMT and SDT version (default 0, valid values are from 0 to 31, inclusively).
|
||||
This option allows updating stream structure so that standard consumer may
|
||||
detect the change. To do so, reopen output AVFormatContext (in case of API
|
||||
usage) or restart ffmpeg instance, cyclically changing tables_version value:
|
||||
@example
|
||||
ffmpeg -i source1.ts -codec copy -f mpegts -tables_version 0 udp://1.1.1.1:1111
|
||||
ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udp://1.1.1.1:1111
|
||||
...
|
||||
ffmpeg -i source3.ts -codec copy -f mpegts -tables_version 31 udp://1.1.1.1:1111
|
||||
ffmpeg -i source1.ts -codec copy -f mpegts -tables_version 0 udp://1.1.1.1:1111
|
||||
ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udp://1.1.1.1:1111
|
||||
...
|
||||
@end example
|
||||
@end table
|
||||
|
||||
Option mpegts_flags may take a set of such flags:
|
||||
|
||||
@table @option
|
||||
@item resend_headers
|
||||
Reemit PAT/PMT before writing the next packet.
|
||||
@item latm
|
||||
Use LATM packetization for AAC.
|
||||
@end table
|
||||
|
||||
The recognized metadata settings in mpegts muxer are @code{service_provider}
|
||||
@@ -597,21 +434,69 @@ Alternatively you can write the command as:
|
||||
ffmpeg -benchmark -i INPUT -f null -
|
||||
@end example
|
||||
|
||||
@section ogg
|
||||
@section matroska
|
||||
|
||||
Ogg container muxer.
|
||||
Matroska container muxer.
|
||||
|
||||
This muxer implements the matroska and webm container specs.
|
||||
|
||||
The recognized metadata settings in this muxer are:
|
||||
|
||||
@table @option
|
||||
@item -page_duration @var{duration}
|
||||
Preferred page duration, in microseconds. The muxer will attempt to create
|
||||
pages that are approximately @var{duration} microseconds long. This allows the
|
||||
user to compromise between seek granularity and container overhead. The default
|
||||
is 1 second. A value of 0 will fill all segments, making pages as large as
|
||||
possible. A value of 1 will effectively use 1 packet-per-page in most
|
||||
situations, giving a small seek granularity at the cost of additional container
|
||||
overhead.
|
||||
|
||||
@item title=@var{title name}
|
||||
Name provided to a single track
|
||||
@end table
|
||||
|
||||
@table @option
|
||||
|
||||
@item language=@var{language name}
|
||||
Specifies the language of the track in the Matroska languages form
|
||||
@end table
|
||||
|
||||
@table @option
|
||||
|
||||
@item stereo_mode=@var{mode}
|
||||
Stereo 3D video layout of two views in a single video track
|
||||
@table @option
|
||||
@item mono
|
||||
video is not stereo
|
||||
@item left_right
|
||||
Both views are arranged side by side, Left-eye view is on the left
|
||||
@item bottom_top
|
||||
Both views are arranged in top-bottom orientation, Left-eye view is at bottom
|
||||
@item top_bottom
|
||||
Both views are arranged in top-bottom orientation, Left-eye view is on top
|
||||
@item checkerboard_rl
|
||||
Each view is arranged in a checkerboard interleaved pattern, Left-eye view being first
|
||||
@item checkerboard_lr
|
||||
Each view is arranged in a checkerboard interleaved pattern, Right-eye view being first
|
||||
@item row_interleaved_rl
|
||||
Each view is constituted by a row based interleaving, Right-eye view is first row
|
||||
@item row_interleaved_lr
|
||||
Each view is constituted by a row based interleaving, Left-eye view is first row
|
||||
@item col_interleaved_rl
|
||||
Both views are arranged in a column based interleaving manner, Right-eye view is first column
|
||||
@item col_interleaved_lr
|
||||
Both views are arranged in a column based interleaving manner, Left-eye view is first column
|
||||
@item anaglyph_cyan_red
|
||||
All frames are in anaglyph format viewable through red-cyan filters
|
||||
@item right_left
|
||||
Both views are arranged side by side, Right-eye view is on the left
|
||||
@item anaglyph_green_magenta
|
||||
All frames are in anaglyph format viewable through green-magenta filters
|
||||
@item block_lr
|
||||
Both eyes laced in one Block, Left-eye view is first
|
||||
@item block_rl
|
||||
Both eyes laced in one Block, Right-eye view is first
|
||||
@end table
|
||||
@end table
|
||||
|
||||
For example a 3D WebM clip can be created using the following command line:
|
||||
@example
|
||||
ffmpeg -i sample_left_right_clip.mpg -an -c:v libvpx -metadata stereo_mode=left_right -y stereo_clip.webm
|
||||
@end example
|
||||
|
||||
@section segment, stream_segment, ssegment
|
||||
|
||||
Basic stream segmenter.
|
||||
@@ -648,40 +533,40 @@ Set the reference stream, as specified by the string @var{specifier}.
|
||||
If @var{specifier} is set to @code{auto}, the reference is choosen
|
||||
automatically. Otherwise it must be a stream specifier (see the ``Stream
|
||||
specifiers'' chapter in the ffmpeg manual) which specifies the
|
||||
reference stream. The default value is @code{auto}.
|
||||
reference stream. The default value is ``auto''.
|
||||
|
||||
@item segment_format @var{format}
|
||||
Override the inner container format, by default it is guessed by the filename
|
||||
extension.
|
||||
|
||||
@item segment_list @var{name}
|
||||
Generate also a listfile named @var{name}. If not specified no
|
||||
listfile is generated.
|
||||
|
||||
@item segment_list_flags @var{flags}
|
||||
Set flags affecting the segment list generation.
|
||||
|
||||
It currently supports the following flags:
|
||||
@table @samp
|
||||
@table @var
|
||||
@item cache
|
||||
Allow caching (only affects M3U8 list files).
|
||||
|
||||
@item live
|
||||
Allow live-friendly file generation.
|
||||
|
||||
This currently only affects M3U8 lists. In particular, write a fake
|
||||
EXT-X-TARGETDURATION duration field at the top of the file, based on
|
||||
the specified @var{segment_time}.
|
||||
@end table
|
||||
|
||||
Default value is @code{samp}.
|
||||
Default value is @code{cache}.
|
||||
|
||||
@item segment_list_size @var{size}
|
||||
Update the list file so that it contains at most the last @var{size}
|
||||
segments. If 0 the list file will contain all the segments. Default
|
||||
value is 0.
|
||||
|
||||
@item segment_list_type @var{type}
|
||||
Overwrite the listfile once it reaches @var{size} entries. If 0
|
||||
the listfile is never overwritten. Default value is 0.
|
||||
@item segment_list type @var{type}
|
||||
Specify the format for the segment list file.
|
||||
|
||||
The following values are recognized:
|
||||
@table @samp
|
||||
@table @option
|
||||
@item flat
|
||||
Generate a flat list for the created segments, one segment per line.
|
||||
|
||||
@@ -702,36 +587,21 @@ the segment start and end time expressed in seconds.
|
||||
A list file with the suffix @code{".csv"} or @code{".ext"} will
|
||||
auto-select this format.
|
||||
|
||||
@samp{ext} is deprecated in favor or @samp{csv}.
|
||||
|
||||
@item ffconcat
|
||||
Generate an ffconcat file for the created segments. The resulting file
|
||||
can be read using the FFmpeg @ref{concat} demuxer.
|
||||
|
||||
A list file with the suffix @code{".ffcat"} or @code{".ffconcat"} will
|
||||
auto-select this format.
|
||||
@code{ext} is deprecated in favor or @code{csv}.
|
||||
|
||||
@item m3u8
|
||||
Generate an extended M3U8 file, version 3, compliant with
|
||||
@url{http://tools.ietf.org/id/draft-pantos-http-live-streaming}.
|
||||
Generate an extended M3U8 file, version 4, compliant with
|
||||
@url{http://tools.ietf.org/id/draft-pantos-http-live-streaming-08.txt}.
|
||||
|
||||
A list file with the suffix @code{".m3u8"} will auto-select this format.
|
||||
@end table
|
||||
|
||||
If not specified the type is guessed from the list file name suffix.
|
||||
|
||||
@item segment_time @var{time}
|
||||
Set segment duration to @var{time}, the value must be a duration
|
||||
specification. Default value is "2". See also the
|
||||
@option{segment_times} option.
|
||||
|
||||
Note that splitting may not be accurate, unless you force the
|
||||
reference stream key-frames at the given time. See the introductory
|
||||
notice and the examples below.
|
||||
|
||||
Set segment duration to @var{time}. Default value is "2".
|
||||
@item segment_time_delta @var{delta}
|
||||
Specify the accuracy time when selecting the start time for a
|
||||
segment, expressed as a duration specification. Default value is "0".
|
||||
segment. Default value is "0".
|
||||
|
||||
When delta is specified a key-frame will start a new segment if its
|
||||
PTS satisfies the relation:
|
||||
@@ -753,8 +623,7 @@ the specified time and the time set by @var{force_key_frames}.
|
||||
|
||||
@item segment_times @var{times}
|
||||
Specify a list of split points. @var{times} contains a list of comma
|
||||
separated duration specifications, in increasing order. See also
|
||||
the @option{segment_time} option.
|
||||
separated duration specifications, in increasing order.
|
||||
|
||||
@item segment_frames @var{frames}
|
||||
Specify a list of split video frame numbers. @var{frames} contains a
|
||||
@@ -775,13 +644,9 @@ Reset timestamps at the begin of each segment, so that each segment
|
||||
will start with near-zero timestamps. It is meant to ease the playback
|
||||
of the generated segments. May not work with some combinations of
|
||||
muxers/codecs. It is set to @code{0} by default.
|
||||
|
||||
@item initial_offset @var{offset}
|
||||
Specify timestamp offset to apply to the output packet timestamps. The
|
||||
argument must be a time duration specification, and defaults to 0.
|
||||
@end table
|
||||
|
||||
@subsection Examples
|
||||
@section Examples
|
||||
|
||||
@itemize
|
||||
@item
|
||||
@@ -800,9 +665,9 @@ ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.csv -segment_ti
|
||||
@end example
|
||||
|
||||
@item
|
||||
As the example above, but use the @command{ffmpeg} @option{force_key_frames}
|
||||
As the example above, but use the @code{ffmpeg} @var{force_key_frames}
|
||||
option to force key frames in the input at the specified location, together
|
||||
with the segment option @option{segment_time_delta} to account for
|
||||
with the segment option @var{segment_time_delta} to account for
|
||||
possible roundings operated when setting key frame times.
|
||||
@example
|
||||
ffmpeg -i in.mkv -force_key_frames 1,2,3,5,8,13,21 -codec:v mpeg4 -codec:a pcm_s16le -map 0 \
|
||||
@@ -813,7 +678,7 @@ required.
|
||||
|
||||
@item
|
||||
Segment the input file by splitting the input file according to the
|
||||
frame numbers sequence specified with the @option{segment_frames} option:
|
||||
frame numbers sequence specified with the @var{segment_frames} option:
|
||||
@example
|
||||
ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.csv -segment_frames 100,200,300,500,800 out%03d.nut
|
||||
@end example
|
||||
@@ -834,75 +699,40 @@ ffmpeg -re -i in.mkv -codec copy -map 0 -f segment -segment_list playlist.m3u8 \
|
||||
@end example
|
||||
@end itemize
|
||||
|
||||
@section tee
|
||||
@section mp3
|
||||
|
||||
The tee muxer can be used to write the same data to several files or any
|
||||
other kind of muxer. It can be used, for example, to both stream a video to
|
||||
the network and save it to disk at the same time.
|
||||
The MP3 muxer writes a raw MP3 stream with an ID3v2 header at the beginning and
|
||||
optionally an ID3v1 tag at the end. ID3v2.3 and ID3v2.4 are supported, the
|
||||
@code{id3v2_version} option controls which one is used. The legacy ID3v1 tag is
|
||||
not written by default, but may be enabled with the @code{write_id3v1} option.
|
||||
|
||||
It is different from specifying several outputs to the @command{ffmpeg}
|
||||
command-line tool because the audio and video data will be encoded only once
|
||||
with the tee muxer; encoding can be a very expensive process. It is not
|
||||
useful when using the libavformat API directly because it is then possible
|
||||
to feed the same packets to several muxers directly.
|
||||
For seekable output the muxer also writes a Xing frame at the beginning, which
|
||||
contains the number of frames in the file. It is useful for computing duration
|
||||
of VBR files.
|
||||
|
||||
The slave outputs are specified in the file name given to the muxer,
|
||||
separated by '|'. If any of the slave name contains the '|' separator,
|
||||
leading or trailing spaces or any special character, it must be
|
||||
escaped (see the ``Quoting and escaping'' section in the ffmpeg-utils
|
||||
manual).
|
||||
The muxer supports writing ID3v2 attached pictures (APIC frames). The pictures
|
||||
are supplied to the muxer in form of a video stream with a single packet. There
|
||||
can be any number of those streams, each will correspond to a single APIC frame.
|
||||
The stream metadata tags @var{title} and @var{comment} map to APIC
|
||||
@var{description} and @var{picture type} respectively. See
|
||||
@url{http://id3.org/id3v2.4.0-frames} for allowed picture types.
|
||||
|
||||
Muxer options can be specified for each slave by prepending them as a list of
|
||||
@var{key}=@var{value} pairs separated by ':', between square brackets. If
|
||||
the options values contain a special character or the ':' separator, they
|
||||
must be escaped; note that this is a second level escaping.
|
||||
Note that the APIC frames must be written at the beginning, so the muxer will
|
||||
buffer the audio frames until it gets all the pictures. It is therefore advised
|
||||
to provide the pictures as soon as possible to avoid excessive buffering.
|
||||
|
||||
The following special options are also recognized:
|
||||
@table @option
|
||||
@item f
|
||||
Specify the format name. Useful if it cannot be guessed from the
|
||||
output name suffix.
|
||||
Examples:
|
||||
|
||||
@item bsfs[/@var{spec}]
|
||||
Specify a list of bitstream filters to apply to the specified
|
||||
output. It is possible to specify to which streams a given bitstream
|
||||
filter applies, by appending a stream specifier to the option
|
||||
separated by @code{/}. If the stream specifier is not specified, the
|
||||
bistream filters will be applied to all streams in the output.
|
||||
|
||||
Several bitstream filters can be specified, separated by ",".
|
||||
|
||||
@item select
|
||||
Select the streams that should be mapped to the slave output,
|
||||
specified by a stream specifier. If not specified, this defaults to
|
||||
all the input streams.
|
||||
@end table
|
||||
|
||||
Some examples follow.
|
||||
@itemize
|
||||
@item
|
||||
Encode something and both archive it in a WebM file and stream it
|
||||
as MPEG-TS over UDP (the streams need to be explicitly mapped):
|
||||
Write an mp3 with an ID3v2.3 header and an ID3v1 footer:
|
||||
@example
|
||||
ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 0:a
|
||||
"archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/"
|
||||
ffmpeg -i INPUT -id3v2_version 3 -write_id3v1 1 out.mp3
|
||||
@end example
|
||||
|
||||
@item
|
||||
Use @command{ffmpeg} to encode the input, and send the output
|
||||
to three different destinations. The @code{dump_extra} bitstream
|
||||
filter is used to add extradata information to all the output video
|
||||
keyframes packets, as requested by the MPEG-TS format. The select
|
||||
option is applied to @file{out.aac} in order to make it contain only
|
||||
audio packets.
|
||||
To attach a picture to an mp3 file select both the audio and the picture stream
|
||||
with @code{map}:
|
||||
@example
|
||||
ffmpeg -i ... -map 0 -flags +global_header -c:v libx264 -c:a aac -strict experimental
|
||||
-f tee "[bsfs/v=dump_extra]out.ts|[movflags=+faststart]out.mp4|[select=a]out.aac"
|
||||
ffmpeg -i input.mp3 -i cover.png -c copy -map 0 -map 1
|
||||
-metadata:s:v title="Album cover" -metadata:s:v comment="Cover (Front)" out.mp3
|
||||
@end example
|
||||
@end itemize
|
||||
|
||||
Note: some codecs may need different options depending on the output format;
|
||||
the auto-detection of this can not work with the tee muxer. The main example
|
||||
is the @option{global_header} flag.
|
||||
|
||||
@c man end MUXERS
|
||||
|
||||
@@ -148,7 +148,7 @@ Alignment:
|
||||
Some instructions on some architectures have strict alignment restrictions,
|
||||
for example most SSE/SSE2 instructions on x86.
|
||||
The minimum guaranteed alignment is written in the .h files, for example:
|
||||
void (*put_pixels_clamped)(const int16_t *block/*align 16*/, UINT8 *pixels/*align 8*/, int line_size);
|
||||
void (*put_pixels_clamped)(const DCTELEM *block/*align 16*/, UINT8 *pixels/*align 8*/, int line_size);
|
||||
|
||||
|
||||
General Tips:
|
||||
|
||||
139
doc/outdevs.texi
139
doc/outdevs.texi
@@ -1,7 +1,7 @@
|
||||
@chapter Output Devices
|
||||
@c man begin OUTPUT DEVICES
|
||||
|
||||
Output devices are configured elements in FFmpeg that can write
|
||||
Output devices are configured elements in FFmpeg which allow to write
|
||||
multimedia data to an output device attached to your system.
|
||||
|
||||
When you configure your FFmpeg build, all the supported output devices
|
||||
@@ -26,7 +26,7 @@ ALSA (Advanced Linux Sound Architecture) output device.
|
||||
|
||||
CACA output device.
|
||||
|
||||
This output device allows to show a video stream in CACA window.
|
||||
This output devices allows to show a video stream in CACA window.
|
||||
Only one CACA window is allowed per application, so you can
|
||||
have only one instance of this output device in an application.
|
||||
|
||||
@@ -104,79 +104,15 @@ ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_dither colors -
|
||||
@end example
|
||||
@end itemize
|
||||
|
||||
@section fbdev
|
||||
|
||||
Linux framebuffer output device.
|
||||
|
||||
The Linux framebuffer is a graphic hardware-independent abstraction
|
||||
layer to show graphics on a computer monitor, typically on the
|
||||
console. It is accessed through a file device node, usually
|
||||
@file{/dev/fb0}.
|
||||
|
||||
For more detailed information read the file
|
||||
@file{Documentation/fb/framebuffer.txt} included in the Linux source tree.
|
||||
|
||||
@subsection Options
|
||||
@table @option
|
||||
|
||||
@item xoffset
|
||||
@item yoffset
|
||||
Set x/y coordinate of top left corner. Default is 0.
|
||||
@end table
|
||||
|
||||
@subsection Examples
|
||||
Play a file on framebuffer device @file{/dev/fb0}.
|
||||
Required pixel format depends on current framebuffer settings.
|
||||
@example
|
||||
ffmpeg -re -i INPUT -vcodec rawvideo -pix_fmt bgra -f fbdev /dev/fb0
|
||||
@end example
|
||||
|
||||
See also @url{http://linux-fbdev.sourceforge.net/}, and fbset(1).
|
||||
|
||||
@section oss
|
||||
|
||||
OSS (Open Sound System) output device.
|
||||
|
||||
@section pulse
|
||||
|
||||
PulseAudio output device.
|
||||
|
||||
To enable this output device you need to configure FFmpeg with @code{--enable-libpulse}.
|
||||
|
||||
More information about PulseAudio can be found on @url{http://www.pulseaudio.org}
|
||||
|
||||
@subsection Options
|
||||
@table @option
|
||||
|
||||
@item server
|
||||
Connect to a specific PulseAudio server, specified by an IP address.
|
||||
Default server is used when not provided.
|
||||
|
||||
@item name
|
||||
Specify the application name PulseAudio will use when showing active clients,
|
||||
by default it is the @code{LIBAVFORMAT_IDENT} string.
|
||||
|
||||
@item stream_name
|
||||
Specify the stream name PulseAudio will use when showing active streams,
|
||||
by default it is set to the specified output name.
|
||||
|
||||
@item device
|
||||
Specify the device to use. Default device is used when not provided.
|
||||
List of output devices can be obtained with command @command{pactl list sinks}.
|
||||
|
||||
@end table
|
||||
|
||||
@subsection Examples
|
||||
Play a file on default device on default server:
|
||||
@example
|
||||
ffmpeg -i INPUT -f pulse "stream name"
|
||||
@end example
|
||||
|
||||
@section sdl
|
||||
|
||||
SDL (Simple DirectMedia Layer) output device.
|
||||
|
||||
This output device 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
|
||||
have only one instance of this output device in an application.
|
||||
|
||||
@@ -203,10 +139,6 @@ Set the SDL window size, can be a string of the form
|
||||
@var{width}x@var{height} or a video size abbreviation.
|
||||
If not specified it defaults to the size of the input video,
|
||||
downscaled according to the aspect ratio.
|
||||
|
||||
@item window_fullscreen
|
||||
Set fullscreen mode when non-zero value is provided.
|
||||
Zero is a default.
|
||||
@end table
|
||||
|
||||
@subsection Examples
|
||||
@@ -221,69 +153,4 @@ ffmpeg -i INPUT -vcodec rawvideo -pix_fmt yuv420p -window_size qcif -f sdl "SDL
|
||||
|
||||
sndio audio output device.
|
||||
|
||||
@section xv
|
||||
|
||||
XV (XVideo) output device.
|
||||
|
||||
This output device allows to show a video stream in a X Window System
|
||||
window.
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
@item display_name
|
||||
Specify the hardware display name, which determines the display and
|
||||
communications domain to be used.
|
||||
|
||||
The display name or DISPLAY environment variable can be a string in
|
||||
the format @var{hostname}[:@var{number}[.@var{screen_number}]].
|
||||
|
||||
@var{hostname} specifies the name of the host machine on which the
|
||||
display is physically attached. @var{number} specifies the number of
|
||||
the display server on that host machine. @var{screen_number} specifies
|
||||
the screen to be used on that server.
|
||||
|
||||
If unspecified, it defaults to the value of the DISPLAY environment
|
||||
variable.
|
||||
|
||||
For example, @code{dual-headed:0.1} would specify screen 1 of display
|
||||
0 on the machine named ``dual-headed''.
|
||||
|
||||
Check the X11 specification for more detailed information about the
|
||||
display name format.
|
||||
|
||||
@item window_size
|
||||
Set the created window size, can be a string of the form
|
||||
@var{width}x@var{height} or a video size abbreviation. If not
|
||||
specified it defaults to the size of the input video.
|
||||
|
||||
@item window_x
|
||||
@item window_y
|
||||
Set the X and Y window offsets for the created window. They are both
|
||||
set to 0 by default. The values may be ignored by the window manager.
|
||||
|
||||
@item window_title
|
||||
Set the window title, if not specified default to the filename
|
||||
specified for the output device.
|
||||
@end table
|
||||
|
||||
For more information about XVideo see @url{http://www.x.org/}.
|
||||
|
||||
@subsection Examples
|
||||
|
||||
@itemize
|
||||
@item
|
||||
Decode, display and encode video input with @command{ffmpeg} at the
|
||||
same time:
|
||||
@example
|
||||
ffmpeg -i INPUT OUTPUT -f xv display
|
||||
@end example
|
||||
|
||||
@item
|
||||
Decode and display the input video to multiple X11 windows:
|
||||
@example
|
||||
ffmpeg -i INPUT -f xv normal -vf negate -f xv negated
|
||||
@end example
|
||||
@end itemize
|
||||
|
||||
@c man end OUTPUT DEVICES
|
||||
|
||||
@@ -106,10 +106,10 @@ libavformat) as DLLs.
|
||||
|
||||
@end itemize
|
||||
|
||||
@section Microsoft Visual C++ or Intel C++ Compiler for Windows
|
||||
@section Microsoft Visual C++
|
||||
|
||||
FFmpeg can be built with MSVC or ICL using a C99-to-C89 conversion utility and
|
||||
wrapper. For ICL, only the wrapper is used, since ICL supports C99.
|
||||
FFmpeg can be built with MSVC using a C99-to-C89 conversion utility and
|
||||
wrapper.
|
||||
|
||||
You will need the following prerequisites:
|
||||
|
||||
@@ -122,33 +122,28 @@ You will need the following prerequisites:
|
||||
you want to run @uref{fate.html, FATE}.
|
||||
@end itemize
|
||||
|
||||
To set up a proper environment in MSYS, you need to run @code{msys.bat} from
|
||||
the Visual Studio or Intel Compiler command prompt.
|
||||
To set up a proper MSVC environment in MSYS, you simply need to run
|
||||
@code{msys.bat} from the Visual Studio command prompt.
|
||||
|
||||
Place @code{makedef}, @code{c99wrap.exe}, @code{c99conv.exe}, and @code{yasm.exe}
|
||||
somewhere in your @code{PATH}.
|
||||
|
||||
Next, make sure @code{inttypes.h} and any other headers and libs you want to use
|
||||
are located in a spot that the compiler can see. Do so by modifying the @code{LIB}
|
||||
and @code{INCLUDE} environment variables to include the @strong{Windows} paths to
|
||||
are located in a spot that MSVC can see. Do so by modifying the @code{LIB} and
|
||||
@code{INCLUDE} environment variables to include the @strong{Windows} paths to
|
||||
these directories. Alternatively, you can try and use the
|
||||
@code{--extra-cflags}/@code{--extra-ldflags} configure options.
|
||||
|
||||
Finally, run:
|
||||
|
||||
@example
|
||||
For MSVC:
|
||||
./configure --toolchain=msvc
|
||||
|
||||
For ICL:
|
||||
./configure --toolchain=icl
|
||||
|
||||
make
|
||||
make install
|
||||
@end example
|
||||
|
||||
If you wish to compile shared libraries, add @code{--enable-shared} to your
|
||||
configure options. Note that due to the way MSVC and ICL handle DLL imports and
|
||||
configure options. Note that due to the way MSVC handles DLL imports and
|
||||
exports, you cannot compile static and shared libraries at the same time, and
|
||||
enabling shared libraries will automatically disable the static ones.
|
||||
|
||||
@@ -178,12 +173,7 @@ erroneously included when building FFmpeg.
|
||||
can see.
|
||||
@end enumerate
|
||||
|
||||
@item FFmpeg has been tested with the following on i686 and x86_64:
|
||||
@itemize
|
||||
@item Visual Studio 2010 Pro and Express
|
||||
@item Visual Studio 2012 Pro and Express
|
||||
@item Intel Composer XE 2013
|
||||
@end itemize
|
||||
@item FFmpeg has been tested with Visual Studio 2010 and 2012, Pro and Express.
|
||||
Anything else is not officially supported.
|
||||
|
||||
@end itemize
|
||||
@@ -194,7 +184,16 @@ If you plan to link with MSVC-built static libraries, you will need
|
||||
to make sure you have @code{Runtime Library} set to
|
||||
@code{Multi-threaded (/MT)} in your project's settings.
|
||||
|
||||
You will need to define @code{inline} to something MSVC understands:
|
||||
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
|
||||
|
||||
You will also need to define @code{inline} to something MSVC understands:
|
||||
@example
|
||||
#define inline __inline
|
||||
@end example
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
/*
|
||||
* Copyright (c) 2012 Anton Khirnov
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
* This file is part of Libav.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* Libav is free software; you can redistribute it and/or
|
||||
* 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.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* Libav is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* License along with Libav; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
@@ -27,9 +27,7 @@
|
||||
#include <float.h>
|
||||
|
||||
#include "libavformat/avformat.h"
|
||||
#include "libavformat/options_table.h"
|
||||
#include "libavcodec/avcodec.h"
|
||||
#include "libavcodec/options_table.h"
|
||||
#include "libavutil/opt.h"
|
||||
|
||||
static void print_usage(void)
|
||||
@@ -41,9 +39,6 @@ static void print_usage(void)
|
||||
|
||||
static void print_option(const AVOption *opts, const AVOption *o, int per_stream)
|
||||
{
|
||||
if (!(o->flags & (AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_ENCODING_PARAM)))
|
||||
return;
|
||||
|
||||
printf("@item -%s%s @var{", o->name, per_stream ? "[:stream_specifier]" : "");
|
||||
switch (o->type) {
|
||||
case AV_OPT_TYPE_BINARY: printf("hexadecimal string"); break;
|
||||
@@ -98,14 +93,18 @@ static void show_opts(const AVOption *opts, int per_stream)
|
||||
|
||||
static void show_format_opts(void)
|
||||
{
|
||||
#include "libavformat/options_table.h"
|
||||
|
||||
printf("@section Format AVOptions\n");
|
||||
show_opts(avformat_options, 0);
|
||||
show_opts(options, 0);
|
||||
}
|
||||
|
||||
static void show_codec_opts(void)
|
||||
{
|
||||
#include "libavcodec/options_table.h"
|
||||
|
||||
printf("@section Codec AVOptions\n");
|
||||
show_opts(avcodec_options, 1);
|
||||
show_opts(options, 1);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
@chapter Protocols
|
||||
@c man begin PROTOCOLS
|
||||
|
||||
Protocols are configured elements in FFmpeg that enable access to
|
||||
resources that require specific protocols.
|
||||
Protocols are configured elements in FFmpeg which allow to access
|
||||
resources which require the use of a particular protocol.
|
||||
|
||||
When you configure your FFmpeg build, all the supported protocols are
|
||||
enabled by default. You can list all available ones using the
|
||||
@@ -49,16 +49,6 @@ Read angle 2 of playlist 4 from BluRay mounted to /mnt/bluray, start from chapte
|
||||
-playlist 4 -angle 2 -chapter 2 bluray:/mnt/bluray
|
||||
@end example
|
||||
|
||||
@section cache
|
||||
|
||||
Caching wrapper for input stream.
|
||||
|
||||
Cache the input stream to temporary file. It brings seeking capability to live streams.
|
||||
|
||||
@example
|
||||
cache:@var{URL}
|
||||
@end example
|
||||
|
||||
@section concat
|
||||
|
||||
Physical concatenation protocol.
|
||||
@@ -85,25 +75,6 @@ ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
|
||||
Note that you may need to escape the character "|" which is special for
|
||||
many shells.
|
||||
|
||||
@section crypto
|
||||
|
||||
AES-encrypted stream reading protocol.
|
||||
|
||||
The accepted options are:
|
||||
@table @option
|
||||
@item key
|
||||
Set the AES decryption key binary block from given hexadecimal representation.
|
||||
|
||||
@item iv
|
||||
Set the AES decryption initialization vector binary block from given hexadecimal representation.
|
||||
@end table
|
||||
|
||||
Accepted URL formats:
|
||||
@example
|
||||
crypto:@var{URL}
|
||||
crypto+@var{URL}
|
||||
@end example
|
||||
|
||||
@section data
|
||||
|
||||
Data in-line in the URI. See @url{http://en.wikipedia.org/wiki/Data_URI_scheme}.
|
||||
@@ -129,54 +100,6 @@ The ff* tools default to the file protocol, that is a resource
|
||||
specified with the name "FILE.mpeg" is interpreted as the URL
|
||||
"file:FILE.mpeg".
|
||||
|
||||
This protocol accepts the following options:
|
||||
|
||||
@table @option
|
||||
@item truncate
|
||||
Truncate existing files on write, if set to 1. A value of 0 prevents
|
||||
truncating. Default value is 1.
|
||||
|
||||
@item blocksize
|
||||
Set I/O operation maximum block size, in bytes. Default value is
|
||||
@code{INT_MAX}, which results in not limiting the requested block size.
|
||||
Setting this value reasonably low improves user termination request reaction
|
||||
time, which is valuable for files on slow medium.
|
||||
@end table
|
||||
|
||||
@section ftp
|
||||
|
||||
FTP (File Transfer Protocol).
|
||||
|
||||
Allow to read from or write to remote resources using FTP protocol.
|
||||
|
||||
Following syntax is required.
|
||||
@example
|
||||
ftp://[user[:password]@@]server[:port]/path/to/remote/resource.mpeg
|
||||
@end example
|
||||
|
||||
This protocol accepts the following options.
|
||||
|
||||
@table @option
|
||||
@item timeout
|
||||
Set timeout of socket I/O operations used by the underlying low level
|
||||
operation. By default it is set to -1, which means that the timeout is
|
||||
not specified.
|
||||
|
||||
@item ftp-anonymous-password
|
||||
Password used when login as anonymous user. Typically an e-mail address
|
||||
should be used.
|
||||
|
||||
@item ftp-write-seekable
|
||||
Control seekability of connection during encoding. If set to 1 the
|
||||
resource is supposed to be seekable, if set to 0 it is assumed not
|
||||
to be seekable. Default value is 0.
|
||||
@end table
|
||||
|
||||
NOTE: Protocol can be used as output, but it is recommended to not do
|
||||
it, unless special care is taken (tests, customized server configuration
|
||||
etc.). Different FTP servers behave in different way during seek
|
||||
operation. ff* tools may produce incomplete content due to server limitations.
|
||||
|
||||
@section gopher
|
||||
|
||||
Gopher protocol.
|
||||
@@ -205,77 +128,6 @@ m3u8 files.
|
||||
|
||||
HTTP (Hyper Text Transfer Protocol).
|
||||
|
||||
This protocol accepts the following options.
|
||||
|
||||
@table @option
|
||||
@item seekable
|
||||
Control seekability of connection. If set to 1 the resource is
|
||||
supposed to be seekable, if set to 0 it is assumed not to be seekable,
|
||||
if set to -1 it will try to autodetect if it is seekable. Default
|
||||
value is -1.
|
||||
|
||||
@item chunked_post
|
||||
If set to 1 use chunked transfer-encoding for posts, default is 1.
|
||||
|
||||
@item headers
|
||||
Set custom HTTP headers, can override built in default headers. The
|
||||
value must be a string encoding the headers.
|
||||
|
||||
@item content_type
|
||||
Force a content type.
|
||||
|
||||
@item user-agent
|
||||
Override User-Agent header. If not specified the protocol will use a
|
||||
string describing the libavformat build.
|
||||
|
||||
@item multiple_requests
|
||||
Use persistent connections if set to 1. By default it is 0.
|
||||
|
||||
@item post_data
|
||||
Set custom HTTP post data.
|
||||
|
||||
@item timeout
|
||||
Set timeout of socket I/O operations used by the underlying low level
|
||||
operation. By default it is set to -1, which means that the timeout is
|
||||
not specified.
|
||||
|
||||
@item mime_type
|
||||
Set MIME type.
|
||||
|
||||
@item icy
|
||||
If set to 1 request ICY (SHOUTcast) metadata from the server. If the server
|
||||
supports this, the metadata has to be retrieved by the application by reading
|
||||
the @option{icy_metadata_headers} and @option{icy_metadata_packet} options.
|
||||
The default is 0.
|
||||
|
||||
@item icy_metadata_headers
|
||||
If the server supports ICY metadata, this contains the ICY specific HTTP reply
|
||||
headers, separated with newline characters.
|
||||
|
||||
@item icy_metadata_packet
|
||||
If the server supports ICY metadata, and @option{icy} was set to 1, this
|
||||
contains the last non-empty metadata packet sent by the server.
|
||||
|
||||
@item cookies
|
||||
Set the cookies to be sent in future requests. The format of each cookie is the
|
||||
same as the value of a Set-Cookie HTTP response field. Multiple cookies can be
|
||||
delimited by a newline character.
|
||||
@end table
|
||||
|
||||
@subsection HTTP Cookies
|
||||
|
||||
Some HTTP requests will be denied unless cookie values are passed in with the
|
||||
request. The @option{cookies} option allows these cookies to be specified. At
|
||||
the very least, each cookie must specify a value along with a path and domain.
|
||||
HTTP requests that match both the domain and path will automatically include the
|
||||
cookie value in the HTTP Cookie header field. Multiple cookies can be delimited
|
||||
by a newline.
|
||||
|
||||
The required syntax to play a stream specifying a cookie is:
|
||||
@example
|
||||
ffplay -cookies "nlqptid=nltid=tsn; path=/; domain=somedomain.com;" http://somedomain.com/somestream.m3u8
|
||||
@end example
|
||||
|
||||
@section mmst
|
||||
|
||||
MMS (Microsoft Media Server) protocol over TCP.
|
||||
@@ -339,16 +191,6 @@ ffmpeg -i test.wav -f avi pipe:1 | cat > test.avi
|
||||
ffmpeg -i test.wav -f avi pipe: | cat > test.avi
|
||||
@end example
|
||||
|
||||
This protocol accepts the following options:
|
||||
|
||||
@table @option
|
||||
@item blocksize
|
||||
Set I/O operation maximum block size, in bytes. Default value is
|
||||
@code{INT_MAX}, which results in not limiting the requested block size.
|
||||
Setting this value reasonably low improves user termination request reaction
|
||||
time, which is valuable if data transmission is slow.
|
||||
@end table
|
||||
|
||||
Note that some formats (typically MOV), require the output protocol to
|
||||
be seekable, so they will fail with the pipe output protocol.
|
||||
|
||||
@@ -361,18 +203,12 @@ content across a TCP/IP network.
|
||||
|
||||
The required syntax is:
|
||||
@example
|
||||
rtmp://[@var{username}:@var{password}@@]@var{server}[:@var{port}][/@var{app}][/@var{instance}][/@var{playpath}]
|
||||
rtmp://@var{server}[:@var{port}][/@var{app}][/@var{instance}][/@var{playpath}]
|
||||
@end example
|
||||
|
||||
The accepted parameters are:
|
||||
@table @option
|
||||
|
||||
@item username
|
||||
An optional username (mostly for publishing).
|
||||
|
||||
@item password
|
||||
An optional password (mostly for publishing).
|
||||
|
||||
@item server
|
||||
The address of the RTMP server.
|
||||
|
||||
@@ -423,8 +259,7 @@ times to construct arbitrary AMF sequences.
|
||||
|
||||
@item rtmp_flashver
|
||||
Version of the Flash plugin used to run the SWF player. The default
|
||||
is LNX 9,0,124,2. (When publishing, the default is FMLE/3.0 (compatible;
|
||||
<libavformat version>).)
|
||||
is LNX 9,0,124,2.
|
||||
|
||||
@item rtmp_flush_interval
|
||||
Number of packets flushed in the same request (RTMPT only). The default
|
||||
@@ -474,12 +309,6 @@ For example to read with @command{ffplay} a multimedia resource named
|
||||
ffplay rtmp://myserver/vod/sample
|
||||
@end example
|
||||
|
||||
To publish to a password protected server, passing the playpath and
|
||||
app names separately:
|
||||
@example
|
||||
ffmpeg -re -i <input> -f flv -rtmp_playpath some/long/path -rtmp_app long/app/name rtmp://username:password@@myserver/
|
||||
@end example
|
||||
|
||||
@section rtmpe
|
||||
|
||||
Encrypted Real-Time Messaging Protocol.
|
||||
@@ -520,39 +349,7 @@ The Real-Time Messaging Protocol tunneled through HTTPS (RTMPTS) is used
|
||||
for streaming multimedia content within HTTPS requests to traverse
|
||||
firewalls.
|
||||
|
||||
@section libssh
|
||||
|
||||
Secure File Transfer Protocol via libssh
|
||||
|
||||
Allow to read from or write to remote resources using SFTP protocol.
|
||||
|
||||
Following syntax is required.
|
||||
|
||||
@example
|
||||
sftp://[user[:password]@@]server[:port]/path/to/remote/resource.mpeg
|
||||
@end example
|
||||
|
||||
This protocol accepts the following options.
|
||||
|
||||
@table @option
|
||||
@item timeout
|
||||
Set timeout of socket I/O operations used by the underlying low level
|
||||
operation. By default it is set to -1, which means that the timeout
|
||||
is not specified.
|
||||
|
||||
@item truncate
|
||||
Truncate existing files on write, if set to 1. A value of 0 prevents
|
||||
truncating. Default value is 1.
|
||||
|
||||
@end table
|
||||
|
||||
Example: Play a file stored on remote server.
|
||||
|
||||
@example
|
||||
ffplay sftp://user:password@@server_address:22/home/user/resource.mpeg
|
||||
@end example
|
||||
|
||||
@section librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte
|
||||
@section rtmp, rtmpe, rtmps, rtmpt, rtmpte
|
||||
|
||||
Real-Time Messaging Protocol and its variants supported through
|
||||
librtmp.
|
||||
@@ -594,70 +391,7 @@ ffplay "rtmp://myserver/live/mystream live=1"
|
||||
|
||||
@section rtp
|
||||
|
||||
Real-time Transport Protocol.
|
||||
|
||||
The required syntax for an RTP URL is:
|
||||
rtp://@var{hostname}[:@var{port}][?@var{option}=@var{val}...]
|
||||
|
||||
@var{port} specifies the RTP port to use.
|
||||
|
||||
The following URL options are supported:
|
||||
|
||||
@table @option
|
||||
|
||||
@item ttl=@var{n}
|
||||
Set the TTL (Time-To-Live) value (for multicast only).
|
||||
|
||||
@item rtcpport=@var{n}
|
||||
Set the remote RTCP port to @var{n}.
|
||||
|
||||
@item localrtpport=@var{n}
|
||||
Set the local RTP port to @var{n}.
|
||||
|
||||
@item localrtcpport=@var{n}'
|
||||
Set the local RTCP port to @var{n}.
|
||||
|
||||
@item pkt_size=@var{n}
|
||||
Set max packet size (in bytes) to @var{n}.
|
||||
|
||||
@item connect=0|1
|
||||
Do a @code{connect()} on the UDP socket (if set to 1) or not (if set
|
||||
to 0).
|
||||
|
||||
@item sources=@var{ip}[,@var{ip}]
|
||||
List allowed source IP addresses.
|
||||
|
||||
@item block=@var{ip}[,@var{ip}]
|
||||
List disallowed (blocked) source IP addresses.
|
||||
|
||||
@item write_to_source=0|1
|
||||
Send packets to the source address of the latest received packet (if
|
||||
set to 1) or to a default remote address (if set to 0).
|
||||
|
||||
@item localport=@var{n}
|
||||
Set the local RTP port to @var{n}.
|
||||
|
||||
This is a deprecated option. Instead, @option{localrtpport} should be
|
||||
used.
|
||||
|
||||
@end table
|
||||
|
||||
Important notes:
|
||||
|
||||
@enumerate
|
||||
|
||||
@item
|
||||
If @option{rtcpport} is not set the RTCP port will be set to the RTP
|
||||
port value plus 1.
|
||||
|
||||
@item
|
||||
If @option{localrtpport} (the local RTP port) is not set any available
|
||||
port will be used for the local RTP and RTCP ports.
|
||||
|
||||
@item
|
||||
If @option{localrtcpport} (the local RTCP port) is not set it will be
|
||||
set to the the local RTP port value plus 1.
|
||||
@end enumerate
|
||||
Real-Time Protocol.
|
||||
|
||||
@section rtsp
|
||||
|
||||
@@ -747,11 +481,6 @@ To receive a stream in realtime:
|
||||
ffmpeg -rtsp_flags listen -i rtsp://ownaddress/live.sdp @var{output}
|
||||
@end example
|
||||
|
||||
@table @option
|
||||
@item stimeout
|
||||
Socket IO timeout in micro seconds.
|
||||
@end table
|
||||
|
||||
@section sap
|
||||
|
||||
Session Announcement Protocol (RFC 2974). This is not technically a
|
||||
@@ -844,50 +573,6 @@ To play back the first stream announced on one the default IPv6 SAP multicast ad
|
||||
ffplay sap://[ff0e::2:7ffe]
|
||||
@end example
|
||||
|
||||
@section sctp
|
||||
|
||||
Stream Control Transmission Protocol.
|
||||
|
||||
The accepted URL syntax is:
|
||||
@example
|
||||
sctp://@var{host}:@var{port}[?@var{options}]
|
||||
@end example
|
||||
|
||||
The protocol accepts the following options:
|
||||
@table @option
|
||||
@item listen
|
||||
If set to any value, listen for an incoming connection. Outgoing connection is done by default.
|
||||
|
||||
@item max_streams
|
||||
Set the maximum number of streams. By default no limit is set.
|
||||
@end table
|
||||
|
||||
@section srtp
|
||||
|
||||
Secure Real-time Transport Protocol.
|
||||
|
||||
The accepted options are:
|
||||
@table @option
|
||||
@item srtp_in_suite
|
||||
@item srtp_out_suite
|
||||
Select input and output encoding suites.
|
||||
|
||||
Supported values:
|
||||
@table @samp
|
||||
@item AES_CM_128_HMAC_SHA1_80
|
||||
@item SRTP_AES128_CM_HMAC_SHA1_80
|
||||
@item AES_CM_128_HMAC_SHA1_32
|
||||
@item SRTP_AES128_CM_HMAC_SHA1_32
|
||||
@end table
|
||||
|
||||
@item srtp_in_params
|
||||
@item srtp_out_params
|
||||
Set input and output encoding parameters, which are expressed by a
|
||||
base64-encoded representation of a binary block. The first 16 bytes of
|
||||
this binary block are used as master key, the following 14 bytes are
|
||||
used as master salt.
|
||||
@end table
|
||||
|
||||
@section tcp
|
||||
|
||||
Trasmission Control Protocol.
|
||||
@@ -916,48 +601,29 @@ ffplay tcp://@var{hostname}:@var{port}
|
||||
|
||||
@section tls
|
||||
|
||||
Transport Layer Security (TLS) / Secure Sockets Layer (SSL)
|
||||
Transport Layer Security/Secure Sockets Layer
|
||||
|
||||
The required syntax for a TLS/SSL url is:
|
||||
@example
|
||||
tls://@var{hostname}:@var{port}[?@var{options}]
|
||||
@end example
|
||||
|
||||
The following parameters can be set via command line options
|
||||
(or in code via @code{AVOption}s):
|
||||
|
||||
@table @option
|
||||
|
||||
@item ca_file, cafile=@var{filename}
|
||||
A file containing certificate authority (CA) root certificates to treat
|
||||
as trusted. If the linked TLS library contains a default this might not
|
||||
need to be specified for verification to work, but not all libraries and
|
||||
setups have defaults built in.
|
||||
The file must be in OpenSSL PEM format.
|
||||
@item listen
|
||||
Act as a server, listening for an incoming connection.
|
||||
|
||||
@item tls_verify=@var{1|0}
|
||||
If enabled, try to verify the peer that we are communicating with.
|
||||
Note, if using OpenSSL, this currently only makes sure that the
|
||||
peer certificate is signed by one of the root certificates in the CA
|
||||
database, but it does not validate that the certificate actually
|
||||
matches the host name we are trying to connect to. (With GnuTLS,
|
||||
the host name is validated as well.)
|
||||
@item cafile=@var{filename}
|
||||
Certificate authority file. The file must be in OpenSSL PEM format.
|
||||
|
||||
This is disabled by default since it requires a CA database to be
|
||||
provided by the caller in many cases.
|
||||
@item cert=@var{filename}
|
||||
Certificate file. The file must be in OpenSSL PEM format.
|
||||
|
||||
@item cert_file, cert=@var{filename}
|
||||
A file containing a certificate to use in the handshake with the peer.
|
||||
(When operating as server, in listen mode, this is more often required
|
||||
by the peer, while client certificates only are mandated in certain
|
||||
setups.)
|
||||
@item key=@var{filename}
|
||||
Private key file.
|
||||
|
||||
@item key_file, key=@var{filename}
|
||||
A file containing the private key for the certificate.
|
||||
|
||||
@item listen=@var{1|0}
|
||||
If enabled, listen for connections on the provided port, and assume
|
||||
the server role in the handshake instead of the client role.
|
||||
@item verify=@var{0|1}
|
||||
Verify the peer's certificate.
|
||||
|
||||
@end table
|
||||
|
||||
@@ -1064,24 +730,4 @@ To receive over UDP from a remote endpoint:
|
||||
ffmpeg -i udp://[@var{multicast-address}]:@var{port}
|
||||
@end example
|
||||
|
||||
@section unix
|
||||
|
||||
Unix local socket
|
||||
|
||||
The required syntax for a Unix socket URL is:
|
||||
|
||||
@example
|
||||
unix://@var{filepath}
|
||||
@end example
|
||||
|
||||
The following parameters can be set via command line options
|
||||
(or in code via @code{AVOption}s):
|
||||
|
||||
@table @option
|
||||
@item timeout
|
||||
Timeout in ms.
|
||||
@item listen
|
||||
Create the Unix socket in listening mode.
|
||||
@end table
|
||||
|
||||
@c man end PROTOCOLS
|
||||
|
||||
@@ -1,232 +0,0 @@
|
||||
@chapter Resampler Options
|
||||
@c man begin RESAMPLER OPTIONS
|
||||
|
||||
The audio resampler supports the following named options.
|
||||
|
||||
Options may be set by specifying -@var{option} @var{value} in the
|
||||
FFmpeg tools, @var{option}=@var{value} for the aresample filter,
|
||||
by setting the value explicitly in the
|
||||
@code{SwrContext} options or using the @file{libavutil/opt.h} API for
|
||||
programmatic use.
|
||||
|
||||
@table @option
|
||||
|
||||
@item ich, in_channel_count
|
||||
Set the number of input channels. Default value is 0. Setting this
|
||||
value is not mandatory if the corresponding channel layout
|
||||
@option{in_channel_layout} is set.
|
||||
|
||||
@item och, out_channel_count
|
||||
Set the number of output channels. Default value is 0. Setting this
|
||||
value is not mandatory if the corresponding channel layout
|
||||
@option{out_channel_layout} is set.
|
||||
|
||||
@item uch, used_channel_count
|
||||
Set the number of used input channels. Default value is 0. This option is
|
||||
only used for special remapping.
|
||||
|
||||
@item isr, in_sample_rate
|
||||
Set the input sample rate. Default value is 0.
|
||||
|
||||
@item osr, out_sample_rate
|
||||
Set the output sample rate. Default value is 0.
|
||||
|
||||
@item isf, in_sample_fmt
|
||||
Specify the input sample format. It is set by default to @code{none}.
|
||||
|
||||
@item osf, out_sample_fmt
|
||||
Specify the output sample format. It is set by default to @code{none}.
|
||||
|
||||
@item tsf, internal_sample_fmt
|
||||
Set the internal sample format. Default value is @code{none}.
|
||||
This will automatically be chosen when it is not explicitly set.
|
||||
|
||||
@item icl, in_channel_layout
|
||||
@item ocl, out_channel_layout
|
||||
Set the input/output channel layout.
|
||||
|
||||
See @ref{channel layout syntax,,the Channel Layout section in the ffmpeg-utils(1) manual,ffmpeg-utils}
|
||||
for the required syntax.
|
||||
|
||||
@item clev, center_mix_level
|
||||
Set the center mix level. It is a value expressed in deciBel, and must be
|
||||
in the interval [-32,32].
|
||||
|
||||
@item slev, surround_mix_level
|
||||
Set the surround mix level. It is a value expressed in deciBel, and must
|
||||
be in the interval [-32,32].
|
||||
|
||||
@item lfe_mix_level
|
||||
Set LFE mix into non LFE level. It is used when there is a LFE input but no
|
||||
LFE output. It is a value expressed in deciBel, and must
|
||||
be in the interval [-32,32].
|
||||
|
||||
@item rmvol, rematrix_volume
|
||||
Set rematrix volume. Default value is 1.0.
|
||||
|
||||
@item rematrix_maxval
|
||||
Set maximum output value for rematrixing.
|
||||
This can be used to prevent clipping vs. preventing volumn reduction
|
||||
A value of 1.0 prevents cliping.
|
||||
|
||||
@item flags, swr_flags
|
||||
Set flags used by the converter. Default value is 0.
|
||||
|
||||
It supports the following individual flags:
|
||||
@table @option
|
||||
@item res
|
||||
force resampling, this flag forces resampling to be used even when the
|
||||
input and output sample rates match.
|
||||
@end table
|
||||
|
||||
@item dither_scale
|
||||
Set the dither scale. Default value is 1.
|
||||
|
||||
@item dither_method
|
||||
Set dither method. Default value is 0.
|
||||
|
||||
Supported values:
|
||||
@table @samp
|
||||
@item rectangular
|
||||
select rectangular dither
|
||||
@item triangular
|
||||
select triangular dither
|
||||
@item triangular_hp
|
||||
select triangular dither with high pass
|
||||
@item lipshitz
|
||||
select lipshitz noise shaping dither
|
||||
@item shibata
|
||||
select shibata noise shaping dither
|
||||
@item low_shibata
|
||||
select low shibata noise shaping dither
|
||||
@item high_shibata
|
||||
select high shibata noise shaping dither
|
||||
@item f_weighted
|
||||
select f-weighted noise shaping dither
|
||||
@item modified_e_weighted
|
||||
select modified-e-weighted noise shaping dither
|
||||
@item improved_e_weighted
|
||||
select improved-e-weighted noise shaping dither
|
||||
|
||||
@end table
|
||||
|
||||
@item resampler
|
||||
Set resampling engine. Default value is swr.
|
||||
|
||||
Supported values:
|
||||
@table @samp
|
||||
@item swr
|
||||
select the native SW Resampler; filter options precision and cheby are not
|
||||
applicable in this case.
|
||||
@item soxr
|
||||
select the SoX Resampler (where available); compensation, and filter options
|
||||
filter_size, phase_shift, filter_type & kaiser_beta, are not applicable in this
|
||||
case.
|
||||
@end table
|
||||
|
||||
@item filter_size
|
||||
For swr only, set resampling filter size, default value is 32.
|
||||
|
||||
@item phase_shift
|
||||
For swr only, set resampling phase shift, default value is 10, and must be in
|
||||
the interval [0,30].
|
||||
|
||||
@item linear_interp
|
||||
Use Linear Interpolation if set to 1, default value is 0.
|
||||
|
||||
@item cutoff
|
||||
Set cutoff frequency (swr: 6dB point; soxr: 0dB point) ratio; must be a float
|
||||
value between 0 and 1. Default value is 0.97 with swr, and 0.91 with soxr
|
||||
(which, with a sample-rate of 44100, preserves the entire audio band to 20kHz).
|
||||
|
||||
@item precision
|
||||
For soxr only, the precision in bits to which the resampled signal will be
|
||||
calculated. The default value of 20 (which, with suitable dithering, is
|
||||
appropriate for a destination bit-depth of 16) gives SoX's 'High Quality'; a
|
||||
value of 28 gives SoX's 'Very High Quality'.
|
||||
|
||||
@item cheby
|
||||
For soxr only, selects passband rolloff none (Chebyshev) & higher-precision
|
||||
approximation for 'irrational' ratios. Default value is 0.
|
||||
|
||||
@item async
|
||||
For swr only, simple 1 parameter audio sync to timestamps using stretching,
|
||||
squeezing, filling and trimming. Setting this to 1 will enable filling and
|
||||
trimming, larger values represent the maximum amount in samples that the data
|
||||
may be stretched or squeezed for each second.
|
||||
Default value is 0, thus no compensation is applied to make the samples match
|
||||
the audio timestamps.
|
||||
|
||||
@item first_pts
|
||||
For swr only, assume the first pts should be this value. The time unit is 1 / sample rate.
|
||||
This allows for padding/trimming at the start of stream. By default, no
|
||||
assumption is made about the first frame's expected pts, so no padding or
|
||||
trimming is done. For example, this could be set to 0 to pad the beginning with
|
||||
silence if an audio stream starts after the video stream or to trim any samples
|
||||
with a negative pts due to encoder delay.
|
||||
|
||||
@item min_comp
|
||||
For swr only, set the minimum difference between timestamps and audio data (in
|
||||
seconds) to trigger stretching/squeezing/filling or trimming of the
|
||||
data to make it match the timestamps. The default is that
|
||||
stretching/squeezing/filling and trimming is disabled
|
||||
(@option{min_comp} = @code{FLT_MAX}).
|
||||
|
||||
@item min_hard_comp
|
||||
For swr only, set the minimum difference between timestamps and audio data (in
|
||||
seconds) to trigger adding/dropping samples to make it match the
|
||||
timestamps. This option effectively is a threshold to select between
|
||||
hard (trim/fill) and soft (squeeze/stretch) compensation. Note that
|
||||
all compensation is by default disabled through @option{min_comp}.
|
||||
The default is 0.1.
|
||||
|
||||
@item comp_duration
|
||||
For swr only, set duration (in seconds) over which data is stretched/squeezed
|
||||
to make it match the timestamps. Must be a non-negative double float value,
|
||||
default value is 1.0.
|
||||
|
||||
@item max_soft_comp
|
||||
For swr only, set maximum factor by which data is stretched/squeezed to make it
|
||||
match the timestamps. Must be a non-negative double float value, default value
|
||||
is 0.
|
||||
|
||||
@item matrix_encoding
|
||||
Select matrixed stereo encoding.
|
||||
|
||||
It accepts the following values:
|
||||
@table @samp
|
||||
@item none
|
||||
select none
|
||||
@item dolby
|
||||
select Dolby
|
||||
@item dplii
|
||||
select Dolby Pro Logic II
|
||||
@end table
|
||||
|
||||
Default value is @code{none}.
|
||||
|
||||
@item filter_type
|
||||
For swr only, select resampling filter type. This only affects resampling
|
||||
operations.
|
||||
|
||||
It accepts the following values:
|
||||
@table @samp
|
||||
@item cubic
|
||||
select cubic
|
||||
@item blackman_nuttall
|
||||
select Blackman Nuttall Windowed Sinc
|
||||
@item kaiser
|
||||
select Kaiser Windowed Sinc
|
||||
@end table
|
||||
|
||||
@item kaiser_beta
|
||||
For swr only, set Kaiser Window Beta value. Must be an integer in the
|
||||
interval [2,16], default value is 9.
|
||||
|
||||
@item output_sample_bits
|
||||
For swr only, set number of used output sample bits for dithering. Must be an integer in the
|
||||
interval [0,64], default value is 0, which means it's not used.
|
||||
|
||||
@end table
|
||||
|
||||
@c man end RESAMPLER OPTIONS
|
||||
119
doc/scaler.texi
119
doc/scaler.texi
@@ -1,119 +0,0 @@
|
||||
@anchor{scaler_options}
|
||||
@chapter Scaler Options
|
||||
@c man begin SCALER OPTIONS
|
||||
|
||||
The video scaler supports the following named options.
|
||||
|
||||
Options may be set by specifying -@var{option} @var{value} in the
|
||||
FFmpeg tools. For programmatic use, they can be set explicitly in the
|
||||
@code{SwsContext} options or through the @file{libavutil/opt.h} API.
|
||||
|
||||
@table @option
|
||||
|
||||
@anchor{sws_flags}
|
||||
@item sws_flags
|
||||
Set the scaler flags. This is also used to set the scaling
|
||||
algorithm. Only a single algorithm should be selected.
|
||||
|
||||
It accepts the following values:
|
||||
@table @samp
|
||||
@item fast_bilinear
|
||||
Select fast bilinear scaling algorithm.
|
||||
|
||||
@item bilinear
|
||||
Select bilinear scaling algorithm.
|
||||
|
||||
@item bicubic
|
||||
Select bicubic scaling algorithm.
|
||||
|
||||
@item experimental
|
||||
Select experimental scaling algorithm.
|
||||
|
||||
@item neighbor
|
||||
Select nearest neighbor rescaling algorithm.
|
||||
|
||||
@item area
|
||||
Select averaging area rescaling algorithm.
|
||||
|
||||
@item bicubiclin
|
||||
Select bicubic scaling algorithm for the luma component, bilinear for
|
||||
chroma components.
|
||||
|
||||
@item gauss
|
||||
Select Gaussian rescaling algorithm.
|
||||
|
||||
@item sinc
|
||||
Select sinc rescaling algorithm.
|
||||
|
||||
@item lanczos
|
||||
Select lanczos rescaling algorithm.
|
||||
|
||||
@item spline
|
||||
Select natural bicubic spline rescaling algorithm.
|
||||
|
||||
@item print_info
|
||||
Enable printing/debug logging.
|
||||
|
||||
@item accurate_rnd
|
||||
Enable accurate rounding.
|
||||
|
||||
@item full_chroma_int
|
||||
Enable full chroma interpolation.
|
||||
|
||||
@item full_chroma_inp
|
||||
Select full chroma input.
|
||||
|
||||
@item bitexact
|
||||
Enable bitexact output.
|
||||
@end table
|
||||
|
||||
@item srcw
|
||||
Set source width.
|
||||
|
||||
@item srch
|
||||
Set source height.
|
||||
|
||||
@item dstw
|
||||
Set destination width.
|
||||
|
||||
@item dsth
|
||||
Set destination height.
|
||||
|
||||
@item src_format
|
||||
Set source pixel format (must be expressed as an integer).
|
||||
|
||||
@item dst_format
|
||||
Set destination pixel format (must be expressed as an integer).
|
||||
|
||||
@item src_range
|
||||
Select source range.
|
||||
|
||||
@item dst_range
|
||||
Select destination range.
|
||||
|
||||
@item param0, param1
|
||||
Set scaling algorithm parameters. The specified values are specific of
|
||||
some scaling algorithms and ignored by others. The specified values
|
||||
are floating point number values.
|
||||
|
||||
@item sws_dither
|
||||
Set the dithering algorithm. Accepts one of the following
|
||||
values. Default value is @samp{auto}.
|
||||
|
||||
@table @samp
|
||||
@item auto
|
||||
automatic choice
|
||||
|
||||
@item none
|
||||
no dithering
|
||||
|
||||
@item bayer
|
||||
bayer dither
|
||||
|
||||
@item ed
|
||||
error diffusion dither
|
||||
@end table
|
||||
|
||||
@end table
|
||||
|
||||
@c man end SCALER OPTIONS
|
||||
24
doc/snow.txt
24
doc/snow.txt
@@ -50,10 +50,8 @@ header:
|
||||
temporal_decomposition_count u header_state
|
||||
spatial_decomposition_count u header_state
|
||||
colorspace_type u header_state
|
||||
if (nb_planes > 2) {
|
||||
chroma_h_shift u header_state
|
||||
chroma_v_shift u header_state
|
||||
}
|
||||
chroma_h_shift u header_state
|
||||
chroma_v_shift u header_state
|
||||
spatial_scalability b header_state
|
||||
max_ref_frames-1 u header_state
|
||||
qlogs
|
||||
@@ -61,7 +59,7 @@ header:
|
||||
if(!keyframe){
|
||||
update_mc b header_state
|
||||
if(update_mc){
|
||||
for(plane=0; plane<nb_plane_types; plane++){
|
||||
for(plane=0; plane<2; plane++){
|
||||
diag_mc b header_state
|
||||
htaps/2-1 u header_state
|
||||
for(i= p->htaps/2; i; i--)
|
||||
@@ -82,7 +80,7 @@ header:
|
||||
block_max_depth s header_state
|
||||
|
||||
qlogs:
|
||||
for(plane=0; plane<nb_plane_types; plane++){
|
||||
for(plane=0; plane<2; plane++){
|
||||
quant_table[plane][0][0] s header_state
|
||||
for(level=0; level < spatial_decomposition_count; level++){
|
||||
quant_table[plane][level][1]s header_state
|
||||
@@ -133,10 +131,8 @@ block(level):
|
||||
|
||||
residual:
|
||||
residual2(luma)
|
||||
if (nb_planes > 2) {
|
||||
residual2(chroma_cr)
|
||||
residual2(chroma_cb)
|
||||
}
|
||||
residual2(chroma_cr)
|
||||
residual2(chroma_cb)
|
||||
|
||||
residual2:
|
||||
for(level=0; level<spatial_decomposition_count; level++){
|
||||
@@ -150,7 +146,7 @@ residual2:
|
||||
subband:
|
||||
FIXME
|
||||
|
||||
nb_plane_types = gray ? 1 : 2;
|
||||
|
||||
|
||||
Tag description:
|
||||
----------------
|
||||
@@ -172,11 +168,7 @@ spatial_decomposition_count
|
||||
FIXME
|
||||
|
||||
colorspace_type
|
||||
0 unspecified YcbCr
|
||||
1 Gray
|
||||
2 Gray + Alpha
|
||||
3 GBR
|
||||
4 GBRA
|
||||
0
|
||||
this MUST NOT change within a bitstream
|
||||
|
||||
chroma_h_shift
|
||||
|
||||
@@ -32,9 +32,9 @@ Special Converter v
|
||||
Output
|
||||
|
||||
Planar/Packed conversion is done when needed during sample format conversion.
|
||||
Every step can be skipped without memcpy when it is not needed.
|
||||
Every step can be skipped without memcpy when its not needed.
|
||||
Either Resampling and Rematrixing can be performed first depending on which
|
||||
way it is faster.
|
||||
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.
|
||||
|
||||
230
doc/syntax.texi
Normal file
230
doc/syntax.texi
Normal file
@@ -0,0 +1,230 @@
|
||||
@chapter Syntax
|
||||
@c man begin SYNTAX
|
||||
|
||||
This section documents the syntax and formats employed by the FFmpeg
|
||||
libraries and tools.
|
||||
|
||||
@anchor{quoting_and_escaping}
|
||||
@section Quoting and escaping
|
||||
|
||||
FFmpeg adopts the following quoting and escaping mechanism, unless
|
||||
explicitly specified. The following rules are applied:
|
||||
|
||||
@itemize
|
||||
@item
|
||||
@code{'} and @code{\} are special characters (respectively used for
|
||||
quoting and escaping). In addition to them, there might be other
|
||||
special characters depending on the specific syntax where the escaping
|
||||
and quoting are employed.
|
||||
|
||||
@item
|
||||
A special character is escaped by prefixing it with a '\'.
|
||||
|
||||
@item
|
||||
All characters enclosed between '' are included literally in the
|
||||
parsed string. The quote character @code{'} itself cannot be quoted,
|
||||
so you may need to close the quote and escape it.
|
||||
|
||||
@item
|
||||
Leading and trailing whitespaces, unless escaped or quoted, are
|
||||
removed from the parsed string.
|
||||
@end itemize
|
||||
|
||||
Note that you may need to add a second level of escaping when using
|
||||
the command line or a script, which depends on the syntax of the
|
||||
adopted shell language.
|
||||
|
||||
The function @code{av_get_token} defined in
|
||||
@file{libavutil/avstring.h} can be used to parse a token quoted or
|
||||
escaped according to the rules defined above.
|
||||
|
||||
The tool @file{tools/ffescape} in the FFmpeg source tree can be used
|
||||
to automatically quote or escape a string in a script.
|
||||
|
||||
@subsection Examples
|
||||
|
||||
@itemize
|
||||
@item
|
||||
Escape the string @code{Crime d'Amour} containing the @code{'} special
|
||||
character:
|
||||
@example
|
||||
Crime d\'Amour
|
||||
@end example
|
||||
|
||||
@item
|
||||
The string above contains a quote, so the @code{'} needs to be escaped
|
||||
when quoting it:
|
||||
@example
|
||||
'Crime d'\''Amour'
|
||||
@end example
|
||||
|
||||
@item
|
||||
Include leading or trailing whitespaces using quoting:
|
||||
@example
|
||||
' this string starts and ends with whitespaces '
|
||||
@end example
|
||||
|
||||
@item
|
||||
Escaping and quoting can be mixed together:
|
||||
@example
|
||||
' The string '\'string\'' is a string '
|
||||
@end example
|
||||
|
||||
@item
|
||||
To include a literal @code{\} you can use either escaping or quoting:
|
||||
@example
|
||||
'c:\foo' can be written as c:\\foo
|
||||
@end example
|
||||
@end itemize
|
||||
|
||||
@anchor{date syntax}
|
||||
@section Date
|
||||
|
||||
The accepted syntax is:
|
||||
@example
|
||||
[(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH:MM:SS[.m...]]])|(HHMMSS[.m...]]]))[Z]
|
||||
now
|
||||
@end example
|
||||
|
||||
If the value is "now" it takes the current time.
|
||||
|
||||
Time is local time unless Z is appended, in which case it is
|
||||
interpreted as UTC.
|
||||
If the year-month-day part is not specified it takes the current
|
||||
year-month-day.
|
||||
|
||||
@anchor{time duration syntax}
|
||||
@section Time duration
|
||||
|
||||
The accepted syntax is:
|
||||
@example
|
||||
[-]HH:MM:SS[.m...]
|
||||
[-]S+[.m...]
|
||||
@end example
|
||||
|
||||
@var{HH} expresses the number of hours, @var{MM} the number a of minutes
|
||||
and @var{SS} the number of seconds.
|
||||
|
||||
@anchor{video size syntax}
|
||||
@section Video size
|
||||
Specify the size of the sourced video, it may be a string of the form
|
||||
@var{width}x@var{height}, or the name of a size abbreviation.
|
||||
|
||||
The following abbreviations are recognized:
|
||||
@table @samp
|
||||
@item sqcif
|
||||
128x96
|
||||
@item qcif
|
||||
176x144
|
||||
@item cif
|
||||
352x288
|
||||
@item 4cif
|
||||
704x576
|
||||
@item 16cif
|
||||
1408x1152
|
||||
@item qqvga
|
||||
160x120
|
||||
@item qvga
|
||||
320x240
|
||||
@item vga
|
||||
640x480
|
||||
@item svga
|
||||
800x600
|
||||
@item xga
|
||||
1024x768
|
||||
@item uxga
|
||||
1600x1200
|
||||
@item qxga
|
||||
2048x1536
|
||||
@item sxga
|
||||
1280x1024
|
||||
@item qsxga
|
||||
2560x2048
|
||||
@item hsxga
|
||||
5120x4096
|
||||
@item wvga
|
||||
852x480
|
||||
@item wxga
|
||||
1366x768
|
||||
@item wsxga
|
||||
1600x1024
|
||||
@item wuxga
|
||||
1920x1200
|
||||
@item woxga
|
||||
2560x1600
|
||||
@item wqsxga
|
||||
3200x2048
|
||||
@item wquxga
|
||||
3840x2400
|
||||
@item whsxga
|
||||
6400x4096
|
||||
@item whuxga
|
||||
7680x4800
|
||||
@item cga
|
||||
320x200
|
||||
@item ega
|
||||
640x350
|
||||
@item hd480
|
||||
852x480
|
||||
@item hd720
|
||||
1280x720
|
||||
@item hd1080
|
||||
1920x1080
|
||||
@end table
|
||||
|
||||
@anchor{video rate syntax}
|
||||
@section Video rate
|
||||
|
||||
Specify the frame rate of a video, expressed as the number of frames
|
||||
generated per second. It has to be a string in the format
|
||||
@var{frame_rate_num}/@var{frame_rate_den}, an integer number, a float
|
||||
number or a valid video frame rate abbreviation.
|
||||
|
||||
The following abbreviations are recognized:
|
||||
@table @samp
|
||||
@item ntsc
|
||||
30000/1001
|
||||
@item pal
|
||||
25/1
|
||||
@item qntsc
|
||||
30000/1
|
||||
@item qpal
|
||||
25/1
|
||||
@item sntsc
|
||||
30000/1
|
||||
@item spal
|
||||
25/1
|
||||
@item film
|
||||
24/1
|
||||
@item ntsc-film
|
||||
24000/1
|
||||
@end table
|
||||
|
||||
@anchor{ratio syntax}
|
||||
@section Ratio
|
||||
|
||||
A ratio can be expressed as an expression, or in the form
|
||||
@var{numerator}:@var{denominator}.
|
||||
|
||||
Note that a ratio with infinite (1/0) or negative value is
|
||||
considered valid, so you should check on the returned value if you
|
||||
want to exclude those values.
|
||||
|
||||
The undefined value can be expressed using the "0:0" string.
|
||||
|
||||
@anchor{color syntax}
|
||||
@section Color
|
||||
|
||||
It can be the name of a color (case insensitive match) or a
|
||||
[0x|#]RRGGBB[AA] sequence, possibly followed by "@@" and a string
|
||||
representing the alpha component.
|
||||
|
||||
The alpha component may be a string composed by "0x" followed by an
|
||||
hexadecimal number or a decimal number between 0.0 and 1.0, which
|
||||
represents the opacity value (0x00/0.0 means completely transparent,
|
||||
0xff/1.0 completely opaque).
|
||||
If the alpha component is not specified then 0xff is assumed.
|
||||
|
||||
The string "random" will result in a random color.
|
||||
|
||||
@c man end SYNTAX
|
||||
@@ -17,7 +17,6 @@ my $TEMPLATE_HEADER = $ENV{"FFMPEG_HEADER"} || <<EOT;
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="body">
|
||||
EOT
|
||||
|
||||
$PRE_BODY_CLOSE = '</div></div>';
|
||||
@@ -33,7 +32,7 @@ sub FFmpeg_print_page_foot($$)
|
||||
T2H_DEFAULT_program_string() : program_string();
|
||||
print $fh '<footer class="footer pagination-right">' . "\n";
|
||||
print $fh '<span class="label label-info">' . $program_string;
|
||||
print $fh "</span></footer></div></div></body>\n";
|
||||
print $fh "</span></footer></div>\n";
|
||||
}
|
||||
|
||||
$float = \&FFmpeg_float;
|
||||
@@ -69,7 +68,7 @@ $print_page_head = \&FFmpeg_print_page_head;
|
||||
sub FFmpeg_print_page_head($$)
|
||||
{
|
||||
my $fh = shift;
|
||||
my $longtitle = "$Texi2HTML::THISDOC{'fulltitle_no_texi'}";
|
||||
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));
|
||||
@@ -93,6 +92,8 @@ $Texi2HTML::THISDOC{program_authors}
|
||||
|
||||
$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
|
||||
|
||||
1064
doc/utils.texi
1064
doc/utils.texi
File diff suppressed because it is too large
Load Diff
49
ffmpeg.h
49
ffmpeg.h
@@ -37,10 +37,10 @@
|
||||
#include "libavcodec/avcodec.h"
|
||||
|
||||
#include "libavfilter/avfilter.h"
|
||||
#include "libavfilter/avfiltergraph.h"
|
||||
|
||||
#include "libavutil/avutil.h"
|
||||
#include "libavutil/dict.h"
|
||||
#include "libavutil/eval.h"
|
||||
#include "libavutil/fifo.h"
|
||||
#include "libavutil/pixfmt.h"
|
||||
#include "libavutil/rational.h"
|
||||
@@ -51,7 +51,6 @@
|
||||
#define VSYNC_PASSTHROUGH 0
|
||||
#define VSYNC_CFR 1
|
||||
#define VSYNC_VFR 2
|
||||
#define VSYNC_VSCFR 0xfe
|
||||
#define VSYNC_DROP 0xff
|
||||
|
||||
#define MAX_STREAMS 1024 /* arbitrary sanity check value */
|
||||
@@ -94,7 +93,6 @@ typedef struct OptionsContext {
|
||||
/* input options */
|
||||
int64_t input_ts_offset;
|
||||
int rate_emu;
|
||||
int accurate_seek;
|
||||
|
||||
SpecifierOpt *ts_scale;
|
||||
int nb_ts_scale;
|
||||
@@ -115,7 +113,6 @@ typedef struct OptionsContext {
|
||||
int chapters_input_file;
|
||||
|
||||
int64_t recording_time;
|
||||
int64_t stop_time;
|
||||
uint64_t limit_filesize;
|
||||
float mux_preload;
|
||||
float mux_max_delay;
|
||||
@@ -166,22 +163,14 @@ typedef struct OptionsContext {
|
||||
int nb_copy_prior_start;
|
||||
SpecifierOpt *filters;
|
||||
int nb_filters;
|
||||
SpecifierOpt *filter_scripts;
|
||||
int nb_filter_scripts;
|
||||
SpecifierOpt *reinit_filters;
|
||||
int nb_reinit_filters;
|
||||
SpecifierOpt *fix_sub_duration;
|
||||
int nb_fix_sub_duration;
|
||||
SpecifierOpt *canvas_sizes;
|
||||
int nb_canvas_sizes;
|
||||
SpecifierOpt *pass;
|
||||
int nb_pass;
|
||||
SpecifierOpt *passlogfiles;
|
||||
int nb_passlogfiles;
|
||||
SpecifierOpt *guess_layout_max;
|
||||
int nb_guess_layout_max;
|
||||
SpecifierOpt *apad;
|
||||
int nb_apad;
|
||||
} OptionsContext;
|
||||
|
||||
typedef struct InputFilter {
|
||||
@@ -206,7 +195,6 @@ typedef struct FilterGraph {
|
||||
const char *graph_desc;
|
||||
|
||||
AVFilterGraph *graph;
|
||||
int reconfiguration;
|
||||
|
||||
InputFilter **inputs;
|
||||
int nb_inputs;
|
||||
@@ -221,7 +209,6 @@ typedef struct InputStream {
|
||||
int decoding_needed; /* true if the packets must be decoded in 'raw_fifo' */
|
||||
AVCodec *dec;
|
||||
AVFrame *decoded_frame;
|
||||
AVFrame *filter_frame; /* a ref of decoded_frame, to be sent to filters */
|
||||
|
||||
int64_t start; /* time when read started */
|
||||
/* predicted dts of the next packet read for this stream or (when there are
|
||||
@@ -242,7 +229,6 @@ typedef struct InputStream {
|
||||
AVDictionary *opts;
|
||||
AVRational framerate; /* framerate forced with -r */
|
||||
int top_field_first;
|
||||
int guess_layout_max;
|
||||
|
||||
int resample_height;
|
||||
int resample_width;
|
||||
@@ -263,10 +249,12 @@ typedef struct InputStream {
|
||||
struct sub2video {
|
||||
int64_t last_pts;
|
||||
int64_t end_pts;
|
||||
AVFrame *frame;
|
||||
AVFilterBufferRef *ref;
|
||||
int w, h;
|
||||
} sub2video;
|
||||
|
||||
/* a pool of free buffers for decoded data */
|
||||
FrameBuffer *buffer_pool;
|
||||
int dr1;
|
||||
|
||||
/* decoded data from this stream goes into all those filters
|
||||
@@ -282,16 +270,11 @@ typedef struct InputFile {
|
||||
int eof_reached; /* true if eof reached */
|
||||
int eagain; /* true if last read attempt returned EAGAIN */
|
||||
int ist_index; /* index of first stream in input_streams */
|
||||
int64_t input_ts_offset;
|
||||
int64_t ts_offset;
|
||||
int64_t last_ts;
|
||||
int64_t start_time; /* user-specified start time in AV_TIME_BASE or AV_NOPTS_VALUE */
|
||||
int64_t recording_time;
|
||||
int nb_streams; /* number of stream that ffmpeg is aware of; may be different
|
||||
from ctx.nb_streams if new streams appear during av_read_frame() */
|
||||
int nb_streams_warn; /* number of streams that the user was warned of */
|
||||
int rate_emu;
|
||||
int accurate_seek;
|
||||
|
||||
#if HAVE_PTHREADS
|
||||
pthread_t thread; /* thread reading from this file */
|
||||
@@ -303,17 +286,6 @@ typedef struct InputFile {
|
||||
#endif
|
||||
} InputFile;
|
||||
|
||||
enum forced_keyframes_const {
|
||||
FKF_N,
|
||||
FKF_N_FORCED,
|
||||
FKF_PREV_FORCED_N,
|
||||
FKF_PREV_FORCED_T,
|
||||
FKF_T,
|
||||
FKF_NB
|
||||
};
|
||||
|
||||
extern const char *const forced_keyframes_const_names[];
|
||||
|
||||
typedef struct OutputStream {
|
||||
int file_index; /* file index */
|
||||
int index; /* stream index in the output file */
|
||||
@@ -328,8 +300,6 @@ typedef struct OutputStream {
|
||||
/* pts of the first frame encoded for this stream, used for limiting
|
||||
* recording time */
|
||||
int64_t first_pts;
|
||||
/* dts of the last packet sent to the muxer */
|
||||
int64_t last_mux_dts;
|
||||
AVBitStreamFilterContext *bitstream_filters;
|
||||
AVCodec *enc;
|
||||
int64_t max_frames;
|
||||
@@ -340,15 +310,13 @@ typedef struct OutputStream {
|
||||
int force_fps;
|
||||
int top_field_first;
|
||||
|
||||
AVRational frame_aspect_ratio;
|
||||
float frame_aspect_ratio;
|
||||
|
||||
/* forced key frames */
|
||||
int64_t *forced_kf_pts;
|
||||
int forced_kf_count;
|
||||
int forced_kf_index;
|
||||
char *forced_keyframes;
|
||||
AVExpr *forced_keyframes_pexpr;
|
||||
double forced_keyframes_expr_const_values[FKF_NB];
|
||||
|
||||
/* audio only */
|
||||
int audio_channels_map[SWR_CH_MAX]; /* list of the channels id to pick from the source stream */
|
||||
@@ -361,10 +329,10 @@ typedef struct OutputStream {
|
||||
char *avfilter;
|
||||
|
||||
int64_t sws_flags;
|
||||
int64_t swr_filter_type;
|
||||
int64_t swr_dither_method;
|
||||
double swr_dither_scale;
|
||||
AVDictionary *opts;
|
||||
AVDictionary *swr_opts;
|
||||
AVDictionary *resample_opts;
|
||||
char *apad;
|
||||
int finished; /* no more packets should be written for this stream */
|
||||
int unavailable; /* true if the steram is unavailable (possibly temporarily) */
|
||||
int stream_copy;
|
||||
@@ -422,7 +390,6 @@ extern int qp_hist;
|
||||
extern int stdin_interaction;
|
||||
extern int frame_bits_per_raw_sample;
|
||||
extern AVIOContext *progress_avio;
|
||||
extern float max_error_rate;
|
||||
|
||||
extern const AVIOInterruptCB int_cb;
|
||||
|
||||
|
||||
303
ffmpeg_filter.c
303
ffmpeg_filter.c
@@ -21,10 +21,9 @@
|
||||
#include "ffmpeg.h"
|
||||
|
||||
#include "libavfilter/avfilter.h"
|
||||
#include "libavfilter/avfiltergraph.h"
|
||||
#include "libavfilter/buffersink.h"
|
||||
|
||||
#include "libavresample/avresample.h"
|
||||
|
||||
#include "libavutil/avassert.h"
|
||||
#include "libavutil/avstring.h"
|
||||
#include "libavutil/bprint.h"
|
||||
@@ -92,11 +91,6 @@ void choose_sample_fmt(AVStream *st, AVCodec *codec)
|
||||
|
||||
static char *choose_pix_fmts(OutputStream *ost)
|
||||
{
|
||||
AVDictionaryEntry *strict_dict = av_dict_get(ost->opts, "strict", NULL, 0);
|
||||
if (strict_dict)
|
||||
// used by choose_pixel_fmt() and below
|
||||
av_opt_set(ost->st->codec, "strict", strict_dict->value, 0);
|
||||
|
||||
if (ost->keep_pix_fmt) {
|
||||
if (ost->filter)
|
||||
avfilter_graph_set_auto_convert(ost->filter->graph->graph,
|
||||
@@ -114,7 +108,7 @@ static char *choose_pix_fmts(OutputStream *ost)
|
||||
int len;
|
||||
|
||||
if (avio_open_dyn_buf(&s) < 0)
|
||||
exit_program(1);
|
||||
exit(1);
|
||||
|
||||
p = ost->enc->pix_fmts;
|
||||
if (ost->st->codec->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL) {
|
||||
@@ -128,7 +122,7 @@ static char *choose_pix_fmts(OutputStream *ost)
|
||||
|
||||
for (; *p != AV_PIX_FMT_NONE; p++) {
|
||||
const char *name = av_get_pix_fmt_name(*p);
|
||||
avio_printf(s, "%s|", name);
|
||||
avio_printf(s, "%s:", name);
|
||||
}
|
||||
len = avio_close_dyn_buf(s, &ret);
|
||||
ret[len - 1] = 0;
|
||||
@@ -139,24 +133,24 @@ static char *choose_pix_fmts(OutputStream *ost)
|
||||
|
||||
/* Define a function for building a string containing a list of
|
||||
* allowed formats. */
|
||||
#define DEF_CHOOSE_FORMAT(type, var, supported_list, none, get_name) \
|
||||
#define DEF_CHOOSE_FORMAT(type, var, supported_list, none, get_name, separator)\
|
||||
static char *choose_ ## var ## s(OutputStream *ost) \
|
||||
{ \
|
||||
if (ost->st->codec->var != none) { \
|
||||
get_name(ost->st->codec->var); \
|
||||
return av_strdup(name); \
|
||||
} else if (ost->enc && ost->enc->supported_list) { \
|
||||
} else if (ost->enc->supported_list) { \
|
||||
const type *p; \
|
||||
AVIOContext *s = NULL; \
|
||||
uint8_t *ret; \
|
||||
int len; \
|
||||
\
|
||||
if (avio_open_dyn_buf(&s) < 0) \
|
||||
exit_program(1); \
|
||||
exit(1); \
|
||||
\
|
||||
for (p = ost->enc->supported_list; *p != none; p++) { \
|
||||
get_name(*p); \
|
||||
avio_printf(s, "%s|", name); \
|
||||
avio_printf(s, "%s" separator, name); \
|
||||
} \
|
||||
len = avio_close_dyn_buf(s, &ret); \
|
||||
ret[len - 1] = 0; \
|
||||
@@ -166,28 +160,28 @@ static char *choose_ ## var ## s(OutputStream *ost) \
|
||||
}
|
||||
|
||||
// DEF_CHOOSE_FORMAT(enum AVPixelFormat, pix_fmt, pix_fmts, AV_PIX_FMT_NONE,
|
||||
// GET_PIX_FMT_NAME)
|
||||
// GET_PIX_FMT_NAME, ":")
|
||||
|
||||
DEF_CHOOSE_FORMAT(enum AVSampleFormat, sample_fmt, sample_fmts,
|
||||
AV_SAMPLE_FMT_NONE, GET_SAMPLE_FMT_NAME)
|
||||
AV_SAMPLE_FMT_NONE, GET_SAMPLE_FMT_NAME, ",")
|
||||
|
||||
DEF_CHOOSE_FORMAT(int, sample_rate, supported_samplerates, 0,
|
||||
GET_SAMPLE_RATE_NAME)
|
||||
GET_SAMPLE_RATE_NAME, ",")
|
||||
|
||||
DEF_CHOOSE_FORMAT(uint64_t, channel_layout, channel_layouts, 0,
|
||||
GET_CH_LAYOUT_NAME)
|
||||
GET_CH_LAYOUT_NAME, ",")
|
||||
|
||||
FilterGraph *init_simple_filtergraph(InputStream *ist, OutputStream *ost)
|
||||
{
|
||||
FilterGraph *fg = av_mallocz(sizeof(*fg));
|
||||
|
||||
if (!fg)
|
||||
exit_program(1);
|
||||
exit(1);
|
||||
fg->index = nb_filtergraphs;
|
||||
|
||||
GROW_ARRAY(fg->outputs, fg->nb_outputs);
|
||||
if (!(fg->outputs[0] = av_mallocz(sizeof(*fg->outputs[0]))))
|
||||
exit_program(1);
|
||||
exit(1);
|
||||
fg->outputs[0]->ost = ost;
|
||||
fg->outputs[0]->graph = fg;
|
||||
|
||||
@@ -195,7 +189,7 @@ FilterGraph *init_simple_filtergraph(InputStream *ist, OutputStream *ost)
|
||||
|
||||
GROW_ARRAY(fg->inputs, fg->nb_inputs);
|
||||
if (!(fg->inputs[0] = av_mallocz(sizeof(*fg->inputs[0]))))
|
||||
exit_program(1);
|
||||
exit(1);
|
||||
fg->inputs[0]->ist = ist;
|
||||
fg->inputs[0]->graph = fg;
|
||||
|
||||
@@ -218,7 +212,7 @@ static void init_input_filter(FilterGraph *fg, AVFilterInOut *in)
|
||||
if (type != AVMEDIA_TYPE_VIDEO && type != AVMEDIA_TYPE_AUDIO) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Only video and audio filters supported "
|
||||
"currently.\n");
|
||||
exit_program(1);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (in->name) {
|
||||
@@ -230,7 +224,7 @@ static void init_input_filter(FilterGraph *fg, AVFilterInOut *in)
|
||||
if (file_idx < 0 || file_idx >= nb_input_files) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Invalid file index %d in filtergraph description %s.\n",
|
||||
file_idx, fg->graph_desc);
|
||||
exit_program(1);
|
||||
exit(1);
|
||||
}
|
||||
s = input_files[file_idx]->ctx;
|
||||
|
||||
@@ -248,7 +242,7 @@ static void init_input_filter(FilterGraph *fg, AVFilterInOut *in)
|
||||
if (!st) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Stream specifier '%s' in filtergraph description %s "
|
||||
"matches no streams.\n", p, fg->graph_desc);
|
||||
exit_program(1);
|
||||
exit(1);
|
||||
}
|
||||
ist = input_streams[input_files[file_idx]->ist_index + st->index];
|
||||
} else {
|
||||
@@ -262,7 +256,7 @@ static void init_input_filter(FilterGraph *fg, AVFilterInOut *in)
|
||||
av_log(NULL, AV_LOG_FATAL, "Cannot find a matching stream for "
|
||||
"unlabeled input pad %d on filter %s\n", in->pad_idx,
|
||||
in->filter_ctx->name);
|
||||
exit_program(1);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
av_assert0(ist);
|
||||
@@ -273,7 +267,7 @@ static void init_input_filter(FilterGraph *fg, AVFilterInOut *in)
|
||||
|
||||
GROW_ARRAY(fg->inputs, fg->nb_inputs);
|
||||
if (!(fg->inputs[fg->nb_inputs - 1] = av_mallocz(sizeof(*fg->inputs[0]))))
|
||||
exit_program(1);
|
||||
exit(1);
|
||||
fg->inputs[fg->nb_inputs - 1]->ist = ist;
|
||||
fg->inputs[fg->nb_inputs - 1]->graph = fg;
|
||||
|
||||
@@ -281,72 +275,22 @@ static void init_input_filter(FilterGraph *fg, AVFilterInOut *in)
|
||||
ist->filters[ist->nb_filters - 1] = fg->inputs[fg->nb_inputs - 1];
|
||||
}
|
||||
|
||||
static int insert_trim(int64_t start_time, int64_t duration,
|
||||
AVFilterContext **last_filter, int *pad_idx,
|
||||
const char *filter_name)
|
||||
{
|
||||
AVFilterGraph *graph = (*last_filter)->graph;
|
||||
AVFilterContext *ctx;
|
||||
const AVFilter *trim;
|
||||
enum AVMediaType type = avfilter_pad_get_type((*last_filter)->output_pads, *pad_idx);
|
||||
const char *name = (type == AVMEDIA_TYPE_VIDEO) ? "trim" : "atrim";
|
||||
int ret = 0;
|
||||
|
||||
if (duration == INT64_MAX && start_time == AV_NOPTS_VALUE)
|
||||
return 0;
|
||||
|
||||
trim = avfilter_get_by_name(name);
|
||||
if (!trim) {
|
||||
av_log(NULL, AV_LOG_ERROR, "%s filter not present, cannot limit "
|
||||
"recording time.\n", name);
|
||||
return AVERROR_FILTER_NOT_FOUND;
|
||||
}
|
||||
|
||||
ctx = avfilter_graph_alloc_filter(graph, trim, filter_name);
|
||||
if (!ctx)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
if (duration != INT64_MAX) {
|
||||
ret = av_opt_set_int(ctx, "durationi", duration,
|
||||
AV_OPT_SEARCH_CHILDREN);
|
||||
}
|
||||
if (ret >= 0 && start_time != AV_NOPTS_VALUE) {
|
||||
ret = av_opt_set_int(ctx, "starti", start_time,
|
||||
AV_OPT_SEARCH_CHILDREN);
|
||||
}
|
||||
if (ret < 0) {
|
||||
av_log(ctx, AV_LOG_ERROR, "Error configuring the %s filter", name);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = avfilter_init_str(ctx, NULL);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = avfilter_link(*last_filter, *pad_idx, ctx, 0);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
*last_filter = ctx;
|
||||
*pad_idx = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int configure_output_video_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out)
|
||||
{
|
||||
char *pix_fmts;
|
||||
OutputStream *ost = ofilter->ost;
|
||||
OutputFile *of = output_files[ost->file_index];
|
||||
AVCodecContext *codec = ost->st->codec;
|
||||
AVFilterContext *last_filter = out->filter_ctx;
|
||||
int pad_idx = out->pad_idx;
|
||||
int ret;
|
||||
char name[255];
|
||||
AVBufferSinkParams *buffersink_params = av_buffersink_params_alloc();
|
||||
|
||||
snprintf(name, sizeof(name), "output stream %d:%d", ost->file_index, ost->index);
|
||||
ret = avfilter_graph_create_filter(&ofilter->filter,
|
||||
avfilter_get_by_name("buffersink"),
|
||||
avfilter_get_by_name("ffbuffersink"),
|
||||
name, NULL, NULL, fg->graph);
|
||||
av_freep(&buffersink_params);
|
||||
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
@@ -355,7 +299,7 @@ static int configure_output_video_filter(FilterGraph *fg, OutputFilter *ofilter,
|
||||
char args[255];
|
||||
AVFilterContext *filter;
|
||||
|
||||
snprintf(args, sizeof(args), "%d:%d:0x%X",
|
||||
snprintf(args, sizeof(args), "%d:%d:flags=0x%X",
|
||||
codec->width,
|
||||
codec->height,
|
||||
(unsigned)ost->sws_flags);
|
||||
@@ -375,18 +319,17 @@ static int configure_output_video_filter(FilterGraph *fg, OutputFilter *ofilter,
|
||||
AVFilterContext *filter;
|
||||
snprintf(name, sizeof(name), "pixel format for output stream %d:%d",
|
||||
ost->file_index, ost->index);
|
||||
ret = avfilter_graph_create_filter(&filter,
|
||||
if ((ret = avfilter_graph_create_filter(&filter,
|
||||
avfilter_get_by_name("format"),
|
||||
"format", pix_fmts, NULL,
|
||||
fg->graph);
|
||||
av_freep(&pix_fmts);
|
||||
if (ret < 0)
|
||||
fg->graph)) < 0)
|
||||
return ret;
|
||||
if ((ret = avfilter_link(last_filter, pad_idx, filter, 0)) < 0)
|
||||
return ret;
|
||||
|
||||
last_filter = filter;
|
||||
pad_idx = 0;
|
||||
av_freep(&pix_fmts);
|
||||
}
|
||||
|
||||
if (ost->frame_rate.num && 0) {
|
||||
@@ -409,14 +352,6 @@ static int configure_output_video_filter(FilterGraph *fg, OutputFilter *ofilter,
|
||||
pad_idx = 0;
|
||||
}
|
||||
|
||||
snprintf(name, sizeof(name), "trim for output stream %d:%d",
|
||||
ost->file_index, ost->index);
|
||||
ret = insert_trim(of->start_time, of->recording_time,
|
||||
&last_filter, &pad_idx, name);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
||||
if ((ret = avfilter_link(last_filter, pad_idx, ofilter->filter, 0)) < 0)
|
||||
return ret;
|
||||
|
||||
@@ -426,7 +361,6 @@ static int configure_output_video_filter(FilterGraph *fg, OutputFilter *ofilter,
|
||||
static int configure_output_audio_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out)
|
||||
{
|
||||
OutputStream *ost = ofilter->ost;
|
||||
OutputFile *of = output_files[ost->file_index];
|
||||
AVCodecContext *codec = ost->st->codec;
|
||||
AVFilterContext *last_filter = out->filter_ctx;
|
||||
int pad_idx = out->pad_idx;
|
||||
@@ -434,14 +368,13 @@ static int configure_output_audio_filter(FilterGraph *fg, OutputFilter *ofilter,
|
||||
char name[255];
|
||||
int ret;
|
||||
|
||||
|
||||
snprintf(name, sizeof(name), "output stream %d:%d", ost->file_index, ost->index);
|
||||
ret = avfilter_graph_create_filter(&ofilter->filter,
|
||||
avfilter_get_by_name("abuffersink"),
|
||||
avfilter_get_by_name("ffabuffersink"),
|
||||
name, NULL, NULL, fg->graph);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
if ((ret = av_opt_set_int(ofilter->filter, "all_channel_counts", 1, AV_OPT_SEARCH_CHILDREN)) < 0)
|
||||
return ret;
|
||||
|
||||
#define AUTO_INSERT_FILTER(opt_name, filter_name, arg) do { \
|
||||
AVFilterContext *filt_ctx; \
|
||||
@@ -524,27 +457,6 @@ static int configure_output_audio_filter(FilterGraph *fg, OutputFilter *ofilter,
|
||||
AUTO_INSERT_FILTER("-vol", "volume", args);
|
||||
}
|
||||
|
||||
if (ost->apad && of->shortest) {
|
||||
char args[256];
|
||||
int i;
|
||||
|
||||
for (i=0; i<of->ctx->nb_streams; i++)
|
||||
if (of->ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO)
|
||||
break;
|
||||
|
||||
if (i<of->ctx->nb_streams) {
|
||||
snprintf(args, sizeof(args), "%s", ost->apad);
|
||||
AUTO_INSERT_FILTER("-apad", "apad", args);
|
||||
}
|
||||
}
|
||||
|
||||
snprintf(name, sizeof(name), "trim for output stream %d:%d",
|
||||
ost->file_index, ost->index);
|
||||
ret = insert_trim(of->start_time, of->recording_time,
|
||||
&last_filter, &pad_idx, name);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if ((ret = avfilter_link(last_filter, pad_idx, ofilter->filter, 0)) < 0)
|
||||
return ret;
|
||||
|
||||
@@ -555,11 +467,11 @@ static int configure_output_audio_filter(FilterGraph *fg, OutputFilter *ofilter,
|
||||
{ \
|
||||
AVFilterContext *ctx = inout->filter_ctx; \
|
||||
AVFilterPad *pads = in ? ctx->input_pads : ctx->output_pads; \
|
||||
int nb_pads = in ? ctx->nb_inputs : ctx->nb_outputs; \
|
||||
int nb_pads = in ? ctx->input_count : ctx->output_count; \
|
||||
AVIOContext *pb; \
|
||||
\
|
||||
if (avio_open_dyn_buf(&pb) < 0) \
|
||||
exit_program(1); \
|
||||
exit(1); \
|
||||
\
|
||||
avio_printf(pb, "%s", ctx->filter->name); \
|
||||
if (nb_pads > 1) \
|
||||
@@ -583,7 +495,9 @@ int configure_output_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOu
|
||||
static int sub2video_prepare(InputStream *ist)
|
||||
{
|
||||
AVFormatContext *avf = input_files[ist->file_index]->ctx;
|
||||
int i, w, h;
|
||||
int i, ret, w, h;
|
||||
uint8_t *image[4];
|
||||
int linesize[4];
|
||||
|
||||
/* Compute the size of the canvas for the subtitles stream.
|
||||
If the subtitles codec has set a size, use it. Otherwise use the
|
||||
@@ -608,37 +522,47 @@ static int sub2video_prepare(InputStream *ist)
|
||||
|
||||
/* rectangles are AV_PIX_FMT_PAL8, but we have no guarantee that the
|
||||
palettes for all rectangles are identical or compatible */
|
||||
ist->resample_pix_fmt = ist->st->codec->pix_fmt = AV_PIX_FMT_RGB32;
|
||||
ist->st->codec->pix_fmt = AV_PIX_FMT_RGB32;
|
||||
|
||||
ist->sub2video.frame = av_frame_alloc();
|
||||
if (!ist->sub2video.frame)
|
||||
ret = av_image_alloc(image, linesize, w, h, AV_PIX_FMT_RGB32, 32);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
memset(image[0], 0, h * linesize[0]);
|
||||
ist->sub2video.ref = avfilter_get_video_buffer_ref_from_arrays(
|
||||
image, linesize, AV_PERM_READ | AV_PERM_PRESERVE,
|
||||
w, h, AV_PIX_FMT_RGB32);
|
||||
if (!ist->sub2video.ref) {
|
||||
av_free(image[0]);
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
|
||||
AVFilterInOut *in)
|
||||
{
|
||||
AVFilterContext *last_filter;
|
||||
const AVFilter *buffer_filt = avfilter_get_by_name("buffer");
|
||||
AVFilterContext *first_filter = in->filter_ctx;
|
||||
AVFilter *filter = avfilter_get_by_name("buffer");
|
||||
InputStream *ist = ifilter->ist;
|
||||
InputFile *f = input_files[ist->file_index];
|
||||
AVRational tb = ist->framerate.num ? av_inv_q(ist->framerate) :
|
||||
ist->st->time_base;
|
||||
AVRational fr = ist->framerate;
|
||||
AVRational fr = ist->framerate.num ? ist->framerate :
|
||||
ist->st->r_frame_rate;
|
||||
AVRational sar;
|
||||
AVBPrint args;
|
||||
char name[255];
|
||||
int ret, pad_idx = 0;
|
||||
int pad_idx = in->pad_idx;
|
||||
int ret;
|
||||
|
||||
if (ist->st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Cannot connect video filter to audio input\n");
|
||||
return AVERROR(EINVAL);
|
||||
if (!ist->framerate.num && ist->st->codec->ticks_per_frame>1) {
|
||||
AVRational codec_fr = av_inv_q(ist->st->codec->time_base);
|
||||
AVRational avg_fr = ist->st->avg_frame_rate;
|
||||
codec_fr.den *= ist->st->codec->ticks_per_frame;
|
||||
if ( codec_fr.num>0 && codec_fr.den>0 && av_q2d(codec_fr) < av_q2d(fr)*0.7
|
||||
&& fabs(1.0 - av_q2d(av_div_q(avg_fr, fr)))>0.1)
|
||||
fr = codec_fr;
|
||||
}
|
||||
|
||||
if (!fr.num)
|
||||
fr = av_guess_frame_rate(input_files[ist->file_index]->ctx, ist->st, NULL);
|
||||
|
||||
if (ist->st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) {
|
||||
ret = sub2video_prepare(ist);
|
||||
if (ret < 0)
|
||||
@@ -662,10 +586,9 @@ static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
|
||||
snprintf(name, sizeof(name), "graph %d input from stream %d:%d", fg->index,
|
||||
ist->file_index, ist->st->index);
|
||||
|
||||
if ((ret = avfilter_graph_create_filter(&ifilter->filter, buffer_filt, name,
|
||||
if ((ret = avfilter_graph_create_filter(&ifilter->filter, filter, name,
|
||||
args.str, NULL, fg->graph)) < 0)
|
||||
return ret;
|
||||
last_filter = ifilter->filter;
|
||||
|
||||
if (ist->framerate.num) {
|
||||
AVFilterContext *setpts;
|
||||
@@ -678,37 +601,14 @@ static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
|
||||
fg->graph)) < 0)
|
||||
return ret;
|
||||
|
||||
if ((ret = avfilter_link(last_filter, 0, setpts, 0)) < 0)
|
||||
if ((ret = avfilter_link(setpts, 0, first_filter, pad_idx)) < 0)
|
||||
return ret;
|
||||
|
||||
last_filter = setpts;
|
||||
first_filter = setpts;
|
||||
pad_idx = 0;
|
||||
}
|
||||
|
||||
if (do_deinterlace) {
|
||||
AVFilterContext *yadif;
|
||||
|
||||
snprintf(name, sizeof(name), "deinterlace input from stream %d:%d",
|
||||
ist->file_index, ist->st->index);
|
||||
if ((ret = avfilter_graph_create_filter(&yadif,
|
||||
avfilter_get_by_name("yadif"),
|
||||
name, "", NULL,
|
||||
fg->graph)) < 0)
|
||||
return ret;
|
||||
|
||||
if ((ret = avfilter_link(last_filter, 0, yadif, 0)) < 0)
|
||||
return ret;
|
||||
|
||||
last_filter = yadif;
|
||||
}
|
||||
|
||||
snprintf(name, sizeof(name), "trim for input stream %d:%d",
|
||||
ist->file_index, ist->st->index);
|
||||
ret = insert_trim(((f->start_time == AV_NOPTS_VALUE) || !f->accurate_seek) ?
|
||||
AV_NOPTS_VALUE : 0, f->recording_time, &last_filter, &pad_idx, name);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if ((ret = avfilter_link(last_filter, 0, in->filter_ctx, in->pad_idx)) < 0)
|
||||
if ((ret = avfilter_link(ifilter->filter, 0, first_filter, pad_idx)) < 0)
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
@@ -716,37 +616,26 @@ static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
|
||||
static int configure_input_audio_filter(FilterGraph *fg, InputFilter *ifilter,
|
||||
AVFilterInOut *in)
|
||||
{
|
||||
AVFilterContext *last_filter;
|
||||
const AVFilter *abuffer_filt = avfilter_get_by_name("abuffer");
|
||||
AVFilterContext *first_filter = in->filter_ctx;
|
||||
AVFilter *filter = avfilter_get_by_name("abuffer");
|
||||
InputStream *ist = ifilter->ist;
|
||||
InputFile *f = input_files[ist->file_index];
|
||||
AVBPrint args;
|
||||
char name[255];
|
||||
int ret, pad_idx = 0;
|
||||
int pad_idx = in->pad_idx;
|
||||
char args[255], name[255];
|
||||
int ret;
|
||||
|
||||
if (ist->st->codec->codec_type != AVMEDIA_TYPE_AUDIO) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Cannot connect audio filter to non audio input\n");
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
av_bprint_init(&args, 0, AV_BPRINT_SIZE_AUTOMATIC);
|
||||
av_bprintf(&args, "time_base=%d/%d:sample_rate=%d:sample_fmt=%s",
|
||||
snprintf(args, sizeof(args), "time_base=%d/%d:sample_rate=%d:sample_fmt=%s"
|
||||
":channel_layout=0x%"PRIx64,
|
||||
1, ist->st->codec->sample_rate,
|
||||
ist->st->codec->sample_rate,
|
||||
av_get_sample_fmt_name(ist->st->codec->sample_fmt));
|
||||
if (ist->st->codec->channel_layout)
|
||||
av_bprintf(&args, ":channel_layout=0x%"PRIx64,
|
||||
ist->st->codec->channel_layout);
|
||||
else
|
||||
av_bprintf(&args, ":channels=%d", ist->st->codec->channels);
|
||||
av_get_sample_fmt_name(ist->st->codec->sample_fmt),
|
||||
ist->st->codec->channel_layout);
|
||||
snprintf(name, sizeof(name), "graph %d input from stream %d:%d", fg->index,
|
||||
ist->file_index, ist->st->index);
|
||||
|
||||
if ((ret = avfilter_graph_create_filter(&ifilter->filter, abuffer_filt,
|
||||
name, args.str, NULL,
|
||||
if ((ret = avfilter_graph_create_filter(&ifilter->filter, filter,
|
||||
name, args, NULL,
|
||||
fg->graph)) < 0)
|
||||
return ret;
|
||||
last_filter = ifilter->filter;
|
||||
|
||||
#define AUTO_INSERT_FILTER_INPUT(opt_name, filter_name, arg) do { \
|
||||
AVFilterContext *filt_ctx; \
|
||||
@@ -762,11 +651,11 @@ static int configure_input_audio_filter(FilterGraph *fg, InputFilter *ifilter,
|
||||
if (ret < 0) \
|
||||
return ret; \
|
||||
\
|
||||
ret = avfilter_link(last_filter, 0, filt_ctx, 0); \
|
||||
ret = avfilter_link(filt_ctx, 0, first_filter, pad_idx); \
|
||||
if (ret < 0) \
|
||||
return ret; \
|
||||
\
|
||||
last_filter = filt_ctx; \
|
||||
first_filter = filt_ctx; \
|
||||
} while (0)
|
||||
|
||||
if (audio_sync_method > 0) {
|
||||
@@ -775,8 +664,6 @@ static int configure_input_audio_filter(FilterGraph *fg, InputFilter *ifilter,
|
||||
av_strlcatf(args, sizeof(args), "async=%d", audio_sync_method);
|
||||
if (audio_drift_threshold != 0.1)
|
||||
av_strlcatf(args, sizeof(args), ":min_hard_comp=%f", audio_drift_threshold);
|
||||
if (!fg->reconfiguration)
|
||||
av_strlcatf(args, sizeof(args), ":first_pts=0");
|
||||
AUTO_INSERT_FILTER_INPUT("-async", "aresample", args);
|
||||
}
|
||||
|
||||
@@ -802,15 +689,7 @@ static int configure_input_audio_filter(FilterGraph *fg, InputFilter *ifilter,
|
||||
snprintf(args, sizeof(args), "%f", audio_volume / 256.);
|
||||
AUTO_INSERT_FILTER_INPUT("-vol", "volume", args);
|
||||
}
|
||||
|
||||
snprintf(name, sizeof(name), "trim for input stream %d:%d",
|
||||
ist->file_index, ist->st->index);
|
||||
ret = insert_trim(((f->start_time == AV_NOPTS_VALUE) || !f->accurate_seek) ?
|
||||
AV_NOPTS_VALUE : 0, f->recording_time, &last_filter, &pad_idx, name);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if ((ret = avfilter_link(last_filter, 0, in->filter_ctx, in->pad_idx)) < 0)
|
||||
if ((ret = avfilter_link(ifilter->filter, 0, first_filter, pad_idx)) < 0)
|
||||
return ret;
|
||||
|
||||
return 0;
|
||||
@@ -842,33 +721,20 @@ int configure_filtergraph(FilterGraph *fg)
|
||||
|
||||
if (simple) {
|
||||
OutputStream *ost = fg->outputs[0]->ost;
|
||||
char args[512];
|
||||
AVDictionaryEntry *e = NULL;
|
||||
|
||||
char args[255];
|
||||
snprintf(args, sizeof(args), "flags=0x%X", (unsigned)ost->sws_flags);
|
||||
fg->graph->scale_sws_opts = av_strdup(args);
|
||||
|
||||
args[0] = 0;
|
||||
while ((e = av_dict_get(ost->swr_opts, "", e,
|
||||
AV_DICT_IGNORE_SUFFIX))) {
|
||||
av_strlcatf(args, sizeof(args), "%s=%s:", e->key, e->value);
|
||||
}
|
||||
if (ost->swr_filter_type != SWR_FILTER_TYPE_KAISER)
|
||||
av_strlcatf(args, sizeof(args), "filter_type=%d:", (int)ost->swr_filter_type);
|
||||
if (ost->swr_dither_method)
|
||||
av_strlcatf(args, sizeof(args), "dither_method=%d:", (int)ost->swr_dither_method);
|
||||
if (ost->swr_dither_scale != 1.0)
|
||||
av_strlcatf(args, sizeof(args), "dither_scale=%f:", ost->swr_dither_scale);
|
||||
if (strlen(args))
|
||||
args[strlen(args)-1] = 0;
|
||||
av_opt_set(fg->graph, "aresample_swr_opts", args, 0);
|
||||
|
||||
args[0] = '\0';
|
||||
while ((e = av_dict_get(fg->outputs[0]->ost->resample_opts, "", e,
|
||||
AV_DICT_IGNORE_SUFFIX))) {
|
||||
av_strlcatf(args, sizeof(args), "%s=%s:", e->key, e->value);
|
||||
}
|
||||
if (strlen(args))
|
||||
args[strlen(args) - 1] = '\0';
|
||||
fg->graph->resample_lavr_opts = av_strdup(args);
|
||||
|
||||
e = av_dict_get(ost->opts, "threads", NULL, 0);
|
||||
if (e)
|
||||
av_opt_set(fg->graph, "threads", e->value, 0);
|
||||
}
|
||||
|
||||
if ((ret = avfilter_graph_parse2(fg->graph, graph_desc, &inputs, &outputs)) < 0)
|
||||
@@ -902,7 +768,7 @@ int configure_filtergraph(FilterGraph *fg)
|
||||
for (cur = outputs; cur;) {
|
||||
GROW_ARRAY(fg->outputs, fg->nb_outputs);
|
||||
if (!(fg->outputs[fg->nb_outputs - 1] = av_mallocz(sizeof(*fg->outputs[0]))))
|
||||
exit_program(1);
|
||||
exit(1);
|
||||
fg->outputs[fg->nb_outputs - 1]->graph = fg;
|
||||
fg->outputs[fg->nb_outputs - 1]->out_tmp = cur;
|
||||
cur = cur->next;
|
||||
@@ -910,7 +776,6 @@ int configure_filtergraph(FilterGraph *fg)
|
||||
}
|
||||
}
|
||||
|
||||
fg->reconfiguration = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
798
ffmpeg_opt.c
798
ffmpeg_opt.c
File diff suppressed because it is too large
Load Diff
547
ffprobe.c
547
ffprobe.c
@@ -37,9 +37,7 @@
|
||||
#include "libavutil/pixdesc.h"
|
||||
#include "libavutil/dict.h"
|
||||
#include "libavutil/libm.h"
|
||||
#include "libavutil/parseutils.h"
|
||||
#include "libavutil/timecode.h"
|
||||
#include "libavutil/timestamp.h"
|
||||
#include "libavdevice/avdevice.h"
|
||||
#include "libswscale/swscale.h"
|
||||
#include "libswresample/swresample.h"
|
||||
@@ -54,12 +52,10 @@ static int do_count_frames = 0;
|
||||
static int do_count_packets = 0;
|
||||
static int do_read_frames = 0;
|
||||
static int do_read_packets = 0;
|
||||
static int do_show_chapters = 0;
|
||||
static int do_show_error = 0;
|
||||
static int do_show_format = 0;
|
||||
static int do_show_frames = 0;
|
||||
static int do_show_packets = 0;
|
||||
static int do_show_programs = 0;
|
||||
static int do_show_streams = 0;
|
||||
static int do_show_stream_disposition = 0;
|
||||
static int do_show_data = 0;
|
||||
@@ -75,17 +71,6 @@ static int show_private_data = 1;
|
||||
static char *print_format;
|
||||
static char *stream_specifier;
|
||||
|
||||
typedef struct {
|
||||
int id; ///< identifier
|
||||
int64_t start, end; ///< start, end in second/AV_TIME_BASE units
|
||||
int has_start, has_end;
|
||||
int start_is_offset, end_is_offset;
|
||||
int duration_frames;
|
||||
} ReadInterval;
|
||||
|
||||
static ReadInterval *read_intervals;
|
||||
static int read_intervals_nb = 0;
|
||||
|
||||
/* section structure definition */
|
||||
|
||||
#define SECTION_MAX_NB_CHILDREN 10
|
||||
@@ -108,9 +93,6 @@ struct section {
|
||||
|
||||
typedef enum {
|
||||
SECTION_ID_NONE = -1,
|
||||
SECTION_ID_CHAPTER,
|
||||
SECTION_ID_CHAPTER_TAGS,
|
||||
SECTION_ID_CHAPTERS,
|
||||
SECTION_ID_ERROR,
|
||||
SECTION_ID_FORMAT,
|
||||
SECTION_ID_FORMAT_TAGS,
|
||||
@@ -122,14 +104,7 @@ typedef enum {
|
||||
SECTION_ID_PACKET,
|
||||
SECTION_ID_PACKETS,
|
||||
SECTION_ID_PACKETS_AND_FRAMES,
|
||||
SECTION_ID_PROGRAM_STREAM_DISPOSITION,
|
||||
SECTION_ID_PROGRAM_STREAM_TAGS,
|
||||
SECTION_ID_PROGRAM,
|
||||
SECTION_ID_PROGRAM_STREAMS,
|
||||
SECTION_ID_PROGRAM_STREAM,
|
||||
SECTION_ID_PROGRAM_TAGS,
|
||||
SECTION_ID_PROGRAM_VERSION,
|
||||
SECTION_ID_PROGRAMS,
|
||||
SECTION_ID_ROOT,
|
||||
SECTION_ID_STREAM,
|
||||
SECTION_ID_STREAM_DISPOSITION,
|
||||
@@ -138,9 +113,6 @@ typedef enum {
|
||||
} SectionID;
|
||||
|
||||
static struct section sections[] = {
|
||||
[SECTION_ID_CHAPTERS] = { SECTION_ID_CHAPTERS, "chapters", SECTION_FLAG_IS_ARRAY, { SECTION_ID_CHAPTER, -1 } },
|
||||
[SECTION_ID_CHAPTER] = { SECTION_ID_CHAPTER, "chapter", 0, { SECTION_ID_CHAPTER_TAGS, -1 } },
|
||||
[SECTION_ID_CHAPTER_TAGS] = { SECTION_ID_CHAPTER_TAGS, "tags", SECTION_FLAG_HAS_VARIABLE_FIELDS, { -1 }, .element_name = "tag", .unique_name = "chapter_tags" },
|
||||
[SECTION_ID_ERROR] = { SECTION_ID_ERROR, "error", 0, { -1 } },
|
||||
[SECTION_ID_FORMAT] = { SECTION_ID_FORMAT, "format", 0, { SECTION_ID_FORMAT_TAGS, -1 } },
|
||||
[SECTION_ID_FORMAT_TAGS] = { SECTION_ID_FORMAT_TAGS, "tags", SECTION_FLAG_HAS_VARIABLE_FIELDS, { -1 }, .element_name = "tag", .unique_name = "format_tags" },
|
||||
@@ -152,17 +124,10 @@ static struct section sections[] = {
|
||||
[SECTION_ID_PACKETS] = { SECTION_ID_PACKETS, "packets", SECTION_FLAG_IS_ARRAY, { SECTION_ID_PACKET, -1} },
|
||||
[SECTION_ID_PACKETS_AND_FRAMES] = { SECTION_ID_PACKETS_AND_FRAMES, "packets_and_frames", SECTION_FLAG_IS_ARRAY, { SECTION_ID_PACKET, -1} },
|
||||
[SECTION_ID_PACKET] = { SECTION_ID_PACKET, "packet", 0, { -1 } },
|
||||
[SECTION_ID_PROGRAM_STREAM_DISPOSITION] = { SECTION_ID_PROGRAM_STREAM_DISPOSITION, "disposition", 0, { -1 }, .unique_name = "program_stream_disposition" },
|
||||
[SECTION_ID_PROGRAM_STREAM_TAGS] = { SECTION_ID_PROGRAM_STREAM_TAGS, "tags", SECTION_FLAG_HAS_VARIABLE_FIELDS, { -1 }, .element_name = "tag", .unique_name = "program_stream_tags" },
|
||||
[SECTION_ID_PROGRAM] = { SECTION_ID_PROGRAM, "program", 0, { SECTION_ID_PROGRAM_TAGS, SECTION_ID_PROGRAM_STREAMS, -1 } },
|
||||
[SECTION_ID_PROGRAM_STREAMS] = { SECTION_ID_PROGRAM_STREAMS, "streams", SECTION_FLAG_IS_ARRAY, { SECTION_ID_PROGRAM_STREAM, -1 }, .unique_name = "program_streams" },
|
||||
[SECTION_ID_PROGRAM_STREAM] = { SECTION_ID_PROGRAM_STREAM, "stream", 0, { SECTION_ID_PROGRAM_STREAM_DISPOSITION, SECTION_ID_PROGRAM_STREAM_TAGS, -1 }, .unique_name = "program_stream" },
|
||||
[SECTION_ID_PROGRAM_TAGS] = { SECTION_ID_PROGRAM_TAGS, "tags", SECTION_FLAG_HAS_VARIABLE_FIELDS, { -1 }, .element_name = "tag", .unique_name = "program_tags" },
|
||||
[SECTION_ID_PROGRAM_VERSION] = { SECTION_ID_PROGRAM_VERSION, "program_version", 0, { -1 } },
|
||||
[SECTION_ID_PROGRAMS] = { SECTION_ID_PROGRAMS, "programs", SECTION_FLAG_IS_ARRAY, { SECTION_ID_PROGRAM, -1 } },
|
||||
[SECTION_ID_ROOT] = { SECTION_ID_ROOT, "root", SECTION_FLAG_IS_WRAPPER,
|
||||
{ SECTION_ID_CHAPTERS, SECTION_ID_FORMAT, SECTION_ID_FRAMES, SECTION_ID_PROGRAMS, SECTION_ID_STREAMS,
|
||||
SECTION_ID_PACKETS, SECTION_ID_ERROR, SECTION_ID_PROGRAM_VERSION, SECTION_ID_LIBRARY_VERSIONS, -1} },
|
||||
{ SECTION_ID_FORMAT, SECTION_ID_FRAMES, SECTION_ID_STREAMS, SECTION_ID_PACKETS,
|
||||
SECTION_ID_ERROR, SECTION_ID_PROGRAM_VERSION, SECTION_ID_LIBRARY_VERSIONS, -1} },
|
||||
[SECTION_ID_STREAMS] = { SECTION_ID_STREAMS, "streams", SECTION_FLAG_IS_ARRAY, { SECTION_ID_STREAM, -1 } },
|
||||
[SECTION_ID_STREAM] = { SECTION_ID_STREAM, "stream", 0, { SECTION_ID_STREAM_DISPOSITION, SECTION_ID_STREAM_TAGS, -1 } },
|
||||
[SECTION_ID_STREAM_DISPOSITION] = { SECTION_ID_STREAM_DISPOSITION, "disposition", 0, { -1 }, .unique_name = "stream_disposition" },
|
||||
@@ -187,7 +152,7 @@ static uint64_t *nb_streams_packets;
|
||||
static uint64_t *nb_streams_frames;
|
||||
static int *selected_streams;
|
||||
|
||||
static void ffprobe_cleanup(int ret)
|
||||
static void exit_program(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < FF_ARRAY_ELEMS(sections); i++)
|
||||
@@ -335,7 +300,7 @@ static int writer_open(WriterContext **wctx, const Writer *writer, const char *a
|
||||
{
|
||||
int i, ret = 0;
|
||||
|
||||
if (!(*wctx = av_mallocz(sizeof(WriterContext)))) {
|
||||
if (!(*wctx = av_malloc(sizeof(WriterContext)))) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto fail;
|
||||
}
|
||||
@@ -703,8 +668,6 @@ typedef struct CompactContext {
|
||||
char *escape_mode_str;
|
||||
const char * (*escape_str)(AVBPrint *dst, const char *src, const char sep, void *log_ctx);
|
||||
int nested_section[SECTION_MAX_NB_LEVELS];
|
||||
int has_nested_elems[SECTION_MAX_NB_LEVELS];
|
||||
int terminate_line[SECTION_MAX_NB_LEVELS];
|
||||
} CompactContext;
|
||||
|
||||
#undef OFFSET
|
||||
@@ -752,28 +715,18 @@ static void compact_print_section_header(WriterContext *wctx)
|
||||
const struct section *section = wctx->section[wctx->level];
|
||||
const struct section *parent_section = wctx->level ?
|
||||
wctx->section[wctx->level-1] : NULL;
|
||||
compact->terminate_line[wctx->level] = 1;
|
||||
compact->has_nested_elems[wctx->level] = 0;
|
||||
|
||||
av_bprint_clear(&wctx->section_pbuf[wctx->level]);
|
||||
if (!(section->flags & SECTION_FLAG_IS_ARRAY) && parent_section &&
|
||||
if (parent_section &&
|
||||
!(parent_section->flags & (SECTION_FLAG_IS_WRAPPER|SECTION_FLAG_IS_ARRAY))) {
|
||||
compact->nested_section[wctx->level] = 1;
|
||||
compact->has_nested_elems[wctx->level-1] = 1;
|
||||
av_bprintf(&wctx->section_pbuf[wctx->level], "%s%s:",
|
||||
wctx->section_pbuf[wctx->level-1].str,
|
||||
(char *)av_x_if_null(section->element_name, section->name));
|
||||
wctx->nb_item[wctx->level] = wctx->nb_item[wctx->level-1];
|
||||
} else {
|
||||
if (parent_section && compact->has_nested_elems[wctx->level-1] &&
|
||||
(section->flags & SECTION_FLAG_IS_ARRAY)) {
|
||||
compact->terminate_line[wctx->level-1] = 0;
|
||||
printf("\n");
|
||||
}
|
||||
if (compact->print_section &&
|
||||
!(section->flags & (SECTION_FLAG_IS_WRAPPER|SECTION_FLAG_IS_ARRAY)))
|
||||
printf("%s%c", section->name, compact->item_sep);
|
||||
}
|
||||
} else if (compact->print_section &&
|
||||
!(section->flags & (SECTION_FLAG_IS_WRAPPER|SECTION_FLAG_IS_ARRAY)))
|
||||
printf("%s%c", section->name, compact->item_sep);
|
||||
}
|
||||
|
||||
static void compact_print_section_footer(WriterContext *wctx)
|
||||
@@ -781,7 +734,6 @@ static void compact_print_section_footer(WriterContext *wctx)
|
||||
CompactContext *compact = wctx->priv;
|
||||
|
||||
if (!compact->nested_section[wctx->level] &&
|
||||
compact->terminate_line[wctx->level] &&
|
||||
!(wctx->section[wctx->level]->flags & (SECTION_FLAG_IS_WRAPPER|SECTION_FLAG_IS_ARRAY)))
|
||||
printf("\n");
|
||||
}
|
||||
@@ -1520,11 +1472,11 @@ static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream,
|
||||
print_time("pkt_pts_time", frame->pkt_pts, &stream->time_base);
|
||||
print_ts ("pkt_dts", frame->pkt_dts);
|
||||
print_time("pkt_dts_time", frame->pkt_dts, &stream->time_base);
|
||||
print_duration_ts ("pkt_duration", av_frame_get_pkt_duration(frame));
|
||||
print_duration_time("pkt_duration_time", av_frame_get_pkt_duration(frame), &stream->time_base);
|
||||
if (av_frame_get_pkt_pos (frame) != -1) print_fmt ("pkt_pos", "%"PRId64, av_frame_get_pkt_pos(frame));
|
||||
print_duration_ts ("pkt_duration", frame->pkt_duration);
|
||||
print_duration_time("pkt_duration_time", frame->pkt_duration, &stream->time_base);
|
||||
if (frame->pkt_pos != -1) print_fmt ("pkt_pos", "%"PRId64, frame->pkt_pos);
|
||||
else print_str_opt("pkt_pos", "N/A");
|
||||
if (av_frame_get_pkt_size(frame) != -1) print_fmt ("pkt_size", "%d", av_frame_get_pkt_size(frame));
|
||||
if (frame->pkt_size != -1) print_fmt ("pkt_size", "%d", av_frame_get_pkt_size(frame));
|
||||
else print_str_opt("pkt_size", "N/A");
|
||||
|
||||
switch (stream->codec->codec_type) {
|
||||
@@ -1548,6 +1500,7 @@ static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream,
|
||||
print_int("interlaced_frame", frame->interlaced_frame);
|
||||
print_int("top_field_first", frame->top_field_first);
|
||||
print_int("repeat_pict", frame->repeat_pict);
|
||||
print_int("reference", frame->reference);
|
||||
break;
|
||||
|
||||
case AVMEDIA_TYPE_AUDIO:
|
||||
@@ -1606,93 +1559,16 @@ static av_always_inline int process_frame(WriterContext *w,
|
||||
return got_frame;
|
||||
}
|
||||
|
||||
static void log_read_interval(const ReadInterval *interval, void *log_ctx, int log_level)
|
||||
{
|
||||
av_log(log_ctx, log_level, "id:%d", interval->id);
|
||||
|
||||
if (interval->has_start) {
|
||||
av_log(log_ctx, log_level, " start:%s%s", interval->start_is_offset ? "+" : "",
|
||||
av_ts2timestr(interval->start, &AV_TIME_BASE_Q));
|
||||
} else {
|
||||
av_log(log_ctx, log_level, " start:N/A");
|
||||
}
|
||||
|
||||
if (interval->has_end) {
|
||||
av_log(log_ctx, log_level, " end:%s", interval->end_is_offset ? "+" : "");
|
||||
if (interval->duration_frames)
|
||||
av_log(log_ctx, log_level, "#%"PRId64, interval->end);
|
||||
else
|
||||
av_log(log_ctx, log_level, "%s", av_ts2timestr(interval->end, &AV_TIME_BASE_Q));
|
||||
} else {
|
||||
av_log(log_ctx, log_level, " end:N/A");
|
||||
}
|
||||
|
||||
av_log(log_ctx, log_level, "\n");
|
||||
}
|
||||
|
||||
static int read_interval_packets(WriterContext *w, AVFormatContext *fmt_ctx,
|
||||
const ReadInterval *interval, int64_t *cur_ts)
|
||||
static void read_packets(WriterContext *w, AVFormatContext *fmt_ctx)
|
||||
{
|
||||
AVPacket pkt, pkt1;
|
||||
AVFrame frame;
|
||||
int ret = 0, i = 0, frame_count = 0;
|
||||
int64_t start = -INT64_MAX, end = interval->end;
|
||||
int has_start = 0, has_end = interval->has_end && !interval->end_is_offset;
|
||||
int i = 0;
|
||||
|
||||
av_init_packet(&pkt);
|
||||
|
||||
av_log(NULL, AV_LOG_VERBOSE, "Processing read interval ");
|
||||
log_read_interval(interval, NULL, AV_LOG_VERBOSE);
|
||||
|
||||
if (interval->has_start) {
|
||||
int64_t target;
|
||||
if (interval->start_is_offset) {
|
||||
if (*cur_ts == AV_NOPTS_VALUE) {
|
||||
av_log(NULL, AV_LOG_ERROR,
|
||||
"Could not seek to relative position since current "
|
||||
"timestamp is not defined\n");
|
||||
ret = AVERROR(EINVAL);
|
||||
goto end;
|
||||
}
|
||||
target = *cur_ts + interval->start;
|
||||
} else {
|
||||
target = interval->start;
|
||||
}
|
||||
|
||||
av_log(NULL, AV_LOG_VERBOSE, "Seeking to read interval start point %s\n",
|
||||
av_ts2timestr(target, &AV_TIME_BASE_Q));
|
||||
if ((ret = avformat_seek_file(fmt_ctx, -1, -INT64_MAX, target, INT64_MAX, 0)) < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Could not seek to position %"PRId64": %s\n",
|
||||
interval->start, av_err2str(ret));
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
while (!av_read_frame(fmt_ctx, &pkt)) {
|
||||
if (selected_streams[pkt.stream_index]) {
|
||||
AVRational tb = fmt_ctx->streams[pkt.stream_index]->time_base;
|
||||
|
||||
if (pkt.pts != AV_NOPTS_VALUE)
|
||||
*cur_ts = av_rescale_q(pkt.pts, tb, AV_TIME_BASE_Q);
|
||||
|
||||
if (!has_start && *cur_ts != AV_NOPTS_VALUE) {
|
||||
start = *cur_ts;
|
||||
has_start = 1;
|
||||
}
|
||||
|
||||
if (has_start && !has_end && interval->end_is_offset) {
|
||||
end = start + interval->end;
|
||||
has_end = 1;
|
||||
}
|
||||
|
||||
if (interval->end_is_offset && interval->duration_frames) {
|
||||
if (frame_count >= interval->end)
|
||||
break;
|
||||
} else if (has_end && *cur_ts != AV_NOPTS_VALUE && *cur_ts >= end) {
|
||||
break;
|
||||
}
|
||||
|
||||
frame_count++;
|
||||
if (do_read_packets) {
|
||||
if (do_show_packets)
|
||||
show_packet(w, fmt_ctx, &pkt, i++);
|
||||
@@ -1714,33 +1590,9 @@ static int read_interval_packets(WriterContext *w, AVFormatContext *fmt_ctx,
|
||||
if (do_read_frames)
|
||||
while (process_frame(w, fmt_ctx, &frame, &pkt) > 0);
|
||||
}
|
||||
|
||||
end:
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Could not read packets in interval ");
|
||||
log_read_interval(interval, NULL, AV_LOG_ERROR);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void read_packets(WriterContext *w, AVFormatContext *fmt_ctx)
|
||||
{
|
||||
int i, ret = 0;
|
||||
int64_t cur_ts = fmt_ctx->start_time;
|
||||
|
||||
if (read_intervals_nb == 0) {
|
||||
ReadInterval interval = (ReadInterval) { .has_start = 0, .has_end = 0 };
|
||||
ret = read_interval_packets(w, fmt_ctx, &interval, &cur_ts);
|
||||
} else {
|
||||
for (i = 0; i < read_intervals_nb; i++) {
|
||||
ret = read_interval_packets(w, fmt_ctx, &read_intervals[i], &cur_ts);
|
||||
if (ret < 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_idx, int in_program)
|
||||
static void show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_idx)
|
||||
{
|
||||
AVStream *stream = fmt_ctx->streams[stream_idx];
|
||||
AVCodecContext *dec_ctx;
|
||||
@@ -1752,7 +1604,7 @@ static void show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_i
|
||||
|
||||
av_bprint_init(&pbuf, 1, AV_BPRINT_SIZE_UNLIMITED);
|
||||
|
||||
writer_print_section_header(w, in_program ? SECTION_ID_PROGRAM_STREAM : SECTION_ID_STREAM);
|
||||
writer_print_section_header(w, SECTION_ID_STREAM);
|
||||
|
||||
print_int("index", stream->index);
|
||||
|
||||
@@ -1823,28 +1675,8 @@ static void show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_i
|
||||
else print_str_opt("sample_fmt", "unknown");
|
||||
print_val("sample_rate", dec_ctx->sample_rate, unit_hertz_str);
|
||||
print_int("channels", dec_ctx->channels);
|
||||
|
||||
if (dec_ctx->channel_layout) {
|
||||
av_bprint_clear(&pbuf);
|
||||
av_bprint_channel_layout(&pbuf, dec_ctx->channels, dec_ctx->channel_layout);
|
||||
print_str ("channel_layout", pbuf.str);
|
||||
} else {
|
||||
print_str_opt("channel_layout", "unknown");
|
||||
}
|
||||
|
||||
print_int("bits_per_sample", av_get_bits_per_sample(dec_ctx->codec_id));
|
||||
break;
|
||||
|
||||
case AVMEDIA_TYPE_SUBTITLE:
|
||||
if (dec_ctx->width)
|
||||
print_int("width", dec_ctx->width);
|
||||
else
|
||||
print_str_opt("width", "N/A");
|
||||
if (dec_ctx->height)
|
||||
print_int("height", dec_ctx->height);
|
||||
else
|
||||
print_str_opt("height", "N/A");
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
print_str_opt("codec_type", "unknown");
|
||||
@@ -1888,7 +1720,7 @@ static void show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_i
|
||||
} while (0)
|
||||
|
||||
if (do_show_stream_disposition) {
|
||||
writer_print_section_header(w, in_program ? SECTION_ID_PROGRAM_STREAM_DISPOSITION : SECTION_ID_STREAM_DISPOSITION);
|
||||
writer_print_section_header(w, SECTION_ID_STREAM_DISPOSITION);
|
||||
PRINT_DISPOSITION(DEFAULT, "default");
|
||||
PRINT_DISPOSITION(DUB, "dub");
|
||||
PRINT_DISPOSITION(ORIGINAL, "original");
|
||||
@@ -1903,7 +1735,7 @@ static void show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_i
|
||||
writer_print_section_footer(w);
|
||||
}
|
||||
|
||||
show_tags(w, stream->metadata, in_program ? SECTION_ID_PROGRAM_STREAM_TAGS : SECTION_ID_STREAM_TAGS);
|
||||
show_tags(w, stream->metadata, SECTION_ID_STREAM_TAGS);
|
||||
|
||||
writer_print_section_footer(w);
|
||||
av_bprint_finalize(&pbuf, NULL);
|
||||
@@ -1916,68 +1748,7 @@ static void show_streams(WriterContext *w, AVFormatContext *fmt_ctx)
|
||||
writer_print_section_header(w, SECTION_ID_STREAMS);
|
||||
for (i = 0; i < fmt_ctx->nb_streams; i++)
|
||||
if (selected_streams[i])
|
||||
show_stream(w, fmt_ctx, i, 0);
|
||||
writer_print_section_footer(w);
|
||||
}
|
||||
|
||||
static void show_program(WriterContext *w, AVFormatContext *fmt_ctx, AVProgram *program)
|
||||
{
|
||||
int i;
|
||||
|
||||
writer_print_section_header(w, SECTION_ID_PROGRAM);
|
||||
print_int("program_id", program->id);
|
||||
print_int("program_num", program->program_num);
|
||||
print_int("nb_streams", program->nb_stream_indexes);
|
||||
print_int("pmt_pid", program->pmt_pid);
|
||||
print_int("pcr_pid", program->pcr_pid);
|
||||
print_ts("start_pts", program->start_time);
|
||||
print_time("start_time", program->start_time, &AV_TIME_BASE_Q);
|
||||
print_ts("end_pts", program->end_time);
|
||||
print_time("end_time", program->end_time, &AV_TIME_BASE_Q);
|
||||
show_tags(w, program->metadata, SECTION_ID_PROGRAM_TAGS);
|
||||
|
||||
writer_print_section_header(w, SECTION_ID_PROGRAM_STREAMS);
|
||||
for (i = 0; i < program->nb_stream_indexes; i++) {
|
||||
if (selected_streams[program->stream_index[i]])
|
||||
show_stream(w, fmt_ctx, program->stream_index[i], 1);
|
||||
}
|
||||
writer_print_section_footer(w);
|
||||
|
||||
writer_print_section_footer(w);
|
||||
}
|
||||
|
||||
static void show_programs(WriterContext *w, AVFormatContext *fmt_ctx)
|
||||
{
|
||||
int i;
|
||||
|
||||
writer_print_section_header(w, SECTION_ID_PROGRAMS);
|
||||
for (i = 0; i < fmt_ctx->nb_programs; i++) {
|
||||
AVProgram *program = fmt_ctx->programs[i];
|
||||
if (!program)
|
||||
continue;
|
||||
show_program(w, fmt_ctx, program);
|
||||
}
|
||||
writer_print_section_footer(w);
|
||||
}
|
||||
|
||||
static void show_chapters(WriterContext *w, AVFormatContext *fmt_ctx)
|
||||
{
|
||||
int i;
|
||||
|
||||
writer_print_section_header(w, SECTION_ID_CHAPTERS);
|
||||
for (i = 0; i < fmt_ctx->nb_chapters; i++) {
|
||||
AVChapter *chapter = fmt_ctx->chapters[i];
|
||||
|
||||
writer_print_section_header(w, SECTION_ID_CHAPTER);
|
||||
print_int("id", chapter->id);
|
||||
print_q ("time_base", chapter->time_base, '/');
|
||||
print_int("start", chapter->start);
|
||||
print_time("start_time", chapter->start, &chapter->time_base);
|
||||
print_int("end", chapter->end);
|
||||
print_time("end_time", chapter->end, &chapter->time_base);
|
||||
show_tags(w, chapter->metadata, SECTION_ID_CHAPTER_TAGS);
|
||||
writer_print_section_footer(w);
|
||||
}
|
||||
show_stream(w, fmt_ctx, i);
|
||||
writer_print_section_footer(w);
|
||||
}
|
||||
|
||||
@@ -1989,7 +1760,6 @@ static void show_format(WriterContext *w, AVFormatContext *fmt_ctx)
|
||||
writer_print_section_header(w, SECTION_ID_FORMAT);
|
||||
print_str("filename", fmt_ctx->filename);
|
||||
print_int("nb_streams", fmt_ctx->nb_streams);
|
||||
print_int("nb_programs", fmt_ctx->nb_programs);
|
||||
print_str("format_name", fmt_ctx->iformat->name);
|
||||
if (!do_bitexact) {
|
||||
if (fmt_ctx->iformat->long_name) print_str ("format_long_name", fmt_ctx->iformat->long_name);
|
||||
@@ -2001,7 +1771,6 @@ static void show_format(WriterContext *w, AVFormatContext *fmt_ctx)
|
||||
else print_str_opt("size", "N/A");
|
||||
if (fmt_ctx->bit_rate > 0) print_val ("bit_rate", fmt_ctx->bit_rate, unit_bit_per_second_str);
|
||||
else print_str_opt("bit_rate", "N/A");
|
||||
print_int("probe_score", av_format_get_probe_score(fmt_ctx));
|
||||
show_tags(w, fmt_ctx->metadata, SECTION_ID_FORMAT_TAGS);
|
||||
|
||||
writer_print_section_footer(w);
|
||||
@@ -2024,10 +1793,9 @@ static void show_error(WriterContext *w, int err)
|
||||
|
||||
static int open_input_file(AVFormatContext **fmt_ctx_ptr, const char *filename)
|
||||
{
|
||||
int err, i, orig_nb_streams;
|
||||
int err, i;
|
||||
AVFormatContext *fmt_ctx = NULL;
|
||||
AVDictionaryEntry *t;
|
||||
AVDictionary **opts;
|
||||
|
||||
if ((err = avformat_open_input(&fmt_ctx, filename,
|
||||
iformat, &format_opts)) < 0) {
|
||||
@@ -2039,17 +1807,12 @@ static int open_input_file(AVFormatContext **fmt_ctx_ptr, const char *filename)
|
||||
return AVERROR_OPTION_NOT_FOUND;
|
||||
}
|
||||
|
||||
/* fill the streams in the format context */
|
||||
opts = setup_find_stream_info_opts(fmt_ctx, codec_opts);
|
||||
orig_nb_streams = fmt_ctx->nb_streams;
|
||||
|
||||
if ((err = avformat_find_stream_info(fmt_ctx, opts)) < 0) {
|
||||
/* fill the streams in the format context */
|
||||
if ((err = avformat_find_stream_info(fmt_ctx, NULL)) < 0) {
|
||||
print_error(filename, err);
|
||||
return err;
|
||||
}
|
||||
for (i = 0; i < orig_nb_streams; i++)
|
||||
av_dict_free(&opts[i]);
|
||||
av_freep(&opts);
|
||||
|
||||
av_dump_format(fmt_ctx, 0, filename, 0);
|
||||
|
||||
@@ -2059,25 +1822,16 @@ static int open_input_file(AVFormatContext **fmt_ctx_ptr, const char *filename)
|
||||
AVCodec *codec;
|
||||
|
||||
if (stream->codec->codec_id == AV_CODEC_ID_PROBE) {
|
||||
av_log(NULL, AV_LOG_WARNING,
|
||||
av_log(NULL, AV_LOG_ERROR,
|
||||
"Failed to probe codec for input stream %d\n",
|
||||
stream->index);
|
||||
} else if (!(codec = avcodec_find_decoder(stream->codec->codec_id))) {
|
||||
av_log(NULL, AV_LOG_WARNING,
|
||||
av_log(NULL, AV_LOG_ERROR,
|
||||
"Unsupported codec with id %d for input stream %d\n",
|
||||
stream->codec->codec_id, stream->index);
|
||||
} else {
|
||||
AVDictionary *opts = filter_codec_opts(codec_opts, stream->codec->codec_id,
|
||||
fmt_ctx, stream, codec);
|
||||
if (avcodec_open2(stream->codec, codec, &opts) < 0) {
|
||||
av_log(NULL, AV_LOG_WARNING, "Could not open codec for input stream %d\n",
|
||||
stream->index);
|
||||
}
|
||||
if ((t = av_dict_get(opts, "", NULL, AV_DICT_IGNORE_SUFFIX))) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Option %s for input stream %d not found\n",
|
||||
t->key, stream->index);
|
||||
return AVERROR_OPTION_NOT_FOUND;
|
||||
}
|
||||
} else if (avcodec_open2(stream->codec, codec, NULL) < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Error while opening codec for input stream %d\n",
|
||||
stream->index);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2108,57 +1862,50 @@ static int probe_file(WriterContext *wctx, const char *filename)
|
||||
do_read_packets = do_show_packets || do_count_packets;
|
||||
|
||||
ret = open_input_file(&fmt_ctx, filename);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
if (ret >= 0) {
|
||||
nb_streams_frames = av_calloc(fmt_ctx->nb_streams, sizeof(*nb_streams_frames));
|
||||
nb_streams_packets = av_calloc(fmt_ctx->nb_streams, sizeof(*nb_streams_packets));
|
||||
selected_streams = av_calloc(fmt_ctx->nb_streams, sizeof(*selected_streams));
|
||||
|
||||
nb_streams_frames = av_calloc(fmt_ctx->nb_streams, sizeof(*nb_streams_frames));
|
||||
nb_streams_packets = av_calloc(fmt_ctx->nb_streams, sizeof(*nb_streams_packets));
|
||||
selected_streams = av_calloc(fmt_ctx->nb_streams, sizeof(*selected_streams));
|
||||
|
||||
for (i = 0; i < fmt_ctx->nb_streams; i++) {
|
||||
if (stream_specifier) {
|
||||
ret = avformat_match_stream_specifier(fmt_ctx,
|
||||
fmt_ctx->streams[i],
|
||||
stream_specifier);
|
||||
if (ret < 0)
|
||||
goto end;
|
||||
else
|
||||
selected_streams[i] = ret;
|
||||
ret = 0;
|
||||
} else {
|
||||
selected_streams[i] = 1;
|
||||
for (i = 0; i < fmt_ctx->nb_streams; i++) {
|
||||
if (stream_specifier) {
|
||||
ret = avformat_match_stream_specifier(fmt_ctx,
|
||||
fmt_ctx->streams[i],
|
||||
stream_specifier);
|
||||
if (ret < 0)
|
||||
goto end;
|
||||
else
|
||||
selected_streams[i] = ret;
|
||||
} else {
|
||||
selected_streams[i] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (do_read_frames || do_read_packets) {
|
||||
if (do_show_frames && do_show_packets &&
|
||||
wctx->writer->flags & WRITER_FLAG_PUT_PACKETS_AND_FRAMES_IN_SAME_CHAPTER)
|
||||
section_id = SECTION_ID_PACKETS_AND_FRAMES;
|
||||
else if (do_show_packets && !do_show_frames)
|
||||
section_id = SECTION_ID_PACKETS;
|
||||
else // (!do_show_packets && do_show_frames)
|
||||
section_id = SECTION_ID_FRAMES;
|
||||
if (do_show_frames || do_show_packets)
|
||||
writer_print_section_header(wctx, section_id);
|
||||
read_packets(wctx, fmt_ctx);
|
||||
if (do_show_frames || do_show_packets)
|
||||
writer_print_section_footer(wctx);
|
||||
}
|
||||
if (do_show_streams)
|
||||
show_streams(wctx, fmt_ctx);
|
||||
if (do_show_format)
|
||||
show_format(wctx, fmt_ctx);
|
||||
|
||||
end:
|
||||
close_input_file(&fmt_ctx);
|
||||
av_freep(&nb_streams_frames);
|
||||
av_freep(&nb_streams_packets);
|
||||
av_freep(&selected_streams);
|
||||
}
|
||||
|
||||
if (do_read_frames || do_read_packets) {
|
||||
if (do_show_frames && do_show_packets &&
|
||||
wctx->writer->flags & WRITER_FLAG_PUT_PACKETS_AND_FRAMES_IN_SAME_CHAPTER)
|
||||
section_id = SECTION_ID_PACKETS_AND_FRAMES;
|
||||
else if (do_show_packets && !do_show_frames)
|
||||
section_id = SECTION_ID_PACKETS;
|
||||
else // (!do_show_packets && do_show_frames)
|
||||
section_id = SECTION_ID_FRAMES;
|
||||
if (do_show_frames || do_show_packets)
|
||||
writer_print_section_header(wctx, section_id);
|
||||
read_packets(wctx, fmt_ctx);
|
||||
if (do_show_frames || do_show_packets)
|
||||
writer_print_section_footer(wctx);
|
||||
}
|
||||
if (do_show_programs)
|
||||
show_programs(wctx, fmt_ctx);
|
||||
if (do_show_streams)
|
||||
show_streams(wctx, fmt_ctx);
|
||||
if (do_show_chapters)
|
||||
show_chapters(wctx, fmt_ctx);
|
||||
if (do_show_format)
|
||||
show_format(wctx, fmt_ctx);
|
||||
|
||||
end:
|
||||
close_input_file(&fmt_ctx);
|
||||
av_freep(&nb_streams_frames);
|
||||
av_freep(&nb_streams_packets);
|
||||
av_freep(&selected_streams);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -2329,7 +2076,7 @@ static void opt_input_file(void *optctx, const char *arg)
|
||||
av_log(NULL, AV_LOG_ERROR,
|
||||
"Argument '%s' provided as input filename, but '%s' was already specified.\n",
|
||||
arg, input_filename);
|
||||
exit_program(1);
|
||||
exit(1);
|
||||
}
|
||||
if (!strcmp(arg, "-"))
|
||||
arg = "pipe:";
|
||||
@@ -2352,145 +2099,6 @@ void show_help_default(const char *opt, const char *arg)
|
||||
show_help_children(avformat_get_class(), AV_OPT_FLAG_DECODING_PARAM);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse interval specification, according to the format:
|
||||
* INTERVAL ::= [START|+START_OFFSET][%[END|+END_OFFSET]]
|
||||
* INTERVALS ::= INTERVAL[,INTERVALS]
|
||||
*/
|
||||
static int parse_read_interval(const char *interval_spec,
|
||||
ReadInterval *interval)
|
||||
{
|
||||
int ret = 0;
|
||||
char *next, *p, *spec = av_strdup(interval_spec);
|
||||
if (!spec)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
if (!*spec) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Invalid empty interval specification\n");
|
||||
ret = AVERROR(EINVAL);
|
||||
goto end;
|
||||
}
|
||||
|
||||
p = spec;
|
||||
next = strchr(spec, '%');
|
||||
if (next)
|
||||
*next++ = 0;
|
||||
|
||||
/* parse first part */
|
||||
if (*p) {
|
||||
interval->has_start = 1;
|
||||
|
||||
if (*p == '+') {
|
||||
interval->start_is_offset = 1;
|
||||
p++;
|
||||
} else {
|
||||
interval->start_is_offset = 0;
|
||||
}
|
||||
|
||||
ret = av_parse_time(&interval->start, p, 1);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Invalid interval start specification '%s'\n", p);
|
||||
goto end;
|
||||
}
|
||||
} else {
|
||||
interval->has_start = 0;
|
||||
}
|
||||
|
||||
/* parse second part */
|
||||
p = next;
|
||||
if (p && *p) {
|
||||
int64_t us;
|
||||
interval->has_end = 1;
|
||||
|
||||
if (*p == '+') {
|
||||
interval->end_is_offset = 1;
|
||||
p++;
|
||||
} else {
|
||||
interval->end_is_offset = 0;
|
||||
}
|
||||
|
||||
if (interval->end_is_offset && *p == '#') {
|
||||
long long int lli;
|
||||
char *tail;
|
||||
interval->duration_frames = 1;
|
||||
p++;
|
||||
lli = strtoll(p, &tail, 10);
|
||||
if (*tail || lli < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR,
|
||||
"Invalid or negative value '%s' for duration number of frames\n", p);
|
||||
goto end;
|
||||
}
|
||||
interval->end = lli;
|
||||
} else {
|
||||
ret = av_parse_time(&us, p, 1);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Invalid interval end/duration specification '%s'\n", p);
|
||||
goto end;
|
||||
}
|
||||
interval->end = us;
|
||||
}
|
||||
} else {
|
||||
interval->has_end = 0;
|
||||
}
|
||||
|
||||
end:
|
||||
av_free(spec);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int parse_read_intervals(const char *intervals_spec)
|
||||
{
|
||||
int ret, n, i;
|
||||
char *p, *spec = av_strdup(intervals_spec);
|
||||
if (!spec)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
/* preparse specification, get number of intervals */
|
||||
for (n = 0, p = spec; *p; p++)
|
||||
if (*p == ',')
|
||||
n++;
|
||||
n++;
|
||||
|
||||
read_intervals = av_malloc(n * sizeof(*read_intervals));
|
||||
if (!read_intervals) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto end;
|
||||
}
|
||||
read_intervals_nb = n;
|
||||
|
||||
/* parse intervals */
|
||||
p = spec;
|
||||
for (i = 0; p; i++) {
|
||||
char *next;
|
||||
|
||||
av_assert0(i < read_intervals_nb);
|
||||
next = strchr(p, ',');
|
||||
if (next)
|
||||
*next++ = 0;
|
||||
|
||||
read_intervals[i].id = i;
|
||||
ret = parse_read_interval(p, &read_intervals[i]);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Error parsing read interval #%d '%s'\n",
|
||||
i, p);
|
||||
goto end;
|
||||
}
|
||||
av_log(NULL, AV_LOG_VERBOSE, "Parsed log interval ");
|
||||
log_read_interval(&read_intervals[i], NULL, AV_LOG_VERBOSE);
|
||||
p = next;
|
||||
}
|
||||
av_assert0(i == read_intervals_nb);
|
||||
|
||||
end:
|
||||
av_free(spec);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int opt_read_intervals(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
return parse_read_intervals(arg);
|
||||
}
|
||||
|
||||
static int opt_pretty(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
show_value_unit = 1;
|
||||
@@ -2543,7 +2151,6 @@ static int opt_show_versions(const char *opt, const char *arg)
|
||||
return 0; \
|
||||
}
|
||||
|
||||
DEFINE_OPT_SHOW_SECTION(chapters, CHAPTERS);
|
||||
DEFINE_OPT_SHOW_SECTION(error, ERROR);
|
||||
DEFINE_OPT_SHOW_SECTION(format, FORMAT);
|
||||
DEFINE_OPT_SHOW_SECTION(frames, FRAMES);
|
||||
@@ -2551,7 +2158,6 @@ DEFINE_OPT_SHOW_SECTION(library_versions, LIBRARY_VERSIONS);
|
||||
DEFINE_OPT_SHOW_SECTION(packets, PACKETS);
|
||||
DEFINE_OPT_SHOW_SECTION(program_version, PROGRAM_VERSION);
|
||||
DEFINE_OPT_SHOW_SECTION(streams, STREAMS);
|
||||
DEFINE_OPT_SHOW_SECTION(programs, PROGRAMS);
|
||||
|
||||
static const OptionDef real_options[] = {
|
||||
#include "cmdutils_common_opts.h"
|
||||
@@ -2578,9 +2184,7 @@ static const OptionDef real_options[] = {
|
||||
{ "show_entries", HAS_ARG, {.func_arg = opt_show_entries},
|
||||
"show a set of specified entries", "entry_list" },
|
||||
{ "show_packets", 0, {(void*)&opt_show_packets}, "show packets info" },
|
||||
{ "show_programs", 0, {(void*)&opt_show_programs}, "show programs info" },
|
||||
{ "show_streams", 0, {(void*)&opt_show_streams}, "show streams info" },
|
||||
{ "show_chapters", 0, {(void*)&opt_show_chapters}, "show chapters info" },
|
||||
{ "count_frames", OPT_BOOL, {(void*)&do_count_frames}, "count the number of frames per stream" },
|
||||
{ "count_packets", OPT_BOOL, {(void*)&do_count_packets}, "count the number of packets per stream" },
|
||||
{ "show_program_version", 0, {(void*)&opt_show_program_version}, "show ffprobe version" },
|
||||
@@ -2589,7 +2193,6 @@ static const OptionDef real_options[] = {
|
||||
{ "show_private_data", OPT_BOOL, {(void*)&show_private_data}, "show private data" },
|
||||
{ "private", OPT_BOOL, {(void*)&show_private_data}, "same as show_private_data" },
|
||||
{ "bitexact", OPT_BOOL, {&do_bitexact}, "force bitexact output" },
|
||||
{ "read_intervals", HAS_ARG, {.func_arg = opt_read_intervals}, "set read intervals", "read_intervals" },
|
||||
{ "default", HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, {.func_arg = opt_default}, "generic catch all option", "" },
|
||||
{ "i", HAS_ARG, {.func_arg = opt_input_file_i}, "read specified file", "input_file"},
|
||||
{ NULL, },
|
||||
@@ -2621,7 +2224,7 @@ int main(int argc, char **argv)
|
||||
int ret, i;
|
||||
|
||||
av_log_set_flags(AV_LOG_SKIP_REPEATED);
|
||||
register_exit(ffprobe_cleanup);
|
||||
atexit(exit_program);
|
||||
|
||||
options = real_options;
|
||||
parse_loglevel(argc, argv, options);
|
||||
@@ -2636,17 +2239,14 @@ int main(int argc, char **argv)
|
||||
parse_options(NULL, argc, argv, options, opt_input_file);
|
||||
|
||||
/* mark things to show, based on -show_entries */
|
||||
SET_DO_SHOW(CHAPTERS, chapters);
|
||||
SET_DO_SHOW(ERROR, error);
|
||||
SET_DO_SHOW(FORMAT, format);
|
||||
SET_DO_SHOW(FRAMES, frames);
|
||||
SET_DO_SHOW(LIBRARY_VERSIONS, library_versions);
|
||||
SET_DO_SHOW(PACKETS, packets);
|
||||
SET_DO_SHOW(PROGRAM_VERSION, program_version);
|
||||
SET_DO_SHOW(PROGRAMS, programs);
|
||||
SET_DO_SHOW(STREAMS, streams);
|
||||
SET_DO_SHOW(STREAM_DISPOSITION, stream_disposition);
|
||||
SET_DO_SHOW(PROGRAM_STREAM_DISPOSITION, stream_disposition);
|
||||
|
||||
if (do_bitexact && (do_show_program_version || do_show_library_versions)) {
|
||||
av_log(NULL, AV_LOG_ERROR,
|
||||
@@ -2684,7 +2284,7 @@ int main(int argc, char **argv)
|
||||
ffprobe_show_library_versions(wctx);
|
||||
|
||||
if (!input_filename &&
|
||||
((do_show_format || do_show_programs || do_show_streams || do_show_chapters || do_show_packets || do_show_error) ||
|
||||
((do_show_format || do_show_streams || do_show_packets || do_show_error) ||
|
||||
(!do_show_program_version && !do_show_library_versions))) {
|
||||
show_usage();
|
||||
av_log(NULL, AV_LOG_ERROR, "You have to specify one input file.\n");
|
||||
@@ -2702,7 +2302,6 @@ int main(int argc, char **argv)
|
||||
|
||||
end:
|
||||
av_freep(&print_format);
|
||||
av_freep(&read_intervals);
|
||||
|
||||
uninit_opts();
|
||||
for (i = 0; i < FF_ARRAY_ELEMS(sections); i++)
|
||||
@@ -2710,5 +2309,5 @@ end:
|
||||
|
||||
avformat_network_deinit();
|
||||
|
||||
return ret < 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
89
ffserver.c
89
ffserver.c
@@ -36,7 +36,6 @@
|
||||
#include "libavformat/network.h"
|
||||
#include "libavformat/os_support.h"
|
||||
#include "libavformat/rtpdec.h"
|
||||
#include "libavformat/rtpproto.h"
|
||||
#include "libavformat/rtsp.h"
|
||||
#include "libavformat/avio_internal.h"
|
||||
#include "libavformat/internal.h"
|
||||
@@ -48,7 +47,6 @@
|
||||
#include "libavutil/dict.h"
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "libavutil/mathematics.h"
|
||||
#include "libavutil/pixdesc.h"
|
||||
#include "libavutil/random_seed.h"
|
||||
#include "libavutil/parseutils.h"
|
||||
#include "libavutil/opt.h"
|
||||
@@ -65,6 +63,9 @@
|
||||
#include <time.h>
|
||||
#include <sys/wait.h>
|
||||
#include <signal.h>
|
||||
#if HAVE_DLFCN_H
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
#include "cmdutils.h"
|
||||
|
||||
@@ -307,7 +308,7 @@ static int rtp_new_av_stream(HTTPContext *c,
|
||||
|
||||
static const char *my_program_name;
|
||||
|
||||
static const char *config_filename;
|
||||
static const char *config_filename = "/etc/ffserver.conf";
|
||||
|
||||
static int ffserver_debug;
|
||||
static int no_launch;
|
||||
@@ -403,14 +404,14 @@ static int resolve_host(struct in_addr *sin_addr, const char *hostname)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static char *ctime1(char *buf2, int buf_size)
|
||||
static char *ctime1(char *buf2)
|
||||
{
|
||||
time_t ti;
|
||||
char *p;
|
||||
|
||||
ti = time(NULL);
|
||||
p = ctime(&ti);
|
||||
av_strlcpy(buf2, p, buf_size);
|
||||
strcpy(buf2, p);
|
||||
p = buf2 + strlen(p) - 1;
|
||||
if (*p == '\n')
|
||||
*p = '\0';
|
||||
@@ -423,7 +424,7 @@ static void http_vlog(const char *fmt, va_list vargs)
|
||||
if (logfile) {
|
||||
if (print_prefix) {
|
||||
char buf[32];
|
||||
ctime1(buf, sizeof(buf));
|
||||
ctime1(buf);
|
||||
fprintf(logfile, "%s ", buf);
|
||||
}
|
||||
print_prefix = strstr(fmt, "\n") != NULL;
|
||||
@@ -1132,7 +1133,7 @@ static int extract_rates(char *rates, int ratelen, const char *request)
|
||||
if (av_strncasecmp(p, "Pragma:", 7) == 0) {
|
||||
const char *q = p + 7;
|
||||
|
||||
while (*q && *q != '\n' && av_isspace(*q))
|
||||
while (*q && *q != '\n' && isspace(*q))
|
||||
q++;
|
||||
|
||||
if (av_strncasecmp(q, "stream-switch-entry=", 20) == 0) {
|
||||
@@ -1154,7 +1155,7 @@ static int extract_rates(char *rates, int ratelen, const char *request)
|
||||
if (stream_no < ratelen && stream_no >= 0)
|
||||
rates[stream_no] = rate_no;
|
||||
|
||||
while (*q && *q != '\n' && !av_isspace(*q))
|
||||
while (*q && *q != '\n' && !isspace(*q))
|
||||
q++;
|
||||
}
|
||||
|
||||
@@ -1265,7 +1266,7 @@ static void get_word(char *buf, int buf_size, const char **pp)
|
||||
p = *pp;
|
||||
skip_spaces(&p);
|
||||
q = buf;
|
||||
while (!av_isspace(*p) && *p != '\0') {
|
||||
while (!isspace(*p) && *p != '\0') {
|
||||
if ((q - buf) < buf_size - 1)
|
||||
*q++ = *p;
|
||||
p++;
|
||||
@@ -1282,7 +1283,7 @@ static void get_arg(char *buf, int buf_size, const char **pp)
|
||||
int quote;
|
||||
|
||||
p = *pp;
|
||||
while (av_isspace(*p)) p++;
|
||||
while (isspace(*p)) p++;
|
||||
q = buf;
|
||||
quote = 0;
|
||||
if (*p == '\"' || *p == '\'')
|
||||
@@ -1292,7 +1293,7 @@ static void get_arg(char *buf, int buf_size, const char **pp)
|
||||
if (*p == quote)
|
||||
break;
|
||||
} else {
|
||||
if (av_isspace(*p))
|
||||
if (isspace(*p))
|
||||
break;
|
||||
}
|
||||
if (*p == '\0')
|
||||
@@ -1396,7 +1397,7 @@ static IPAddressACL* parse_dynamic_acl(FFStream *stream, HTTPContext *c)
|
||||
break;
|
||||
line_num++;
|
||||
p = line;
|
||||
while (av_isspace(*p))
|
||||
while (isspace(*p))
|
||||
p++;
|
||||
if (*p == '\0' || *p == '#')
|
||||
continue;
|
||||
@@ -1547,7 +1548,7 @@ static int http_parse_request(HTTPContext *c)
|
||||
for (p = c->buffer; *p && *p != '\r' && *p != '\n'; ) {
|
||||
if (av_strncasecmp(p, "User-Agent:", 11) == 0) {
|
||||
useragent = p + 11;
|
||||
if (*useragent && *useragent != '\n' && av_isspace(*useragent))
|
||||
if (*useragent && *useragent != '\n' && isspace(*useragent))
|
||||
useragent++;
|
||||
break;
|
||||
}
|
||||
@@ -1675,7 +1676,7 @@ static int http_parse_request(HTTPContext *c)
|
||||
char *eoh;
|
||||
char hostbuf[260];
|
||||
|
||||
while (av_isspace(*hostinfo))
|
||||
while (isspace(*hostinfo))
|
||||
hostinfo++;
|
||||
|
||||
eoh = strchr(hostinfo, '\n');
|
||||
@@ -3914,7 +3915,7 @@ static void add_codec(FFStream *stream, AVCodecContext *av)
|
||||
av->rc_buffer_aggressivity = 1.0;
|
||||
|
||||
if (!av->rc_eq)
|
||||
av->rc_eq = av_strdup("tex^qComp");
|
||||
av->rc_eq = "tex^qComp";
|
||||
if (!av->i_quant_factor)
|
||||
av->i_quant_factor = -0.8;
|
||||
if (!av->b_quant_factor)
|
||||
@@ -3962,6 +3963,32 @@ static enum AVCodecID opt_video_codec(const char *arg)
|
||||
return p->id;
|
||||
}
|
||||
|
||||
/* simplistic plugin support */
|
||||
|
||||
#if HAVE_DLOPEN
|
||||
static void load_module(const char *filename)
|
||||
{
|
||||
void *dll;
|
||||
void (*init_func)(void);
|
||||
dll = dlopen(filename, RTLD_NOW);
|
||||
if (!dll) {
|
||||
fprintf(stderr, "Could not load module '%s' - %s\n",
|
||||
filename, dlerror());
|
||||
return;
|
||||
}
|
||||
|
||||
init_func = dlsym(dll, "ffserver_module_init");
|
||||
if (!init_func) {
|
||||
fprintf(stderr,
|
||||
"%s: init function 'ffserver_module_init()' not found\n",
|
||||
filename);
|
||||
dlclose(dll);
|
||||
}
|
||||
|
||||
init_func();
|
||||
}
|
||||
#endif
|
||||
|
||||
static int ffserver_opt_default(const char *opt, const char *arg,
|
||||
AVCodecContext *avctx, int type)
|
||||
{
|
||||
@@ -4082,7 +4109,7 @@ static int parse_ffconfig(const char *filename)
|
||||
break;
|
||||
line_num++;
|
||||
p = line;
|
||||
while (av_isspace(*p))
|
||||
while (isspace(*p))
|
||||
p++;
|
||||
if (*p == '\0' || *p == '#')
|
||||
continue;
|
||||
@@ -4133,7 +4160,7 @@ static int parse_ffconfig(const char *filename)
|
||||
} else if (!av_strcasecmp(cmd, "MaxBandwidth")) {
|
||||
int64_t llval;
|
||||
get_arg(arg, sizeof(arg), &p);
|
||||
llval = strtoll(arg, NULL, 10);
|
||||
llval = atoll(arg);
|
||||
if (llval < 10 || llval > 10000000) {
|
||||
ERROR("Invalid MaxBandwidth: %s\n", arg);
|
||||
} else
|
||||
@@ -4219,7 +4246,7 @@ static int parse_ffconfig(const char *filename)
|
||||
get_arg(arg, sizeof(arg), &p);
|
||||
p1 = arg;
|
||||
fsize = strtod(p1, &p1);
|
||||
switch(av_toupper(*p1)) {
|
||||
switch(toupper(*p1)) {
|
||||
case 'K':
|
||||
fsize *= 1024;
|
||||
break;
|
||||
@@ -4435,14 +4462,6 @@ static int parse_ffconfig(const char *filename)
|
||||
video_enc.time_base.den = frame_rate.num;
|
||||
}
|
||||
}
|
||||
} else if (!av_strcasecmp(cmd, "PixelFormat")) {
|
||||
get_arg(arg, sizeof(arg), &p);
|
||||
if (stream) {
|
||||
video_enc.pix_fmt = av_get_pix_fmt(arg);
|
||||
if (video_enc.pix_fmt == AV_PIX_FMT_NONE) {
|
||||
ERROR("Unknown pixel format: %s\n", arg);
|
||||
}
|
||||
}
|
||||
} else if (!av_strcasecmp(cmd, "VideoGopSize")) {
|
||||
get_arg(arg, sizeof(arg), &p);
|
||||
if (stream)
|
||||
@@ -4535,6 +4554,14 @@ static int parse_ffconfig(const char *filename)
|
||||
ERROR("VideoQMin out of range\n");
|
||||
}
|
||||
}
|
||||
} else if (!av_strcasecmp(cmd, "LumaElim")) {
|
||||
get_arg(arg, sizeof(arg), &p);
|
||||
if (stream)
|
||||
video_enc.luma_elim_threshold = atoi(arg);
|
||||
} else if (!av_strcasecmp(cmd, "ChromaElim")) {
|
||||
get_arg(arg, sizeof(arg), &p);
|
||||
if (stream)
|
||||
video_enc.chroma_elim_threshold = atoi(arg);
|
||||
} else if (!av_strcasecmp(cmd, "LumiMask")) {
|
||||
get_arg(arg, sizeof(arg), &p);
|
||||
if (stream)
|
||||
@@ -4626,7 +4653,12 @@ static int parse_ffconfig(const char *filename)
|
||||
redirect = NULL;
|
||||
}
|
||||
} else if (!av_strcasecmp(cmd, "LoadModule")) {
|
||||
ERROR("Loadable modules no longer supported\n");
|
||||
get_arg(arg, sizeof(arg), &p);
|
||||
#if HAVE_DLOPEN
|
||||
load_module(arg);
|
||||
#else
|
||||
ERROR("Module support not compiled into this version: '%s'\n", arg);
|
||||
#endif
|
||||
} else {
|
||||
ERROR("Incorrect keyword: '%s'\n", cmd);
|
||||
}
|
||||
@@ -4691,8 +4723,6 @@ int main(int argc, char **argv)
|
||||
{
|
||||
struct sigaction sigact = { { 0 } };
|
||||
|
||||
config_filename = av_strdup("/etc/ffserver.conf");
|
||||
|
||||
parse_loglevel(argc, argv, options);
|
||||
av_register_all();
|
||||
avformat_network_init();
|
||||
@@ -4715,7 +4745,6 @@ int main(int argc, char **argv)
|
||||
fprintf(stderr, "Incorrect config file - exiting.\n");
|
||||
exit(1);
|
||||
}
|
||||
av_freep(&config_filename);
|
||||
|
||||
/* open log file if needed */
|
||||
if (logfilename[0] != '\0') {
|
||||
|
||||
@@ -26,12 +26,18 @@
|
||||
|
||||
static av_cold int zero12v_decode_init(AVCodecContext *avctx)
|
||||
{
|
||||
avctx->pix_fmt = AV_PIX_FMT_YUV422P16;
|
||||
avctx->pix_fmt = PIX_FMT_YUV422P16;
|
||||
avctx->bits_per_raw_sample = 10;
|
||||
|
||||
if (avctx->codec_tag == MKTAG('a', '1', '2', 'v'))
|
||||
avpriv_request_sample(avctx, "transparency");
|
||||
avctx->coded_frame = avcodec_alloc_frame();
|
||||
if (!avctx->coded_frame)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
if (avctx->codec_tag == MKTAG('a', '1', '2', 'v'))
|
||||
av_log_ask_for_sample(avctx, "Samples with actual transparency needed\n");
|
||||
|
||||
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
|
||||
avctx->coded_frame->key_frame = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -40,33 +46,28 @@ static int zero12v_decode_frame(AVCodecContext *avctx, void *data,
|
||||
{
|
||||
int line = 0, ret;
|
||||
const int width = avctx->width;
|
||||
AVFrame *pic = data;
|
||||
AVFrame *pic = avctx->coded_frame;
|
||||
uint16_t *y, *u, *v;
|
||||
const uint8_t *line_end, *src = avpkt->data;
|
||||
int stride = avctx->width * 8 / 3;
|
||||
|
||||
if (pic->data[0])
|
||||
avctx->release_buffer(avctx, pic);
|
||||
|
||||
if (width == 1) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Width 1 not supported.\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if ( avctx->codec_tag == MKTAG('0', '1', '2', 'v')
|
||||
&& avpkt->size % avctx->height == 0
|
||||
&& avpkt->size / avctx->height * 3 >= width * 8)
|
||||
stride = avpkt->size / avctx->height;
|
||||
|
||||
if (avpkt->size < avctx->height * stride) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Packet too small: %d instead of %d\n",
|
||||
avpkt->size, avctx->height * stride);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
|
||||
pic->reference = 0;
|
||||
if ((ret = ff_get_buffer(avctx, pic)) < 0)
|
||||
return ret;
|
||||
|
||||
pic->pict_type = AV_PICTURE_TYPE_I;
|
||||
pic->key_frame = 1;
|
||||
|
||||
y = (uint16_t *)pic->data[0];
|
||||
u = (uint16_t *)pic->data[1];
|
||||
v = (uint16_t *)pic->data[2];
|
||||
@@ -144,16 +145,28 @@ static int zero12v_decode_frame(AVCodecContext *avctx, void *data,
|
||||
}
|
||||
|
||||
*got_frame = 1;
|
||||
*(AVFrame*)data= *avctx->coded_frame;
|
||||
|
||||
return avpkt->size;
|
||||
}
|
||||
|
||||
static av_cold int zero12v_decode_close(AVCodecContext *avctx)
|
||||
{
|
||||
AVFrame *pic = avctx->coded_frame;
|
||||
if (pic->data[0])
|
||||
avctx->release_buffer(avctx, pic);
|
||||
av_freep(&avctx->coded_frame);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
AVCodec ff_zero12v_decoder = {
|
||||
.name = "012v",
|
||||
.long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:2:2 10-bit"),
|
||||
.type = AVMEDIA_TYPE_VIDEO,
|
||||
.id = AV_CODEC_ID_012V,
|
||||
.init = zero12v_decode_init,
|
||||
.close = zero12v_decode_close,
|
||||
.decode = zero12v_decode_frame,
|
||||
.capabilities = CODEC_CAP_DR1,
|
||||
.long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:2:2 10-bit"),
|
||||
};
|
||||
|
||||
262
libavcodec/4xm.c
262
libavcodec/4xm.c
@@ -24,8 +24,6 @@
|
||||
* 4XM codec.
|
||||
*/
|
||||
|
||||
#include "libavutil/avassert.h"
|
||||
#include "libavutil/frame.h"
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "avcodec.h"
|
||||
#include "bytestream.h"
|
||||
@@ -33,6 +31,7 @@
|
||||
#include "get_bits.h"
|
||||
#include "internal.h"
|
||||
|
||||
#include "libavutil/avassert.h"
|
||||
|
||||
#define BLOCK_TYPE_VLC_BITS 5
|
||||
#define ACDC_VLC_BITS 9
|
||||
@@ -131,7 +130,7 @@ typedef struct CFrameBuffer {
|
||||
typedef struct FourXContext {
|
||||
AVCodecContext *avctx;
|
||||
DSPContext dsp;
|
||||
AVFrame *current_picture, *last_picture;
|
||||
AVFrame current_picture, last_picture;
|
||||
GetBitContext pre_gb; ///< ac/dc prefix
|
||||
GetBitContext gb;
|
||||
GetByteContext g;
|
||||
@@ -139,7 +138,7 @@ typedef struct FourXContext {
|
||||
int mv[256];
|
||||
VLC pre_vlc;
|
||||
int last_dc;
|
||||
DECLARE_ALIGNED(16, int16_t, block)[6][64];
|
||||
DECLARE_ALIGNED(16, DCTELEM, block)[6][64];
|
||||
void *bitstream_buffer;
|
||||
unsigned int bitstream_buffer_size;
|
||||
int version;
|
||||
@@ -154,7 +153,7 @@ typedef struct FourXContext {
|
||||
|
||||
#define MULTIPLY(var, const) (((var) * (const)) >> 16)
|
||||
|
||||
static void idct(int16_t block[64])
|
||||
static void idct(DCTELEM block[64])
|
||||
{
|
||||
int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
|
||||
int tmp10, tmp11, tmp12, tmp13;
|
||||
@@ -256,15 +255,15 @@ static av_cold void init_vlcs(FourXContext *f)
|
||||
}
|
||||
}
|
||||
|
||||
static void init_mv(FourXContext *f, int linesize)
|
||||
static void init_mv(FourXContext *f)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 256; i++) {
|
||||
if (f->version > 1)
|
||||
f->mv[i] = mv[i][0] + mv[i][1] * linesize / 2;
|
||||
f->mv[i] = mv[i][0] + mv[i][1] * f->current_picture.linesize[0] / 2;
|
||||
else
|
||||
f->mv[i] = (i & 15) - 8 + ((i >> 4) - 8) * linesize / 2;
|
||||
f->mv[i] = (i & 15) - 8 + ((i >> 4) - 8) * f->current_picture.linesize[0] / 2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -341,28 +340,70 @@ static int decode_p_block(FourXContext *f, uint16_t *dst, uint16_t *src,
|
||||
int code = get_vlc2(&f->gb,
|
||||
block_type_vlc[1 - (f->version > 1)][index].table,
|
||||
BLOCK_TYPE_VLC_BITS, 1);
|
||||
uint16_t *start = (uint16_t *)f->last_picture->data[0];
|
||||
uint16_t *start = (uint16_t *)f->last_picture.data[0];
|
||||
uint16_t *end = start + stride * (f->avctx->height - h + 1) - (1 << log2w);
|
||||
int ret;
|
||||
int scale = 1;
|
||||
unsigned dc = 0;
|
||||
|
||||
av_assert0(code >= 0 && code <= 6 && log2w >= 0);
|
||||
|
||||
if (code == 1) {
|
||||
if (code == 0) {
|
||||
if (bytestream2_get_bytes_left(&f->g) < 1) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "bytestream overread\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
src += f->mv[bytestream2_get_byteu(&f->g)];
|
||||
if (start > src || src > end) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "mv out of pic\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
mcdc(dst, src, log2w, h, stride, 1, 0);
|
||||
} else if (code == 1) {
|
||||
log2h--;
|
||||
if ((ret = decode_p_block(f, dst, src, log2w, log2h, stride)) < 0)
|
||||
return ret;
|
||||
return decode_p_block(f, dst + (stride << log2h),
|
||||
src + (stride << log2h),
|
||||
log2w, log2h, stride);
|
||||
if ((ret = decode_p_block(f, dst + (stride << log2h),
|
||||
src + (stride << log2h),
|
||||
log2w, log2h, stride)) < 0)
|
||||
return ret;
|
||||
} else if (code == 2) {
|
||||
log2w--;
|
||||
if ((ret = decode_p_block(f, dst , src, log2w, log2h, stride)) < 0)
|
||||
return ret;
|
||||
return decode_p_block(f, dst + (1 << log2w),
|
||||
src + (1 << log2w),
|
||||
log2w, log2h, stride);
|
||||
if ((ret = decode_p_block(f, dst + (1 << log2w),
|
||||
src + (1 << log2w),
|
||||
log2w, log2h, stride)) < 0)
|
||||
return ret;
|
||||
} else if (code == 3 && f->version < 2) {
|
||||
if (start > src || src > end) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "mv out of pic\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
mcdc(dst, src, log2w, h, stride, 1, 0);
|
||||
} else if (code == 4) {
|
||||
if (bytestream2_get_bytes_left(&f->g) < 1) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "bytestream overread\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
src += f->mv[bytestream2_get_byteu(&f->g)];
|
||||
if (start > src || src > end) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "mv out of pic\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if (bytestream2_get_bytes_left(&f->g2) < 2){
|
||||
av_log(f->avctx, AV_LOG_ERROR, "wordstream overread\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
mcdc(dst, src, log2w, h, stride, 1, bytestream2_get_le16u(&f->g2));
|
||||
} else if (code == 5) {
|
||||
if (bytestream2_get_bytes_left(&f->g2) < 2) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "wordstream overread\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if (start > src || src > end) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "mv out of pic\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
mcdc(dst, src, log2w, h, stride, 0, bytestream2_get_le16u(&f->g2));
|
||||
} else if (code == 6) {
|
||||
if (bytestream2_get_bytes_left(&f->g2) < 4) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "wordstream overread\n");
|
||||
@@ -375,73 +416,37 @@ static int decode_p_block(FourXContext *f, uint16_t *dst, uint16_t *src,
|
||||
dst[0] = bytestream2_get_le16u(&f->g2);
|
||||
dst[stride] = bytestream2_get_le16u(&f->g2);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((code&3)==0 && bytestream2_get_bytes_left(&f->g) < 1) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "bytestream overread\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if (code == 0) {
|
||||
src += f->mv[bytestream2_get_byte(&f->g)];
|
||||
} else if (code == 3 && f->version >= 2) {
|
||||
return 0;
|
||||
} else if (code == 4) {
|
||||
src += f->mv[bytestream2_get_byte(&f->g)];
|
||||
if (bytestream2_get_bytes_left(&f->g2) < 2){
|
||||
av_log(f->avctx, AV_LOG_ERROR, "wordstream overread\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
dc = bytestream2_get_le16(&f->g2);
|
||||
} else if (code == 5) {
|
||||
if (bytestream2_get_bytes_left(&f->g2) < 2){
|
||||
av_log(f->avctx, AV_LOG_ERROR, "wordstream overread\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
av_assert0(start <= src && src <= end);
|
||||
scale = 0;
|
||||
dc = bytestream2_get_le16(&f->g2);
|
||||
}
|
||||
|
||||
if (start > src || src > end) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "mv out of pic\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
mcdc(dst, src, log2w, h, stride, scale, dc);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int decode_p_frame(FourXContext *f, AVFrame *frame,
|
||||
const uint8_t *buf, int length)
|
||||
static int decode_p_frame(FourXContext *f, const uint8_t *buf, int length)
|
||||
{
|
||||
int x, y;
|
||||
const int width = f->avctx->width;
|
||||
const int height = f->avctx->height;
|
||||
uint16_t *dst = (uint16_t *)frame->data[0];
|
||||
const int stride = frame->linesize[0] >> 1;
|
||||
uint16_t *src;
|
||||
uint16_t *src = (uint16_t *)f->last_picture.data[0];
|
||||
uint16_t *dst = (uint16_t *)f->current_picture.data[0];
|
||||
const int stride = f->current_picture.linesize[0] >> 1;
|
||||
unsigned int bitstream_size, bytestream_size, wordstream_size, extra,
|
||||
bytestream_offset, wordstream_offset;
|
||||
int ret;
|
||||
|
||||
if (!f->last_picture->data[0]) {
|
||||
if ((ret = ff_get_buffer(f->avctx, f->last_picture,
|
||||
AV_GET_BUFFER_FLAG_REF)) < 0) {
|
||||
if (!f->last_picture.data[0]) {
|
||||
if ((ret = ff_get_buffer(f->avctx, &f->last_picture)) < 0) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
return ret;
|
||||
}
|
||||
for (y=0; y<f->avctx->height; y++)
|
||||
memset(f->last_picture->data[0] + y*f->last_picture->linesize[0], 0, 2*f->avctx->width);
|
||||
memset(f->last_picture.data[0] + y*f->last_picture.linesize[0], 0, 2*f->avctx->width);
|
||||
}
|
||||
|
||||
src = (uint16_t *)f->last_picture->data[0];
|
||||
|
||||
if (f->version > 1) {
|
||||
if (length < 20)
|
||||
return AVERROR_INVALIDDATA;
|
||||
extra = 20;
|
||||
if (length < extra)
|
||||
return AVERROR_INVALIDDATA;
|
||||
return -1;
|
||||
bitstream_size = AV_RL32(buf + 8);
|
||||
wordstream_size = AV_RL32(buf + 12);
|
||||
bytestream_size = AV_RL32(buf + 16);
|
||||
@@ -458,7 +463,7 @@ static int decode_p_frame(FourXContext *f, AVFrame *frame,
|
||||
extra > length - bytestream_size - bitstream_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);
|
||||
return AVERROR_INVALIDDATA;
|
||||
return -1;
|
||||
}
|
||||
|
||||
av_fast_malloc(&f->bitstream_buffer, &f->bitstream_buffer_size,
|
||||
@@ -478,7 +483,7 @@ static int decode_p_frame(FourXContext *f, AVFrame *frame,
|
||||
bytestream2_init(&f->g, buf + bytestream_offset,
|
||||
length - bytestream_offset);
|
||||
|
||||
init_mv(f, frame->linesize[0]);
|
||||
init_mv(f);
|
||||
|
||||
for (y = 0; y < height; y += 8) {
|
||||
for (x = 0; x < width; x += 8)
|
||||
@@ -495,7 +500,7 @@ static int decode_p_frame(FourXContext *f, AVFrame *frame,
|
||||
* decode block and dequantize.
|
||||
* Note this is almost identical to MJPEG.
|
||||
*/
|
||||
static int decode_i_block(FourXContext *f, int16_t *block)
|
||||
static int decode_i_block(FourXContext *f, DCTELEM *block)
|
||||
{
|
||||
int code, i, j, level, val;
|
||||
|
||||
@@ -506,10 +511,8 @@ static int decode_i_block(FourXContext *f, int16_t *block)
|
||||
|
||||
/* DC coef */
|
||||
val = get_vlc2(&f->pre_gb, f->pre_vlc.table, ACDC_VLC_BITS, 3);
|
||||
if (val >> 4) {
|
||||
if (val >> 4)
|
||||
av_log(f->avctx, AV_LOG_ERROR, "error dc run != 0\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if (val)
|
||||
val = get_xbits(&f->gb, val);
|
||||
@@ -527,12 +530,7 @@ static int decode_i_block(FourXContext *f, int16_t *block)
|
||||
if (code == 0xf0) {
|
||||
i += 16;
|
||||
} else {
|
||||
if (code & 0xf) {
|
||||
level = get_xbits(&f->gb, code & 0xf);
|
||||
} else {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "0 coeff\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
level = get_xbits(&f->gb, code & 0xf);
|
||||
i += code >> 4;
|
||||
if (i >= 64) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "run %d oveflow\n", i);
|
||||
@@ -550,12 +548,12 @@ static int decode_i_block(FourXContext *f, int16_t *block)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void idct_put(FourXContext *f, AVFrame *frame, int x, int y)
|
||||
static inline void idct_put(FourXContext *f, int x, int y)
|
||||
{
|
||||
int16_t (*block)[64] = f->block;
|
||||
int stride = frame->linesize[0] >> 1;
|
||||
DCTELEM (*block)[64] = f->block;
|
||||
int stride = f->current_picture.linesize[0] >> 1;
|
||||
int i;
|
||||
uint16_t *dst = ((uint16_t*)frame->data[0]) + y * stride + x;
|
||||
uint16_t *dst = ((uint16_t*)f->current_picture.data[0]) + y * stride + x;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
block[i][0] += 0x80 * 8 * 8;
|
||||
@@ -573,7 +571,7 @@ static inline void idct_put(FourXContext *f, AVFrame *frame, int x, int y)
|
||||
* cr = (-1b - 4g + 5r) / 14 */
|
||||
for (y = 0; y < 8; y++) {
|
||||
for (x = 0; x < 8; x++) {
|
||||
int16_t *temp = block[(x >> 2) + 2 * (y >> 2)] +
|
||||
DCTELEM *temp = block[(x >> 2) + 2 * (y >> 2)] +
|
||||
2 * (x & 3) + 2 * 8 * (y & 3); // FIXME optimize
|
||||
int cb = block[4][x + 8 * y];
|
||||
int cr = block[5][x + 8 * y];
|
||||
@@ -598,14 +596,13 @@ static inline void idct_put(FourXContext *f, AVFrame *frame, int x, int y)
|
||||
|
||||
static int decode_i_mb(FourXContext *f)
|
||||
{
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
f->dsp.clear_blocks(f->block[0]);
|
||||
|
||||
for (i = 0; i < 6; i++)
|
||||
if ((ret = decode_i_block(f, f->block[i])) < 0)
|
||||
return ret;
|
||||
if (decode_i_block(f, f->block[i]) < 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -649,11 +646,6 @@ static const uint8_t *read_huffman_tables(FourXContext *f,
|
||||
while ((ptr - buf) & 3)
|
||||
ptr++; // 4byte align
|
||||
|
||||
if (ptr > ptr_end) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "ptr overflow in read_huffman_tables\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (j = 257; j < 512; j++) {
|
||||
int min_freq[2] = { 256 * 256, 256 * 256 };
|
||||
int smallest[2] = { 0, 0 };
|
||||
@@ -715,14 +707,14 @@ static int mix(int c0, int c1)
|
||||
return red / 3 * 1024 + green / 3 * 32 + blue / 3;
|
||||
}
|
||||
|
||||
static int decode_i2_frame(FourXContext *f, AVFrame *frame, const uint8_t *buf, int length)
|
||||
static int decode_i2_frame(FourXContext *f, const uint8_t *buf, int length)
|
||||
{
|
||||
int x, y, x2, y2;
|
||||
const int width = f->avctx->width;
|
||||
const int height = f->avctx->height;
|
||||
const int mbs = (FFALIGN(width, 16) >> 4) * (FFALIGN(height, 16) >> 4);
|
||||
uint16_t *dst = (uint16_t*)frame->data[0];
|
||||
const int stride = frame->linesize[0]>>1;
|
||||
uint16_t *dst = (uint16_t*)f->current_picture.data[0];
|
||||
const int stride = f->current_picture.linesize[0]>>1;
|
||||
const uint8_t *buf_end = buf + length;
|
||||
GetByteContext g3;
|
||||
|
||||
@@ -764,9 +756,9 @@ static int decode_i2_frame(FourXContext *f, AVFrame *frame, const uint8_t *buf,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int decode_i_frame(FourXContext *f, AVFrame *frame, const uint8_t *buf, int length)
|
||||
static int decode_i_frame(FourXContext *f, const uint8_t *buf, int length)
|
||||
{
|
||||
int x, y, ret;
|
||||
int x, y;
|
||||
const int width = f->avctx->width;
|
||||
const int height = f->avctx->height;
|
||||
const unsigned int bitstream_size = AV_RL32(buf);
|
||||
@@ -788,7 +780,7 @@ static int decode_i_frame(FourXContext *f, AVFrame *frame, const uint8_t *buf, i
|
||||
|| prestream_size > (1 << 26)) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "size mismatch %d %d %d\n",
|
||||
prestream_size, bitstream_size, length);
|
||||
return AVERROR_INVALIDDATA;
|
||||
return -1;
|
||||
}
|
||||
|
||||
prestream = read_huffman_tables(f, prestream, prestream_size);
|
||||
@@ -797,8 +789,6 @@ static int decode_i_frame(FourXContext *f, AVFrame *frame, const uint8_t *buf, i
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
av_assert0(prestream <= buf + length);
|
||||
|
||||
init_get_bits(&f->gb, buf + 4, 8 * bitstream_size);
|
||||
|
||||
prestream_size = length + buf - prestream;
|
||||
@@ -817,10 +807,10 @@ static int decode_i_frame(FourXContext *f, AVFrame *frame, const uint8_t *buf, i
|
||||
|
||||
for (y = 0; y < height; y += 16) {
|
||||
for (x = 0; x < width; x += 16) {
|
||||
if ((ret = decode_i_mb(f)) < 0)
|
||||
return ret;
|
||||
if (decode_i_mb(f) < 0)
|
||||
return -1;
|
||||
|
||||
idct_put(f, frame, x, y);
|
||||
idct_put(f, x, y);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -837,7 +827,8 @@ static int decode_frame(AVCodecContext *avctx, void *data,
|
||||
int buf_size = avpkt->size;
|
||||
FourXContext *const f = avctx->priv_data;
|
||||
AVFrame *picture = data;
|
||||
int i, frame_4cc, frame_size, ret;
|
||||
AVFrame *p, temp;
|
||||
int i, frame_4cc, frame_size;
|
||||
|
||||
if (buf_size < 20)
|
||||
return AVERROR_INVALIDDATA;
|
||||
@@ -897,7 +888,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
|
||||
// explicit check needed as memcpy below might not catch a NULL
|
||||
if (!cfrm->data) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "realloc failure\n");
|
||||
return AVERROR(ENOMEM);
|
||||
return -1;
|
||||
}
|
||||
|
||||
memcpy(cfrm->data + cfrm->size, buf + 20, data_size);
|
||||
@@ -923,31 +914,39 @@ static int decode_frame(AVCodecContext *avctx, void *data,
|
||||
frame_size = buf_size - 12;
|
||||
}
|
||||
|
||||
FFSWAP(AVFrame*, f->current_picture, f->last_picture);
|
||||
temp = f->current_picture;
|
||||
f->current_picture = f->last_picture;
|
||||
f->last_picture = temp;
|
||||
|
||||
p = &f->current_picture;
|
||||
avctx->coded_frame = p;
|
||||
|
||||
// alternatively we would have to use our own buffer management
|
||||
avctx->flags |= CODEC_FLAG_EMU_EDGE;
|
||||
|
||||
if ((ret = ff_reget_buffer(avctx, f->current_picture)) < 0)
|
||||
return ret;
|
||||
p->reference= 3;
|
||||
if (avctx->reget_buffer(avctx, p) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (frame_4cc == AV_RL32("ifr2")) {
|
||||
f->current_picture->pict_type = AV_PICTURE_TYPE_I;
|
||||
if ((ret = decode_i2_frame(f, f->current_picture, buf - 4, frame_size + 4)) < 0) {
|
||||
p->pict_type= AV_PICTURE_TYPE_I;
|
||||
if (decode_i2_frame(f, buf - 4, frame_size + 4) < 0) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "decode i2 frame failed\n");
|
||||
return ret;
|
||||
return -1;
|
||||
}
|
||||
} else if (frame_4cc == AV_RL32("ifrm")) {
|
||||
f->current_picture->pict_type = AV_PICTURE_TYPE_I;
|
||||
if ((ret = decode_i_frame(f, f->current_picture, buf, frame_size)) < 0) {
|
||||
p->pict_type= AV_PICTURE_TYPE_I;
|
||||
if (decode_i_frame(f, buf, frame_size) < 0) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "decode i frame failed\n");
|
||||
return ret;
|
||||
return -1;
|
||||
}
|
||||
} else if (frame_4cc == AV_RL32("pfrm") || frame_4cc == AV_RL32("pfr2")) {
|
||||
f->current_picture->pict_type = AV_PICTURE_TYPE_P;
|
||||
if ((ret = decode_p_frame(f, f->current_picture, buf, frame_size)) < 0) {
|
||||
p->pict_type = AV_PICTURE_TYPE_P;
|
||||
if (decode_p_frame(f, buf, frame_size) < 0) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "decode p frame failed\n");
|
||||
return ret;
|
||||
return -1;
|
||||
}
|
||||
} else if (frame_4cc == AV_RL32("snd_")) {
|
||||
av_log(avctx, AV_LOG_ERROR, "ignoring snd_ chunk length:%d\n",
|
||||
@@ -957,10 +956,9 @@ static int decode_frame(AVCodecContext *avctx, void *data,
|
||||
buf_size);
|
||||
}
|
||||
|
||||
f->current_picture->key_frame = f->current_picture->pict_type == AV_PICTURE_TYPE_I;
|
||||
p->key_frame = p->pict_type == AV_PICTURE_TYPE_I;
|
||||
|
||||
if ((ret = av_frame_ref(picture, f->current_picture)) < 0)
|
||||
return ret;
|
||||
*picture = *p;
|
||||
*got_frame = 1;
|
||||
|
||||
emms_c();
|
||||
@@ -968,6 +966,16 @@ static int decode_frame(AVCodecContext *avctx, void *data,
|
||||
return buf_size;
|
||||
}
|
||||
|
||||
|
||||
static av_cold void common_init(AVCodecContext *avctx)
|
||||
{
|
||||
FourXContext * const f = avctx->priv_data;
|
||||
|
||||
ff_dsputil_init(&f->dsp, avctx);
|
||||
|
||||
f->avctx = avctx;
|
||||
}
|
||||
|
||||
static av_cold int decode_init(AVCodecContext *avctx)
|
||||
{
|
||||
FourXContext * const f = avctx->priv_data;
|
||||
@@ -981,9 +989,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
avcodec_get_frame_defaults(&f->current_picture);
|
||||
avcodec_get_frame_defaults(&f->last_picture);
|
||||
f->version = AV_RL32(avctx->extradata) >> 16;
|
||||
ff_dsputil_init(&f->dsp, avctx);
|
||||
f->avctx = avctx;
|
||||
common_init(avctx);
|
||||
init_vlcs(f);
|
||||
|
||||
if (f->version > 2)
|
||||
@@ -991,11 +1000,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
else
|
||||
avctx->pix_fmt = AV_PIX_FMT_BGR555;
|
||||
|
||||
f->current_picture = av_frame_alloc();
|
||||
f->last_picture = av_frame_alloc();
|
||||
if (!f->current_picture || !f->last_picture)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1012,15 +1016,16 @@ static av_cold int decode_end(AVCodecContext *avctx)
|
||||
f->cfrm[i].allocated_size = 0;
|
||||
}
|
||||
ff_free_vlc(&f->pre_vlc);
|
||||
av_frame_free(&f->current_picture);
|
||||
av_frame_free(&f->last_picture);
|
||||
if (f->current_picture.data[0])
|
||||
avctx->release_buffer(avctx, &f->current_picture);
|
||||
if (f->last_picture.data[0])
|
||||
avctx->release_buffer(avctx, &f->last_picture);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
AVCodec ff_fourxm_decoder = {
|
||||
.name = "4xm",
|
||||
.long_name = NULL_IF_CONFIG_SMALL("4X Movie"),
|
||||
.type = AVMEDIA_TYPE_VIDEO,
|
||||
.id = AV_CODEC_ID_4XM,
|
||||
.priv_data_size = sizeof(FourXContext),
|
||||
@@ -1028,4 +1033,5 @@ AVCodec ff_fourxm_decoder = {
|
||||
.close = decode_end,
|
||||
.decode = decode_frame,
|
||||
.capabilities = CODEC_CAP_DR1,
|
||||
.long_name = NULL_IF_CONFIG_SMALL("4X Movie"),
|
||||
};
|
||||
|
||||
@@ -46,6 +46,7 @@ static const enum AVPixelFormat pixfmt_rgb24[] = {
|
||||
|
||||
typedef struct EightBpsContext {
|
||||
AVCodecContext *avctx;
|
||||
AVFrame pic;
|
||||
|
||||
unsigned char planes;
|
||||
unsigned char planemap[4];
|
||||
@@ -56,7 +57,6 @@ typedef struct EightBpsContext {
|
||||
static int decode_frame(AVCodecContext *avctx, void *data,
|
||||
int *got_frame, AVPacket *avpkt)
|
||||
{
|
||||
AVFrame *frame = data;
|
||||
const uint8_t *buf = avpkt->data;
|
||||
int buf_size = avpkt->size;
|
||||
EightBpsContext * const c = avctx->priv_data;
|
||||
@@ -68,10 +68,16 @@ static int decode_frame(AVCodecContext *avctx, void *data,
|
||||
unsigned char count;
|
||||
unsigned int planes = c->planes;
|
||||
unsigned char *planemap = c->planemap;
|
||||
int ret;
|
||||
|
||||
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
|
||||
return ret;
|
||||
if (c->pic.data[0])
|
||||
avctx->release_buffer(avctx, &c->pic);
|
||||
|
||||
c->pic.reference = 0;
|
||||
c->pic.buffer_hints = FF_BUFFER_HINTS_VALID;
|
||||
if (ff_get_buffer(avctx, &c->pic) < 0){
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
ep = encoded + buf_size;
|
||||
|
||||
@@ -84,29 +90,29 @@ static int decode_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
/* Decode a plane */
|
||||
for (row = 0; row < height; row++) {
|
||||
pixptr = frame->data[0] + row * frame->linesize[0] + planemap[p];
|
||||
pixptr_end = pixptr + frame->linesize[0];
|
||||
pixptr = c->pic.data[0] + row * c->pic.linesize[0] + planemap[p];
|
||||
pixptr_end = pixptr + c->pic.linesize[0];
|
||||
if (ep - lp < row * 2 + 2)
|
||||
return AVERROR_INVALIDDATA;
|
||||
dlen = av_be2ne16(*(const unsigned short *)(lp + row * 2));
|
||||
/* Decode a row of this plane */
|
||||
while (dlen > 0) {
|
||||
if (ep - dp <= 1)
|
||||
return AVERROR_INVALIDDATA;
|
||||
return -1;
|
||||
if ((count = *dp++) <= 127) {
|
||||
count++;
|
||||
dlen -= count + 1;
|
||||
if (pixptr_end - pixptr < count * planes)
|
||||
if (pixptr + count * planes > pixptr_end)
|
||||
break;
|
||||
if (ep - dp < count)
|
||||
return AVERROR_INVALIDDATA;
|
||||
return -1;
|
||||
while (count--) {
|
||||
*pixptr = *dp++;
|
||||
pixptr += planes;
|
||||
}
|
||||
} else {
|
||||
count = 257 - count;
|
||||
if (pixptr_end - pixptr < count * planes)
|
||||
if (pixptr + count * planes > pixptr_end)
|
||||
break;
|
||||
while (count--) {
|
||||
*pixptr = *dp;
|
||||
@@ -124,14 +130,15 @@ static int decode_frame(AVCodecContext *avctx, void *data,
|
||||
AV_PKT_DATA_PALETTE,
|
||||
NULL);
|
||||
if (pal) {
|
||||
frame->palette_has_changed = 1;
|
||||
c->pic.palette_has_changed = 1;
|
||||
memcpy(c->pal, pal, AVPALETTE_SIZE);
|
||||
}
|
||||
|
||||
memcpy (frame->data[1], c->pal, AVPALETTE_SIZE);
|
||||
memcpy (c->pic.data[1], c->pal, AVPALETTE_SIZE);
|
||||
}
|
||||
|
||||
*got_frame = 1;
|
||||
*(AVFrame*)data = c->pic;
|
||||
|
||||
/* always report that the buffer was completely consumed */
|
||||
return buf_size;
|
||||
@@ -142,7 +149,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
EightBpsContext * const c = avctx->priv_data;
|
||||
|
||||
c->avctx = avctx;
|
||||
c->pic.data[0] = NULL;
|
||||
|
||||
avcodec_get_frame_defaults(&c->pic);
|
||||
switch (avctx->bits_per_coded_sample) {
|
||||
case 8:
|
||||
avctx->pix_fmt = AV_PIX_FMT_PAL8;
|
||||
@@ -159,30 +168,45 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
case 32:
|
||||
avctx->pix_fmt = AV_PIX_FMT_RGB32;
|
||||
c->planes = 4;
|
||||
/* handle planemap setup later for decoding rgb24 data as rbg32 */
|
||||
#if HAVE_BIGENDIAN
|
||||
c->planemap[0] = 1; // 1st plane is red
|
||||
c->planemap[1] = 2; // 2nd plane is green
|
||||
c->planemap[2] = 3; // 3rd plane is blue
|
||||
c->planemap[3] = 0; // 4th plane is alpha
|
||||
#else
|
||||
c->planemap[0] = 2; // 1st plane is red
|
||||
c->planemap[1] = 1; // 2nd plane is green
|
||||
c->planemap[2] = 0; // 3rd plane is blue
|
||||
c->planemap[3] = 3; // 4th plane is alpha
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
av_log(avctx, AV_LOG_ERROR, "Error: Unsupported color depth: %u.\n",
|
||||
avctx->bits_per_coded_sample);
|
||||
return AVERROR_INVALIDDATA;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (avctx->pix_fmt == AV_PIX_FMT_RGB32) {
|
||||
c->planemap[0] = HAVE_BIGENDIAN ? 1 : 2; // 1st plane is red
|
||||
c->planemap[1] = HAVE_BIGENDIAN ? 2 : 1; // 2nd plane is green
|
||||
c->planemap[2] = HAVE_BIGENDIAN ? 3 : 0; // 3rd plane is blue
|
||||
c->planemap[3] = HAVE_BIGENDIAN ? 0 : 3; // 4th plane is alpha
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static av_cold int decode_end(AVCodecContext *avctx)
|
||||
{
|
||||
EightBpsContext * const c = avctx->priv_data;
|
||||
|
||||
if (c->pic.data[0])
|
||||
avctx->release_buffer(avctx, &c->pic);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
AVCodec ff_eightbps_decoder = {
|
||||
.name = "8bps",
|
||||
.long_name = NULL_IF_CONFIG_SMALL("QuickTime 8BPS video"),
|
||||
.type = AVMEDIA_TYPE_VIDEO,
|
||||
.id = AV_CODEC_ID_8BPS,
|
||||
.priv_data_size = sizeof(EightBpsContext),
|
||||
.init = decode_init,
|
||||
.close = decode_end,
|
||||
.decode = decode_frame,
|
||||
.capabilities = CODEC_CAP_DR1,
|
||||
.long_name = NULL_IF_CONFIG_SMALL("QuickTime 8BPS video"),
|
||||
};
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
|
||||
/** decoder context */
|
||||
typedef struct EightSvxContext {
|
||||
AVFrame frame;
|
||||
uint8_t fib_acc[2];
|
||||
const int8_t *table;
|
||||
|
||||
@@ -87,7 +88,6 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, void *data,
|
||||
int *got_frame_ptr, AVPacket *avpkt)
|
||||
{
|
||||
EightSvxContext *esc = avctx->priv_data;
|
||||
AVFrame *frame = data;
|
||||
int buf_size;
|
||||
int ch, ret;
|
||||
int hdr_size = 2;
|
||||
@@ -135,18 +135,21 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, void *data,
|
||||
}
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = buf_size * 2;
|
||||
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
|
||||
esc->frame.nb_samples = buf_size * 2;
|
||||
if ((ret = ff_get_buffer(avctx, &esc->frame)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
for (ch = 0; ch < avctx->channels; ch++) {
|
||||
delta_decode(frame->data[ch], &esc->data[ch][esc->data_idx],
|
||||
delta_decode(esc->frame.data[ch], &esc->data[ch][esc->data_idx],
|
||||
buf_size, &esc->fib_acc[ch], esc->table);
|
||||
}
|
||||
|
||||
esc->data_idx += buf_size;
|
||||
|
||||
*got_frame_ptr = 1;
|
||||
*got_frame_ptr = 1;
|
||||
*(AVFrame *)data = esc->frame;
|
||||
|
||||
return ((avctx->frame_number == 0)*hdr_size + buf_size)*avctx->channels;
|
||||
}
|
||||
@@ -169,6 +172,9 @@ static av_cold int eightsvx_decode_init(AVCodecContext *avctx)
|
||||
}
|
||||
avctx->sample_fmt = AV_SAMPLE_FMT_U8P;
|
||||
|
||||
avcodec_get_frame_defaults(&esc->frame);
|
||||
avctx->coded_frame = &esc->frame;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -187,7 +193,6 @@ static av_cold int eightsvx_decode_close(AVCodecContext *avctx)
|
||||
#if CONFIG_EIGHTSVX_FIB_DECODER
|
||||
AVCodec ff_eightsvx_fib_decoder = {
|
||||
.name = "8svx_fib",
|
||||
.long_name = NULL_IF_CONFIG_SMALL("8SVX fibonacci"),
|
||||
.type = AVMEDIA_TYPE_AUDIO,
|
||||
.id = AV_CODEC_ID_8SVX_FIB,
|
||||
.priv_data_size = sizeof (EightSvxContext),
|
||||
@@ -195,6 +200,7 @@ AVCodec ff_eightsvx_fib_decoder = {
|
||||
.decode = eightsvx_decode_frame,
|
||||
.close = eightsvx_decode_close,
|
||||
.capabilities = CODEC_CAP_DR1,
|
||||
.long_name = NULL_IF_CONFIG_SMALL("8SVX fibonacci"),
|
||||
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P,
|
||||
AV_SAMPLE_FMT_NONE },
|
||||
};
|
||||
@@ -202,7 +208,6 @@ AVCodec ff_eightsvx_fib_decoder = {
|
||||
#if CONFIG_EIGHTSVX_EXP_DECODER
|
||||
AVCodec ff_eightsvx_exp_decoder = {
|
||||
.name = "8svx_exp",
|
||||
.long_name = NULL_IF_CONFIG_SMALL("8SVX exponential"),
|
||||
.type = AVMEDIA_TYPE_AUDIO,
|
||||
.id = AV_CODEC_ID_8SVX_EXP,
|
||||
.priv_data_size = sizeof (EightSvxContext),
|
||||
@@ -210,6 +215,7 @@ AVCodec ff_eightsvx_exp_decoder = {
|
||||
.decode = eightsvx_decode_frame,
|
||||
.close = eightsvx_decode_close,
|
||||
.capabilities = CODEC_CAP_DR1,
|
||||
.long_name = NULL_IF_CONFIG_SMALL("8SVX exponential"),
|
||||
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P,
|
||||
AV_SAMPLE_FMT_NONE },
|
||||
};
|
||||
|
||||
@@ -20,8 +20,11 @@ OBJS = allcodecs.o \
|
||||
bitstream.o \
|
||||
bitstream_filter.o \
|
||||
codec_desc.o \
|
||||
dsputil.o \
|
||||
faanidct.o \
|
||||
fmtconvert.o \
|
||||
imgconvert.o \
|
||||
jrevdct.o \
|
||||
mathtables.o \
|
||||
options.o \
|
||||
parser.o \
|
||||
@@ -29,37 +32,30 @@ OBJS = allcodecs.o \
|
||||
rawdec.o \
|
||||
resample.o \
|
||||
resample2.o \
|
||||
simple_idct.o \
|
||||
utils.o \
|
||||
|
||||
OBJS-$(HAVE_MSVCRT) += file_open.o
|
||||
|
||||
# parts needed for many different codecs
|
||||
OBJS-$(CONFIG_AANDCTTABLES) += aandcttab.o
|
||||
OBJS-$(CONFIG_AC3DSP) += ac3dsp.o
|
||||
OBJS-$(CONFIG_AUDIO_FRAME_QUEUE) += audio_frame_queue.o
|
||||
OBJS-$(CONFIG_CRYSTALHD) += crystalhd.o
|
||||
OBJS-$(CONFIG_DCT) += dct.o dct32_fixed.o dct32_float.o
|
||||
OBJS-$(CONFIG_DWT) += dwt.o snow.o
|
||||
OBJS-$(CONFIG_DXVA2) += dxva2.o
|
||||
OBJS-$(CONFIG_DSPUTIL) += dsputil.o faanidct.o \
|
||||
simple_idct.o jrevdct.o
|
||||
OBJS-$(CONFIG_ENCODERS) += faandct.o jfdctfst.o jfdctint.o
|
||||
OBJS-$(CONFIG_ERROR_RESILIENCE) += error_resilience.o
|
||||
OBJS-$(CONFIG_EXIF) += exif.o tiff_common.o
|
||||
FFT-OBJS-$(CONFIG_HARDCODED_TABLES) += cos_tables.o cos_fixed_tables.o
|
||||
OBJS-$(CONFIG_FFT) += avfft.o fft_fixed.o fft_float.o \
|
||||
fft_fixed_32.o fft_init_table.o \
|
||||
$(FFT-OBJS-yes)
|
||||
OBJS-$(CONFIG_GOLOMB) += golomb.o
|
||||
OBJS-$(CONFIG_H264CHROMA) += h264chroma.o
|
||||
OBJS-$(CONFIG_H264DSP) += h264dsp.o h264idct.o
|
||||
OBJS-$(CONFIG_H264PRED) += h264pred.o
|
||||
OBJS-$(CONFIG_H264QPEL) += h264qpel.o
|
||||
OBJS-$(CONFIG_HPELDSP) += hpeldsp.o
|
||||
OBJS-$(CONFIG_HUFFMAN) += huffman.o
|
||||
OBJS-$(CONFIG_LIBXVID) += libxvid_rc.o
|
||||
OBJS-$(CONFIG_LPC) += lpc.o
|
||||
OBJS-$(CONFIG_LSP) += lsp.o
|
||||
OBJS-$(CONFIG_MDCT) += mdct_fixed.o mdct_float.o mdct_fixed_32.o
|
||||
OBJS-$(CONFIG_MDCT) += mdct_fixed.o mdct_float.o
|
||||
OBJS-$(CONFIG_MPEGAUDIO) += mpegaudio.o mpegaudiodata.o \
|
||||
mpegaudiodecheader.o
|
||||
OBJS-$(CONFIG_MPEGAUDIODSP) += mpegaudiodsp.o \
|
||||
@@ -79,7 +75,7 @@ OBJS-$(CONFIG_VDPAU) += vdpau.o
|
||||
OBJS-$(CONFIG_VIDEODSP) += videodsp.o
|
||||
OBJS-$(CONFIG_VP3DSP) += vp3dsp.o
|
||||
|
||||
# decoders/encoders
|
||||
# decoders/encoders/hardware accelerators
|
||||
OBJS-$(CONFIG_ZERO12V_DECODER) += 012v.o
|
||||
OBJS-$(CONFIG_A64MULTI_ENCODER) += a64multienc.o elbg.o
|
||||
OBJS-$(CONFIG_A64MULTI5_ENCODER) += a64multienc.o elbg.o
|
||||
@@ -95,7 +91,6 @@ OBJS-$(CONFIG_AC3_DECODER) += ac3dec.o ac3dec_data.o ac3.o kbdwin.o
|
||||
OBJS-$(CONFIG_AC3_ENCODER) += ac3enc_float.o ac3enc.o ac3tab.o \
|
||||
ac3.o kbdwin.o
|
||||
OBJS-$(CONFIG_AC3_FIXED_ENCODER) += ac3enc_fixed.o ac3enc.o ac3tab.o ac3.o
|
||||
OBJS-$(CONFIG_AIC_DECODER) += aic.o
|
||||
OBJS-$(CONFIG_ALAC_DECODER) += alac.o alac_data.o
|
||||
OBJS-$(CONFIG_ALAC_ENCODER) += alacenc.o alac_data.o
|
||||
OBJS-$(CONFIG_ALS_DECODER) += alsdec.o bgmc.o mpeg4audio.o
|
||||
@@ -115,8 +110,6 @@ OBJS-$(CONFIG_AMV_ENCODER) += mjpegenc.o mjpeg.o \
|
||||
OBJS-$(CONFIG_ANM_DECODER) += anm.o
|
||||
OBJS-$(CONFIG_ANSI_DECODER) += ansi.o cga_data.o
|
||||
OBJS-$(CONFIG_APE_DECODER) += apedec.o
|
||||
OBJS-$(CONFIG_SSA_DECODER) += assdec.o ass.o ass_split.o
|
||||
OBJS-$(CONFIG_SSA_ENCODER) += assenc.o ass.o
|
||||
OBJS-$(CONFIG_ASS_DECODER) += assdec.o ass.o ass_split.o
|
||||
OBJS-$(CONFIG_ASS_ENCODER) += assenc.o ass.o
|
||||
OBJS-$(CONFIG_ASV1_DECODER) += asvdec.o asv.o mpeg12data.o
|
||||
@@ -162,10 +155,10 @@ OBJS-$(CONFIG_CPIA_DECODER) += cpia.o
|
||||
OBJS-$(CONFIG_CSCD_DECODER) += cscd.o
|
||||
OBJS-$(CONFIG_CYUV_DECODER) += cyuv.o
|
||||
OBJS-$(CONFIG_DCA_DECODER) += dcadec.o dca.o dcadsp.o \
|
||||
synth_filter.o
|
||||
dca_parser.o synth_filter.o
|
||||
OBJS-$(CONFIG_DCA_ENCODER) += dcaenc.o dca.o
|
||||
OBJS-$(CONFIG_DIRAC_DECODER) += diracdec.o dirac.o diracdsp.o \
|
||||
dirac_arith.o mpeg12data.o dirac_dwt.o
|
||||
dirac_arith.o mpeg12data.o dwt.o
|
||||
OBJS-$(CONFIG_DFA_DECODER) += dfa.o
|
||||
OBJS-$(CONFIG_DNXHD_DECODER) += dnxhddec.o dnxhddata.o
|
||||
OBJS-$(CONFIG_DNXHD_ENCODER) += dnxhdenc.o dnxhddata.o
|
||||
@@ -188,14 +181,13 @@ OBJS-$(CONFIG_EAMAD_DECODER) += eamad.o eaidct.o mpeg12.o \
|
||||
mpeg12data.o
|
||||
OBJS-$(CONFIG_EATGQ_DECODER) += eatgq.o eaidct.o
|
||||
OBJS-$(CONFIG_EATGV_DECODER) += eatgv.o
|
||||
OBJS-$(CONFIG_EATQI_DECODER) += eatqi.o eaidct.o mpeg12dec.o \
|
||||
mpeg12.o mpeg12data.o
|
||||
OBJS-$(CONFIG_EATQI_DECODER) += eatqi.o eaidct.o mpeg12.o \
|
||||
mpeg12data.o
|
||||
OBJS-$(CONFIG_EIGHTBPS_DECODER) += 8bps.o
|
||||
OBJS-$(CONFIG_EIGHTSVX_EXP_DECODER) += 8svx.o
|
||||
OBJS-$(CONFIG_EIGHTSVX_FIB_DECODER) += 8svx.o
|
||||
OBJS-$(CONFIG_ESCAPE124_DECODER) += escape124.o
|
||||
OBJS-$(CONFIG_ESCAPE130_DECODER) += escape130.o
|
||||
OBJS-$(CONFIG_EVRC_DECODER) += evrcdec.o acelp_vectors.o lsp.o
|
||||
OBJS-$(CONFIG_EXR_DECODER) += exr.o
|
||||
OBJS-$(CONFIG_FFV1_DECODER) += ffv1dec.o ffv1.o
|
||||
OBJS-$(CONFIG_FFV1_ENCODER) += ffv1enc.o ffv1.o
|
||||
@@ -212,7 +204,6 @@ OBJS-$(CONFIG_FLIC_DECODER) += flicvideo.o
|
||||
OBJS-$(CONFIG_FOURXM_DECODER) += 4xm.o
|
||||
OBJS-$(CONFIG_FRAPS_DECODER) += fraps.o
|
||||
OBJS-$(CONFIG_FRWU_DECODER) += frwu.o
|
||||
OBJS-$(CONFIG_G2M_DECODER) += g2meet.o mjpeg.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 acelp_vectors.o celp_math.o
|
||||
@@ -221,22 +212,22 @@ OBJS-$(CONFIG_GIF_DECODER) += gifdec.o lzw.o
|
||||
OBJS-$(CONFIG_GIF_ENCODER) += gif.o lzwenc.o
|
||||
OBJS-$(CONFIG_GSM_DECODER) += gsmdec.o gsmdec_data.o msgsmdec.o
|
||||
OBJS-$(CONFIG_GSM_MS_DECODER) += gsmdec.o gsmdec_data.o msgsmdec.o
|
||||
OBJS-$(CONFIG_H261_DECODER) += h261dec.o h261data.o h261.o
|
||||
OBJS-$(CONFIG_H261_ENCODER) += h261enc.o h261data.o h261.o
|
||||
OBJS-$(CONFIG_H261_DECODER) += h261dec.o h261.o h261data.o
|
||||
OBJS-$(CONFIG_H261_ENCODER) += h261enc.o h261.o h261data.o
|
||||
OBJS-$(CONFIG_H263_DECODER) += h263dec.o h263.o ituh263dec.o \
|
||||
mpeg4video.o mpeg4videodec.o flvdec.o\
|
||||
intelh263dec.o
|
||||
OBJS-$(CONFIG_H263_VAAPI_HWACCEL) += vaapi_mpeg4.o
|
||||
OBJS-$(CONFIG_H263_ENCODER) += mpeg4videoenc.o mpeg4video.o \
|
||||
h263.o ituh263enc.o flvenc.o
|
||||
OBJS-$(CONFIG_H264_DECODER) += h264.o \
|
||||
h264_loopfilter.o h264_direct.o \
|
||||
cabac.o h264_sei.o h264_ps.o \
|
||||
h264_refs.o h264_cavlc.o h264_cabac.o
|
||||
OBJS-$(CONFIG_H264_DXVA2_HWACCEL) += dxva2_h264.o
|
||||
OBJS-$(CONFIG_H264_VAAPI_HWACCEL) += vaapi_h264.o
|
||||
OBJS-$(CONFIG_H264_VDA_HWACCEL) += vda_h264.o
|
||||
OBJS-$(CONFIG_H264_VDA_DECODER) += vda_h264_dec.o
|
||||
OBJS-$(CONFIG_HEVC_DECODER) += hevc.o hevc_mvs.o hevc_ps.o hevc_sei.o \
|
||||
hevc_cabac.o hevc_refs.o hevcpred.o \
|
||||
hevcdsp.o hevc_filter.o cabac.o
|
||||
|
||||
OBJS-$(CONFIG_HUFFYUV_DECODER) += huffyuv.o huffyuvdec.o
|
||||
OBJS-$(CONFIG_HUFFYUV_ENCODER) += huffyuv.o huffyuvenc.o
|
||||
OBJS-$(CONFIG_IAC_DECODER) += imc.o
|
||||
@@ -252,10 +243,8 @@ OBJS-$(CONFIG_INDEO5_DECODER) += indeo5.o ivi_common.o ivi_dsp.o
|
||||
OBJS-$(CONFIG_INTERPLAY_DPCM_DECODER) += dpcm.o
|
||||
OBJS-$(CONFIG_INTERPLAY_VIDEO_DECODER) += interplayvideo.o
|
||||
OBJS-$(CONFIG_JACOSUB_DECODER) += jacosubdec.o ass.o
|
||||
OBJS-$(CONFIG_JPEG2000_ENCODER) += j2kenc.o mqcenc.o mqc.o jpeg2000.o \
|
||||
jpeg2000dwt.o
|
||||
OBJS-$(CONFIG_JPEG2000_DECODER) += jpeg2000dec.o jpeg2000.o \
|
||||
jpeg2000dwt.o mqcdec.o mqc.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_JPEGLS_DECODER) += jpeglsdec.o jpegls.o \
|
||||
mjpegdec.o mjpeg.o
|
||||
OBJS-$(CONFIG_JPEGLS_ENCODER) += jpeglsenc.o jpegls.o
|
||||
@@ -268,8 +257,6 @@ OBJS-$(CONFIG_LOCO_DECODER) += loco.o
|
||||
OBJS-$(CONFIG_MACE3_DECODER) += mace.o
|
||||
OBJS-$(CONFIG_MACE6_DECODER) += mace.o
|
||||
OBJS-$(CONFIG_MDEC_DECODER) += mdec.o mpeg12.o mpeg12data.o
|
||||
OBJS-$(CONFIG_METASOUND_DECODER) += metasound.o metasound_data.o \
|
||||
twinvq.o
|
||||
OBJS-$(CONFIG_MICRODVD_DECODER) += microdvddec.o ass.o
|
||||
OBJS-$(CONFIG_MIMIC_DECODER) += mimic.o
|
||||
OBJS-$(CONFIG_MJPEG_DECODER) += mjpegdec.o mjpeg.o
|
||||
@@ -297,23 +284,27 @@ OBJS-$(CONFIG_MPC8_DECODER) += mpc8.o mpc.o
|
||||
OBJS-$(CONFIG_MPEGVIDEO_DECODER) += mpeg12.o mpeg12data.o \
|
||||
mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_MPEG_XVMC_DECODER) += mpegvideo_xvmc.o
|
||||
OBJS-$(CONFIG_MPEG1VIDEO_DECODER) += mpeg12dec.o mpeg12.o mpeg12data.o
|
||||
OBJS-$(CONFIG_MPEG1VIDEO_ENCODER) += mpeg12enc.o mpeg12.o
|
||||
OBJS-$(CONFIG_MPEG2VIDEO_DECODER) += mpeg12dec.o mpeg12.o mpeg12data.o
|
||||
OBJS-$(CONFIG_MPEG1VIDEO_DECODER) += mpeg12.o mpeg12data.o
|
||||
OBJS-$(CONFIG_MPEG1VIDEO_ENCODER) += mpeg12enc.o mpeg12.o \
|
||||
timecode.o
|
||||
OBJS-$(CONFIG_MPEG2_DXVA2_HWACCEL) += dxva2_mpeg2.o
|
||||
OBJS-$(CONFIG_MPEG2_VAAPI_HWACCEL) += vaapi_mpeg2.o
|
||||
OBJS-$(CONFIG_MPEG2VIDEO_DECODER) += mpeg12.o mpeg12data.o
|
||||
OBJS-$(CONFIG_MPEG2VIDEO_ENCODER) += mpeg12enc.o mpeg12.o \
|
||||
timecode.o
|
||||
OBJS-$(CONFIG_MPEG4_VAAPI_HWACCEL) += vaapi_mpeg4.o
|
||||
OBJS-$(CONFIG_MPL2_DECODER) += mpl2dec.o ass.o
|
||||
OBJS-$(CONFIG_MSMPEG4V1_DECODER) += msmpeg4dec.o msmpeg4.o msmpeg4data.o
|
||||
OBJS-$(CONFIG_MSMPEG4V2_DECODER) += msmpeg4dec.o msmpeg4.o msmpeg4data.o \
|
||||
h263dec.o h263.o ituh263dec.o \
|
||||
mpeg4videodec.o
|
||||
OBJS-$(CONFIG_MSMPEG4V1_DECODER) += msmpeg4.o msmpeg4data.o
|
||||
OBJS-$(CONFIG_MSMPEG4V2_DECODER) += msmpeg4.o msmpeg4data.o h263dec.o \
|
||||
h263.o ituh263dec.o mpeg4videodec.o
|
||||
OBJS-$(CONFIG_MSMPEG4V2_ENCODER) += msmpeg4.o msmpeg4enc.o msmpeg4data.o \
|
||||
h263.o
|
||||
OBJS-$(CONFIG_MSMPEG4V3_DECODER) += msmpeg4dec.o msmpeg4.o msmpeg4data.o \
|
||||
h263dec.o h263.o ituh263dec.o \
|
||||
h263dec.o h263.o ituh263dec.o \
|
||||
mpeg4videodec.o
|
||||
OBJS-$(CONFIG_MSMPEG4V3_DECODER) += msmpeg4.o msmpeg4data.o h263dec.o \
|
||||
h263.o ituh263dec.o mpeg4videodec.o
|
||||
OBJS-$(CONFIG_MSMPEG4V3_ENCODER) += msmpeg4.o msmpeg4enc.o msmpeg4data.o \
|
||||
h263.o
|
||||
h263dec.o h263.o ituh263dec.o \
|
||||
mpeg4videodec.o
|
||||
OBJS-$(CONFIG_MSRLE_DECODER) += msrle.o msrledec.o
|
||||
OBJS-$(CONFIG_MSA1_DECODER) += mss3.o mss34dsp.o
|
||||
OBJS-$(CONFIG_MSS1_DECODER) += mss1.o mss12.o
|
||||
@@ -347,11 +338,11 @@ OBJS-$(CONFIG_PNG_DECODER) += png.o pngdec.o pngdsp.o
|
||||
OBJS-$(CONFIG_PNG_ENCODER) += png.o pngenc.o
|
||||
OBJS-$(CONFIG_PPM_DECODER) += pnmdec.o pnm.o
|
||||
OBJS-$(CONFIG_PPM_ENCODER) += pnmenc.o pnm.o
|
||||
OBJS-$(CONFIG_PRORES_DECODER) += proresdec2.o proresdsp.o proresdata.o
|
||||
OBJS-$(CONFIG_PRORES_DECODER) += proresdec2.o proresdsp.o
|
||||
OBJS-$(CONFIG_PRORES_LGPL_DECODER) += proresdec_lgpl.o proresdsp.o proresdata.o
|
||||
OBJS-$(CONFIG_PRORES_ENCODER) += proresenc_anatoliy.o
|
||||
OBJS-$(CONFIG_PRORES_AW_ENCODER) += proresenc_anatoliy.o
|
||||
OBJS-$(CONFIG_PRORES_KS_ENCODER) += proresenc_kostya.o proresdata.o proresdsp.o
|
||||
OBJS-$(CONFIG_PRORES_ANATOLIY_ENCODER) += proresenc_anatoliy.o
|
||||
OBJS-$(CONFIG_PRORES_KOSTYA_ENCODER) += proresenc_kostya.o proresdata.o proresdsp.o
|
||||
OBJS-$(CONFIG_PTX_DECODER) += ptx.o
|
||||
OBJS-$(CONFIG_QCELP_DECODER) += qcelpdec.o \
|
||||
celp_filters.o acelp_vectors.o \
|
||||
@@ -386,7 +377,6 @@ OBJS-$(CONFIG_RV30_DECODER) += rv30.o rv34.o rv30dsp.o rv34dsp.o
|
||||
OBJS-$(CONFIG_RV40_DECODER) += rv40.o rv34.o rv34dsp.o rv40dsp.o
|
||||
OBJS-$(CONFIG_SAMI_DECODER) += samidec.o ass.o
|
||||
OBJS-$(CONFIG_S302M_DECODER) += s302m.o
|
||||
OBJS-$(CONFIG_S302M_ENCODER) += s302menc.o
|
||||
OBJS-$(CONFIG_SANM_DECODER) += sanm.o
|
||||
OBJS-$(CONFIG_SGI_DECODER) += sgidec.o
|
||||
OBJS-$(CONFIG_SGI_ENCODER) += sgienc.o rle.o
|
||||
@@ -399,9 +389,8 @@ OBJS-$(CONFIG_SIPR_DECODER) += sipr.o acelp_pitch_delay.o \
|
||||
OBJS-$(CONFIG_SMACKAUD_DECODER) += smacker.o
|
||||
OBJS-$(CONFIG_SMACKER_DECODER) += smacker.o
|
||||
OBJS-$(CONFIG_SMC_DECODER) += smc.o
|
||||
OBJS-$(CONFIG_SMVJPEG_DECODER) += smvjpegdec.o
|
||||
OBJS-$(CONFIG_SNOW_DECODER) += snowdec.o snow.o snow_dwt.o
|
||||
OBJS-$(CONFIG_SNOW_ENCODER) += snowenc.o snow.o snow_dwt.o \
|
||||
OBJS-$(CONFIG_SNOW_DECODER) += snowdec.o snow.o
|
||||
OBJS-$(CONFIG_SNOW_ENCODER) += snowenc.o snow.o \
|
||||
h263.o ituh263enc.o
|
||||
OBJS-$(CONFIG_SOL_DPCM_DECODER) += dpcm.o
|
||||
OBJS-$(CONFIG_SONIC_DECODER) += sonic.o
|
||||
@@ -431,7 +420,7 @@ OBJS-$(CONFIG_TARGA_Y216_DECODER) += targa_y216dec.o
|
||||
OBJS-$(CONFIG_THEORA_DECODER) += xiph.o
|
||||
OBJS-$(CONFIG_THP_DECODER) += mjpegdec.o mjpeg.o
|
||||
OBJS-$(CONFIG_TIERTEXSEQVIDEO_DECODER) += tiertexseqv.o
|
||||
OBJS-$(CONFIG_TIFF_DECODER) += tiff.o lzw.o faxcompr.o tiff_data.o tiff_common.o
|
||||
OBJS-$(CONFIG_TIFF_DECODER) += tiff.o lzw.o faxcompr.o tiff_data.o
|
||||
OBJS-$(CONFIG_TIFF_ENCODER) += tiffenc.o rle.o lzwenc.o tiff_data.o
|
||||
OBJS-$(CONFIG_TMV_DECODER) += tmv.o cga_data.o
|
||||
OBJS-$(CONFIG_TRUEHD_DECODER) += mlpdec.o mlpdsp.o
|
||||
@@ -440,9 +429,8 @@ OBJS-$(CONFIG_TRUEMOTION2_DECODER) += truemotion2.o
|
||||
OBJS-$(CONFIG_TRUESPEECH_DECODER) += truespeech.o
|
||||
OBJS-$(CONFIG_TSCC_DECODER) += tscc.o msrledec.o
|
||||
OBJS-$(CONFIG_TSCC2_DECODER) += tscc2.o
|
||||
OBJS-$(CONFIG_TTA_DECODER) += tta.o ttadata.o
|
||||
OBJS-$(CONFIG_TTA_ENCODER) += ttaenc.o ttadata.o
|
||||
OBJS-$(CONFIG_TWINVQ_DECODER) += twinvqdec.o twinvq.o
|
||||
OBJS-$(CONFIG_TTA_DECODER) += tta.o
|
||||
OBJS-$(CONFIG_TWINVQ_DECODER) += twinvq.o
|
||||
OBJS-$(CONFIG_TXD_DECODER) += txd.o s3tc.o
|
||||
OBJS-$(CONFIG_ULTI_DECODER) += ulti.o
|
||||
OBJS-$(CONFIG_UTVIDEO_DECODER) += utvideodec.o utvideo.o
|
||||
@@ -459,13 +447,16 @@ OBJS-$(CONFIG_V210X_DECODER) += v210x.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 \
|
||||
msmpeg4dec.o msmpeg4.o msmpeg4data.o \
|
||||
intrax8.o intrax8dsp.o wmv2dsp.o
|
||||
msmpeg4.o msmpeg4data.o \
|
||||
intrax8.o intrax8dsp.o
|
||||
OBJS-$(CONFIG_VC1_DXVA2_HWACCEL) += dxva2_vc1.o
|
||||
OBJS-$(CONFIG_VC1_VAAPI_HWACCEL) += vaapi_vc1.o
|
||||
OBJS-$(CONFIG_VCR1_DECODER) += vcr1.o
|
||||
OBJS-$(CONFIG_VCR1_ENCODER) += vcr1.o
|
||||
OBJS-$(CONFIG_VMDAUDIO_DECODER) += vmdav.o
|
||||
OBJS-$(CONFIG_VMDVIDEO_DECODER) += vmdav.o
|
||||
OBJS-$(CONFIG_VMNC_DECODER) += vmnc.o
|
||||
OBJS-$(CONFIG_VORBIS_DECODER) += vorbisdec.o vorbisdsp.o vorbis.o \
|
||||
OBJS-$(CONFIG_VORBIS_DECODER) += vorbisdec.o vorbis.o \
|
||||
vorbis_data.o xiph.o
|
||||
OBJS-$(CONFIG_VORBIS_ENCODER) += vorbisenc.o vorbis.o \
|
||||
vorbis_data.o
|
||||
@@ -475,13 +466,9 @@ OBJS-$(CONFIG_VP5_DECODER) += vp5.o vp56.o vp56data.o vp56dsp.o \
|
||||
OBJS-$(CONFIG_VP6_DECODER) += vp6.o vp56.o vp56data.o vp56dsp.o \
|
||||
vp6dsp.o vp56rac.o
|
||||
OBJS-$(CONFIG_VP8_DECODER) += vp8.o vp8dsp.o vp56rac.o
|
||||
OBJS-$(CONFIG_VP9_DECODER) += vp9.o vp9dsp.o vp56rac.o
|
||||
OBJS-$(CONFIG_VPLAYER_DECODER) += textdec.o ass.o
|
||||
OBJS-$(CONFIG_VQA_DECODER) += vqavideo.o
|
||||
OBJS-$(CONFIG_WAVPACK_DECODER) += wavpack.o
|
||||
OBJS-$(CONFIG_WAVPACK_ENCODER) += wavpackenc.o
|
||||
OBJS-$(CONFIG_WEBP_DECODER) += vp8.o vp8dsp.o vp56rac.o
|
||||
OBJS-$(CONFIG_WEBP_DECODER) += webp.o
|
||||
OBJS-$(CONFIG_WEBVTT_DECODER) += webvttdec.o
|
||||
OBJS-$(CONFIG_WMALOSSLESS_DECODER) += wmalosslessdec.o wma_common.o
|
||||
OBJS-$(CONFIG_WMAPRO_DECODER) += wmaprodec.o wma.o wma_common.o
|
||||
@@ -492,12 +479,13 @@ OBJS-$(CONFIG_WMAV2_ENCODER) += wmaenc.o wma.o wma_common.o aactab.o
|
||||
OBJS-$(CONFIG_WMAVOICE_DECODER) += wmavoice.o \
|
||||
celp_filters.o \
|
||||
acelp_vectors.o acelp_filters.o
|
||||
OBJS-$(CONFIG_WMV1_DECODER) += msmpeg4dec.o msmpeg4.o msmpeg4data.o
|
||||
OBJS-$(CONFIG_WMV2_DECODER) += wmv2dec.o wmv2.o wmv2dsp.o \
|
||||
msmpeg4dec.o msmpeg4.o msmpeg4data.o \
|
||||
OBJS-$(CONFIG_WMV1_DECODER) += msmpeg4.o msmpeg4data.o
|
||||
OBJS-$(CONFIG_WMV2_DECODER) += wmv2dec.o wmv2.o \
|
||||
msmpeg4.o msmpeg4data.o \
|
||||
intrax8.o intrax8dsp.o
|
||||
OBJS-$(CONFIG_WMV2_ENCODER) += wmv2enc.o wmv2.o wmv2dsp.o \
|
||||
msmpeg4.o msmpeg4enc.o msmpeg4data.o
|
||||
OBJS-$(CONFIG_WMV2_ENCODER) += wmv2enc.o wmv2.o \
|
||||
msmpeg4.o msmpeg4enc.o msmpeg4data.o \
|
||||
mpeg4videodec.o ituh263dec.o h263dec.o
|
||||
OBJS-$(CONFIG_WNV1_DECODER) += wnv1.o
|
||||
OBJS-$(CONFIG_WS_SND1_DECODER) += ws-snd1.o
|
||||
OBJS-$(CONFIG_XAN_DPCM_DECODER) += dpcm.o
|
||||
@@ -527,8 +515,8 @@ OBJS-$(CONFIG_ZMBV_ENCODER) += zmbvenc.o
|
||||
# (AD)PCM decoders/encoders
|
||||
OBJS-$(CONFIG_PCM_ALAW_DECODER) += pcm.o
|
||||
OBJS-$(CONFIG_PCM_ALAW_ENCODER) += pcm.o
|
||||
OBJS-$(CONFIG_PCM_BLURAY_DECODER) += pcm-bluray.o
|
||||
OBJS-$(CONFIG_PCM_DVD_DECODER) += pcm-dvd.o
|
||||
OBJS-$(CONFIG_PCM_BLURAY_DECODER) += pcm-mpeg.o
|
||||
OBJS-$(CONFIG_PCM_DVD_DECODER) += pcm.o
|
||||
OBJS-$(CONFIG_PCM_F32BE_DECODER) += pcm.o
|
||||
OBJS-$(CONFIG_PCM_F32BE_ENCODER) += pcm.o
|
||||
OBJS-$(CONFIG_PCM_F32LE_DECODER) += pcm.o
|
||||
@@ -587,7 +575,6 @@ OBJS-$(CONFIG_ADPCM_ADX_DECODER) += adxdec.o adx.o
|
||||
OBJS-$(CONFIG_ADPCM_ADX_ENCODER) += adxenc.o adx.o
|
||||
OBJS-$(CONFIG_ADPCM_AFC_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_CT_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_DTK_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_EA_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_EA_MAXIS_XA_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_EA_R1_DECODER) += adpcm.o adpcm_data.o
|
||||
@@ -608,7 +595,6 @@ OBJS-$(CONFIG_ADPCM_IMA_ISS_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_OKI_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_QT_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_QT_ENCODER) += adpcmenc.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_RAD_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_SMJPEG_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_WAV_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_WAV_ENCODER) += adpcmenc.o adpcm_data.o
|
||||
@@ -626,23 +612,6 @@ OBJS-$(CONFIG_ADPCM_YAMAHA_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_YAMAHA_ENCODER) += adpcmenc.o adpcm_data.o
|
||||
OBJS-$(CONFIG_VIMA_DECODER) += vima.o adpcm_data.o
|
||||
|
||||
# hardware accelerators
|
||||
OBJS-$(CONFIG_H263_VAAPI_HWACCEL) += vaapi_mpeg4.o vaapi_mpeg.o
|
||||
OBJS-$(CONFIG_H263_VDPAU_HWACCEL) += vdpau_mpeg4.o
|
||||
OBJS-$(CONFIG_H264_DXVA2_HWACCEL) += dxva2_h264.o
|
||||
OBJS-$(CONFIG_H264_VAAPI_HWACCEL) += vaapi_h264.o
|
||||
OBJS-$(CONFIG_H264_VDA_HWACCEL) += vda_h264.o
|
||||
OBJS-$(CONFIG_H264_VDPAU_HWACCEL) += vdpau_h264.o
|
||||
OBJS-$(CONFIG_MPEG1_VDPAU_HWACCEL) += vdpau_mpeg12.o
|
||||
OBJS-$(CONFIG_MPEG2_DXVA2_HWACCEL) += dxva2_mpeg2.o
|
||||
OBJS-$(CONFIG_MPEG2_VAAPI_HWACCEL) += vaapi_mpeg2.o vaapi_mpeg.o
|
||||
OBJS-$(CONFIG_MPEG2_VDPAU_HWACCEL) += vdpau_mpeg12.o
|
||||
OBJS-$(CONFIG_MPEG4_VAAPI_HWACCEL) += vaapi_mpeg4.o vaapi_mpeg.o
|
||||
OBJS-$(CONFIG_MPEG4_VDPAU_HWACCEL) += vdpau_mpeg4.o
|
||||
OBJS-$(CONFIG_VC1_DXVA2_HWACCEL) += dxva2_vc1.o
|
||||
OBJS-$(CONFIG_VC1_VAAPI_HWACCEL) += vaapi_vc1.o vaapi_mpeg.o
|
||||
OBJS-$(CONFIG_VC1_VDPAU_HWACCEL) += vdpau_vc1.o
|
||||
|
||||
# libavformat dependencies
|
||||
OBJS-$(CONFIG_ADTS_MUXER) += mpeg4audio.o
|
||||
OBJS-$(CONFIG_ADX_DEMUXER) += adx.o
|
||||
@@ -690,7 +659,6 @@ OBJS-$(CONFIG_WTV_DEMUXER) += mpeg4audio.o mpegaudiodata.o
|
||||
OBJS-$(CONFIG_LIBAACPLUS_ENCODER) += libaacplus.o
|
||||
OBJS-$(CONFIG_LIBCELT_DECODER) += libcelt_dec.o
|
||||
OBJS-$(CONFIG_LIBFAAC_ENCODER) += libfaac.o
|
||||
OBJS-$(CONFIG_LIBFDK_AAC_DECODER) += libfdk-aacdec.o
|
||||
OBJS-$(CONFIG_LIBFDK_AAC_ENCODER) += libfdk-aacenc.o
|
||||
OBJS-$(CONFIG_LIBGSM_DECODER) += libgsm.o
|
||||
OBJS-$(CONFIG_LIBGSM_ENCODER) += libgsm.o
|
||||
@@ -712,7 +680,6 @@ OBJS-$(CONFIG_LIBSCHROEDINGER_DECODER) += libschroedingerdec.o \
|
||||
libschroedinger.o
|
||||
OBJS-$(CONFIG_LIBSCHROEDINGER_ENCODER) += libschroedingerenc.o \
|
||||
libschroedinger.o
|
||||
OBJS-$(CONFIG_LIBSHINE_ENCODER) += libshine.o
|
||||
OBJS-$(CONFIG_LIBSPEEX_DECODER) += libspeexdec.o
|
||||
OBJS-$(CONFIG_LIBSPEEX_ENCODER) += libspeexenc.o
|
||||
OBJS-$(CONFIG_LIBSTAGEFRIGHT_H264_DECODER)+= libstagefright.o
|
||||
@@ -725,15 +692,11 @@ OBJS-$(CONFIG_LIBVO_AMRWBENC_ENCODER) += libvo-amrwbenc.o
|
||||
OBJS-$(CONFIG_LIBVORBIS_DECODER) += libvorbisdec.o
|
||||
OBJS-$(CONFIG_LIBVORBIS_ENCODER) += libvorbisenc.o \
|
||||
vorbis_data.o vorbis_parser.o xiph.o
|
||||
OBJS-$(CONFIG_LIBVPX_VP8_DECODER) += libvpxdec.o
|
||||
OBJS-$(CONFIG_LIBVPX_VP8_ENCODER) += libvpxenc.o
|
||||
OBJS-$(CONFIG_LIBVPX_VP9_DECODER) += libvpxdec.o
|
||||
OBJS-$(CONFIG_LIBVPX_VP9_ENCODER) += libvpxenc.o
|
||||
OBJS-$(CONFIG_LIBWAVPACK_ENCODER) += libwavpackenc.o
|
||||
OBJS-$(CONFIG_LIBVPX_DECODER) += libvpxdec.o
|
||||
OBJS-$(CONFIG_LIBVPX_ENCODER) += libvpxenc.o
|
||||
OBJS-$(CONFIG_LIBX264_ENCODER) += libx264.o
|
||||
OBJS-$(CONFIG_LIBXAVS_ENCODER) += libxavs.o
|
||||
OBJS-$(CONFIG_LIBXVID_ENCODER) += libxvid.o
|
||||
OBJS-$(CONFIG_LIBZVBI_TELETEXT_DECODER) += libzvbi-teletextdec.o
|
||||
|
||||
# parsers
|
||||
OBJS-$(CONFIG_AAC_PARSER) += aac_parser.o aac_ac3_parser.o \
|
||||
@@ -748,9 +711,7 @@ OBJS-$(CONFIG_COOK_PARSER) += cook_parser.o
|
||||
OBJS-$(CONFIG_DCA_PARSER) += dca_parser.o dca.o
|
||||
OBJS-$(CONFIG_DIRAC_PARSER) += dirac_parser.o
|
||||
OBJS-$(CONFIG_DNXHD_PARSER) += dnxhd_parser.o
|
||||
OBJS-$(CONFIG_DPX_PARSER) += dpx_parser.o
|
||||
OBJS-$(CONFIG_DVBSUB_PARSER) += dvbsub_parser.o
|
||||
OBJS-$(CONFIG_DVD_NAV_PARSER) += dvd_nav_parser.o
|
||||
OBJS-$(CONFIG_DVDSUB_PARSER) += dvdsub_parser.o
|
||||
OBJS-$(CONFIG_FLAC_PARSER) += flac_parser.o flacdata.o flac.o \
|
||||
vorbis_data.o
|
||||
@@ -762,7 +723,6 @@ OBJS-$(CONFIG_H264_PARSER) += h264_parser.o h264.o \
|
||||
h264_refs.o h264_sei.o h264_direct.o \
|
||||
h264_loopfilter.o h264_cabac.o \
|
||||
h264_cavlc.o h264_ps.o
|
||||
OBJS-$(CONFIG_HEVC_PARSER) += hevc_parser.o
|
||||
OBJS-$(CONFIG_MJPEG_PARSER) += mjpeg_parser.o
|
||||
OBJS-$(CONFIG_MLP_PARSER) += mlp_parser.o mlp.o
|
||||
OBJS-$(CONFIG_MPEG4VIDEO_PARSER) += mpeg4video_parser.o h263.o \
|
||||
@@ -802,11 +762,9 @@ OBJS-$(CONFIG_REMOVE_EXTRADATA_BSF) += remove_extradata_bsf.o
|
||||
OBJS-$(CONFIG_TEXT2MOVSUB_BSF) += movsub_bsf.o
|
||||
|
||||
# thread libraries
|
||||
OBJS-$(HAVE_PTHREADS) += pthread.o
|
||||
OBJS-$(HAVE_W32THREADS) += pthread.o
|
||||
OBJS-$(HAVE_OS2THREADS) += pthread.o
|
||||
|
||||
OBJS-$(CONFIG_FRAME_THREAD_ENCODER) += frame_thread_encoder.o
|
||||
OBJS-$(HAVE_PTHREADS) += pthread.o frame_thread_encoder.o
|
||||
OBJS-$(HAVE_W32THREADS) += pthread.o frame_thread_encoder.o
|
||||
OBJS-$(HAVE_OS2THREADS) += pthread.o frame_thread_encoder.o
|
||||
|
||||
SKIPHEADERS += %_tablegen.h \
|
||||
%_tables.h \
|
||||
@@ -822,19 +780,20 @@ SKIPHEADERS-$(CONFIG_LIBUTVIDEO) += libutvideo.h
|
||||
SKIPHEADERS-$(CONFIG_MPEG_XVMC_DECODER) += xvmc.h
|
||||
SKIPHEADERS-$(CONFIG_VAAPI) += vaapi_internal.h
|
||||
SKIPHEADERS-$(CONFIG_VDA) += vda.h
|
||||
SKIPHEADERS-$(CONFIG_VDPAU) += vdpau.h vdpau_internal.h
|
||||
SKIPHEADERS-$(CONFIG_VDPAU) += vdpau.h
|
||||
SKIPHEADERS-$(HAVE_OS2THREADS) += os2threads.h
|
||||
SKIPHEADERS-$(HAVE_W32THREADS) += w32pthreads.h
|
||||
|
||||
TESTPROGS = cabac \
|
||||
dct \
|
||||
fft \
|
||||
fft-fixed \
|
||||
fft-fixed32 \
|
||||
golomb \
|
||||
iirfilter \
|
||||
imgconvert \
|
||||
rangecoder \
|
||||
snowenc \
|
||||
|
||||
TESTPROGS-$(CONFIG_DCT) += dct
|
||||
TESTPROGS-$(HAVE_MMX) += motion
|
||||
TESTOBJS = dctref.o
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
/*
|
||||
* Video Acceleration API (video decoding)
|
||||
* HW decode acceleration for MPEG-2, MPEG-4, H.264 and VC-1
|
||||
*
|
||||
* Copyright (C) 2013 Anton Khirnov
|
||||
* a64 video encoder - basic headers
|
||||
* Copyright (c) 2009 Tobias Bindhammer
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
@@ -21,28 +19,40 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* a64 video encoder - basic headers
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_A64ENC_H
|
||||
#define AVCODEC_A64ENC_H
|
||||
|
||||
#include "libavutil/lfg.h"
|
||||
#include "avcodec.h"
|
||||
#include "vaapi_internal.h"
|
||||
|
||||
int ff_vaapi_mpeg_end_frame(AVCodecContext *avctx)
|
||||
{
|
||||
struct vaapi_context * const vactx = avctx->hwaccel_context;
|
||||
MpegEncContext *s = avctx->priv_data;
|
||||
int ret;
|
||||
#define C64XRES 320
|
||||
#define C64YRES 200
|
||||
|
||||
ret = ff_vaapi_commit_slices(vactx);
|
||||
if (ret < 0)
|
||||
goto finish;
|
||||
typedef struct A64Context {
|
||||
/* general variables */
|
||||
AVFrame picture;
|
||||
|
||||
ret = ff_vaapi_render_picture(vactx,
|
||||
ff_vaapi_get_surface_id(s->current_picture_ptr));
|
||||
if (ret < 0)
|
||||
goto finish;
|
||||
/* variables for multicolor modes */
|
||||
AVLFG randctx;
|
||||
int mc_lifetime;
|
||||
int mc_use_5col;
|
||||
unsigned mc_frame_counter;
|
||||
int *mc_meta_charset;
|
||||
int *mc_charmap;
|
||||
int *mc_best_cb;
|
||||
int mc_luma_vals[5];
|
||||
uint8_t *mc_charset;
|
||||
uint8_t *mc_colram;
|
||||
uint8_t *mc_palette;
|
||||
int mc_pal_size;
|
||||
|
||||
ff_mpeg_draw_horiz_band(s, 0, s->avctx->height);
|
||||
|
||||
finish:
|
||||
ff_vaapi_common_end_frame(avctx);
|
||||
return ret;
|
||||
}
|
||||
/* pts of the next packet that will be output */
|
||||
int64_t next_pts;
|
||||
} A64Context;
|
||||
|
||||
#endif /* AVCODEC_A64ENC_H */
|
||||
@@ -24,6 +24,7 @@
|
||||
* a64 video encoder - multicolor modes
|
||||
*/
|
||||
|
||||
#include "a64enc.h"
|
||||
#include "a64colors.h"
|
||||
#include "a64tables.h"
|
||||
#include "elbg.h"
|
||||
@@ -36,31 +37,6 @@
|
||||
#define INTERLACED 1
|
||||
#define CROP_SCREENS 1
|
||||
|
||||
#define C64XRES 320
|
||||
#define C64YRES 200
|
||||
|
||||
typedef struct A64Context {
|
||||
/* general variables */
|
||||
AVFrame picture;
|
||||
|
||||
/* variables for multicolor modes */
|
||||
AVLFG randctx;
|
||||
int mc_lifetime;
|
||||
int mc_use_5col;
|
||||
unsigned mc_frame_counter;
|
||||
int *mc_meta_charset;
|
||||
int *mc_charmap;
|
||||
int *mc_best_cb;
|
||||
int mc_luma_vals[5];
|
||||
uint8_t *mc_charset;
|
||||
uint8_t *mc_colram;
|
||||
uint8_t *mc_palette;
|
||||
int mc_pal_size;
|
||||
|
||||
/* pts of the next packet that will be output */
|
||||
int64_t next_pts;
|
||||
} A64Context;
|
||||
|
||||
/* gray gradient */
|
||||
static const int mc_colors[5]={0x0,0xb,0xc,0xf,0x1};
|
||||
|
||||
@@ -396,7 +372,6 @@ static int a64multi_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||
#if CONFIG_A64MULTI_ENCODER
|
||||
AVCodec ff_a64multi_encoder = {
|
||||
.name = "a64multi",
|
||||
.long_name = NULL_IF_CONFIG_SMALL("Multicolor charset for Commodore 64"),
|
||||
.type = AVMEDIA_TYPE_VIDEO,
|
||||
.id = AV_CODEC_ID_A64_MULTI,
|
||||
.priv_data_size = sizeof(A64Context),
|
||||
@@ -404,13 +379,13 @@ AVCodec ff_a64multi_encoder = {
|
||||
.encode2 = a64multi_encode_frame,
|
||||
.close = a64multi_close_encoder,
|
||||
.pix_fmts = (const enum AVPixelFormat[]) {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE},
|
||||
.long_name = NULL_IF_CONFIG_SMALL("Multicolor charset for Commodore 64"),
|
||||
.capabilities = CODEC_CAP_DELAY,
|
||||
};
|
||||
#endif
|
||||
#if CONFIG_A64MULTI5_ENCODER
|
||||
AVCodec ff_a64multi5_encoder = {
|
||||
.name = "a64multi5",
|
||||
.long_name = NULL_IF_CONFIG_SMALL("Multicolor charset for Commodore 64, extended with 5th color (colram)"),
|
||||
.type = AVMEDIA_TYPE_VIDEO,
|
||||
.id = AV_CODEC_ID_A64_MULTI5,
|
||||
.priv_data_size = sizeof(A64Context),
|
||||
@@ -418,6 +393,7 @@ AVCodec ff_a64multi5_encoder = {
|
||||
.encode2 = a64multi_encode_frame,
|
||||
.close = a64multi_close_encoder,
|
||||
.pix_fmts = (const enum AVPixelFormat[]) {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE},
|
||||
.long_name = NULL_IF_CONFIG_SMALL("Multicolor charset for Commodore 64, extended with 5th color (colram)"),
|
||||
.capabilities = CODEC_CAP_DELAY,
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
#include "libavutil/float_dsp.h"
|
||||
#include "avcodec.h"
|
||||
#include "dsputil.h"
|
||||
#include "fft.h"
|
||||
#include "mpeg4audio.h"
|
||||
#include "sbr.h"
|
||||
@@ -157,7 +158,7 @@ typedef struct LongTermPrediction {
|
||||
typedef struct IndividualChannelStream {
|
||||
uint8_t max_sfb; ///< number of scalefactor bands per group
|
||||
enum WindowSequence window_sequence[2];
|
||||
uint8_t use_kb_window[2]; ///< If set, use Kaiser-Bessel window, otherwise use a sine window.
|
||||
uint8_t use_kb_window[2]; ///< If set, use Kaiser-Bessel window, otherwise use a sinus window.
|
||||
int num_window_groups;
|
||||
uint8_t group_len[8];
|
||||
LongTermPrediction ltp;
|
||||
@@ -234,7 +235,7 @@ typedef struct SingleChannelElement {
|
||||
int sf_idx[128]; ///< scalefactor indices (used by encoder)
|
||||
uint8_t zeroes[128]; ///< band is not coded (used by encoder)
|
||||
DECLARE_ALIGNED(32, float, coeffs)[1024]; ///< coefficients for IMDCT
|
||||
DECLARE_ALIGNED(32, float, saved)[1536]; ///< overlap
|
||||
DECLARE_ALIGNED(32, float, saved)[1024]; ///< overlap
|
||||
DECLARE_ALIGNED(32, float, ret_buf)[2048]; ///< PCM output buffer
|
||||
DECLARE_ALIGNED(16, float, ltp_state)[3072]; ///< time signal for LTP
|
||||
PredictorState predictor_state[MAX_PREDICTORS];
|
||||
@@ -259,10 +260,10 @@ typedef struct ChannelElement {
|
||||
/**
|
||||
* main AAC context
|
||||
*/
|
||||
struct AACContext {
|
||||
typedef struct AACContext {
|
||||
AVClass *class;
|
||||
AVCodecContext *avctx;
|
||||
AVFrame *frame;
|
||||
AVFrame frame;
|
||||
|
||||
int is_saved; ///< Set if elements have stored overlap from previous frame.
|
||||
DynamicRangeControl che_drc;
|
||||
@@ -290,8 +291,8 @@ struct AACContext {
|
||||
*/
|
||||
FFTContext mdct;
|
||||
FFTContext mdct_small;
|
||||
FFTContext mdct_ld;
|
||||
FFTContext mdct_ltp;
|
||||
DSPContext dsp;
|
||||
FmtConvertContext fmt_conv;
|
||||
AVFloatDSPContext fdsp;
|
||||
int random_state;
|
||||
@@ -317,18 +318,6 @@ struct AACContext {
|
||||
|
||||
OutputConfiguration oc[2];
|
||||
int warned_num_aac_frames;
|
||||
|
||||
/* aacdec functions pointers */
|
||||
void (*imdct_and_windowing)(AACContext *ac, SingleChannelElement *sce);
|
||||
void (*apply_ltp)(AACContext *ac, SingleChannelElement *sce);
|
||||
void (*apply_tns)(float coef[1024], TemporalNoiseShaping *tns,
|
||||
IndividualChannelStream *ics, int decode);
|
||||
void (*windowing_and_mdct_ltp)(AACContext *ac, float *out,
|
||||
float *in, IndividualChannelStream *ics);
|
||||
void (*update_ltp)(AACContext *ac, SingleChannelElement *sce);
|
||||
|
||||
};
|
||||
|
||||
void ff_aacdec_init_mips(AACContext *c);
|
||||
} AACContext;
|
||||
|
||||
#endif /* AVCODEC_AAC_H */
|
||||
|
||||
@@ -61,8 +61,7 @@ static int aac_adtstoasc_filter(AVBitStreamFilterContext *bsfc,
|
||||
}
|
||||
|
||||
if (!hdr.crc_absent && hdr.num_aac_frames > 1) {
|
||||
avpriv_report_missing_feature(avctx,
|
||||
"Multiple RDBs per frame with CRC");
|
||||
av_log_missing_feature(avctx, "Multiple RDBs per frame with CRC", 0);
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
|
||||
@@ -75,10 +74,7 @@ static int aac_adtstoasc_filter(AVBitStreamFilterContext *bsfc,
|
||||
if (!hdr.chan_config) {
|
||||
init_get_bits(&gb, buf, buf_size * 8);
|
||||
if (get_bits(&gb, 3) != 5) {
|
||||
avpriv_report_missing_feature(avctx,
|
||||
"PCE-based channel configuration "
|
||||
"without PCE as first syntax "
|
||||
"element");
|
||||
av_log_missing_feature(avctx, "PCE based channel configuration, where the PCE is not the first syntax element", 0);
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
init_put_bits(&pb, pce_data, MAX_PCE_SIZE);
|
||||
@@ -112,7 +108,7 @@ static int aac_adtstoasc_filter(AVBitStreamFilterContext *bsfc,
|
||||
}
|
||||
|
||||
AVBitStreamFilter ff_aac_adtstoasc_bsf = {
|
||||
.name = "aac_adtstoasc",
|
||||
.priv_data_size = sizeof(AACBSFContext),
|
||||
.filter = aac_adtstoasc_filter,
|
||||
"aac_adtstoasc",
|
||||
sizeof(AACBSFContext),
|
||||
aac_adtstoasc_filter,
|
||||
};
|
||||
|
||||
@@ -35,7 +35,7 @@ void ff_aac_tableinit(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < 428; i++)
|
||||
ff_aac_pow2sf_tab[i] = pow(2, (i - POW_SF2_ZERO) / 4.0);
|
||||
ff_aac_pow2sf_tab[i] = pow(2, (i - POW_SF2_ZERO) / 4.);
|
||||
}
|
||||
#endif /* CONFIG_HARDCODED_TABLES */
|
||||
|
||||
|
||||
@@ -1113,25 +1113,25 @@ static void search_for_ms(AACEncContext *s, ChannelElement *cpe,
|
||||
}
|
||||
|
||||
AACCoefficientsEncoder ff_aac_coders[AAC_CODER_NB] = {
|
||||
[AAC_CODER_FAAC] = {
|
||||
{
|
||||
search_for_quantizers_faac,
|
||||
encode_window_bands_info,
|
||||
quantize_and_encode_band,
|
||||
search_for_ms,
|
||||
},
|
||||
[AAC_CODER_ANMR] = {
|
||||
{
|
||||
search_for_quantizers_anmr,
|
||||
encode_window_bands_info,
|
||||
quantize_and_encode_band,
|
||||
search_for_ms,
|
||||
},
|
||||
[AAC_CODER_TWOLOOP] = {
|
||||
{
|
||||
search_for_quantizers_twoloop,
|
||||
codebook_trellis_rate,
|
||||
quantize_and_encode_band,
|
||||
search_for_ms,
|
||||
},
|
||||
[AAC_CODER_FAST] = {
|
||||
{
|
||||
search_for_quantizers_fast,
|
||||
encode_window_bands_info,
|
||||
quantize_and_encode_band,
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
* AAC decoder
|
||||
* Copyright (c) 2005-2006 Oded Shimon ( ods15 ods15 dyndns org )
|
||||
* Copyright (c) 2006-2007 Maxim Gavrilov ( maxim.gavrilov gmail com )
|
||||
* Copyright (c) 2008-2013 Alex Converse <alex.converse@gmail.com>
|
||||
*
|
||||
* AAC LATM decoder
|
||||
* Copyright (c) 2008-2010 Paul Kendall <paul@kcbbs.gen.nz>
|
||||
@@ -85,6 +84,7 @@
|
||||
#include "avcodec.h"
|
||||
#include "internal.h"
|
||||
#include "get_bits.h"
|
||||
#include "dsputil.h"
|
||||
#include "fft.h"
|
||||
#include "fmtconvert.h"
|
||||
#include "lpc.h"
|
||||
@@ -108,8 +108,6 @@
|
||||
|
||||
#if ARCH_ARM
|
||||
# include "arm/aac.h"
|
||||
#elif ARCH_MIPS
|
||||
# include "mips/aacdec_mips.h"
|
||||
#endif
|
||||
|
||||
static VLC vlc_scalefactors;
|
||||
@@ -193,15 +191,16 @@ static int frame_configure_elements(AVCodecContext *avctx)
|
||||
}
|
||||
|
||||
/* get output buffer */
|
||||
av_frame_unref(ac->frame);
|
||||
ac->frame->nb_samples = 2048;
|
||||
if ((ret = ff_get_buffer(avctx, ac->frame, 0)) < 0)
|
||||
ac->frame.nb_samples = 2048;
|
||||
if ((ret = ff_get_buffer(avctx, &ac->frame)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* map output channel pointers to AVFrame data */
|
||||
for (ch = 0; ch < avctx->channels; ch++) {
|
||||
if (ac->output_element[ch])
|
||||
ac->output_element[ch]->ret = (float *)ac->frame->extended_data[ch];
|
||||
ac->output_element[ch]->ret = (float *)ac->frame.extended_data[ch];
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -483,8 +482,8 @@ static int output_configure(AACContext *ac,
|
||||
|
||||
memcpy(ac->tag_che_map, ac->che, 4 * MAX_ELEM_ID * sizeof(ac->che[0][0]));
|
||||
if (layout) avctx->channel_layout = layout;
|
||||
ac->oc[1].channel_layout = layout;
|
||||
avctx->channels = ac->oc[1].channels = channels;
|
||||
ac->oc[1].channel_layout = layout;
|
||||
avctx->channels = ac->oc[1].channels = channels;
|
||||
ac->oc[1].status = oc_type;
|
||||
|
||||
if (get_new_frame) {
|
||||
@@ -746,12 +745,12 @@ static int decode_ga_specific_config(AACContext *ac, AVCodecContext *avctx,
|
||||
MPEG4AudioConfig *m4ac,
|
||||
int channel_config)
|
||||
{
|
||||
int extension_flag, ret, ep_config, res_flags;
|
||||
int extension_flag, ret;
|
||||
uint8_t layout_map[MAX_ELEM_ID*4][3];
|
||||
int tags = 0;
|
||||
|
||||
if (get_bits1(gb)) { // frameLengthFlag
|
||||
avpriv_request_sample(avctx, "960/120 MDCT window");
|
||||
av_log_missing_feature(avctx, "960/120 MDCT window", 1);
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
|
||||
@@ -792,90 +791,14 @@ static int decode_ga_specific_config(AACContext *ac, AVCodecContext *avctx,
|
||||
case AOT_ER_AAC_LTP:
|
||||
case AOT_ER_AAC_SCALABLE:
|
||||
case AOT_ER_AAC_LD:
|
||||
res_flags = get_bits(gb, 3);
|
||||
if (res_flags) {
|
||||
avpriv_report_missing_feature(avctx,
|
||||
"AAC data resilience (flags %x)",
|
||||
res_flags);
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
skip_bits(gb, 3); /* aacSectionDataResilienceFlag
|
||||
* aacScalefactorDataResilienceFlag
|
||||
* aacSpectralDataResilienceFlag
|
||||
*/
|
||||
break;
|
||||
}
|
||||
skip_bits1(gb); // extensionFlag3 (TBD in version 3)
|
||||
}
|
||||
switch (m4ac->object_type) {
|
||||
case AOT_ER_AAC_LC:
|
||||
case AOT_ER_AAC_LTP:
|
||||
case AOT_ER_AAC_SCALABLE:
|
||||
case AOT_ER_AAC_LD:
|
||||
ep_config = get_bits(gb, 2);
|
||||
if (ep_config) {
|
||||
avpriv_report_missing_feature(avctx,
|
||||
"epConfig %d", ep_config);
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int decode_eld_specific_config(AACContext *ac, AVCodecContext *avctx,
|
||||
GetBitContext *gb,
|
||||
MPEG4AudioConfig *m4ac,
|
||||
int channel_config)
|
||||
{
|
||||
int ret, ep_config, res_flags;
|
||||
uint8_t layout_map[MAX_ELEM_ID*4][3];
|
||||
int tags = 0;
|
||||
const int ELDEXT_TERM = 0;
|
||||
|
||||
m4ac->ps = 0;
|
||||
m4ac->sbr = 0;
|
||||
|
||||
if (get_bits1(gb)) { // frameLengthFlag
|
||||
avpriv_request_sample(avctx, "960/120 MDCT window");
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
|
||||
res_flags = get_bits(gb, 3);
|
||||
if (res_flags) {
|
||||
avpriv_report_missing_feature(avctx,
|
||||
"AAC data resilience (flags %x)",
|
||||
res_flags);
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
|
||||
if (get_bits1(gb)) { // ldSbrPresentFlag
|
||||
avpriv_report_missing_feature(avctx,
|
||||
"Low Delay SBR");
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
|
||||
while (get_bits(gb, 4) != ELDEXT_TERM) {
|
||||
int len = get_bits(gb, 4);
|
||||
if (len == 15)
|
||||
len += get_bits(gb, 8);
|
||||
if (len == 15 + 255)
|
||||
len += get_bits(gb, 16);
|
||||
if (get_bits_left(gb) < len * 8 + 4) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR, overread_err);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
skip_bits_long(gb, 8 * len);
|
||||
}
|
||||
|
||||
if ((ret = set_default_channel_config(avctx, layout_map,
|
||||
&tags, channel_config)))
|
||||
return ret;
|
||||
|
||||
if (ac && (ret = output_configure(ac, layout_map, tags, OC_GLOBAL_HDR, 0)))
|
||||
return ret;
|
||||
|
||||
ep_config = get_bits(gb, 2);
|
||||
if (ep_config) {
|
||||
avpriv_report_missing_feature(avctx,
|
||||
"epConfig %d", ep_config);
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -902,7 +825,7 @@ static int decode_audio_specific_config(AACContext *ac,
|
||||
|
||||
av_dlog(avctx, "audio specific config size %d\n", bit_size >> 3);
|
||||
for (i = 0; i < bit_size >> 3; i++)
|
||||
av_dlog(avctx, "%02x ", data[i]);
|
||||
av_dlog(avctx, "%02x ", data[i]);
|
||||
av_dlog(avctx, "\n");
|
||||
|
||||
if ((ret = init_get_bits(&gb, data, bit_size)) < 0)
|
||||
@@ -917,13 +840,6 @@ static int decode_audio_specific_config(AACContext *ac,
|
||||
m4ac->sampling_index);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if (m4ac->object_type == AOT_ER_AAC_LD &&
|
||||
(m4ac->sampling_index < 3 || m4ac->sampling_index > 7)) {
|
||||
av_log(avctx, AV_LOG_ERROR,
|
||||
"invalid low delay sampling rate index %d\n",
|
||||
m4ac->sampling_index);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
skip_bits_long(&gb, i);
|
||||
|
||||
@@ -931,22 +847,15 @@ static int decode_audio_specific_config(AACContext *ac,
|
||||
case AOT_AAC_MAIN:
|
||||
case AOT_AAC_LC:
|
||||
case AOT_AAC_LTP:
|
||||
case AOT_ER_AAC_LC:
|
||||
case AOT_ER_AAC_LD:
|
||||
if ((ret = decode_ga_specific_config(ac, avctx, &gb,
|
||||
m4ac, m4ac->chan_config)) < 0)
|
||||
return ret;
|
||||
break;
|
||||
case AOT_ER_AAC_ELD:
|
||||
if ((ret = decode_eld_specific_config(ac, avctx, &gb,
|
||||
m4ac, m4ac->chan_config)) < 0)
|
||||
return ret;
|
||||
break;
|
||||
default:
|
||||
avpriv_report_missing_feature(avctx,
|
||||
"Audio object type %s%d",
|
||||
m4ac->sbr == 1 ? "SBR+" : "",
|
||||
m4ac->object_type);
|
||||
av_log(avctx, AV_LOG_ERROR,
|
||||
"Audio object type %s%d is not supported.\n",
|
||||
m4ac->sbr == 1 ? "SBR+" : "",
|
||||
m4ac->object_type);
|
||||
return AVERROR(ENOSYS);
|
||||
}
|
||||
|
||||
@@ -1020,8 +929,6 @@ static void reset_predictor_group(PredictorState *ps, int group_num)
|
||||
sizeof(ff_aac_spectral_codes[num][0]), \
|
||||
size);
|
||||
|
||||
static void aacdec_init(AACContext *ac);
|
||||
|
||||
static av_cold int aac_decode_init(AVCodecContext *avctx)
|
||||
{
|
||||
AACContext *ac = avctx->priv_data;
|
||||
@@ -1030,8 +937,6 @@ static av_cold int aac_decode_init(AVCodecContext *avctx)
|
||||
ac->avctx = avctx;
|
||||
ac->oc[1].m4ac.sample_rate = avctx->sample_rate;
|
||||
|
||||
aacdec_init(ac);
|
||||
|
||||
avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
|
||||
|
||||
if (avctx->extradata_size > 0) {
|
||||
@@ -1089,6 +994,7 @@ static av_cold int aac_decode_init(AVCodecContext *avctx)
|
||||
|
||||
ff_aac_sbr_init();
|
||||
|
||||
ff_dsputil_init(&ac->dsp, avctx);
|
||||
ff_fmt_convert_init(&ac->fmt_conv, avctx);
|
||||
avpriv_float_dsp_init(&ac->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
|
||||
|
||||
@@ -1107,19 +1013,19 @@ static av_cold int aac_decode_init(AVCodecContext *avctx)
|
||||
352);
|
||||
|
||||
ff_mdct_init(&ac->mdct, 11, 1, 1.0 / (32768.0 * 1024.0));
|
||||
ff_mdct_init(&ac->mdct_ld, 10, 1, 1.0 / (32768.0 * 512.0));
|
||||
ff_mdct_init(&ac->mdct_small, 8, 1, 1.0 / (32768.0 * 128.0));
|
||||
ff_mdct_init(&ac->mdct_ltp, 11, 0, -2.0 * 32768.0);
|
||||
// window initialization
|
||||
ff_kbd_window_init(ff_aac_kbd_long_1024, 4.0, 1024);
|
||||
ff_kbd_window_init(ff_aac_kbd_long_512, 4.0, 512);
|
||||
ff_kbd_window_init(ff_aac_kbd_short_128, 6.0, 128);
|
||||
ff_init_ff_sine_windows(10);
|
||||
ff_init_ff_sine_windows( 9);
|
||||
ff_init_ff_sine_windows( 7);
|
||||
|
||||
cbrt_tableinit();
|
||||
|
||||
avcodec_get_frame_defaults(&ac->frame);
|
||||
avctx->coded_frame = &ac->frame;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1182,25 +1088,14 @@ static void decode_ltp(LongTermPrediction *ltp,
|
||||
static int decode_ics_info(AACContext *ac, IndividualChannelStream *ics,
|
||||
GetBitContext *gb)
|
||||
{
|
||||
int aot = ac->oc[1].m4ac.object_type;
|
||||
if (aot != AOT_ER_AAC_ELD) {
|
||||
if (get_bits1(gb)) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR, "Reserved bit set.\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
ics->window_sequence[1] = ics->window_sequence[0];
|
||||
ics->window_sequence[0] = get_bits(gb, 2);
|
||||
if (aot == AOT_ER_AAC_LD &&
|
||||
ics->window_sequence[0] != ONLY_LONG_SEQUENCE) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR,
|
||||
"AAC LD is only defined for ONLY_LONG_SEQUENCE but "
|
||||
"window sequence %d found.\n", ics->window_sequence[0]);
|
||||
ics->window_sequence[0] = ONLY_LONG_SEQUENCE;
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
ics->use_kb_window[1] = ics->use_kb_window[0];
|
||||
ics->use_kb_window[0] = get_bits1(gb);
|
||||
if (get_bits1(gb)) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR, "Reserved bit set.\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
ics->window_sequence[1] = ics->window_sequence[0];
|
||||
ics->window_sequence[0] = get_bits(gb, 2);
|
||||
ics->use_kb_window[1] = ics->use_kb_window[0];
|
||||
ics->use_kb_window[0] = get_bits1(gb);
|
||||
ics->num_window_groups = 1;
|
||||
ics->group_len[0] = 1;
|
||||
if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
|
||||
@@ -1222,36 +1117,21 @@ static int decode_ics_info(AACContext *ac, IndividualChannelStream *ics,
|
||||
} else {
|
||||
ics->max_sfb = get_bits(gb, 6);
|
||||
ics->num_windows = 1;
|
||||
if (aot == AOT_ER_AAC_LD || aot == AOT_ER_AAC_ELD) {
|
||||
ics->swb_offset = ff_swb_offset_512[ac->oc[1].m4ac.sampling_index];
|
||||
ics->num_swb = ff_aac_num_swb_512[ac->oc[1].m4ac.sampling_index];
|
||||
if (!ics->num_swb || !ics->swb_offset)
|
||||
return AVERROR_BUG;
|
||||
} else {
|
||||
ics->swb_offset = ff_swb_offset_1024[ac->oc[1].m4ac.sampling_index];
|
||||
ics->num_swb = ff_aac_num_swb_1024[ac->oc[1].m4ac.sampling_index];
|
||||
}
|
||||
ics->swb_offset = ff_swb_offset_1024[ac->oc[1].m4ac.sampling_index];
|
||||
ics->num_swb = ff_aac_num_swb_1024[ac->oc[1].m4ac.sampling_index];
|
||||
ics->tns_max_bands = ff_tns_max_bands_1024[ac->oc[1].m4ac.sampling_index];
|
||||
if (aot != AOT_ER_AAC_ELD) {
|
||||
ics->predictor_present = get_bits1(gb);
|
||||
ics->predictor_reset_group = 0;
|
||||
}
|
||||
ics->predictor_present = get_bits1(gb);
|
||||
ics->predictor_reset_group = 0;
|
||||
if (ics->predictor_present) {
|
||||
if (aot == AOT_AAC_MAIN) {
|
||||
if (ac->oc[1].m4ac.object_type == AOT_AAC_MAIN) {
|
||||
if (decode_prediction(ac, ics, gb)) {
|
||||
goto fail;
|
||||
}
|
||||
} else if (aot == AOT_AAC_LC ||
|
||||
aot == AOT_ER_AAC_LC) {
|
||||
} else if (ac->oc[1].m4ac.object_type == AOT_AAC_LC) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR,
|
||||
"Prediction is not allowed in AAC-LC.\n");
|
||||
goto fail;
|
||||
} else {
|
||||
if (aot == AOT_ER_AAC_LD) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR,
|
||||
"LTP in ER AAC LD not yet implemented.\n");
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
if ((ics->ltp.present = get_bits(gb, 1)))
|
||||
decode_ltp(&ics->ltp, gb, ics->max_sfb);
|
||||
}
|
||||
@@ -1344,17 +1224,17 @@ static int decode_scalefactors(AACContext *ac, float sf[120], GetBitContext *gb,
|
||||
int run_end = band_type_run_end[idx];
|
||||
if (band_type[idx] == ZERO_BT) {
|
||||
for (; i < run_end; i++, idx++)
|
||||
sf[idx] = 0.0;
|
||||
sf[idx] = 0.;
|
||||
} else if ((band_type[idx] == INTENSITY_BT) ||
|
||||
(band_type[idx] == INTENSITY_BT2)) {
|
||||
for (; i < run_end; i++, idx++) {
|
||||
offset[2] += get_vlc2(gb, vlc_scalefactors.table, 7, 3) - 60;
|
||||
clipped_offset = av_clip(offset[2], -155, 100);
|
||||
if (offset[2] != clipped_offset) {
|
||||
avpriv_request_sample(ac->avctx,
|
||||
"If you heard an audible artifact, there may be a bug in the decoder. "
|
||||
"Clipped intensity stereo position (%d -> %d)",
|
||||
offset[2], clipped_offset);
|
||||
av_log_ask_for_sample(ac->avctx, "Intensity stereo "
|
||||
"position clipped (%d -> %d).\nIf you heard an "
|
||||
"audible artifact, there may be a bug in the "
|
||||
"decoder. ", offset[2], clipped_offset);
|
||||
}
|
||||
sf[idx] = ff_aac_pow2sf_tab[-clipped_offset + POW_SF2_ZERO];
|
||||
}
|
||||
@@ -1366,10 +1246,10 @@ static int decode_scalefactors(AACContext *ac, float sf[120], GetBitContext *gb,
|
||||
offset[1] += get_vlc2(gb, vlc_scalefactors.table, 7, 3) - 60;
|
||||
clipped_offset = av_clip(offset[1], -100, 155);
|
||||
if (offset[1] != clipped_offset) {
|
||||
avpriv_request_sample(ac->avctx,
|
||||
"If you heard an audible artifact, there may be a bug in the decoder. "
|
||||
"Clipped noise gain (%d -> %d)",
|
||||
offset[1], clipped_offset);
|
||||
av_log_ask_for_sample(ac->avctx, "Noise gain clipped "
|
||||
"(%d -> %d).\nIf you heard an audible "
|
||||
"artifact, there may be a bug in the decoder. ",
|
||||
offset[1], clipped_offset);
|
||||
}
|
||||
sf[idx] = -ff_aac_pow2sf_tab[clipped_offset + POW_SF2_ZERO];
|
||||
}
|
||||
@@ -1594,7 +1474,7 @@ static int decode_spectrum_and_dequant(AACContext *ac, float coef[1024],
|
||||
cfo[k] = ac->random_state;
|
||||
}
|
||||
|
||||
band_energy = ac->fdsp.scalarproduct_float(cfo, cfo, off_len);
|
||||
band_energy = ac->dsp.scalarproduct_float(cfo, cfo, off_len);
|
||||
scale = sf[idx] / sqrtf(band_energy);
|
||||
ac->fdsp.vector_fmul_scalar(cfo, cfo, scale, off_len);
|
||||
}
|
||||
@@ -1872,15 +1752,9 @@ static int decode_ics(AACContext *ac, SingleChannelElement *sce,
|
||||
TemporalNoiseShaping *tns = &sce->tns;
|
||||
IndividualChannelStream *ics = &sce->ics;
|
||||
float *out = sce->coeffs;
|
||||
int global_gain, eld_syntax, er_syntax, pulse_present = 0;
|
||||
int global_gain, pulse_present = 0;
|
||||
int ret;
|
||||
|
||||
eld_syntax = ac->oc[1].m4ac.object_type == AOT_ER_AAC_ELD;
|
||||
er_syntax = ac->oc[1].m4ac.object_type == AOT_ER_AAC_LC ||
|
||||
ac->oc[1].m4ac.object_type == AOT_ER_AAC_LTP ||
|
||||
ac->oc[1].m4ac.object_type == AOT_ER_AAC_LD ||
|
||||
ac->oc[1].m4ac.object_type == AOT_ER_AAC_ELD;
|
||||
|
||||
/* This assignment is to silence a GCC warning about the variable being used
|
||||
* uninitialized when in fact it always is.
|
||||
*/
|
||||
@@ -1902,7 +1776,7 @@ static int decode_ics(AACContext *ac, SingleChannelElement *sce,
|
||||
|
||||
pulse_present = 0;
|
||||
if (!scale_flag) {
|
||||
if (!eld_syntax && (pulse_present = get_bits1(gb))) {
|
||||
if ((pulse_present = get_bits1(gb))) {
|
||||
if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR,
|
||||
"Pulse tool not allowed in eight short sequence.\n");
|
||||
@@ -1914,19 +1788,12 @@ static int decode_ics(AACContext *ac, SingleChannelElement *sce,
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
}
|
||||
tns->present = get_bits1(gb);
|
||||
if (tns->present && !er_syntax)
|
||||
if (decode_tns(ac, tns, gb, ics) < 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
if (!eld_syntax && get_bits1(gb)) {
|
||||
avpriv_request_sample(ac->avctx, "SSR");
|
||||
if ((tns->present = get_bits1(gb)) && decode_tns(ac, tns, gb, ics))
|
||||
return AVERROR_INVALIDDATA;
|
||||
if (get_bits1(gb)) {
|
||||
av_log_missing_feature(ac->avctx, "SSR", 1);
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
// I see no textual basis in the spec for this occuring after SSR gain
|
||||
// control, but this is what both reference and real implmentations do
|
||||
if (tns->present && er_syntax)
|
||||
if (decode_tns(ac, tns, gb, ics) < 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if (decode_spectrum_and_dequant(ac, out, gb, sce->sf, pulse_present,
|
||||
@@ -1955,9 +1822,9 @@ static void apply_mid_side_stereo(AACContext *ac, ChannelElement *cpe)
|
||||
cpe->ch[0].band_type[idx] < NOISE_BT &&
|
||||
cpe->ch[1].band_type[idx] < NOISE_BT) {
|
||||
for (group = 0; group < ics->group_len[g]; group++) {
|
||||
ac->fdsp.butterflies_float(ch0 + group * 128 + offsets[i],
|
||||
ch1 + group * 128 + offsets[i],
|
||||
offsets[i+1] - offsets[i]);
|
||||
ac->dsp.butterflies_float(ch0 + group * 128 + offsets[i],
|
||||
ch1 + group * 128 + offsets[i],
|
||||
offsets[i+1] - offsets[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2018,9 +1885,8 @@ static void apply_intensity_stereo(AACContext *ac,
|
||||
static int decode_cpe(AACContext *ac, GetBitContext *gb, ChannelElement *cpe)
|
||||
{
|
||||
int i, ret, common_window, ms_present = 0;
|
||||
int eld_syntax = ac->oc[1].m4ac.object_type == AOT_ER_AAC_ELD;
|
||||
|
||||
common_window = eld_syntax || get_bits1(gb);
|
||||
common_window = get_bits1(gb);
|
||||
if (common_window) {
|
||||
if (decode_ics_info(ac, &cpe->ch[0].ics, gb))
|
||||
return AVERROR_INVALIDDATA;
|
||||
@@ -2102,7 +1968,7 @@ static int decode_cce(AACContext *ac, GetBitContext *gb, ChannelElement *che)
|
||||
int idx = 0;
|
||||
int cge = 1;
|
||||
int gain = 0;
|
||||
float gain_cache = 1.0;
|
||||
float gain_cache = 1.;
|
||||
if (c) {
|
||||
cge = coup->coupling_point == AFTER_IMDCT ? 1 : get_bits1(gb);
|
||||
gain = cge ? get_vlc2(gb, vlc_scalefactors.table, 7, 3) - 60: 0;
|
||||
@@ -2361,9 +2227,9 @@ static void windowing_and_mdct_ltp(AACContext *ac, float *out,
|
||||
ac->fdsp.vector_fmul(in + 448, in + 448, swindow_prev, 128);
|
||||
}
|
||||
if (ics->window_sequence[0] != LONG_START_SEQUENCE) {
|
||||
ac->fdsp.vector_fmul_reverse(in + 1024, in + 1024, lwindow, 1024);
|
||||
ac->dsp.vector_fmul_reverse(in + 1024, in + 1024, lwindow, 1024);
|
||||
} else {
|
||||
ac->fdsp.vector_fmul_reverse(in + 1024 + 448, in + 1024 + 448, swindow, 128);
|
||||
ac->dsp.vector_fmul_reverse(in + 1024 + 448, in + 1024 + 448, swindow, 128);
|
||||
memset(in + 1024 + 576, 0, 448 * sizeof(float));
|
||||
}
|
||||
ac->mdct_ltp.mdct_calc(&ac->mdct_ltp, out, in);
|
||||
@@ -2389,10 +2255,10 @@ static void apply_ltp(AACContext *ac, SingleChannelElement *sce)
|
||||
predTime[i] = sce->ltp_state[i + 2048 - ltp->lag] * ltp->coef;
|
||||
memset(&predTime[i], 0, (2048 - i) * sizeof(float));
|
||||
|
||||
ac->windowing_and_mdct_ltp(ac, predFreq, predTime, &sce->ics);
|
||||
windowing_and_mdct_ltp(ac, predFreq, predTime, &sce->ics);
|
||||
|
||||
if (sce->tns.present)
|
||||
ac->apply_tns(predFreq, &sce->tns, &sce->ics, 0);
|
||||
apply_tns(predFreq, &sce->tns, &sce->ics, 0);
|
||||
|
||||
for (sfb = 0; sfb < FFMIN(sce->ics.max_sfb, MAX_LTP_LONG_SFB); sfb++)
|
||||
if (ltp->used[sfb])
|
||||
@@ -2416,17 +2282,17 @@ static void update_ltp(AACContext *ac, SingleChannelElement *sce)
|
||||
if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
|
||||
memcpy(saved_ltp, saved, 512 * sizeof(float));
|
||||
memset(saved_ltp + 576, 0, 448 * sizeof(float));
|
||||
ac->fdsp.vector_fmul_reverse(saved_ltp + 448, ac->buf_mdct + 960, &swindow[64], 64);
|
||||
ac->dsp.vector_fmul_reverse(saved_ltp + 448, ac->buf_mdct + 960, &swindow[64], 64);
|
||||
for (i = 0; i < 64; i++)
|
||||
saved_ltp[i + 512] = ac->buf_mdct[1023 - i] * swindow[63 - i];
|
||||
} else if (ics->window_sequence[0] == LONG_START_SEQUENCE) {
|
||||
memcpy(saved_ltp, ac->buf_mdct + 512, 448 * sizeof(float));
|
||||
memset(saved_ltp + 576, 0, 448 * sizeof(float));
|
||||
ac->fdsp.vector_fmul_reverse(saved_ltp + 448, ac->buf_mdct + 960, &swindow[64], 64);
|
||||
ac->dsp.vector_fmul_reverse(saved_ltp + 448, ac->buf_mdct + 960, &swindow[64], 64);
|
||||
for (i = 0; i < 64; i++)
|
||||
saved_ltp[i + 512] = ac->buf_mdct[1023 - i] * swindow[63 - i];
|
||||
} else { // LONG_STOP or ONLY_LONG
|
||||
ac->fdsp.vector_fmul_reverse(saved_ltp, ac->buf_mdct + 512, &lwindow[512], 512);
|
||||
ac->dsp.vector_fmul_reverse(saved_ltp, ac->buf_mdct + 512, &lwindow[512], 512);
|
||||
for (i = 0; i < 512; i++)
|
||||
saved_ltp[i + 512] = ac->buf_mdct[1023 - i] * lwindow[511 - i];
|
||||
}
|
||||
@@ -2467,113 +2333,38 @@ static void imdct_and_windowing(AACContext *ac, SingleChannelElement *sce)
|
||||
*/
|
||||
if ((ics->window_sequence[1] == ONLY_LONG_SEQUENCE || ics->window_sequence[1] == LONG_STOP_SEQUENCE) &&
|
||||
(ics->window_sequence[0] == ONLY_LONG_SEQUENCE || ics->window_sequence[0] == LONG_START_SEQUENCE)) {
|
||||
ac->fdsp.vector_fmul_window( out, saved, buf, lwindow_prev, 512);
|
||||
ac->dsp.vector_fmul_window( out, saved, buf, lwindow_prev, 512);
|
||||
} else {
|
||||
memcpy( out, saved, 448 * sizeof(float));
|
||||
memcpy( out, saved, 448 * sizeof(float));
|
||||
|
||||
if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
|
||||
ac->fdsp.vector_fmul_window(out + 448 + 0*128, saved + 448, buf + 0*128, swindow_prev, 64);
|
||||
ac->fdsp.vector_fmul_window(out + 448 + 1*128, buf + 0*128 + 64, buf + 1*128, swindow, 64);
|
||||
ac->fdsp.vector_fmul_window(out + 448 + 2*128, buf + 1*128 + 64, buf + 2*128, swindow, 64);
|
||||
ac->fdsp.vector_fmul_window(out + 448 + 3*128, buf + 2*128 + 64, buf + 3*128, swindow, 64);
|
||||
ac->fdsp.vector_fmul_window(temp, buf + 3*128 + 64, buf + 4*128, swindow, 64);
|
||||
memcpy( out + 448 + 4*128, temp, 64 * sizeof(float));
|
||||
ac->dsp.vector_fmul_window(out + 448 + 0*128, saved + 448, buf + 0*128, swindow_prev, 64);
|
||||
ac->dsp.vector_fmul_window(out + 448 + 1*128, buf + 0*128 + 64, buf + 1*128, swindow, 64);
|
||||
ac->dsp.vector_fmul_window(out + 448 + 2*128, buf + 1*128 + 64, buf + 2*128, swindow, 64);
|
||||
ac->dsp.vector_fmul_window(out + 448 + 3*128, buf + 2*128 + 64, buf + 3*128, swindow, 64);
|
||||
ac->dsp.vector_fmul_window(temp, buf + 3*128 + 64, buf + 4*128, swindow, 64);
|
||||
memcpy( out + 448 + 4*128, temp, 64 * sizeof(float));
|
||||
} else {
|
||||
ac->fdsp.vector_fmul_window(out + 448, saved + 448, buf, swindow_prev, 64);
|
||||
memcpy( out + 576, buf + 64, 448 * sizeof(float));
|
||||
ac->dsp.vector_fmul_window(out + 448, saved + 448, buf, swindow_prev, 64);
|
||||
memcpy( out + 576, buf + 64, 448 * sizeof(float));
|
||||
}
|
||||
}
|
||||
|
||||
// buffer update
|
||||
if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
|
||||
memcpy( saved, temp + 64, 64 * sizeof(float));
|
||||
ac->fdsp.vector_fmul_window(saved + 64, buf + 4*128 + 64, buf + 5*128, swindow, 64);
|
||||
ac->fdsp.vector_fmul_window(saved + 192, buf + 5*128 + 64, buf + 6*128, swindow, 64);
|
||||
ac->fdsp.vector_fmul_window(saved + 320, buf + 6*128 + 64, buf + 7*128, swindow, 64);
|
||||
memcpy( saved + 448, buf + 7*128 + 64, 64 * sizeof(float));
|
||||
memcpy( saved, temp + 64, 64 * sizeof(float));
|
||||
ac->dsp.vector_fmul_window(saved + 64, buf + 4*128 + 64, buf + 5*128, swindow, 64);
|
||||
ac->dsp.vector_fmul_window(saved + 192, buf + 5*128 + 64, buf + 6*128, swindow, 64);
|
||||
ac->dsp.vector_fmul_window(saved + 320, buf + 6*128 + 64, buf + 7*128, swindow, 64);
|
||||
memcpy( saved + 448, buf + 7*128 + 64, 64 * sizeof(float));
|
||||
} else if (ics->window_sequence[0] == LONG_START_SEQUENCE) {
|
||||
memcpy( saved, buf + 512, 448 * sizeof(float));
|
||||
memcpy( saved + 448, buf + 7*128 + 64, 64 * sizeof(float));
|
||||
memcpy( saved, buf + 512, 448 * sizeof(float));
|
||||
memcpy( saved + 448, buf + 7*128 + 64, 64 * sizeof(float));
|
||||
} else { // LONG_STOP or ONLY_LONG
|
||||
memcpy( saved, buf + 512, 512 * sizeof(float));
|
||||
memcpy( saved, buf + 512, 512 * sizeof(float));
|
||||
}
|
||||
}
|
||||
|
||||
static void imdct_and_windowing_ld(AACContext *ac, SingleChannelElement *sce)
|
||||
{
|
||||
IndividualChannelStream *ics = &sce->ics;
|
||||
float *in = sce->coeffs;
|
||||
float *out = sce->ret;
|
||||
float *saved = sce->saved;
|
||||
const float *lwindow_prev = ics->use_kb_window[1] ? ff_aac_kbd_long_512 : ff_sine_512;
|
||||
float *buf = ac->buf_mdct;
|
||||
|
||||
// imdct
|
||||
ac->mdct.imdct_half(&ac->mdct_ld, buf, in);
|
||||
|
||||
// window overlapping
|
||||
ac->fdsp.vector_fmul_window(out, saved, buf, lwindow_prev, 256);
|
||||
|
||||
// buffer update
|
||||
memcpy(saved, buf + 256, 256 * sizeof(float));
|
||||
}
|
||||
|
||||
static void imdct_and_windowing_eld(AACContext *ac, SingleChannelElement *sce)
|
||||
{
|
||||
float *in = sce->coeffs;
|
||||
float *out = sce->ret;
|
||||
float *saved = sce->saved;
|
||||
const float *const window = ff_aac_eld_window;
|
||||
float *buf = ac->buf_mdct;
|
||||
int i;
|
||||
const int n = 512;
|
||||
const int n2 = n >> 1;
|
||||
const int n4 = n >> 2;
|
||||
|
||||
// Inverse transform, mapped to the conventional IMDCT by
|
||||
// Chivukula, R.K.; Reznik, Y.A.; Devarajan, V.,
|
||||
// "Efficient algorithms for MPEG-4 AAC-ELD, AAC-LD and AAC-LC filterbanks,"
|
||||
// Audio, Language and Image Processing, 2008. ICALIP 2008. International Conference on
|
||||
// URL: http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=4590245&isnumber=4589950
|
||||
for (i = 0; i < n2; i+=2) {
|
||||
float temp;
|
||||
temp = in[i ]; in[i ] = -in[n - 1 - i]; in[n - 1 - i] = temp;
|
||||
temp = -in[i + 1]; in[i + 1] = in[n - 2 - i]; in[n - 2 - i] = temp;
|
||||
}
|
||||
ac->mdct.imdct_half(&ac->mdct_ld, buf, in);
|
||||
for (i = 0; i < n; i+=2) {
|
||||
buf[i] = -buf[i];
|
||||
}
|
||||
// Like with the regular IMDCT at this point we still have the middle half
|
||||
// of a transform but with even symmetry on the left and odd symmetry on
|
||||
// the right
|
||||
|
||||
// window overlapping
|
||||
// The spec says to use samples [0..511] but the reference decoder uses
|
||||
// samples [128..639].
|
||||
for (i = n4; i < n2; i ++) {
|
||||
out[i - n4] = buf[n2 - 1 - i] * window[i - n4] +
|
||||
saved[ i + n2] * window[i + n - n4] +
|
||||
-saved[ n + n2 - 1 - i] * window[i + 2*n - n4] +
|
||||
-saved[2*n + n2 + i] * window[i + 3*n - n4];
|
||||
}
|
||||
for (i = 0; i < n2; i ++) {
|
||||
out[n4 + i] = buf[i] * window[i + n2 - n4] +
|
||||
-saved[ n - 1 - i] * window[i + n2 + n - n4] +
|
||||
-saved[ n + i] * window[i + n2 + 2*n - n4] +
|
||||
saved[2*n + n - 1 - i] * window[i + n2 + 3*n - n4];
|
||||
}
|
||||
for (i = 0; i < n4; i ++) {
|
||||
out[n2 + n4 + i] = buf[ i + n2] * window[i + n - n4] +
|
||||
-saved[ n2 - 1 - i] * window[i + 2*n - n4] +
|
||||
-saved[ n + n2 + i] * window[i + 3*n - n4];
|
||||
}
|
||||
|
||||
// buffer update
|
||||
memmove(saved + n, saved, 2 * n * sizeof(float));
|
||||
memcpy( saved, buf, n * sizeof(float));
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply dependent channel coupling (applied before IMDCT).
|
||||
*
|
||||
@@ -2670,17 +2461,6 @@ static void apply_channel_coupling(AACContext *ac, ChannelElement *cc,
|
||||
static void spectral_to_sample(AACContext *ac)
|
||||
{
|
||||
int i, type;
|
||||
void (*imdct_and_window)(AACContext *ac, SingleChannelElement *sce);
|
||||
switch (ac->oc[1].m4ac.object_type) {
|
||||
case AOT_ER_AAC_LD:
|
||||
imdct_and_window = imdct_and_windowing_ld;
|
||||
break;
|
||||
case AOT_ER_AAC_ELD:
|
||||
imdct_and_window = imdct_and_windowing_eld;
|
||||
break;
|
||||
default:
|
||||
imdct_and_window = ac->imdct_and_windowing;
|
||||
}
|
||||
for (type = 3; type >= 0; type--) {
|
||||
for (i = 0; i < MAX_ELEM_ID; i++) {
|
||||
ChannelElement *che = ac->che[type][i];
|
||||
@@ -2690,25 +2470,25 @@ static void spectral_to_sample(AACContext *ac)
|
||||
if (ac->oc[1].m4ac.object_type == AOT_AAC_LTP) {
|
||||
if (che->ch[0].ics.predictor_present) {
|
||||
if (che->ch[0].ics.ltp.present)
|
||||
ac->apply_ltp(ac, &che->ch[0]);
|
||||
apply_ltp(ac, &che->ch[0]);
|
||||
if (che->ch[1].ics.ltp.present && type == TYPE_CPE)
|
||||
ac->apply_ltp(ac, &che->ch[1]);
|
||||
apply_ltp(ac, &che->ch[1]);
|
||||
}
|
||||
}
|
||||
if (che->ch[0].tns.present)
|
||||
ac->apply_tns(che->ch[0].coeffs, &che->ch[0].tns, &che->ch[0].ics, 1);
|
||||
apply_tns(che->ch[0].coeffs, &che->ch[0].tns, &che->ch[0].ics, 1);
|
||||
if (che->ch[1].tns.present)
|
||||
ac->apply_tns(che->ch[1].coeffs, &che->ch[1].tns, &che->ch[1].ics, 1);
|
||||
apply_tns(che->ch[1].coeffs, &che->ch[1].tns, &che->ch[1].ics, 1);
|
||||
if (type <= TYPE_CPE)
|
||||
apply_channel_coupling(ac, che, type, i, BETWEEN_TNS_AND_IMDCT, apply_dependent_coupling);
|
||||
if (type != TYPE_CCE || che->coup.coupling_point == AFTER_IMDCT) {
|
||||
imdct_and_window(ac, &che->ch[0]);
|
||||
imdct_and_windowing(ac, &che->ch[0]);
|
||||
if (ac->oc[1].m4ac.object_type == AOT_AAC_LTP)
|
||||
ac->update_ltp(ac, &che->ch[0]);
|
||||
update_ltp(ac, &che->ch[0]);
|
||||
if (type == TYPE_CPE) {
|
||||
imdct_and_window(ac, &che->ch[1]);
|
||||
imdct_and_windowing(ac, &che->ch[1]);
|
||||
if (ac->oc[1].m4ac.object_type == AOT_AAC_LTP)
|
||||
ac->update_ltp(ac, &che->ch[1]);
|
||||
update_ltp(ac, &che->ch[1]);
|
||||
}
|
||||
if (ac->oc[1].m4ac.sbr > 0) {
|
||||
ff_sbr_apply(ac, &che->sbr, type, che->ch[0].ret, che->ch[1].ret);
|
||||
@@ -2726,29 +2506,25 @@ static int parse_adts_frame_header(AACContext *ac, GetBitContext *gb)
|
||||
int size;
|
||||
AACADTSHeaderInfo hdr_info;
|
||||
uint8_t layout_map[MAX_ELEM_ID*4][3];
|
||||
int layout_map_tags, ret;
|
||||
int layout_map_tags;
|
||||
|
||||
size = avpriv_aac_parse_header(gb, &hdr_info);
|
||||
if (size > 0) {
|
||||
if (!ac->warned_num_aac_frames && hdr_info.num_aac_frames != 1) {
|
||||
// This is 2 for "VLB " audio in NSV files.
|
||||
// See samples/nsv/vlb_audio.
|
||||
avpriv_report_missing_feature(ac->avctx,
|
||||
"More than one AAC RDB per ADTS frame");
|
||||
av_log_missing_feature(ac->avctx, "More than one AAC RDB per ADTS frame", 0);
|
||||
ac->warned_num_aac_frames = 1;
|
||||
}
|
||||
push_output_configuration(ac);
|
||||
if (hdr_info.chan_config) {
|
||||
ac->oc[1].m4ac.chan_config = hdr_info.chan_config;
|
||||
if ((ret = set_default_channel_config(ac->avctx,
|
||||
layout_map,
|
||||
&layout_map_tags,
|
||||
hdr_info.chan_config)) < 0)
|
||||
return ret;
|
||||
if ((ret = output_configure(ac, layout_map, layout_map_tags,
|
||||
FFMAX(ac->oc[1].status,
|
||||
OC_TRIAL_FRAME), 0)) < 0)
|
||||
return ret;
|
||||
if (set_default_channel_config(ac->avctx, layout_map,
|
||||
&layout_map_tags, hdr_info.chan_config))
|
||||
return -7;
|
||||
if (output_configure(ac, layout_map, layout_map_tags,
|
||||
FFMAX(ac->oc[1].status, OC_TRIAL_FRAME), 0))
|
||||
return -7;
|
||||
} else {
|
||||
ac->oc[1].m4ac.chan_config = 0;
|
||||
/**
|
||||
@@ -2782,66 +2558,6 @@ static int parse_adts_frame_header(AACContext *ac, GetBitContext *gb)
|
||||
return size;
|
||||
}
|
||||
|
||||
static int aac_decode_er_frame(AVCodecContext *avctx, void *data,
|
||||
int *got_frame_ptr, GetBitContext *gb)
|
||||
{
|
||||
AACContext *ac = avctx->priv_data;
|
||||
ChannelElement *che;
|
||||
int err, i;
|
||||
int samples = 1024;
|
||||
int chan_config = ac->oc[1].m4ac.chan_config;
|
||||
int aot = ac->oc[1].m4ac.object_type;
|
||||
|
||||
if (aot == AOT_ER_AAC_LD || aot == AOT_ER_AAC_ELD)
|
||||
samples >>= 1;
|
||||
|
||||
ac->frame = data;
|
||||
|
||||
if ((err = frame_configure_elements(avctx)) < 0)
|
||||
return err;
|
||||
|
||||
ac->tags_mapped = 0;
|
||||
|
||||
if (chan_config < 0 || chan_config >= 8) {
|
||||
avpriv_request_sample(avctx, "Unknown ER channel configuration %d",
|
||||
ac->oc[1].m4ac.chan_config);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
for (i = 0; i < tags_per_config[chan_config]; i++) {
|
||||
const int elem_type = aac_channel_layout_map[chan_config-1][i][0];
|
||||
const int elem_id = aac_channel_layout_map[chan_config-1][i][1];
|
||||
if (!(che=get_che(ac, elem_type, elem_id))) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR,
|
||||
"channel element %d.%d is not allocated\n",
|
||||
elem_type, elem_id);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if (aot != AOT_ER_AAC_ELD)
|
||||
skip_bits(gb, 4);
|
||||
switch (elem_type) {
|
||||
case TYPE_SCE:
|
||||
err = decode_ics(ac, &che->ch[0], gb, 0, 0);
|
||||
break;
|
||||
case TYPE_CPE:
|
||||
err = decode_cpe(ac, gb, che);
|
||||
break;
|
||||
case TYPE_LFE:
|
||||
err = decode_ics(ac, &che->ch[0], gb, 0, 0);
|
||||
break;
|
||||
}
|
||||
if (err < 0)
|
||||
return err;
|
||||
}
|
||||
|
||||
spectral_to_sample(ac);
|
||||
|
||||
ac->frame->nb_samples = samples;
|
||||
*got_frame_ptr = 1;
|
||||
|
||||
skip_bits_long(gb, get_bits_left(gb));
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
|
||||
int *got_frame_ptr, GetBitContext *gb, AVPacket *avpkt)
|
||||
{
|
||||
@@ -2852,22 +2568,23 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
|
||||
int samples = 0, multiplier, audio_found = 0, pce_found = 0;
|
||||
int is_dmono, sce_count = 0;
|
||||
|
||||
ac->frame = data;
|
||||
|
||||
if (show_bits(gb, 12) == 0xfff) {
|
||||
if ((err = parse_adts_frame_header(ac, gb)) < 0) {
|
||||
if (parse_adts_frame_header(ac, gb) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Error decoding AAC frame header.\n");
|
||||
err = -1;
|
||||
goto fail;
|
||||
}
|
||||
if (ac->oc[1].m4ac.sampling_index > 12) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR, "invalid sampling rate index %d\n", ac->oc[1].m4ac.sampling_index);
|
||||
err = AVERROR_INVALIDDATA;
|
||||
err = -1;
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
||||
if ((err = frame_configure_elements(avctx)) < 0)
|
||||
if (frame_configure_elements(avctx) < 0) {
|
||||
err = -1;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
ac->tags_mapped = 0;
|
||||
// parse
|
||||
@@ -2878,7 +2595,7 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
|
||||
if (!(che=get_che(ac, elem_type, elem_id))) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR, "channel element %d.%d is not allocated\n",
|
||||
elem_type, elem_id);
|
||||
err = AVERROR_INVALIDDATA;
|
||||
err = -1;
|
||||
goto fail;
|
||||
}
|
||||
samples = 1024;
|
||||
@@ -2922,6 +2639,7 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
|
||||
if (pce_found) {
|
||||
av_log(avctx, AV_LOG_ERROR,
|
||||
"Not evaluating a further program_config_element as this construct is dubious at best.\n");
|
||||
pop_output_configuration(ac);
|
||||
} else {
|
||||
err = output_configure(ac, layout_map, tags, OC_TRIAL_PCE, 1);
|
||||
if (!err)
|
||||
@@ -2936,7 +2654,7 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
|
||||
elem_id += get_bits(gb, 8) - 1;
|
||||
if (get_bits_left(gb) < 8 * elem_id) {
|
||||
av_log(avctx, AV_LOG_ERROR, "TYPE_FIL: "overread_err);
|
||||
err = AVERROR_INVALIDDATA;
|
||||
err = -1;
|
||||
goto fail;
|
||||
}
|
||||
while (elem_id > 0)
|
||||
@@ -2945,7 +2663,7 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
|
||||
break;
|
||||
|
||||
default:
|
||||
err = AVERROR_BUG; /* should not happen, but keeps compiler happy */
|
||||
err = -1; /* should not happen, but keeps compiler happy */
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2957,7 +2675,7 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
|
||||
|
||||
if (get_bits_left(gb) < 3) {
|
||||
av_log(avctx, AV_LOG_ERROR, overread_err);
|
||||
err = AVERROR_INVALIDDATA;
|
||||
err = -1;
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
@@ -2970,10 +2688,10 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
|
||||
is_dmono = ac->dmono_mode && sce_count == 2 &&
|
||||
ac->oc[1].channel_layout == (AV_CH_FRONT_LEFT | AV_CH_FRONT_RIGHT);
|
||||
|
||||
if (samples)
|
||||
ac->frame->nb_samples = samples;
|
||||
else
|
||||
av_frame_unref(ac->frame);
|
||||
if (samples) {
|
||||
ac->frame.nb_samples = samples;
|
||||
*(AVFrame *)data = ac->frame;
|
||||
}
|
||||
*got_frame_ptr = !!samples;
|
||||
|
||||
if (is_dmono) {
|
||||
@@ -2991,7 +2709,7 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
|
||||
|
||||
if (multiplier) {
|
||||
int side_size;
|
||||
const uint8_t *side = av_packet_get_side_data(avpkt, AV_PKT_DATA_SKIP_SAMPLES, &side_size);
|
||||
uint32_t *side = av_packet_get_side_data(avpkt, AV_PKT_DATA_SKIP_SAMPLES, &side_size);
|
||||
if (side && side_size>=4)
|
||||
AV_WL32(side, 2*AV_RL32(side));
|
||||
}
|
||||
@@ -3043,23 +2761,10 @@ static int aac_decode_frame(AVCodecContext *avctx, void *data,
|
||||
if (ac->force_dmono_mode >= 0)
|
||||
ac->dmono_mode = ac->force_dmono_mode;
|
||||
|
||||
if (INT_MAX / 8 <= buf_size)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
if ((err = init_get_bits(&gb, buf, buf_size * 8)) < 0)
|
||||
return err;
|
||||
|
||||
switch (ac->oc[1].m4ac.object_type) {
|
||||
case AOT_ER_AAC_LC:
|
||||
case AOT_ER_AAC_LTP:
|
||||
case AOT_ER_AAC_LD:
|
||||
case AOT_ER_AAC_ELD:
|
||||
err = aac_decode_er_frame(avctx, data, got_frame_ptr, &gb);
|
||||
break;
|
||||
default:
|
||||
err = aac_decode_frame_int(avctx, data, got_frame_ptr, &gb, avpkt);
|
||||
}
|
||||
if (err < 0)
|
||||
if ((err = aac_decode_frame_int(avctx, data, got_frame_ptr, &gb, avpkt)) < 0)
|
||||
return err;
|
||||
|
||||
buf_consumed = (get_bits_count(&gb) + 7) >> 3;
|
||||
@@ -3085,7 +2790,6 @@ static av_cold int aac_decode_close(AVCodecContext *avctx)
|
||||
|
||||
ff_mdct_end(&ac->mdct);
|
||||
ff_mdct_end(&ac->mdct_small);
|
||||
ff_mdct_end(&ac->mdct_ld);
|
||||
ff_mdct_end(&ac->mdct_ltp);
|
||||
return 0;
|
||||
}
|
||||
@@ -3095,7 +2799,7 @@ static av_cold int aac_decode_close(AVCodecContext *avctx)
|
||||
|
||||
struct LATMContext {
|
||||
AACContext aac_ctx; ///< containing AACContext
|
||||
int initialized; ///< initialized after a valid extradata was seen
|
||||
int initialized; ///< initilized after a valid extradata was seen
|
||||
|
||||
// parser data
|
||||
int audio_mux_version_A; ///< LATM syntax version
|
||||
@@ -3127,8 +2831,8 @@ static int latm_decode_audio_specific_config(struct LATMContext *latmctx,
|
||||
asclen = get_bits_left(gb);
|
||||
|
||||
if (config_start_bit % 8) {
|
||||
avpriv_request_sample(latmctx->aac_ctx.avctx,
|
||||
"Non-byte-aligned audio-specific config");
|
||||
av_log_missing_feature(latmctx->aac_ctx.avctx,
|
||||
"Non-byte-aligned audio-specific config", 1);
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
if (asclen <= 0)
|
||||
@@ -3147,7 +2851,7 @@ static int latm_decode_audio_specific_config(struct LATMContext *latmctx,
|
||||
if(latmctx->initialized) {
|
||||
av_log(avctx, AV_LOG_INFO, "audio config changed\n");
|
||||
} else {
|
||||
av_log(avctx, AV_LOG_DEBUG, "initializing latmctx\n");
|
||||
av_log(avctx, AV_LOG_INFO, "initializing latmctx\n");
|
||||
}
|
||||
latmctx->initialized = 0;
|
||||
|
||||
@@ -3187,7 +2891,8 @@ static int read_stream_mux_config(struct LATMContext *latmctx,
|
||||
skip_bits(gb, 6); // numSubFrames
|
||||
// numPrograms
|
||||
if (get_bits(gb, 4)) { // numPrograms
|
||||
avpriv_request_sample(latmctx->aac_ctx.avctx, "Multiple programs");
|
||||
av_log_missing_feature(latmctx->aac_ctx.avctx,
|
||||
"Multiple programs", 1);
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
|
||||
@@ -3195,7 +2900,8 @@ static int read_stream_mux_config(struct LATMContext *latmctx,
|
||||
|
||||
// for each layer (which there is only one in DVB)
|
||||
if (get_bits(gb, 3)) { // numLayer
|
||||
avpriv_request_sample(latmctx->aac_ctx.avctx, "Multiple layers");
|
||||
av_log_missing_feature(latmctx->aac_ctx.avctx,
|
||||
"Multiple layers", 1);
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
|
||||
@@ -3306,7 +3012,7 @@ static int latm_decode_frame(AVCodecContext *avctx, void *out,
|
||||
int muxlength, err;
|
||||
GetBitContext gb;
|
||||
|
||||
if ((err = init_get_bits8(&gb, avpkt->data, avpkt->size)) < 0)
|
||||
if ((err = init_get_bits(&gb, avpkt->data, avpkt->size * 8)) < 0)
|
||||
return err;
|
||||
|
||||
// check for LOAS sync word
|
||||
@@ -3361,17 +3067,6 @@ static av_cold int latm_decode_init(AVCodecContext *avctx)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void aacdec_init(AACContext *c)
|
||||
{
|
||||
c->imdct_and_windowing = imdct_and_windowing;
|
||||
c->apply_ltp = apply_ltp;
|
||||
c->apply_tns = apply_tns;
|
||||
c->windowing_and_mdct_ltp = windowing_and_mdct_ltp;
|
||||
c->update_ltp = update_ltp;
|
||||
|
||||
if(ARCH_MIPS)
|
||||
ff_aacdec_init_mips(c);
|
||||
}
|
||||
/**
|
||||
* AVOptions for Japanese DTV specific extensions (ADTS only)
|
||||
*/
|
||||
@@ -3398,13 +3093,13 @@ static const AVClass aac_decoder_class = {
|
||||
|
||||
AVCodec ff_aac_decoder = {
|
||||
.name = "aac",
|
||||
.long_name = NULL_IF_CONFIG_SMALL("AAC (Advanced Audio Coding)"),
|
||||
.type = AVMEDIA_TYPE_AUDIO,
|
||||
.id = AV_CODEC_ID_AAC,
|
||||
.priv_data_size = sizeof(AACContext),
|
||||
.init = aac_decode_init,
|
||||
.close = aac_decode_close,
|
||||
.decode = aac_decode_frame,
|
||||
.long_name = NULL_IF_CONFIG_SMALL("AAC (Advanced Audio Coding)"),
|
||||
.sample_fmts = (const enum AVSampleFormat[]) {
|
||||
AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE
|
||||
},
|
||||
@@ -3421,13 +3116,13 @@ AVCodec ff_aac_decoder = {
|
||||
*/
|
||||
AVCodec ff_aac_latm_decoder = {
|
||||
.name = "aac_latm",
|
||||
.long_name = NULL_IF_CONFIG_SMALL("AAC LATM (Advanced Audio Coding LATM syntax)"),
|
||||
.type = AVMEDIA_TYPE_AUDIO,
|
||||
.id = AV_CODEC_ID_AAC_LATM,
|
||||
.priv_data_size = sizeof(struct LATMContext),
|
||||
.init = latm_decode_init,
|
||||
.close = aac_decode_close,
|
||||
.decode = latm_decode_frame,
|
||||
.long_name = NULL_IF_CONFIG_SMALL("AAC LATM (Advanced Audio Coding LATM syntax)"),
|
||||
.sample_fmts = (const enum AVSampleFormat[]) {
|
||||
AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE
|
||||
},
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user