Compare commits
562 commits
master
...
release/7.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2e503a9b94 | ||
|
|
67ce9aeb5c | ||
|
|
01e42959a5 | ||
|
|
20d711e4df | ||
|
|
eaa3fb32d9 | ||
|
|
5c61d2bddd | ||
|
|
94e94becb1 | ||
|
|
70fe76385d | ||
|
|
cacdb41ef2 | ||
|
|
f1e8e74477 | ||
|
|
e0e7c95a06 | ||
|
|
695dcf29c2 | ||
|
|
d6270e6b5c | ||
|
|
c10f15c0e8 | ||
|
|
d88741836e | ||
|
|
70ae846c71 | ||
|
|
5a8055a58a | ||
|
|
3c3d252449 | ||
|
|
9aab014878 | ||
|
|
33435e078f | ||
|
|
f43dfb5e82 | ||
|
|
89a792fd3b | ||
|
|
af1eb801da | ||
|
|
f28eeabd03 | ||
|
|
4d00981ce7 | ||
|
|
8e69f09c40 | ||
|
|
584eb8c73c | ||
|
|
f57d15139f | ||
|
|
8e95a9177e | ||
|
|
55ec6d87aa | ||
|
|
55a3a57dff | ||
|
|
6a50a92137 | ||
|
|
1826e947d0 | ||
|
|
15498e7242 | ||
|
|
884c833434 | ||
|
|
53be7e244c | ||
|
|
4cb1c7a31c | ||
|
|
7dd232e587 | ||
|
|
315e4e5097 | ||
|
|
2080df4606 | ||
|
|
de6eed407c | ||
|
|
fdabd48bbb | ||
|
|
2cdf8e0d8e | ||
|
|
be65fc7c97 | ||
|
|
29ff07ab76 | ||
|
|
439d36d539 | ||
|
|
dfeb22ffa7 | ||
|
|
cd163136b5 | ||
|
|
1e3b60a916 | ||
|
|
45944e0c1f | ||
|
|
3bdb889b11 | ||
|
|
932b0ea281 | ||
|
|
3b0c222dc0 | ||
|
|
e43f54f043 | ||
|
|
b6f184ac47 | ||
|
|
9b82620275 | ||
|
|
b4c888343a | ||
|
|
65e885dd58 | ||
|
|
c99baf2cee | ||
|
|
d06fcec830 | ||
|
|
caceeed2b4 | ||
|
|
b263aa0095 | ||
|
|
7a6d21b293 | ||
|
|
cda205835f | ||
|
|
a58941bc1f | ||
|
|
d6a82f3f49 | ||
|
|
6143f633f7 | ||
|
|
06d71cd465 | ||
|
|
f4d37b1a60 | ||
|
|
690d4bb8cb | ||
|
|
d60d2313da | ||
|
|
47b3b3079b | ||
|
|
47f88bf02a | ||
|
|
8334cae265 | ||
|
|
041084f753 | ||
|
|
69c4c85432 | ||
|
|
2c07fa346f | ||
|
|
68c41b95e0 | ||
|
|
8dfb82b732 | ||
|
|
9078f0f524 | ||
|
|
3cead954c8 | ||
|
|
aa9e07461c | ||
|
|
4310bcb07d | ||
|
|
3c53b9ff3e | ||
|
|
483b77b038 | ||
|
|
351392460a | ||
|
|
b5cb8e4951 | ||
|
|
c530cff25d | ||
|
|
a770e544a2 | ||
|
|
5a988a5fed | ||
|
|
64cd344fbe | ||
|
|
16127ebb9f | ||
|
|
24e1f327a5 | ||
|
|
654d329fcb | ||
|
|
27ed6de46d | ||
|
|
5585e33181 | ||
|
|
ad989ae50b | ||
|
|
6f395fba57 | ||
|
|
0f0645381b | ||
|
|
f8b1d416e3 | ||
|
|
0b5bfff1c0 | ||
|
|
d4bdaa24ea | ||
|
|
ab1b1ef730 | ||
|
|
b67e271bed | ||
|
|
44bf027a3f | ||
|
|
5ea1ae9385 | ||
|
|
af50c43d82 | ||
|
|
c3d84bdcbf | ||
|
|
c709d551d6 | ||
|
|
73475dfa8d | ||
|
|
8840b81535 | ||
|
|
d300b23bad | ||
|
|
748e8c6afa | ||
|
|
bd29e0ca59 | ||
|
|
45c9900a9f | ||
|
|
7289a09477 | ||
|
|
d349ad7bb6 | ||
|
|
f2d7b8089f | ||
|
|
d649d42a2c | ||
|
|
5742fce47a | ||
|
|
24396a0caf | ||
|
|
470718d8cb | ||
|
|
d8be286c00 | ||
|
|
677e7cd814 | ||
|
|
01c406b1d6 | ||
|
|
2909f42351 | ||
|
|
87de55344c | ||
|
|
d4394c8dce | ||
|
|
d9e078dcd7 | ||
|
|
4926619103 | ||
|
|
68a8dc4dd7 | ||
|
|
c419b928cd | ||
|
|
a6d7abc88b | ||
|
|
29fc028ae2 | ||
|
|
53c666d17e | ||
|
|
5a0393bf01 | ||
|
|
21ef3948a5 | ||
|
|
02231d4012 | ||
|
|
c15df4daca | ||
|
|
32dd9118c7 | ||
|
|
bd1b5e7b58 | ||
|
|
bbba5e041c | ||
|
|
069bf0efff | ||
|
|
11037bdec0 | ||
|
|
53ac436375 | ||
|
|
d392adb19a | ||
|
|
dd1058a7b4 | ||
|
|
0a10ae25ba | ||
|
|
d4d154f714 | ||
|
|
7b942f342f | ||
|
|
be882efb53 | ||
|
|
24c9ecad42 | ||
|
|
13ca705eeb | ||
|
|
aaaf20a11f | ||
|
|
72e64ede94 | ||
|
|
aac44b78aa | ||
|
|
e65923eff0 | ||
|
|
e2a60e532f | ||
|
|
50c4fad6c8 | ||
|
|
bb1a9c5932 | ||
|
|
0407cd4990 | ||
|
|
7f1e209028 | ||
|
|
210cb52ef6 | ||
|
|
a38726fb05 | ||
|
|
77facc9a55 | ||
|
|
caaa4d2d6a | ||
|
|
786d4af405 | ||
|
|
d63f7ddebc | ||
|
|
f5f590b1e7 | ||
|
|
45ecf80f0e | ||
|
|
3e6cec1286 | ||
|
|
f705bc5b73 | ||
|
|
9cadadb9a1 | ||
|
|
0458a86656 | ||
|
|
6a1ceb3c72 | ||
|
|
51482627ca | ||
|
|
b9ce1b405a | ||
|
|
47844f5869 | ||
|
|
fee22dba5f | ||
|
|
098ab0cd99 | ||
|
|
48a53bc2c7 | ||
|
|
7950855197 | ||
|
|
7e69129d2f | ||
|
|
5ff181c025 | ||
|
|
5ba8efe90b | ||
|
|
96e648ddbc | ||
|
|
345855af80 | ||
|
|
714635937a | ||
|
|
e3a61e9103 | ||
|
|
679a572e44 | ||
|
|
8b0cf8ab31 | ||
|
|
f2145744a2 | ||
|
|
abd5df3033 | ||
|
|
d0d740946b | ||
|
|
b6b55f6e2b | ||
|
|
517e559a46 | ||
|
|
0ab20b5788 | ||
|
|
63e90b338c | ||
|
|
c77a3b8d29 | ||
|
|
d517a84c85 | ||
|
|
a83c1a3db9 | ||
|
|
5f953ac26f | ||
|
|
a0d1902e2c | ||
|
|
adcb97538a | ||
|
|
68a017f6b5 | ||
|
|
71dc382513 | ||
|
|
354d5b9737 | ||
|
|
5faff14b90 | ||
|
|
c2ec2994c3 | ||
|
|
b158f7c62b | ||
|
|
5c2dfe559e | ||
|
|
e82aa42f6c | ||
|
|
224dd41cce | ||
|
|
dc2b488fc7 | ||
|
|
d7b229b387 | ||
|
|
634744ca91 | ||
|
|
1ad6cf075d | ||
|
|
2248217d42 | ||
|
|
591680a0cf | ||
|
|
2a59fc5b18 | ||
|
|
db71fb1549 | ||
|
|
68770bfe17 | ||
|
|
d0937f480e | ||
|
|
400fff4ba7 | ||
|
|
8804d76aa5 | ||
|
|
e86687bd6c | ||
|
|
6b772034ff | ||
|
|
1b4795df08 | ||
|
|
0a6d42ce38 | ||
|
|
444789f647 | ||
|
|
9350f387e8 | ||
|
|
0e529f8a93 | ||
|
|
640f35b83e | ||
|
|
a841e90cfd | ||
|
|
e2ba5abaa7 | ||
|
|
893992cf00 | ||
|
|
be3e6ba7ad | ||
|
|
39d083cb73 | ||
|
|
ca19dbf33d | ||
|
|
b926b87f3c | ||
|
|
175c3d6cc5 | ||
|
|
76779f2b87 | ||
|
|
587acd0d40 | ||
|
|
996ce2b379 | ||
|
|
b10323ef64 | ||
|
|
964a3e2fa7 | ||
|
|
8d294ee692 | ||
|
|
d02a49ba01 | ||
|
|
72d3f1f802 | ||
|
|
7c7624d2b7 | ||
|
|
3e0da83058 | ||
|
|
333a623915 | ||
|
|
2e442aa820 | ||
|
|
45a91d998f | ||
|
|
04abb63b7c | ||
|
|
365c58cfab | ||
|
|
3d37e3aa9b | ||
|
|
11ecd11ee5 | ||
|
|
386e7ac113 | ||
|
|
7669cc2b8b | ||
|
|
64c26cd18a | ||
|
|
8982bf0d84 | ||
|
|
d3d9798312 | ||
|
|
ecfdecabfb | ||
|
|
66f42ad1d5 | ||
|
|
31bc90cd2f | ||
|
|
4da9443735 | ||
|
|
76cabac818 | ||
|
|
01458ce446 | ||
|
|
da5d437757 | ||
|
|
f66256651b | ||
|
|
d6efa604a2 | ||
|
|
72b087cf0d | ||
|
|
5f59b54041 | ||
|
|
62a772263e | ||
|
|
f07a35b5e5 | ||
|
|
eebdb93d94 | ||
|
|
3b70bc4bd6 | ||
|
|
b93e62052f | ||
|
|
a0988dae8e | ||
|
|
594c2086fa | ||
|
|
740fb498e1 | ||
|
|
d7912a6d4a | ||
|
|
19631babab | ||
|
|
6f452f4ea0 | ||
|
|
dad5fcb33d | ||
|
|
f3505e4d29 | ||
|
|
6b76648dc0 | ||
|
|
a88516b6f7 | ||
|
|
b2f7532ac7 | ||
|
|
a7beed1a11 | ||
|
|
6b1e91a52c | ||
|
|
75c8afab03 | ||
|
|
2f0fe13450 | ||
|
|
6cf8d4ea3d | ||
|
|
b2da9efb71 | ||
|
|
9b52ca7ca5 | ||
|
|
9ca0577c5e | ||
|
|
acd5523b7a | ||
|
|
315766e290 | ||
|
|
9f2917aaf3 | ||
|
|
3c85e12e5a | ||
|
|
dd3075434e | ||
|
|
adab1e6f0c | ||
|
|
ca5ffb7f46 | ||
|
|
4d00378da8 | ||
|
|
38f2f4555a | ||
|
|
7e2396e890 | ||
|
|
09806744cc | ||
|
|
82dcc0fb8e | ||
|
|
624f15e77d | ||
|
|
a4f8bb40e1 | ||
|
|
266ea4d840 | ||
|
|
c40b96982d | ||
|
|
45b2c1f810 | ||
|
|
8c378a78c9 | ||
|
|
1056db9bf8 | ||
|
|
886045ca87 | ||
|
|
d304d1ea30 | ||
|
|
bd3a6b6681 | ||
|
|
4042d01660 | ||
|
|
031c758482 | ||
|
|
43dfbdcae5 | ||
|
|
8941956c32 | ||
|
|
2191f4f5d6 | ||
|
|
2d8a4ca3b1 | ||
|
|
01af7b97e6 | ||
|
|
345ff46a69 | ||
|
|
b3e53af1e5 | ||
|
|
d478214f72 | ||
|
|
806be9f6b6 | ||
|
|
045cc9c037 | ||
|
|
4e40e893cc | ||
|
|
ee71ffc8f0 | ||
|
|
7180b3f213 | ||
|
|
40cca1cf87 | ||
|
|
13067aa562 | ||
|
|
8abfa9e42f | ||
|
|
9d7811aa65 | ||
|
|
c818250194 | ||
|
|
d44a75849c | ||
|
|
488aa52371 | ||
|
|
9e6950dcb4 | ||
|
|
871c89e0ba | ||
|
|
b8ee22e1dd | ||
|
|
2ea4dfd684 | ||
|
|
54f57cb532 | ||
|
|
1973b87dda | ||
|
|
45eabb1ef6 | ||
|
|
b09cadf2ef | ||
|
|
ca087aac86 | ||
|
|
caed56c6c5 | ||
|
|
58dc78387d | ||
|
|
02cb95ba0c | ||
|
|
063c906f1f | ||
|
|
d2295ca945 | ||
|
|
23e085b743 | ||
|
|
8689e9d178 | ||
|
|
5dc3069673 | ||
|
|
956f4cc431 | ||
|
|
7a73598b3f | ||
|
|
0e746e97a3 | ||
|
|
4d6197911e | ||
|
|
0fc0a84c03 | ||
|
|
e292a764c0 | ||
|
|
0eda3eaac4 | ||
|
|
376e36d253 | ||
|
|
c684c13ee4 | ||
|
|
bf5aba6b88 | ||
|
|
78ad74a20a | ||
|
|
4175b43533 | ||
|
|
23e3356b86 | ||
|
|
4bc1462acf | ||
|
|
24658e9ee2 | ||
|
|
1e23d86cd5 | ||
|
|
eb1e40909b | ||
|
|
98a1c887c3 | ||
|
|
31afbc0e4c | ||
|
|
57a22f0994 | ||
|
|
447e9fea75 | ||
|
|
4b11e29881 | ||
|
|
d17dcd63b1 | ||
|
|
87f805613c | ||
|
|
1ef18d0223 | ||
|
|
fdd3e3504e | ||
|
|
db90c46fff | ||
|
|
5fc5b33319 | ||
|
|
5e43483206 | ||
|
|
df2d21a47b | ||
|
|
a3bc5cd841 | ||
|
|
507348799c | ||
|
|
29d626ea85 | ||
|
|
3d4d2897e6 | ||
|
|
ce939aa59a | ||
|
|
fd789a087e | ||
|
|
daffde0544 | ||
|
|
b5d42852d0 | ||
|
|
2df8aaa8c5 | ||
|
|
c75cabef94 | ||
|
|
28b1dbb4ee | ||
|
|
dc51d491cf | ||
|
|
fbe52bd65c | ||
|
|
b44758d8e4 | ||
|
|
89a85efbf1 | ||
|
|
5ce0c37896 | ||
|
|
a7fa1049d7 | ||
|
|
40ddddca45 | ||
|
|
887e6f404d | ||
|
|
173673f359 | ||
|
|
0013970c68 | ||
|
|
647e983450 | ||
|
|
f0b747ef1a | ||
|
|
edc7b57e26 | ||
|
|
449cab7b16 | ||
|
|
1800213575 | ||
|
|
f42c35b7c9 | ||
|
|
58ac1f9ea8 | ||
|
|
af25a4bfd2 | ||
|
|
2d514f5d48 | ||
|
|
45765b7c2e | ||
|
|
2bfcc11f51 | ||
|
|
a08da68e0a | ||
|
|
7050b247b2 | ||
|
|
17674b150f | ||
|
|
85d4df3873 | ||
|
|
1a6995c6d6 | ||
|
|
a49a8dc0d6 | ||
|
|
435b74c6a5 | ||
|
|
b4fdbbe6aa | ||
|
|
39da4ac79b | ||
|
|
c250e3b101 | ||
|
|
b27c156c15 | ||
|
|
68763d6a6f | ||
|
|
3a0320e95a | ||
|
|
7f05002e05 | ||
|
|
8c5358c617 | ||
|
|
1e67935ab1 | ||
|
|
14bd2b4b87 | ||
|
|
b01e6a7e0b | ||
|
|
271c364eb5 | ||
|
|
15de2a9b96 | ||
|
|
402a2c730f | ||
|
|
e94527f38f | ||
|
|
9eb6558fa9 | ||
|
|
b9985f105e | ||
|
|
559dd6f68a | ||
|
|
44b0e6a99f | ||
|
|
4d920afb82 | ||
|
|
c8a9e35514 | ||
|
|
4eccabcc26 | ||
|
|
67ca3a5ee7 | ||
|
|
c8ffda5684 | ||
|
|
0047b51b8d | ||
|
|
ef9d59defb | ||
|
|
ccd7fe3c67 | ||
|
|
8170914a34 | ||
|
|
c5671e9de9 | ||
|
|
13ef4f209f | ||
|
|
ec35ed8bb2 | ||
|
|
9a4199c71b | ||
|
|
0e44de3b9b | ||
|
|
dba4b859d8 | ||
|
|
e806d36b38 | ||
|
|
c42248f466 | ||
|
|
a0577e9877 | ||
|
|
62d3e4fd29 | ||
|
|
7fa0143d7e | ||
|
|
70191fc0a6 | ||
|
|
6b42ba2094 | ||
|
|
53868f5193 | ||
|
|
ad26b2d05a | ||
|
|
1dbfdd2d30 | ||
|
|
4197c3203b | ||
|
|
ba031f8771 | ||
|
|
935279b855 | ||
|
|
52132f4d6e | ||
|
|
89ea8af0b3 | ||
|
|
07ee3648b7 | ||
|
|
060d2ce8ae | ||
|
|
00ccb7be29 | ||
|
|
a8b8b1042f | ||
|
|
5f23eecfba | ||
|
|
8b0fe91754 | ||
|
|
6ab65792ab | ||
|
|
e7d2238ad7 | ||
|
|
a4bc1dd928 | ||
|
|
c3665ee60f | ||
|
|
a51c06b42c | ||
|
|
da8b2f9704 | ||
|
|
1e6382a6b7 | ||
|
|
5683aa6318 | ||
|
|
fb8f0ea7b3 | ||
|
|
0085da21b4 | ||
|
|
64a048d4cc | ||
|
|
96d941b30e | ||
|
|
9963b9e3c9 | ||
|
|
506fbe681c | ||
|
|
13e93ffbfd | ||
|
|
2d3ee7c069 | ||
|
|
30002d58fa | ||
|
|
cbd98447bc | ||
|
|
ed55219edd | ||
|
|
8dfafe5366 | ||
|
|
48721a415a | ||
|
|
0d851a82dd | ||
|
|
d38bf5e08e | ||
|
|
6c701b5f6c | ||
|
|
e2a1a4f581 | ||
|
|
265de29acb | ||
|
|
607fca80b7 | ||
|
|
82aa188281 | ||
|
|
0e3a46720a | ||
|
|
083443d67c | ||
|
|
4f0e9457d6 | ||
|
|
9a4c7b937f | ||
|
|
abaa747ee5 | ||
|
|
3736130e5b | ||
|
|
e0dd533ad6 | ||
|
|
97751fda3e | ||
|
|
1ef084f910 | ||
|
|
839e8baa20 | ||
|
|
d918d9afe0 | ||
|
|
4866aaf7c5 | ||
|
|
3b6732bcb3 | ||
|
|
aeff85620a | ||
|
|
fd8fb39af9 | ||
|
|
5cd6683ddc | ||
|
|
87e5bc918a | ||
|
|
8146cab801 | ||
|
|
5469ba6d74 | ||
|
|
e37d66a72e | ||
|
|
cbbe688434 | ||
|
|
8194f34b5d | ||
|
|
54a7f22ee8 | ||
|
|
003e006ccb | ||
|
|
d4bb784274 | ||
|
|
1a9da17c5a | ||
|
|
7e899776ec | ||
|
|
cc9d291fb0 | ||
|
|
7570390be6 | ||
|
|
74e4e900bb | ||
|
|
2d18c4906f | ||
|
|
4bb04c52fb | ||
|
|
112fdae9f9 | ||
|
|
dcbc1fdb3b | ||
|
|
efa0670048 | ||
|
|
d0e5f83ffb | ||
|
|
2ecaef7455 | ||
|
|
8709604ca1 | ||
|
|
43fd3d5df6 | ||
|
|
4c5a809388 | ||
|
|
5ff5a431c7 | ||
|
|
7ed9ad3467 | ||
|
|
5a3b625dbc | ||
|
|
799a7200ee | ||
|
|
515949a15a | ||
|
|
7fa569e34d | ||
|
|
536443919f | ||
|
|
da903c558b | ||
|
|
9cfb29baa2 | ||
|
|
304208d40c | ||
|
|
6ceda54629 |
4638 changed files with 102322 additions and 217643 deletions
|
|
@ -1,96 +0,0 @@
|
|||
# This file describes the expected reviewers for a PR based on the changed
|
||||
# files. Unlike what the name of the file suggests they don't own the code, but
|
||||
# merely have a good understanding of that area of the codebase and therefore
|
||||
# are usually suited as a reviewer.
|
||||
|
||||
# Lines in this file match changed paths via Go-Style regular expressions:
|
||||
# https://pkg.go.dev/regexp/syntax
|
||||
|
||||
# Mind the alphabetical order
|
||||
|
||||
# avcodec
|
||||
# =======
|
||||
libavcodec/.*aac.* @lynne
|
||||
libavcodec/.*ac3.* @lynne
|
||||
libavcodec/.*atrac9.* @lynne
|
||||
libavcodec/.*bitpacked.* @lynne
|
||||
libavcodec/.*d3d12va.* @jianhuaw
|
||||
libavcodec/.*dirac.* @lynne
|
||||
libavcodec/.*ffv1.* @lynne @michaelni
|
||||
libavcodec/golomb.* @michaelni
|
||||
libavcodec/.*h266.* @frankplow @NuoMi @jianhuaw
|
||||
libavcodec/h26x/.* @frankplow @NuoMi @jianhuaw
|
||||
libavcodec/.*jpegxl.* @lynne @Traneptora
|
||||
libavcodec/.*jxl.* @lynne @Traneptora
|
||||
libavcodec/.*opus.* @lynne
|
||||
libavcodec/.*png.* @Traneptora
|
||||
libavcodec/.*prores.* @lynne
|
||||
libavcodec/rangecoder.* @michaelni
|
||||
libavcodec/ratecontrol.* @michaelni
|
||||
libavcodec/.*siren.* @lynne
|
||||
libavcodec/.*vc2.* @lynne
|
||||
libavcodec/.*vvc.* @frankplow @NuoMi @jianhuaw
|
||||
|
||||
libavcodec/aarch64/.* @lynne @mstorsjo
|
||||
libavcodec/arm/.* @mstorsjo
|
||||
libavcodec/ppc/.* @sean_mcg
|
||||
libavcodec/x86/.* @lynne
|
||||
|
||||
# avfilter
|
||||
# =======
|
||||
libavfilter/aarch64/.* @mstorsjo
|
||||
libavfilter/af_whisper.* @vpalmisano
|
||||
libavfilter/vf_yadif.* @michaelni
|
||||
libavfilter/vsrc_mandelbrot.* @michaelni
|
||||
|
||||
# avformat
|
||||
# =======
|
||||
libavformat/iamf.* @jamrial
|
||||
libavformat/.*jpegxl.* @Traneptora
|
||||
libavformat/.*jxl.* @Traneptora
|
||||
|
||||
# avutil
|
||||
# ======
|
||||
libavutil/.*crc.* @lynne @michaelni
|
||||
libavutil/.*d3d12va.* @jianhuaw
|
||||
libavutil/eval.* @michaelni
|
||||
libavutil/iamf.* @jamrial
|
||||
libavutil/integer.* @michaelni
|
||||
libavutil/lfg.* @michaelni
|
||||
libavutil/lls.* @michaelni
|
||||
libavutil/md5.* @michaelni
|
||||
libavutil/mathematics.* @michaelni
|
||||
libavutil/mem.* @michaelni
|
||||
libavutil/qsort.* @michaelni
|
||||
libavutil/random_seed.* @michaelni
|
||||
libavutil/rational.* @michaelni
|
||||
libavutil/sfc.* @michaelni
|
||||
libavutil/softfloat.* @michaelni
|
||||
libavutil/tree.* @michaelni
|
||||
libavutil/tx.* @lynne
|
||||
|
||||
libavutil/aarch64/.* @lynne @mstorsjo
|
||||
libavutil/arm/.* @mstorsjo
|
||||
libavutil/ppc/.* @sean_mcg
|
||||
libavutil/x86/.* @lynne
|
||||
|
||||
# swresample
|
||||
# =======
|
||||
libswresample/aarch64/.* @mstorsjo
|
||||
libswresample/arm/.* @mstorsjo
|
||||
libswresample/.* @michaelni
|
||||
|
||||
# swscale
|
||||
# =======
|
||||
libswscale/aarch64/.* @mstorsjo
|
||||
libswscale/arm/.* @mstorsjo
|
||||
libswscale/ppc/.* @sean_mcg
|
||||
|
||||
# doc
|
||||
# ===
|
||||
doc/.* @GyanD
|
||||
|
||||
# Frameworks
|
||||
# ==========
|
||||
.*d3d12va.* @jianhuaw
|
||||
.*vulkan.* @lynne
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# Summary of the bug
|
||||
|
||||
Briefly describe the issue you're experiencing. Include any error messages, unexpected behavior, or relevant observations.
|
||||
|
||||
# Steps to reproduce
|
||||
|
||||
List the steps required to trigger the bug.
|
||||
Include the exact CLI command used, if any.
|
||||
Provide sample input files, logs, or scripts if available.
|
||||
|
|
@ -1,72 +0,0 @@
|
|||
module.exports = async ({github, context}) => {
|
||||
const title = (context.payload.pull_request?.title || context.payload.issue?.title || '').toLowerCase();
|
||||
const labels = [];
|
||||
const issueNumber = context.payload.pull_request?.number || context.payload.issue?.number;
|
||||
|
||||
const kwmap = {
|
||||
'avcodec': 'avcodec',
|
||||
'avdevice': 'avdevice',
|
||||
'avfilter': 'avfilter',
|
||||
'avformat': 'avformat',
|
||||
'avutil': 'avutil',
|
||||
'swresample': 'swresample',
|
||||
'swscale': 'swscale',
|
||||
'fftools': 'CLI'
|
||||
};
|
||||
|
||||
async function isOrgMember(username) {
|
||||
try {
|
||||
const response = await github.rest.orgs.checkMembershipForUser({
|
||||
org: context.repo.owner,
|
||||
username: username
|
||||
});
|
||||
return response.status === 204;
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (context.payload.action === 'closed' ||
|
||||
(context.payload.action !== 'opened' && (
|
||||
context.payload.action === 'assigned' ||
|
||||
context.payload.action === 'label_updated' ||
|
||||
context.payload.comment) &&
|
||||
await isOrgMember(context.payload.sender.login))
|
||||
) {
|
||||
try {
|
||||
await github.rest.issues.removeLabel({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: issueNumber,
|
||||
// this should say 'new', but forgejo deviates from GitHub API here and expects the ID
|
||||
name: '41'
|
||||
});
|
||||
console.log('Removed "new" label');
|
||||
} catch (error) {
|
||||
if (error.status !== 404 && error.status !== 410) {
|
||||
console.log('Could not remove "new" label');
|
||||
}
|
||||
}
|
||||
} else if (context.payload.action === 'opened') {
|
||||
labels.push('new');
|
||||
console.log('Detected label: new');
|
||||
}
|
||||
|
||||
if ((context.payload.action === 'opened' || context.payload.action === 'edited') && context.eventName !== 'issue_comment') {
|
||||
for (const [kw, label] of Object.entries(kwmap)) {
|
||||
if (title.includes(kw)) {
|
||||
labels.push(label);
|
||||
console.log('Detected label: ' + label);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (labels.length > 0) {
|
||||
await github.rest.issues.addLabels({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: issueNumber,
|
||||
labels: labels,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
avcodec:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: libavcodec/**
|
||||
|
||||
avdevice:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: libavdevice/**
|
||||
|
||||
avfilter:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: libavfilter/**
|
||||
|
||||
avformat:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: libavformat/**
|
||||
|
||||
avutil:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: libavutil/**
|
||||
|
||||
swresample:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: libswresample/**
|
||||
|
||||
swscale:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: libswscale/**
|
||||
|
||||
CLI:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: fftools/**
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
exclude: ^tests/ref/
|
||||
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v5.0.0
|
||||
hooks:
|
||||
- id: check-case-conflict
|
||||
- id: check-executables-have-shebangs
|
||||
- id: check-illegal-windows-names
|
||||
- id: check-shebang-scripts-are-executable
|
||||
- id: check-yaml
|
||||
- id: end-of-file-fixer
|
||||
- id: file-contents-sorter
|
||||
files:
|
||||
.forgejo/pre-commit/ignored-words.txt
|
||||
args:
|
||||
- --ignore-case
|
||||
- id: fix-byte-order-marker
|
||||
- id: mixed-line-ending
|
||||
- id: trailing-whitespace
|
||||
- repo: https://github.com/codespell-project/codespell
|
||||
rev: v2.4.1
|
||||
hooks:
|
||||
- id: codespell
|
||||
args:
|
||||
- --ignore-words=.forgejo/pre-commit/ignored-words.txt
|
||||
- --ignore-multiline-regex=codespell:off.*?(codespell:on|\Z)
|
||||
exclude: ^tools/(patcheck|clean-diff)$
|
||||
|
|
@ -1,119 +0,0 @@
|
|||
abl
|
||||
ACN
|
||||
acount
|
||||
addin
|
||||
alis
|
||||
alls
|
||||
ALOG
|
||||
ALS
|
||||
als
|
||||
ANC
|
||||
anc
|
||||
ANS
|
||||
ans
|
||||
anull
|
||||
basf
|
||||
bloc
|
||||
brane
|
||||
BREIF
|
||||
BU
|
||||
bu
|
||||
bufer
|
||||
CAF
|
||||
caf
|
||||
clen
|
||||
clens
|
||||
Collet
|
||||
compre
|
||||
dum
|
||||
endin
|
||||
erro
|
||||
FIEL
|
||||
fiel
|
||||
filp
|
||||
fils
|
||||
FILTERD
|
||||
filterd
|
||||
fle
|
||||
fo
|
||||
FPR
|
||||
fro
|
||||
Hald
|
||||
indx
|
||||
ine
|
||||
inh
|
||||
inout
|
||||
inouts
|
||||
inport
|
||||
ist
|
||||
LAF
|
||||
laf
|
||||
lastr
|
||||
LinS
|
||||
mapp
|
||||
mis
|
||||
mot
|
||||
nd
|
||||
nIn
|
||||
offsetp
|
||||
orderd
|
||||
ot
|
||||
outout
|
||||
padd
|
||||
PAETH
|
||||
paeth
|
||||
PARM
|
||||
parm
|
||||
parms
|
||||
pEvents
|
||||
PixelX
|
||||
Psot
|
||||
quater
|
||||
readd
|
||||
recuse
|
||||
redY
|
||||
Reencode
|
||||
reencode
|
||||
remaind
|
||||
renderD
|
||||
rin
|
||||
SAV
|
||||
SEH
|
||||
SER
|
||||
ser
|
||||
setts
|
||||
shft
|
||||
SIZ
|
||||
siz
|
||||
skipd
|
||||
sme
|
||||
som
|
||||
sover
|
||||
STAP
|
||||
startd
|
||||
statics
|
||||
struc
|
||||
suble
|
||||
TE
|
||||
tE
|
||||
te
|
||||
tha
|
||||
tne
|
||||
tolen
|
||||
tpye
|
||||
tre
|
||||
TRUN
|
||||
trun
|
||||
truns
|
||||
Tung
|
||||
TYE
|
||||
ue
|
||||
UES
|
||||
ues
|
||||
vai
|
||||
vas
|
||||
vie
|
||||
VILL
|
||||
vor
|
||||
wel
|
||||
wih
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
on:
|
||||
pull_request_target:
|
||||
types: [opened, edited, synchronize, closed, assigned, labeled, unlabeled]
|
||||
issues:
|
||||
types: [opened, edited, closed, assigned, labeled, unlabeled]
|
||||
issue_comment:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
pr_labeler:
|
||||
runs-on: utilities
|
||||
if: ${{ github.event.sender.login != 'ffmpeg-devel' }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Label by file-changes
|
||||
uses: https://github.com/actions/labeler@v5
|
||||
if: ${{ forge.event_name == 'pull_request_target' }}
|
||||
with:
|
||||
configuration-path: .forgejo/labeler/labeler.yml
|
||||
repo-token: ${{ secrets.AUTOLABELER_TOKEN }}
|
||||
- name: Label by title-match
|
||||
uses: https://github.com/actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const script = require('.forgejo/labeler/labeler.js')
|
||||
await script({github, context})
|
||||
github-token: ${{ secrets.AUTOLABELER_TOKEN }}
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: utilities
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Install pre-commit CI
|
||||
id: install
|
||||
run: |
|
||||
python3 -m venv ~/pre-commit
|
||||
~/pre-commit/bin/pip install --upgrade pip setuptools
|
||||
~/pre-commit/bin/pip install pre-commit
|
||||
echo "envhash=$({ python3 --version && cat .forgejo/pre-commit/config.yaml; } | sha256sum | cut -d' ' -f1)" >> $FORGEJO_OUTPUT
|
||||
- name: Cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/pre-commit
|
||||
key: pre-commit-${{ steps.install.outputs.envhash }}
|
||||
- name: Run pre-commit CI
|
||||
run: ~/pre-commit/bin/pre-commit run -c .forgejo/pre-commit/config.yaml --show-diff-on-failure --color=always --all-files
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
run_fate:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
runner: [linux-amd64,linux-aarch64]
|
||||
runs-on: ${{ matrix.runner }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Configure
|
||||
run: ./configure --enable-gpl --enable-nonfree --enable-memory-poisoning --assert-level=2
|
||||
- name: Build
|
||||
run: make -j$(nproc)
|
||||
- name: Restore Cached Fate-Suite
|
||||
id: cache
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: fate-suite
|
||||
key: fate-suite
|
||||
restore-keys: |
|
||||
fate-suite-
|
||||
- name: Sync Fate-Suite
|
||||
id: fate
|
||||
run: |
|
||||
make fate-rsync SAMPLES=$PWD/fate-suite
|
||||
echo "hash=$(find fate-suite -type f | sort | sha256sum | cut -d' ' -f1)" >> $FORGEJO_OUTPUT
|
||||
- name: Cache Fate-Suite
|
||||
uses: actions/cache/save@v4
|
||||
if: ${{ format('fate-suite-{0}', steps.fate.outputs.hash) != steps.cache.outputs.cache-matched-key }}
|
||||
with:
|
||||
path: fate-suite
|
||||
key: fate-suite-${{ steps.fate.outputs.hash }}
|
||||
- name: Run Fate
|
||||
run: make fate SAMPLES=$PWD/fate-suite -j$(nproc)
|
||||
compile_only:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
image: ["ghcr.io/btbn/ffmpeg-builds/win64-gpl:latest"]
|
||||
runs-on: linux-amd64
|
||||
container: ${{ matrix.image }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Configure
|
||||
run: |
|
||||
./configure --pkg-config-flags="--static" $FFBUILD_TARGET_FLAGS $FF_CONFIGURE \
|
||||
--cc="$CC" --cxx="$CXX" --ar="$AR" --ranlib="$RANLIB" --nm="$NM" \
|
||||
--extra-cflags="$FF_CFLAGS" --extra-cxxflags="$FF_CXXFLAGS" \
|
||||
--extra-libs="$FF_LIBS" --extra-ldflags="$FF_LDFLAGS" --extra-ldexeflags="$FF_LDEXEFLAGS"
|
||||
- name: Build
|
||||
run: make -j$(nproc)
|
||||
1
.gitattributes
vendored
1
.gitattributes
vendored
|
|
@ -1,2 +1 @@
|
|||
*.pnm -diff -text
|
||||
Changelog merge=union
|
||||
|
|
|
|||
5
.gitignore
vendored
5
.gitignore
vendored
|
|
@ -1,6 +1,5 @@
|
|||
*.a
|
||||
*.o
|
||||
*.objs
|
||||
*.o.*
|
||||
*.d
|
||||
*.def
|
||||
|
|
@ -42,7 +41,3 @@
|
|||
/src
|
||||
/mapfile
|
||||
/tools/python/__pycache__/
|
||||
/libavcodec/vulkan/*.c
|
||||
/libavfilter/vulkan/*.c
|
||||
/.*/
|
||||
!/.forgejo/
|
||||
|
|
|
|||
4
.mailmap
4
.mailmap
|
|
@ -24,7 +24,3 @@ rcombs <rcombs@rcombs.me> <rodger.combs@gmail.com>
|
|||
<lq@chinaffmpeg.org> <liuqi05@kuaishou.com>
|
||||
<ruiling.song83@gmail.com> <ruiling.song@intel.com>
|
||||
Cosmin Stejerean <cosmin@cosmin.at> Cosmin Stejerean via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
|
||||
<wutong1208@outlook.com> <tong1.wu-at-intel.com@ffmpeg.org>
|
||||
<wutong1208@outlook.com> <tong1.wu@intel.com>
|
||||
<toqsxw@outlook.com> <jianhua.wu-at-intel.com@ffmpeg.org>
|
||||
<toqsxw@outlook.com> <jianhua.wu@intel.com>
|
||||
|
|
|
|||
30
.travis.yml
Normal file
30
.travis.yml
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
language: c
|
||||
sudo: false
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- nasm
|
||||
- diffutils
|
||||
compiler:
|
||||
- clang
|
||||
- gcc
|
||||
matrix:
|
||||
exclude:
|
||||
- os: osx
|
||||
compiler: gcc
|
||||
cache:
|
||||
directories:
|
||||
- ffmpeg-samples
|
||||
before_install:
|
||||
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; fi
|
||||
install:
|
||||
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install nasm; fi
|
||||
script:
|
||||
- mkdir -p ffmpeg-samples
|
||||
- ./configure --samples=ffmpeg-samples --cc=$CC
|
||||
- make -j 8
|
||||
- make fate-rsync
|
||||
- make check -j 8
|
||||
|
|
@ -55,7 +55,7 @@ modified by someone else and passed on, the recipients should know
|
|||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
|
|
@ -111,7 +111,7 @@ modification follow. Pay close attention to the difference between a
|
|||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
|
|
@ -158,7 +158,7 @@ Library.
|
|||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
|
|
@ -216,7 +216,7 @@ instead of to this License. (If a newer version than version 2 of the
|
|||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
|
@ -267,7 +267,7 @@ Library will still fall under Section 6.)
|
|||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
|
|
@ -329,7 +329,7 @@ restrictions of other proprietary libraries that do not normally
|
|||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
|
|
@ -370,7 +370,7 @@ subject to these terms and conditions. You may not impose any further
|
|||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
|
|
@ -422,7 +422,7 @@ conditions either of that version or of any later version published by
|
|||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
|
|
@ -456,7 +456,7 @@ SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
|||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
|
|
|
|||
582
Changelog
582
Changelog
|
|
@ -1,86 +1,511 @@
|
|||
Entries are sorted chronologically from oldest to youngest within each release,
|
||||
releases are sorted from youngest to oldest.
|
||||
|
||||
version <next>:
|
||||
version 7.0.3:
|
||||
doc/t2h: Support texinfo 7.1 and 7.2 pretest
|
||||
avformat/iamf_parse: ensure there's at most one of each parameter types in audio elements
|
||||
avformat/iamf_parse: add missing constrains for num_parameters in audio_element_oub()
|
||||
avformat/iamf_parse: add missing av_free() call on failure path
|
||||
avformat/iamf_writer: ensure the stream groups are not empty
|
||||
avformat/iamf_writer: fix setting num_samples_per_frame for OPUS
|
||||
avformat/iamf_parse: fix setting duration for the last subblock in a parameter definition
|
||||
avformat/iamf_parse: add checks to parameter definition durations
|
||||
avformat/iamfdec: don't set individual streams as dependent
|
||||
avformat/iff: Check that we have a stream in read_dst_frame()
|
||||
avformat/mlvdec: fix size checks
|
||||
avformat/wavdec: Fix overflow of intermediate in block_align check
|
||||
avformat/mxfdec: Check edit unit for overflow in mxf_set_current_edit_unit()
|
||||
avformat/hls: Fix twitter
|
||||
libavformat/hls: Be more restrictive on mpegts extensions
|
||||
avformat/hls: .ts is always ok even if its a mov/mp4
|
||||
avcodec/h263dec: Check against previous dimensions instead of coded
|
||||
avformat/hls: Print input format in error message
|
||||
avformat/hls: Be more picky on extensions
|
||||
avformat/mxfdec: Check avio_read() success in mxf_decrypt_triplet()
|
||||
avcodec/huffyuvdec: Initialize whole output for decode_gray_bitstream()
|
||||
avformat/iamf_reader: Initialize padding and check read in ff_iamf_read_packet()
|
||||
avformat/ipmovie: Check signature_buffer read
|
||||
avformat/wtvdec: Initialize buf
|
||||
avcodec/cbs_vp9: Initialize VP9RawSuperframeIndex
|
||||
avformat/vqf: Propagate errors from add_metadata()
|
||||
avformat/vqf: Check avio_read() in add_metadata()
|
||||
avformat/dashdec: Check whitelist
|
||||
avutil/avstring: dont mess with NULL pointers in av_match_list()
|
||||
avfilter/vf_v360: Fix NULL pointer use
|
||||
avcodec/mpegvideo_enc: Check FLV1 resolution limits
|
||||
avcodec/ffv1enc: Fix handling of 32bit unsigned symbols
|
||||
avformat/mov: Factorize sanity check out
|
||||
avcodec/vc1dec: Clear block_index in vc1_decode_reset()
|
||||
avcodec/aacsbr_template: Clear n_q on error
|
||||
avformat/iamf_parse: Check output_channel_count
|
||||
avcodec/osq: Fixes several undefined overflows in do_decode()
|
||||
swscale/output: Fix undefined overflow in yuv2rgba64_full_X_c_template()
|
||||
avfilter/af_pan: Fix sscanf() use
|
||||
avfilter/vf_grayworld: Use the correct pointer for av_log()
|
||||
avfilter/vf_addroi: Add missing NULL termination to addroi_var_names[]()
|
||||
avcodec/get_buffer: Use av_buffer_mallocz() for audio same as its done for video
|
||||
avformat/jpegxl_anim_dec: clear buffer padding
|
||||
avformat/rmdec: check that buf if completely filled
|
||||
avcodec/cfhdenc: Clear dwt_tmp
|
||||
avcodec/hapdec: Clear tex buffer
|
||||
avformat/mxfdec: Check that key was read sucessfull
|
||||
avformat/rpl: Fix check for negative values
|
||||
avformat/mlvdec: Check avio_read()
|
||||
avcodec/utils: Fix block align overflow for ADPCM_IMA_WAV
|
||||
avformat/matroskadec: Check pre_ns for overflow
|
||||
tools/target_dec_fuzzer: Adjust threshold for EACMV
|
||||
tools/target_dec_fuzzer: Adjust threshold for MVC1
|
||||
tools/target_dec_fuzzer: Adjust Threshold for indeo5
|
||||
avutil/timecode: Avoid fps overflow in av_timecode_get_smpte_from_framenum()
|
||||
avcodec/webp: Check ref_x/y
|
||||
avcodec/ilbcdec: Initialize tempbuff2
|
||||
avformat/qcp: Check for read failure in header
|
||||
avcodec/eatgq: Check bytestream2_get_buffer() for failure
|
||||
avformat/dxa: check bpc
|
||||
swscale/slice: clear allocated memory in alloc_lines()
|
||||
avcodec/h2645_parse: Ignore NAL with nuh_layer_id == 63
|
||||
avformat/iamf_parse: reject ambisonics mode > 1
|
||||
avcodec/mjpegdec: Disallow progressive bayer images
|
||||
avformat/icodec: fix integer overflow with nb_pal
|
||||
doc/developer: Document relationship between git accounts and MAINTAINERS
|
||||
doc/infra: Document trac backup system
|
||||
doc/infra: Document gitolite
|
||||
avformat/vividas: Check avio_read() for failure
|
||||
avformat/ilbc: Check avio_read() for failure
|
||||
avformat/nistspheredec: Clear buffer
|
||||
avformat/mccdec: Initialize and check rate.den
|
||||
avformat/rpl: check channels
|
||||
INSTALL: explain the circular dependency issue and solution
|
||||
avformat/mpegts: Initialize predefined_SLConfigDescriptor_seen
|
||||
avformat/mxfdec: Fix overflow in midpoint computation
|
||||
swscale/output: used unsigned for bit accumulation
|
||||
avcodec/rangecoder: only perform renorm check/loop for callers that need it
|
||||
avcodec/ffv1dec: Fix end computation with ec=2
|
||||
avcodec/ffv1enc: Prevent generation of files with broken slices
|
||||
avformat/matroskadec: Check desc_bytes so bits fit in 64bit
|
||||
avformat/mov: Avoid overflow in dts
|
||||
avcodec/ffv1enc: Correct error message about unsupported version
|
||||
avcodec/ffv1enc: Slice combination is unsupported
|
||||
avcodec/ffv1enc: 2Pass mode is not possible with golomb coding
|
||||
avcodec/ffv1enc: Fix >8bit context size
|
||||
avcodec/xan: Add basic input size check
|
||||
avcodec/imm4: Check input size
|
||||
avcodec/svq3: Check for minimum size input
|
||||
avcodec/eacmv: Check input size for intra frames
|
||||
tools/target_dec_fuzzer: Adapt threshold for RASC
|
||||
avcodec/encode: Check bitrate
|
||||
avcodec/cbs_h266_syntax_template: Check bit depth with range extension
|
||||
avcodec/osq: use unsigned for decorrelation
|
||||
avcodec/jfdctint_template: use unsigned z* in row_fdct()
|
||||
avformat/asf: Check picsize
|
||||
avcodec/osq: Treat sum = 0 as k = 0
|
||||
avformat/mxfdec: Check timecode for overflow
|
||||
avformat/mxfdec: More offset_temp checks
|
||||
avformat/flvdec: Free metaVideoColor
|
||||
swscale/output: Fix undefined integer overflow in yuv2rgba64_2_c_template()
|
||||
swscale/swscale: Use unsigned operation to avoid undefined behavior
|
||||
avcodec/vc2enc: basic sanity check on slice_max_bytes
|
||||
avformat/mvdec: Check if name was fully read
|
||||
avcodec/wmavoice: Do not use uninitialized pitch[0]
|
||||
avformat/argo_brp: Check that ASF chunk header is completely read
|
||||
avcodec/notchlc: Check bytes left before reading
|
||||
avcodec/vc1_block: propagate error codes
|
||||
avformat/apetag: Check APETAGEX
|
||||
avcodec/magicyuvenc: better slice height
|
||||
avcodec/avcodec: Warn about data returned from get_buffer*()
|
||||
avformat/av1dec: Better fix for 70872/clusterfuzz-testcase-minimized-ffmpeg_dem_OBU_fuzzer-6005782487826432
|
||||
avcodec/apac: Fix discards ‘const’ qualifier
|
||||
avcodec/alsdec: clear last_acf_mantissa
|
||||
avcodec/aic: Clear slice_data
|
||||
avcodec/vc1dec: Clear mb_type_base and ttblk_base
|
||||
avcodec/shorten: clear padding
|
||||
avformat/mpeg: Check an avio_read() for failure
|
||||
avcodec/apac: Clean padding space
|
||||
avcodec/mvha: Clear remaining space after inflate()
|
||||
bsf/media100_to_mjpegb: Clear output buffer padding
|
||||
avformat/iamfdec: Check nb_layers before dereferencing layer
|
||||
avformat/av1dec: Check bits left before get_leb128()
|
||||
avformat/segafilm: Set keyframe
|
||||
avcodec/sga: av_assert1 check init_get_bits8()
|
||||
tools/target_dec_fuzzer: Check that FFv1 doesnt leave uninitialized memory in its buffers
|
||||
avdevice/dshow: Initialize 2 pointers
|
||||
avcodec/dxva2: initialize hr in ff_dxva2_common_end_frame()
|
||||
avcodec/dxva2: initialize validate
|
||||
avcodec/dxva2: Initialize ConfigBitstreamRaw
|
||||
avcodec/dxva2: Initialize dxva_size and check it
|
||||
avfilter/vf_xfade: Compute w2, h2 with float
|
||||
avfilter/vf_v360: Assert that vf was initialized
|
||||
avfilter/vf_tonemap_opencl: Dereference after NULL check
|
||||
avfilter/af_surround: Check output format
|
||||
avfilter/vf_xfade_opencl: Check ff_inlink_consume_frame() for failure
|
||||
avformat/lmlm4: Eliminate some AVERROR(EIO)
|
||||
tools/target_dec_fuzzer: Use av_buffer_allocz() to avoid missing slices to have unpredictable content
|
||||
avformat/wtvdec: Check length of read mpeg2_descriptor
|
||||
avformat/wtvdec: clear sectors
|
||||
avcodec/parser: ensure input padding is zeroed
|
||||
avformat/jpegxl_anim_dec: ensure input padding is zeroed
|
||||
avformat/img2dec: Clear padding data after EOF
|
||||
avformat/wavdec: Check if there are 16 bytes before testing them
|
||||
avformat/mov: (v4) fix get_eia608_packet
|
||||
configure: Improve the check for the rsync --contimeout option
|
||||
rtmpproto: Avoid rare crashes in the fail: codepath in rtmp_open
|
||||
lavc/aarch64: Fix ff_pred16x16_plane_neon_10
|
||||
lavc/aarch64: Fix ff_pred8x8_plane_neon_10
|
||||
vp9: recon: Use emulated edge to prevent buffer overflows
|
||||
arm: vp9mc: Load only 12 pixels in the 4 pixel wide horizontal filter
|
||||
aarch64: vp9mc: Load only 12 pixels in the 4 pixel wide horizontal filter
|
||||
avfilter/f_loop: fix aloop activate logic
|
||||
avfilter/f_loop: fix length of aloop leftover buffer
|
||||
avcodec/jpegxl_parser: fix reading lz77-pair as initial entropy symbol
|
||||
avcodec/jpegxl_parser: check entropy_decoder_read_symbol return value
|
||||
fftools/ffplay: fix crash when vk renderer is null
|
||||
avutil/wchar_filename: re-introduce explicit cast of void* to char*
|
||||
avcodec/libx265: unbreak build for X265_BUILD >= 213
|
||||
avutil/iamf: fix doxygen
|
||||
avformat/mov_chan: add extra checks to channel description count
|
||||
lavc/hevcdec: set per-CTB filter parameters for WPP
|
||||
lavc/hevc: check framerate num/den to be strictly positive
|
||||
lavc/libx265: unbreak build for X265_BUILD >= 210
|
||||
avformat/libzmq: fix check for zmq protocol prefix
|
||||
configure: improve check for POSIX ioctl
|
||||
configure: restore autodetection of v4l2 and fbdev
|
||||
avformat/iamf_parse: Fix return of uninitialized value
|
||||
avformat/iamf_parse: use get_bits_long() to read the remaining AAC extradata bits
|
||||
avformat/iamf_parse: fix parsing AAC DecoderConfigDescriptor
|
||||
avformat/isom: make parameters used for loging a pointer to void
|
||||
avformat/iamf_parse: clear padding
|
||||
avformat/hlsenc: correctly reset subtitle stream counter per-varstream
|
||||
libavcodec/arm/mlpdsp_armv5te: fix label format to work with binutils 2.43
|
||||
avformat/iamf_parse: ignore Audio Elements with an unsupported type
|
||||
lavc/vaapi_av1: Avoid sending the same slice buffer multiple times
|
||||
lavc/vaapi_decode: Make it possible to send multiple slice params buffers
|
||||
avformat/mov: fix track handling when mixing IAMF and video tracks
|
||||
|
||||
version 7.0.2:
|
||||
avcodec/snow: Fix off by 1 error in run_buffer
|
||||
avcodec/utils: apply the same alignment to YUV410 as we do to YUV420 for snow
|
||||
avformat/iamf_parse: Check for 0 samples
|
||||
swscale: [loongarch] Fix checkasm-sw_yuv2rgb failure.
|
||||
avcodec/aacps_tablegen_template: don't redefine CONFIG_HARDCODED_TABLES
|
||||
avutil/hwcontext_vaapi: use the correct type for VASurfaceAttribExternalBuffers.buffers
|
||||
avcodec/pcm-bluray/dvd: Use correct pointer types on BE
|
||||
avcodec/pngenc: fix sBIT writing for indexed-color PNGs
|
||||
avcodec/pngdec: use 8-bit sBIT cap for indexed PNGs per spec
|
||||
avformat/mov: check that child boxes of trak are only present inside it
|
||||
avformat/mov: check that sample and chunk count is 1 for HEIF
|
||||
avcodec/videotoolboxenc: Fix bitrate doesn't work as expected
|
||||
avdevice/dshow: Don't skip audio devices if no video device is present
|
||||
avcodec/hdrenc: Allocate more space
|
||||
avcodec/cfhdenc: Height of 16 is not supported
|
||||
avcodec/cfhdenc: Allocate more space
|
||||
avcodec/osq: fix integer overflow when applying factor
|
||||
avcodec/osq: avoid using too large numbers for shifts and integers in update_residue_parameter()
|
||||
avcodec/vaapi_encode: Check hwctx
|
||||
avcodec/proresdec: Consider negative bits left
|
||||
avcodec/alsdec: Clear shift_value
|
||||
avcodec/hevc/hevcdec: Do not allow slices to depend on failed slices
|
||||
avformat/mov: add an EOF check in IPRP
|
||||
avfilter/vf_xfade: Check ff_inlink_consume_frame() for failure
|
||||
avutil/slicethread: Check pthread_*_init() for failure
|
||||
avutil/frame: Check log2_crop_align
|
||||
avutil/buffer: Check ff_mutex_init() for failure
|
||||
avformat/xmv: Check this_packet_size
|
||||
avformat/webpenc: Check filesize in trailer
|
||||
avformat/ty: rec_size seems to only need 32bit
|
||||
avformat/tty: Check avio_size()
|
||||
avformat/siff: Basic pkt_size check
|
||||
avformat/sauce: Check avio_size() for failure
|
||||
avformat/sapdec: Check ffurl_get_file_handle() for error
|
||||
avformat/nsvdec: Check asize for PCM
|
||||
avformat/mp3dec: Check header_filesize
|
||||
avformat/mp3dec; Check for avio_size() failure
|
||||
avformat/mov: Use 64bit for str_size
|
||||
avformat/mm: Check length
|
||||
avformat/hnm: Check *chunk_size
|
||||
avformat/hlsenc: Check ret
|
||||
avformat/bintext: Check avio_size() return
|
||||
avformat/asfdec_o: Check size of index object
|
||||
avfilter/vf_scale: Check ff_scale_adjust_dimensions() for failure
|
||||
avfilter/scale_eval: Use 64bit, check values in ff_scale_adjust_dimensions()
|
||||
avfilter/vf_lut3d: Check av_scanf()
|
||||
avfilter/vf_elbg: Use unsigned for shifting into the top bit
|
||||
avfilter/vf_premultiply: Use AV_PIX_MAX_PLANES
|
||||
avfilter/vf_deshake_opencl: Ensure that the first iteration initializes the best variables
|
||||
avformat/iamf_parse: Check for negative sample sizes
|
||||
swscale/output: Fix integer overflows in yuv2rgba64_X_c_template
|
||||
avformat/mxfdec: Reorder elements of expression in bisect loop
|
||||
avutil/timecode: Use a 64bit framenum internally
|
||||
avcodec/pnmdec: Use 64bit for input size check
|
||||
avformat/mov: Check extradata in mov_read_iacb()
|
||||
avcodec/mpeg12enc: Use av_rescale() in vbv_buffer_size computation
|
||||
avcodec/utvideoenc: Use unsigned shift to build flags
|
||||
avcodec/j2kenc: Merge dwt_norm into lambda
|
||||
avcodec/vc2enc: Fix overflows with storing large values
|
||||
avcodec/mpegvideo_enc: Do not duplicate pictures on shifting
|
||||
avdevice/dshow_capture: Fix error handling in ff_dshow_##prefix##_Create()
|
||||
avcodec/tiff: Check value on positive signed targets
|
||||
avfilter/vf_convolution_opencl: Assert that the filter name is one of the filters
|
||||
avfilter/vf_bm3d: Dont round MSE2SSE to an integer
|
||||
avdevice/dshow: Remove NULL check on pin
|
||||
avdevice/dshow: check ff_dshow_pin_ConnectionMediaType() for failure
|
||||
avdevice/dshow: Check device_filter_unique_name before use
|
||||
avdevice/dshow: Cleanup also on av_log case
|
||||
avdevice/dshow_filter: Use wcscpy_s()
|
||||
avcodec/flac_parser: Assert that we do not overrun the link_penalty array
|
||||
avcodec/osq: avoid signed overflow in downsample path
|
||||
avcodec/pixlet: Simplify pfx computation
|
||||
avcodec/motion_est: Fix score squaring overflow
|
||||
avcodec/mlpenc: Use 64 for ml, mr
|
||||
avcodec/loco: Check loco_get_rice() for failure
|
||||
avcodec/loco: check get_ur_golomb_jpegls() for failure
|
||||
avcodec/leaddec: Check init_get_bits8() for failure
|
||||
avcodec/imm4: check cbphi for error
|
||||
avcodec/iff: Use signed count
|
||||
avcodec/golomb: Assert that k is in the supported range for get_ur/sr_golomb()
|
||||
avcodec/golomb: Document return for get_ur_golomb_jpegls() and get_sr_golomb_flac()
|
||||
avcodec/dxv: Fix type in get_opcodes()
|
||||
avcodec/cri: Check length
|
||||
avcodec/xsubdec: Check parse_timecode()
|
||||
avutil/imgutils: av_image_check_size2() ensure width and height fit in 32bit
|
||||
avfilter/vf_tiltandshift: Free dst on error
|
||||
doc/examples/mux: remove nop
|
||||
avcodec/proresenc_kostya: use unsigned alpha for rotation
|
||||
avformat/rtpenc_rfc4175: Use 64bit in computation if copy_offset
|
||||
avformat/rtmpproto: Use AV_DICT_MATCH_CASE instead of litteral number
|
||||
avformat/rtmppkt: Simplify and deobfuscate amf_tag_skip() slightly
|
||||
avformat/rmdec: use 64bit for audio_framesize checks
|
||||
avutil/wchar_filename: Correct sizeof
|
||||
avutil/hwcontext_d3d11va: correct sizeof IDirect3DSurface9
|
||||
avutil/hwcontext_d3d11va: Free AVD3D11FrameDescriptor on error
|
||||
avutil/hwcontext_d3d11va: correct sizeof AVD3D11FrameDescriptor
|
||||
avcodec/vvc/refs: Use unsigned mask
|
||||
doc/examples/vaapi_encode: Try to check fwrite() for failure
|
||||
avformat/usmdec: Initialize value
|
||||
avformat/tls_schannel: Initialize ret
|
||||
avformat/subfile: Assert that whence is a known case
|
||||
avformat/subfile: Merge if into switch()
|
||||
avformat/rtsp: Check that lower transport is handled in one of the if()
|
||||
avformat/rtsp: initialize reply1
|
||||
avformat/rtsp: use < 0 for error check
|
||||
avformat/rtpenc_vc2hq: Check sizes
|
||||
avfilter/af_aderivative: Free out on error
|
||||
swscale/swscale: Use ptrdiff_t for linesize computations
|
||||
avfilter/af_amerge: Cleanup on av_channel_layout_copy() failure
|
||||
avfilter/af_afir: Assert format
|
||||
avfilter/af_afftdn: Assert format
|
||||
avfilter/af_pan: check nb_output_channels before use
|
||||
cbs_av1: Reject thirty-two zero bits in uvlc code
|
||||
avfilter/af_mcompand: compute half frequency in double
|
||||
avfilter/af_channelsplit: Assert that av_channel_layout_channel_from_index() succeeds
|
||||
avfilter/af_aresample: Cleanup on av_channel_layout_copy() failure
|
||||
tools/coverity: Phase 1 study of anti-halicogenic for coverity av_rescale()
|
||||
avfilter/vf_avgblur: Check plane instead of AVFrame
|
||||
avfilter/drawutils: Fix depthb computation
|
||||
avfilter/avf_showcwt: Check av_parse_video_rate() for failure
|
||||
avformat/rdt: Check pkt_len
|
||||
avformat/mpeg: Check len in mpegps_probe()
|
||||
avformat/mxfenc: resurrects the error print
|
||||
avdevice/dshow: Check ICaptureGraphBuilder2_SetFiltergraph() for failure
|
||||
avcodec/mfenc: check IMFSample_ConvertToContiguousBuffer() for failure
|
||||
avcodec/vc1_loopfilter: Factor duplicate code in vc1_b_h_intfi_loop_filter()
|
||||
avcodec/vvc/ctu: Remove dead ret check
|
||||
avcodec/vvc/dec: Remove constant eos_at_start
|
||||
avformat/img2dec: assert no pipe on ts_from_file
|
||||
avcodec/cbs_jpeg: Try to move the read entity to one side in a test
|
||||
fftools/ffplay: Check vulkan_params
|
||||
fftools/ffmpeg_enc: Initialize Decoder
|
||||
fftools/ffmpeg_enc: Initialize fd
|
||||
fftools/ffmpeg_enc: simplify opaque_ref check
|
||||
avformat/mov: Check edit list for overflow
|
||||
fftools/ffmpeg: Check read() for failure
|
||||
avcodec/vvc/dec: Check ff_init_cabac_decoder() for failure
|
||||
MAINTAINERS: Add Timo Rothenpieler to server admins
|
||||
swscale/output: Avoid undefined overflow in yuv2rgb_write_full()
|
||||
swscale/output: alpha can become negative after scaling, use multiply
|
||||
avcodec/targaenc: Allocate space for the palette
|
||||
avcodec/r210enc: Use av_rescale for bitrate
|
||||
avcodec/jfdctint_template: Fewer integer anomalies
|
||||
avcodec/snowenc: MV limits due to mv_penalty table size
|
||||
tools/target_dec_fuzzer: Adjust threshold for MV30
|
||||
tools/target_dec_fuzzer: Adjust threshold for jpeg2000
|
||||
avformat/mxfdec: Check container_ul->desc before use
|
||||
avcodec/libvpxenc: Cleanup on error
|
||||
MAINTAINERS: Update the entries for the release maintainer for FFmpeg
|
||||
doc/developer: Provide information about git send-email and gmail
|
||||
avfilter/vf_rotate: Check ff_draw_init2() return value
|
||||
avformat/mov: Use int64_t in intermediate for corrected_dts
|
||||
avformat/mov: Use 64bit in intermediate for current_dts
|
||||
avformat/matroskadec: Assert that num_levels is non negative
|
||||
avformat/libzmq: Check av_strstart()
|
||||
avformat/img2dec: Little JFIF / Exif cleanup
|
||||
avformat/img2dec: Move DQT after unrelated if()
|
||||
avformat/imfdec: Simplify get_next_track_with_minimum_timestamp()
|
||||
avdevice/xcbgrab: Check sscanf() return
|
||||
fftools/cmdutils: Add protective () to FLAGS
|
||||
avformat/sdp: Check before appending ","
|
||||
avcodec/libx264: Check init_get_bits8() return code
|
||||
avcodec/ilbcdec: Remove dead code
|
||||
avcodec/vp8: Check cond init
|
||||
avcodec/vp8: Check mutex init
|
||||
avcodec/proresenc_anatoliy: Assert that AV_PROFILE_UNKNOWN is replaced
|
||||
avcodec/pcm-dvdenc: 64bit pkt-size
|
||||
avcodec/notchlc: Check init_get_bits8() for failure
|
||||
avcodec/tests/dct: Use 64bit in intermediate for error computation
|
||||
avcodec/scpr3: Check add_dec() for failure
|
||||
avcodec/rv34: assert that size is not 0 in rv34_gen_vlc_ext()
|
||||
avcodec/wavpackenc: Use unsigned for potential 31bit shift
|
||||
avcodec/vvc/mvs: Initialize mvf
|
||||
avcodec/tests/jpeg2000dwt: Use 64bit in comparission
|
||||
avcodec/tests/jpeg2000dwt: Use 64bit in err2 computation
|
||||
avformat/fwse: Remove always false expression
|
||||
avcodec/sga: Make it clear that the return is intentionally not checked
|
||||
avformat/asfdec_f: Use 64bit for preroll computation
|
||||
avformat/argo_asf: Use 64bit in offset intermediate
|
||||
avformat/ape: Use 64bit for final frame size
|
||||
avformat/ac4dec: Check remaining space in ac4_probe()
|
||||
avdevice/pulse_audio_enc: Use av_rescale() to avoid integer overflow
|
||||
avcodec/vlc: Cleanup on multi table alloc failure in ff_vlc_init_multi_from_lengths()
|
||||
avcodec/tiff: Assert init_get_bits8() success in unpack_gray()
|
||||
avcodec/tiff: Assert init_get_bits8() success in horizontal_fill()
|
||||
tools/decode_simple: Check avcodec_send_packet() for errors on flushing
|
||||
swscale/yuv2rgb: Use 64bit for brightness computation
|
||||
swscale/x86/swscale: use a clearer name for INPUT_PLANER_RGB_A_FUNC_CASE
|
||||
avutil/tests/opt: Check av_set_options_string() for failure
|
||||
avutil/tests/dict: Check av_dict_set() before get for failure
|
||||
avdevice/dshow: fix badly indented line
|
||||
avformat/demux: resurrect dead stores
|
||||
avcodec/tests/bitstream_template: Assert bits_init8() return
|
||||
tools/enc_recon_frame_test: Assert that av_image_get_linesize() succeeds
|
||||
avformat/iamf_writer: disallow Opus extradata with mapping family other than 0
|
||||
avformat/iamf_parse: sanitize audio_roll_distance values
|
||||
avformat/iamf: byteswap values in OpusHeader
|
||||
avformat/iamf: rename Codec Config seek_preroll to audio_roll_distance
|
||||
avformat/iamf_writer: fix coded audio_roll_distance values
|
||||
avformat/iamf_writer: fix PCM endian-ness flag
|
||||
avformat/movenc: fix channel count and samplerate fields for IAMF tracks
|
||||
avformat/iamf_parse: keep substream count consistent
|
||||
avformat/iamf_parse: add missing padding to AAC extradata
|
||||
avformat/iamf_parse: 0 layers are not allowed
|
||||
avformat/iamf_parse: consider nb_substreams when accessing substreams array
|
||||
avformat/iamf_parse: Remove dead case
|
||||
avcodec/png: more informative error message for invalid sBIT size
|
||||
avcodec/pngdec: avoid erroring with sBIT on indexed-color images
|
||||
avfilter/vf_tiltandshift: fix buffer offset for yuv422p input
|
||||
avutil/timestamp: avoid possible FPE when 0 is passed to av_ts_make_time_string2()
|
||||
avformat/mov: add more checks for infe atom size
|
||||
avformat/mov: check for EOF inside the infe list parsing loop
|
||||
avformat/mov: check extent_offset calculation for overflow
|
||||
avformat/mov: check that iloc offset values fit on an int64_t
|
||||
avcodec/pngenc: fix mDCv typo
|
||||
avcodec/pngdec: fix mDCv typo
|
||||
avcodec/nvenc: fix segfault in intra-only mode
|
||||
avdevice/avfoundation: add external video devices
|
||||
aarch64: Add OpenBSD runtime detection of dotprod and i8mm using sysctl
|
||||
fftools/ffplay_renderer: use correct NULL value for Vulkan type
|
||||
qsv: Initialize impl_value
|
||||
avutil/hwcontext_qsv: fix GCC 14.1 warnings
|
||||
avcodec/mediacodecenc: workaround the alignment requirement for H.265
|
||||
avcodec/mediacodecenc: workaround the alignment requirement only for H.264
|
||||
lavc/lpc: fix off-by-one in R-V V compute_autocorr
|
||||
lavc/vp9: reset segmentation fields when segmentation isn't enabled
|
||||
configure: enable ffnvcodec, nvenc, nvdec for FreeBSD
|
||||
lavc/sbrdsp: fix potential overflow in noise table
|
||||
|
||||
version 8.0:
|
||||
- Whisper filter
|
||||
- Drop support for OpenSSL < 1.1.0
|
||||
- Enable TLS peer certificate verification by default (on next major version bump)
|
||||
- Drop support for OpenSSL < 1.1.1
|
||||
- yasm support dropped, users need to use nasm
|
||||
- VVC VAAPI decoder
|
||||
- RealVideo 6.0 decoder
|
||||
- OpenMAX encoders deprecated
|
||||
- libx265 alpha layer encoding
|
||||
- ADPCM IMA Xbox decoder
|
||||
- Enhanced FLV v2: Multitrack audio/video, modern codec support
|
||||
- Animated JPEG XL encoding (via libjxl)
|
||||
- VVC in Matroska
|
||||
- CENC AV1 support in MP4 muxer
|
||||
- pngenc: set default prediction method to PAETH
|
||||
- APV decoder and APV raw bitstream muxing and demuxing
|
||||
- APV parser
|
||||
- APV encoding support through a libopenapv wrapper
|
||||
- VVC decoder supports all content of SCC (Screen Content Coding):
|
||||
IBC (Inter Block Copy), Palette Mode and ACT (Adaptive Color Transform
|
||||
- G.728 decoder
|
||||
- pad_cuda filter
|
||||
- Sanyo LD-ADPCM decoder
|
||||
- APV in MP4/ISOBMFF muxing and demuxing
|
||||
- OpenHarmony hardware decoder/encoder
|
||||
- Colordetect filter
|
||||
- Add vf_scale_d3d11 filter
|
||||
- No longer disabling GCC autovectorization, on X86, ARM and AArch64
|
||||
- VP9 Vulkan hwaccel
|
||||
- AV1 Vulkan encoder
|
||||
- ProRes RAW decoder
|
||||
- ProRes RAW Vulkan hwaccel
|
||||
- ffprobe -codec option
|
||||
|
||||
|
||||
version 7.1:
|
||||
- Raw Captions with Time (RCWT) closed caption demuxer
|
||||
- LC3/LC3plus decoding/encoding using external library liblc3
|
||||
- ffmpeg CLI filtergraph chaining
|
||||
- LC3/LC3plus demuxer and muxer
|
||||
- pad_vaapi, drawbox_vaapi filters
|
||||
- vf_scale supports secondary ref input and framesync options
|
||||
- vf_scale2ref deprecated
|
||||
- qsv_params option added for QSV encoders
|
||||
- VVC decoder compatible with DVB test content
|
||||
- xHE-AAC decoder
|
||||
- removed DEC Alpha DSP and support code
|
||||
- VVC encoding support via libvvenc
|
||||
- perlin video source
|
||||
- D3D12VA HEVC encoder
|
||||
- Cropping metadata parsing and writing in Matroska and MP4/MOV de/muxers
|
||||
- Intel QSV-accelerated VVC decoding
|
||||
- MediaCodec AAC/AMR-NB/AMR-WB/MP3 decoding
|
||||
- YUV colorspace negotiation for codecs and filters, obsoleting the
|
||||
YUVJ pixel format
|
||||
- Vulkan H.264 encoder
|
||||
- Vulkan H.265 encoder
|
||||
- stream specifiers in fftools can now match by stream disposition
|
||||
- LCEVC enhancement data exporting in H.26x and MP4/ISOBMFF
|
||||
- LCEVC filter
|
||||
- MV-HEVC decoding
|
||||
- minor stream specifier syntax changes:
|
||||
- when matching by metadata (:m:<key>:<val>), the colon character
|
||||
in keys or values now has to be backslash-escaped
|
||||
- in optional maps (-map ....?) with a metadata-matching stream specifier,
|
||||
the value has to be separated from the question mark by a colon, i.e.
|
||||
-map ....:m:<key>:<val>:? (otherwise it would be ambiguous whether the
|
||||
question mark is a part of <val> or not)
|
||||
- multiple stream types in a single specifier (e.g. :s:s:0) now cause an
|
||||
error, as such a specifier makes no sense
|
||||
- Mastering Display and Content Light Level metadata support in hevc_nvenc
|
||||
and av1_nvenc encoders
|
||||
- libswresample now accepts custom order channel layouts as input, with some
|
||||
constrains
|
||||
- FFV1 parser
|
||||
|
||||
version 7.0.1:
|
||||
lavc/flacdsp: do not assume maximum R-V VL
|
||||
avformat/flacdec: Reorder allocations to avoid leak on error
|
||||
avcodec/adts_parser: Don't presume buffer to be padded
|
||||
avformat/movenc: Check av_malloc()
|
||||
avcodec/vp8: Return error on error
|
||||
avformat/mov: store sample_sizes as unsigned ints
|
||||
avformat/vvc: fix parsing sps_subpic_id
|
||||
avformat/vvc: initialize some ptl flags
|
||||
avcodec/mscc & mwsc: Check loop counts before use
|
||||
avcodec/mpegvideo_enc: Fix potential overflow in RD
|
||||
avcodec/mpeg4videodec: assert impossible wrap points
|
||||
avcodec/mpeg12dec: Use 64bit in bit computation
|
||||
avcodec/vqcdec: Check init_get_bits8() for failure
|
||||
avcodec/vvc/dec: Check init_get_bits8() for failure
|
||||
avcodec/vble: Check av_image_get_buffer_size() for failure
|
||||
avcodec/vp3: Replace check by assert
|
||||
avcodec/vp8: Forward return of ff_vpx_init_range_decoder()
|
||||
avcodec/jpeg2000dec: remove ST=3 case
|
||||
avcodec/qsvdec: Check av_image_get_buffer_size() for failure
|
||||
avcodec/exr: Fix preview overflow
|
||||
avcodec/decode: decode_simple_internal() only implements audio and video
|
||||
avcodec/fmvc: remove dead assignment
|
||||
avcodec/h2645_sei: Remove dead checks
|
||||
avcodec/h264_slice: Remove dead sps check
|
||||
avcodec/lpc: copy levenson coeffs only when they have been computed
|
||||
avutil/tests/base64: Check with too short output array
|
||||
libavutil/base64: Try not to write over the array end
|
||||
avcodec/cbs_av1: Avoid shift overflow
|
||||
fftools/ffplay: Check return of swr_alloc_set_opts2()
|
||||
tools/opt_common: Check for malloc failure
|
||||
doc/examples/demux_decode: Simplify loop
|
||||
avformat/concatdec: Check file
|
||||
avcodec/mpegvideo_enc: Fix 1 line and one column images
|
||||
avcodec/amrwbdec: assert mode to be valid in decode_fixed_vector()
|
||||
avcodec/wavarc: fix integer overflow in decode_5elp() block type 2
|
||||
swscale/output: Fix integer overflow in yuv2rgba64_full_1_c_template()
|
||||
swscale/output: Fix integer overflow in yuv2rgba64_1_c_template
|
||||
avcodec/av1dec: Change bit_depth to int
|
||||
avcodec/av1dec: bit_depth cannot be another values than 8,10,12
|
||||
avcodec/avs3_parser: assert the return value of init_get_bits()
|
||||
avcodec/avs2_parser: Assert init_get_bits8() success with const size 15
|
||||
avfilter/avfiltergraph: return value of ff_request_frame() is unused
|
||||
avformat/mxfdec: Check body_offset
|
||||
avformat/kvag: Check sample_rate
|
||||
avcodec/atrac9dec: Check init_get_bits8() for failure
|
||||
avcodec/ac3_parser: Check init_get_bits8() for failure
|
||||
avcodec/pngdec: Check last AVFrame before deref
|
||||
avcodec/hevcdec: Check ref frame
|
||||
doc/examples/qsv_transcode: Initialize pointer before free
|
||||
doc/examples/qsv_transcode: Simplify str_to_dict() loop
|
||||
doc/examples/vaapi_transcode: Simplify loop
|
||||
doc/examples/qsv_transcode: Simplify loop
|
||||
avcodec/cbs_h2645: Check NAL space
|
||||
avfilter/vf_thumbnail_cuda: Set ret before checking it
|
||||
avfilter/signature_lookup: Dont copy uninitialized stuff around
|
||||
avfilter/signature_lookup: Fix 2 differences to the refernce SW
|
||||
avcodec/x86/vp3dsp_init: Set correct function pointer, fix crash
|
||||
avformat/mp3dec: change bogus error message if read_header encounters EOF
|
||||
avformat/mp3dec: simplify inner frame size check in mp3_read_header
|
||||
avformat/mp3dec: only call ffio_ensure_seekback once
|
||||
avcodec/cbs_h266: read vps_ptl_max_tid before using it
|
||||
avcodec/cbs_h266: fix sh_collocated_from_l0_flag and sh_collocated_ref_idx infer
|
||||
avformat/vvc: fix parsing some early VPS bitstream values
|
||||
avformat/vvc: fix writing general_constraint_info bytes
|
||||
avutil/ppc/cpu: Also use the machdep.altivec sysctl on NetBSD
|
||||
lavd/v4l2: Use proper field type for second parameter of ioctl() with BSD's
|
||||
vulkan_av1: Fix force_integer_mv value
|
||||
vaapi_av1: Fix force_integer_mv value
|
||||
av1dec: Add force_integer_mv derived field for decoder use
|
||||
avutil/iamf: fix offsets for mix_gain options
|
||||
avformat/iamfdec: check nb_streams in header read
|
||||
avformat/mov: free the infe allocated item data on failure
|
||||
avformat/iamf_writer: reject duplicated stream ids in a stream group
|
||||
avformat/mov: don't read key_size bytes twice in the keys atom
|
||||
avformat/mov: take into account the first eight bytes in the keys atom
|
||||
avformat/mov: fix the check for the heif item parsing loop
|
||||
avutil/iamf: fix mix_gain_class name
|
||||
av1dec: Fix RefFrameSignBias calculation
|
||||
avcodec/codec_par: always clear extradata_size in avcodec_parameters_to_context()
|
||||
avcodec/mediacodecenc: Fix return empty packet when bsf is used
|
||||
avcodec/hevcdec: Fix precedence, bogus film grain warning
|
||||
avcodec/hevcdec: fix segfault on invalid film grain metadata
|
||||
lavc/vvc: Skip enhancement layer NAL units
|
||||
avformat/mov: ignore old infe box versions
|
||||
vulkan_av1: add workaround for NVIDIA drivers tested on broken CTS
|
||||
lavc/vulkan_av1: Use av1dec reference order hint information
|
||||
lavc/av1: Record reference ordering information for each frame
|
||||
doc/encoders: add missing libxvid option
|
||||
doc/encoders: remove non-existent flag
|
||||
fate/ffmpeg: Avoid dependency on samples
|
||||
avcodec/wavpack: Remove always-false check
|
||||
avcodec/wavpack: Fix leak and segfault on reallocation error
|
||||
avcodec/lossless_videoencdsp: Don't presume alignment in diff_bytes
|
||||
avcodec/ppc/h264dsp: Fix left shifts of negative numbers
|
||||
|
||||
version 7.0:
|
||||
- DXV DXT1 encoder
|
||||
|
|
@ -168,7 +593,6 @@ version 6.1:
|
|||
variable-fields elements within the same parent element
|
||||
- ffprobe -output_format option added as an alias of -of
|
||||
|
||||
# codespell:off
|
||||
|
||||
version 6.0:
|
||||
- Radiance HDR image support
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
{
|
||||
"drips": {
|
||||
"ethereum": {
|
||||
"ownedBy": "0x2f3900e7064eE63D30d749971265858612AA7139"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +1,5 @@
|
|||
## Installing FFmpeg
|
||||
|
||||
0. If you like to include source plugins, merge them before configure
|
||||
for example run tools/merge-all-source-plugins
|
||||
|
||||
1. Type `./configure` to create the configuration. A list of configure
|
||||
options is printed by running `configure --help`.
|
||||
|
||||
|
|
@ -24,5 +21,5 @@ NOTICE for Package Maintainers
|
|||
|
||||
- It is recommended to build FFmpeg twice, first with minimal external dependencies so
|
||||
that 3rd party packages, which depend on FFmpegs libavutil/libavfilter/libavcodec/libavformat
|
||||
can then be built. And last build FFmpeg with full dependencies (which may in turn depend on
|
||||
can then be built. And last build FFmpeg with full dependancies (which may in turn depend on
|
||||
some of these 3rd party packages). This avoids circular dependencies during build.
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ configure to activate them. In this case, FFmpeg's license changes to GPL v2+.
|
|||
|
||||
Specifically, the GPL parts of FFmpeg are:
|
||||
|
||||
- libpostproc
|
||||
- optional x86 optimization in the files
|
||||
- `libavcodec/x86/flac_dsp_gpl.asm`
|
||||
- `libavcodec/x86/idct_mmx.c`
|
||||
|
|
@ -44,6 +45,7 @@ Specifically, the GPL parts of FFmpeg are:
|
|||
- `vf_owdenoise.c`
|
||||
- `vf_perspective.c`
|
||||
- `vf_phase.c`
|
||||
- `vf_pp.c`
|
||||
- `vf_pp7.c`
|
||||
- `vf_pullup.c`
|
||||
- `vf_repeatfields.c`
|
||||
|
|
|
|||
133
MAINTAINERS
133
MAINTAINERS
|
|
@ -6,26 +6,10 @@ FFmpeg code.
|
|||
|
||||
Please try to keep entries where you are the maintainer up to date!
|
||||
|
||||
*Status*, one of the following:
|
||||
[X] Old code. Something tagged obsolete generally means it has been replaced by a better system and you should be using that.
|
||||
[0] No current maintainer [but maybe you could take the role as you write your new code].
|
||||
[1] It has a maintainer but they don't have time to do much other than throw the odd patch in.
|
||||
[2] Someone actually looks after it.
|
||||
|
||||
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.
|
||||
|
||||
(L <address>) *Mailing list* that is relevant to this area
|
||||
(W <address>) *Web-page* with status/info
|
||||
(B <address>) URI for where to file *bugs*. A web-page with detailed bug
|
||||
filing info, a direct bug tracker link, or a mailto: URI.
|
||||
(P <address>) *Subsystem Profile* document for more details submitting
|
||||
patches to the given subsystem. This is either an in-tree file,
|
||||
or a URI. See Documentation/maintainer/maintainer-entry-profile.rst
|
||||
for details.
|
||||
(T <address>) *SCM* tree type and location.
|
||||
Type is one of: git, hg, quilt, stgit, topgit
|
||||
|
||||
|
||||
Applications
|
||||
============
|
||||
|
|
@ -34,10 +18,10 @@ ffmpeg:
|
|||
ffmpeg.c Michael Niedermayer, Anton Khirnov
|
||||
|
||||
ffplay:
|
||||
ffplay.c [2] Marton Balint
|
||||
ffplay.c Marton Balint
|
||||
|
||||
ffprobe:
|
||||
ffprobe.c [2] Stefano Sabatini
|
||||
ffprobe.c Stefano Sabatini
|
||||
|
||||
Commandline utility code:
|
||||
cmdutils.c, cmdutils.h Michael Niedermayer
|
||||
|
|
@ -45,32 +29,30 @@ Commandline utility code:
|
|||
QuickTime faststart:
|
||||
tools/qt-faststart.c Baptiste Coudurier
|
||||
|
||||
Execution Graph Printing
|
||||
fftools/graph, fftools/resources [2] softworkz
|
||||
|
||||
Miscellaneous Areas
|
||||
===================
|
||||
|
||||
documentation Stefano Sabatini, Mike Melanson, Timothy Gu, Gyan Doshi
|
||||
project server day to day operations (L: root@ffmpeg.org) Michael Niedermayer, Reimar Doeffinger, Alexander Strasser, Nikolay Aleksandrov, Timo Rothenpieler
|
||||
project server emergencies (L: root@ffmpeg.org) Reimar Doeffinger, Alexander Strasser, Nikolay Aleksandrov, Timo Rothenpieler
|
||||
presets [0]
|
||||
project server day to day operations Árpád Gereöffy, Michael Niedermayer, Reimar Doeffinger, Alexander Strasser, Nikolay Aleksandrov, Timo Rothenpieler
|
||||
project server emergencies Árpád Gereöffy, Reimar Doeffinger, Alexander Strasser, Nikolay Aleksandrov, Timo Rothenpieler
|
||||
presets Robert Swain
|
||||
metadata subsystem Aurelien Jacobs
|
||||
release management Michael Niedermayer
|
||||
API tests [0]
|
||||
samples-request [2] Thilo Borgmann, James Almer, Ben Littler
|
||||
API tests Ludmila Glinskih
|
||||
|
||||
|
||||
Communication
|
||||
=============
|
||||
website (T: https://git.ffmpeg.org/ffmpeg-web) Deby Barbara Lepage
|
||||
fate.ffmpeg.org (L: fate-admin@ffmpeg.org) (W: https://fate.ffmpeg.org) (P: https://ffmpeg.org/fate.html) (S: https://git.ffmpeg.org/fateserver) Timo Rothenpieler
|
||||
Trac bug tracker (W: https://trac.ffmpeg.org) Alexander Strasser, Michael Niedermayer, Carl Eugen Hoyos
|
||||
Patchwork [2] (W: https://patchwork.ffmpeg.org) Andriy Gelman
|
||||
mailing lists (W: https://ffmpeg.org/contact.html#MailingLists) Baptiste Coudurier
|
||||
|
||||
website Deby Barbara Lepage
|
||||
fate.ffmpeg.org Timothy Gu
|
||||
Trac bug tracker Alexander Strasser, Michael Niedermayer, Carl Eugen Hoyos
|
||||
Patchwork Andriy Gelman
|
||||
mailing lists Baptiste Coudurier
|
||||
Twitter Reynaldo H. Verdejo Pinochet
|
||||
Launchpad Timothy Gu
|
||||
ffmpeg-security [2] (L: ffmpeg-security@ffmpeg.org) (W: https://ffmpeg.org/security.html) Michael Niedermayer, Reimar Doeffinger
|
||||
ffmpeg-security Andreas Cadhalpun, Carl Eugen Hoyos, Clément Bœsch, Michael Niedermayer, Reimar Doeffinger, rcombs, wm4
|
||||
|
||||
|
||||
libavutil
|
||||
|
|
@ -85,26 +67,24 @@ Other:
|
|||
aes_ctr.c, aes_ctr.h Eran Kornblau
|
||||
bprint Nicolas George
|
||||
bswap.h
|
||||
csp.c, csp.h Leo Izen, Ronald S. Bultje
|
||||
des Reimar Doeffinger
|
||||
dynarray.h Nicolas George
|
||||
eval.c, eval.h [2] Michael Niedermayer
|
||||
eval.c, eval.h Michael Niedermayer
|
||||
float_dsp Loren Merritt
|
||||
hash Reimar Doeffinger
|
||||
hwcontext_cuda* Timo Rothenpieler
|
||||
hwcontext_d3d12va* Wu Jianhua
|
||||
hwcontext_vulkan* [2] Lynne
|
||||
hwcontext_vulkan* Lynne
|
||||
intfloat* Michael Niedermayer
|
||||
integer.c, integer.h Michael Niedermayer
|
||||
lzo Reimar Doeffinger
|
||||
mathematics.c, mathematics.h [2] Michael Niedermayer
|
||||
mem.c, mem.h [2] Michael Niedermayer
|
||||
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 [2] Michael Niedermayer
|
||||
rational.c, rational.h Michael Niedermayer
|
||||
rc4 Reimar Doeffinger
|
||||
ripemd.c, ripemd.h James Almer
|
||||
tx* [2] Lynne
|
||||
tx* Lynne
|
||||
|
||||
|
||||
libavcodec
|
||||
|
|
@ -126,18 +106,20 @@ Generic Parts:
|
|||
DSP utilities:
|
||||
dsputils.c, dsputils.h Michael Niedermayer
|
||||
entropy coding:
|
||||
rangecoder.c, rangecoder.h [2] Michael Niedermayer
|
||||
rangecoder.c, rangecoder.h Michael Niedermayer
|
||||
lzw.* Michael Niedermayer
|
||||
floating point AAN DCT:
|
||||
faandct.c, faandct.h [2] Michael Niedermayer
|
||||
faandct.c, faandct.h Michael Niedermayer
|
||||
Golomb coding:
|
||||
golomb.c, golomb.h [2] Michael Niedermayer
|
||||
golomb.c, golomb.h Michael Niedermayer
|
||||
motion estimation:
|
||||
motion* Michael Niedermayer
|
||||
rate control:
|
||||
ratecontrol.c [2] Michael Niedermayer
|
||||
ratecontrol.c Michael Niedermayer
|
||||
simple IDCT:
|
||||
simple_idct.c, simple_idct.h [2] Michael Niedermayer
|
||||
simple_idct.c, simple_idct.h Michael Niedermayer
|
||||
postprocessing:
|
||||
libpostproc/* Michael Niedermayer
|
||||
table generation:
|
||||
tableprint.c, tableprint.h Reimar Doeffinger
|
||||
fixed point FFT:
|
||||
|
|
@ -145,7 +127,7 @@ Generic Parts:
|
|||
Text Subtitles Clément Bœsch
|
||||
|
||||
Codecs:
|
||||
4xm.c [2] Michael Niedermayer
|
||||
4xm.c Michael Niedermayer
|
||||
8bps.c Roberto Togni
|
||||
8svx.c Jaikrishnan Menon
|
||||
aacenc*, aaccoder.c Rostislav Pehlivanov
|
||||
|
|
@ -179,10 +161,9 @@ Codecs:
|
|||
dss_sp.c Oleksij Rempel
|
||||
dv.c Roman Shaposhnik
|
||||
dvbsubdec.c Anshul Maheshwari
|
||||
dxv.*, dxvenc.* Emma Worley
|
||||
eacmv*, eaidct*, eat* Peter Ross
|
||||
exif.c, exif.h Thilo Borgmann
|
||||
ffv1* [2] Michael Niedermayer
|
||||
ffv1* Michael Niedermayer
|
||||
ffwavesynth.c Nicolas George
|
||||
fifo.c Jan Sebechlebsky
|
||||
flicvideo.c Mike Melanson
|
||||
|
|
@ -193,7 +174,6 @@ Codecs:
|
|||
h263* Michael Niedermayer
|
||||
h264* Loren Merritt, Michael Niedermayer
|
||||
hap* Tom Butterworth
|
||||
hevc/* Anton Khirnov
|
||||
huffyuv* Michael Niedermayer
|
||||
idcinvideo.c Mike Melanson
|
||||
interplayvideo.c Mike Melanson
|
||||
|
|
@ -210,6 +190,7 @@ Codecs:
|
|||
libgsm.c Michel Bardiaux
|
||||
libkvazaar.c Arttu Ylä-Outinen
|
||||
libopenh264enc.c Martin Storsjo, Linjie Fu
|
||||
libopenjpeg.c Jaikrishnan Menon
|
||||
libopenjpegenc.c Michael Bradshaw
|
||||
libtheoraenc.c David Conrad
|
||||
libvorbis.c David Conrad
|
||||
|
|
@ -247,7 +228,6 @@ Codecs:
|
|||
rpza.c Roberto Togni
|
||||
rtjpeg.c, rtjpeg.h Reimar Doeffinger
|
||||
rv10.c Michael Niedermayer
|
||||
sanm.c Manuel Lauss
|
||||
smc.c Mike Melanson
|
||||
snow* Michael Niedermayer, Loren Merritt
|
||||
sonic.c Alex Beregszaszi
|
||||
|
|
@ -270,7 +250,7 @@ Codecs:
|
|||
vp8 David Conrad, Ronald Bultje
|
||||
vp9 Ronald Bultje
|
||||
vqavideo.c Mike Melanson
|
||||
vvc [2] Nuo Mi, Wu Jianhua, Frank Plowman
|
||||
vvc Nuo Mi
|
||||
wmaprodec.c Sascha Sommer
|
||||
wmavoice.c Ronald S. Bultje
|
||||
wmv2.c Michael Niedermayer
|
||||
|
|
@ -280,8 +260,6 @@ Codecs:
|
|||
Hardware acceleration:
|
||||
dxva2* Hendrik Leppkes, Laurent Aimar, Steve Lhomme
|
||||
d3d11va* Steve Lhomme
|
||||
d3d12va* Wu Jianhua
|
||||
d3d12va_encode* Tong Wu
|
||||
mediacodec* Matthieu Bouron, Aman Gupta, Zhao Zhili
|
||||
vaapi* Haihao Xiang
|
||||
vaapi_encode* Mark Thompson, Haihao Xiang
|
||||
|
|
@ -346,13 +324,12 @@ Filters:
|
|||
vf_mestimate.c Davinder Singh
|
||||
vf_minterpolate.c Davinder Singh
|
||||
vf_readvitc.c Tobias Rapp (CC t.rapp at noa-archive dot com)
|
||||
vf_scale.c [2] Michael Niedermayer
|
||||
vf_scale.c Michael Niedermayer
|
||||
vf_tonemap_opencl.c Ruiling Song
|
||||
vf_yadif.c [2] Michael Niedermayer
|
||||
vf_xfade_vulkan.c [2] Marvin Scholz (CC <epirat07@gmail.com>)
|
||||
vf_yadif.c Michael Niedermayer
|
||||
|
||||
Sources:
|
||||
vsrc_mandelbrot.c [2] Michael Niedermayer
|
||||
vsrc_mandelbrot.c Michael Niedermayer
|
||||
|
||||
dnn Yejun Guo
|
||||
|
||||
|
|
@ -370,7 +347,7 @@ Generic parts:
|
|||
Muxers/Demuxers:
|
||||
4xm.c Mike Melanson
|
||||
aadec.c Vesselin Bontchev (vesselin.bontchev at yandex dot com)
|
||||
adtsenc.c [0]
|
||||
adtsenc.c Robert Swain
|
||||
aiffdec.c Baptiste Coudurier, Matthieu Bouron
|
||||
aiffenc.c Baptiste Coudurier, Matthieu Bouron
|
||||
alp.c Zane van Iperen
|
||||
|
|
@ -396,7 +373,7 @@ Muxers/Demuxers:
|
|||
dss.c Oleksij Rempel
|
||||
dtsdec.c foo86
|
||||
dv.c Roman Shaposhnik
|
||||
dvdvideodec.c [2] Marth64
|
||||
dvdvideodec.c Marth64
|
||||
electronicarts.c Peter Ross
|
||||
evc* Samsung (Dawid Kozinski)
|
||||
ffm* Baptiste Coudurier
|
||||
|
|
@ -406,7 +383,6 @@ Muxers/Demuxers:
|
|||
gxf.c Reimar Doeffinger
|
||||
gxfenc.c Baptiste Coudurier
|
||||
hlsenc.c Christian Suloway, Steven Liu
|
||||
iamf* [2] James Almer
|
||||
idcin.c Mike Melanson
|
||||
idroqdec.c Mike Melanson
|
||||
iff.c Jaikrishnan Menon
|
||||
|
|
@ -421,9 +397,9 @@ Muxers/Demuxers:
|
|||
libopenmpt.c Josh de Kock
|
||||
lmlm4.c Ivo van Poorten
|
||||
lxfdec.c Tomas Härdin
|
||||
matroska.c Andreas Rheinhardt
|
||||
matroskadec.c Andreas Rheinhardt
|
||||
matroskaenc.c Andreas Rheinhardt
|
||||
matroska.c Aurelien Jacobs, Andreas Rheinhardt
|
||||
matroskadec.c Aurelien Jacobs, Andreas Rheinhardt
|
||||
matroskaenc.c David Conrad, Andreas Rheinhardt
|
||||
matroska subtitles (matroskaenc.c) John Peebles
|
||||
metadata* Aurelien Jacobs
|
||||
microdvd* Aurelien Jacobs
|
||||
|
|
@ -450,8 +426,7 @@ Muxers/Demuxers:
|
|||
pva.c Ivo van Poorten
|
||||
r3d.c Baptiste Coudurier
|
||||
raw.c Michael Niedermayer
|
||||
rcwtdec.c [2] Marth64
|
||||
rcwtenc.c [2] Marth64
|
||||
rcwtenc.c Marth64
|
||||
rdt.c Ronald S. Bultje
|
||||
rl2.c Sascha Sommer
|
||||
rmdec.c, rmenc.c Ronald S. Bultje
|
||||
|
|
@ -470,7 +445,6 @@ Muxers/Demuxers:
|
|||
sdp.c Martin Storsjo
|
||||
segafilm.c Mike Melanson
|
||||
segment.c Stefano Sabatini
|
||||
smush.c Manuel Lauss
|
||||
spdif* Anssi Hannula
|
||||
srtdec.c Aurelien Jacobs
|
||||
swf.c Baptiste Coudurier
|
||||
|
|
@ -494,35 +468,33 @@ Protocols:
|
|||
libzmq.c Andriy Gelman
|
||||
mms*.c Ronald S. Bultje
|
||||
udp.c Luca Abeni
|
||||
icecast.c [2] Marvin Scholz (CC <epirat07@gmail.com>)
|
||||
icecast.c Marvin Scholz
|
||||
|
||||
|
||||
libswresample
|
||||
=============
|
||||
|
||||
Generic parts:
|
||||
audioconvert.c [2] Michael Niedermayer
|
||||
dither.c [2] Michael Niedermayer
|
||||
rematrix*.c [2] Michael Niedermayer
|
||||
swresample*.c [2] Michael Niedermayer
|
||||
audioconvert.c Michael Niedermayer
|
||||
dither.c Michael Niedermayer
|
||||
rematrix*.c Michael Niedermayer
|
||||
swresample*.c Michael Niedermayer
|
||||
|
||||
Resamplers:
|
||||
resample*.c [2] Michael Niedermayer
|
||||
resample*.c Michael Niedermayer
|
||||
soxr_resample.c Rob Sykes
|
||||
|
||||
|
||||
Operating systems / CPU architectures
|
||||
=====================================
|
||||
|
||||
*BSD [2] Brad Smith
|
||||
Alpha [0]
|
||||
Alpha Falk Hueffner
|
||||
MIPS Manojkumar Bhosale, Shiyou Yin
|
||||
LoongArch [2] Shiyou Yin
|
||||
Darwin (macOS, iOS) [2] Marvin Scholz
|
||||
Mac OS X / PowerPC [0]
|
||||
LoongArch Shiyou Yin
|
||||
Mac OS X / PowerPC Romain Dolbeau, Guillaume Poirier
|
||||
Amiga / PowerPC Colin Ward
|
||||
Linux / PowerPC [1] Lauri Kasanen
|
||||
RISC-V [2] Rémi Denis-Courmont
|
||||
Linux / PowerPC Lauri Kasanen
|
||||
RISC-V Rémi Denis-Courmont
|
||||
Windows MinGW Alex Beregszaszi, Ramiro Polla
|
||||
Windows Cygwin Victor Paesa
|
||||
Windows MSVC Hendrik Leppkes
|
||||
|
|
@ -541,7 +513,6 @@ Benjamin Larsson
|
|||
Bobby Bingham
|
||||
Daniel Verkamp
|
||||
Derek Buitenhuis
|
||||
Fei Wang
|
||||
Ganesh Ajjanagadde
|
||||
Henrik Gramner
|
||||
Ivan Uskov
|
||||
|
|
@ -549,7 +520,6 @@ James Darnley
|
|||
Jan Ekström
|
||||
Joakim Plate
|
||||
Jun Zhao
|
||||
Kacper Michajłow
|
||||
Kieran Kunhya
|
||||
Kirill Gavrilov
|
||||
Limin Wang
|
||||
|
|
@ -591,7 +561,6 @@ Benoit Fouet B22A 4F4F 43EF 636B BB66 FCDC 0023 AE1E 2985 49C8
|
|||
Clément Bœsch 52D0 3A82 D445 F194 DB8B 2B16 87EE 2CB8 F4B8 FCF9
|
||||
Daniel Verkamp 78A6 07ED 782C 653E C628 B8B9 F0EB 8DD8 2F0E 21C7
|
||||
FFmpeg release signing key FCF9 86EA 15E6 E293 A564 4F10 B432 2F04 D676 58D8
|
||||
Frank Plowman 34E2 48D6 B7DF 4769 70C7 3304 03A8 4C6A 098F 2C6B
|
||||
Ganesh Ajjanagadde C96A 848E 97C3 CEA2 AB72 5CE4 45F9 6A2D 3C36 FB1B
|
||||
Gwenole Beauchesne 2E63 B3A6 3E44 37E2 017D 2704 53C7 6266 B153 99C4
|
||||
Haihao Xiang (haihao) 1F0C 31E8 B4FE F7A4 4DC1 DC99 E0F5 76D4 76FC 437F
|
||||
|
|
|
|||
19
Makefile
19
Makefile
|
|
@ -19,20 +19,14 @@ vpath %/fate_config.sh.template $(SRC_PATH)
|
|||
TESTTOOLS = audiogen videogen rotozoom tiny_psnr tiny_ssim base64 audiomatch
|
||||
HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options
|
||||
|
||||
ALLFFLIBS = \
|
||||
avcodec \
|
||||
avdevice \
|
||||
avfilter \
|
||||
avformat \
|
||||
avutil \
|
||||
swscale \
|
||||
swresample \
|
||||
ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale swresample
|
||||
|
||||
# $(FFLIBS-yes) needs to be in linking order
|
||||
FFLIBS-$(CONFIG_AVDEVICE) += avdevice
|
||||
FFLIBS-$(CONFIG_AVFILTER) += avfilter
|
||||
FFLIBS-$(CONFIG_AVFORMAT) += avformat
|
||||
FFLIBS-$(CONFIG_AVCODEC) += avcodec
|
||||
FFLIBS-$(CONFIG_POSTPROC) += postproc
|
||||
FFLIBS-$(CONFIG_SWRESAMPLE) += swresample
|
||||
FFLIBS-$(CONFIG_SWSCALE) += swscale
|
||||
|
||||
|
|
@ -58,9 +52,6 @@ $(TOOLS): %$(EXESUF): %.o
|
|||
target_dec_%_fuzzer$(EXESUF): target_dec_%_fuzzer.o $(FF_DEP_LIBS)
|
||||
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
|
||||
|
||||
target_enc_%_fuzzer$(EXESUF): target_enc_%_fuzzer.o $(FF_DEP_LIBS)
|
||||
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
|
||||
|
||||
tools/target_bsf_%_fuzzer$(EXESUF): tools/target_bsf_%_fuzzer.o $(FF_DEP_LIBS)
|
||||
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
|
||||
|
||||
|
|
@ -76,8 +67,6 @@ tools/target_io_dem_fuzzer$(EXESUF): tools/target_io_dem_fuzzer.o $(FF_DEP_LIBS)
|
|||
tools/target_sws_fuzzer$(EXESUF): tools/target_sws_fuzzer.o $(FF_DEP_LIBS)
|
||||
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
|
||||
|
||||
tools/target_swr_fuzzer$(EXESUF): tools/target_swr_fuzzer.o $(FF_DEP_LIBS)
|
||||
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
|
||||
|
||||
tools/enum_options$(EXESUF): ELIBS = $(FF_EXTRALIBS)
|
||||
tools/enum_options$(EXESUF): $(FF_DEP_LIBS)
|
||||
|
|
@ -109,8 +98,8 @@ SUBDIR_VARS := CLEANFILES FFLIBS HOSTPROGS TESTPROGS TOOLS \
|
|||
ARMV5TE-OBJS ARMV6-OBJS ARMV8-OBJS VFP-OBJS NEON-OBJS \
|
||||
ALTIVEC-OBJS VSX-OBJS MMX-OBJS X86ASM-OBJS \
|
||||
MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSP-OBJS MSA-OBJS \
|
||||
MMI-OBJS LSX-OBJS LASX-OBJS RV-OBJS RVV-OBJS RVVB-OBJS \
|
||||
OBJS SHLIBOBJS STLIBOBJS HOSTOBJS TESTOBJS SIMD128-OBJS
|
||||
MMI-OBJS LSX-OBJS LASX-OBJS RV-OBJS RVV-OBJS \
|
||||
OBJS SLIBOBJS SHLIBOBJS STLIBOBJS HOSTOBJS TESTOBJS
|
||||
|
||||
define RESET
|
||||
$(1) :=
|
||||
|
|
|
|||
2
RELEASE
2
RELEASE
|
|
@ -1 +1 @@
|
|||
8.0.git
|
||||
7.0.3
|
||||
|
|
|
|||
15
RELEASE_NOTES
Normal file
15
RELEASE_NOTES
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
|
||||
┌─────────────────────────────────────────┐
|
||||
│ RELEASE NOTES for FFmpeg 7.0 "Dijkstra" │
|
||||
└─────────────────────────────────────────┘
|
||||
|
||||
The FFmpeg Project proudly presents FFmpeg 7.0 "Dijkstra", about 6
|
||||
months after the release of FFmpeg 6.1.
|
||||
|
||||
A complete Changelog is available at the root of the project, and the
|
||||
complete Git history on https://git.ffmpeg.org/gitweb/ffmpeg.git
|
||||
|
||||
We hope you will like this release as much as we enjoyed working on it, and
|
||||
as usual, if you have any questions about it, or any FFmpeg related topic,
|
||||
feel free to join us on the #ffmpeg IRC channel (on irc.libera.chat) or ask
|
||||
on the mailing-lists.
|
||||
173
compat/atomics/gcc/stdatomic.h
Normal file
173
compat/atomics/gcc/stdatomic.h
Normal file
|
|
@ -0,0 +1,173 @@
|
|||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*
|
||||
* based on vlc_atomic.h from VLC
|
||||
* Copyright (C) 2010 Rémi Denis-Courmont
|
||||
*/
|
||||
|
||||
#ifndef COMPAT_ATOMICS_GCC_STDATOMIC_H
|
||||
#define COMPAT_ATOMICS_GCC_STDATOMIC_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define ATOMIC_FLAG_INIT 0
|
||||
|
||||
#define ATOMIC_VAR_INIT(value) (value)
|
||||
|
||||
#define atomic_init(obj, value) \
|
||||
do { \
|
||||
*(obj) = (value); \
|
||||
} while(0)
|
||||
|
||||
#define kill_dependency(y) ((void)0)
|
||||
|
||||
#define atomic_thread_fence(order) \
|
||||
__sync_synchronize()
|
||||
|
||||
#define atomic_signal_fence(order) \
|
||||
((void)0)
|
||||
|
||||
#define atomic_is_lock_free(obj) 0
|
||||
|
||||
typedef _Bool atomic_flag;
|
||||
typedef _Bool atomic_bool;
|
||||
typedef char atomic_char;
|
||||
typedef signed char atomic_schar;
|
||||
typedef unsigned char atomic_uchar;
|
||||
typedef short atomic_short;
|
||||
typedef unsigned short atomic_ushort;
|
||||
typedef int atomic_int;
|
||||
typedef unsigned int atomic_uint;
|
||||
typedef long atomic_long;
|
||||
typedef unsigned long atomic_ulong;
|
||||
typedef long long atomic_llong;
|
||||
typedef unsigned long long atomic_ullong;
|
||||
typedef wchar_t atomic_wchar_t;
|
||||
typedef int_least8_t atomic_int_least8_t;
|
||||
typedef uint_least8_t atomic_uint_least8_t;
|
||||
typedef int_least16_t atomic_int_least16_t;
|
||||
typedef uint_least16_t atomic_uint_least16_t;
|
||||
typedef int_least32_t atomic_int_least32_t;
|
||||
typedef uint_least32_t atomic_uint_least32_t;
|
||||
typedef int_least64_t atomic_int_least64_t;
|
||||
typedef uint_least64_t atomic_uint_least64_t;
|
||||
typedef int_fast8_t atomic_int_fast8_t;
|
||||
typedef uint_fast8_t atomic_uint_fast8_t;
|
||||
typedef int_fast16_t atomic_int_fast16_t;
|
||||
typedef uint_fast16_t atomic_uint_fast16_t;
|
||||
typedef int_fast32_t atomic_int_fast32_t;
|
||||
typedef uint_fast32_t atomic_uint_fast32_t;
|
||||
typedef int_fast64_t atomic_int_fast64_t;
|
||||
typedef uint_fast64_t atomic_uint_fast64_t;
|
||||
typedef intptr_t atomic_intptr_t;
|
||||
typedef uintptr_t atomic_uintptr_t;
|
||||
typedef size_t atomic_size_t;
|
||||
typedef ptrdiff_t atomic_ptrdiff_t;
|
||||
typedef intmax_t atomic_intmax_t;
|
||||
typedef uintmax_t atomic_uintmax_t;
|
||||
|
||||
#define atomic_store(object, desired) \
|
||||
do { \
|
||||
*(object) = (desired); \
|
||||
__sync_synchronize(); \
|
||||
} while (0)
|
||||
|
||||
#define atomic_store_explicit(object, desired, order) \
|
||||
atomic_store(object, desired)
|
||||
|
||||
#define atomic_load(object) \
|
||||
(__sync_synchronize(), *(object))
|
||||
|
||||
#define atomic_load_explicit(object, order) \
|
||||
atomic_load(object)
|
||||
|
||||
#define atomic_exchange(object, desired) \
|
||||
({ \
|
||||
__typeof__(object) _obj = (object); \
|
||||
__typeof__(*object) _old; \
|
||||
do \
|
||||
_old = atomic_load(_obj); \
|
||||
while (!__sync_bool_compare_and_swap(_obj, _old, (desired))); \
|
||||
_old; \
|
||||
})
|
||||
|
||||
#define atomic_exchange_explicit(object, desired, order) \
|
||||
atomic_exchange(object, desired)
|
||||
|
||||
#define atomic_compare_exchange_strong(object, expected, desired) \
|
||||
({ \
|
||||
__typeof__(object) _exp = (expected); \
|
||||
__typeof__(*object) _old = *_exp; \
|
||||
*_exp = __sync_val_compare_and_swap((object), _old, (desired)); \
|
||||
*_exp == _old; \
|
||||
})
|
||||
|
||||
#define atomic_compare_exchange_strong_explicit(object, expected, desired, success, failure) \
|
||||
atomic_compare_exchange_strong(object, expected, desired)
|
||||
|
||||
#define atomic_compare_exchange_weak(object, expected, desired) \
|
||||
atomic_compare_exchange_strong(object, expected, desired)
|
||||
|
||||
#define atomic_compare_exchange_weak_explicit(object, expected, desired, success, failure) \
|
||||
atomic_compare_exchange_weak(object, expected, desired)
|
||||
|
||||
#define atomic_fetch_add(object, operand) \
|
||||
__sync_fetch_and_add(object, operand)
|
||||
|
||||
#define atomic_fetch_add_explicit(object, operand, order) \
|
||||
atomic_fetch_add(object, operand)
|
||||
|
||||
#define atomic_fetch_sub(object, operand) \
|
||||
__sync_fetch_and_sub(object, operand)
|
||||
|
||||
#define atomic_fetch_sub_explicit(object, operand, order) \
|
||||
atomic_fetch_sub(object, operand)
|
||||
|
||||
#define atomic_fetch_or(object, operand) \
|
||||
__sync_fetch_and_or(object, operand)
|
||||
|
||||
#define atomic_fetch_or_explicit(object, operand, order) \
|
||||
atomic_fetch_or(object, operand)
|
||||
|
||||
#define atomic_fetch_xor(object, operand) \
|
||||
__sync_fetch_and_xor(object, operand)
|
||||
|
||||
#define atomic_fetch_xor_explicit(object, operand, order) \
|
||||
atomic_fetch_xor(object, operand)
|
||||
|
||||
#define atomic_fetch_and(object, operand) \
|
||||
__sync_fetch_and_and(object, operand)
|
||||
|
||||
#define atomic_fetch_and_explicit(object, operand, order) \
|
||||
atomic_fetch_and(object, operand)
|
||||
|
||||
#define atomic_flag_test_and_set(object) \
|
||||
atomic_exchange(object, 1)
|
||||
|
||||
#define atomic_flag_test_and_set_explicit(object, order) \
|
||||
atomic_flag_test_and_set(object)
|
||||
|
||||
#define atomic_flag_clear(object) \
|
||||
atomic_store(object, 0)
|
||||
|
||||
#define atomic_flag_clear_explicit(object, order) \
|
||||
atomic_flag_clear(object)
|
||||
|
||||
#endif /* COMPAT_ATOMICS_GCC_STDATOMIC_H */
|
||||
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* Copyright (c) 2024 Zhao Zhili
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
|
|
@ -18,24 +16,24 @@
|
|||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* based on vlc_atomic.h from VLC
|
||||
* Copyright (C) 2010 Rémi Denis-Courmont
|
||||
*/
|
||||
|
||||
#include <pthread.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libavutil/cpu_internal.h"
|
||||
#include "stdatomic.h"
|
||||
|
||||
int ff_get_cpu_flags_wasm(void)
|
||||
static pthread_mutex_t atomic_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
void avpriv_atomic_lock(void)
|
||||
{
|
||||
int flags = 0;
|
||||
#if HAVE_SIMD128
|
||||
flags |= AV_CPU_FLAG_SIMD128;
|
||||
#endif
|
||||
return flags;
|
||||
pthread_mutex_lock(&atomic_lock);
|
||||
}
|
||||
|
||||
size_t ff_get_cpu_max_align_wasm(void)
|
||||
void avpriv_atomic_unlock(void)
|
||||
{
|
||||
#if HAVE_SIMD128
|
||||
return 16;
|
||||
#else
|
||||
return 8;
|
||||
#endif
|
||||
pthread_mutex_unlock(&atomic_lock);
|
||||
}
|
||||
197
compat/atomics/pthread/stdatomic.h
Normal file
197
compat/atomics/pthread/stdatomic.h
Normal file
|
|
@ -0,0 +1,197 @@
|
|||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*
|
||||
* based on vlc_atomic.h from VLC
|
||||
* Copyright (C) 2010 Rémi Denis-Courmont
|
||||
*/
|
||||
|
||||
#ifndef COMPAT_ATOMICS_PTHREAD_STDATOMIC_H
|
||||
#define COMPAT_ATOMICS_PTHREAD_STDATOMIC_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define ATOMIC_FLAG_INIT 0
|
||||
|
||||
#define ATOMIC_VAR_INIT(value) (value)
|
||||
|
||||
#define atomic_init(obj, value) \
|
||||
do { \
|
||||
*(obj) = (value); \
|
||||
} while(0)
|
||||
|
||||
#define kill_dependency(y) ((void)0)
|
||||
|
||||
#define atomic_signal_fence(order) \
|
||||
((void)0)
|
||||
|
||||
#define atomic_is_lock_free(obj) 0
|
||||
|
||||
typedef intptr_t atomic_flag;
|
||||
typedef intptr_t atomic_bool;
|
||||
typedef intptr_t atomic_char;
|
||||
typedef intptr_t atomic_schar;
|
||||
typedef intptr_t atomic_uchar;
|
||||
typedef intptr_t atomic_short;
|
||||
typedef intptr_t atomic_ushort;
|
||||
typedef intptr_t atomic_int;
|
||||
typedef intptr_t atomic_uint;
|
||||
typedef intptr_t atomic_long;
|
||||
typedef intptr_t atomic_ulong;
|
||||
typedef intptr_t atomic_llong;
|
||||
typedef intptr_t atomic_ullong;
|
||||
typedef intptr_t atomic_wchar_t;
|
||||
typedef intptr_t atomic_int_least8_t;
|
||||
typedef intptr_t atomic_uint_least8_t;
|
||||
typedef intptr_t atomic_int_least16_t;
|
||||
typedef intptr_t atomic_uint_least16_t;
|
||||
typedef intptr_t atomic_int_least32_t;
|
||||
typedef intptr_t atomic_uint_least32_t;
|
||||
typedef intptr_t atomic_int_least64_t;
|
||||
typedef intptr_t atomic_uint_least64_t;
|
||||
typedef intptr_t atomic_int_fast8_t;
|
||||
typedef intptr_t atomic_uint_fast8_t;
|
||||
typedef intptr_t atomic_int_fast16_t;
|
||||
typedef intptr_t atomic_uint_fast16_t;
|
||||
typedef intptr_t atomic_int_fast32_t;
|
||||
typedef intptr_t atomic_uint_fast32_t;
|
||||
typedef intptr_t atomic_int_fast64_t;
|
||||
typedef intptr_t atomic_uint_fast64_t;
|
||||
typedef intptr_t atomic_intptr_t;
|
||||
typedef intptr_t atomic_uintptr_t;
|
||||
typedef intptr_t atomic_size_t;
|
||||
typedef intptr_t atomic_ptrdiff_t;
|
||||
typedef intptr_t atomic_intmax_t;
|
||||
typedef intptr_t atomic_uintmax_t;
|
||||
|
||||
void avpriv_atomic_lock(void);
|
||||
void avpriv_atomic_unlock(void);
|
||||
|
||||
static inline void atomic_thread_fence(int order)
|
||||
{
|
||||
avpriv_atomic_lock();
|
||||
avpriv_atomic_unlock();
|
||||
}
|
||||
|
||||
static inline void atomic_store(intptr_t *object, intptr_t desired)
|
||||
{
|
||||
avpriv_atomic_lock();
|
||||
*object = desired;
|
||||
avpriv_atomic_unlock();
|
||||
}
|
||||
|
||||
#define atomic_store_explicit(object, desired, order) \
|
||||
atomic_store(object, desired)
|
||||
|
||||
static inline intptr_t atomic_load(intptr_t *object)
|
||||
{
|
||||
intptr_t ret;
|
||||
avpriv_atomic_lock();
|
||||
ret = *object;
|
||||
avpriv_atomic_unlock();
|
||||
return ret;
|
||||
}
|
||||
|
||||
#define atomic_load_explicit(object, order) \
|
||||
atomic_load(object)
|
||||
|
||||
static inline intptr_t atomic_exchange(intptr_t *object, intptr_t desired)
|
||||
{
|
||||
intptr_t ret;
|
||||
avpriv_atomic_lock();
|
||||
ret = *object;
|
||||
*object = desired;
|
||||
avpriv_atomic_unlock();
|
||||
return ret;
|
||||
}
|
||||
|
||||
#define atomic_exchange_explicit(object, desired, order) \
|
||||
atomic_exchange(object, desired)
|
||||
|
||||
static inline int atomic_compare_exchange_strong(intptr_t *object, intptr_t *expected,
|
||||
intptr_t desired)
|
||||
{
|
||||
int ret;
|
||||
avpriv_atomic_lock();
|
||||
if (*object == *expected) {
|
||||
ret = 1;
|
||||
*object = desired;
|
||||
} else {
|
||||
ret = 0;
|
||||
*expected = *object;
|
||||
}
|
||||
avpriv_atomic_unlock();
|
||||
return ret;
|
||||
}
|
||||
|
||||
#define atomic_compare_exchange_strong_explicit(object, expected, desired, success, failure) \
|
||||
atomic_compare_exchange_strong(object, expected, desired)
|
||||
|
||||
#define atomic_compare_exchange_weak(object, expected, desired) \
|
||||
atomic_compare_exchange_strong(object, expected, desired)
|
||||
|
||||
#define atomic_compare_exchange_weak_explicit(object, expected, desired, success, failure) \
|
||||
atomic_compare_exchange_weak(object, expected, desired)
|
||||
|
||||
#define FETCH_MODIFY(opname, op) \
|
||||
static inline intptr_t atomic_fetch_ ## opname(intptr_t *object, intptr_t operand) \
|
||||
{ \
|
||||
intptr_t ret; \
|
||||
avpriv_atomic_lock(); \
|
||||
ret = *object; \
|
||||
*object = *object op operand; \
|
||||
avpriv_atomic_unlock(); \
|
||||
return ret; \
|
||||
}
|
||||
|
||||
FETCH_MODIFY(add, +)
|
||||
FETCH_MODIFY(sub, -)
|
||||
FETCH_MODIFY(or, |)
|
||||
FETCH_MODIFY(xor, ^)
|
||||
FETCH_MODIFY(and, &)
|
||||
|
||||
#undef FETCH_MODIFY
|
||||
|
||||
#define atomic_fetch_add_explicit(object, operand, order) \
|
||||
atomic_fetch_add(object, operand)
|
||||
|
||||
#define atomic_fetch_sub_explicit(object, operand, order) \
|
||||
atomic_fetch_sub(object, operand)
|
||||
|
||||
#define atomic_fetch_or_explicit(object, operand, order) \
|
||||
atomic_fetch_or(object, operand)
|
||||
|
||||
#define atomic_fetch_xor_explicit(object, operand, order) \
|
||||
atomic_fetch_xor(object, operand)
|
||||
|
||||
#define atomic_fetch_and_explicit(object, operand, order) \
|
||||
atomic_fetch_and(object, operand)
|
||||
|
||||
#define atomic_flag_test_and_set(object) \
|
||||
atomic_exchange(object, 1)
|
||||
|
||||
#define atomic_flag_test_and_set_explicit(object, order) \
|
||||
atomic_flag_test_and_set(object)
|
||||
|
||||
#define atomic_flag_clear(object) \
|
||||
atomic_store(object, 0)
|
||||
|
||||
#define atomic_flag_clear_explicit(object, order) \
|
||||
atomic_flag_clear(object)
|
||||
|
||||
#endif /* COMPAT_ATOMICS_PTHREAD_STDATOMIC_H */
|
||||
186
compat/atomics/suncc/stdatomic.h
Normal file
186
compat/atomics/suncc/stdatomic.h
Normal file
|
|
@ -0,0 +1,186 @@
|
|||
/*
|
||||
* 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 COMPAT_ATOMICS_SUNCC_STDATOMIC_H
|
||||
#define COMPAT_ATOMICS_SUNCC_STDATOMIC_H
|
||||
|
||||
#include <atomic.h>
|
||||
#include <mbarrier.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define ATOMIC_FLAG_INIT 0
|
||||
|
||||
#define ATOMIC_VAR_INIT(value) (value)
|
||||
|
||||
#define atomic_init(obj, value) \
|
||||
do { \
|
||||
*(obj) = (value); \
|
||||
} while(0)
|
||||
|
||||
#define kill_dependency(y) ((void)0)
|
||||
|
||||
#define atomic_thread_fence(order) \
|
||||
__machine_rw_barrier();
|
||||
|
||||
#define atomic_signal_fence(order) \
|
||||
((void)0)
|
||||
|
||||
#define atomic_is_lock_free(obj) 0
|
||||
|
||||
typedef intptr_t atomic_flag;
|
||||
typedef intptr_t atomic_bool;
|
||||
typedef intptr_t atomic_char;
|
||||
typedef intptr_t atomic_schar;
|
||||
typedef intptr_t atomic_uchar;
|
||||
typedef intptr_t atomic_short;
|
||||
typedef intptr_t atomic_ushort;
|
||||
typedef intptr_t atomic_int;
|
||||
typedef intptr_t atomic_uint;
|
||||
typedef intptr_t atomic_long;
|
||||
typedef intptr_t atomic_ulong;
|
||||
typedef intptr_t atomic_llong;
|
||||
typedef intptr_t atomic_ullong;
|
||||
typedef intptr_t atomic_wchar_t;
|
||||
typedef intptr_t atomic_int_least8_t;
|
||||
typedef intptr_t atomic_uint_least8_t;
|
||||
typedef intptr_t atomic_int_least16_t;
|
||||
typedef intptr_t atomic_uint_least16_t;
|
||||
typedef intptr_t atomic_int_least32_t;
|
||||
typedef intptr_t atomic_uint_least32_t;
|
||||
typedef intptr_t atomic_int_least64_t;
|
||||
typedef intptr_t atomic_uint_least64_t;
|
||||
typedef intptr_t atomic_int_fast8_t;
|
||||
typedef intptr_t atomic_uint_fast8_t;
|
||||
typedef intptr_t atomic_int_fast16_t;
|
||||
typedef intptr_t atomic_uint_fast16_t;
|
||||
typedef intptr_t atomic_int_fast32_t;
|
||||
typedef intptr_t atomic_uint_fast32_t;
|
||||
typedef intptr_t atomic_int_fast64_t;
|
||||
typedef intptr_t atomic_uint_fast64_t;
|
||||
typedef intptr_t atomic_intptr_t;
|
||||
typedef intptr_t atomic_uintptr_t;
|
||||
typedef intptr_t atomic_size_t;
|
||||
typedef intptr_t atomic_ptrdiff_t;
|
||||
typedef intptr_t atomic_intmax_t;
|
||||
typedef intptr_t atomic_uintmax_t;
|
||||
|
||||
static inline void atomic_store(intptr_t *object, intptr_t desired)
|
||||
{
|
||||
*object = desired;
|
||||
__machine_rw_barrier();
|
||||
}
|
||||
|
||||
#define atomic_store_explicit(object, desired, order) \
|
||||
atomic_store(object, desired)
|
||||
|
||||
static inline intptr_t atomic_load(intptr_t *object)
|
||||
{
|
||||
__machine_rw_barrier();
|
||||
return *object;
|
||||
}
|
||||
|
||||
#define atomic_load_explicit(object, order) \
|
||||
atomic_load(object)
|
||||
|
||||
#define atomic_exchange(object, desired) \
|
||||
atomic_swap_ptr(object, desired)
|
||||
|
||||
#define atomic_exchange_explicit(object, desired, order) \
|
||||
atomic_exchange(object, desired)
|
||||
|
||||
static inline int atomic_compare_exchange_strong(intptr_t *object, intptr_t *expected,
|
||||
intptr_t desired)
|
||||
{
|
||||
intptr_t old = *expected;
|
||||
*expected = (intptr_t)atomic_cas_ptr(object, (void *)old, (void *)desired);
|
||||
return *expected == old;
|
||||
}
|
||||
|
||||
#define atomic_compare_exchange_strong_explicit(object, expected, desired, success, failure) \
|
||||
atomic_compare_exchange_strong(object, expected, desired)
|
||||
|
||||
#define atomic_compare_exchange_weak(object, expected, desired) \
|
||||
atomic_compare_exchange_strong(object, expected, desired)
|
||||
|
||||
#define atomic_compare_exchange_weak_explicit(object, expected, desired, success, failure) \
|
||||
atomic_compare_exchange_weak(object, expected, desired)
|
||||
|
||||
static inline intptr_t atomic_fetch_add(intptr_t *object, intptr_t operand)
|
||||
{
|
||||
return atomic_add_ptr_nv(object, operand) - operand;
|
||||
}
|
||||
|
||||
#define atomic_fetch_sub(object, operand) \
|
||||
atomic_fetch_add(object, -(operand))
|
||||
|
||||
static inline intptr_t atomic_fetch_or(intptr_t *object, intptr_t operand)
|
||||
{
|
||||
intptr_t old;
|
||||
do {
|
||||
old = atomic_load(object);
|
||||
} while (!atomic_compare_exchange_strong(object, old, old | operand));
|
||||
return old;
|
||||
}
|
||||
|
||||
static inline intptr_t atomic_fetch_xor(intptr_t *object, intptr_t operand)
|
||||
{
|
||||
intptr_t old;
|
||||
do {
|
||||
old = atomic_load(object);
|
||||
} while (!atomic_compare_exchange_strong(object, old, old ^ operand));
|
||||
return old;
|
||||
}
|
||||
|
||||
static inline intptr_t atomic_fetch_and(intptr_t *object, intptr_t operand)
|
||||
{
|
||||
intptr_t old;
|
||||
do {
|
||||
old = atomic_load(object);
|
||||
} while (!atomic_compare_exchange_strong(object, old, old & operand));
|
||||
return old;
|
||||
}
|
||||
|
||||
#define atomic_fetch_add_explicit(object, operand, order) \
|
||||
atomic_fetch_add(object, operand)
|
||||
|
||||
#define atomic_fetch_sub_explicit(object, operand, order) \
|
||||
atomic_fetch_sub(object, operand)
|
||||
|
||||
#define atomic_fetch_or_explicit(object, operand, order) \
|
||||
atomic_fetch_or(object, operand)
|
||||
|
||||
#define atomic_fetch_xor_explicit(object, operand, order) \
|
||||
atomic_fetch_xor(object, operand)
|
||||
|
||||
#define atomic_fetch_and_explicit(object, operand, order) \
|
||||
atomic_fetch_and(object, operand)
|
||||
|
||||
#define atomic_flag_test_and_set(object) \
|
||||
atomic_exchange(object, 1)
|
||||
|
||||
#define atomic_flag_test_and_set_explicit(object, order) \
|
||||
atomic_flag_test_and_set(object)
|
||||
|
||||
#define atomic_flag_clear(object) \
|
||||
atomic_store(object, 0)
|
||||
|
||||
#define atomic_flag_clear_explicit(object, order) \
|
||||
atomic_flag_clear(object)
|
||||
|
||||
#endif /* COMPAT_ATOMICS_SUNCC_STDATOMIC_H */
|
||||
|
|
@ -189,7 +189,4 @@ static inline __device__ float __cosf(float a) { return __nvvm_cos_approx_f(a);
|
|||
static inline __device__ float __expf(float a) { return __nvvm_ex2_approx_f(a * (float)__builtin_log2(__builtin_exp(1))); }
|
||||
static inline __device__ float __powf(float a, float b) { return __nvvm_ex2_approx_f(__nvvm_lg2_approx_f(a) * b); }
|
||||
|
||||
// Misc helper functions
|
||||
extern "C" __device__ int printf(const char*, ...);
|
||||
|
||||
#endif /* COMPAT_CUDA_CUDA_RUNTIME_H */
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ static int optind = 1;
|
|||
static int optopt;
|
||||
static char *optarg;
|
||||
|
||||
static int getopt(int argc, char *argv[], const char *opts)
|
||||
static int getopt(int argc, char *argv[], char *opts)
|
||||
{
|
||||
static int sp = 1;
|
||||
int c;
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ while (<F>) {
|
|||
# Lines of the form '} SOME_VERSION_NAME_1.0;'
|
||||
if (/^[ \t]*\}[ \tA-Z0-9_.a-z]+;[ \t]*$/) {
|
||||
$glob = 'glob';
|
||||
# We tried to match symbols against this version, but none matched.
|
||||
# We tried to match symbols agains this version, but none matched.
|
||||
# Emit dummy hidden symbol to avoid marking this version WEAK.
|
||||
if ($matches_attempted && $matched_symbols == 0) {
|
||||
print " hidden:\n";
|
||||
|
|
|
|||
|
|
@ -1,599 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2023 Rémi Denis-Courmont
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef __STDC_VERSION_STDBIT_H__
|
||||
#define __STDC_VERSION_STDBIT_H__ 202311L
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <limits.h> /* CHAR_BIT */
|
||||
|
||||
#define __STDC_ENDIAN_LITTLE__ 1234
|
||||
#define __STDC_ENDIAN_BIG__ 4321
|
||||
|
||||
#ifdef __BYTE_ORDER__
|
||||
# if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
|
||||
# define __STDC_ENDIAN_NATIVE__ __STDC_ENDIAN_LITTLE__
|
||||
# elif (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
|
||||
# define __STDC_ENDIAN_NATIVE__ __STDC_ENDIAN_BIG__
|
||||
# else
|
||||
# define __STDC_ENDIAN_NATIVE__ 3412
|
||||
# endif
|
||||
#elif defined(_MSC_VER)
|
||||
# define __STDC_ENDIAN_NATIVE__ __STDC_ENDIAN_LITTLE__
|
||||
#else
|
||||
# error Not implemented.
|
||||
#endif
|
||||
|
||||
#define __stdbit_generic_type_func(func, value) \
|
||||
_Generic (value, \
|
||||
unsigned long long: stdc_##func##_ull((unsigned long long)(value)), \
|
||||
unsigned long: stdc_##func##_ul((unsigned long)(value)), \
|
||||
unsigned int: stdc_##func##_ui((unsigned int)(value)), \
|
||||
unsigned short: stdc_##func##_us((unsigned short)(value)), \
|
||||
unsigned char: stdc_##func##_uc((unsigned char)(value)))
|
||||
|
||||
#if defined (__GNUC__) || defined (__clang__)
|
||||
static inline unsigned int stdc_leading_zeros_ull(unsigned long long value)
|
||||
{
|
||||
return value ? __builtin_clzll(value) : (CHAR_BIT * sizeof (value));
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_leading_zeros_ul(unsigned long value)
|
||||
{
|
||||
return value ? __builtin_clzl(value) : (CHAR_BIT * sizeof (value));
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_leading_zeros_ui(unsigned int value)
|
||||
{
|
||||
return value ? __builtin_clz(value) : (CHAR_BIT * sizeof (value));
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_leading_zeros_us(unsigned short value)
|
||||
{
|
||||
return stdc_leading_zeros_ui(value)
|
||||
- CHAR_BIT * (sizeof (int) - sizeof (value));
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_leading_zeros_uc(unsigned char value)
|
||||
{
|
||||
return stdc_leading_zeros_ui(value) - (CHAR_BIT * (sizeof (int) - 1));
|
||||
}
|
||||
#else
|
||||
static inline unsigned int __stdc_leading_zeros(unsigned long long value,
|
||||
unsigned int size)
|
||||
{
|
||||
unsigned int zeros = size * CHAR_BIT;
|
||||
|
||||
while (value != 0) {
|
||||
value >>= 1;
|
||||
zeros--;
|
||||
}
|
||||
|
||||
return zeros;
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_leading_zeros_ull(unsigned long long value)
|
||||
{
|
||||
return __stdc_leading_zeros(value, sizeof (value));
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_leading_zeros_ul(unsigned long value)
|
||||
{
|
||||
return __stdc_leading_zeros(value, sizeof (value));
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_leading_zeros_ui(unsigned int value)
|
||||
{
|
||||
return __stdc_leading_zeros(value, sizeof (value));
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_leading_zeros_us(unsigned short value)
|
||||
{
|
||||
return __stdc_leading_zeros(value, sizeof (value));
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_leading_zeros_uc(unsigned char value)
|
||||
{
|
||||
return __stdc_leading_zeros(value, sizeof (value));
|
||||
}
|
||||
#endif
|
||||
|
||||
#define stdc_leading_zeros(value) \
|
||||
__stdbit_generic_type_func(leading_zeros, value)
|
||||
|
||||
static inline unsigned int stdc_leading_ones_ull(unsigned long long value)
|
||||
{
|
||||
return stdc_leading_zeros_ull(~value);
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_leading_ones_ul(unsigned long value)
|
||||
{
|
||||
return stdc_leading_zeros_ul(~value);
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_leading_ones_ui(unsigned int value)
|
||||
{
|
||||
return stdc_leading_zeros_ui(~value);
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_leading_ones_us(unsigned short value)
|
||||
{
|
||||
return stdc_leading_zeros_us(~value);
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_leading_ones_uc(unsigned char value)
|
||||
{
|
||||
return stdc_leading_zeros_uc(~value);
|
||||
}
|
||||
|
||||
#define stdc_leading_ones(value) \
|
||||
__stdbit_generic_type_func(leading_ones, value)
|
||||
|
||||
#if defined (__GNUC__) || defined (__clang__)
|
||||
static inline unsigned int stdc_trailing_zeros_ull(unsigned long long value)
|
||||
{
|
||||
return value ? (unsigned int)__builtin_ctzll(value)
|
||||
: (CHAR_BIT * sizeof (value));
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_trailing_zeros_ul(unsigned long value)
|
||||
{
|
||||
return value ? (unsigned int)__builtin_ctzl(value)
|
||||
: (CHAR_BIT * sizeof (value));
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_trailing_zeros_ui(unsigned int value)
|
||||
{
|
||||
return value ? (unsigned int)__builtin_ctz(value)
|
||||
: (CHAR_BIT * sizeof (value));
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_trailing_zeros_us(unsigned short value)
|
||||
{
|
||||
return value ? (unsigned int)__builtin_ctz(value)
|
||||
: (CHAR_BIT * sizeof (value));
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_trailing_zeros_uc(unsigned char value)
|
||||
{
|
||||
return value ? (unsigned int)__builtin_ctz(value)
|
||||
: (CHAR_BIT * sizeof (value));
|
||||
}
|
||||
#else
|
||||
static inline unsigned int __stdc_trailing_zeros(unsigned long long value,
|
||||
unsigned int size)
|
||||
{
|
||||
unsigned int zeros = 0;
|
||||
|
||||
if (!value)
|
||||
return size * CHAR_BIT;
|
||||
|
||||
while ((value & 1) == 0) {
|
||||
value >>= 1;
|
||||
zeros++;
|
||||
}
|
||||
|
||||
return zeros;
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_trailing_zeros_ull(unsigned long long value)
|
||||
{
|
||||
return __stdc_trailing_zeros(value, sizeof (value));
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_trailing_zeros_ul(unsigned long value)
|
||||
{
|
||||
return __stdc_trailing_zeros(value, sizeof (value));
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_trailing_zeros_ui(unsigned int value)
|
||||
{
|
||||
return __stdc_trailing_zeros(value, sizeof (value));
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_trailing_zeros_us(unsigned short value)
|
||||
{
|
||||
return __stdc_trailing_zeros(value, sizeof (value));
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_trailing_zeros_uc(unsigned char value)
|
||||
{
|
||||
return __stdc_trailing_zeros(value, sizeof (value));
|
||||
}
|
||||
#endif
|
||||
|
||||
#define stdc_trailing_zeros(value) \
|
||||
__stdbit_generic_type_func(trailing_zeros, value)
|
||||
|
||||
static inline unsigned int stdc_trailing_ones_ull(unsigned long long value)
|
||||
{
|
||||
return stdc_trailing_zeros_ull(~value);
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_trailing_ones_ul(unsigned long value)
|
||||
{
|
||||
return stdc_trailing_zeros_ul(~value);
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_trailing_ones_ui(unsigned int value)
|
||||
{
|
||||
return stdc_trailing_zeros_ui(~value);
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_trailing_ones_us(unsigned short value)
|
||||
{
|
||||
return stdc_trailing_zeros_us(~value);
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_trailing_ones_uc(unsigned char value)
|
||||
{
|
||||
return stdc_trailing_zeros_uc(~value);
|
||||
}
|
||||
|
||||
#define stdc_trailing_ones(value) \
|
||||
__stdbit_generic_type_func(trailing_ones, value)
|
||||
|
||||
static inline unsigned int stdc_first_leading_one_ull(unsigned long long value)
|
||||
{
|
||||
return value ? (stdc_leading_zeros_ull(value) + 1) : 0;
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_first_leading_one_ul(unsigned long value)
|
||||
{
|
||||
return value ? (stdc_leading_zeros_ul(value) + 1) : 0;
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_first_leading_one_ui(unsigned int value)
|
||||
{
|
||||
return value ? (stdc_leading_zeros_ui(value) + 1) : 0;
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_first_leading_one_us(unsigned short value)
|
||||
{
|
||||
return value ? (stdc_leading_zeros_us(value) + 1) : 0;
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_first_leading_one_uc(unsigned char value)
|
||||
{
|
||||
return value ? (stdc_leading_zeros_uc(value) + 1) : 0;
|
||||
}
|
||||
|
||||
#define stdc_first_leading_one(value) \
|
||||
__stdbit_generic_type_func(first_leading_one, value)
|
||||
|
||||
static inline unsigned int stdc_first_leading_zero_ull(unsigned long long value)
|
||||
{
|
||||
return stdc_leading_ones_ull(~value);
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_first_leading_zero_ul(unsigned long value)
|
||||
{
|
||||
return stdc_leading_ones_ul(~value);
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_first_leading_zero_ui(unsigned int value)
|
||||
{
|
||||
return stdc_leading_ones_ui(~value);
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_first_leading_zero_us(unsigned short value)
|
||||
{
|
||||
return stdc_leading_ones_us(~value);
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_first_leading_zero_uc(unsigned char value)
|
||||
{
|
||||
return stdc_leading_ones_uc(~value);
|
||||
}
|
||||
|
||||
#define stdc_first_leading_zero(value) \
|
||||
__stdbit_generic_type_func(first_leading_zero, value)
|
||||
|
||||
#if defined (__GNUC__) || defined (__clang__)
|
||||
static inline unsigned int stdc_first_trailing_one_ull(unsigned long long value)
|
||||
{
|
||||
return __builtin_ffsll(value);
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_first_trailing_one_ul(unsigned long value)
|
||||
{
|
||||
return __builtin_ffsl(value);
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_first_trailing_one_ui(unsigned int value)
|
||||
{
|
||||
return __builtin_ffs(value);
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_first_trailing_one_us(unsigned short value)
|
||||
{
|
||||
return __builtin_ffs(value);
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_first_trailing_one_uc(unsigned char value)
|
||||
{
|
||||
return __builtin_ffs(value);
|
||||
}
|
||||
#else
|
||||
static inline unsigned int stdc_first_trailing_one_ull(unsigned long long value)
|
||||
{
|
||||
return value ? (1 + stdc_trailing_zeros_ull(value)) : 0;
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_first_trailing_one_ul(unsigned long value)
|
||||
{
|
||||
return value ? (1 + stdc_trailing_zeros_ul(value)) : 0;
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_first_trailing_one_ui(unsigned int value)
|
||||
{
|
||||
return value ? (1 + stdc_trailing_zeros_ui(value)) : 0;
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_first_trailing_one_us(unsigned short value)
|
||||
{
|
||||
return value ? (1 + stdc_trailing_zeros_us(value)) : 0;
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_first_trailing_one_uc(unsigned char value)
|
||||
{
|
||||
return value ? (1 + stdc_trailing_zeros_uc(value)) : 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#define stdc_first_trailing_one(value) \
|
||||
__stdbit_generic_type_func(first_trailing_one, value)
|
||||
|
||||
static inline unsigned int stdc_first_trailing_zero_ull(unsigned long long value)
|
||||
{
|
||||
return stdc_first_trailing_one_ull(~value);
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_first_trailing_zero_ul(unsigned long value)
|
||||
{
|
||||
return stdc_first_trailing_one_ul(~value);
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_first_trailing_zero_ui(unsigned int value)
|
||||
{
|
||||
return stdc_first_trailing_one_ui(~value);
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_first_trailing_zero_us(unsigned short value)
|
||||
{
|
||||
return stdc_first_trailing_one_us(~value);
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_first_trailing_zero_uc(unsigned char value)
|
||||
{
|
||||
return stdc_first_trailing_one_uc(~value);
|
||||
}
|
||||
|
||||
#define stdc_first_trailing_zero(value) \
|
||||
__stdbit_generic_type_func(first_trailing_zero, value)
|
||||
|
||||
#if defined (__GNUC__) || defined (__clang__)
|
||||
static inline unsigned int stdc_count_ones_ull(unsigned long long value)
|
||||
{
|
||||
return __builtin_popcountll(value);
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_count_ones_ul(unsigned long value)
|
||||
{
|
||||
return __builtin_popcountl(value);
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_count_ones_ui(unsigned int value)
|
||||
{
|
||||
return __builtin_popcount(value);
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_count_ones_us(unsigned short value)
|
||||
{
|
||||
return __builtin_popcount(value);
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_count_ones_uc(unsigned char value)
|
||||
{
|
||||
return __builtin_popcount(value);
|
||||
}
|
||||
#else
|
||||
static inline unsigned int __stdc_count_ones(unsigned long long value,
|
||||
unsigned int size)
|
||||
{
|
||||
unsigned int ones = 0;
|
||||
|
||||
for (unsigned int c = 0; c < (size * CHAR_BIT); c++) {
|
||||
ones += value & 1;
|
||||
value >>= 1;
|
||||
}
|
||||
|
||||
return ones;
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_count_ones_ull(unsigned long long value)
|
||||
{
|
||||
return __stdc_count_ones(value, sizeof (value));
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_count_ones_ul(unsigned long value)
|
||||
{
|
||||
return __stdc_count_ones(value, sizeof (value));
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_count_ones_ui(unsigned int value)
|
||||
{
|
||||
return __stdc_count_ones(value, sizeof (value));
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_count_ones_us(unsigned short value)
|
||||
{
|
||||
return __stdc_count_ones(value, sizeof (value));
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_count_ones_uc(unsigned char value)
|
||||
{
|
||||
return __stdc_count_ones(value, sizeof (value));
|
||||
}
|
||||
#endif
|
||||
|
||||
#define stdc_count_ones(value) \
|
||||
__stdbit_generic_type_func(count_ones, value)
|
||||
|
||||
static inline unsigned int stdc_count_zeros_ull(unsigned long long value)
|
||||
{
|
||||
return stdc_count_ones_ull(~value);
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_count_zeros_ul(unsigned long value)
|
||||
{
|
||||
return stdc_count_ones_ul(~value);
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_count_zeros_ui(unsigned int value)
|
||||
{
|
||||
return stdc_count_ones_ui(~value);
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_count_zeros_us(unsigned short value)
|
||||
{
|
||||
return stdc_count_ones_us(~value);
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_count_zeros_uc(unsigned char value)
|
||||
{
|
||||
return stdc_count_ones_uc(~value);
|
||||
}
|
||||
|
||||
#define stdc_count_zeros(value) \
|
||||
__stdbit_generic_type_func(count_zeros, value)
|
||||
|
||||
static inline bool stdc_has_single_bit_ull(unsigned long long value)
|
||||
{
|
||||
return value && (value & (value - 1)) == 0;
|
||||
}
|
||||
|
||||
static inline bool stdc_has_single_bit_ul(unsigned long value)
|
||||
{
|
||||
return value && (value & (value - 1)) == 0;
|
||||
}
|
||||
|
||||
static inline bool stdc_has_single_bit_ui(unsigned int value)
|
||||
{
|
||||
return value && (value & (value - 1)) == 0;
|
||||
}
|
||||
|
||||
static inline bool stdc_has_single_bit_us(unsigned short value)
|
||||
{
|
||||
return value && (value & (value - 1)) == 0;
|
||||
}
|
||||
|
||||
static inline bool stdc_has_single_bit_uc(unsigned char value)
|
||||
{
|
||||
return value && (value & (value - 1)) == 0;
|
||||
}
|
||||
|
||||
#define stdc_has_single_bit(value) \
|
||||
__stdbit_generic_type_func(has_single_bit, value)
|
||||
|
||||
static inline unsigned int stdc_bit_width_ull(unsigned long long value)
|
||||
{
|
||||
return (CHAR_BIT * sizeof (value)) - stdc_leading_zeros_ull(value);
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_bit_width_ul(unsigned long value)
|
||||
{
|
||||
return (CHAR_BIT * sizeof (value)) - stdc_leading_zeros_ul(value);
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_bit_width_ui(unsigned int value)
|
||||
{
|
||||
return (CHAR_BIT * sizeof (value)) - stdc_leading_zeros_ui(value);
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_bit_width_us(unsigned short value)
|
||||
{
|
||||
return (CHAR_BIT * sizeof (value)) - stdc_leading_zeros_us(value);
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_bit_width_uc(unsigned char value)
|
||||
{
|
||||
return (CHAR_BIT * sizeof (value)) - stdc_leading_zeros_uc(value);
|
||||
}
|
||||
|
||||
#define stdc_bit_width(value) \
|
||||
__stdbit_generic_type_func(bit_width, value)
|
||||
|
||||
static inline unsigned long long stdc_bit_floor_ull(unsigned long long value)
|
||||
{
|
||||
return value ? (1ULL << (stdc_bit_width_ull(value) - 1)) : 0ULL;
|
||||
}
|
||||
|
||||
static inline unsigned long stdc_bit_floor_ul(unsigned long value)
|
||||
{
|
||||
return value ? (1UL << (stdc_bit_width_ul(value) - 1)) : 0UL;
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_bit_floor_ui(unsigned int value)
|
||||
{
|
||||
return value ? (1U << (stdc_bit_width_ui(value) - 1)) : 0U;
|
||||
}
|
||||
|
||||
static inline unsigned short stdc_bit_floor_us(unsigned short value)
|
||||
{
|
||||
return value ? (1U << (stdc_bit_width_us(value) - 1)) : 0U;
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_bit_floor_uc(unsigned char value)
|
||||
{
|
||||
return value ? (1U << (stdc_bit_width_uc(value) - 1)) : 0U;
|
||||
}
|
||||
|
||||
#define stdc_bit_floor(value) \
|
||||
__stdbit_generic_type_func(bit_floor, value)
|
||||
|
||||
/* NOTE: Bit ceiling undefines overflow. */
|
||||
static inline unsigned long long stdc_bit_ceil_ull(unsigned long long value)
|
||||
{
|
||||
return 1ULL << (value ? stdc_bit_width_ull(value - 1) : 0);
|
||||
}
|
||||
|
||||
static inline unsigned long stdc_bit_ceil_ul(unsigned long value)
|
||||
{
|
||||
return 1UL << (value ? stdc_bit_width_ul(value - 1) : 0);
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_bit_ceil_ui(unsigned int value)
|
||||
{
|
||||
return 1U << (value ? stdc_bit_width_ui(value - 1) : 0);
|
||||
}
|
||||
|
||||
static inline unsigned short stdc_bit_ceil_us(unsigned short value)
|
||||
{
|
||||
return 1U << (value ? stdc_bit_width_us(value - 1) : 0);
|
||||
}
|
||||
|
||||
static inline unsigned int stdc_bit_ceil_uc(unsigned char value)
|
||||
{
|
||||
return 1U << (value ? stdc_bit_width_uc(value - 1) : 0);
|
||||
}
|
||||
|
||||
#define stdc_bit_ceil(value) \
|
||||
__stdbit_generic_type_func(bit_ceil, value)
|
||||
|
||||
#endif /* __STDC_VERSION_STDBIT_H__ */
|
||||
|
|
@ -26,7 +26,6 @@
|
|||
|
||||
#include "config.h"
|
||||
#include "libavutil/macros.h"
|
||||
#include "libavutil/mem.h"
|
||||
#include "libavutil/wchar_filename.h"
|
||||
|
||||
static inline wchar_t *get_module_filename(HMODULE module)
|
||||
|
|
|
|||
|
|
@ -44,14 +44,13 @@
|
|||
#include "libavutil/internal.h"
|
||||
#include "libavutil/mem.h"
|
||||
#include "libavutil/time.h"
|
||||
#include "libavutil/wchar_filename.h"
|
||||
|
||||
typedef struct pthread_t {
|
||||
void *handle;
|
||||
void *(*func)(void* arg);
|
||||
void *arg;
|
||||
void *ret;
|
||||
} *pthread_t;
|
||||
} pthread_t;
|
||||
|
||||
/* use light weight mutex/condition variable API for Windows Vista and later */
|
||||
typedef SRWLOCK pthread_mutex_t;
|
||||
|
|
@ -75,7 +74,7 @@ typedef CONDITION_VARIABLE pthread_cond_t;
|
|||
static av_unused THREADFUNC_RETTYPE
|
||||
__stdcall attribute_align_arg win32thread_worker(void *arg)
|
||||
{
|
||||
pthread_t h = (pthread_t)arg;
|
||||
pthread_t *h = (pthread_t*)arg;
|
||||
h->ret = h->func(h->arg);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -83,35 +82,21 @@ __stdcall attribute_align_arg win32thread_worker(void *arg)
|
|||
static av_unused int pthread_create(pthread_t *thread, const void *unused_attr,
|
||||
void *(*start_routine)(void*), void *arg)
|
||||
{
|
||||
pthread_t ret;
|
||||
|
||||
ret = av_mallocz(sizeof(*ret));
|
||||
if (!ret)
|
||||
return EAGAIN;
|
||||
|
||||
ret->func = start_routine;
|
||||
ret->arg = arg;
|
||||
thread->func = start_routine;
|
||||
thread->arg = arg;
|
||||
#if HAVE_WINRT
|
||||
ret->handle = (void*)CreateThread(NULL, 0, win32thread_worker, ret,
|
||||
0, NULL);
|
||||
thread->handle = (void*)CreateThread(NULL, 0, win32thread_worker, thread,
|
||||
0, NULL);
|
||||
#else
|
||||
ret->handle = (void*)_beginthreadex(NULL, 0, win32thread_worker, ret,
|
||||
0, NULL);
|
||||
thread->handle = (void*)_beginthreadex(NULL, 0, win32thread_worker, thread,
|
||||
0, NULL);
|
||||
#endif
|
||||
|
||||
if (!ret->handle) {
|
||||
av_free(ret);
|
||||
return EAGAIN;
|
||||
}
|
||||
|
||||
*thread = ret;
|
||||
|
||||
return 0;
|
||||
return !thread->handle;
|
||||
}
|
||||
|
||||
static av_unused int pthread_join(pthread_t thread, void **value_ptr)
|
||||
{
|
||||
DWORD ret = WaitForSingleObject(thread->handle, INFINITE);
|
||||
DWORD ret = WaitForSingleObject(thread.handle, INFINITE);
|
||||
if (ret != WAIT_OBJECT_0) {
|
||||
if (ret == WAIT_ABANDONED)
|
||||
return EINVAL;
|
||||
|
|
@ -119,9 +104,8 @@ static av_unused int pthread_join(pthread_t thread, void **value_ptr)
|
|||
return EDEADLK;
|
||||
}
|
||||
if (value_ptr)
|
||||
*value_ptr = thread->ret;
|
||||
CloseHandle(thread->handle);
|
||||
av_free(thread);
|
||||
*value_ptr = thread.ret;
|
||||
CloseHandle(thread.handle);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -210,38 +194,4 @@ static inline int pthread_setcancelstate(int state, int *oldstate)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static inline int win32_thread_setname(const char *name)
|
||||
{
|
||||
#if !HAVE_UWP
|
||||
typedef HRESULT (WINAPI *SetThreadDescriptionFn)(HANDLE, PCWSTR);
|
||||
|
||||
// Although SetThreadDescription lives in kernel32.dll, on Windows Server 2016,
|
||||
// Windows 10 LTSB 2016 and Windows 10 version 1607, it was only available in
|
||||
// kernelbase.dll. So, load it from there for maximum coverage.
|
||||
HMODULE kernelbase = GetModuleHandleW(L"kernelbase.dll");
|
||||
if (!kernelbase)
|
||||
return AVERROR(ENOSYS);
|
||||
|
||||
SetThreadDescriptionFn pSetThreadDescription =
|
||||
(SetThreadDescriptionFn)GetProcAddress(kernelbase, "SetThreadDescription");
|
||||
if (!pSetThreadDescription)
|
||||
return AVERROR(ENOSYS);
|
||||
|
||||
wchar_t *wname;
|
||||
if (utf8towchar(name, &wname) < 0)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
HRESULT hr = pSetThreadDescription(GetCurrentThread(), wname);
|
||||
av_free(wname);
|
||||
return SUCCEEDED(hr) ? 0 : AVERROR(EINVAL);
|
||||
#else
|
||||
// UWP is not supported because we cannot use LoadLibrary/GetProcAddress to
|
||||
// detect the availability of the SetThreadDescription API. There is a small
|
||||
// gap in Windows builds 1507-1607 where it was not available. UWP allows
|
||||
// querying the availability of APIs with QueryOptionalDelayLoadedAPI, but it
|
||||
// requires /DELAYLOAD:kernel32.dll during linking, and we cannot enforce that.
|
||||
return AVERROR(ENOSYS);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* COMPAT_W32PTHREADS_H */
|
||||
|
|
|
|||
376
doc/APIchanges
376
doc/APIchanges
|
|
@ -1,377 +1,7 @@
|
|||
The last version increases of all libraries were on 2025-03-28
|
||||
The last version increases of all libraries were on 2024-03-07
|
||||
|
||||
API changes, most recent first:
|
||||
|
||||
2025-07-29 - 1c85a3832af - lavc 62.10.100 - smpte_436m.h
|
||||
Add a new public header smpte_436m.h with API for
|
||||
manipulating AV_CODEC_ID_SMPTE_436M_ANC data.
|
||||
|
||||
2025-07-10 - a566fcb9dc0 - lavf 62.2.100
|
||||
mxf [de]muxer now uses AV_CODEC_ID_SMPTE_436M_ANC for
|
||||
the vbi_vanc_smpte_436M streams instead of AV_CODEC_ID_NONE.
|
||||
|
||||
2025-07-10 - f4ff379baea - lavc 62.10.100 - codec_id.h
|
||||
Add AV_CODEC_ID_SMPTE_436M_ANC.
|
||||
|
||||
2025-08-08 - 83b36f54108 - lavc 62.9.100 - codec_id.h
|
||||
Add AV_CODEC_ID_PRORES_RAW.
|
||||
|
||||
2025-07-31 - 119d127d05c - lavu 60.7.100 - spherical.h
|
||||
Add AV_SPHERICAL_PARAMETRIC_IMMERSIVE.
|
||||
|
||||
2025-07-20 - 157d3b007e9 - lavu 60.6.100 - attributes.h, avstring.h
|
||||
Add av_scanf_format() and use it on av_sscanf().
|
||||
|
||||
2025-07-18 - fbda5ffb953 - lavu 60.5.100 - pixfmt.h
|
||||
Add AV_PIX_FMT_OHCODEC.
|
||||
|
||||
2025-07-18 - fbda5ffb953 - lavu 60.5.100 - hwcontext.h
|
||||
Add AV_HWDEVICE_TYPE_OHCODEC and AVOHCodecDeviceContext.
|
||||
|
||||
2025-07-14 - b24155cae11 - lavfi 11.2.100 - avfilter.h
|
||||
Add AVFilterGraph->max_buffered_frames.
|
||||
|
||||
2025-07-07 - eca477da52 - lavc 62.6.100 - packet.h
|
||||
Add AV_PKT_DATA_RTCP_SR.
|
||||
|
||||
2025-07-01 - 39d5a998bd - lavc 62.4.101 - packet.h
|
||||
Add AV_PKT_DATA_3D_REFERENCE_DISPLAYS.
|
||||
|
||||
2025-07-01 - b2e4b0e282 - lavu 60.4.101 - frame.h
|
||||
Add AV_FRAME_DATA_3D_REFERENCE_DISPLAYS.
|
||||
|
||||
2025-07-01 - 80a05bea4f - lavu 60.4.100 - tdrdi.h
|
||||
Add AV3DReferenceDisplaysInfo and AV3DReferenceDisplay structs.
|
||||
Add av_tdrdi_alloc() and av_tdrdi_get_display().
|
||||
|
||||
2025-05-21 - 004cc60f0e3 - lavu 60.3.100 - avassert.h
|
||||
Add av_unreachable() and av_assume() macros.
|
||||
|
||||
2025-02-15 - e2f39671ae2 - lavfi 10.10.100 - avfilter.h
|
||||
Add avfilter_link_get_hw_frames_ctx().
|
||||
|
||||
2025-04-21 - bf1579c904a - lavu 60.2.100 - log.h
|
||||
Add AV_CLASS_CATEGORY_HWDEVICE.
|
||||
|
||||
2025-04-16 - c818c67991 - libpostproc 59.1.100 - postprocess.h
|
||||
Deprecate PP_CPU_CAPS_3DNOW.
|
||||
|
||||
2025-04-07 - 19e9a203b7 - lavu 60.01.100 - dict.h
|
||||
Add AV_DICT_DEDUP.
|
||||
|
||||
2025-03-17 - 49af9746e8f - lavu 59.60.100 - pixfmt.h
|
||||
Add AV_PIX_FMT_GBRAP32BE and AV_PIX_FMT_GBRAP32LE.
|
||||
|
||||
2025-03-10 - 61fc9b6fee1 - lavu 59.59.100 - pixfmt.h
|
||||
Add AV_PIX_FMT_YAF16BE, AV_PIX_FMT_YAF16LE, AV_PIX_FMT_YAF32BE,
|
||||
and AV_PIX_FMT_YAF32LE.
|
||||
|
||||
2025-03-01 - 0245e9382c7 - lavu 59.58.100 - pixfmt.h
|
||||
Add AV_PIX_FMT_GRAY32BE and AV_PIX_FMT_GRAY32LE.
|
||||
|
||||
2025-02-04 - 0ef678f5c50 - lavu 59.56.000 - pixfmt.h
|
||||
Add AV_PIX_FMT_AMF_SURFACE.
|
||||
|
||||
2025-01-09 - a73760da537 - lavu 59.55.100 - pixfmt.h
|
||||
Add AV_PIX_FMT_GBRPF16BE, AV_PIX_FMT_GBRPF16LE, AV_PIX_FMT_GBRAPF16BE,
|
||||
AV_PIX_FMT_GBRAPF16LE, AV_PIX_FMT_GRAYF16BE, and AV_PIX_FMT_GRAYF16LE.
|
||||
|
||||
2025-02-16 - c79cdae3777 - lavu 59.57.100 - log.h
|
||||
Add flags AV_LOG_PRINT_TIME and AV_LOG_PRINT_DATETIME.
|
||||
|
||||
2025-02-09 - 9fb806fa577 - lavc 61.32.100 - codec_id.h
|
||||
Add AV_CODEC_ID_IVTV_VBI.
|
||||
|
||||
2025-01-25 - ea3c3b42dff - lavu 59.56.100 - frame.h
|
||||
Add AV_SIDE_DATA_PROP_CHANNEL_DEPENDENT.
|
||||
|
||||
2025-01-25 - 6707d970c04 - lavfi 10.9.100 - buffersink.h
|
||||
Add av_buffersink_get_side_data().
|
||||
|
||||
2025-01-25 - 7a025e1cb5f - lavfi 10.8.100 - buffersrc.h
|
||||
Add AVBufferSrcParameters.side_data and AVBufferSrcParameters.nb_side_data
|
||||
|
||||
2025-01-25 - ef1cb1c9c81 - lavfi 10.7.100 - avfilter.h
|
||||
Add AVFilterLink.side_data and AVFilterLink.nb_side_data
|
||||
|
||||
2025-01-05 - 42e72d5c8b5 - lavu 59.55.100 - frame.h
|
||||
Add AV_FRAME_SIDE_DATA_FLAG_NEW_REF.
|
||||
|
||||
2025-01-05 - 19c95ecbff8 - lavc 61.31.100 - avcodec.h
|
||||
Deprecate AVCodecContext->properties.
|
||||
|
||||
2025-01-05 - 2d91f89445d - lavc 61.30.100 - frame.h
|
||||
Add AV_FRAME_FLAG_LOSSLESS.
|
||||
|
||||
2025-01-03 - f3c40826455 - lavc 61.29.100 - codec_id.h
|
||||
Add AV_CODEC_ID_JPEGXL_ANIM.
|
||||
|
||||
2025-01-03 - da9dcaba69d - lavu 59.54.100 - frame.h
|
||||
Add AV_CH_LAYOUT_5POINT1POINT2 and AV_CHANNEL_LAYOUT_5POINT1POINT2.
|
||||
|
||||
2024-12-23 - b88944a8aa5 - lavu 59.53.100 - frame.h
|
||||
Add av_frame_side_data_remove_by_props().
|
||||
|
||||
2024-12-23 - 3428a8d8303 - lavu 59.52.100 - frame.h
|
||||
Add AV_SIDE_DATA_PROP_SIZE_DEPENDENT and AV_FRAME_DATA_PROP_COLOR_DEPENDENT.
|
||||
|
||||
2024-12-23 - 45f0a7ad338 - lsws 8.13.100 - swscale.h
|
||||
Add enum SwsIntent and SwsContext.intent.
|
||||
|
||||
2024-12-15 - 2ac34d08542 - lavc 61.27.100 packet.h
|
||||
Add av_container_fifo_alloc_avpacket().
|
||||
|
||||
2024-12-15 - 56ba57b6725 - lavu 59.51.100 - refstruct.h container_fifo.h
|
||||
Add a new public header refstruct.h with new API for
|
||||
reference-counted objects.
|
||||
|
||||
Add a new public header container_fifo.h with new API for
|
||||
a FIFO of container objects (e.g. AVFrame or AVPacket).
|
||||
|
||||
2024-12-13 - 6eb4bf04e92 - lavu 59.50.100 - channel_layout.h
|
||||
Add AV_CH_LAYOUT_9POINT1POINT6 and AV_CHANNEL_LAYOUT_9POINT1POINT6.
|
||||
|
||||
2024-12-05 - 06f084468e0 - lavu 59.49.100 - csp.h
|
||||
Add av_csp_itu_eotf() and av_csp_itu_eotf_inv().
|
||||
|
||||
2024-12-05 - bf0a6c41111 - lavu 59.48.100 - csp.h
|
||||
Add av_csp_trc_func_inv_from_id().
|
||||
|
||||
2024-11-25 - 2a091d4f2ee - lsws 8.12.100 - swscale.h
|
||||
Allow using sws_frame_scale() dynamically, without first initializing the
|
||||
SwsContext. Deprecate sws_init_context(). Add sws_frame_setup() instead.
|
||||
|
||||
2024-11-25 - fb169640092 - lsws 8.11.100 - swscale.h
|
||||
Replace #define-based SWS_* flags by enum SwsFlags.
|
||||
|
||||
2024-11-25 - ed5dd675624 - lsws 8.10.100 - swscale.h
|
||||
Publicly expose struct SwsContext, enum SwsDither, and enum SwsAlphaBlend.
|
||||
|
||||
2024-11-16 - 46cb7b8d9dc - lavu 59.47.101 - frame.h
|
||||
av_frame_get_buffer() now also aligns the data pointers according to
|
||||
the requested alignment.
|
||||
|
||||
2024-11-13 - 20af68b63a4 - lavu 59.47.100 - channel_layout.h
|
||||
Add AV_CHAN_BINAURAL_LEFT, AV_CHAN_BINAURAL_RIGHT
|
||||
Add AV_CH_BINAURAL_LEFT, AV_CH_BINAURAL_RIGHT
|
||||
Add AV_CH_LAYOUT_BINAURAL, AV_CHANNEL_LAYOUT_BINAURAL
|
||||
|
||||
2024-10-26 - e02a3b40a5e - lavu 59.46.100 - pixfmt.h
|
||||
Add AV_PIX_FMT_XV48.
|
||||
|
||||
2024-10-23 - b03c758600f - lsws 8.9.100 - swscale.h
|
||||
Add sws_is_noop().
|
||||
|
||||
2024-10-23 - 5e50a56b9c4 - lsws 8.8.100 - swscale.h
|
||||
Add frame property testing API:
|
||||
- sws_test_format()
|
||||
- sws_test_colorspace()
|
||||
- sws_test_primaries()
|
||||
- sws_test_transfer()
|
||||
- sws_test_frame()
|
||||
|
||||
2024-10-23 - 87baf9ab2c2 - lsws 8.7.100 - swscale.h
|
||||
Add sws_free_context().
|
||||
|
||||
2024-10-23 - f462ba05f54 - lavu 59.45.100 - pixfmt.h
|
||||
Add AV_PIX_FMT_Y216.
|
||||
|
||||
2024-10-15 - 2336e685657 - lavu 59.44.100 - pixfmt.h
|
||||
Add AV_PIX_FMT_RGB96 and AV_PIX_FMT_RGBA128.
|
||||
|
||||
2024-10-14 - c993a91bea - lavu 59.43.100 - pixfmt.h
|
||||
Add AV_PIX_FMT_RGBF16.
|
||||
|
||||
2024-10-08 - 29ea34728f1 - lavu 59.42.100 - pixfmt.h
|
||||
Add AV_PIX_FMT_AYUV, AV_PIX_FMT_UYVA, AV_PIX_FMT_VYU444,
|
||||
and AV_PIX_FMT_V30X.
|
||||
|
||||
2024-10-01 - 0548ab2e425 - lavu 59.41.100 - log.h
|
||||
Add AVClass.state_flags_offset and AV_CLASS_STATE_INITIALIZED.
|
||||
|
||||
2024-09-30 - 50d1b89fa0d - lavf 61.9.100 - avformat.h
|
||||
Add {nb_}coded_side_data to AVStreamGroupTileGrid.
|
||||
|
||||
2024-09-30 - df9b80d21a2 - lavu 59
|
||||
Deprecate av_int_list_length_for_size(), av_int_list_length(), and
|
||||
av_opt_set_int_list() without replacement. All AVOptions using these
|
||||
should be replaced with AV_OPT_TYPE_FLAG_ARRAY.
|
||||
|
||||
2024-09-30 - 1efcdbc54d9 - lavfi 10.6.100
|
||||
Buffersink now has array-type options
|
||||
- pixel_formats
|
||||
- colorspaces
|
||||
- colorranges
|
||||
replacing the int-list options
|
||||
- pix_fmts
|
||||
- color_spaces
|
||||
- color_ranges
|
||||
abuffersink now has array-type options
|
||||
- sample_formats
|
||||
- samplerates
|
||||
- channel_layouts
|
||||
replacing the int-list/string options
|
||||
- sample_fmts
|
||||
- sample_rates
|
||||
- ch_layouts
|
||||
|
||||
-------- 8< --------- FFmpeg 7.1 was cut here -------- 8< ---------
|
||||
|
||||
2024-09-23 - 6940a6de2f0 - lavu 59.38.100 - frame.h
|
||||
Add AV_FRAME_DATA_VIEW_ID.
|
||||
|
||||
2024-09-23 - 6147385393a - lavc 61.18.100 - avcodec.h
|
||||
Add a new flag AV_CODEC_EXPORT_DATA_ENHANCEMENTS for export_side_data.
|
||||
|
||||
2024-09-18 - df609af8e44 - lavc 61.17.100 - packet.h
|
||||
Add AV_PKT_DATA_LCEVC.
|
||||
|
||||
2024-09-18 - ba0ef0860f0 - lavf 61.5.100 - avformat.h
|
||||
Add AVStreamGroupLCEVC
|
||||
Add AV_STREAM_GROUP_PARAMS_LCEVC
|
||||
Add AVStreamGroup.params.lcevc
|
||||
|
||||
2024-09-18 - 58963182294 - lavc 61.16.100 - avcodec.h
|
||||
Add AV_CODEC_ID_LCEVC.
|
||||
|
||||
2024-09-18 - 90d12c24c51 - lavu 59.37.100 - frame.h
|
||||
Add AV_FRAME_DATA_LCEVC.
|
||||
|
||||
2024-09-08 - 3305767560a - lavc 61.13.100 - avcodec.h
|
||||
Add avcodec_get_supported_config() and enum AVCodecConfig; deprecate
|
||||
AVCodec.pix_fmts, AVCodec.sample_fmts, AVCodec.supported_framerates,
|
||||
AVCodec.supported_samplerates and AVCodec.ch_layouts.
|
||||
|
||||
2024-09-06 - c35a51f4bb1 - lavc 61.12.100 - defs.h
|
||||
Add AV_PROFILE_HEVC_MULTIVIEW_MAIN
|
||||
|
||||
2024-09-06 - 450a3f58edb - lavu 59.36.100 - opt.h
|
||||
Add av_opt_set_array() and AV_OPT_ARRAY_REPLACE.
|
||||
|
||||
2024-08-27 - d89930f8666 - lavu 59.35.100 - opt.h
|
||||
Add av_opt_get_array_size() and av_opt_get_array().
|
||||
|
||||
2024-08-18 - 8657eb9c3f4 - lavc 61.11.100 - avcodec.h
|
||||
Clarify the documentation for get_buffer*() functions, making it
|
||||
clear that the memory returned by them should not contain sensitive
|
||||
information. This is not a change in the API, it is how it already worked
|
||||
before.
|
||||
|
||||
2024-08-10 - 5f0f1f7b7a6 - lavu 59.34.100 - hwcontext_vulkan.h
|
||||
Add qf and nb_qf to AVVulkanDeviceContext.
|
||||
Deprecate queue_family_index, nb_graphics_queues,
|
||||
queue_family_tx_index, nb_tx_queues.
|
||||
queue_family_comp_index, nb_comp_queues.
|
||||
queue_family_encode_index, nb_encode_queues.
|
||||
queue_family_decode_index, and nb_decode_queues,
|
||||
from AVVulkanDeviceContext.
|
||||
|
||||
2024-07-30 - e0f9f4d4915 - lavu 59.32.100 - cpu.h
|
||||
Deprecate AV_CPU_FLAG_RVF and AV_CPU_FLAG_RVD without replacement.
|
||||
Deprecate AV_CPU_FLAG_RVB_ADDR, subsumed into AV_CPU_FLAG_RVB.
|
||||
|
||||
2024-07-29 - 753f2aeed76 - lavu 59.31.100 - intreadwrite.h
|
||||
Add AV_{R,W}{L,B}{16,32}A and AV_{R,W}B64A.
|
||||
|
||||
2024-07-28 - cbea92c84d4 - lavu 59.30.100 - dovi_meta.h
|
||||
Add AVDOVIDecoderConfigurationRecord.dv_md_compression.
|
||||
|
||||
2024-07-25 - 45d7078a218 - lavu 59.29.100 - cpu.h
|
||||
Add AV_CPU_FLAG_RVB.
|
||||
|
||||
2024-07-xx - xxxxxxxxxx - lavf 61 - avformat.h
|
||||
Deprecate avformat_transfer_internal_stream_timing_info()
|
||||
and av_stream_get_codec_timebase() without replacement.
|
||||
|
||||
2024-07-08 - 1b58f3af30c - lavc 61.10.100 - packet.h
|
||||
Add AV_PKT_DATA_FRAME_CROPPING.
|
||||
|
||||
2024-07-07 - 46f7ea44563 - lavf 61.5.100 - avformat.h
|
||||
Add AV_DISPOSITION_MULTILAYER
|
||||
|
||||
2024-07-02 - d822146f4fc - lavu 59.28.100 - hwcontext_d3d12va.h
|
||||
Add AVD3D12VAFramesContext.flags
|
||||
|
||||
2024-06-28 - 8af0919cc66 - lavu 59.27.100 - stereo3d.h
|
||||
Add AV_STEREO3D_UNSPEC and AV_STEREO3D_VIEW_UNSPEC.
|
||||
|
||||
2024-06-25 - e6baf4f3841 - lavu 59.26.100 - stereo3d.h
|
||||
Add av_stereo3d_alloc_size().
|
||||
|
||||
2024-06-19 - cc587e69c6f - lavu 59.25.100 - dovi_meta.h
|
||||
Add AVDOVIRpuDataHeader.ext_mapping_idc_0_4 and ext_mapping_idc_5_7.
|
||||
|
||||
2024-06-18 - cf2436a0b4d - lavu 59.24.100 - stereo3d.h
|
||||
Add primary_eye, baseline, horizontal_disparity_adjustment, and
|
||||
horizontal_field_of_view fields to AVStereo3D.
|
||||
Add AVStereo3DPrimaryEye.
|
||||
Add av_stereo3d_view_name.
|
||||
Add av_stereo3d_view_from_name.
|
||||
Add av_stereo3d_primary_eye_name.
|
||||
Add av_stereo3d_primary_eye_from_name.
|
||||
|
||||
2024-06-18 - 57bfba35d6b - lavu 59.23.100 - spherical.h
|
||||
Add AV_SPHERICAL_HALF_EQUIRECTANGULAR, AV_SPHERICAL_RECTILINEAR, and
|
||||
AV_SPHERICAL_FISHEYE values to AVSphericalProjection, and initialize
|
||||
to AV_SPHERICAL_RECTILINEAR on alloc.
|
||||
|
||||
2024-06-13 - 39c90d6466a - lavu 59.22.100 - common.h
|
||||
Deprecate av_mod_uintp2[_c]() and replace it with av_zero_extend[_c]().
|
||||
|
||||
2024-06-08 - 91fd6ca000c - lavc 61.7.100 - defs.h
|
||||
Add AV_PROFILE_AAC_USAC.
|
||||
|
||||
2024-06-02 - 63e166d8028 - lavu 59.21.100 - channel_layout.h
|
||||
Add AV_CHAN_SIDE_SURROUND_RIGHT and AV_CH_SIDE_SURROUND_LEFT.
|
||||
Add AV_CHAN_SIDE_SURROUND_RIGHT and AV_CH_SIDE_SURROUND_RIGHT.
|
||||
Add AV_CHAN_TOP_SURROUND_LEFT and AV_CH_TOP_SURROUND_LEFT.
|
||||
Add AV_CHAN_TOP_SURROUND_RIGHT and AV_CH_TOP_SURROUND_RIGHT.
|
||||
|
||||
2024-05-23 - 8c974494822 - lavu 59.20.100 - channel_layout.h
|
||||
Add av_channel_layout_ambisonic_order().
|
||||
|
||||
2024-05-20 - 4c0bb7d4a91 - lavu 59.19.100 - hwcontext_qsv.h
|
||||
Add AVQSVFramesContext.info
|
||||
|
||||
2024-05-10 - 01c5f4ad9fa - lavu 59.18.100 - cpu.h
|
||||
Add AV_CPU_FLAG_RV_ZVBB.
|
||||
|
||||
2024-05-04 - d053290d8dd - lavu 59.17.100 - opt.h
|
||||
Add AV_OPT_TYPE_UINT and av_opt_eval_uint().
|
||||
|
||||
2024-04-24 - 8616cfe0890 - lavu 59.16.100 - opt.h
|
||||
Add AV_OPT_SERIALIZE_SEARCH_CHILDREN.
|
||||
|
||||
2024-04-11 - 6d0c89980c7 - lavc 61.5.102 - avcodec.h
|
||||
AVCodecContext.decoded_side_data may now be set by libavcodec after
|
||||
calling avcodec_open2().
|
||||
|
||||
2024-04-11 - 6d760c666d5 - lavu 59.15.100 - frame.h
|
||||
Add av_mastering_display_metadata_alloc_size().
|
||||
|
||||
2024-04-11 - adb67bba064 - lavu 59.14.100 - frame.h
|
||||
Add av_frame_side_data_add() and av_frame_side_data_remove().
|
||||
Add AV_FRAME_SIDE_DATA_FLAG_REPLACE.
|
||||
|
||||
2024-04-03 - 29561c8e2d4 - lavu 59.13.100 - pixfmt.h
|
||||
Add AVCOL_SPC_IPT_C2, AVCOL_SPC_YCGCO_RE and AVCOL_SPC_YCGCO_RO
|
||||
to map new matrix coefficients defined by H.273 v3.
|
||||
|
||||
2024-04-03 - 4f55e16f2bc - lavu 59.12.100 - dovi_meta.h
|
||||
Add AVDOVIMetadata.ext_block_{offset,size}, AVDOVIMetadata.num_ext_blocks,
|
||||
AVDOVIDmData and AVDOVIDmLevel{1..6,8..11,254..255}, av_dovi_get_ext()
|
||||
and av_dovi_find_level().
|
||||
|
||||
2024-04-03 - 78076ede296 - lavu 59.11.100 - dovi_meta.h
|
||||
Add AVDOVIDataMapping.nlq_pivots.
|
||||
|
||||
2024-03-29 - ed9363052f4 - lavf 61.3.100 - avformat.h
|
||||
Add AVFormatContext.duration_probesize.
|
||||
|
||||
2024-03-27 - 2621be35397 - lavu 59.10.100 - frame.h
|
||||
Add AVSideDataDescriptor, enum AVSideDataProps, and
|
||||
av_frame_side_data_desc().
|
||||
|
||||
-------- 8< --------- FFmpeg 7.0 was cut here -------- 8< ---------
|
||||
|
||||
2024-03-25 - 5df901ffa56 - lavu 59.7.100 - timestamp.h
|
||||
|
|
@ -627,7 +257,7 @@ API changes, most recent first:
|
|||
Deprecate AVFrame.palette_has_changed without replacement.
|
||||
|
||||
2023-05-15 - 7d1d61cc5f5 - lavc 60 - avcodec.h
|
||||
Deprecate AVCodecContext.ticks_per_frame in favor of
|
||||
Depreate AVCodecContext.ticks_per_frame in favor of
|
||||
AVCodecContext.framerate (encoding) and
|
||||
AV_CODEC_PROP_FIELDS (decoding).
|
||||
|
||||
|
|
@ -635,7 +265,7 @@ API changes, most recent first:
|
|||
Add AV_CODEC_PROP_FIELDS.
|
||||
|
||||
2023-05-15 - 8b20d0dcb5c - lavc 60 - codec.h
|
||||
Deprecate AV_CODEC_CAP_SUBFRAMES without replacement.
|
||||
Depreate AV_CODEC_CAP_SUBFRAMES without replacement.
|
||||
|
||||
2023-05-07 - c2ae8e30b7f - lavc 60.11.100 - codec_par.h
|
||||
Add AVCodecParameters.framerate.
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ PROJECT_NAME = FFmpeg
|
|||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER =
|
||||
PROJECT_NUMBER = 7.0.3
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
|
|
@ -1093,7 +1093,7 @@ HTML_STYLESHEET =
|
|||
# cascading style sheets that are included after the standard style sheets
|
||||
# created by doxygen. Using this option one can overrule certain style aspects.
|
||||
# This is preferred over using HTML_STYLESHEET since it does not replace the
|
||||
# standard style sheet and is therefore more robust against future updates.
|
||||
# standard style sheet and is therefor more robust against future updates.
|
||||
# Doxygen will copy the style sheet files to the output directory.
|
||||
# Note: The order of the extra stylesheet files is of importance (e.g. the last
|
||||
# stylesheet in the list overrules the setting of the previous ones in the
|
||||
|
|
@ -1636,7 +1636,7 @@ EXTRA_PACKAGES =
|
|||
# Note: Only use a user-defined header if you know what you are doing! The
|
||||
# following commands have a special meaning inside the header: $title,
|
||||
# $datetime, $date, $doxygenversion, $projectname, $projectnumber,
|
||||
# $projectbrief, $projectlogo. Doxygen will replace $title with the empty string,
|
||||
# $projectbrief, $projectlogo. Doxygen will replace $title with the empy string,
|
||||
# for the replacement values of the other commands the user is referred to
|
||||
# HTML_HEADER.
|
||||
# This tag requires that the tag GENERATE_LATEX is set to YES.
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ GENTEXI := $(GENTEXI:%=doc/avoptions_%.texi)
|
|||
|
||||
$(GENTEXI): TAG = GENTEXI
|
||||
$(GENTEXI): doc/avoptions_%.texi: doc/print_options$(HOSTEXESUF)
|
||||
$(M)doc/print_options$(HOSTEXESUF) $* > $@
|
||||
$(M)doc/print_options $* > $@
|
||||
|
||||
doc/%.html: TAG = HTML
|
||||
doc/%-all.html: TAG = HTML
|
||||
|
|
|
|||
|
|
@ -101,29 +101,6 @@ Remove zero padding at the end of a packet.
|
|||
Extract the core from a DCA/DTS stream, dropping extensions such as
|
||||
DTS-HD.
|
||||
|
||||
@section dovi_rpu
|
||||
|
||||
Manipulate Dolby Vision metadata in a HEVC/AV1 bitstream, optionally enabling
|
||||
metadata compression.
|
||||
|
||||
@table @option
|
||||
@item strip
|
||||
If enabled, strip all Dolby Vision metadata (configuration record + RPU data
|
||||
blocks) from the stream.
|
||||
@item compression
|
||||
Which compression level to enable.
|
||||
@table @samp
|
||||
@item none
|
||||
No metadata compression.
|
||||
@item limited
|
||||
Limited metadata compression scheme. Should be compatible with most devices.
|
||||
This is the default.
|
||||
@item extended
|
||||
Extended metadata compression. Devices are not required to support this. Note
|
||||
that this level currently behaves the same as @samp{limited} in libavcodec.
|
||||
@end table
|
||||
@end table
|
||||
|
||||
@section dump_extra
|
||||
|
||||
Add extradata to the beginning of the filtered packets except when
|
||||
|
|
@ -189,52 +166,6 @@ see page 44-46 or section 5.5 of
|
|||
|
||||
Extract the core from a E-AC-3 stream, dropping extra channels.
|
||||
|
||||
@section eia608_to_smpte436m
|
||||
|
||||
Convert from a @code{EIA_608} stream to a @code{SMPTE_436M_ANC} data stream, wrapping the closed captions in CTA-708 CDP VANC packets.
|
||||
|
||||
@table @option
|
||||
@item line_number
|
||||
Choose which line number the generated VANC packets should go on. You generally want either line 9 (the default) or 11.
|
||||
@item wrapping_type
|
||||
Choose the SMPTE 436M wrapping type, defaults to @samp{vanc_frame}.
|
||||
It accepts the values:
|
||||
@table @samp
|
||||
@item vanc_frame
|
||||
VANC frame (interlaced or segmented progressive frame)
|
||||
@item vanc_field_1
|
||||
@item vanc_field_2
|
||||
@item vanc_progressive_frame
|
||||
@end table
|
||||
@item sample_coding
|
||||
Choose the SMPTE 436M sample coding, defaults to @samp{8bit_luma}.
|
||||
It accepts the values:
|
||||
@table @samp
|
||||
@item 8bit_luma
|
||||
8-bit component luma samples
|
||||
@item 8bit_color_diff
|
||||
8-bit component color difference samples
|
||||
@item 8bit_luma_and_color_diff
|
||||
8-bit component luma and color difference samples
|
||||
@item 10bit_luma
|
||||
10-bit component luma samples
|
||||
@item 10bit_color_diff
|
||||
10-bit component color difference samples
|
||||
@item 10bit_luma_and_color_diff
|
||||
10-bit component luma and color difference samples
|
||||
@item 8bit_luma_parity_error
|
||||
8-bit component luma samples with parity error
|
||||
@item 8bit_color_diff_parity_error
|
||||
8-bit component color difference samples with parity error
|
||||
@item 8bit_luma_and_color_diff_parity_error
|
||||
8-bit component luma and color difference samples with parity error
|
||||
@end table
|
||||
@item initial_cdp_sequence_cntr
|
||||
The initial value of the CDP's 16-bit unsigned integer @code{cdp_hdr_sequence_cntr} and @code{cdp_ftr_sequence_cntr} fields. Defaults to 0.
|
||||
@item cdp_frame_rate
|
||||
Set the CDP's @code{cdp_frame_rate} field. This doesn't actually change the timing of the data stream, it just changes the values inserted in that field in the generated CDP packets. Defaults to @samp{30000/1001}.
|
||||
@end table
|
||||
|
||||
@section extract_extradata
|
||||
|
||||
Extract the in-band extradata.
|
||||
|
|
@ -469,21 +400,9 @@ Please note that this filter is auto-inserted for MPEG-TS (muxer
|
|||
|
||||
@section h264_redundant_pps
|
||||
|
||||
This applies a specific fixup to some Blu-ray BDMV H264 streams
|
||||
which contain redundant PPSs. The PPSs modify irrelevant parameters
|
||||
of the stream, confusing other transformations which require
|
||||
the correct extradata.
|
||||
|
||||
The encoder used on these impacted streams adds extra PPSs throughout
|
||||
the stream, varying the initial QP and whether weighted prediction
|
||||
was enabled. This causes issues after copying the stream into
|
||||
a global header container, as the starting PPS is not suitable
|
||||
for the rest of the stream. One side effect, for example,
|
||||
is seeking will return garbled output until a new PPS appears.
|
||||
|
||||
This BSF removes the extra PPSs and rewrites the slice headers
|
||||
such that the stream uses a single leading PPS in the global header,
|
||||
which resolves the issue.
|
||||
This applies a specific fixup to some Blu-ray streams which contain
|
||||
redundant PPSs modifying irrelevant parameters of the stream which
|
||||
confuse other transformations which require correct extradata.
|
||||
|
||||
@section hevc_metadata
|
||||
|
||||
|
|
@ -537,10 +456,6 @@ will replace the current ones if the stream is already cropped.
|
|||
These fields are set in pixels. Note that some sizes may not be
|
||||
representable if the chroma is subsampled (H.265 section 7.4.3.2.1).
|
||||
|
||||
@item width
|
||||
@item height
|
||||
Set width and height after crop.
|
||||
|
||||
@item level
|
||||
Set the level in the VPS and SPS. See H.265 section A.4 and tables
|
||||
A.6 and A.7.
|
||||
|
|
@ -754,12 +669,12 @@ ffmpeg -i INPUT -c copy -bsf noise=1 output.mkv
|
|||
Drop every video packet not marked as a keyframe after timestamp 30s but do not
|
||||
modify any of the remaining packets.
|
||||
@example
|
||||
ffmpeg -i INPUT -c copy -bsf:v noise=drop='gt(pts*tb\,30)*not(key)' output.mkv
|
||||
ffmpeg -i INPUT -c copy -bsf:v noise=drop='gt(t\,30)*not(key)' output.mkv
|
||||
@end example
|
||||
|
||||
Drop one second of audio every 10 seconds and add some random noise to the rest.
|
||||
@example
|
||||
ffmpeg -i INPUT -c copy -bsf:a noise=amount=-1:drop='between(mod(pts*tb\,10)\,9\,10)' output.mkv
|
||||
ffmpeg -i INPUT -c copy -bsf:a noise=amount=-1:drop='between(mod(t\,10)\,9\,10)' output.mkv
|
||||
@end example
|
||||
|
||||
@section null
|
||||
|
|
@ -994,11 +909,6 @@ ffmpeg -i INPUT -c:a copy -bsf:a setts=pts=DTS out.mkv
|
|||
Log basic packet information. Mainly useful for testing, debugging,
|
||||
and development.
|
||||
|
||||
@section smpte436m_to_eia608
|
||||
|
||||
Convert from a @code{SMPTE_436M_ANC} data stream to a @code{EIA_608} stream,
|
||||
extracting the closed captions from CTA-708 CDP VANC packets, and ignoring all other data.
|
||||
|
||||
@anchor{text2movsub}
|
||||
@section text2movsub
|
||||
|
||||
|
|
|
|||
|
|
@ -30,13 +30,6 @@ fate
|
|||
fate-list
|
||||
List all fate/regression test targets.
|
||||
|
||||
fate-list-failing
|
||||
List the fate tests that failed the last time they were executed.
|
||||
|
||||
fate-clear-reports
|
||||
Remove the test reports from previous test executions (getting rid of
|
||||
potentially stale results from fate-list-failing).
|
||||
|
||||
install
|
||||
Install headers, libraries and programs.
|
||||
|
||||
|
|
@ -70,3 +63,4 @@ make -j<num>
|
|||
make -k
|
||||
Continue build in case of errors, this is useful for the regression tests
|
||||
sometimes but note that it will still not run all reg tests.
|
||||
|
||||
|
|
|
|||
|
|
@ -664,8 +664,6 @@ for codecs that support it. At present, those are H.264 and VP9.
|
|||
@item film_grain
|
||||
Export film grain parameters through frame side data (see @code{AV_FRAME_DATA_FILM_GRAIN_PARAMS}).
|
||||
Supported at present by AV1 decoders.
|
||||
@item enhancements
|
||||
Export picture enhancement metadata through frame side data, e.g. LCEVC (see @code{AV_FRAME_DATA_LCEVC}).
|
||||
@end table
|
||||
|
||||
@item threads @var{integer} (@emph{decoding/encoding,video})
|
||||
|
|
|
|||
|
|
@ -82,6 +82,8 @@ The TC has 2 modes of operation: a RFC one and an internal one.
|
|||
|
||||
If the TC thinks it needs the input from the larger community, the TC can call for a RFC. Else, it can decide by itself.
|
||||
|
||||
If the disagreement involves a member of the TC, that member should recuse themselves from the decision.
|
||||
|
||||
The decision to use a RFC process or an internal discussion is a discretionary decision of the TC.
|
||||
|
||||
The TC can also reject a seizure for a few reasons such as: the matter was not discussed enough previously; it lacks expertise to reach a beneficial decision on the matter; or the matter is too trivial.
|
||||
|
|
@ -121,13 +123,6 @@ The decisions from the TC will be sent on the mailing list, with the [TC] tag.
|
|||
|
||||
Internally, the TC should take decisions with a majority, or using ranked-choice voting.
|
||||
|
||||
Each TC member must vote on such decision according to what is, in their view, best for the project.
|
||||
|
||||
If a TC member feels they are affected by a conflict of interest with regards to the case, they should announce it and recuse themselves from the TC
|
||||
discussion and vote.
|
||||
|
||||
A conflict of interest is presumed to occur when a TC member has a personal interest (e.g. financial) in a specific outcome of the case.
|
||||
|
||||
The decision from the TC should be published with a summary of the reasons that lead to this decision.
|
||||
|
||||
The decisions from the TC are final, until the matters are reopened after no less than one year.
|
||||
|
|
|
|||
|
|
@ -38,51 +38,6 @@ Select an operating point of a scalable AV1 bitstream (0 - 31). Default is 0.
|
|||
|
||||
@end table
|
||||
|
||||
@section hevc
|
||||
HEVC (AKA ITU-T H.265 or ISO/IEC 23008-2) decoder.
|
||||
|
||||
The decoder supports MV-HEVC multiview streams with at most two views. Views to
|
||||
be output are selected by supplying a list of view IDs to the decoder (the
|
||||
@option{view_ids} option). This option may be set either statically before
|
||||
decoder init, or from the @code{get_format()} callback - useful for the case
|
||||
when the view count or IDs change dynamically during decoding.
|
||||
|
||||
Only the base layer is decoded by default.
|
||||
|
||||
Note that if you are using the @code{ffmpeg} CLI tool, you should be using view
|
||||
specifiers as documented in its manual, rather than the options documented here.
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
|
||||
@item view_ids (MV-HEVC)
|
||||
Specify a list of view IDs that should be output. This option can also be set to
|
||||
a single '-1', which will cause all views defined in the VPS to be decoded and
|
||||
output.
|
||||
|
||||
@item view_ids_available (MV-HEVC)
|
||||
This option may be read by the caller to retrieve an array of view IDs available
|
||||
in the active VPS. The array is empty for single-layer video.
|
||||
|
||||
The value of this option is guaranteed to be accurate when read from the
|
||||
@code{get_format()} callback. It may also be set at other times (e.g. after
|
||||
opening the decoder), but the value is informational only and may be incorrect
|
||||
(e.g. when the stream contains multiple distinct VPS NALUs).
|
||||
|
||||
@item view_pos_available (MV-HEVC)
|
||||
This option may be read by the caller to retrieve an array of view positions
|
||||
(left, right, or unspecified) available in the active VPS, as
|
||||
@code{AVStereo3DView} values. When the array is available, its elements apply to
|
||||
the corresponding elements of @option{view_ids_available}, i.e.
|
||||
@code{view_pos_available[i]} contains the position of view with ID
|
||||
@code{view_ids_available[i]}.
|
||||
|
||||
Same validity restrictions as for @option{view_ids_available} apply to
|
||||
this option.
|
||||
|
||||
@end table
|
||||
|
||||
@section rawvideo
|
||||
|
||||
Raw video decoder.
|
||||
|
|
@ -202,7 +157,7 @@ Force to use a specific number of threads
|
|||
@section QSV Decoders
|
||||
|
||||
The family of Intel QuickSync Video decoders (VC1, MPEG-2, H.264, HEVC,
|
||||
JPEG/MJPEG, VP8, VP9, AV1, VVC).
|
||||
JPEG/MJPEG, VP8, VP9, AV1).
|
||||
|
||||
@subsection Common Options
|
||||
|
||||
|
|
@ -395,7 +350,7 @@ without this library.
|
|||
@c man end AUDIO DECODERS
|
||||
|
||||
@chapter Subtitles Decoders
|
||||
@c man begin SUBTITLES DECODERS
|
||||
@c man begin SUBTILES DECODERS
|
||||
|
||||
@section libaribb24
|
||||
|
||||
|
|
@ -427,7 +382,7 @@ Enabled by default.
|
|||
Yet another ARIB STD-B24 caption decoder using external @dfn{libaribcaption}
|
||||
library.
|
||||
|
||||
Implements profiles A and C of the Japanese ARIB STD-B24 standard,
|
||||
Implements profiles A and C of the Japanse ARIB STD-B24 standard,
|
||||
Brazilian ABNT NBR 15606-1, and Philippines version of ISDB-T.
|
||||
|
||||
Requires the presence of the libaribcaption headers and library
|
||||
|
|
@ -477,7 +432,7 @@ Specify comma-separated list of font family names to be used for @dfn{bitmap}
|
|||
or @dfn{ass} type subtitle rendering.
|
||||
Only first font name is used for @dfn{ass} type subtitle.
|
||||
|
||||
If not specified, use internally defined default font family.
|
||||
If not specified, use internaly defined default font family.
|
||||
|
||||
@item -ass_single_rect @var{boolean}
|
||||
ARIB STD-B24 specifies that some captions may be displayed at different
|
||||
|
|
@ -495,7 +450,7 @@ default behavior at compilation.
|
|||
|
||||
@item -force_outline_text @var{boolean}
|
||||
Specify whether always render outline text for all characters regardless of
|
||||
the indication by character style.
|
||||
the indication by charactor style.
|
||||
|
||||
The default is @var{false}.
|
||||
|
||||
|
|
@ -696,4 +651,4 @@ box and an end box, typically subtitles. Default value is 0 if
|
|||
|
||||
@end table
|
||||
|
||||
@c man end SUBTITLES DECODERS
|
||||
@c man end SUBTILES DECODERS
|
||||
|
|
|
|||
|
|
@ -292,6 +292,7 @@ DVD-Video demuxer, powered by libdvdnav and libdvdread.
|
|||
Can directly ingest DVD titles, specifically sequential PGCs, into
|
||||
a conversion pipeline. Menu assets, such as background video or audio,
|
||||
can also be demuxed given the menu's coordinates (at best effort).
|
||||
Seeking is not supported at this time.
|
||||
|
||||
Block devices (DVD drives), ISO files, and directory structures are accepted.
|
||||
Activate with @code{-f dvdvideo} in front of one of these inputs.
|
||||
|
|
@ -379,11 +380,11 @@ Default is false.
|
|||
|
||||
@item menu_lu @var{int}
|
||||
The menu language to demux. In DVD, menus are grouped by language.
|
||||
Default is 1, the first language unit.
|
||||
Default is 0, the first language unit.
|
||||
|
||||
@item menu_vts @var{int}
|
||||
The VTS where the menu lives, or 0 if it is a VMG menu (root-level).
|
||||
Default is 1, menu of the first VTS.
|
||||
Default is 0, VMG menu.
|
||||
|
||||
@item pgc @var{int}
|
||||
The entry PGC to start playback, in conjunction with @option{pg}.
|
||||
|
|
@ -396,7 +397,8 @@ Default is 0, automatically resolve from value of @option{title}.
|
|||
The entry PG to start playback, in conjunction with @option{pgc}.
|
||||
Alternative to setting @option{title}.
|
||||
Chapter markers are not supported at this time.
|
||||
Default is 1, the first PG of the PGC.
|
||||
Default is 0, automatically resolve from value of @option{title}, or
|
||||
start from the beginning (PG 1) of the menu.
|
||||
|
||||
@item preindex @var{bool}
|
||||
Enable this to have accurate chapter (PTT) markers and duration measurement,
|
||||
|
|
@ -404,6 +406,7 @@ which requires a slow second pass read in order to index the chapter marker
|
|||
timestamps from NAV packets. This is non-ideal extra work for real optical drives.
|
||||
It is recommended and faster to use this option with a backup of the DVD structure
|
||||
stored on a hard drive. Not compatible with @option{pgc} and @option{pg}.
|
||||
Not applicable to menus.
|
||||
Default is 0, false.
|
||||
|
||||
@item trim @var{bool}
|
||||
|
|
@ -855,32 +858,6 @@ Set the sample rate for libopenmpt to output.
|
|||
Range is from 1000 to INT_MAX. The value default is 48000.
|
||||
@end table
|
||||
|
||||
@anchor{mccdec}
|
||||
@section mcc
|
||||
|
||||
Demuxer for MacCaption MCC files, it supports MCC versions 1.0 and 2.0.
|
||||
MCC files store VANC data, which can include closed captions (EIA-608 and CEA-708), ancillary time code, pan-scan data, etc.
|
||||
By default, for backward compatibility, the MCC demuxer extracts just the EIA-608 and CEA-708 closed captions and returns a @code{EIA_608} stream, ignoring all other VANC data.
|
||||
You can change it to return all VANC data in a @code{SMPTE_436M_ANC} data stream by setting @option{-eia608_extract 0}
|
||||
|
||||
@subsection Examples
|
||||
|
||||
@itemize
|
||||
@item
|
||||
Convert a MCC file to Scenarist (SCC) format:
|
||||
@example
|
||||
ffmpeg -i CC.mcc -c:s copy CC.scc
|
||||
@end example
|
||||
Note that the SCC format only supports EIA-608, so this will discard all other data such as CEA-708 extensions.
|
||||
|
||||
@item
|
||||
Merge a MCC file into a MXF file:
|
||||
@example
|
||||
ffmpeg -i video_and_audio.mxf -eia608_extract 0 -i CC.mcc -c copy -map 0 -map 1 out.mxf
|
||||
@end example
|
||||
This retains all VANC data and inserts it into the output MXF file as a @code{SMPTE_436M_ANC} data stream.
|
||||
@end itemize
|
||||
|
||||
@section mov/mp4/3gp
|
||||
|
||||
Demuxer for Quicktime File Format & ISO/IEC Base Media File Format (ISO/IEC 14496-12 or MPEG-4 Part 12, ISO/IEC 15444-12 or JPEG 2000 Part 12).
|
||||
|
|
@ -1016,7 +993,7 @@ to 1 (-1 means automatic setting, 1 means enabled, 0 means
|
|||
disabled). Default value is -1.
|
||||
|
||||
@item merge_pmt_versions
|
||||
Reuse existing streams when a PMT's version is updated and elementary
|
||||
Re-use existing streams when a PMT's version is updated and elementary
|
||||
streams move to different PIDs. Default value is 0.
|
||||
|
||||
@item max_packet_size
|
||||
|
|
@ -1068,36 +1045,6 @@ the command:
|
|||
ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw
|
||||
@end example
|
||||
|
||||
@anchor{rcwtdec}
|
||||
@section rcwt
|
||||
|
||||
RCWT (Raw Captions With Time) is a format native to ccextractor, a commonly
|
||||
used open source tool for processing 608/708 Closed Captions (CC) sources.
|
||||
For more information on the format, see @ref{rcwtenc,,,ffmpeg-formats}.
|
||||
|
||||
This demuxer implements the specification as of March 2024, which has
|
||||
been stable and unchanged since April 2014.
|
||||
|
||||
@subsection Examples
|
||||
|
||||
@itemize
|
||||
@item
|
||||
Render CC to ASS using the built-in decoder:
|
||||
@example
|
||||
ffmpeg -i CC.rcwt.bin CC.ass
|
||||
@end example
|
||||
Note that if your output appears to be empty, you may have to manually
|
||||
set the decoder's @option{data_field} option to pick the desired CC substream.
|
||||
|
||||
@item
|
||||
Convert an RCWT backup to Scenarist (SCC) format:
|
||||
@example
|
||||
ffmpeg -i CC.rcwt.bin -c:s copy CC.scc
|
||||
@end example
|
||||
Note that the SCC format does not support all of the possible CC extensions
|
||||
that can be stored in RCWT (such as EIA-708).
|
||||
@end itemize
|
||||
|
||||
@section sbg
|
||||
|
||||
SBaGen script demuxer.
|
||||
|
|
|
|||
|
|
@ -70,6 +70,9 @@ variable-length arrays;
|
|||
|
||||
@item
|
||||
complex numbers;
|
||||
|
||||
@item
|
||||
mixed statements and declarations.
|
||||
@end itemize
|
||||
|
||||
@subsection SIMD/DSP
|
||||
|
|
@ -112,7 +115,7 @@ Objective-C where required for interacting with macOS-specific interfaces.
|
|||
|
||||
@section Code formatting conventions
|
||||
|
||||
There are the following guidelines regarding the code style in files:
|
||||
There are the following guidelines regarding the indentation in files:
|
||||
|
||||
@itemize @bullet
|
||||
@item
|
||||
|
|
@ -132,104 +135,6 @@ K&R coding style is used.
|
|||
@end itemize
|
||||
The presentation is one inspired by 'indent -i4 -kr -nut'.
|
||||
|
||||
@subsection Examples
|
||||
Some notable examples to illustrate common code style in FFmpeg:
|
||||
|
||||
@itemize @bullet
|
||||
|
||||
@item
|
||||
Space around assignments and after
|
||||
@code{if}/@code{do}/@code{while}/@code{for} keywords:
|
||||
|
||||
@example c, good
|
||||
// Good
|
||||
if (condition)
|
||||
av_foo();
|
||||
@end example
|
||||
|
||||
@example c, good
|
||||
// Good
|
||||
for (size_t i = 0; i < len; i++)
|
||||
av_bar(i);
|
||||
@end example
|
||||
|
||||
@example c, good
|
||||
// Good
|
||||
size_t size = 0;
|
||||
@end example
|
||||
|
||||
However no spaces between the parentheses and condition, unless it helps
|
||||
readability of complex conditions, so the following should not be done:
|
||||
|
||||
@example c, bad
|
||||
// Bad style
|
||||
if ( condition )
|
||||
av_foo();
|
||||
@end example
|
||||
|
||||
@item
|
||||
No unnecessary parentheses, unless it helps readability:
|
||||
|
||||
@example c, good
|
||||
// Good
|
||||
int fields = ilace ? 2 : 1;
|
||||
@end example
|
||||
|
||||
@item
|
||||
Don't wrap single-line blocks in braces. Use braces only if there is an accompanying else statement. This keeps future code changes easier to keep track of.
|
||||
|
||||
@example c, good
|
||||
// Good
|
||||
if (bits_pixel == 24) @{
|
||||
avctx->pix_fmt = AV_PIX_FMT_BGR24;
|
||||
@} else if (bits_pixel == 8) @{
|
||||
avctx->pix_fmt = AV_PIX_FMT_GRAY8;
|
||||
@} else
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
@end example
|
||||
|
||||
@item
|
||||
Avoid assignments in conditions where it makes sense:
|
||||
|
||||
@example c, good
|
||||
// Good
|
||||
video_enc->chroma_intra_matrix = av_mallocz(sizeof(*video_enc->chroma_intra_matrix) * 64)
|
||||
if (!video_enc->chroma_intra_matrix)
|
||||
return AVERROR(ENOMEM);
|
||||
@end example
|
||||
|
||||
@example c, bad
|
||||
// Bad style
|
||||
if (!(video_enc->chroma_intra_matrix = av_mallocz(sizeof(*video_enc->chroma_intra_matrix) * 64)))
|
||||
return AVERROR(ENOMEM);
|
||||
@end example
|
||||
|
||||
@example c, good
|
||||
// Ok
|
||||
while ((entry = av_dict_iterate(options, entry)))
|
||||
av_log(ctx, AV_LOG_INFO, "Item '%s': '%s'\n", entry->key, entry->value);
|
||||
@end example
|
||||
|
||||
@item
|
||||
When declaring a pointer variable, the @code{*} goes with the variable not the type:
|
||||
|
||||
@example c, good
|
||||
// Good
|
||||
AVStream *stream;
|
||||
@end example
|
||||
|
||||
@example c, bad
|
||||
// Bad style
|
||||
AVStream* stream;
|
||||
@end example
|
||||
|
||||
@end itemize
|
||||
|
||||
If you work on a file that does not follow these guidelines consistently,
|
||||
change the parts that you are editing to follow these guidelines but do
|
||||
not make unrelated changes in the file to make it conform to these.
|
||||
|
||||
@subsection Vim configuration
|
||||
In order to configure Vim to follow FFmpeg formatting conventions, paste
|
||||
the following snippet into your @file{.vimrc}:
|
||||
|
|
@ -546,7 +451,7 @@ FFmpeg also has a defined scope - your new API must fit within it.
|
|||
|
||||
@subsubheading Replacing existing APIs
|
||||
If your new API is replacing an existing one, it should be strictly superior to
|
||||
it, so that the advantages of using the new API outweigh the cost to the
|
||||
it, so that the advantages of using the new API outweight the cost to the
|
||||
callers of changing their code. After adding the new API you should then
|
||||
deprecate the old one and schedule it for removal, as described in
|
||||
@ref{Removing interfaces}.
|
||||
|
|
@ -596,7 +501,7 @@ change in @file{doc/APIchanges}.
|
|||
Backward-incompatible API or ABI changes require incrementing (bumping) the
|
||||
major version number, as described in @ref{Major version bumps}. Major
|
||||
bumps are significant events that happen on a schedule - so if your change
|
||||
strictly requires one you should add it under @code{#if} preprocessor guards that
|
||||
strictly requires one you should add it under @code{#if} preprocesor guards that
|
||||
disable it until the next major bump happens.
|
||||
|
||||
New APIs that can be added without breaking API or ABI compatibility require
|
||||
|
|
@ -782,7 +687,7 @@ number) in @file{libavcodec/version.h} or @file{libavformat/version.h}?
|
|||
Did you register it in @file{allcodecs.c} or @file{allformats.c}?
|
||||
|
||||
@item
|
||||
Did you add the AVCodecID to @file{codec_id.h}?
|
||||
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}.
|
||||
|
||||
|
|
@ -797,7 +702,7 @@ 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_contents.texi}?
|
||||
@file{doc/general.texi}?
|
||||
|
||||
@item
|
||||
Did you add an entry in the Changelog?
|
||||
|
|
@ -917,10 +822,10 @@ improves readability.
|
|||
Consider adding a regression test for your code. All new modules
|
||||
should be covered by tests. That includes demuxers, muxers, decoders, encoders
|
||||
filters, bitstream filters, parsers. If its not possible to do that, add
|
||||
an explanation why to your patchset, its ok to not test if there's a reason.
|
||||
an explanation why to your patchset, its ok to not test if theres a reason.
|
||||
|
||||
@item
|
||||
If you added NASM code please check that things still work with --disable-x86asm.
|
||||
If you added YASM code please check that things still work with --disable-yasm.
|
||||
|
||||
@item
|
||||
Test your code with valgrind and or Address Sanitizer to ensure it's free
|
||||
|
|
|
|||
|
|
@ -106,8 +106,15 @@ debugging by setting the option to "disable".
|
|||
Enables the use of the long term prediction extension which increases coding
|
||||
efficiency in very low bandwidth situations such as encoding of voice or
|
||||
solo piano music by extending constant harmonic peaks in bands throughout
|
||||
frames. This option is implied by profile:a aac_low.
|
||||
Use in conjunction with @option{-ar} to decrease the samplerate.
|
||||
frames. This option is implied by profile:a aac_low and is incompatible with
|
||||
aac_pred. Use in conjunction with @option{-ar} to decrease the samplerate.
|
||||
|
||||
@item aac_pred
|
||||
Enables the use of a more traditional style of prediction where the spectral
|
||||
coefficients transmitted are replaced by the difference of the current
|
||||
coefficients minus the previous "predicted" coefficients. In theory and sometimes
|
||||
in practice this can improve quality for low to mid bitrate audio.
|
||||
This option implies the aac_main profile and is incompatible with aac_ltp.
|
||||
|
||||
@item profile
|
||||
Sets the encoding profile, possible values:
|
||||
|
|
@ -125,6 +132,10 @@ MPEG4 specifications.
|
|||
Long term prediction profile, is enabled by and will enable the @option{aac_ltp}
|
||||
option. Introduced in MPEG4.
|
||||
|
||||
@item aac_main
|
||||
Main-type prediction profile, is enabled by and will enable the @option{aac_pred}
|
||||
option. Introduced in MPEG2.
|
||||
|
||||
@end table
|
||||
If this option is unspecified it is set to @samp{aac_low}.
|
||||
@end table
|
||||
|
|
@ -133,7 +144,8 @@ If this option is unspecified it is set to @samp{aac_low}.
|
|||
|
||||
AC-3 audio encoders.
|
||||
|
||||
These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366.
|
||||
These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366, as well as
|
||||
the undocumented RealAudio 3 (a.k.a. dnet).
|
||||
|
||||
The @var{ac3} encoder uses floating-point math, while the @var{ac3_fixed}
|
||||
encoder only uses fixed-point integer math. This does not mean that one is
|
||||
|
|
@ -802,63 +814,6 @@ ffmpeg -i input.wav -c:a libfdk_aac -profile:a aac_he -b:a 64k output.m4a
|
|||
@end example
|
||||
@end itemize
|
||||
|
||||
@anchor{liblc3-enc}
|
||||
@section liblc3
|
||||
|
||||
liblc3 LC3 (Low Complexity Communication Codec) encoder wrapper.
|
||||
|
||||
Requires the presence of the liblc3 headers and library during configuration.
|
||||
You need to explicitly configure the build with @code{--enable-liblc3}.
|
||||
|
||||
This encoder has support for the Bluetooth SIG LC3 codec for the LE Audio
|
||||
protocol, and the following features of LC3plus:
|
||||
@itemize
|
||||
@item
|
||||
Frame duration of 2.5 and 5ms.
|
||||
@item
|
||||
High-Resolution mode, 48 KHz, and 96 kHz sampling rates.
|
||||
@end itemize
|
||||
|
||||
For more information see the liblc3 project at
|
||||
@url{https://github.com/google/liblc3}.
|
||||
|
||||
@subsection Options
|
||||
|
||||
The following options are mapped on the shared FFmpeg codec options.
|
||||
|
||||
@table @option
|
||||
@item b @var{bitrate}
|
||||
Set the bit rate in bits/s. This will determine the fixed size of the encoded
|
||||
frames, for a selected frame duration.
|
||||
|
||||
@item ar @var{frequency}
|
||||
Set the audio sampling rate (in Hz).
|
||||
|
||||
@item channels
|
||||
Set the number of audio channels.
|
||||
|
||||
@item frame_duration
|
||||
Set the audio frame duration in milliseconds. Default value is 10ms.
|
||||
Allowed frame durations are 2.5ms, 5ms, 7.5ms and 10ms.
|
||||
LC3 (Bluetooth LE Audio), allows 7.5ms and 10ms; and LC3plus 2.5ms, 5ms
|
||||
and 10ms.
|
||||
|
||||
The 10ms frame duration is available in LC3 and LC3 plus standard.
|
||||
In this mode, the produced bitstream can be referenced either as LC3 or LC3plus.
|
||||
|
||||
@item high_resolution @var{boolean}
|
||||
Enable the high-resolution mode if set to 1. The high-resolution mode is
|
||||
available with all LC3plus frame durations and for a sampling rate of 48 KHz,
|
||||
and 96 KHz.
|
||||
|
||||
The encoder automatically turns off this mode at lower sampling rates and
|
||||
activates it at 96 KHz.
|
||||
|
||||
This mode should be preferred at high bitrates. In this mode, the audio
|
||||
bandwidth is always up to the Nyquist frequency, compared to LC3 at 48 KHz,
|
||||
which limits the bandwidth to 20 KHz.
|
||||
@end table
|
||||
|
||||
@anchor{libmp3lame}
|
||||
@section libmp3lame
|
||||
|
||||
|
|
@ -1038,7 +993,7 @@ forces a wideband cutoff for bitrates < 15 kbps, unless CELT-only
|
|||
Set channel mapping family to be used by the encoder. The default value of -1
|
||||
uses mapping family 0 for mono and stereo inputs, and mapping family 1
|
||||
otherwise. The default also disables the surround masking and LFE bandwidth
|
||||
optimizations in libopus, and requires that the input contains 8 channels or
|
||||
optimzations in libopus, and requires that the input contains 8 channels or
|
||||
fewer.
|
||||
|
||||
Other values include 0 for mono and stereo, 1 for surround sound with masking
|
||||
|
|
@ -1380,48 +1335,6 @@ Higher is better but slower.
|
|||
|
||||
@end table
|
||||
|
||||
@anchor{ffv1}
|
||||
@section ffv1
|
||||
|
||||
FFv1 Encoder
|
||||
|
||||
@subsection Options
|
||||
|
||||
The following options are supported by FFmpeg's FFv1 encoder.
|
||||
|
||||
@table @option
|
||||
@item context
|
||||
Sets the context size, 0 (default) is small, 1 is big.
|
||||
|
||||
@item coder
|
||||
Set the coder,
|
||||
@table @samp
|
||||
@item rice
|
||||
Golomb rice coder
|
||||
@item range_def
|
||||
Range coder with default table
|
||||
@item range_tab
|
||||
Range coder with custom table
|
||||
@end table
|
||||
|
||||
@item slicecrc
|
||||
-1 (default, automatic), 1 use crc with zero initial and final state, 2 use crc with non zero initial and final state
|
||||
|
||||
@item qtable
|
||||
@table @samp
|
||||
@item default
|
||||
default, automatic
|
||||
@item 8bit
|
||||
use 8bit default
|
||||
@item greater8bit
|
||||
use >8bit default
|
||||
@end table
|
||||
|
||||
@item remap_optimizer
|
||||
0 - 5, default 3, how much effort the encoder puts into optimizing the remap table.
|
||||
|
||||
@end table
|
||||
|
||||
@section GIF
|
||||
|
||||
GIF image/animation encoder.
|
||||
|
|
@ -1889,42 +1802,6 @@ ffmpeg -i input -c:v libaom-av1 -b:v 500K -aom-params tune=psnr:enable-tpl-model
|
|||
|
||||
@end table
|
||||
|
||||
@section liboapv
|
||||
|
||||
Advanced Professional Video codec encoder wrapper.
|
||||
|
||||
This encoder requires the presence of the liboapv headers and library
|
||||
during configuration. You need to explicitly configure the build with
|
||||
@option{--enable-liboapv}.
|
||||
|
||||
@float NOTE
|
||||
Many liboapv encoder options are mapped to FFmpeg global codec options,
|
||||
while unique encoder options are provided through private options.
|
||||
@end float
|
||||
|
||||
The apv project website is at @url{https://github.com/AcademySoftwareFoundation/openapv}.
|
||||
|
||||
@subsection Options
|
||||
|
||||
The following options are supported by the liboapv wrapper.
|
||||
|
||||
@float NOTE
|
||||
To get a more extensive documentation of the liboapv options, consult the
|
||||
liboapv documentation.
|
||||
@end float
|
||||
|
||||
@table @option
|
||||
@item preset
|
||||
Set the quality-speed tradeoff [fastest, fast, medium, slow, placebo, default]
|
||||
|
||||
@item qp
|
||||
Set the quantization parameter value for CQP rate control mode.
|
||||
|
||||
@item oapv-params (@emph{parse_apv_params})
|
||||
Set liboapvenc options using a list of @var{key}=@var{value} pairs separated
|
||||
by ":". See the liboapv encoder user guide for a list of accepted parameters.
|
||||
@end table
|
||||
|
||||
@section libsvtav1
|
||||
|
||||
SVT-AV1 encoder wrapper.
|
||||
|
|
@ -2445,70 +2322,6 @@ Indicates frame duration
|
|||
For more information about libvpx see:
|
||||
@url{http://www.webmproject.org/}
|
||||
|
||||
@section libvvenc
|
||||
|
||||
VVenC H.266/VVC encoder wrapper.
|
||||
|
||||
This encoder requires the presence of the libvvenc headers and library
|
||||
during configuration. You need to explicitly configure the build with
|
||||
@option{--enable-libvvenc}.
|
||||
|
||||
The VVenC project website is at
|
||||
@url{https://github.com/fraunhoferhhi/vvenc}.
|
||||
|
||||
@subsection Supported Pixel Formats
|
||||
|
||||
VVenC supports only 10-bit color spaces as input. But the internal (encoded)
|
||||
bit depth can be set to 8-bit or 10-bit at runtime.
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
@item b
|
||||
Sets target video bitrate.
|
||||
|
||||
@item g
|
||||
Set the GOP size. Currently support for g=1 (Intra only) or default.
|
||||
|
||||
@item preset
|
||||
Set the VVenC preset.
|
||||
|
||||
@item levelidc
|
||||
Set level idc.
|
||||
|
||||
@item tier
|
||||
Set vvc tier.
|
||||
|
||||
@item qp
|
||||
Set constant quantization parameter.
|
||||
|
||||
@item subopt @var{boolean}
|
||||
Set subjective (perceptually motivated) optimization. Default is 1 (on).
|
||||
|
||||
@item bitdepth8 @var{boolean}
|
||||
Set 8bit coding mode instead of using 10bit. Default is 0 (off).
|
||||
|
||||
@item period
|
||||
set (intra) refresh period in seconds.
|
||||
|
||||
@item vvenc-params
|
||||
Set vvenc options using a list of @var{key}=@var{value} couples separated
|
||||
by ":". See @command{vvencapp --fullhelp} or @command{vvencFFapp --fullhelp} for a list of options.
|
||||
|
||||
For example, the options might be provided as:
|
||||
|
||||
@example
|
||||
intraperiod=64:decodingrefreshtype=idr:poc0idr=1:internalbitdepth=8
|
||||
@end example
|
||||
|
||||
For example the encoding options might be provided with @option{-vvenc-params}:
|
||||
|
||||
@example
|
||||
ffmpeg -i input -c:v libvvenc -b 1M -vvenc-params intraperiod=64:decodingrefreshtype=idr:poc0idr=1:internalbitdepth=8 output.mp4
|
||||
@end example
|
||||
|
||||
@end table
|
||||
|
||||
@section libwebp
|
||||
|
||||
libwebp WebP Image encoder wrapper
|
||||
|
|
@ -3342,75 +3155,6 @@ fastest.
|
|||
|
||||
@end table
|
||||
|
||||
@section MediaCodec
|
||||
|
||||
MediaCodec encoder wrapper enables hardware-accelerated video encoding on
|
||||
Android device. It supports H.264, H.265 (HEVC), VP8, VP9, MPEG-4, and AV1
|
||||
encoding (whether works or not is device dependent).
|
||||
|
||||
Android provides two sets of APIs: Java MediaCodec and NDK MediaCodec. The
|
||||
MediaCodec encoder wrapper supports both. Note that the NDK MediaCodec API
|
||||
operates without requiring JVM, but may fail to function outside the JVM
|
||||
environment due to dependencies on system framework services, particularly
|
||||
after Android 15.
|
||||
|
||||
@table @option
|
||||
@item ndk_codec @var{boolean}
|
||||
Use the NDK-based MediaCodec API instead of the Java API. Enabled by default
|
||||
if @code{av_jni_get_java_vm()} return NULL.
|
||||
|
||||
@item ndk_async @var{boolean}
|
||||
Use NDK MediaCodec in async mode. Async mode has less overhead than poll in a
|
||||
loop in sync mode. The drawback of async mode is AV_CODEC_FLAG_GLOBAL_HEADER
|
||||
doesn't work (use extract_extradata bsf when necessary). It doesn't work and
|
||||
will be disabled automatically on devices below Android 8.0.
|
||||
|
||||
@item codec_name @var{string}
|
||||
A codec type can have multiple implementations on a single device, this option
|
||||
specify which backend to use (via MediaCodec createCodecByName API). It's NULL
|
||||
by default, and encoder is created by createEncoderByType.
|
||||
|
||||
@item bitrate_mode @var{integer}
|
||||
|
||||
Possible values:
|
||||
@table @samp
|
||||
@item cq
|
||||
Constant quality mode
|
||||
@item vbr
|
||||
Variable bitrate mode
|
||||
@item cbr
|
||||
Constant bitrate mode
|
||||
@item cbr_fd
|
||||
Constant bitrate mode with frame drops
|
||||
@end table
|
||||
|
||||
@item pts_as_dts @var{boolean}
|
||||
Use PTS as DTS. This is a workaround since MediaCodec API doesn't provide
|
||||
decoding timestamp. It is enabled automatically if B frame is 0.
|
||||
|
||||
@item operating_rate @var{integer}
|
||||
The desired operating rate that the codec will need to operate at, zero for
|
||||
unspecified. This is used for cases like high-speed/slow-motion video capture,
|
||||
where the video encoder format contains the target playback rate (e.g. 30fps),
|
||||
but the component must be able to handle the high operating capture rate (e.g.
|
||||
240fps). This rate will be used by codec for resource planning and setting the
|
||||
operating points.
|
||||
|
||||
@item qp_i_min @var{integer}
|
||||
Minimum quantization parameter for I frame.
|
||||
@item qp_p_min @var{integer}
|
||||
Minimum quantization parameter for P frame.
|
||||
@item qp_b_min @var{integer}
|
||||
Minimum quantization parameter for B frame.
|
||||
@item qp_i_max @var{integer}
|
||||
Maximum quantization parameter for I frame.
|
||||
@item qp_p_max @var{integer}
|
||||
Maximum quantization parameter for P frame.
|
||||
@item qp_b_max @var{integer}
|
||||
Maximum quantization parameter for B frame.
|
||||
|
||||
@end table
|
||||
|
||||
@section MediaFoundation
|
||||
|
||||
This provides wrappers to encoders (both audio and video) in the
|
||||
|
|
@ -3493,13 +3237,6 @@ Default is 1 (on).
|
|||
|
||||
PNG image encoder.
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
@item compression_level
|
||||
Sets the compression level, from 0 to 9(default)
|
||||
@end table
|
||||
|
||||
@subsection Private options
|
||||
|
||||
@table @option
|
||||
|
|
@ -3507,8 +3244,6 @@ Sets the compression level, from 0 to 9(default)
|
|||
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
|
||||
@item pred @var{method}
|
||||
Set prediction method (none, sub, up, avg, paeth, mixed), default is paeth
|
||||
@end table
|
||||
|
||||
@section ProRes
|
||||
|
|
@ -3703,7 +3438,7 @@ For encoders set this flag to ON to reduce power consumption and GPU usage.
|
|||
@end table
|
||||
|
||||
@subsection Runtime Options
|
||||
Following options can be used during qsv encoding.
|
||||
Following options can be used durning qsv encoding.
|
||||
|
||||
@table @option
|
||||
@item @var{global_quality}
|
||||
|
|
@ -3755,20 +3490,6 @@ Change these value to reset qsv codec's bitrate control configuration.
|
|||
@item @var{pic_timing_sei}
|
||||
Supported in h264_qsv and hevc_qsv.
|
||||
Change this value to reset qsv codec's pic_timing_sei configuration.
|
||||
|
||||
@item @var{qsv_params}
|
||||
Set QSV encoder parameters as a colon-separated list of key-value pairs.
|
||||
|
||||
The @option{qsv_params} should be formatted as @code{key1=value1:key2=value2:...}.
|
||||
|
||||
These parameters are passed directly to the underlying Intel Quick Sync Video (QSV) encoder using the MFXSetParameter function.
|
||||
|
||||
Example:
|
||||
@example
|
||||
ffmpeg -i input.mp4 -c:v h264_qsv -qsv_params "CodingOption1=1:CodingOption2=2" output.mp4
|
||||
@end example
|
||||
|
||||
This option allows fine-grained control over various encoder-specific settings provided by the QSV encoder.
|
||||
@end table
|
||||
|
||||
@subsection H264 options
|
||||
|
|
@ -3813,7 +3534,7 @@ improves subjective visual quality. Enabling this flag may have negative impact
|
|||
on performance and objective visual quality metric.
|
||||
|
||||
@item @var{low_delay_brc}
|
||||
Setting this flag turns on or off LowDelayBRC feature in qsv plugin, which provides
|
||||
Setting this flag turns on or off LowDelayBRC feautre in qsv plugin, which provides
|
||||
more accurate bitrate control to minimize the variance of bitstream size frame
|
||||
by frame. Value: -1-default 0-off 1-on
|
||||
|
||||
|
|
@ -4012,7 +3733,7 @@ improves subjective visual quality. Enabling this flag may have negative impact
|
|||
on performance and objective visual quality metric.
|
||||
|
||||
@item @var{low_delay_brc}
|
||||
Setting this flag turns on or off LowDelayBRC feature in qsv plugin, which provides
|
||||
Setting this flag turns on or off LowDelayBRC feautre in qsv plugin, which provides
|
||||
more accurate bitrate control to minimize the variance of bitstream size frame
|
||||
by frame. Value: -1-default 0-off 1-on
|
||||
|
||||
|
|
@ -4246,22 +3967,14 @@ Extended bitrate control.
|
|||
Depth of look ahead in number frames, available when extbrc option is enabled.
|
||||
|
||||
@item @var{low_delay_brc}
|
||||
Setting this flag turns on or off LowDelayBRC feature in qsv plugin, which provides
|
||||
Setting this flag turns on or off LowDelayBRC feautre in qsv plugin, which provides
|
||||
more accurate bitrate control to minimize the variance of bitstream size frame
|
||||
by frame. Value: -1-default 0-off 1-on
|
||||
|
||||
@item @var{max_frame_size}
|
||||
@item max_frame_size
|
||||
Set the allowed max size in bytes for each frame. If the frame size exceeds
|
||||
the limitation, encoder will adjust the QP value to control the frame size.
|
||||
Invalid in CQP rate control mode.
|
||||
|
||||
@item @var{max_frame_size_i}
|
||||
Maximum encoded frame size for I frames in bytes. If this value is set as larger
|
||||
than zero, then for I frames the value set by max_frame_size is ignored.
|
||||
|
||||
@item @var{max_frame_size_p}
|
||||
Maximum encoded frame size for P frames in bytes. If this value is set as larger
|
||||
than zero, then for P frames the value set by max_frame_size is ignored.
|
||||
@end table
|
||||
|
||||
@section snow
|
||||
|
|
@ -4602,25 +4315,6 @@ Reduces detail but attempts to preserve color at extremely low bitrates.
|
|||
@chapter Subtitles Encoders
|
||||
@c man begin SUBTITLES ENCODERS
|
||||
|
||||
@section dvbsub
|
||||
|
||||
This codec encodes the bitmap subtitle format that is used in DVB
|
||||
broadcasts and recordings. The bitmaps are typically embedded in a
|
||||
container such as MPEG-TS as a separate stream.
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
@item min_bpp @var{integer (2, 4, or 8)}
|
||||
Set a minimum bits-per-pixel value for the subtitle color lookup tables.
|
||||
|
||||
DVB supports 2, 4, and 8 bits-per-pixel color lookup tables. This
|
||||
option enables forcing a particular bits-per-pixel value regardless of
|
||||
the number of colors. Since not all players support or properly
|
||||
support 2 bits-per-pixel, this value defaults to 4.
|
||||
|
||||
@end table
|
||||
|
||||
@section dvdsub
|
||||
|
||||
This codec encodes the bitmap subtitle format that is used in DVDs.
|
||||
|
|
@ -4648,18 +4342,4 @@ one byte per subtitle on average.
|
|||
By default, this work-around is disabled.
|
||||
@end table
|
||||
|
||||
@section lrc
|
||||
|
||||
This codec encodes the LRC lyrics format.
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
@item precision
|
||||
Specify the precision of the fractional part of the timestamp. Time base is
|
||||
determined based on this value.
|
||||
|
||||
Defaults to 2 for centiseconds.
|
||||
@end table
|
||||
|
||||
@c man end SUBTITLES ENCODERS
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@
|
|||
#include <libavformat/avformat.h>
|
||||
#include <libavformat/avio.h>
|
||||
#include <libavutil/file.h>
|
||||
#include <libavutil/mem.h>
|
||||
|
||||
struct buffer_data {
|
||||
uint8_t *ptr;
|
||||
|
|
@ -96,7 +95,6 @@ int main(int argc, char *argv[])
|
|||
avio_ctx = avio_alloc_context(avio_ctx_buffer, avio_ctx_buffer_size,
|
||||
0, &bd, &read_packet, NULL, NULL);
|
||||
if (!avio_ctx) {
|
||||
av_freep(&avio_ctx_buffer);
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto end;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -128,10 +128,6 @@ int main(int argc, char **argv)
|
|||
outfilename = argv[2];
|
||||
|
||||
pkt = av_packet_alloc();
|
||||
if (!pkt) {
|
||||
fprintf(stderr, "Could not allocate AVPacket\n");
|
||||
exit(1); /* or proper cleanup and returning */
|
||||
}
|
||||
|
||||
/* find the MPEG audio decoder */
|
||||
codec = avcodec_find_decoder(AV_CODEC_ID_MP2);
|
||||
|
|
@ -165,7 +161,7 @@ int main(int argc, char **argv)
|
|||
}
|
||||
outfile = fopen(outfilename, "wb");
|
||||
if (!outfile) {
|
||||
fprintf(stderr, "Could not open %s\n", outfilename);
|
||||
av_free(c);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,12 +30,13 @@
|
|||
* file to be played with ffplay.
|
||||
*/
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#include <libavcodec/avcodec.h>
|
||||
#include <libavformat/avformat.h>
|
||||
#include <libavfilter/buffersink.h>
|
||||
#include <libavfilter/buffersrc.h>
|
||||
#include <libavutil/channel_layout.h>
|
||||
#include <libavutil/mem.h>
|
||||
#include <libavutil/opt.h>
|
||||
|
||||
static const char *filter_descr = "aresample=8000,aformat=sample_fmts=s16:channel_layouts=mono";
|
||||
|
|
@ -94,7 +95,8 @@ static int init_filters(const char *filters_descr)
|
|||
const AVFilter *abuffersink = avfilter_get_by_name("abuffersink");
|
||||
AVFilterInOut *outputs = avfilter_inout_alloc();
|
||||
AVFilterInOut *inputs = avfilter_inout_alloc();
|
||||
static const int out_sample_rate = 8000;
|
||||
static const enum AVSampleFormat out_sample_fmts[] = { AV_SAMPLE_FMT_S16, -1 };
|
||||
static const int out_sample_rates[] = { 8000, -1 };
|
||||
const AVFilterLink *outlink;
|
||||
AVRational time_base = fmt_ctx->streams[audio_stream_index]->time_base;
|
||||
|
||||
|
|
@ -120,40 +122,34 @@ static int init_filters(const char *filters_descr)
|
|||
}
|
||||
|
||||
/* buffer audio sink: to terminate the filter chain. */
|
||||
buffersink_ctx = avfilter_graph_alloc_filter(filter_graph, abuffersink, "out");
|
||||
if (!buffersink_ctx) {
|
||||
ret = avfilter_graph_create_filter(&buffersink_ctx, abuffersink, "out",
|
||||
NULL, NULL, filter_graph);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Cannot create audio buffer sink\n");
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto end;
|
||||
}
|
||||
|
||||
ret = av_opt_set(buffersink_ctx, "sample_formats", "s16",
|
||||
AV_OPT_SEARCH_CHILDREN);
|
||||
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");
|
||||
goto end;
|
||||
}
|
||||
|
||||
ret = av_opt_set(buffersink_ctx, "channel_layouts", "mono",
|
||||
AV_OPT_SEARCH_CHILDREN);
|
||||
ret = av_opt_set(buffersink_ctx, "ch_layouts", "mono",
|
||||
AV_OPT_SEARCH_CHILDREN);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Cannot set output channel layout\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
ret = av_opt_set_array(buffersink_ctx, "samplerates", AV_OPT_SEARCH_CHILDREN,
|
||||
0, 1, AV_OPT_TYPE_INT, &out_sample_rate);
|
||||
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");
|
||||
goto end;
|
||||
}
|
||||
|
||||
ret = avfilter_init_dict(buffersink_ctx, NULL);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Cannot initialize audio buffer sink\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the endpoints for the filter graph. The filter_graph will
|
||||
* be linked to the graph described by filters_descr.
|
||||
|
|
@ -283,25 +279,6 @@ int main(int argc, char **argv)
|
|||
}
|
||||
av_packet_unref(packet);
|
||||
}
|
||||
if (ret == AVERROR_EOF) {
|
||||
/* signal EOF to the filtergraph */
|
||||
if (av_buffersrc_add_frame_flags(buffersrc_ctx, NULL, 0) < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Error while closing the filtergraph\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* pull remaining frames from the filtergraph */
|
||||
while (1) {
|
||||
ret = av_buffersink_get_frame(buffersink_ctx, filt_frame);
|
||||
if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
|
||||
break;
|
||||
if (ret < 0)
|
||||
goto end;
|
||||
print_frame(filt_frame);
|
||||
av_frame_unref(filt_frame);
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
avfilter_graph_free(&filter_graph);
|
||||
avcodec_free_context(&dec_ctx);
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@
|
|||
* @example decode_filter_video.c
|
||||
*/
|
||||
|
||||
#define _XOPEN_SOURCE 600 /* for usleep */
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
|
@ -34,9 +36,7 @@
|
|||
#include <libavformat/avformat.h>
|
||||
#include <libavfilter/buffersink.h>
|
||||
#include <libavfilter/buffersrc.h>
|
||||
#include <libavutil/mem.h>
|
||||
#include <libavutil/opt.h>
|
||||
#include <libavutil/time.h>
|
||||
|
||||
const char *filter_descr = "scale=78:24,transpose=cclock";
|
||||
/* other way:
|
||||
|
|
@ -98,6 +98,7 @@ static int init_filters(const char *filters_descr)
|
|||
AVFilterInOut *outputs = avfilter_inout_alloc();
|
||||
AVFilterInOut *inputs = avfilter_inout_alloc();
|
||||
AVRational time_base = fmt_ctx->streams[video_stream_index]->time_base;
|
||||
enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE };
|
||||
|
||||
filter_graph = avfilter_graph_alloc();
|
||||
if (!outputs || !inputs || !filter_graph) {
|
||||
|
|
@ -120,26 +121,20 @@ static int init_filters(const char *filters_descr)
|
|||
}
|
||||
|
||||
/* buffer video sink: to terminate the filter chain. */
|
||||
buffersink_ctx = avfilter_graph_alloc_filter(filter_graph, buffersink, "out");
|
||||
if (!buffersink_ctx) {
|
||||
ret = avfilter_graph_create_filter(&buffersink_ctx, buffersink, "out",
|
||||
NULL, NULL, filter_graph);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Cannot create buffer sink\n");
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto end;
|
||||
}
|
||||
|
||||
ret = av_opt_set(buffersink_ctx, "pixel_formats", "gray8",
|
||||
AV_OPT_SEARCH_CHILDREN);
|
||||
ret = av_opt_set_int_list(buffersink_ctx, "pix_fmts", pix_fmts,
|
||||
AV_PIX_FMT_NONE, AV_OPT_SEARCH_CHILDREN);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Cannot set output pixel format\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
ret = avfilter_init_dict(buffersink_ctx, NULL);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Cannot initialize buffer sink\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the endpoints for the filter graph. The filter_graph will
|
||||
* be linked to the graph described by filters_descr.
|
||||
|
|
@ -194,7 +189,7 @@ static void display_frame(const AVFrame *frame, AVRational time_base)
|
|||
delay = av_rescale_q(frame->pts - last_pts,
|
||||
time_base, AV_TIME_BASE_Q);
|
||||
if (delay > 0 && delay < 1000000)
|
||||
av_usleep(delay);
|
||||
usleep(delay);
|
||||
}
|
||||
last_pts = frame->pts;
|
||||
}
|
||||
|
|
@ -281,25 +276,6 @@ int main(int argc, char **argv)
|
|||
}
|
||||
av_packet_unref(packet);
|
||||
}
|
||||
if (ret == AVERROR_EOF) {
|
||||
/* signal EOF to the filtergraph */
|
||||
if (av_buffersrc_add_frame_flags(buffersrc_ctx, NULL, 0) < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Error while closing the filtergraph\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* pull remaining frames from the filtergraph */
|
||||
while (1) {
|
||||
ret = av_buffersink_get_frame(buffersink_ctx, filt_frame);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
avfilter_graph_free(&filter_graph);
|
||||
avcodec_free_context(&dec_ctx);
|
||||
|
|
|
|||
|
|
@ -41,15 +41,15 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <libavutil/channel_layout.h>
|
||||
#include <libavutil/md5.h>
|
||||
#include <libavutil/mem.h>
|
||||
#include <libavutil/opt.h>
|
||||
#include <libavutil/samplefmt.h>
|
||||
#include "libavutil/channel_layout.h"
|
||||
#include "libavutil/md5.h"
|
||||
#include "libavutil/mem.h"
|
||||
#include "libavutil/opt.h"
|
||||
#include "libavutil/samplefmt.h"
|
||||
|
||||
#include <libavfilter/avfilter.h>
|
||||
#include <libavfilter/buffersink.h>
|
||||
#include <libavfilter/buffersrc.h>
|
||||
#include "libavfilter/avfilter.h"
|
||||
#include "libavfilter/buffersink.h"
|
||||
#include "libavfilter/buffersrc.h"
|
||||
|
||||
#define INPUT_SAMPLERATE 48000
|
||||
#define INPUT_FORMAT AV_SAMPLE_FMT_FLTP
|
||||
|
|
@ -270,6 +270,7 @@ int main(int argc, char *argv[])
|
|||
AVFilterGraph *graph;
|
||||
AVFilterContext *src, *sink;
|
||||
AVFrame *frame;
|
||||
uint8_t errstr[1024];
|
||||
float duration;
|
||||
int err, nb_frames, i;
|
||||
|
||||
|
|
@ -294,7 +295,6 @@ int main(int argc, char *argv[])
|
|||
|
||||
md5 = av_md5_alloc();
|
||||
if (!md5) {
|
||||
av_frame_free(&frame);
|
||||
fprintf(stderr, "Error allocating the MD5 context\n");
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -302,10 +302,8 @@ int main(int argc, char *argv[])
|
|||
/* Set up the filtergraph. */
|
||||
err = init_filter_graph(&graph, &src, &sink);
|
||||
if (err < 0) {
|
||||
av_frame_free(&frame);
|
||||
av_freep(&md5);
|
||||
fprintf(stderr, "Unable to init filter graph:");
|
||||
return 1;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* the main filtering loop */
|
||||
|
|
@ -356,10 +354,7 @@ int main(int argc, char *argv[])
|
|||
return 0;
|
||||
|
||||
fail:
|
||||
avfilter_graph_free(&graph);
|
||||
av_frame_free(&frame);
|
||||
av_freep(&md5);
|
||||
|
||||
fprintf(stderr, "%s\n", av_err2str(err));
|
||||
av_strerror(err, errstr, sizeof(errstr));
|
||||
fprintf(stderr, "%s\n", errstr);
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@
|
|||
|
||||
#include <libavcodec/avcodec.h>
|
||||
#include <libavformat/avformat.h>
|
||||
#include <libavutil/mem.h>
|
||||
#include <libavutil/pixdesc.h>
|
||||
#include <libavutil/hwcontext.h>
|
||||
#include <libavutil/opt.h>
|
||||
|
|
|
|||
|
|
@ -418,7 +418,7 @@ static void open_video(AVFormatContext *oc, const AVCodec *codec,
|
|||
exit(1);
|
||||
}
|
||||
|
||||
/* allocate and init a reusable frame */
|
||||
/* allocate and init a re-usable frame */
|
||||
ost->frame = alloc_frame(c->pix_fmt, c->width, c->height);
|
||||
if (!ost->frame) {
|
||||
fprintf(stderr, "Could not allocate video frame\n");
|
||||
|
|
|
|||
|
|
@ -30,16 +30,16 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <libavformat/avformat.h>
|
||||
#include <libavformat/avio.h>
|
||||
#include "libavformat/avformat.h"
|
||||
#include "libavformat/avio.h"
|
||||
|
||||
#include <libavcodec/avcodec.h>
|
||||
#include "libavcodec/avcodec.h"
|
||||
|
||||
#include <libavutil/buffer.h>
|
||||
#include <libavutil/error.h>
|
||||
#include <libavutil/hwcontext.h>
|
||||
#include <libavutil/hwcontext_qsv.h>
|
||||
#include <libavutil/mem.h>
|
||||
#include "libavutil/buffer.h"
|
||||
#include "libavutil/error.h"
|
||||
#include "libavutil/hwcontext.h"
|
||||
#include "libavutil/hwcontext_qsv.h"
|
||||
#include "libavutil/mem.h"
|
||||
|
||||
static int get_format(AVCodecContext *avctx, const enum AVPixelFormat *pix_fmts)
|
||||
{
|
||||
|
|
@ -219,8 +219,11 @@ int main(int argc, char **argv)
|
|||
ret = decode_packet(decoder_ctx, frame, sw_frame, NULL, output_ctx);
|
||||
|
||||
finish:
|
||||
if (ret < 0)
|
||||
fprintf(stderr, "%s\n", av_err2str(ret));
|
||||
if (ret < 0) {
|
||||
char buf[1024];
|
||||
av_strerror(ret, buf, sizeof(buf));
|
||||
fprintf(stderr, "%s\n", buf);
|
||||
}
|
||||
|
||||
avformat_close_input(&input_ctx);
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@
|
|||
#include <errno.h>
|
||||
|
||||
#include <libavutil/hwcontext.h>
|
||||
#include <libavutil/mem.h>
|
||||
#include <libavcodec/avcodec.h>
|
||||
#include <libavformat/avformat.h>
|
||||
#include <libavutil/opt.h>
|
||||
|
|
@ -101,7 +100,7 @@ static int dynamic_set_parameter(AVCodecContext *avctx)
|
|||
/* Set codec specific option */
|
||||
if ((ret = av_opt_set_dict(avctx->priv_data, &opts)) < 0)
|
||||
goto fail;
|
||||
/* There is no "framerate" option in common option list. Use "-r" to set
|
||||
/* There is no "framerate" option in commom option list. Use "-r" to set
|
||||
* framerate, which is compatible with ffmpeg commandline. The video is
|
||||
* assumed to be average frame rate, so set time_base to 1/framerate. */
|
||||
e = av_dict_get(opts, "r", NULL, 0);
|
||||
|
|
@ -180,7 +179,7 @@ static int open_input_file(char *filename)
|
|||
decoder = avcodec_find_decoder_by_name("mjpeg_qsv");
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "Codec is not supported by qsv\n");
|
||||
fprintf(stderr, "Codec is not supportted by qsv\n");
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
|
|
@ -289,7 +288,7 @@ static int dec_enc(AVPacket *pkt, const AVCodec *enc_codec, char *optstr)
|
|||
fprintf(stderr, "Failed to set encoding parameter.\n");
|
||||
goto fail;
|
||||
}
|
||||
/* There is no "framerate" option in common option list. Use "-r" to
|
||||
/* There is no "framerate" option in commom option list. Use "-r" to
|
||||
* set framerate, which is compatible with ffmpeg commandline. The
|
||||
* video is assumed to be average frame rate, so set time_base to
|
||||
* 1/framerate. */
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@
|
|||
* input to the output without transcoding.
|
||||
*/
|
||||
|
||||
#include <libavutil/mem.h>
|
||||
#include <libavutil/timestamp.h>
|
||||
#include <libavformat/avformat.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@
|
|||
#include <libavfilter/buffersink.h>
|
||||
#include <libavfilter/buffersrc.h>
|
||||
#include <libavutil/channel_layout.h>
|
||||
#include <libavutil/mem.h>
|
||||
#include <libavutil/opt.h>
|
||||
#include <libavutil/pixdesc.h>
|
||||
|
||||
|
|
@ -171,38 +170,23 @@ static int open_output_file(const char *filename)
|
|||
* sample rate etc.). These properties can be changed for output
|
||||
* streams easily using filters */
|
||||
if (dec_ctx->codec_type == AVMEDIA_TYPE_VIDEO) {
|
||||
const enum AVPixelFormat *pix_fmts = NULL;
|
||||
|
||||
enc_ctx->height = dec_ctx->height;
|
||||
enc_ctx->width = dec_ctx->width;
|
||||
enc_ctx->sample_aspect_ratio = dec_ctx->sample_aspect_ratio;
|
||||
|
||||
ret = avcodec_get_supported_config(dec_ctx, NULL,
|
||||
AV_CODEC_CONFIG_PIX_FORMAT, 0,
|
||||
(const void**)&pix_fmts, NULL);
|
||||
|
||||
/* take first format from list of supported formats */
|
||||
enc_ctx->pix_fmt = (ret >= 0 && pix_fmts) ?
|
||||
pix_fmts[0] : dec_ctx->pix_fmt;
|
||||
|
||||
if (encoder->pix_fmts)
|
||||
enc_ctx->pix_fmt = encoder->pix_fmts[0];
|
||||
else
|
||||
enc_ctx->pix_fmt = dec_ctx->pix_fmt;
|
||||
/* video time_base can be set to whatever is handy and supported by encoder */
|
||||
enc_ctx->time_base = av_inv_q(dec_ctx->framerate);
|
||||
} else {
|
||||
const enum AVSampleFormat *sample_fmts = NULL;
|
||||
|
||||
enc_ctx->sample_rate = dec_ctx->sample_rate;
|
||||
ret = av_channel_layout_copy(&enc_ctx->ch_layout, &dec_ctx->ch_layout);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = avcodec_get_supported_config(dec_ctx, NULL,
|
||||
AV_CODEC_CONFIG_SAMPLE_FORMAT, 0,
|
||||
(const void**)&sample_fmts, NULL);
|
||||
|
||||
/* take first format from list of supported formats */
|
||||
enc_ctx->sample_fmt = (ret >= 0 && sample_fmts) ?
|
||||
sample_fmts[0] : dec_ctx->sample_fmt;
|
||||
|
||||
enc_ctx->sample_fmt = encoder->sample_fmts[0];
|
||||
enc_ctx->time_base = (AVRational){1, enc_ctx->sample_rate};
|
||||
}
|
||||
|
||||
|
|
@ -298,10 +282,10 @@ static int init_filter(FilteringContext* fctx, AVCodecContext *dec_ctx,
|
|||
goto end;
|
||||
}
|
||||
|
||||
buffersink_ctx = avfilter_graph_alloc_filter(filter_graph, buffersink, "out");
|
||||
if (!buffersink_ctx) {
|
||||
ret = avfilter_graph_create_filter(&buffersink_ctx, buffersink, "out",
|
||||
NULL, NULL, filter_graph);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Cannot create buffer sink\n");
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto end;
|
||||
}
|
||||
|
||||
|
|
@ -312,12 +296,6 @@ static int init_filter(FilteringContext* fctx, AVCodecContext *dec_ctx,
|
|||
av_log(NULL, AV_LOG_ERROR, "Cannot set output pixel format\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
ret = avfilter_init_dict(buffersink_ctx, NULL);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Cannot initialize buffer sink\n");
|
||||
goto end;
|
||||
}
|
||||
} else if (dec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) {
|
||||
char buf[64];
|
||||
buffersrc = avfilter_get_by_name("abuffer");
|
||||
|
|
@ -343,10 +321,10 @@ static int init_filter(FilteringContext* fctx, AVCodecContext *dec_ctx,
|
|||
goto end;
|
||||
}
|
||||
|
||||
buffersink_ctx = avfilter_graph_alloc_filter(filter_graph, buffersink, "out");
|
||||
if (!buffersink_ctx) {
|
||||
ret = avfilter_graph_create_filter(&buffersink_ctx, buffersink, "out",
|
||||
NULL, NULL, filter_graph);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Cannot create audio buffer sink\n");
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto end;
|
||||
}
|
||||
|
||||
|
|
@ -373,15 +351,6 @@ static int init_filter(FilteringContext* fctx, AVCodecContext *dec_ctx,
|
|||
av_log(NULL, AV_LOG_ERROR, "Cannot set output sample rate\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (enc_ctx->frame_size > 0)
|
||||
av_buffersink_set_frame_size(buffersink_ctx, enc_ctx->frame_size);
|
||||
|
||||
ret = avfilter_init_dict(buffersink_ctx, NULL);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Cannot initialize audio buffer sink\n");
|
||||
goto end;
|
||||
}
|
||||
} else {
|
||||
ret = AVERROR_UNKNOWN;
|
||||
goto end;
|
||||
|
|
|
|||
|
|
@ -29,20 +29,19 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <libavutil/mem.h>
|
||||
#include <libavformat/avformat.h>
|
||||
#include <libavformat/avio.h>
|
||||
#include "libavformat/avformat.h"
|
||||
#include "libavformat/avio.h"
|
||||
|
||||
#include <libavcodec/avcodec.h>
|
||||
#include "libavcodec/avcodec.h"
|
||||
|
||||
#include <libavutil/audio_fifo.h>
|
||||
#include <libavutil/avassert.h>
|
||||
#include <libavutil/avstring.h>
|
||||
#include <libavutil/channel_layout.h>
|
||||
#include <libavutil/frame.h>
|
||||
#include <libavutil/opt.h>
|
||||
#include "libavutil/audio_fifo.h"
|
||||
#include "libavutil/avassert.h"
|
||||
#include "libavutil/avstring.h"
|
||||
#include "libavutil/channel_layout.h"
|
||||
#include "libavutil/frame.h"
|
||||
#include "libavutil/opt.h"
|
||||
|
||||
#include <libswresample/swresample.h>
|
||||
#include "libswresample/swresample.h"
|
||||
|
||||
/* The output bit rate in bit/s */
|
||||
#define OUTPUT_BIT_RATE 96000
|
||||
|
|
|
|||
|
|
@ -208,13 +208,6 @@ Download/synchronize sample files to the configured samples directory.
|
|||
@item fate-list
|
||||
Will list all fate/regression test targets.
|
||||
|
||||
@item fate-list-failing
|
||||
List the fate tests that failed the last time they were executed.
|
||||
|
||||
@item fate-clear-reports
|
||||
Remove the test reports from previous test executions (getting rid of
|
||||
potentially stale results from fate-list-failing).
|
||||
|
||||
@item fate
|
||||
Run the FATE test suite (requires the fate-suite dataset).
|
||||
@end table
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
slot= # some unique identifier
|
||||
repo=https://git.ffmpeg.org/ffmpeg.git # the source repository
|
||||
repo=git://source.ffmpeg.org/ffmpeg.git # the source repository
|
||||
#branch=release/2.6 # the branch to test
|
||||
samples= # path to samples directory
|
||||
workdir= # directory in which to do all the work
|
||||
|
|
|
|||
810
doc/ffmpeg.texi
810
doc/ffmpeg.texi
|
|
@ -21,24 +21,22 @@ ffmpeg [@var{global_options}] @{[@var{input_file_options}] -i @file{input_url}@}
|
|||
inputs - including live grabbing/recording devices - filter, and transcode them
|
||||
into a plethora of output formats.
|
||||
|
||||
@command{ffmpeg} reads from an arbitrary number of inputs (which can be regular
|
||||
@command{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 outputs, which are
|
||||
specified by a plain output url. Anything found on the command line which cannot
|
||||
be interpreted as an option is considered to be an output url.
|
||||
@code{-i} option, and writes to an arbitrary number of output "files", which are
|
||||
specified by a plain output url. Anything found on the command line which
|
||||
cannot be interpreted as an option is considered to be an output url.
|
||||
|
||||
Each input or output can, in principle, contain any number of elementary streams
|
||||
of different types (video/audio/subtitle/attachment/data), though the allowed
|
||||
stream counts and/or types 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 @ref{Stream selection}
|
||||
chapter).
|
||||
Each input or output url 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).
|
||||
|
||||
To refer to inputs/outputs in options, you must use their indices (0-based).
|
||||
E.g. the first input is @code{0}, the second is @code{1}, etc. Similarly,
|
||||
streams within an input/output are referred to by their indices. E.g. @code{2:3}
|
||||
refers to the fourth stream in the third input or output. Also see the
|
||||
@ref{Stream specifiers} chapter.
|
||||
To refer to input files in options, you must use their indices (0-based). E.g.
|
||||
the first input file is @code{0}, the second is @code{1}, etc. Similarly, streams
|
||||
within a file are referred to by their indices. E.g. @code{2:3} refers to the
|
||||
fourth stream in the third input file. Also see 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
|
||||
|
|
@ -87,405 +85,140 @@ The format option may be needed for raw input files.
|
|||
@chapter Detailed description
|
||||
@c man begin DETAILED DESCRIPTION
|
||||
|
||||
@command{ffmpeg} builds a transcoding pipeline out of the components listed
|
||||
below. The program's operation then consists of input data chunks flowing from
|
||||
the sources down the pipes towards the sinks, while being transformed by the
|
||||
components they encounter along the way.
|
||||
The transcoding process in @command{ffmpeg} for each output can be described by
|
||||
the following diagram:
|
||||
|
||||
The following kinds of components are available:
|
||||
@itemize
|
||||
@item
|
||||
@emph{Demuxers} (short for "demultiplexers") read an input source in order to
|
||||
extract
|
||||
|
||||
@itemize
|
||||
@item
|
||||
global properties such as metadata or chapters;
|
||||
@item
|
||||
list of input elementary streams and their properties
|
||||
@end itemize
|
||||
|
||||
One demuxer instance is created for each @option{-i} option, and sends encoded
|
||||
@emph{packets} to @emph{decoders} or @emph{muxers}.
|
||||
|
||||
In other literature, demuxers are sometimes called @emph{splitters}, because
|
||||
their main function is splitting a file into elementary streams (though some
|
||||
files only contain one elementary stream).
|
||||
|
||||
A schematic representation of a demuxer looks like this:
|
||||
@verbatim
|
||||
┌──────────┬───────────────────────┐
|
||||
│ demuxer │ │ packets for stream 0
|
||||
╞══════════╡ elementary stream 0 ├──────────────────────►
|
||||
│ │ │
|
||||
│ global ├───────────────────────┤
|
||||
│properties│ │ packets for stream 1
|
||||
│ and │ elementary stream 1 ├──────────────────────►
|
||||
│ metadata │ │
|
||||
│ ├───────────────────────┤
|
||||
│ │ │
|
||||
│ │ ........... │
|
||||
│ │ │
|
||||
│ ├───────────────────────┤
|
||||
│ │ │ packets for stream N
|
||||
│ │ elementary stream N ├──────────────────────►
|
||||
│ │ │
|
||||
└──────────┴───────────────────────┘
|
||||
▲
|
||||
│
|
||||
│ read from file, network stream,
|
||||
│ grabbing device, etc.
|
||||
│
|
||||
_______ ______________
|
||||
| | | |
|
||||
| input | demuxer | encoded data | decoder
|
||||
| file | ---------> | packets | -----+
|
||||
|_______| |______________| |
|
||||
v
|
||||
_________
|
||||
| |
|
||||
| decoded |
|
||||
| frames |
|
||||
|_________|
|
||||
________ ______________ |
|
||||
| | | | |
|
||||
| output | <-------- | encoded data | <----+
|
||||
| file | muxer | packets | encoder
|
||||
|________| |______________|
|
||||
|
||||
|
||||
@end verbatim
|
||||
|
||||
@item
|
||||
@emph{Decoders} receive encoded (compressed) @emph{packets} for an audio, video,
|
||||
or subtitle elementary stream, and decode them into raw @emph{frames} (arrays of
|
||||
pixels for video, PCM for audio). A decoder is typically associated with (and
|
||||
receives its input from) an elementary stream in a @emph{demuxer}, but sometimes
|
||||
may also exist on its own (see @ref{Loopback decoders}).
|
||||
|
||||
A schematic representation of a decoder looks like this:
|
||||
@verbatim
|
||||
┌─────────┐
|
||||
packets │ │ raw frames
|
||||
─────────►│ decoder ├────────────►
|
||||
│ │
|
||||
└─────────┘
|
||||
@end verbatim
|
||||
|
||||
@item
|
||||
@emph{Filtergraphs} process and transform raw audio or video @emph{frames}. A
|
||||
filtergraph consists of one or more individual @emph{filters} linked into a
|
||||
graph. Filtergraphs come in two flavors - @emph{simple} and @emph{complex},
|
||||
configured with the @option{-filter} and @option{-filter_complex} options,
|
||||
respectively.
|
||||
|
||||
A simple filtergraph is associated with an @emph{output elementary stream}; it
|
||||
receives the input to be filtered from a @emph{decoder} and sends filtered
|
||||
output to that output stream's @emph{encoder}.
|
||||
|
||||
A simple video filtergraph that performs deinterlacing (using the @code{yadif}
|
||||
deinterlacer) followed by resizing (using the @code{scale} filter) can look like
|
||||
this:
|
||||
@verbatim
|
||||
|
||||
┌────────────────────────┐
|
||||
│ simple filtergraph │
|
||||
frames from ╞════════════════════════╡ frames for
|
||||
a decoder │ ┌───────┐ ┌───────┐ │ an encoder
|
||||
────────────►├─►│ yadif ├─►│ scale ├─►│────────────►
|
||||
│ └───────┘ └───────┘ │
|
||||
└────────────────────────┘
|
||||
@end verbatim
|
||||
|
||||
A complex filtergraph is standalone and not associated with any specific stream.
|
||||
It may have multiple (or zero) inputs, potentially of different types (audio or
|
||||
video), each of which receiving data either from a decoder or another complex
|
||||
filtergraph's output. It also has one or more outputs that feed either an
|
||||
encoder or another complex filtergraph's input.
|
||||
|
||||
The following example diagram represents a complex filtergraph with 3 inputs and
|
||||
2 outputs (all video):
|
||||
@verbatim
|
||||
┌─────────────────────────────────────────────────┐
|
||||
│ complex filtergraph │
|
||||
╞═════════════════════════════════════════════════╡
|
||||
frames ├───────┐ ┌─────────┐ ┌─────────┐ ┌────────┤ frames
|
||||
─────────►│input 0├─►│ overlay ├─────►│ overlay ├─►│output 0├────────►
|
||||
├───────┘ │ │ │ │ └────────┤
|
||||
frames ├───────┐╭►│ │ ╭►│ │ │
|
||||
─────────►│input 1├╯ └─────────┘ │ └─────────┘ │
|
||||
├───────┘ │ │
|
||||
frames ├───────┐ ┌─────┐ ┌─────┬─╯ ┌────────┤ frames
|
||||
─────────►│input 2├►│scale├►│split├───────────────►│output 1├────────►
|
||||
├───────┘ └─────┘ └─────┘ └────────┤
|
||||
└─────────────────────────────────────────────────┘
|
||||
@end verbatim
|
||||
Frames from second input are overlaid over those from the first. Frames from the
|
||||
third input are rescaled, then the duplicated into two identical streams. One of
|
||||
them is overlaid over the combined first two inputs, with the result exposed as
|
||||
the filtergraph's first output. The other duplicate ends up being the
|
||||
filtergraph's second output.
|
||||
|
||||
@item
|
||||
@emph{Encoders} receive raw audio, video, or subtitle @emph{frames} and encode
|
||||
them into encoded @emph{packets}. The encoding (compression) process is
|
||||
typically @emph{lossy} - it degrades stream quality to make the output smaller;
|
||||
some encoders are @emph{lossless}, but at the cost of much higher output size. A
|
||||
video or audio encoder receives its input from some filtergraph's output,
|
||||
subtitle encoders receive input from a decoder (since subtitle filtering is not
|
||||
supported yet). Every encoder is associated with some muxer's @emph{output
|
||||
elementary stream} and sends its output to that muxer.
|
||||
|
||||
A schematic representation of an encoder looks like this:
|
||||
@verbatim
|
||||
┌─────────┐
|
||||
raw frames │ │ packets
|
||||
────────────►│ encoder ├─────────►
|
||||
│ │
|
||||
└─────────┘
|
||||
@end verbatim
|
||||
|
||||
@item
|
||||
@emph{Muxers} (short for "multiplexers") receive encoded @emph{packets} for
|
||||
their elementary streams from encoders (the @emph{transcoding} path) or directly
|
||||
from demuxers (the @emph{streamcopy} path), interleave them (when there is more
|
||||
than one elementary stream), and write the resulting bytes into the output file
|
||||
(or pipe, network stream, etc.).
|
||||
|
||||
A schematic representation of a muxer looks like this:
|
||||
@verbatim
|
||||
┌──────────────────────┬───────────┐
|
||||
packets for stream 0 │ │ muxer │
|
||||
──────────────────────►│ elementary stream 0 ╞═══════════╡
|
||||
│ │ │
|
||||
├──────────────────────┤ global │
|
||||
packets for stream 1 │ │properties │
|
||||
──────────────────────►│ elementary stream 1 │ and │
|
||||
│ │ metadata │
|
||||
├──────────────────────┤ │
|
||||
│ │ │
|
||||
│ ........... │ │
|
||||
│ │ │
|
||||
├──────────────────────┤ │
|
||||
packets for stream N │ │ │
|
||||
──────────────────────►│ elementary stream N │ │
|
||||
│ │ │
|
||||
└──────────────────────┴─────┬─────┘
|
||||
│
|
||||
write to file, network stream, │
|
||||
grabbing device, etc. │
|
||||
│
|
||||
▼
|
||||
@end verbatim
|
||||
|
||||
@end itemize
|
||||
|
||||
@section Streamcopy
|
||||
The simplest pipeline in @command{ffmpeg} is single-stream
|
||||
@emph{streamcopy}, that is copying one @emph{input elementary stream}'s packets
|
||||
without decoding, filtering, or encoding them. As an example, consider an input
|
||||
file called @file{INPUT.mkv} with 3 elementary streams, from which we take the
|
||||
second and write it to file @file{OUTPUT.mp4}. A schematic representation of
|
||||
such a pipeline looks like this:
|
||||
@verbatim
|
||||
┌──────────┬─────────────────────┐
|
||||
│ demuxer │ │ unused
|
||||
╞══════════╡ elementary stream 0 ├────────╳
|
||||
│ │ │
|
||||
│INPUT.mkv ├─────────────────────┤ ┌──────────────────────┬───────────┐
|
||||
│ │ │ packets │ │ muxer │
|
||||
│ │ elementary stream 1 ├─────────►│ elementary stream 0 ╞═══════════╡
|
||||
│ │ │ │ │OUTPUT.mp4 │
|
||||
│ ├─────────────────────┤ └──────────────────────┴───────────┘
|
||||
│ │ │ unused
|
||||
│ │ elementary stream 2 ├────────╳
|
||||
│ │ │
|
||||
└──────────┴─────────────────────┘
|
||||
@end verbatim
|
||||
|
||||
The above pipeline can be constructed with the following commandline:
|
||||
@example
|
||||
ffmpeg -i INPUT.mkv -map 0:1 -c copy OUTPUT.mp4
|
||||
@end example
|
||||
|
||||
In this commandline
|
||||
@itemize
|
||||
|
||||
@item
|
||||
there is a single input @file{INPUT.mkv};
|
||||
|
||||
@item
|
||||
there are no input options for this input;
|
||||
|
||||
@item
|
||||
there is a single output @file{OUTPUT.mp4};
|
||||
|
||||
@item
|
||||
there are two output options for this output:
|
||||
|
||||
@itemize
|
||||
@item
|
||||
@code{-map 0:1} selects the input stream to be used - from input with index 0
|
||||
(i.e. the first one) the stream with index 1 (i.e. the second one);
|
||||
|
||||
@item
|
||||
@code{-c copy} selects the @code{copy} encoder, i.e. streamcopy with no decoding
|
||||
or encoding.
|
||||
@end itemize
|
||||
|
||||
@end itemize
|
||||
|
||||
Streamcopy is useful for changing the elementary stream count, container format,
|
||||
or modifying container-level metadata. 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 a variety of factors (e.g. certain information required by the
|
||||
target container is not available in the source). Applying filters is obviously
|
||||
also impossible, since filters work on decoded frames.
|
||||
|
||||
More complex streamcopy scenarios can be constructed - e.g. combining streams
|
||||
from two input files into a single output:
|
||||
@verbatim
|
||||
┌──────────┬────────────────────┐ ┌────────────────────┬───────────┐
|
||||
│ demuxer 0│ │ packets │ │ muxer │
|
||||
╞══════════╡elementary stream 0 ├────────►│elementary stream 0 ╞═══════════╡
|
||||
│INPUT0.mkv│ │ │ │OUTPUT.mp4 │
|
||||
└──────────┴────────────────────┘ ├────────────────────┤ │
|
||||
┌──────────┬────────────────────┐ │ │ │
|
||||
│ demuxer 1│ │ packets │elementary stream 1 │ │
|
||||
╞══════════╡elementary stream 0 ├────────►│ │ │
|
||||
│INPUT1.aac│ │ └────────────────────┴───────────┘
|
||||
└──────────┴────────────────────┘
|
||||
@end verbatim
|
||||
that can be built by the commandline
|
||||
@example
|
||||
ffmpeg -i INPUT0.mkv -i INPUT1.aac -map 0:0 -map 1:0 -c copy OUTPUT.mp4
|
||||
@end example
|
||||
|
||||
The output @option{-map} option is used twice here, creating two streams in the
|
||||
output file - one fed by the first input and one by the second. The single
|
||||
instance of the @option{-c} option selects streamcopy for both of those streams.
|
||||
You could also use multiple instances of this option together with
|
||||
@ref{Stream specifiers} to apply different values to each stream, as will be
|
||||
demonstrated in following sections.
|
||||
|
||||
A converse scenario is splitting multiple streams from a single input into
|
||||
multiple outputs:
|
||||
@verbatim
|
||||
┌──────────┬─────────────────────┐ ┌───────────────────┬───────────┐
|
||||
│ demuxer │ │ packets │ │ muxer 0 │
|
||||
╞══════════╡ elementary stream 0 ├─────────►│elementary stream 0╞═══════════╡
|
||||
│ │ │ │ │OUTPUT0.mp4│
|
||||
│INPUT.mkv ├─────────────────────┤ └───────────────────┴───────────┘
|
||||
│ │ │ packets ┌───────────────────┬───────────┐
|
||||
│ │ elementary stream 1 ├─────────►│ │ muxer 1 │
|
||||
│ │ │ │elementary stream 0╞═══════════╡
|
||||
└──────────┴─────────────────────┘ │ │OUTPUT1.mp4│
|
||||
└───────────────────┴───────────┘
|
||||
@end verbatim
|
||||
built with
|
||||
@example
|
||||
ffmpeg -i INPUT.mkv -map 0:0 -c copy OUTPUT0.mp4 -map 0:1 -c copy OUTPUT1.mp4
|
||||
@end example
|
||||
Note how a separate instance of the @option{-c} option is needed for every
|
||||
output file even though their values are the same. This is because non-global
|
||||
options (which is most of them) only apply in the context of the file before
|
||||
which they are placed.
|
||||
|
||||
These examples can of course be further generalized into arbitrary remappings
|
||||
of any number of inputs into any number of outputs.
|
||||
|
||||
@section Transcoding
|
||||
@emph{Transcoding} is the process of decoding a stream and then encoding it
|
||||
again. Since encoding tends to be computationally expensive and in most cases
|
||||
degrades the stream quality (i.e. it is @emph{lossy}), you should only transcode
|
||||
when you need to and perform streamcopy otherwise. Typical reasons to transcode
|
||||
are:
|
||||
|
||||
@itemize
|
||||
@item
|
||||
applying filters - e.g. resizing, deinterlacing, or overlaying video; resampling
|
||||
or mixing audio;
|
||||
|
||||
@item
|
||||
you want to feed the stream to something that cannot decode the original codec.
|
||||
@end itemize
|
||||
Note that @command{ffmpeg} will transcode all audio, video, and subtitle streams
|
||||
unless you specify @option{-c copy} for them.
|
||||
|
||||
Consider an example pipeline that reads an input file with one audio and one
|
||||
video stream, transcodes the video and copies the audio into a single output
|
||||
file. This can be schematically represented as follows
|
||||
@verbatim
|
||||
┌──────────┬─────────────────────┐
|
||||
│ demuxer │ │ audio packets
|
||||
╞══════════╡ stream 0 (audio) ├─────────────────────────────────────╮
|
||||
│ │ │ │
|
||||
│INPUT.mkv ├─────────────────────┤ video ┌─────────┐ raw │
|
||||
│ │ │ packets │ video │ video frames │
|
||||
│ │ stream 1 (video) ├─────────►│ decoder ├──────────────╮ │
|
||||
│ │ │ │ │ │ │
|
||||
└──────────┴─────────────────────┘ └─────────┘ │ │
|
||||
▼ ▼
|
||||
│ │
|
||||
┌──────────┬─────────────────────┐ video ┌─────────┐ │ │
|
||||
│ muxer │ │ packets │ video │ │ │
|
||||
╞══════════╡ stream 0 (video) │◄─────────┤ encoder ├──────────────╯ │
|
||||
│ │ │ │(libx264)│ │
|
||||
│OUTPUT.mp4├─────────────────────┤ └─────────┘ │
|
||||
│ │ │ │
|
||||
│ │ stream 1 (audio) │◄────────────────────────────────────╯
|
||||
│ │ │
|
||||
└──────────┴─────────────────────┘
|
||||
@end verbatim
|
||||
and implemented with the following commandline:
|
||||
@example
|
||||
ffmpeg -i INPUT.mkv -map 0:v -map 0:a -c:v libx264 -c:a copy OUTPUT.mp4
|
||||
@end example
|
||||
Note how it uses stream specifiers @code{:v} and @code{:a} to select input
|
||||
streams and apply different values of the @option{-c} option to them; see the
|
||||
@ref{Stream specifiers} section for more details.
|
||||
@command{ffmpeg} calls the libavformat library (containing demuxers) to read
|
||||
input files and get packets containing encoded data from them. When there are
|
||||
multiple input files, @command{ffmpeg} tries to keep them synchronized by
|
||||
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
|
||||
passed to the muxer, which writes the encoded packets to the output file.
|
||||
|
||||
@section Filtering
|
||||
|
||||
When transcoding, audio and video streams can be filtered before encoding, with
|
||||
either a @emph{simple} or @emph{complex} filtergraph.
|
||||
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:
|
||||
simple and complex.
|
||||
|
||||
@subsection Simple filtergraphs
|
||||
|
||||
Simple filtergraphs are those that have exactly one input and output, both of
|
||||
the same type (audio or video). They are configured with the per-stream
|
||||
@option{-filter} option (with @option{-vf} and @option{-af} aliases for
|
||||
@option{-filter:v} (video) and @option{-filter:a} (audio) respectively). Note
|
||||
that simple filtergraphs are tied to their output stream, so e.g. if you have
|
||||
multiple audio streams, @option{-af} will create a separate filtergraph for each
|
||||
one.
|
||||
the same type. In the above diagram they can be represented by simply inserting
|
||||
an additional step between decoding and encoding:
|
||||
|
||||
Taking the transcoding example from above, adding filtering (and omitting audio,
|
||||
for clarity) makes it look like this:
|
||||
@verbatim
|
||||
┌──────────┬───────────────┐
|
||||
│ demuxer │ │ ┌─────────┐
|
||||
╞══════════╡ video stream │ packets │ video │ frames
|
||||
│INPUT.mkv │ ├─────────►│ decoder ├─────►───╮
|
||||
│ │ │ └─────────┘ │
|
||||
└──────────┴───────────────┘ │
|
||||
╭───────────◄───────────╯
|
||||
│ ┌────────────────────────┐
|
||||
│ │ simple filtergraph │
|
||||
│ ╞════════════════════════╡
|
||||
│ │ ┌───────┐ ┌───────┐ │
|
||||
╰──►├─►│ yadif ├─►│ scale ├─►├╮
|
||||
│ └───────┘ └───────┘ ││
|
||||
└────────────────────────┘│
|
||||
│
|
||||
│
|
||||
┌──────────┬───────────────┐ video ┌─────────┐ │
|
||||
│ muxer │ │ packets │ video │ │
|
||||
╞══════════╡ video stream │◄─────────┤ encoder ├───────◄───────╯
|
||||
│OUTPUT.mp4│ │ │ │
|
||||
│ │ │ └─────────┘
|
||||
└──────────┴───────────────┘
|
||||
_________ ______________
|
||||
| | | |
|
||||
| decoded | | encoded data |
|
||||
| frames |\ _ | packets |
|
||||
|_________| \ /||______________|
|
||||
\ __________ /
|
||||
simple _\|| | / encoder
|
||||
filtergraph | filtered |/
|
||||
| frames |
|
||||
|__________|
|
||||
|
||||
@end verbatim
|
||||
|
||||
@subsection Complex filtergraphs
|
||||
Simple filtergraphs are configured with the per-stream @option{-filter} option
|
||||
(with @option{-vf} and @option{-af} aliases for video and audio respectively).
|
||||
A simple filtergraph for video can look for example like this:
|
||||
|
||||
@verbatim
|
||||
_______ _____________ _______ ________
|
||||
| | | | | | | |
|
||||
| input | ---> | deinterlace | ---> | scale | ---> | output |
|
||||
|_______| |_____________| |_______| |________|
|
||||
|
||||
@end verbatim
|
||||
|
||||
Note that some filters change frame properties but not frame contents. E.g. the
|
||||
@code{fps} filter in the example above changes number of frames, but does not
|
||||
touch the frame contents. Another example is the @code{setpts} filter, which
|
||||
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 more than one input and/or output, or when output stream type is
|
||||
different from input. Complex filtergraphs are configured with the
|
||||
@option{-filter_complex} option. Note that this option is global, since a
|
||||
complex filtergraph, by its nature, cannot be unambiguously associated with a
|
||||
single stream or file. Each instance of @option{-filter_complex} creates a new
|
||||
complex filtergraph, and there can be any number of them.
|
||||
processing chain applied to one stream. This is the case, for example, 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:
|
||||
|
||||
@verbatim
|
||||
_________
|
||||
| |
|
||||
| input 0 |\ __________
|
||||
|_________| \ | |
|
||||
\ _________ /| output 0 |
|
||||
\ | | / |__________|
|
||||
_________ \| complex | /
|
||||
| | | |/
|
||||
| input 1 |---->| filter |\
|
||||
|_________| | | \ __________
|
||||
/| graph | \ | |
|
||||
/ | | \| output 1 |
|
||||
_________ / |_________| |__________|
|
||||
| | /
|
||||
| input 2 |/
|
||||
|_________|
|
||||
|
||||
@end verbatim
|
||||
|
||||
Complex filtergraphs are configured with the @option{-filter_complex} option.
|
||||
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.
|
||||
|
||||
@anchor{Loopback decoders}
|
||||
@section Stream copy
|
||||
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:
|
||||
|
||||
@verbatim
|
||||
_______ ______________ ________
|
||||
| | | | | |
|
||||
| input | demuxer | encoded data | muxer | output |
|
||||
| file | ---------> | packets | -------> | file |
|
||||
|_______| |______________| |________|
|
||||
|
||||
@end verbatim
|
||||
|
||||
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
|
||||
filters is obviously also impossible, since filters work on uncompressed data.
|
||||
|
||||
@section Loopback decoders
|
||||
While decoders are normally associated with demuxer streams, it is also possible
|
||||
to create "loopback" decoders that decode the output from some encoder and allow
|
||||
|
|
@ -496,16 +229,12 @@ successive integers starting at zero. These indices should then be used to refer
|
|||
to loopback decoders in complex filtergraph link labels, as described in the
|
||||
documentation for @option{-filter_complex}.
|
||||
|
||||
Decoding AVOptions can be passed to loopback decoders by placing them before
|
||||
@code{-dec}, analogously to input/output options.
|
||||
|
||||
E.g. the following example:
|
||||
|
||||
@example
|
||||
ffmpeg -i INPUT \
|
||||
-map 0:v:0 -c:v libx264 -crf 45 -f null - \
|
||||
-threads 3 -dec 0:0 \
|
||||
-filter_complex '[0:v][dec:0]hstack[stack]' \
|
||||
-dec 0:0 -filter_complex '[0:v][dec:0]hstack[stack]' \
|
||||
-map '[stack]' -c:v ffv1 OUTPUT
|
||||
@end example
|
||||
|
||||
|
|
@ -515,52 +244,17 @@ reads an input video and
|
|||
(line 2) encodes it with @code{libx264} at low quality;
|
||||
|
||||
@item
|
||||
(line 3) decodes this encoded stream using 3 threads;
|
||||
(line 3) decodes this encoded stream and places it side by side with the
|
||||
original input video;
|
||||
|
||||
@item
|
||||
(line 4) places decoded video side by side with the original input video;
|
||||
|
||||
@item
|
||||
(line 5) combined video is then losslessly encoded and written into
|
||||
(line 4) combined video is then losslessly encoded and written into
|
||||
@file{OUTPUT}.
|
||||
|
||||
@end itemize
|
||||
|
||||
Such a transcoding pipeline can be represented with the following diagram:
|
||||
@verbatim
|
||||
┌──────────┬───────────────┐
|
||||
│ demuxer │ │ ┌─────────┐ ┌─────────┐ ┌────────────────────┐
|
||||
╞══════════╡ video stream │ │ video │ │ video │ │ null muxer │
|
||||
│ INPUT │ ├──►│ decoder ├──┬────────►│ encoder ├─┬─►│(discards its input)│
|
||||
│ │ │ └─────────┘ │ │(libx264)│ │ └────────────────────┘
|
||||
└──────────┴───────────────┘ │ └─────────┘ │
|
||||
╭───────◄──╯ ┌─────────┐ │
|
||||
│ │loopback │ │
|
||||
│ ╭─────◄──────┤ decoder ├────◄──╯
|
||||
│ │ └─────────┘
|
||||
│ │
|
||||
│ │
|
||||
│ │ ┌───────────────────┐
|
||||
│ │ │complex filtergraph│
|
||||
│ │ ╞═══════════════════╡
|
||||
│ │ │ ┌─────────────┐ │
|
||||
╰─╫─►├─►│ hstack ├─►├╮
|
||||
╰─►├─►│ │ ││
|
||||
│ └─────────────┘ ││
|
||||
└───────────────────┘│
|
||||
│
|
||||
┌──────────┬───────────────┐ ┌─────────┐ │
|
||||
│ muxer │ │ │ video │ │
|
||||
╞══════════╡ video stream │◄─┤ encoder ├───────◄──────────╯
|
||||
│ OUTPUT │ │ │ (ffv1) │
|
||||
│ │ │ └─────────┘
|
||||
└──────────┴───────────────┘
|
||||
@end verbatim
|
||||
|
||||
|
||||
@c man end DETAILED DESCRIPTION
|
||||
|
||||
@anchor{Stream selection}
|
||||
@chapter Stream selection
|
||||
@c man begin STREAM SELECTION
|
||||
|
||||
|
|
@ -921,25 +615,24 @@ ffmpeg -i INPUT -metadata:s:a:0 language=eng OUTPUT
|
|||
@end example
|
||||
|
||||
@item -disposition[:stream_specifier] @var{value} (@emph{output,per-stream})
|
||||
Sets the disposition flags for a stream.
|
||||
Sets the disposition for a stream.
|
||||
|
||||
Default value: by default, all disposition flags are copied from the input stream,
|
||||
unless the output stream this option applies to is fed by a complex filtergraph
|
||||
- in that case no disposition flags are set by default.
|
||||
By default, the disposition is copied from the input stream, unless the output
|
||||
stream this option applies to is fed by a complex filtergraph - in that case the
|
||||
disposition is unset by default.
|
||||
|
||||
@var{value} is a sequence of disposition flags separated by '+' or '-'. A '+'
|
||||
prefix adds the given disposition, '-' removes it. If the first flag is also
|
||||
prefixed with '+' or '-', the resulting disposition is the default value
|
||||
updated by @var{value}. If the first flag is not prefixed, the resulting
|
||||
disposition is @var{value}. It is also possible to clear the disposition by
|
||||
setting it to 0.
|
||||
@var{value} is a sequence of items separated by '+' or '-'. The first item may
|
||||
also be prefixed with '+' or '-', in which case this option modifies the default
|
||||
value. Otherwise (the first item is not prefixed) this options overrides the
|
||||
default value. A '+' prefix adds the given disposition, '-' removes it. It is
|
||||
also possible to clear the disposition by setting it to 0.
|
||||
|
||||
If no @code{-disposition} options were specified for an output file, ffmpeg will
|
||||
automatically set the 'default' disposition flag on the first stream of each type,
|
||||
automatically set the 'default' disposition on the first stream of each type,
|
||||
when there are multiple streams of this type in the output file and no stream of
|
||||
that type is already marked as default.
|
||||
|
||||
The @code{-dispositions} option lists the known disposition flags.
|
||||
The @code{-dispositions} option lists the known dispositions.
|
||||
|
||||
For example, to make the second audio stream the default stream:
|
||||
@example
|
||||
|
|
@ -957,29 +650,6 @@ To add an embedded cover/thumbnail:
|
|||
ffmpeg -i in.mp4 -i IMAGE -map 0 -map 1 -c copy -c:v:1 png -disposition:v:1 attached_pic out.mp4
|
||||
@end example
|
||||
|
||||
To add the 'original' and remove the 'comment' disposition flag from the first
|
||||
audio stream without removing its other disposition flags:
|
||||
@example
|
||||
ffmpeg -i in.mkv -c copy -disposition:a:0 +original-comment out.mkv
|
||||
@end example
|
||||
|
||||
To remove the 'original' and add the 'comment' disposition flag to the first
|
||||
audio stream without removing its other disposition flags:
|
||||
@example
|
||||
ffmpeg -i in.mkv -c copy -disposition:a:0 -original+comment out.mkv
|
||||
@end example
|
||||
|
||||
To set only the 'original' and 'comment' disposition flags on the first audio
|
||||
stream (and remove its other disposition flags):
|
||||
@example
|
||||
ffmpeg -i in.mkv -c copy -disposition:a:0 original+comment out.mkv
|
||||
@end example
|
||||
|
||||
To remove all disposition flags from the first audio stream:
|
||||
@example
|
||||
ffmpeg -i in.mkv -c copy -disposition:a:0 0 out.mkv
|
||||
@end example
|
||||
|
||||
Not all muxers support embedded thumbnails, and those who do, only support a few formats, like JPEG or PNG.
|
||||
|
||||
@item -program [title=@var{title}:][program_num=@var{program_num}:]st=@var{stream}[:st=@var{stream}...] (@emph{output})
|
||||
|
|
@ -987,11 +657,10 @@ Not all muxers support embedded thumbnails, and those who do, only support a few
|
|||
Creates a program with the specified @var{title}, @var{program_num} and adds the specified
|
||||
@var{stream}(s) to it.
|
||||
|
||||
@item -stream_group [map=@var{input_file_id}=@var{stream_group}][type=@var{type}:]st=@var{stream}[:st=@var{stream}][:stg=@var{stream_group}][:id=@var{stream_group_id}...] (@emph{output})
|
||||
@item -stream_group type=@var{type}:st=@var{stream}[:st=@var{stream}][:stg=@var{stream_group}][:id=@var{stream_group_id}...] (@emph{output})
|
||||
|
||||
Creates a stream group of the specified @var{type} and @var{stream_group_id}, or by
|
||||
@var{map}ping an input group, adding the specified @var{stream}(s) and/or previously
|
||||
defined @var{stream_group}(s) to it.
|
||||
Creates a stream group of the specified @var{type}, @var{stream_group_id} and adds the specified
|
||||
@var{stream}(s) and/or previously defined @var{stream_group}(s) to it.
|
||||
|
||||
@var{type} can be one of the following:
|
||||
@table @option
|
||||
|
|
@ -1048,7 +717,7 @@ The following flags are available:
|
|||
|
||||
@table @option
|
||||
@item recon_gain
|
||||
Whether to signal if recon_gain is present as metadata in parameter blocks within frames
|
||||
Wether to signal if recon_gain is present as metadata in parameter blocks within frames
|
||||
@end table
|
||||
|
||||
@item output_gain
|
||||
|
|
@ -1188,27 +857,6 @@ all sub-mix element's @var{annotations}s
|
|||
|
||||
@end table
|
||||
|
||||
E.g. to create an scalable 5.1 IAMF file from several WAV input files
|
||||
@example
|
||||
ffmpeg -i front.wav -i back.wav -i center.wav -i lfe.wav
|
||||
-map 0:0 -map 1:0 -map 2:0 -map 3:0 -c:a opus
|
||||
-stream_group type=iamf_audio_element:id=1:st=0:st=1:st=2:st=3,
|
||||
demixing=parameter_id=998,
|
||||
recon_gain=parameter_id=101,
|
||||
layer=ch_layout=stereo,
|
||||
layer=ch_layout=5.1(side),
|
||||
-stream_group type=iamf_mix_presentation:id=2:stg=0:annotations=en-us=Mix_Presentation,
|
||||
submix=parameter_id=100:parameter_rate=48000|element=stg=0:parameter_id=100:annotations=en-us=Scalable_Submix|layout=sound_system=stereo|layout=sound_system=5.1(side)
|
||||
-streamid 0:0 -streamid 1:1 -streamid 2:2 -streamid 3:3 output.iamf
|
||||
@end example
|
||||
|
||||
To copy the two stream groups (Audio Element and Mix Presentation) from an input IAMF file with four
|
||||
streams into an mp4 output
|
||||
@example
|
||||
ffmpeg -i input.iamf -c:a copy -stream_group map=0=0:st=0:st=1:st=2:st=3 -stream_group map=0=1:stg=0
|
||||
-streamid 0:0 -streamid 1:1 -streamid 2:2 -streamid 3:3 output.mp4
|
||||
@end example
|
||||
|
||||
@item -target @var{type} (@emph{output})
|
||||
Specify target file type (@code{vcd}, @code{svcd}, @code{dvd}, @code{dv},
|
||||
@code{dv50}). @var{type} may be prefixed with @code{pal-}, @code{ntsc-} or
|
||||
|
|
@ -1373,62 +1021,31 @@ The properties where a change triggers reinitialization are,
|
|||
for video, frame resolution or pixel format;
|
||||
for audio, sample format, sample rate, channel count or channel layout.
|
||||
|
||||
@item -drop_changed[:@var{stream_specifier}] @var{integer} (@emph{input,per-stream})
|
||||
This boolean option determines whether a frame with differing frame parameters mid-stream
|
||||
gets dropped instead of leading to filtergraph reinitialization, as that would lead to loss
|
||||
of filter state. Generally useful to avoid corrupted yet decodable packets in live streaming
|
||||
inputs. Default is false.
|
||||
|
||||
@item -filter_threads @var{nb_threads} (@emph{global})
|
||||
Defines how many threads are used to process a filter pipeline. Each pipeline
|
||||
will produce a thread pool with this many threads available for parallel processing.
|
||||
The default is the number of available CPUs.
|
||||
|
||||
@item -filter_buffered_frames @var{nb_frames} (@emph{global})
|
||||
Defines the maximum number of buffered frames allowed in a filtergraph. Under
|
||||
normal circumstances, a filtergraph should not buffer more than a few frames,
|
||||
especially if frames are being fed to it and read from it in a balanced way
|
||||
(which is the intended behavior in ffmpeg). That said, this option allows you
|
||||
to limit the total number of frames buffered across all links in a filtergraph.
|
||||
If more frames are generated, filtering is aborted and an error is returned.
|
||||
The default value is 0, which means no limit.
|
||||
|
||||
@item -pre[:@var{stream_specifier}] @var{preset_name} (@emph{output,per-stream})
|
||||
Specify the preset for matching stream(s).
|
||||
|
||||
@item -stats (@emph{global})
|
||||
Log encoding progress/statistics as "info"-level log (see @code{-loglevel}).
|
||||
It is on by default, to explicitly disable it you need to specify @code{-nostats}.
|
||||
Print encoding progress/statistics. It is on by default, to explicitly
|
||||
disable it you need to specify @code{-nostats}.
|
||||
|
||||
@item -stats_period @var{time} (@emph{global})
|
||||
Set period at which encoding progress/statistics are updated. Default is 0.5 seconds.
|
||||
|
||||
@item -print_graphs (@emph{global})
|
||||
Prints execution graph details to stderr in the format set via -print_graphs_format.
|
||||
|
||||
@item -print_graphs_file @var{filename} (@emph{global})
|
||||
Writes execution graph details to the specified file in the format set via -print_graphs_format.
|
||||
|
||||
@item -print_graphs_format @var{format} (@emph{global})
|
||||
Sets the output format (available formats are: default, compact, csv, flat, ini, json, xml, mermaid, mermaidhtml)
|
||||
The default format is json.
|
||||
|
||||
@item -progress @var{url} (@emph{global})
|
||||
Send program-friendly progress information to @var{url}.
|
||||
|
||||
Progress information is written periodically and at the end of
|
||||
the encoding process. It is made of "@var{key}=@var{value}" lines. @var{key}
|
||||
consists of only alphanumeric characters. The last key of a sequence of
|
||||
progress information is always "progress" with the value "continue" or "end".
|
||||
progress information is always "progress".
|
||||
|
||||
The update period is set using @code{-stats_period}.
|
||||
|
||||
For example, log progress information to stdout:
|
||||
|
||||
@example
|
||||
ffmpeg -progress pipe:1 -i in.mkv out.mkv
|
||||
@end example
|
||||
|
||||
@anchor{stdin option}
|
||||
@item -stdin
|
||||
Enable interaction on standard input. On by default unless standard input is
|
||||
|
|
@ -1734,21 +1351,6 @@ 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.
|
||||
|
||||
@item -apply_cropping[:@var{stream_specifier}] @var{source} (@emph{input,per-stream})
|
||||
Automatically crop the video after decoding according to file metadata.
|
||||
Default is @emph{all}.
|
||||
|
||||
@table @option
|
||||
@item none (0)
|
||||
Don't apply any cropping metadata.
|
||||
@item all (1)
|
||||
Apply both codec and container level croppping. This is the default mode.
|
||||
@item codec (2)
|
||||
Apply codec level croppping.
|
||||
@item container (3)
|
||||
Apply container level croppping.
|
||||
@end table
|
||||
|
||||
@item -copyinkf[:@var{stream_specifier}] (@emph{output,per-stream})
|
||||
When doing stream copy, copy also non-key frames found at the
|
||||
beginning.
|
||||
|
|
@ -1813,11 +1415,6 @@ The following options are recognized:
|
|||
When @var{device} is not specified, use this option to specify the name of the kernel
|
||||
driver associated with the desired device. This option is available only when
|
||||
the hardware acceleration method @emph{drm} and @emph{vaapi} are enabled.
|
||||
@item vendor_id
|
||||
When @var{device} and @var{kernel_driver} are not specified, use this option to specify
|
||||
the vendor id associated with the desired device. This option is available only when the
|
||||
hardware acceleration method @emph{drm} and @emph{vaapi} are enabled and @emph{kernel_driver}
|
||||
is not specified.
|
||||
@end table
|
||||
|
||||
Examples:
|
||||
|
|
@ -1833,9 +1430,6 @@ Create a vaapi device on DirectX adapter 1.
|
|||
|
||||
@item -init_hw_device vaapi:,kernel_driver=i915
|
||||
Create a vaapi device on a device associated with kernel driver @samp{i915}.
|
||||
|
||||
@item -init_hw_device vaapi:,vendor_id=0x8086
|
||||
Create a vaapi device on a device associated with vendor id @samp{0x8086}.
|
||||
@end table
|
||||
|
||||
@item vdpau
|
||||
|
|
@ -2010,9 +1604,6 @@ transcoding, without copying the frames into the system memory.
|
|||
|
||||
For it to work, both the decoder and the encoder must support QSV acceleration
|
||||
and no filters must be used.
|
||||
|
||||
@item videotoolbox
|
||||
Use Video Toolbox hardware acceleration.
|
||||
@end table
|
||||
|
||||
This option has no effect if the selected hwaccel is not available or not
|
||||
|
|
@ -2100,21 +1691,12 @@ This is an alias for @code{-filter:a}, see the @ref{filter_option,,-filter optio
|
|||
@table @option
|
||||
@item -atag @var{fourcc/tag} (@emph{output})
|
||||
Force audio tag/fourcc. This is an alias for @code{-tag:a}.
|
||||
@item -ch_layout[:@var{stream_specifier}] @var{layout} (@emph{input/output,per-stream})
|
||||
Alias for @code{-channel_layout}.
|
||||
@item -channel_layout[:@var{stream_specifier}] @var{layout} (@emph{input/output,per-stream})
|
||||
Set the audio channel layout. For output streams it is set by default to the
|
||||
input channel layout. For input streams it overrides the channel layout of the
|
||||
input. Not all decoders respect the overridden channel layout. This option
|
||||
also sets the channel layout for audio grabbing devices and raw demuxers
|
||||
and is mapped to the corresponding demuxer option.
|
||||
@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. Using the @code{-channel_layout} option to
|
||||
explicitly specify an input layout also disables guessing.
|
||||
0 to disable all guessing.
|
||||
@end table
|
||||
|
||||
@section Subtitle options
|
||||
|
|
@ -2157,7 +1739,7 @@ Set the size of the canvas used to render subtitles.
|
|||
@section Advanced options
|
||||
|
||||
@table @option
|
||||
@item -map [-]@var{input_file_id}[:@var{stream_specifier}][:@var{view_specifier}][:?] | @var{[linklabel]} (@emph{output})
|
||||
@item -map [-]@var{input_file_id}[:@var{stream_specifier}][?] | @var{[linklabel]} (@emph{output})
|
||||
|
||||
Create one or more streams in the output file. This option has two forms for
|
||||
specifying the data source(s): the first selects one or more streams from some
|
||||
|
|
@ -2172,26 +1754,6 @@ only those streams that match the specifier are used (see the
|
|||
A @code{-} character before the stream identifier creates a "negative" mapping.
|
||||
It disables matching streams from already created mappings.
|
||||
|
||||
An optional @var{view_specifier} may be given after the stream specifier, which
|
||||
for multiview video specifies the view to be used. The view specifier may have
|
||||
one of the following formats:
|
||||
@table @option
|
||||
@item view:@var{view_id}
|
||||
select a view by its ID; @var{view_id} may be set to 'all' to use all the views
|
||||
interleaved into one stream;
|
||||
|
||||
@item vidx:@var{view_idx}
|
||||
select a view by its index; i.e. 0 is the base view, 1 is the first non-base
|
||||
view, etc.
|
||||
|
||||
@item vpos:@var{position}
|
||||
select a view by its display position; @var{position} may be @code{left} or
|
||||
@code{right}
|
||||
@end table
|
||||
The default for transcoding is to only use the base view, i.e. the equivalent of
|
||||
@code{vidx:0}. For streamcopy, view specifiers are not supported and all views
|
||||
are always copied.
|
||||
|
||||
A trailing @code{?} after the stream index will allow the map to be
|
||||
optional: if the map matches no streams the map will be ignored instead
|
||||
of failing. Note the map will still fail if an invalid input file index
|
||||
|
|
@ -2353,11 +1915,6 @@ Read input at native frame rate. This is equivalent to setting @code{-readrate 1
|
|||
@item -readrate_initial_burst @var{seconds}
|
||||
Set an initial read burst time, in seconds, after which @option{-re/-readrate}
|
||||
will be enforced.
|
||||
@item -readrate_catchup @var{speed} (@emph{input})
|
||||
If either the input or output is blocked leading to actual read speed falling behind the
|
||||
specified readrate, then this rate takes effect till the input catches up with the
|
||||
specified readrate. Must not be lower than the primary readrate.
|
||||
|
||||
@item -vsync @var{parameter} (@emph{global})
|
||||
@itemx -fps_mode[:@var{stream_specifier}] @var{parameter} (@emph{output,per-stream})
|
||||
Set video sync method / framerate mode. vsync is applied to all output video streams
|
||||
|
|
@ -2580,68 +2137,15 @@ Define a complex filtergraph, 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
|
||||
ffmpeg-filters manual. This option may be specified multiple times - each use
|
||||
creates a new complex filtergraph.
|
||||
ffmpeg-filters manual.
|
||||
|
||||
Inputs to a complex filtergraph may come from different source types,
|
||||
distinguished by the format of the corresponding link label:
|
||||
@itemize
|
||||
@item
|
||||
To connect an input stream, use @code{[file_index:stream_specifier]} (i.e. the
|
||||
same syntax as @option{-map}). If @var{stream_specifier} matches multiple
|
||||
streams, the first one will be used. For multiview video, the stream specifier
|
||||
may be followed by the view specifier, see documentation for the @option{-map}
|
||||
option for its syntax.
|
||||
Input link labels must refer to either input streams or loopback decoders. For
|
||||
input streams, use the @code{[file_index:stream_specifier]} syntax (i.e. the
|
||||
same as @option{-map} uses). If @var{stream_specifier} matches multiple streams,
|
||||
the first one will be used.
|
||||
|
||||
@item
|
||||
To connect a loopback decoder use [dec:@var{dec_idx}], where @var{dec_idx} is
|
||||
the index of the loopback decoder to be connected to given input. For multiview
|
||||
video, the decoder index may be followed by the view specifier, see
|
||||
documentation for the @option{-map} option for its syntax.
|
||||
|
||||
@item
|
||||
To connect an output from another complex filtergraph, use its link label. E.g
|
||||
the following example:
|
||||
|
||||
@example
|
||||
ffmpeg -i input.mkv \
|
||||
-filter_complex '[0:v]scale=size=hd1080,split=outputs=2[for_enc][orig_scaled]' \
|
||||
-c:v libx264 -map '[for_enc]' output.mkv \
|
||||
-dec 0:0 \
|
||||
-filter_complex '[dec:0][orig_scaled]hstack[stacked]' \
|
||||
-map '[stacked]' -c:v ffv1 comparison.mkv
|
||||
@end example
|
||||
|
||||
reads an input video and
|
||||
@itemize
|
||||
@item
|
||||
(line 2) uses a complex filtergraph with one input and two outputs
|
||||
to scale the video to 1920x1080 and duplicate the result to both
|
||||
outputs;
|
||||
|
||||
@item
|
||||
(line 3) encodes one scaled output with @code{libx264} and writes the result to
|
||||
@file{output.mkv};
|
||||
|
||||
@item
|
||||
(line 4) decodes this encoded stream with a loopback decoder;
|
||||
|
||||
@item
|
||||
(line 5) places the output of the loopback decoder (i.e. the
|
||||
@code{libx264}-encoded video) side by side with the scaled original input;
|
||||
|
||||
@item
|
||||
(line 6) combined video is then losslessly encoded and written into
|
||||
@file{comparison.mkv}.
|
||||
|
||||
@end itemize
|
||||
|
||||
Note that the two filtergraphs cannot be combined into one, because then there
|
||||
would be a cycle in the transcoding pipeline (filtergraph output goes to
|
||||
encoding, from there to decoding, then back to the same graph), and such cycles
|
||||
are not allowed.
|
||||
|
||||
@end itemize
|
||||
For decoders, the link label must be [dec:@var{dec_idx}], where @var{dec_idx} is
|
||||
the index of the loopback decoder to be connected to given input.
|
||||
|
||||
An unlabeled input will be connected to the first unused input stream of the
|
||||
matching type.
|
||||
|
|
|
|||
|
|
@ -139,6 +139,13 @@ stream.
|
|||
All the container format information is printed within a section with
|
||||
name "FORMAT".
|
||||
|
||||
@item -show_format_entry @var{name}
|
||||
Like @option{-show_format}, but only prints the specified entry of the
|
||||
container format information, rather than all. This option may be given more
|
||||
than once, then all specified entries will be shown.
|
||||
|
||||
This option is deprecated, use @code{show_entries} instead.
|
||||
|
||||
@item -show_entries @var{section_entries}
|
||||
Set list of entries to show.
|
||||
|
||||
|
|
@ -344,19 +351,6 @@ while other writers always print them. This option enables one to control this b
|
|||
Valid values are @code{always}/@code{1}, @code{never}/@code{0} and @code{auto}/@code{-1}.
|
||||
Default is @var{auto}.
|
||||
|
||||
@item -analyze_frames
|
||||
Analyze frames and/or their side data up to the provided read interval,
|
||||
providing additional information that may be useful at a stream level.
|
||||
Must be paired with the @option{-show_streams} option or it will have no effect.
|
||||
|
||||
Currently, the additional fields provided by this option when enabled are the
|
||||
@code{closed_captions} and @code{film_grain} fields.
|
||||
|
||||
For example, to analyze the first 20 seconds and populate these fields:
|
||||
@example
|
||||
ffprobe -show_streams -analyze_frames -read_intervals "%+20" INPUT
|
||||
@end example
|
||||
|
||||
@item -bitexact
|
||||
Force bitexact output, useful to produce output which is not dependent
|
||||
on the specific build.
|
||||
|
|
@ -368,12 +362,6 @@ Read @var{input_url}.
|
|||
Write output to @var{output_url}. If not specified, the output is sent
|
||||
to stdout.
|
||||
|
||||
@item -c:@var{media_specifier} @var{codec_name}
|
||||
@itemx -codec:@var{media_specifier} @var{codec_name}
|
||||
Force a specific decoder implementation for the stream identified by
|
||||
@var{media_specifier}, which can assume the values @code{a} (audio),
|
||||
@code{v} (video), @code{s} (subtitle), and @code{d} (data).
|
||||
|
||||
@end table
|
||||
@c man end
|
||||
|
||||
|
|
|
|||
|
|
@ -129,7 +129,6 @@
|
|||
<xsd:attribute name="pict_type" type="xsd:string"/>
|
||||
<xsd:attribute name="interlaced_frame" type="xsd:int" />
|
||||
<xsd:attribute name="top_field_first" type="xsd:int" />
|
||||
<xsd:attribute name="lossless" type="xsd:int" />
|
||||
<xsd:attribute name="repeat_pict" type="xsd:int" />
|
||||
<xsd:attribute name="color_range" type="xsd:string"/>
|
||||
<xsd:attribute name="color_space" type="xsd:string"/>
|
||||
|
|
@ -256,7 +255,6 @@
|
|||
<xsd:attribute name="metadata" type="xsd:int" use="required" />
|
||||
<xsd:attribute name="dependent" type="xsd:int" use="required" />
|
||||
<xsd:attribute name="still_image" type="xsd:int" use="required" />
|
||||
<xsd:attribute name="multilayer" type="xsd:int" use="required" />
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="streamType">
|
||||
|
|
|
|||
|
|
@ -78,12 +78,7 @@ Match the stream by stream id (e.g. PID in MPEG-TS container).
|
|||
@item m:@var{key}[:@var{value}]
|
||||
Matches streams with the metadata tag @var{key} having the specified value. If
|
||||
@var{value} is not given, matches streams that contain the given tag with any
|
||||
value. The colon character ':' in @var{key} or @var{value} needs to be
|
||||
backslash-escaped.
|
||||
@item disp:@var{dispositions}[:@var{additional_stream_specifier}]
|
||||
Matches streams with the given disposition(s). @var{dispositions} is a list of
|
||||
one or more dispositions (as printed by the @option{-dispositions} option)
|
||||
joined with '+'.
|
||||
value.
|
||||
@item u
|
||||
Matches streams with usable configuration, the codec must be defined and the
|
||||
essential information such as video dimension or audio sample rate must be present.
|
||||
|
|
@ -226,10 +221,6 @@ and the "Last message repeated n times" line will be omitted.
|
|||
Indicates that log output should add a @code{[level]} prefix to each message
|
||||
line. This can be used as an alternative to log coloring, e.g. when dumping the
|
||||
log to file.
|
||||
@item time
|
||||
Indicates that log lines should be prefixed with time information.
|
||||
@item datetime
|
||||
Indicates that log lines should be prefixed with date and time information.
|
||||
@end table
|
||||
Flags can also be used alone by adding a '+'/'-' prefix to set/reset a single
|
||||
flag without affecting other @var{flags} or changing @var{loglevel}. When
|
||||
|
|
|
|||
|
|
@ -214,7 +214,6 @@ Frame scheduling
|
|||
FF_FILTER_FORWARD_STATUS(inlink, outlink);
|
||||
FF_FILTER_FORWARD_STATUS_ALL(inlink, filter);
|
||||
FF_FILTER_FORWARD_WANTED(outlink, inlink);
|
||||
FF_FILTER_FORWARD_WANTED_ANY(filter, inlink);
|
||||
|
||||
filter_frame
|
||||
------------
|
||||
|
|
|
|||
2777
doc/filters.texi
2777
doc/filters.texi
File diff suppressed because it is too large
Load diff
|
|
@ -225,26 +225,9 @@ Specifies the maximum number of streams. This can be used to reject files that
|
|||
would require too many resources due to a large number of streams.
|
||||
|
||||
@item skip_estimate_duration_from_pts @var{bool} (@emph{input})
|
||||
Skip estimation of input duration if it requires an additional probing for PTS at end of file.
|
||||
Skip estimation of input duration when calculated using PTS.
|
||||
At present, applicable for MPEG-PS and MPEG-TS.
|
||||
|
||||
@item duration_probesize @var{integer} (@emph{input})
|
||||
Set probing size, in bytes, for input duration estimation when it actually requires
|
||||
an additional probing for PTS at end of file (at present: MPEG-PS and MPEG-TS).
|
||||
It is aimed at users interested in better durations probing for itself, or indirectly
|
||||
because using the concat demuxer, for example.
|
||||
The typical use case is an MPEG-TS CBR with a high bitrate, high video buffering and
|
||||
ending cleaning with similar PTS for video and audio: in such a scenario, the large
|
||||
physical gap between the last video packet and the last audio packet makes it necessary
|
||||
to read many bytes in order to get the video stream duration.
|
||||
Another use case is where the default probing behaviour only reaches a single video frame which is
|
||||
not the last one of the stream due to frame reordering, so the duration is not accurate.
|
||||
Setting this option has a performance impact even for small files because the probing
|
||||
size is fixed.
|
||||
Default behaviour is a general purpose trade-off, largely adaptive, but the probing size
|
||||
will not be extended to get streams durations at all costs.
|
||||
Must be an integer not lesser than 1, or 0 for default behaviour.
|
||||
|
||||
@item strict, f_strict @var{integer} (@emph{input/output})
|
||||
Specify how strictly to follow the standards. @code{f_strict} is deprecated and
|
||||
should be used only via the @command{ffmpeg} tool.
|
||||
|
|
|
|||
|
|
@ -160,19 +160,6 @@ Go to @url{http://lame.sourceforge.net/} and follow the
|
|||
instructions for installing the library.
|
||||
Then pass @code{--enable-libmp3lame} to configure to enable it.
|
||||
|
||||
@section LCEVCdec
|
||||
|
||||
FFmpeg can make use of the liblcevc_dec library for LCEVC enhancement layer
|
||||
decoding on supported bitstreams.
|
||||
|
||||
Go to @url{https://github.com/v-novaltd/LCEVCdec} and follow the instructions
|
||||
for installing the library. Then pass @code{--enable-liblcevc-dec} to configure to
|
||||
enable it.
|
||||
|
||||
@float NOTE
|
||||
LCEVCdec is under the BSD-3-Clause-Clear License.
|
||||
@end float
|
||||
|
||||
@section libilbc
|
||||
|
||||
iLBC is a narrowband speech codec that has been made freely available
|
||||
|
|
@ -250,14 +237,6 @@ Go to @url{http://sourceforge.net/projects/opencore-amr/} and follow the
|
|||
instructions for installing the library.
|
||||
Then pass @code{--enable-libfdk-aac} to configure to enable it.
|
||||
|
||||
@subsection LC3 library
|
||||
|
||||
FFmpeg can make use of the Google LC3 library for LC3 decoding & encoding.
|
||||
|
||||
Go to @url{https://github.com/google/liblc3/} and follow the instructions for
|
||||
installing the library.
|
||||
Then pass @code{--enable-liblc3} to configure to enable it.
|
||||
|
||||
@section OpenH264
|
||||
|
||||
FFmpeg can make use of the OpenH264 library for H.264 decoding and encoding.
|
||||
|
|
@ -625,7 +604,6 @@ library:
|
|||
@item raw AMR-NB @tab @tab X
|
||||
@item raw AMR-WB @tab @tab X
|
||||
@item raw APAC @tab @tab X
|
||||
@item raw APV @tab X @tab X
|
||||
@item raw aptX @tab X @tab X
|
||||
@item raw aptX HD @tab X @tab X
|
||||
@item raw Bonk @tab @tab X
|
||||
|
|
@ -638,7 +616,6 @@ library:
|
|||
@item raw E-AC-3 @tab X @tab X
|
||||
@item raw EVC @tab X @tab X
|
||||
@item raw FLAC @tab X @tab X
|
||||
@item raw G.728 @tab @tab X
|
||||
@item raw GSM @tab @tab X
|
||||
@item raw H.261 @tab X @tab X
|
||||
@item raw H.263 @tab X @tab X
|
||||
|
|
@ -897,7 +874,6 @@ following image formats are supported:
|
|||
@tab fourcc: apch,apcn,apcs,apco,ap4h,ap4x
|
||||
@item Apple QuickDraw @tab @tab X
|
||||
@tab fourcc: qdrw
|
||||
@item APV @tab @tab X
|
||||
@item Argonaut Video @tab @tab X
|
||||
@tab Used in some Argonaut games.
|
||||
@item Asus v1 @tab X @tab X
|
||||
|
|
@ -1039,8 +1015,6 @@ following image formats are supported:
|
|||
@item Kega Game Video (KGV1) @tab @tab X
|
||||
@tab Kega emulator screen capture codec.
|
||||
@item Lagarith @tab @tab X
|
||||
@item LCEVC / MPEG-5 LCEVC / MPEG-5 Part 2 @tab @tab E
|
||||
@tab decoding supported through external library liblcevc-dec
|
||||
@item LCL (LossLess Codec Library) MSZH @tab @tab X
|
||||
@item LCL (LossLess Codec Library) ZLIB @tab E @tab E
|
||||
@item LEAD MCMP @tab @tab X
|
||||
|
|
@ -1112,7 +1086,6 @@ following image formats are supported:
|
|||
@item RealVideo 3.0 @tab @tab X
|
||||
@tab still far from ideal
|
||||
@item RealVideo 4.0 @tab @tab X
|
||||
@item RealVideo 6.0 @tab @tab X
|
||||
@item Renderware TXD (TeXture Dictionary) @tab @tab X
|
||||
@tab Texture dictionaries used by the Renderware Engine.
|
||||
@item RivaTuner Video @tab @tab X
|
||||
|
|
@ -1236,7 +1209,6 @@ following image formats are supported:
|
|||
@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 IMA Xbox @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
|
||||
|
|
@ -1244,7 +1216,6 @@ following image formats are supported:
|
|||
@item ADPCM Nintendo THP @tab @tab X
|
||||
@item ADPCM Playstation @tab @tab X
|
||||
@item ADPCM QT IMA @tab X @tab X
|
||||
@item ADPCM Sanyo @tab @tab X
|
||||
@item ADPCM SEGA CRI ADX @tab X @tab X
|
||||
@tab Used in Sega Dreamcast games.
|
||||
@item ADPCM Shockwave Flash @tab X @tab X
|
||||
|
|
@ -1319,7 +1290,6 @@ following image formats are supported:
|
|||
@item FLAC (Free Lossless Audio Codec) @tab X @tab IX
|
||||
@item FTR Voice @tab @tab X
|
||||
@item G.723.1 @tab X @tab X
|
||||
@item G.728 @tab @tab X
|
||||
@item G.729 @tab @tab X
|
||||
@item GSM @tab E @tab X
|
||||
@tab encoding supported through external library libgsm
|
||||
|
|
@ -1330,8 +1300,7 @@ following image formats are supported:
|
|||
@tab encoding and decoding supported through external library libilbc
|
||||
@item IMC (Intel Music Coder) @tab @tab X
|
||||
@item Interplay ACM @tab @tab X
|
||||
@item LC3 @tab E @tab E
|
||||
@tab supported through external library liblc3
|
||||
@item MACE (Macintosh Audio Compression/Expansion) 3:1 @tab @tab X
|
||||
@item MACE (Macintosh Audio Compression/Expansion) 6:1 @tab @tab X
|
||||
@item Marian's A-pac audio @tab @tab X
|
||||
@item MI-SC4 (Micronas SC-4 Audio) @tab @tab X
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@ git clone git@@ffmpeg.org:ffmpeg-web <target>
|
|||
|
||||
This will put the source of the FFmpeg website into the directory
|
||||
@var{<target>} and let you push back your changes to the remote repository.
|
||||
(Note that @var{gil} stands for GItoLite and is not a typo of @var{git}.)
|
||||
|
||||
If you don't have write-access to the ffmpeg-web repository, you can
|
||||
create patches after making a read-only ffmpeg-web clone:
|
||||
|
|
@ -142,7 +143,7 @@ git log <filename(s)>
|
|||
@end example
|
||||
|
||||
You may also use the graphical tools like @command{gitview} or @command{gitk}
|
||||
or the web interface available at @url{https://git.ffmpeg.org/ffmpeg.git}.
|
||||
or the web interface available at @url{http://source.ffmpeg.org/}.
|
||||
|
||||
@section Checking source tree status
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
ffmpeg mono ./ffmpeg.html
|
||||
ffmpeg-filters mono ./ffmpeg-filters.html
|
||||
ffmpeg-formats mono ./ffmpeg-formats.html
|
||||
ffmpeg-resampler mono ./ffmpeg-resampler.html
|
||||
ffmpeg-scaler mono ./ffmpeg-scaler.html
|
||||
ffmpeg-utils mono ./ffmpeg-utils.html
|
||||
|
|
@ -220,6 +220,41 @@ $ ffmpeg -f avfoundation -capture_raw_data true -i "zr100:none" out.dv
|
|||
|
||||
@end itemize
|
||||
|
||||
@section bktr
|
||||
|
||||
BSD video input device. Deprecated and will be removed - please contact
|
||||
the developers if you are interested in maintaining it.
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
|
||||
@item framerate
|
||||
Set the frame rate.
|
||||
|
||||
@item video_size
|
||||
Set the video frame size. Default is @code{vga}.
|
||||
|
||||
@item standard
|
||||
|
||||
Available values are:
|
||||
@table @samp
|
||||
@item pal
|
||||
|
||||
@item ntsc
|
||||
|
||||
@item secam
|
||||
|
||||
@item paln
|
||||
|
||||
@item palm
|
||||
|
||||
@item ntscj
|
||||
|
||||
@end table
|
||||
|
||||
@end table
|
||||
|
||||
@section decklink
|
||||
|
||||
The decklink input device provides capture capabilities for Blackmagic
|
||||
|
|
@ -361,22 +396,6 @@ Defaults to @samp{audio}.
|
|||
@item draw_bars
|
||||
If set to @samp{true}, color bars are drawn in the event of a signal loss.
|
||||
Defaults to @samp{true}.
|
||||
This option is deprecated, please use the @code{signal_loss_action} option.
|
||||
|
||||
@item signal_loss_action
|
||||
Sets the action to take in the event of a signal loss. Accepts one of the
|
||||
following values:
|
||||
|
||||
@table @option
|
||||
@item 1, none
|
||||
Do nothing on signal loss. This usually results in black frames.
|
||||
@item 2, bars
|
||||
Draw color bars on signal loss. Only supported for 8-bit input signals.
|
||||
@item 3, repeat
|
||||
Repeat the last video frame on signal loss.
|
||||
@end table
|
||||
|
||||
Defaults to @samp{bars}.
|
||||
|
||||
@item queue_size
|
||||
Sets maximum input buffer size in bytes. If the buffering reaches this value,
|
||||
|
|
@ -704,7 +723,7 @@ Win32 GDI-based screen capture device.
|
|||
|
||||
This device allows you to capture a region of the display on Windows.
|
||||
|
||||
Amongst options for the input filenames are such elements as:
|
||||
Amongst options for the imput filenames are such elements as:
|
||||
@example
|
||||
desktop
|
||||
@end example
|
||||
|
|
@ -1050,9 +1069,9 @@ ffplay -f lavfi "movie=test.avi[out0];amovie=test.wav[out1]"
|
|||
@end example
|
||||
|
||||
@item
|
||||
Dump decoded frames to images and Closed Captions to an RCWT backup:
|
||||
Dump decoded frames to images and closed captions to a file (experimental):
|
||||
@example
|
||||
ffmpeg -f lavfi -i "movie=test.ts[out0+subcc]" -map v frame%08d.png -map s -c copy -f rcwt subcc.bin
|
||||
ffmpeg -f lavfi -i "movie=test.ts[out0+subcc]" -map v frame%08d.png -map s -c copy -f rawvideo subcc.bin
|
||||
@end example
|
||||
|
||||
@end itemize
|
||||
|
|
|
|||
|
|
@ -1,18 +1,8 @@
|
|||
FFmpeg Infrastructure:
|
||||
======================
|
||||
|
||||
Trademark:
|
||||
~~~~~~~~~~
|
||||
ffmpeg trademark registered in france by ffmpeg creator.
|
||||
|
||||
|
||||
Domain + NS:
|
||||
~~~~~~~~~~~~
|
||||
ffmpeg.org domain name
|
||||
ns1.avcodec.org Primary Name server (provided by Telepoint, hosted at Telepoint in bulgaria)
|
||||
ns2.avcodec.org Replica Name server (provided by an ffmpeg developer, hosted at Hetzner in germany)
|
||||
ns3.avcodec.org Replica Name server (provided by an ffmpeg developer, hosted at Prometeus Cdlan in italy)
|
||||
|
||||
|
||||
Servers:
|
||||
~~~~~~~~
|
||||
|
|
@ -102,47 +92,8 @@ You need a VM, docker container for FFmpeg? contact root at ffmpeg.org
|
|||
|
||||
|
||||
|
||||
Multimedia Wiki:
|
||||
~~~~~~~~~~~~~~~~
|
||||
The Multimedia Wiki http://wiki.multimedia.cx is ran by Mike Melanson.
|
||||
While not directly part of FFmpeg infrastructure, technical codec and format
|
||||
information written by FFmpeg developers can be found within.
|
||||
It is our unofficial official tech wiki. For access contact Mike.
|
||||
|
||||
|
||||
|
||||
IRC:
|
||||
~~~~
|
||||
irc channels are at https://libera.chat/
|
||||
irc channel archives are at https://libera.irclog.whitequark.org
|
||||
|
||||
#ffmpeg and #ffmpeg-devel founder/admins: BtbN, Michael, Compn
|
||||
#ffmpeg-meeting founder/admins: BtbN, Michael
|
||||
|
||||
|
||||
Twitter aka X:
|
||||
~~~~~~~~~~~~~~
|
||||
https://twitter.com/FFmpeg or https://x.com/FFmpeg
|
||||
|
||||
If you would like to post to twitter please contact twitter MAINTAINERS
|
||||
for access. We want more developers posting to twitter!
|
||||
|
||||
|
||||
|
||||
Reddit:
|
||||
~~~~~~~
|
||||
https://www.reddit.com/r/ffmpeg/
|
||||
moderated by Gyan
|
||||
|
||||
|
||||
|
||||
Facebook:
|
||||
~~~~~~~~~
|
||||
https://www.facebook.com/ffmpeg
|
||||
???
|
||||
|
||||
|
||||
|
||||
Wikipedia entry:
|
||||
~~~~~~~~~~~~~~~~
|
||||
https://en.wikipedia.org/wiki/FFmpeg
|
||||
|
|
|
|||
115
doc/libav-merge.txt
Normal file
115
doc/libav-merge.txt
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
CONTEXT
|
||||
=======
|
||||
|
||||
The FFmpeg project merges all the changes from the Libav project
|
||||
(https://libav.org) since the origin of the fork (around 2011).
|
||||
|
||||
With the exceptions of some commits due to technical/political disagreements or
|
||||
issues, the changes are merged on a more or less regular schedule (daily for
|
||||
years thanks to Michael, but more sparse nowadays).
|
||||
|
||||
WHY
|
||||
===
|
||||
|
||||
The majority of the active developers believe the project needs to keep this
|
||||
policy for various reasons.
|
||||
|
||||
The most important one is that we don't want our users to have to choose
|
||||
between two distributors of libraries of the exact same name in order to have a
|
||||
different set of features and bugfixes. By taking the responsibility of
|
||||
unifying the two codebases, we allow users to benefit from the changes from the
|
||||
two teams.
|
||||
|
||||
Today, FFmpeg has a much larger user database (we are distributed by every
|
||||
major distribution), so we consider this mission a priority.
|
||||
|
||||
A different approach to the merge could have been to pick the changes we are
|
||||
interested in and drop most of the cosmetics and other less important changes.
|
||||
Unfortunately, this makes the following picks much harder, especially since the
|
||||
Libav project is involved in various deep API changes. As a result, we decide
|
||||
to virtually take everything done there.
|
||||
|
||||
Any Libav developer is of course welcome anytime to contribute directly to the
|
||||
FFmpeg tree. Of course, we fully understand and are forced to accept that very
|
||||
few Libav developers are interested in doing so, but we still want to recognize
|
||||
their work. This leads us to create merge commits for every single one from
|
||||
Libav. The original commit appears totally unchanged with full authorship in
|
||||
our history (and the conflict are solved in the merge one). That way, not a
|
||||
single thing from Libav will be lost in the future in case some reunification
|
||||
happens, or that project disappears one way or another.
|
||||
|
||||
DOWNSIDES
|
||||
=========
|
||||
|
||||
Of course, there are many downsides to this approach.
|
||||
|
||||
- It causes a non negligible merge commits pollution. We make sure there are
|
||||
not several level of merges entangled (we do a 1:1 merge/commit), but it's
|
||||
still a non-linear history.
|
||||
|
||||
- Many duplicated work. For instance, we added libavresample in our tree to
|
||||
keep compatibility with Libav when our libswresample was already covering the
|
||||
exact same purpose. The same thing happened for various elements such as the
|
||||
ProRes support (but differences in features, bugs, licenses, ...). There are
|
||||
many work to do to unify them, and any help is very much welcome.
|
||||
|
||||
- So much manpower from both FFmpeg and Libav is lost because of this mess. We
|
||||
know it, and we don't know how to fix it. It takes incredible time to do
|
||||
these merges, so we have even less time to work on things we personally care
|
||||
about. The bad vibes also do not help with keeping our developers motivated.
|
||||
|
||||
- There is a growing technical risk factor with the merges due to the codebase
|
||||
differing more and more.
|
||||
|
||||
MERGE GUIDELINES
|
||||
================
|
||||
|
||||
The following gives developer guidelines on how to proceed when merging Libav commits.
|
||||
|
||||
Before starting, you can reduce the risk of errors on merge conflicts by using
|
||||
a different merge conflict style:
|
||||
|
||||
$ git config --global merge.conflictstyle diff3
|
||||
|
||||
tools/libav-merge-next-commit is a script to help merging the next commit in
|
||||
the queue. It assumes a remote named libav. It has two modes: merge, and noop.
|
||||
The noop mode creates a merge with no change to the HEAD. You can pass a hash
|
||||
as extra argument to reference a justification (it is common that we already
|
||||
have the change done in FFmpeg).
|
||||
|
||||
Also see tools/murge, you can copy and paste a 3 way conflict into its stdin
|
||||
and it will display colored diffs. Any arguments to murge (like ones to suppress
|
||||
whitespace differences) are passed into colordiff.
|
||||
|
||||
TODO/FIXME/UNMERGED
|
||||
===================
|
||||
|
||||
Stuff that didn't reach the codebase:
|
||||
-------------------------------------
|
||||
|
||||
- HEVC DSP and x86 MC SIMD improvements from Libav (see https://ffmpeg.org/pipermail/ffmpeg-devel/2015-December/184777.html)
|
||||
- 1f821750f hevcdsp: split the qpel functions by width instead of by the subpixel fraction
|
||||
- 818bfe7f0 hevcdsp: split the epel functions by width
|
||||
- 688417399 hevcdsp: split the pred functions by width
|
||||
- a853388d2 hevc: change the stride of the MC buffer to be in bytes instead of elements
|
||||
- 0cef06df0 checkasm: add HEVC MC tests
|
||||
- e7078e842 hevcdsp: add x86 SIMD for MC
|
||||
- 7993ec19a hevc: Add hevc_get_pixel_4/8/12/16/24/32/48/64
|
||||
- use av_cpu_max_align() instead of hardcoding alignment requirements (see https://ffmpeg.org/pipermail/ffmpeg-devel/2017-September/215834.html)
|
||||
- f44ec22e0 lavc: use av_cpu_max_align() instead of hardcoding alignment requirements
|
||||
- 4de220d2e frame: allow align=0 (meaning automatic) for av_frame_get_buffer()
|
||||
- Support recovery from an already present HLS playlist (see 16cb06bb30)
|
||||
- Remove all output devices (see 8e7e042d41, 8d3db95f20, 6ce13070bd, d46cd24986 and https://ffmpeg.org/pipermail/ffmpeg-devel/2017-September/216904.html)
|
||||
- avcodec/libaomenc: export the Sequence Header OBU as extradata (See a024c3ce9a)
|
||||
|
||||
Collateral damage that needs work locally:
|
||||
------------------------------------------
|
||||
|
||||
- Merge proresenc_anatoliy.c and proresenc_kostya.c
|
||||
- Fix MIPS AC3 downmix
|
||||
|
||||
Extra changes needed to be aligned with Libav:
|
||||
----------------------------------------------
|
||||
|
||||
- Switching our examples to the new encode/decode API (see 67d28f4a0f)
|
||||
- HEVC IDCT bit depth 12-bit support (Libav added 8 and 10 but doesn't have 12)
|
||||
|
|
@ -157,6 +157,9 @@ Perform a site search using your favorite search engine. Example:
|
|||
|
||||
You can ask for help in the official @t{#ffmpeg} IRC channel on Libera Chat.
|
||||
|
||||
Some users prefer the third-party @url{http://www.ffmpeg-archive.org/, Nabble}
|
||||
interface which presents the mailing lists in a typical forum layout.
|
||||
|
||||
There are also numerous third-party help sites such as
|
||||
@url{https://superuser.com/tags/ffmpeg, Super User} and
|
||||
@url{https://www.reddit.com/r/ffmpeg/, r/ffmpeg on reddit}.
|
||||
|
|
|
|||
|
|
@ -49,6 +49,11 @@ Files that have MIPS copyright notice in them:
|
|||
libm_mips.h
|
||||
softfloat_tables.h
|
||||
* libavcodec/mips/
|
||||
aacdec_fixed.c
|
||||
aacsbr_fixed.c
|
||||
aacsbr_template.c
|
||||
aaccoder_mips.c
|
||||
aacpsy_mips.h
|
||||
ac3dsp_mips.c
|
||||
acelp_filters_mips.c
|
||||
acelp_vectors_mips.c
|
||||
|
|
@ -59,6 +64,8 @@ Files that have MIPS copyright notice in them:
|
|||
compute_antialias_fixed.h
|
||||
compute_antialias_float.h
|
||||
lsp_mips.h
|
||||
dsputil_mips.c
|
||||
fmtconvert_mips.c
|
||||
iirfilter_mips.c
|
||||
mpegaudiodsp_mips_fixed.c
|
||||
mpegaudiodsp_mips_float.c
|
||||
|
|
|
|||
|
|
@ -36,9 +36,9 @@ Frame threading -
|
|||
* Codecs similar to ffv1, whose streams don't reset across frames,
|
||||
will not work because their bitstreams cannot be decoded in parallel.
|
||||
|
||||
* The contents of buffers must not be read before ff_progress_frame_await()
|
||||
* The contents of buffers must not be read before ff_thread_await_progress()
|
||||
has been called on them. reget_buffer() and buffer age optimizations no longer work.
|
||||
* The contents of buffers must not be written to after ff_progress_frame_report()
|
||||
* The contents of buffers must not be written to after ff_thread_report_progress()
|
||||
has been called on them. This includes draw_edges().
|
||||
|
||||
Porting codecs to frame threading
|
||||
|
|
@ -53,13 +53,14 @@ thread.
|
|||
Add AV_CODEC_CAP_FRAME_THREADS to the codec capabilities. There will be very little
|
||||
speed gain at this point but it should work.
|
||||
|
||||
Use ff_thread_get_buffer() (or ff_progress_frame_get_buffer()
|
||||
in case you have inter-frame dependencies and use the ProgressFrame API)
|
||||
to allocate frame buffers.
|
||||
If there are inter-frame dependencies, so the codec calls
|
||||
ff_thread_report/await_progress(), set FF_CODEC_CAP_ALLOCATE_PROGRESS in
|
||||
FFCodec.caps_internal and use ff_thread_get_buffer() to allocate frames.
|
||||
Otherwise decode directly into the user-supplied frames.
|
||||
|
||||
Call ff_progress_frame_report() after some part of the current picture has decoded.
|
||||
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
|
||||
doing this. Note that draw_edges() needs to be called before reporting progress.
|
||||
|
||||
Before accessing a reference frame or its MVs, call ff_progress_frame_await().
|
||||
Before accessing a reference frame or its MVs, call ff_thread_await_progress().
|
||||
|
|
|
|||
768
doc/muxers.texi
768
doc/muxers.texi
File diff suppressed because it is too large
Load diff
|
|
@ -157,3 +157,4 @@ PFD[32] would for example be signed 32 bit little-endian IEEE float
|
|||
@item XVID @tab non-compliant MPEG-4 generated by old Xvid
|
||||
@item XVIX @tab non-compliant MPEG-4 generated by old Xvid with interlacing bug
|
||||
@end multitable
|
||||
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ Code that depends on data in registries being untouched, should be written as
|
|||
a single __asm__() statement. Ideally, a single function contains only one
|
||||
__asm__() block.
|
||||
|
||||
Use external asm (nasm) or inline asm (__asm__()), do not use intrinsics.
|
||||
Use external asm (nasm/yasm) or inline asm (__asm__()), do not use intrinsics.
|
||||
The latter requires a good optimizing compiler which gcc is not.
|
||||
|
||||
When debugging a x86 external asm compilation issue, if lost in the macro
|
||||
|
|
@ -199,7 +199,7 @@ actual lines causing issues.
|
|||
Inline asm vs. external asm
|
||||
---------------------------
|
||||
Both inline asm (__asm__("..") in a .c file, handled by a compiler such as gcc)
|
||||
and external asm (.s or .asm files, handled by an assembler such as nasm)
|
||||
and external asm (.s or .asm files, handled by an assembler such as nasm/yasm)
|
||||
are accepted in FFmpeg. Which one to use differs per specific case.
|
||||
|
||||
- if your code is intended to be inlined in a C function, inline asm is always
|
||||
|
|
|
|||
111
doc/outdevs.texi
111
doc/outdevs.texi
|
|
@ -301,6 +301,45 @@ ffmpeg -re -i INPUT -c:v rawvideo -pix_fmt bgra -f fbdev /dev/fb0
|
|||
|
||||
See also @url{http://linux-fbdev.sourceforge.net/}, and fbset(1).
|
||||
|
||||
@section opengl
|
||||
OpenGL output device. Deprecated and will be removed.
|
||||
|
||||
To enable this output device you need to configure FFmpeg with @code{--enable-opengl}.
|
||||
|
||||
This output device allows one to render to OpenGL context.
|
||||
Context may be provided by application or default SDL window is created.
|
||||
|
||||
When device renders to external context, application must implement handlers for following messages:
|
||||
@code{AV_DEV_TO_APP_CREATE_WINDOW_BUFFER} - create OpenGL context on current thread.
|
||||
@code{AV_DEV_TO_APP_PREPARE_WINDOW_BUFFER} - make OpenGL context current.
|
||||
@code{AV_DEV_TO_APP_DISPLAY_WINDOW_BUFFER} - swap buffers.
|
||||
@code{AV_DEV_TO_APP_DESTROY_WINDOW_BUFFER} - destroy OpenGL context.
|
||||
Application is also required to inform a device about current resolution by sending @code{AV_APP_TO_DEV_WINDOW_SIZE} message.
|
||||
|
||||
@subsection Options
|
||||
@table @option
|
||||
|
||||
@item background
|
||||
Set background color. Black is a default.
|
||||
@item no_window
|
||||
Disables default SDL window when set to non-zero value.
|
||||
Application must provide OpenGL context and both @code{window_size_cb} and @code{window_swap_buffers_cb} callbacks when set.
|
||||
@item window_title
|
||||
Set the SDL window title, if not specified default to the filename specified for the output device.
|
||||
Ignored when @option{no_window} is set.
|
||||
@item window_size
|
||||
Set preferred window size, can be a string of the form widthxheight or a video size abbreviation.
|
||||
If not specified it defaults to the size of the input video, downscaled according to the aspect ratio.
|
||||
Mostly usable when @option{no_window} is not set.
|
||||
|
||||
@end table
|
||||
|
||||
@subsection Examples
|
||||
Play a file on SDL window using OpenGL rendering:
|
||||
@example
|
||||
ffmpeg -i INPUT -f opengl "window title"
|
||||
@end example
|
||||
|
||||
@section oss
|
||||
|
||||
OSS (Open Sound System) output device.
|
||||
|
|
@ -367,6 +406,78 @@ Play a file on default device on default server:
|
|||
ffmpeg -i INPUT -f pulse "stream name"
|
||||
@end example
|
||||
|
||||
@section sdl
|
||||
|
||||
SDL (Simple DirectMedia Layer) output device. Deprecated and will be removed.
|
||||
|
||||
For monitoring purposes in FFmpeg, pipes and a video player such as ffplay can be used:
|
||||
|
||||
@example
|
||||
ffmpeg -i INPUT -f nut -c:v rawvideo - | ffplay -
|
||||
@end example
|
||||
|
||||
"sdl2" can be used as alias for "sdl".
|
||||
|
||||
This output device allows one 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.
|
||||
|
||||
To enable this output device you need libsdl installed on your system
|
||||
when configuring your build.
|
||||
|
||||
For more information about SDL, check:
|
||||
@url{http://www.libsdl.org/}
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
|
||||
@item window_borderless
|
||||
Set SDL window border off.
|
||||
Default value is 0 (enable window border).
|
||||
|
||||
@item window_enable_quit
|
||||
Enable quit action (using window button or keyboard key)
|
||||
when non-zero value is provided.
|
||||
Default value is 1 (enable quit action).
|
||||
|
||||
@item window_fullscreen
|
||||
Set fullscreen mode when non-zero value is provided.
|
||||
Default value is zero.
|
||||
|
||||
@item window_size
|
||||
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_title
|
||||
Set the SDL window title, if not specified default to the filename
|
||||
specified for the output device.
|
||||
|
||||
@item window_x
|
||||
@item window_y
|
||||
Set the position of the window on the screen.
|
||||
@end table
|
||||
|
||||
@subsection Interactive commands
|
||||
|
||||
The window created by the device can be controlled through the
|
||||
following interactive commands.
|
||||
|
||||
@table @key
|
||||
@item q, ESC
|
||||
Quit the device immediately.
|
||||
@end table
|
||||
|
||||
@subsection Examples
|
||||
|
||||
The following command shows the @command{ffmpeg} output is an
|
||||
SDL window, forcing its size to the qcif format:
|
||||
@example
|
||||
ffmpeg -i INPUT -c:v rawvideo -pix_fmt yuv420p -window_size qcif -f sdl "SDL output"
|
||||
@end example
|
||||
|
||||
@section sndio
|
||||
|
||||
sndio audio output device.
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ You will need the following prerequisites:
|
|||
To set up a proper environment in MSYS2, you need to run @code{msys_shell.bat} from
|
||||
the Visual Studio or Intel Compiler command prompt.
|
||||
|
||||
Place @code{nasm.exe} somewhere in your @code{PATH}.
|
||||
Place @code{yasm.exe} somewhere in your @code{PATH}.
|
||||
|
||||
Next, make sure any other headers and libs you want to use, such as zlib, are
|
||||
located in a spot that the compiler can see. Do so by modifying the @code{LIB}
|
||||
|
|
@ -301,7 +301,7 @@ These library packages are only available from
|
|||
@uref{http://sourceware.org/cygwinports/, Cygwin Ports}:
|
||||
|
||||
@example
|
||||
libSDL-devel, libgsm-devel, libmp3lame-devel,
|
||||
yasm, libSDL-devel, libgsm-devel, libmp3lame-devel,
|
||||
speex-devel, libtheora-devel, libxvidcore-devel
|
||||
@end example
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ client may also set a user/password for authentication. The default for both
|
|||
fields is "guest". Name of virtual host on broker can be set with vhost. The
|
||||
default value is "/".
|
||||
|
||||
Multiple subscribers may stream from the broker using the command:
|
||||
Muliple subscribers may stream from the broker using the command:
|
||||
@example
|
||||
ffplay amqp://[[user]:[password]@@]hostname[:port][/vhost]
|
||||
@end example
|
||||
|
|
@ -442,6 +442,9 @@ value is -1.
|
|||
@item chunked_post
|
||||
If set to 1 use chunked Transfer-Encoding for posts, default is 1.
|
||||
|
||||
@item content_type
|
||||
Set a specific content type for the POST messages or for listen mode.
|
||||
|
||||
@item http_proxy
|
||||
set HTTP proxy to tunnel through e.g. http://example.com:1234
|
||||
|
||||
|
|
@ -449,33 +452,42 @@ set HTTP proxy to tunnel through e.g. http://example.com:1234
|
|||
Set custom HTTP headers, can override built in default headers. The
|
||||
value must be a string encoding the headers.
|
||||
|
||||
@item content_type
|
||||
Set a specific content type for the POST messages or for listen mode.
|
||||
|
||||
@item user_agent
|
||||
Override the User-Agent header. If not specified the protocol will use a
|
||||
string describing the libavformat build. ("Lavf/<version>")
|
||||
|
||||
@item referer
|
||||
Set the Referer header. Include 'Referer: URL' header in HTTP request.
|
||||
|
||||
@item multiple_requests
|
||||
Use persistent connections if set to 1, default is 0.
|
||||
|
||||
@item post_data
|
||||
Set custom HTTP post data.
|
||||
|
||||
@item referer
|
||||
Set the Referer header. Include 'Referer: URL' header in HTTP request.
|
||||
|
||||
@item user_agent
|
||||
Override the User-Agent header. If not specified the protocol will use a
|
||||
string describing the libavformat build. ("Lavf/<version>")
|
||||
|
||||
@item reconnect_at_eof
|
||||
If set then eof is treated like an error and causes reconnection, this is useful
|
||||
for live / endless streams.
|
||||
|
||||
@item reconnect_streamed
|
||||
If set then even streamed/non seekable streams will be reconnected on errors.
|
||||
|
||||
@item reconnect_on_network_error
|
||||
Reconnect automatically in case of TCP/TLS errors during connect.
|
||||
|
||||
@item reconnect_on_http_error
|
||||
A comma separated list of HTTP status codes to reconnect on. The list can
|
||||
include specific status codes (e.g. '503') or the strings '4xx' / '5xx'.
|
||||
|
||||
@item reconnect_delay_max
|
||||
Sets the maximum delay in seconds after which to give up reconnecting
|
||||
|
||||
@item mime_type
|
||||
Export the MIME type.
|
||||
|
||||
@item http_version
|
||||
Exports the HTTP response version number. Usually "1.0" or "1.1".
|
||||
|
||||
@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.
|
||||
|
||||
@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
|
||||
|
|
@ -492,40 +504,10 @@ contains the last non-empty metadata packet sent by the server. It should be
|
|||
polled in regular intervals by applications interested in mid-stream metadata
|
||||
updates.
|
||||
|
||||
@item metadata
|
||||
Set an exported dictionary containing Icecast metadata from the bitstream, if present.
|
||||
Only useful with the C API.
|
||||
|
||||
@item auth_type
|
||||
|
||||
Set HTTP authentication type. No option for Digest, since this method requires
|
||||
getting nonce parameters from the server first and can't be used straight away like
|
||||
Basic.
|
||||
|
||||
@table @option
|
||||
@item none
|
||||
Choose the HTTP authentication type automatically. This is the default.
|
||||
@item basic
|
||||
|
||||
Choose the HTTP basic authentication.
|
||||
|
||||
Basic authentication sends a Base64-encoded string that contains a user name and password
|
||||
for the client. Base64 is not a form of encryption and should be considered the same as
|
||||
sending the user name and password in clear text (Base64 is a reversible encoding).
|
||||
If a resource needs to be protected, strongly consider using an authentication scheme
|
||||
other than basic authentication. HTTPS/TLS should be used with basic authentication.
|
||||
Without these additional security enhancements, basic authentication should not be used
|
||||
to protect sensitive or valuable information.
|
||||
@end table
|
||||
|
||||
@item send_expect_100
|
||||
Send an Expect: 100-continue header for POST. If set to 1 it will send, if set
|
||||
to 0 it won't, if set to -1 it will try to send if it is applicable. Default
|
||||
value is -1.
|
||||
|
||||
@item location
|
||||
An exported dictionary containing the content location. Only useful with the C
|
||||
API.
|
||||
@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.
|
||||
|
||||
@item offset
|
||||
Set initial byte offset.
|
||||
|
|
@ -543,37 +525,6 @@ be given a Bad Request response.
|
|||
When unset the HTTP method is not checked for now. This will be replaced by
|
||||
autodetection in the future.
|
||||
|
||||
@item reconnect
|
||||
Reconnect automatically when disconnected before EOF is hit.
|
||||
|
||||
@item reconnect_at_eof
|
||||
If set then eof is treated like an error and causes reconnection, this is useful
|
||||
for live / endless streams.
|
||||
|
||||
@item reconnect_on_network_error
|
||||
Reconnect automatically in case of TCP/TLS errors during connect.
|
||||
|
||||
@item reconnect_on_http_error
|
||||
A comma separated list of HTTP status codes to reconnect on. The list can
|
||||
include specific status codes (e.g. '503') or the strings '4xx' / '5xx'.
|
||||
|
||||
@item reconnect_streamed
|
||||
If set then even streamed/non seekable streams will be reconnected on errors.
|
||||
|
||||
@item reconnect_delay_max
|
||||
Set the maximum delay in seconds after which to give up reconnecting.
|
||||
|
||||
@item reconnect_max_retries
|
||||
Set the maximum number of times to retry a connection. Default unset.
|
||||
|
||||
@item reconnect_delay_total_max
|
||||
Set the maximum total delay in seconds after which to give up reconnecting.
|
||||
|
||||
@item respect_retry_after
|
||||
If enabled, and a Retry-After header is encountered, its requested reconnection
|
||||
delay will be honored, rather than using exponential backoff. Useful for 429 and
|
||||
503 errors. Default enabled.
|
||||
|
||||
@item listen
|
||||
If set to 1 enables experimental HTTP server. This can be used to send data when
|
||||
used as an output option, or read data from a client with HTTP POST when used as
|
||||
|
|
@ -600,16 +551,32 @@ ffmpeg -i somefile.ogg -chunked_post 0 -c copy -f ogg http://@var{server}:@var{p
|
|||
wget --post-file=somefile.ogg http://@var{server}:@var{port}
|
||||
@end example
|
||||
|
||||
@item resource
|
||||
The resource requested by a client, when the experimental HTTP server is in use.
|
||||
@item send_expect_100
|
||||
Send an Expect: 100-continue header for POST. If set to 1 it will send, if set
|
||||
to 0 it won't, if set to -1 it will try to send if it is applicable. Default
|
||||
value is -1.
|
||||
|
||||
@item reply_code
|
||||
The HTTP code returned to the client, when the experimental HTTP server is in use.
|
||||
@item auth_type
|
||||
|
||||
@item short_seek_size
|
||||
Set the threshold, in bytes, for when a readahead should be preferred over a seek and
|
||||
new HTTP request. This is useful, for example, to make sure the same connection
|
||||
is used for reading large video packets with small audio packets in between.
|
||||
Set HTTP authentication type. No option for Digest, since this method requires
|
||||
getting nonce parameters from the server first and can't be used straight away like
|
||||
Basic.
|
||||
|
||||
@table @option
|
||||
@item none
|
||||
Choose the HTTP authentication type automatically. This is the default.
|
||||
@item basic
|
||||
|
||||
Choose the HTTP basic authentication.
|
||||
|
||||
Basic authentication sends a Base64-encoded string that contains a user name and password
|
||||
for the client. Base64 is not a form of encryption and should be considered the same as
|
||||
sending the user name and password in clear text (Base64 is a reversible encoding).
|
||||
If a resource needs to be protected, strongly consider using an authentication scheme
|
||||
other than basic authentication. HTTPS/TLS should be used with basic authentication.
|
||||
Without these additional security enhancements, basic authentication should not be used
|
||||
to protect sensitive or valuable information.
|
||||
@end table
|
||||
|
||||
@end table
|
||||
|
||||
|
|
@ -1150,15 +1117,10 @@ ffplay "rtmp://myserver/live/mystream live=1"
|
|||
Real-time Transport Protocol.
|
||||
|
||||
The required syntax for an RTP URL is:
|
||||
@example
|
||||
rtp://@var{hostname}[:@var{port}][?@var{options}]
|
||||
@end example
|
||||
rtp://@var{hostname}[:@var{port}][?@var{option}=@var{val}...]
|
||||
|
||||
@var{port} specifies the RTP port to use.
|
||||
|
||||
@var{options} contains a list of &-separated options of the form
|
||||
@var{key}=@var{val}.
|
||||
|
||||
The following URL options are supported:
|
||||
|
||||
@table @option
|
||||
|
|
@ -1198,15 +1160,16 @@ 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.
|
||||
|
||||
@item localaddr=@var{addr}
|
||||
Local IP address of a network interface used for sending packets or joining
|
||||
multicast groups.
|
||||
|
||||
@item timeout=@var{n}
|
||||
Set timeout (in microseconds) of socket I/O operations to @var{n}.
|
||||
|
||||
This is a deprecated option. Instead, @option{localrtpport} should be
|
||||
used.
|
||||
|
||||
@end table
|
||||
|
||||
Important notes:
|
||||
|
|
@ -2028,87 +1991,6 @@ To play back a stream from the TLS/SSL server using @command{ffplay}:
|
|||
ffplay tls://@var{hostname}:@var{port}
|
||||
@end example
|
||||
|
||||
@section dtls
|
||||
|
||||
Datagram Transport Layer Security (DTLS)
|
||||
|
||||
The required syntax for a DTLS URL is:
|
||||
@example
|
||||
dtls://@var{hostname}:@var{port}
|
||||
@end example
|
||||
|
||||
DTLS shares most options with TLS, but operates over UDP instead of TCP.
|
||||
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 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.
|
||||
|
||||
This is disabled by default since it requires a CA database to be
|
||||
provided by the caller in many cases.
|
||||
|
||||
@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_file, key=@var{filename}
|
||||
A file containing the private key for the certificate.
|
||||
|
||||
@item cert_pem=@var{string}
|
||||
Certificate PEM string
|
||||
|
||||
@item key_pem=@var{string}
|
||||
Private key PEM string
|
||||
|
||||
@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 mtu=@var{size}
|
||||
Set the Maximum Transmission Unit (MTU) for DTLS packets.
|
||||
|
||||
@item use_srtp=@var{1|0}
|
||||
Enable the use_srtp DTLS extension.
|
||||
This is used in WebRTC applications to establish SRTP encryption keys
|
||||
through the DTLS handshake. Default is disabled.
|
||||
|
||||
@item external_sock=@var{1|0}
|
||||
Use an external socket instead of creating a new one.
|
||||
This option only makes sense to pass when interacting with the code via
|
||||
API, enabling this from CLI will cause immediate failure.
|
||||
Default is disabled.
|
||||
|
||||
@end table
|
||||
|
||||
Example command lines:
|
||||
|
||||
To create a DTLS server:
|
||||
|
||||
@example
|
||||
ffmpeg -listen 1 -i dtls://@var{hostname}:@var{port} @var{output}
|
||||
@end example
|
||||
|
||||
To create a DTLS client and send data to server:
|
||||
|
||||
@example
|
||||
ffmpeg -i @var{input} -f @var{format} dtls://@var{hostname}:@var{port}
|
||||
@end example
|
||||
|
||||
@section udp
|
||||
|
||||
User Datagram Protocol.
|
||||
|
|
|
|||
|
|
@ -96,9 +96,6 @@ If value is set to @code{1}, indicates source is full range. Default value is
|
|||
If value is set to @code{1}, enable full range for destination. Default value
|
||||
is @code{0}, which enables limited range.
|
||||
|
||||
@item gamma @var{(boolean)}
|
||||
If value is set to @code{1}, enable gamma correct scaling. Default value is @code{0}.
|
||||
|
||||
@anchor{sws_params}
|
||||
@item param0, param1
|
||||
Set scaling algorithm parameters. The specified values are specific of
|
||||
|
|
|
|||
2
doc/style.min.css
vendored
2
doc/style.min.css
vendored
File diff suppressed because one or more lines are too long
|
|
@ -1,344 +0,0 @@
|
|||
New swscale design to change everything (tm)
|
||||
============================================
|
||||
|
||||
SwsGraph
|
||||
--------
|
||||
|
||||
The entry point to the new architecture, SwsGraph is what coordinates
|
||||
multiple "passes". These can include cascaded scaling passes, error diffusion
|
||||
dithering, and so on. Or we could have separate passes for the vertical and
|
||||
horizontal scaling. In between each SwsPass lies a fully allocated image buffer.
|
||||
Graph passes may have different levels of threading, e.g. we can have a single
|
||||
threaded error diffusion pass following a multi-threaded scaling pass.
|
||||
|
||||
SwsGraph is internally recreated whenever the image format, dimensions or
|
||||
settings change in any way. sws_scale_frame() is itself just a light-weight
|
||||
wrapper that runs ff_sws_graph_create() whenever the format changes, splits
|
||||
interlaced images into separate fields, and calls ff_sws_graph_run() on each.
|
||||
|
||||
From the point of view of SwsGraph itself, all inputs are progressive.
|
||||
|
||||
SwsOp / SwsOpList
|
||||
-----------------
|
||||
|
||||
This is the newly introduced abstraction layer between the high-level format
|
||||
handling logic and the low-level backing implementation. Each SwsOp is designed
|
||||
to be as small and atomic as possible, with the possible exception of the
|
||||
read / write operations due to their numerous variants.
|
||||
|
||||
The basic idea is to split logic between three major components:
|
||||
|
||||
1. The high-level format "business logic", which generates in a very
|
||||
naive way a sequence of operations guaranteed to get you from point A
|
||||
to point B. This logic is written with correctness in mind only, and
|
||||
ignoring any performance concerns or low-level implementation decisions.
|
||||
Semantically, everything is always decoded from the input format to
|
||||
normalized (real valued) RGB, and then encoded back to output format.
|
||||
|
||||
This code lives in libswscale/format.c
|
||||
|
||||
2. The optimizer. This is where the "magic" happens, so to speak. The
|
||||
optimizer's job is to take the abstract sequence of operations
|
||||
produced by the high-level format analysis code and incrementally
|
||||
optimize it. Each optimization step is designed to be minute and provably
|
||||
lossless, or otherwise guarded behind the BITEXACT flag. This ensures that
|
||||
the resulting output is always identical, no matter how many layers of
|
||||
optimization we add.
|
||||
|
||||
This code lives in libswscale/ops.c
|
||||
|
||||
3. The compiler. Once we have a sequence of operations as output by the
|
||||
optimizer, we "compile" this down to a callable function. This is then
|
||||
applied by the dispatch wrapper by striping it over the input image.
|
||||
|
||||
See libswscale/ops_backend.c for the reference backend, or
|
||||
libswscale/x86/ops.c for a more complex SIMD example.
|
||||
|
||||
This overall approach has a considerable number of benefits:
|
||||
|
||||
1. It allows us to verify correctness of logic and spot semantic errors at a
|
||||
very high level, by simply looking at the sequence of operations (available
|
||||
by default at debug / verbose log level), without having to dig through the
|
||||
multiple levels of complicated, interwoven format handling code that is
|
||||
legacy swscale.
|
||||
|
||||
2. Because most of the brains lives inside the the powerful optimizer, we get
|
||||
fast paths "for free" for any suitable format conversion, rather than having
|
||||
to enumerate them one by one. SIMD code itself can be written in a very
|
||||
general way and does need to be tied to specific pixel formats - subsequent
|
||||
low-level implementations can be strung together without much overhead.
|
||||
|
||||
3. We can in the future, with relative ease, compile these operations
|
||||
down to SPIR-V (or even LLVM IR) and generate efficient GPU or
|
||||
target-machine specific implementations. This also opens the window for
|
||||
adding hardware frame support to libswscale, and even transparently using
|
||||
GPU acceleration for CPU frames.
|
||||
|
||||
4. Platform-specific SIMD can be reduced down to a comparatively small set of
|
||||
optimized routines, while still providing 100% coverage for all possible
|
||||
pixel formats and operations. (As of writing, the x86 example backend has
|
||||
about 60 unique implementations, of which 20 are trivial swizzles, 10 are
|
||||
read/write ops, 10 are pixel type conversions and the remaining 20 are the
|
||||
various logic/arithmetic ops).
|
||||
|
||||
5. Backends hide behind a layer of abstraction offering them a considerable
|
||||
deal of flexibility in how they want to implement their operations. For
|
||||
example, the x86 backend has a dedicated function for compiling compatible
|
||||
operations down to a single in-place pshufb instruction.
|
||||
|
||||
Platform specific low level data is self-contained within its own setup()
|
||||
function and private data structure, eliminating all reads into SwsContext
|
||||
or the possibility of conflicts between platforms.
|
||||
|
||||
6. We can compute an exact reference result for each operation with fixed
|
||||
precision (ff_sws_op_apply_q), and use that to e.g. measure the amount of
|
||||
error introduced by dithering, or even catch bugs in the reference C
|
||||
implementation. (In theory - currently checkasm just compares against C)
|
||||
|
||||
Examples of SwsOp in action
|
||||
---------------------------
|
||||
|
||||
For illustration, here is the sequence of operations currently generated by
|
||||
my prototype, for a conversion from RGB24 to YUV444P:
|
||||
|
||||
Unoptimized operation list:
|
||||
[ u8 .... -> ....] SWS_OP_READ : 3 elem(s) packed >> 0
|
||||
[ u8 .... -> ....] SWS_OP_SWIZZLE : 0123
|
||||
[ u8 .... -> ....] SWS_OP_RSHIFT : >> 0
|
||||
[ u8 .... -> ....] SWS_OP_CLEAR : {_ _ _ 0}
|
||||
[ u8 .... -> ....] SWS_OP_CONVERT : u8 -> f32
|
||||
[f32 .... -> ....] SWS_OP_LINEAR : diag3+alpha [[1/255 0 0 0 0] [0 1/255 0 0 0] [0 0 1/255 0 0] [0 0 0 1 1]]
|
||||
[f32 .... -> ....] SWS_OP_LINEAR : matrix3 [[0.299000 0.587000 0.114000 0 0] [-0.168736 -0.331264 1/2 0 0] [1/2 -0.418688 -57/701 0 0] [0 0 0 1 0]]
|
||||
[f32 .... -> ....] SWS_OP_LINEAR : diag3+off3 [[219 0 0 0 16] [0 224 0 0 128] [0 0 224 0 128] [0 0 0 1 0]]
|
||||
[f32 .... -> ....] SWS_OP_DITHER : 16x16 matrix
|
||||
[f32 .... -> ....] SWS_OP_MAX : {0 0 0 0} <= x
|
||||
[f32 .... -> ....] SWS_OP_MIN : x <= {255 255 255 _}
|
||||
[f32 .... -> ....] SWS_OP_CONVERT : f32 -> u8
|
||||
[ u8 .... -> ....] SWS_OP_LSHIFT : << 0
|
||||
[ u8 .... -> ....] SWS_OP_SWIZZLE : 0123
|
||||
[ u8 .... -> ....] SWS_OP_WRITE : 3 elem(s) planar >> 0
|
||||
|
||||
This is optimized into the following sequence:
|
||||
|
||||
Optimized operation list:
|
||||
[ u8 XXXX -> +++X] SWS_OP_READ : 3 elem(s) packed >> 0
|
||||
[ u8 ...X -> +++X] SWS_OP_CONVERT : u8 -> f32
|
||||
[f32 ...X -> ...X] SWS_OP_LINEAR : matrix3+off3 [[0.256788 0.504129 0.097906 0 16] [-0.148223 -0.290993 112/255 0 128] [112/255 -0.367788 -0.071427 0 128] [0 0 0 1 0]]
|
||||
[f32 ...X -> ...X] SWS_OP_DITHER : 16x16 matrix
|
||||
[f32 ...X -> +++X] SWS_OP_CONVERT : f32 -> u8
|
||||
[ u8 ...X -> +++X] SWS_OP_WRITE : 3 elem(s) planar >> 0
|
||||
(X = unused, + = exact, 0 = zero)
|
||||
|
||||
The extra metadata on the left of the operation list is just a dump of the
|
||||
internal state used by the optimizer during optimization. It keeps track of
|
||||
knowledge about the pixel values, such as their value range, whether or not
|
||||
they're exact integers, and so on.
|
||||
|
||||
In this example, you can see that the input values are exact (except for
|
||||
the alpha channel, which is undefined), until the first SWS_OP_LINEAR
|
||||
multiplies them by a noninteger constant. They regain their exact integer
|
||||
status only after the (truncating) conversion to U8 in the output step.
|
||||
|
||||
Example of more aggressive optimization
|
||||
---------------------------------------
|
||||
|
||||
Conversion pass for gray -> rgb48:
|
||||
Unoptimized operation list:
|
||||
[ u8 .... -> ....] SWS_OP_READ : 1 elem(s) planar >> 0
|
||||
[ u8 .... -> ....] SWS_OP_SWIZZLE : 0123
|
||||
[ u8 .... -> ....] SWS_OP_RSHIFT : >> 0
|
||||
[ u8 .... -> ....] SWS_OP_CLEAR : {_ 0 0 0}
|
||||
[ u8 .... -> ....] SWS_OP_CONVERT : u8 -> f32
|
||||
[f32 .... -> ....] SWS_OP_LINEAR : luma+alpha [[1/255 0 0 0 0] [0 1 0 0 0] [0 0 1 0 0] [0 0 0 1 1]]
|
||||
[f32 .... -> ....] SWS_OP_LINEAR : matrix3 [[1 0 701/500 0 0] [1 -0.344136 -0.714136 0 0] [1 443/250 0 0 0] [0 0 0 1 0]]
|
||||
[f32 .... -> ....] SWS_OP_LINEAR : diag3 [[65535 0 0 0 0] [0 65535 0 0 0] [0 0 65535 0 0] [0 0 0 1 0]]
|
||||
[f32 .... -> ....] SWS_OP_MAX : {0 0 0 0} <= x
|
||||
[f32 .... -> ....] SWS_OP_MIN : x <= {65535 65535 65535 _}
|
||||
[f32 .... -> ....] SWS_OP_CONVERT : f32 -> u16
|
||||
[u16 .... -> ....] SWS_OP_LSHIFT : << 0
|
||||
[u16 .... -> ....] SWS_OP_SWIZZLE : 0123
|
||||
[u16 .... -> ....] SWS_OP_WRITE : 3 elem(s) packed >> 0
|
||||
|
||||
Optimized operation list:
|
||||
[ u8 XXXX -> +XXX] SWS_OP_READ : 1 elem(s) planar >> 0
|
||||
[ u8 .XXX -> +XXX] SWS_OP_CONVERT : u8 -> u16 (expand)
|
||||
[u16 .XXX -> +++X] SWS_OP_SWIZZLE : 0003
|
||||
[u16 ...X -> +++X] SWS_OP_WRITE : 3 elem(s) packed >> 0
|
||||
(X = unused, + = exact, 0 = zero)
|
||||
|
||||
Here, the optimizer has managed to eliminate all of the unnecessary linear
|
||||
operations on previously zero'd values, turn the resulting column matrix into
|
||||
a swizzle operation, avoid the unnecessary dither (and round trip via float)
|
||||
because the pixel values are guaranteed to be bit exact, and finally, turns
|
||||
the multiplication by 65535 / 255 = 257 into a simple integer expand operation.
|
||||
|
||||
As a final bonus, the x86 backend further optimizes this into a 12-byte shuffle:
|
||||
pshufb = {0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1}
|
||||
|
||||
time=208 us, ref=4212 us, speedup=20.236x faster (single thread)
|
||||
time=57 us, ref=472 us, speedup=8.160x faster (multi thread)
|
||||
|
||||
Compiler and underlying implementation layer (SwsOpChain)
|
||||
---------------------------------------------------------
|
||||
|
||||
While the backend API is flexible enough to permit more exotic implementations
|
||||
(e.g. using JIT code generation), we establish a common set of helpers for use
|
||||
in "traditional" SIMD implementations.
|
||||
|
||||
The basic idea is to have one "kernel" (or implementation) per operation,
|
||||
and then just chain a list of these kernels together as separate function
|
||||
calls. For best performance, we want to keep data in vector registers in
|
||||
between function calls using a custom calling convention, thus avoiding any
|
||||
unnecessary memory accesses. Additionally, we want the per-kernel overhead to
|
||||
be as low as possible, with each kernel ideally just jumping directly into
|
||||
the next kernel.
|
||||
|
||||
As a result, we arrive at a design where we first divide the image into small
|
||||
chunks, or "blocks", and then dispatch the "chain" of kernels on each chunk in
|
||||
sequence. Each kernel processes a fixed number of pixels, with the overall
|
||||
entry point taking care of looping. Remaining pixels (the "tail") are handled
|
||||
generically by the backend-invariant dispatch code (located in ops.c), using a
|
||||
partial memcpy into a suitably sized temporary buffer.
|
||||
|
||||
To minimize the per-kernel function call overhead, we use a "continuation
|
||||
passing style" for chaining kernels. Each operation computes its result and
|
||||
then directly calls the next operation in the sequence, with the appropriate
|
||||
internal function signature.
|
||||
|
||||
The C reference backend reads data into the stack and then passes the array
|
||||
pointers to the next continuation as regular function arguments:
|
||||
|
||||
void process(GlobalContext *ctx, OpContext *op,
|
||||
block_t x, block_t y, block_t z, block_t w)
|
||||
{
|
||||
for (int i = 0; i < SWS_BLOCK_SIZE; i++)
|
||||
// do something with x[i], y[i], z[i], w[i]
|
||||
|
||||
op->next(ctx, &op[1], x, y, z, w);
|
||||
}
|
||||
|
||||
With type conversions pushing the new data onto the stack as well:
|
||||
|
||||
void convert8to16(GlobalContext *ctx, OpContext *op,
|
||||
block_t x, block_t y, block_t z, block_t w)
|
||||
{
|
||||
/* Pseudo-code */
|
||||
u16block_t x16 = (u16block_t) x;
|
||||
u16block_t y16 = (u16block_t) y;
|
||||
u16block_t z16 = (u16block_t) z;
|
||||
u16block_t w16 = (u16block_t) w;
|
||||
|
||||
op->next(ctx, &op[1], x16, y16, z16, w16);
|
||||
}
|
||||
|
||||
By contrast, the x86 backend always keeps the X/Y/Z/W values pinned in specific
|
||||
vector registers (ymm0-ymm3 for the lower half, and ymm4-ymm7 for the second
|
||||
half).
|
||||
|
||||
Each kernel additionally has access to a 32 byte per-op context storing the
|
||||
pointer to the next kernel plus 16 bytes of arbitrary private data. This is
|
||||
used during construction of the function chain to place things like small
|
||||
constants.
|
||||
|
||||
In assembly, the per-kernel overhead looks like this:
|
||||
|
||||
load $tmp, $arg1
|
||||
...
|
||||
add $arg1, 32
|
||||
jump $tmp
|
||||
|
||||
This design gives vastly better performance than the alternative of returning
|
||||
out to a central loop or "trampoline". This is partly because the order of
|
||||
kernels within a chain is always the same, so the branch predictor can easily
|
||||
remember the target address of each "jump" instruction.
|
||||
|
||||
The only way to realistically improve on this design would be to directly
|
||||
stitch the kernel body together using runtime code generation.
|
||||
|
||||
Future considerations and limitations
|
||||
-------------------------------------
|
||||
|
||||
My current prototype has a number of severe limitations and opportunities
|
||||
for improvements:
|
||||
|
||||
1. It does not handle scaling at all. I am not yet entirely sure on how I want
|
||||
to handle scaling; this includes handling of subsampled content. I have a
|
||||
number of vague ideas in my head, but nothing where I can say with certainty
|
||||
that it will work out well.
|
||||
|
||||
It's possible that we won't come up with a perfect solution here, and will
|
||||
need to decide on which set of compromises we are comfortable accepting:
|
||||
|
||||
1. Do we need the ability to scale YUV -> YUV by handling luma and chroma
|
||||
independently? When downscaling 100x100 4:2:0 to 50x50 4:4:4, should we
|
||||
support the option of reusing the chroma plane directly (even though
|
||||
this would introduce a subpixel shift for typical chroma siting)?
|
||||
|
||||
Looking towards zimg, I am also thinking that we probably also want to do
|
||||
scaling on floating point values, since this is best for both performance
|
||||
and accuracy, especially given that we need to go up to 32-bit intermediates
|
||||
during scaling anyway.
|
||||
|
||||
So far, the most promising approach seems to be to handle subsampled
|
||||
input/output as a dedicated read/write operation type; perhaps even with a
|
||||
fixed/static subsampling kernel. To avoid compromising on performance when
|
||||
chroma resampling is not necessary, the optimizer could then relax the
|
||||
pipeline to use non-interpolating read/writes when all intermediate
|
||||
operations are component-independent.
|
||||
|
||||
2. Since each operation is conceptually defined on 4-component pixels, we end
|
||||
up defining a lot of variants of each implementation for each possible
|
||||
*subset*. For example, we have four different implementations for
|
||||
SWS_OP_SCALE in my current templates:
|
||||
- op_scale_1000
|
||||
- op_scale_1001
|
||||
- op_scale_1110
|
||||
- op_scale_1111
|
||||
|
||||
This reflects the four different arrangements of pixel components that are
|
||||
typically present (or absent). While best for performance, it does turn into
|
||||
a bit of a chore when implementing these kernels.
|
||||
|
||||
The only real alternative would be to either branch inside the kernel (bad),
|
||||
or to use separate kernels for each individual component and chain them all
|
||||
together. I have not yet tested whether the latter approach would be faster
|
||||
after the latest round of refactors to the kernel glue code.
|
||||
|
||||
3. I do not yet have any support for LUTs. But when I add them, something we
|
||||
could do is have the optimized pass automatically "promote" a sequence of
|
||||
operations to LUTs. For example, any sequence that looks like:
|
||||
|
||||
1. [u8] SWS_OP_CONVERT -> X
|
||||
2. [X] ... // only per-component operations
|
||||
4. [X] SWS_OP_CONVERT -> Y
|
||||
3. [Y] SWS_OP_WRITE
|
||||
|
||||
could be replaced by a LUT with 256 entries. This is especially important
|
||||
for anything involving packed 8-bit input (e.g. rgb8, rgb4_byte).
|
||||
|
||||
We also definitely want to hook this up to the existing CMS code for
|
||||
transformations between different primaries.
|
||||
|
||||
4. Because we rely on AVRational math to generate the coefficients for
|
||||
operations, we need to be able to represent all pixel values as an
|
||||
AVRational. However, this presents a challenge for 32-bit formats (e.g.
|
||||
GRAY32, RGBA128), because their size exceeds INT_MAX, which is the maximum
|
||||
value representable by an AVRational.
|
||||
|
||||
It's possible we may want to introduce an AVRational64 for this, or
|
||||
perhaps more flexibly, extend AVRational to an AVFloating type which is
|
||||
represented as { AVRational n; int exp; }, representing n/d * 2^exp. This
|
||||
would preserve our ability to represent all pixel values exactly, while
|
||||
opening up the range arbitrarily.
|
||||
|
||||
5. Is there ever a situation where the use of floats introduces the risk of
|
||||
non bit-exact output? For this reason, and possible performance advantages,
|
||||
we may want to explore the use of a fixed-point 16 bit path as an alternative
|
||||
to the floating point math.
|
||||
|
||||
So far, I have managed to avoid any bit exactness issues inside the x86
|
||||
backend by ensuring that the order of linear operations is identical
|
||||
between the C backend and the x86 backend, but this may not be practical
|
||||
to guarantee on all backends. The x86 float code is also dramatically
|
||||
faster than the old fixed point code, so I'm tentatively optimistic about
|
||||
the lack of a need for a fixed point path.
|
||||
0
doc/texi2pod.pl
Executable file → Normal file
0
doc/texi2pod.pl
Executable file → Normal file
2
doc/texidep.pl
Executable file → Normal file
2
doc/texidep.pl
Executable file → Normal file
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env perl
|
||||
#! /usr/bin/env perl
|
||||
|
||||
# This script will print the dependency of a Texinfo file to stdout.
|
||||
# texidep.pl <src-path> <input.texi> <output.ext>
|
||||
|
|
|
|||
|
|
@ -44,3 +44,4 @@ a+b*c;
|
|||
here the reader knows that a,b,c are meant to be signed integers but for C
|
||||
standard compliance / to avoid undefined behavior they are stored in unsigned
|
||||
ints.
|
||||
|
||||
|
|
|
|||
|
|
@ -731,12 +731,8 @@ FL+FR+FC+LFE+BL+BR+SL+SR+TFL+TFR+TBL+TBR
|
|||
FL+FR+FC+LFE+BL+BR+SL+SR+TFL+TFR+TBC+LFE2
|
||||
@item 9.1.4
|
||||
FL+FR+FC+LFE+BL+BR+FLC+FRC+SL+SR+TFL+TFR+TBL+TBR
|
||||
@item 9.1.6
|
||||
FL+FR+FC+LFE+BL+BR+FLC+FRC+SL+SR+TFL+TFR+TBL+TBR+TSL+TSR
|
||||
@item hexadecagonal
|
||||
FL+FR+FC+BL+BR+BC+SL+SR+WL+WR+TBL+TBR+TBC+TFC+TFL+TFR
|
||||
@item binaural
|
||||
BIL+BIR
|
||||
@item downmix
|
||||
DL+DR
|
||||
@item 22.2
|
||||
|
|
@ -805,11 +801,6 @@ The following binary operators are available: @code{+}, @code{-},
|
|||
|
||||
The following unary operators are available: @code{+}, @code{-}.
|
||||
|
||||
Some internal variables can be used to store and load intermediary
|
||||
results. They can be accessed using the @code{ld} and @code{st}
|
||||
functions with an index argument varying from 0 to 9 to specify which
|
||||
internal variable to access.
|
||||
|
||||
The following functions are available:
|
||||
@table @option
|
||||
@item abs(x)
|
||||
|
|
@ -907,9 +898,9 @@ 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 ld(idx)
|
||||
Load the value of the internal variable with index @var{idx}, which was
|
||||
previously stored with st(@var{idx}, @var{expr}).
|
||||
@item ld(var)
|
||||
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 lerp(x, y, z)
|
||||
|
|
@ -942,31 +933,21 @@ Compute the power of @var{x} elevated @var{y}, it is equivalent to
|
|||
|
||||
@item print(t)
|
||||
@item print(t, l)
|
||||
Print the value of expression @var{t} with loglevel @var{l}. If @var{l} is not
|
||||
specified then a default log level is used.
|
||||
Return the value of the expression printed.
|
||||
Print the value of expression @var{t} with loglevel @var{l}. If
|
||||
@var{l} is not specified then a default log level is used.
|
||||
Returns the value of the expression printed.
|
||||
|
||||
Prints t with loglevel l
|
||||
|
||||
@item random(idx)
|
||||
Return a pseudo random value between 0.0 and 1.0. @var{idx} is the
|
||||
index of the internal variable used to save the seed/state, which can be
|
||||
previously stored with @code{st(idx)}.
|
||||
|
||||
To initialize the seed, you need to store the seed value as a 64-bit
|
||||
unsigned integer in the internal variable with index @var{idx}.
|
||||
|
||||
For example, to store the seed with value @code{42} in the internal
|
||||
variable with index @code{0} and print a few random values:
|
||||
@example
|
||||
st(0,42); print(random(0)); print(random(0)); print(random(0))
|
||||
@end example
|
||||
index of the internal variable which will be used to save the
|
||||
seed/state.
|
||||
|
||||
@item randomi(idx, min, max)
|
||||
Return a pseudo random value in the interval between @var{min} and
|
||||
@var{max}. @var{idx} is the index of the internal variable which will be used to
|
||||
save the seed/state, which can be previously stored with @code{st(idx)}.
|
||||
|
||||
To initialize the seed, you need to store the seed value as a 64-bit
|
||||
unsigned integer in the internal variable with index @var{idx}.
|
||||
@var{max}. @var{idx} is the index of the internal variable which will
|
||||
be used to save the seed/state.
|
||||
|
||||
@item root(expr, max)
|
||||
Find an input value for which the function represented by @var{expr}
|
||||
|
|
@ -975,14 +956,14 @@ with argument @var{ld(0)} is 0 in the interval 0..@var{max}.
|
|||
The expression in @var{expr} must denote a continuous function or the
|
||||
result is undefined.
|
||||
|
||||
@var{ld(0)} is used to represent the function input value, which means that the
|
||||
given expression will be evaluated multiple times with various input values that
|
||||
the expression can access through @code{ld(0)}. When the expression evaluates to
|
||||
0 then the corresponding input value will be returned.
|
||||
@var{ld(0)} is used to represent the function input value, which means
|
||||
that the given expression will be evaluated multiple times with
|
||||
various input values that the expression can access through
|
||||
@code{ld(0)}. When the expression evaluates to 0 then the
|
||||
corresponding input value will be returned.
|
||||
|
||||
@item round(expr)
|
||||
Round the value of expression @var{expr} to the nearest integer. For example,
|
||||
"round(1.5)" is "2.0".
|
||||
Round the value of expression @var{expr} to the nearest integer. For example, "round(1.5)" is "2.0".
|
||||
|
||||
@item sgn(x)
|
||||
Compute sign of @var{x}.
|
||||
|
|
@ -1000,15 +981,12 @@ Compute the square root of @var{expr}. This is equivalent to
|
|||
@item squish(x)
|
||||
Compute expression @code{1/(1 + exp(4*x))}.
|
||||
|
||||
@item st(idx, expr)
|
||||
@item st(var, expr)
|
||||
Store the value of the expression @var{expr} in an internal
|
||||
variable. @var{idx} specifies the index 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.
|
||||
|
||||
The stored value can be retrieved with @code{ld(var)}.
|
||||
|
||||
Note: variables are currently not shared between expressions.
|
||||
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 tan(x)
|
||||
Compute tangent of @var{x}.
|
||||
|
|
@ -1017,16 +995,16 @@ Compute tangent of @var{x}.
|
|||
Compute hyperbolic tangent of @var{x}.
|
||||
|
||||
@item taylor(expr, x)
|
||||
@item taylor(expr, x, idx)
|
||||
@item taylor(expr, x, id)
|
||||
Evaluate a Taylor series at @var{x}, given an expression representing
|
||||
the @code{ld(idx)}-th derivative of a function at 0.
|
||||
the @code{ld(id)}-th derivative of a function at 0.
|
||||
|
||||
When the series does not converge the result is undefined.
|
||||
|
||||
@var{ld(idx)} is used to represent the derivative order in @var{expr},
|
||||
@var{ld(id)} is used to represent the derivative order in @var{expr},
|
||||
which means that the given expression will be evaluated multiple times
|
||||
with various input values that the expression can access through
|
||||
@code{ld(idx)}. If @var{idx} is not specified then 0 is assumed.
|
||||
@code{ld(id)}. If @var{id} is not specified then 0 is assumed.
|
||||
|
||||
Note, when you have the derivatives at y instead of 0,
|
||||
@code{taylor(expr, x-y)} can be used.
|
||||
|
|
|
|||
|
|
@ -3,8 +3,6 @@ OBJS-$(HAVE_ARMV6) += $(ARMV6-OBJS) $(ARMV6-OBJS-yes)
|
|||
OBJS-$(HAVE_ARMV8) += $(ARMV8-OBJS) $(ARMV8-OBJS-yes)
|
||||
OBJS-$(HAVE_VFP) += $(VFP-OBJS) $(VFP-OBJS-yes)
|
||||
OBJS-$(HAVE_NEON) += $(NEON-OBJS) $(NEON-OBJS-yes)
|
||||
OBJS-$(HAVE_SVE) += $(SVE-OBJS) $(SVE-OBJS-yes)
|
||||
OBJS-$(HAVE_SVE2) += $(SVE2-OBJS) $(SVE2-OBJS-yes)
|
||||
|
||||
OBJS-$(HAVE_MIPSFPU) += $(MIPSFPU-OBJS) $(MIPSFPU-OBJS-yes)
|
||||
OBJS-$(HAVE_MIPSDSP) += $(MIPSDSP-OBJS) $(MIPSDSP-OBJS-yes)
|
||||
|
|
@ -19,9 +17,6 @@ OBJS-$(HAVE_VSX) += $(VSX-OBJS) $(VSX-OBJS-yes)
|
|||
|
||||
OBJS-$(HAVE_RV) += $(RV-OBJS) $(RV-OBJS-yes)
|
||||
OBJS-$(HAVE_RVV) += $(RVV-OBJS) $(RVV-OBJS-yes)
|
||||
OBJS-$(HAVE_RV_ZVBB) += $(RVVB-OBJS) $(RVVB-OBJS-yes)
|
||||
|
||||
OBJS-$(HAVE_SIMD128) += $(SIMD128-OBJS) $(SIMD128-OBJS-yes)
|
||||
|
||||
OBJS-$(HAVE_MMX) += $(MMX-OBJS) $(MMX-OBJS-yes)
|
||||
OBJS-$(HAVE_X86ASM) += $(X86ASM-OBJS) $(X86ASM-OBJS-yes)
|
||||
|
|
|
|||
|
|
@ -38,10 +38,8 @@ int main(int argc, char **argv)
|
|||
return -1;
|
||||
|
||||
output = fopen(argv[2], "wb");
|
||||
if (!output) {
|
||||
fclose(input);
|
||||
if (!output)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (argc == 4) {
|
||||
name = argv[3];
|
||||
|
|
@ -69,10 +67,8 @@ int main(int argc, char **argv)
|
|||
|
||||
fclose(output);
|
||||
|
||||
if (ferror(input) || !feof(input)) {
|
||||
fclose(input);
|
||||
if (ferror(input) || !feof(input))
|
||||
return -1;
|
||||
}
|
||||
|
||||
fclose(input);
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ BIN2C = $(BIN2CEXE)
|
|||
ifndef V
|
||||
Q = @
|
||||
ECHO = printf "$(1)\t%s\n" $(2)
|
||||
BRIEF = CC CXX OBJCC HOSTCC HOSTLD AS X86ASM AR LD STRIP CP WINDRES NVCC BIN2C METALCC METALLIB
|
||||
BRIEF = CC CXX OBJCC HOSTCC HOSTLD AS X86ASM AR LD STRIP CP WINDRES NVCC BIN2C
|
||||
SILENT = DEPCC DEPHOSTCC DEPAS DEPX86ASM RANLIB RM
|
||||
|
||||
MSG = $@
|
||||
|
|
@ -115,12 +115,6 @@ COMPILE_LASX = $(call COMPILE,CC,LASXFLAGS)
|
|||
$(BIN2CEXE): ffbuild/bin2c_host.o
|
||||
$(HOSTLD) $(HOSTLDFLAGS) $(HOSTLD_O) $^ $(HOSTEXTRALIBS)
|
||||
|
||||
RUN_BIN2C = $(BIN2C) $(patsubst $(SRC_PATH)/%,$(SRC_LINK)/%,$<) $@ $(subst .,_,$(basename $(notdir $@)))
|
||||
RUN_GZIP = $(M)gzip -nc9 $(patsubst $(SRC_PATH)/%,$(SRC_LINK)/%,$<) >$@
|
||||
RUN_MINIFY = $(M)sed 's!/\\*.*\\*/!!g' $< | tr '\n' ' ' | tr -s ' ' | sed 's/^ //; s/ $$//' > $@
|
||||
%.gz: TAG = GZIP
|
||||
%.min: TAG = MINIFY
|
||||
|
||||
%.metal.air: %.metal
|
||||
$(METALCC) $< -o $@
|
||||
|
||||
|
|
@ -128,46 +122,21 @@ RUN_MINIFY = $(M)sed 's!/\\*.*\\*/!!g' $< | tr '\n' ' ' | tr -s ' ' | sed 's/^ /
|
|||
$(METALLIB) --split-module-without-linking $< -o $@
|
||||
|
||||
%.metallib.c: %.metallib $(BIN2CEXE)
|
||||
$(RUN_BIN2C)
|
||||
$(BIN2C) $< $@ $(subst .,_,$(basename $(notdir $@)))
|
||||
|
||||
%.ptx: %.cu $(SRC_PATH)/compat/cuda/cuda_runtime.h
|
||||
$(COMPILE_NVCC)
|
||||
|
||||
ifdef CONFIG_PTX_COMPRESSION
|
||||
%.ptx.gz: TAG = GZIP
|
||||
%.ptx.gz: %.ptx
|
||||
$(RUN_GZIP)
|
||||
$(M)gzip -nc9 $(patsubst $(SRC_PATH)/%,$(SRC_LINK)/%,$<) >$@
|
||||
|
||||
%.ptx.c: %.ptx.gz $(BIN2CEXE)
|
||||
$(RUN_BIN2C)
|
||||
$(BIN2C) $(patsubst $(SRC_PATH)/%,$(SRC_LINK)/%,$<) $@ $(subst .,_,$(basename $(notdir $@)))
|
||||
else
|
||||
%.ptx.c: %.ptx $(BIN2CEXE)
|
||||
$(RUN_BIN2C)
|
||||
endif
|
||||
|
||||
%.css.min: %.css
|
||||
$(RUN_MINIFY)
|
||||
|
||||
ifdef CONFIG_RESOURCE_COMPRESSION
|
||||
|
||||
%.css.min.gz: %.css.min
|
||||
$(RUN_GZIP)
|
||||
|
||||
%.css.c: %.css.min.gz $(BIN2CEXE)
|
||||
$(RUN_BIN2C)
|
||||
|
||||
%.html.gz: %.html
|
||||
$(RUN_GZIP)
|
||||
|
||||
%.html.c: %.html.gz $(BIN2CEXE)
|
||||
$(RUN_BIN2C)
|
||||
|
||||
else # NO COMPRESSION
|
||||
|
||||
%.css.c: %.css.min $(BIN2CEXE)
|
||||
$(RUN_BIN2C)
|
||||
|
||||
%.html.c: %.html $(BIN2CEXE)
|
||||
$(RUN_BIN2C)
|
||||
$(BIN2C) $(patsubst $(SRC_PATH)/%,$(SRC_LINK)/%,$<) $@ $(subst .,_,$(basename $(notdir $@)))
|
||||
endif
|
||||
|
||||
clean::
|
||||
|
|
@ -190,6 +159,7 @@ endif
|
|||
include $(SRC_PATH)/ffbuild/arch.mak
|
||||
|
||||
OBJS += $(OBJS-yes)
|
||||
SLIBOBJS += $(SLIBOBJS-yes)
|
||||
SHLIBOBJS += $(SHLIBOBJS-yes)
|
||||
STLIBOBJS += $(STLIBOBJS-yes)
|
||||
FFLIBS := $($(NAME)_FFLIBS) $(FFLIBS-yes) $(FFLIBS)
|
||||
|
|
@ -199,6 +169,7 @@ LDLIBS = $(FFLIBS:%=%$(BUILDSUF))
|
|||
FFEXTRALIBS := $(LDLIBS:%=$(LD_LIB)) $(foreach lib,EXTRALIBS-$(NAME) $(FFLIBS:%=EXTRALIBS-%),$($(lib))) $(EXTRALIBS)
|
||||
|
||||
OBJS := $(sort $(OBJS:%=$(SUBDIR)%))
|
||||
SLIBOBJS := $(sort $(SLIBOBJS:%=$(SUBDIR)%))
|
||||
SHLIBOBJS := $(sort $(SHLIBOBJS:%=$(SUBDIR)%))
|
||||
STLIBOBJS := $(sort $(STLIBOBJS:%=$(SUBDIR)%))
|
||||
TESTOBJS := $(TESTOBJS:%=$(SUBDIR)tests/%) $(TESTPROGS:%=$(SUBDIR)tests/%.o)
|
||||
|
|
@ -223,6 +194,7 @@ PTXOBJS = $(filter %.ptx.o,$(OBJS))
|
|||
$(HOBJS): CCFLAGS += $(CFLAGS_HEADERS)
|
||||
checkheaders: $(HOBJS)
|
||||
.SECONDARY: $(HOBJS:.o=.c) $(PTXOBJS:.o=.c) $(PTXOBJS:.o=.gz) $(PTXOBJS:.o=)
|
||||
|
||||
alltools: $(TOOLS)
|
||||
|
||||
$(HOSTOBJS): %.o: %.c
|
||||
|
|
@ -234,14 +206,15 @@ $(HOSTPROGS): %$(HOSTEXESUF): %.o
|
|||
$(OBJS): | $(sort $(dir $(OBJS)))
|
||||
$(HOBJS): | $(sort $(dir $(HOBJS)))
|
||||
$(HOSTOBJS): | $(sort $(dir $(HOSTOBJS)))
|
||||
$(SLIBOBJS): | $(sort $(dir $(SLIBOBJS)))
|
||||
$(SHLIBOBJS): | $(sort $(dir $(SHLIBOBJS)))
|
||||
$(STLIBOBJS): | $(sort $(dir $(STLIBOBJS)))
|
||||
$(TESTOBJS): | $(sort $(dir $(TESTOBJS)))
|
||||
$(TOOLOBJS): | tools
|
||||
|
||||
OUTDIRS := $(OUTDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(SHLIBOBJS) $(STLIBOBJS) $(TESTOBJS))
|
||||
OUTDIRS := $(OUTDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(SLIBOBJS) $(SHLIBOBJS) $(STLIBOBJS) $(TESTOBJS))
|
||||
|
||||
CLEANSUFFIXES = *.d *.gcda *.gcno *.h.c *.ho *.map *.o *.objs *.pc *.ptx *.ptx.gz *.ptx.c *.ver *.version *.html.gz *.html.c *.css.min.gz *.css.min *.css.c *$(DEFAULT_X86ASMD).asm *~ *.ilk *.pdb
|
||||
CLEANSUFFIXES = *.d *.gcda *.gcno *.h.c *.ho *.map *.o *.pc *.ptx *.ptx.gz *.ptx.c *.ver *.version *$(DEFAULT_X86ASMD).asm *~ *.ilk *.pdb
|
||||
LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a
|
||||
|
||||
define RULES
|
||||
|
|
@ -251,4 +224,4 @@ endef
|
|||
|
||||
$(eval $(RULES))
|
||||
|
||||
-include $(wildcard $(OBJS:.o=.d) $(HOSTOBJS:.o=.d) $(TESTOBJS:.o=.d) $(HOBJS:.o=.d) $(SHLIBOBJS:.o=.d) $(STLIBOBJS:.o=.d)) $(OBJS:.o=$(DEFAULT_X86ASMD).d)
|
||||
-include $(wildcard $(OBJS:.o=.d) $(HOSTOBJS:.o=.d) $(TESTOBJS:.o=.d) $(HOBJS:.o=.d) $(SHLIBOBJS:.o=.d) $(STLIBOBJS:.o=.d) $(SLIBOBJS:.o=.d)) $(OBJS:.o=$(DEFAULT_X86ASMD).d)
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ ifdef CONFIG_SHARED
|
|||
# for purely shared builds.
|
||||
# Test programs are always statically linked against their library
|
||||
# to be able to access their library's internals, even with shared builds.
|
||||
# Yet linking against dependent libraries still uses dynamic linking.
|
||||
# Yet linking against dependend libraries still uses dynamic linking.
|
||||
# This means that we are in the scenario described above.
|
||||
# In case only static libs are used, the linker will only use
|
||||
# one of these copies; this depends on the duplicated object files
|
||||
|
|
@ -35,14 +35,8 @@ OBJS += $(SHLIBOBJS)
|
|||
endif
|
||||
$(SUBDIR)$(LIBNAME): $(OBJS) $(STLIBOBJS)
|
||||
$(RM) $@
|
||||
ifeq ($(RESPONSE_FILES),yes)
|
||||
$(Q)echo $^ > $@.objs
|
||||
$(AR) $(ARFLAGS) $(AR_O) @$@.objs
|
||||
else
|
||||
$(AR) $(ARFLAGS) $(AR_O) $^
|
||||
endif
|
||||
$(RANLIB) $@
|
||||
-$(RM) $@.objs
|
||||
|
||||
install-headers: install-lib$(NAME)-headers install-lib$(NAME)-pkgconfig
|
||||
|
||||
|
|
@ -70,16 +64,10 @@ $(SUBDIR)lib$(NAME).ver: $(SUBDIR)lib$(NAME).v $(OBJS)
|
|||
$(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
|
||||
$(Q)cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME)
|
||||
|
||||
$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SHLIBOBJS) $(SUBDIR)lib$(NAME).ver
|
||||
$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SHLIBOBJS) $(SLIBOBJS) $(SUBDIR)lib$(NAME).ver
|
||||
$(SLIB_CREATE_DEF_CMD)
|
||||
ifeq ($(RESPONSE_FILES),yes)
|
||||
$(Q)echo $$(filter %.o,$$^) > $$@.objs
|
||||
$$(LD) $(SHFLAGS) $(LDFLAGS) $(LDSOFLAGS) $$(LD_O) @$$@.objs $(FFEXTRALIBS)
|
||||
else
|
||||
$$(LD) $(SHFLAGS) $(LDFLAGS) $(LDSOFLAGS) $$(LD_O) $$(filter %.o,$$^) $(FFEXTRALIBS)
|
||||
endif
|
||||
$(SLIB_EXTRA_CMD)
|
||||
-$(RM) $$@.objs
|
||||
|
||||
ifdef SUBDIR
|
||||
$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(DEP_LIBS)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
#!/bin/sh
|
||||
toupper(){
|
||||
echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ includedir=${source_path}
|
|||
prefix=
|
||||
exec_prefix=
|
||||
libdir=\${pcfiledir}/../../../$name
|
||||
includedir=${includedir}
|
||||
includedir=${source_path}
|
||||
|
||||
Name: $fullname
|
||||
Description: $comment
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@ AVBASENAMES = ffmpeg ffplay ffprobe
|
|||
ALLAVPROGS = $(AVBASENAMES:%=%$(PROGSSUF)$(EXESUF))
|
||||
ALLAVPROGS_G = $(AVBASENAMES:%=%$(PROGSSUF)_g$(EXESUF))
|
||||
|
||||
include $(SRC_PATH)/fftools/resources/Makefile
|
||||
|
||||
OBJS-ffmpeg += \
|
||||
fftools/ffmpeg_dec.o \
|
||||
fftools/ffmpeg_demux.o \
|
||||
|
|
@ -21,35 +19,9 @@ OBJS-ffmpeg += \
|
|||
fftools/ffmpeg_mux_init.o \
|
||||
fftools/ffmpeg_opt.o \
|
||||
fftools/ffmpeg_sched.o \
|
||||
fftools/graph/graphprint.o \
|
||||
fftools/objpool.o \
|
||||
fftools/sync_queue.o \
|
||||
fftools/thread_queue.o \
|
||||
fftools/textformat/avtextformat.o \
|
||||
fftools/textformat/tf_compact.o \
|
||||
fftools/textformat/tf_default.o \
|
||||
fftools/textformat/tf_flat.o \
|
||||
fftools/textformat/tf_ini.o \
|
||||
fftools/textformat/tf_json.o \
|
||||
fftools/textformat/tf_mermaid.o \
|
||||
fftools/textformat/tf_xml.o \
|
||||
fftools/textformat/tw_avio.o \
|
||||
fftools/textformat/tw_buffer.o \
|
||||
fftools/textformat/tw_stdout.o \
|
||||
$(OBJS-resman) \
|
||||
$(RESOBJS) \
|
||||
|
||||
OBJS-ffprobe += \
|
||||
fftools/textformat/avtextformat.o \
|
||||
fftools/textformat/tf_compact.o \
|
||||
fftools/textformat/tf_default.o \
|
||||
fftools/textformat/tf_flat.o \
|
||||
fftools/textformat/tf_ini.o \
|
||||
fftools/textformat/tf_json.o \
|
||||
fftools/textformat/tf_mermaid.o \
|
||||
fftools/textformat/tf_xml.o \
|
||||
fftools/textformat/tw_avio.o \
|
||||
fftools/textformat/tw_buffer.o \
|
||||
fftools/textformat/tw_stdout.o \
|
||||
|
||||
OBJS-ffplay += fftools/ffplay_renderer.o
|
||||
|
||||
|
|
@ -59,7 +31,7 @@ ifdef HAVE_GNU_WINDRES
|
|||
OBJS-$(1) += fftools/fftoolsres.o
|
||||
endif
|
||||
$(1)$(PROGSSUF)_g$(EXESUF): $$(OBJS-$(1))
|
||||
$$(OBJS-$(1)): | fftools fftools/textformat fftools/resources fftools/graph
|
||||
$$(OBJS-$(1)): | fftools
|
||||
$$(OBJS-$(1)): CFLAGS += $(CFLAGS-$(1))
|
||||
$(1)$(PROGSSUF)_g$(EXESUF): LDFLAGS += $(LDFLAGS-$(1))
|
||||
$(1)$(PROGSSUF)_g$(EXESUF): FF_EXTRALIBS += $(EXTRALIBS-$(1))
|
||||
|
|
@ -72,9 +44,6 @@ all: $(AVPROGS)
|
|||
|
||||
fftools/ffprobe.o fftools/cmdutils.o: libavutil/ffversion.h | fftools
|
||||
OUTDIRS += fftools
|
||||
OUTDIRS += fftools/textformat
|
||||
OUTDIRS += fftools/resources
|
||||
OUTDIRS += fftools/graph
|
||||
|
||||
ifdef AVPROGS
|
||||
install: install-progs install-data
|
||||
|
|
@ -93,4 +62,4 @@ uninstall-progs:
|
|||
$(RM) $(addprefix "$(BINDIR)/", $(ALLAVPROGS))
|
||||
|
||||
clean::
|
||||
$(RM) $(ALLAVPROGS) $(ALLAVPROGS_G) $(CLEANSUFFIXES:%=fftools/%) $(CLEANSUFFIXES:%=fftools/graph/%) $(CLEANSUFFIXES:%=fftools/textformat/%)
|
||||
$(RM) $(ALLAVPROGS) $(ALLAVPROGS_G) $(CLEANSUFFIXES:%=fftools/%)
|
||||
|
|
|
|||
|
|
@ -33,14 +33,17 @@
|
|||
#include "compat/va_copy.h"
|
||||
#include "libavformat/avformat.h"
|
||||
#include "libswscale/swscale.h"
|
||||
#include "libswscale/version.h"
|
||||
#include "libswresample/swresample.h"
|
||||
#include "libavutil/avassert.h"
|
||||
#include "libavutil/avstring.h"
|
||||
#include "libavutil/bprint.h"
|
||||
#include "libavutil/channel_layout.h"
|
||||
#include "libavutil/display.h"
|
||||
#include "libavutil/getenv_utf8.h"
|
||||
#include "libavutil/mathematics.h"
|
||||
#include "libavutil/imgutils.h"
|
||||
#include "libavutil/libm.h"
|
||||
#include "libavutil/mem.h"
|
||||
#include "libavutil/parseutils.h"
|
||||
#include "libavutil/eval.h"
|
||||
#include "libavutil/dict.h"
|
||||
|
|
@ -246,8 +249,6 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt,
|
|||
(uint8_t *)optctx + po->u.off : po->u.dst_ptr;
|
||||
char *arg_allocated = NULL;
|
||||
|
||||
enum OptionType so_type = po->type;
|
||||
|
||||
SpecifierOptList *sol = NULL;
|
||||
double num;
|
||||
int ret = 0;
|
||||
|
|
@ -255,10 +256,9 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt,
|
|||
if (*opt == '/') {
|
||||
opt++;
|
||||
|
||||
if (!opt_has_arg(po)) {
|
||||
if (po->type == OPT_TYPE_BOOL) {
|
||||
av_log(NULL, AV_LOG_FATAL,
|
||||
"Requested to load an argument from file for an option '%s'"
|
||||
" which does not take an argument\n",
|
||||
"Requested to load an argument from file for a bool option '%s'\n",
|
||||
po->name);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
|
@ -289,14 +289,6 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt,
|
|||
goto finish;
|
||||
}
|
||||
sol->opt[sol->nb_opt - 1].specifier = str;
|
||||
|
||||
if (po->flags & OPT_FLAG_PERSTREAM) {
|
||||
ret = stream_specifier_parse(&sol->opt[sol->nb_opt - 1].stream_spec,
|
||||
str, 0, NULL);
|
||||
if (ret < 0)
|
||||
goto finish;
|
||||
}
|
||||
|
||||
dst = &sol->opt[sol->nb_opt - 1].u;
|
||||
}
|
||||
|
||||
|
|
@ -321,9 +313,8 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt,
|
|||
goto finish;
|
||||
|
||||
*(int *)dst = num;
|
||||
so_type = OPT_TYPE_INT;
|
||||
} else if (po->type == OPT_TYPE_INT64) {
|
||||
ret = parse_number(opt, arg, OPT_TYPE_INT64, INT64_MIN, (double)INT64_MAX, &num);
|
||||
ret = parse_number(opt, arg, OPT_TYPE_INT64, INT64_MIN, INT64_MAX, &num);
|
||||
if (ret < 0)
|
||||
goto finish;
|
||||
|
||||
|
|
@ -335,7 +326,6 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt,
|
|||
opt, arg);
|
||||
goto finish;
|
||||
}
|
||||
so_type = OPT_TYPE_INT64;
|
||||
} else if (po->type == OPT_TYPE_FLOAT) {
|
||||
ret = parse_number(opt, arg, OPT_TYPE_FLOAT, -INFINITY, INFINITY, &num);
|
||||
if (ret < 0)
|
||||
|
|
@ -353,11 +343,9 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt,
|
|||
|
||||
ret = po->u.func_arg(optctx, opt, arg);
|
||||
if (ret < 0) {
|
||||
if ((strcmp(opt, "init_hw_device") != 0) || (strcmp(arg, "list") != 0)) {
|
||||
av_log(NULL, AV_LOG_ERROR,
|
||||
"Failed to set value '%s' for option '%s': %s\n",
|
||||
arg, opt, av_err2str(ret));
|
||||
}
|
||||
av_log(NULL, AV_LOG_ERROR,
|
||||
"Failed to set value '%s' for option '%s': %s\n",
|
||||
arg, opt, av_err2str(ret));
|
||||
goto finish;
|
||||
}
|
||||
}
|
||||
|
|
@ -367,7 +355,7 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt,
|
|||
}
|
||||
|
||||
if (sol) {
|
||||
sol->type = so_type;
|
||||
sol->type = po->type;
|
||||
sol->opt_canon = (po->flags & OPT_HAS_CANON) ?
|
||||
find_option(defs, po->u1.name_canon) : po;
|
||||
}
|
||||
|
|
@ -495,9 +483,8 @@ int locate_option(int argc, char **argv, const OptionDef *options,
|
|||
for (i = 1; i < argc; i++) {
|
||||
const char *cur_opt = argv[i];
|
||||
|
||||
if (!(cur_opt[0] == '-' && cur_opt[1]))
|
||||
if (*cur_opt++ != '-')
|
||||
continue;
|
||||
cur_opt++;
|
||||
|
||||
po = find_option(options, cur_opt);
|
||||
if (!po->name && cur_opt[0] == 'n' && cur_opt[1] == 'o')
|
||||
|
|
@ -555,12 +542,11 @@ static void check_options(const OptionDef *po)
|
|||
|
||||
void parse_loglevel(int argc, char **argv, const OptionDef *options)
|
||||
{
|
||||
int idx;
|
||||
int idx = locate_option(argc, argv, options, "loglevel");
|
||||
char *env;
|
||||
|
||||
check_options(options);
|
||||
|
||||
idx = locate_option(argc, argv, options, "loglevel");
|
||||
if (!idx)
|
||||
idx = locate_option(argc, argv, options, "v");
|
||||
if (idx && argv[idx + 1])
|
||||
|
|
@ -807,7 +793,7 @@ int split_commandline(OptionParseContext *octx, int argc, char *argv[],
|
|||
while (optindex < argc) {
|
||||
const char *opt = argv[optindex++], *arg;
|
||||
const OptionDef *po;
|
||||
int group_idx;
|
||||
int ret, group_idx;
|
||||
|
||||
av_log(NULL, AV_LOG_DEBUG, "Reading option '%s' ...", opt);
|
||||
|
||||
|
|
@ -993,366 +979,17 @@ FILE *get_preset_file(char *filename, size_t filename_size,
|
|||
return f;
|
||||
}
|
||||
|
||||
int cmdutils_isalnum(char c)
|
||||
{
|
||||
return (c >= '0' && c <= '9') ||
|
||||
(c >= 'A' && c <= 'Z') ||
|
||||
(c >= 'a' && c <= 'z');
|
||||
}
|
||||
|
||||
void stream_specifier_uninit(StreamSpecifier *ss)
|
||||
{
|
||||
av_freep(&ss->meta_key);
|
||||
av_freep(&ss->meta_val);
|
||||
av_freep(&ss->remainder);
|
||||
|
||||
memset(ss, 0, sizeof(*ss));
|
||||
}
|
||||
|
||||
int stream_specifier_parse(StreamSpecifier *ss, const char *spec,
|
||||
int allow_remainder, void *logctx)
|
||||
{
|
||||
char *endptr;
|
||||
int ret;
|
||||
|
||||
memset(ss, 0, sizeof(*ss));
|
||||
|
||||
ss->idx = -1;
|
||||
ss->media_type = AVMEDIA_TYPE_UNKNOWN;
|
||||
ss->stream_list = STREAM_LIST_ALL;
|
||||
|
||||
av_log(logctx, AV_LOG_TRACE, "Parsing stream specifier: %s\n", spec);
|
||||
|
||||
while (*spec) {
|
||||
if (*spec <= '9' && *spec >= '0') { /* opt:index */
|
||||
ss->idx = strtol(spec, &endptr, 0);
|
||||
|
||||
av_assert0(endptr > spec);
|
||||
spec = endptr;
|
||||
|
||||
av_log(logctx, AV_LOG_TRACE,
|
||||
"Parsed index: %d; remainder: %s\n", ss->idx, spec);
|
||||
|
||||
// this terminates the specifier
|
||||
break;
|
||||
} else if ((*spec == 'v' || *spec == 'a' || *spec == 's' ||
|
||||
*spec == 'd' || *spec == 't' || *spec == 'V') &&
|
||||
!cmdutils_isalnum(*(spec + 1))) { /* opt:[vasdtV] */
|
||||
if (ss->media_type != AVMEDIA_TYPE_UNKNOWN) {
|
||||
av_log(logctx, AV_LOG_ERROR, "Stream type specified multiple times\n");
|
||||
ret = AVERROR(EINVAL);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
switch (*spec++) {
|
||||
case 'v': ss->media_type = AVMEDIA_TYPE_VIDEO; break;
|
||||
case 'a': ss->media_type = AVMEDIA_TYPE_AUDIO; break;
|
||||
case 's': ss->media_type = AVMEDIA_TYPE_SUBTITLE; break;
|
||||
case 'd': ss->media_type = AVMEDIA_TYPE_DATA; break;
|
||||
case 't': ss->media_type = AVMEDIA_TYPE_ATTACHMENT; break;
|
||||
case 'V': ss->media_type = AVMEDIA_TYPE_VIDEO;
|
||||
ss->no_apic = 1; break;
|
||||
default: av_assert0(0);
|
||||
}
|
||||
|
||||
av_log(logctx, AV_LOG_TRACE, "Parsed media type: %s; remainder: %s\n",
|
||||
av_get_media_type_string(ss->media_type), spec);
|
||||
} else if (*spec == 'g' && *(spec + 1) == ':') {
|
||||
if (ss->stream_list != STREAM_LIST_ALL)
|
||||
goto multiple_stream_lists;
|
||||
|
||||
spec += 2;
|
||||
if (*spec == '#' || (*spec == 'i' && *(spec + 1) == ':')) {
|
||||
ss->stream_list = STREAM_LIST_GROUP_ID;
|
||||
|
||||
spec += 1 + (*spec == 'i');
|
||||
} else
|
||||
ss->stream_list = STREAM_LIST_GROUP_IDX;
|
||||
|
||||
ss->list_id = strtol(spec, &endptr, 0);
|
||||
if (spec == endptr) {
|
||||
av_log(logctx, AV_LOG_ERROR, "Expected stream group idx/ID, got: %s\n", spec);
|
||||
ret = AVERROR(EINVAL);
|
||||
goto fail;
|
||||
}
|
||||
spec = endptr;
|
||||
|
||||
av_log(logctx, AV_LOG_TRACE, "Parsed stream group %s: %"PRId64"; remainder: %s\n",
|
||||
ss->stream_list == STREAM_LIST_GROUP_ID ? "ID" : "index", ss->list_id, spec);
|
||||
} else if (*spec == 'p' && *(spec + 1) == ':') {
|
||||
if (ss->stream_list != STREAM_LIST_ALL)
|
||||
goto multiple_stream_lists;
|
||||
|
||||
ss->stream_list = STREAM_LIST_PROGRAM;
|
||||
|
||||
spec += 2;
|
||||
ss->list_id = strtol(spec, &endptr, 0);
|
||||
if (spec == endptr) {
|
||||
av_log(logctx, AV_LOG_ERROR, "Expected program ID, got: %s\n", spec);
|
||||
ret = AVERROR(EINVAL);
|
||||
goto fail;
|
||||
}
|
||||
spec = endptr;
|
||||
|
||||
av_log(logctx, AV_LOG_TRACE,
|
||||
"Parsed program ID: %"PRId64"; remainder: %s\n", ss->list_id, spec);
|
||||
} else if (!strncmp(spec, "disp:", 5)) {
|
||||
const AVClass *st_class = av_stream_get_class();
|
||||
const AVOption *o = av_opt_find(&st_class, "disposition", NULL, 0, AV_OPT_SEARCH_FAKE_OBJ);
|
||||
char *disp = NULL;
|
||||
size_t len;
|
||||
|
||||
av_assert0(o);
|
||||
|
||||
if (ss->disposition) {
|
||||
av_log(logctx, AV_LOG_ERROR, "Multiple disposition specifiers\n");
|
||||
ret = AVERROR(EINVAL);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
spec += 5;
|
||||
|
||||
for (len = 0; cmdutils_isalnum(spec[len]) ||
|
||||
spec[len] == '_' || spec[len] == '+'; len++)
|
||||
continue;
|
||||
|
||||
disp = av_strndup(spec, len);
|
||||
if (!disp) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
ret = av_opt_eval_flags(&st_class, o, disp, &ss->disposition);
|
||||
av_freep(&disp);
|
||||
if (ret < 0) {
|
||||
av_log(logctx, AV_LOG_ERROR, "Invalid disposition specifier\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
spec += len;
|
||||
|
||||
av_log(logctx, AV_LOG_TRACE,
|
||||
"Parsed disposition: 0x%x; remainder: %s\n", ss->disposition, spec);
|
||||
} else if (*spec == '#' ||
|
||||
(*spec == 'i' && *(spec + 1) == ':')) {
|
||||
if (ss->stream_list != STREAM_LIST_ALL)
|
||||
goto multiple_stream_lists;
|
||||
|
||||
ss->stream_list = STREAM_LIST_STREAM_ID;
|
||||
|
||||
spec += 1 + (*spec == 'i');
|
||||
ss->list_id = strtol(spec, &endptr, 0);
|
||||
if (spec == endptr) {
|
||||
av_log(logctx, AV_LOG_ERROR, "Expected stream ID, got: %s\n", spec);
|
||||
ret = AVERROR(EINVAL);
|
||||
goto fail;
|
||||
}
|
||||
spec = endptr;
|
||||
|
||||
av_log(logctx, AV_LOG_TRACE,
|
||||
"Parsed stream ID: %"PRId64"; remainder: %s\n", ss->list_id, spec);
|
||||
|
||||
// this terminates the specifier
|
||||
break;
|
||||
} else if (*spec == 'm' && *(spec + 1) == ':') {
|
||||
av_assert0(!ss->meta_key && !ss->meta_val);
|
||||
|
||||
spec += 2;
|
||||
ss->meta_key = av_get_token(&spec, ":");
|
||||
if (!ss->meta_key) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto fail;
|
||||
}
|
||||
if (*spec == ':') {
|
||||
spec++;
|
||||
ss->meta_val = av_get_token(&spec, ":");
|
||||
if (!ss->meta_val) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
||||
av_log(logctx, AV_LOG_TRACE,
|
||||
"Parsed metadata: %s:%s; remainder: %s", ss->meta_key,
|
||||
ss->meta_val ? ss->meta_val : "<any value>", spec);
|
||||
|
||||
// this terminates the specifier
|
||||
break;
|
||||
} else if (*spec == 'u' && (*(spec + 1) == '\0' || *(spec + 1) == ':')) {
|
||||
ss->usable_only = 1;
|
||||
spec++;
|
||||
av_log(logctx, AV_LOG_ERROR, "Parsed 'usable only'\n");
|
||||
|
||||
// this terminates the specifier
|
||||
break;
|
||||
} else
|
||||
break;
|
||||
|
||||
if (*spec == ':')
|
||||
spec++;
|
||||
}
|
||||
|
||||
if (*spec) {
|
||||
if (!allow_remainder) {
|
||||
av_log(logctx, AV_LOG_ERROR,
|
||||
"Trailing garbage at the end of a stream specifier: %s\n",
|
||||
spec);
|
||||
ret = AVERROR(EINVAL);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (*spec == ':')
|
||||
spec++;
|
||||
|
||||
ss->remainder = av_strdup(spec);
|
||||
if (!ss->remainder) {
|
||||
ret = AVERROR(EINVAL);
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
multiple_stream_lists:
|
||||
av_log(logctx, AV_LOG_ERROR,
|
||||
"Cannot combine multiple program/group designators in a "
|
||||
"single stream specifier");
|
||||
ret = AVERROR(EINVAL);
|
||||
|
||||
fail:
|
||||
stream_specifier_uninit(ss);
|
||||
return ret;
|
||||
}
|
||||
|
||||
unsigned stream_specifier_match(const StreamSpecifier *ss,
|
||||
const AVFormatContext *s, const AVStream *st,
|
||||
void *logctx)
|
||||
{
|
||||
const AVStreamGroup *g = NULL;
|
||||
const AVProgram *p = NULL;
|
||||
int start_stream = 0, nb_streams;
|
||||
int nb_matched = 0;
|
||||
|
||||
switch (ss->stream_list) {
|
||||
case STREAM_LIST_STREAM_ID:
|
||||
// <n-th> stream with given ID makes no sense and should be impossible to request
|
||||
av_assert0(ss->idx < 0);
|
||||
// return early if we know for sure the stream does not match
|
||||
if (st->id != ss->list_id)
|
||||
return 0;
|
||||
start_stream = st->index;
|
||||
nb_streams = st->index + 1;
|
||||
break;
|
||||
case STREAM_LIST_ALL:
|
||||
start_stream = ss->idx >= 0 ? 0 : st->index;
|
||||
nb_streams = st->index + 1;
|
||||
break;
|
||||
case STREAM_LIST_PROGRAM:
|
||||
for (unsigned i = 0; i < s->nb_programs; i++) {
|
||||
if (s->programs[i]->id == ss->list_id) {
|
||||
p = s->programs[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!p) {
|
||||
av_log(logctx, AV_LOG_WARNING, "No program with ID %"PRId64" exists,"
|
||||
" stream specifier can never match\n", ss->list_id);
|
||||
return 0;
|
||||
}
|
||||
nb_streams = p->nb_stream_indexes;
|
||||
break;
|
||||
case STREAM_LIST_GROUP_ID:
|
||||
for (unsigned i = 0; i < s->nb_stream_groups; i++) {
|
||||
if (ss->list_id == s->stream_groups[i]->id) {
|
||||
g = s->stream_groups[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
// fall-through
|
||||
case STREAM_LIST_GROUP_IDX:
|
||||
if (ss->stream_list == STREAM_LIST_GROUP_IDX &&
|
||||
ss->list_id >= 0 && ss->list_id < s->nb_stream_groups)
|
||||
g = s->stream_groups[ss->list_id];
|
||||
|
||||
if (!g) {
|
||||
av_log(logctx, AV_LOG_WARNING, "No stream group with group %s %"
|
||||
PRId64" exists, stream specifier can never match\n",
|
||||
ss->stream_list == STREAM_LIST_GROUP_ID ? "ID" : "index",
|
||||
ss->list_id);
|
||||
return 0;
|
||||
}
|
||||
nb_streams = g->nb_streams;
|
||||
break;
|
||||
default: av_assert0(0);
|
||||
}
|
||||
|
||||
for (int i = start_stream; i < nb_streams; i++) {
|
||||
const AVStream *candidate = s->streams[g ? g->streams[i]->index :
|
||||
p ? p->stream_index[i] : i];
|
||||
|
||||
if (ss->media_type != AVMEDIA_TYPE_UNKNOWN &&
|
||||
(ss->media_type != candidate->codecpar->codec_type ||
|
||||
(ss->no_apic && (candidate->disposition & AV_DISPOSITION_ATTACHED_PIC))))
|
||||
continue;
|
||||
|
||||
if (ss->meta_key) {
|
||||
const AVDictionaryEntry *tag = av_dict_get(candidate->metadata,
|
||||
ss->meta_key, NULL, 0);
|
||||
|
||||
if (!tag)
|
||||
continue;
|
||||
if (ss->meta_val && strcmp(tag->value, ss->meta_val))
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ss->usable_only) {
|
||||
const AVCodecParameters *par = candidate->codecpar;
|
||||
|
||||
switch (par->codec_type) {
|
||||
case AVMEDIA_TYPE_AUDIO:
|
||||
if (!par->sample_rate || !par->ch_layout.nb_channels ||
|
||||
par->format == AV_SAMPLE_FMT_NONE)
|
||||
continue;
|
||||
break;
|
||||
case AVMEDIA_TYPE_VIDEO:
|
||||
if (!par->width || !par->height || par->format == AV_PIX_FMT_NONE)
|
||||
continue;
|
||||
break;
|
||||
case AVMEDIA_TYPE_UNKNOWN:
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (ss->disposition &&
|
||||
(candidate->disposition & ss->disposition) != ss->disposition)
|
||||
continue;
|
||||
|
||||
if (st == candidate)
|
||||
return ss->idx < 0 || ss->idx == nb_matched;
|
||||
|
||||
nb_matched++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec)
|
||||
{
|
||||
StreamSpecifier ss;
|
||||
int ret;
|
||||
|
||||
ret = stream_specifier_parse(&ss, spec, 0, NULL);
|
||||
int ret = avformat_match_stream_specifier(s, st, spec);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = stream_specifier_match(&ss, s, st, NULL);
|
||||
stream_specifier_uninit(&ss);
|
||||
av_log(s, AV_LOG_ERROR, "Invalid stream specifier: %s.\n", spec);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int filter_codec_opts(const AVDictionary *opts, enum AVCodecID codec_id,
|
||||
AVFormatContext *s, AVStream *st, const AVCodec *codec,
|
||||
AVDictionary **dst, AVDictionary **opts_used)
|
||||
AVDictionary **dst)
|
||||
{
|
||||
AVDictionary *ret = NULL;
|
||||
const AVDictionaryEntry *t = NULL;
|
||||
|
|
@ -1361,6 +998,10 @@ int filter_codec_opts(const AVDictionary *opts, enum AVCodecID codec_id,
|
|||
char prefix = 0;
|
||||
const AVClass *cc = avcodec_get_class();
|
||||
|
||||
if (!codec)
|
||||
codec = s->oformat ? avcodec_find_encoder(codec_id)
|
||||
: avcodec_find_decoder(codec_id);
|
||||
|
||||
switch (st->codecpar->codec_type) {
|
||||
case AVMEDIA_TYPE_VIDEO:
|
||||
prefix = 'v';
|
||||
|
|
@ -1379,7 +1020,6 @@ int filter_codec_opts(const AVDictionary *opts, enum AVCodecID codec_id,
|
|||
while (t = av_dict_iterate(opts, t)) {
|
||||
const AVClass *priv_class;
|
||||
char *p = strchr(t->key, ':');
|
||||
int used = 0;
|
||||
|
||||
/* check stream specification in opt name */
|
||||
if (p) {
|
||||
|
|
@ -1397,21 +1037,15 @@ int filter_codec_opts(const AVDictionary *opts, enum AVCodecID codec_id,
|
|||
!codec ||
|
||||
((priv_class = codec->priv_class) &&
|
||||
av_opt_find(&priv_class, t->key, NULL, flags,
|
||||
AV_OPT_SEARCH_FAKE_OBJ))) {
|
||||
AV_OPT_SEARCH_FAKE_OBJ)))
|
||||
av_dict_set(&ret, t->key, t->value, 0);
|
||||
used = 1;
|
||||
} else if (t->key[0] == prefix &&
|
||||
else if (t->key[0] == prefix &&
|
||||
av_opt_find(&cc, t->key + 1, NULL, flags,
|
||||
AV_OPT_SEARCH_FAKE_OBJ)) {
|
||||
AV_OPT_SEARCH_FAKE_OBJ))
|
||||
av_dict_set(&ret, t->key + 1, t->value, 0);
|
||||
used = 1;
|
||||
}
|
||||
|
||||
if (p)
|
||||
*p = ':';
|
||||
|
||||
if (used && opts_used)
|
||||
av_dict_set(opts_used, t->key, "", 0);
|
||||
}
|
||||
|
||||
*dst = ret;
|
||||
|
|
@ -1419,7 +1053,7 @@ int filter_codec_opts(const AVDictionary *opts, enum AVCodecID codec_id,
|
|||
}
|
||||
|
||||
int setup_find_stream_info_opts(AVFormatContext *s,
|
||||
AVDictionary *local_codec_opts,
|
||||
AVDictionary *codec_opts,
|
||||
AVDictionary ***dst)
|
||||
{
|
||||
int ret;
|
||||
|
|
@ -1435,8 +1069,8 @@ int setup_find_stream_info_opts(AVFormatContext *s,
|
|||
return AVERROR(ENOMEM);
|
||||
|
||||
for (int i = 0; i < s->nb_streams; i++) {
|
||||
ret = filter_codec_opts(local_codec_opts, s->streams[i]->codecpar->codec_id,
|
||||
s, s->streams[i], NULL, &opts[i], NULL);
|
||||
ret = filter_codec_opts(codec_opts, s->streams[i]->codecpar->codec_id,
|
||||
s, s->streams[i], NULL, &opts[i]);
|
||||
if (ret < 0)
|
||||
goto fail;
|
||||
}
|
||||
|
|
@ -1471,12 +1105,9 @@ void *allocate_array_elem(void *ptr, size_t elem_size, int *nb_elems)
|
|||
{
|
||||
void *new_elem;
|
||||
|
||||
new_elem = av_mallocz(elem_size);
|
||||
if (!new_elem)
|
||||
if (!(new_elem = av_mallocz(elem_size)) ||
|
||||
av_dynarray_add_nofree(ptr, nb_elems, new_elem) < 0)
|
||||
return NULL;
|
||||
if (av_dynarray_add_nofree(ptr, nb_elems, new_elem) < 0)
|
||||
av_freep(&new_elem);
|
||||
|
||||
return new_elem;
|
||||
}
|
||||
|
||||
|
|
@ -1522,23 +1153,3 @@ char *file_read(const char *filename)
|
|||
return NULL;
|
||||
return str;
|
||||
}
|
||||
|
||||
void remove_avoptions(AVDictionary **a, AVDictionary *b)
|
||||
{
|
||||
const AVDictionaryEntry *t = NULL;
|
||||
|
||||
while ((t = av_dict_iterate(b, t))) {
|
||||
av_dict_set(a, t->key, NULL, AV_DICT_MATCH_CASE);
|
||||
}
|
||||
}
|
||||
|
||||
int check_avoptions(AVDictionary *m)
|
||||
{
|
||||
const AVDictionaryEntry *t = av_dict_iterate(m, NULL);
|
||||
if (t) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Option %s not found.\n", t->key);
|
||||
return AVERROR_OPTION_NOT_FOUND;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,70 +102,8 @@ enum OptionType {
|
|||
int parse_number(const char *context, const char *numstr, enum OptionType type,
|
||||
double min, double max, double *dst);
|
||||
|
||||
enum StreamList {
|
||||
STREAM_LIST_ALL,
|
||||
STREAM_LIST_STREAM_ID,
|
||||
STREAM_LIST_PROGRAM,
|
||||
STREAM_LIST_GROUP_ID,
|
||||
STREAM_LIST_GROUP_IDX,
|
||||
};
|
||||
|
||||
typedef struct StreamSpecifier {
|
||||
// trailing stream index - pick idx-th stream that matches
|
||||
// all the other constraints; -1 when not present
|
||||
int idx;
|
||||
|
||||
// which stream list to consider
|
||||
enum StreamList stream_list;
|
||||
|
||||
// STREAM_LIST_STREAM_ID: stream ID
|
||||
// STREAM_LIST_GROUP_IDX: group index
|
||||
// STREAM_LIST_GROUP_ID: group ID
|
||||
// STREAM_LIST_PROGRAM: program ID
|
||||
int64_t list_id;
|
||||
|
||||
// when not AVMEDIA_TYPE_UNKNOWN, consider only streams of this type
|
||||
enum AVMediaType media_type;
|
||||
uint8_t no_apic;
|
||||
|
||||
uint8_t usable_only;
|
||||
|
||||
int disposition;
|
||||
|
||||
char *meta_key;
|
||||
char *meta_val;
|
||||
|
||||
char *remainder;
|
||||
} StreamSpecifier;
|
||||
|
||||
/**
|
||||
* Parse a stream specifier string into a form suitable for matching.
|
||||
*
|
||||
* @param ss Parsed specifier will be stored here; must be uninitialized
|
||||
* with stream_specifier_uninit() when no longer needed.
|
||||
* @param spec String containing the stream specifier to be parsed.
|
||||
* @param allow_remainder When 1, the part of spec that is left after parsing
|
||||
* the stream specifier is stored into ss->remainder.
|
||||
* When 0, any remainder will cause parsing to fail.
|
||||
*/
|
||||
int stream_specifier_parse(StreamSpecifier *ss, const char *spec,
|
||||
int allow_remainder, void *logctx);
|
||||
|
||||
/**
|
||||
* @return 1 if st matches the parsed specifier, 0 if it does not
|
||||
*/
|
||||
unsigned stream_specifier_match(const StreamSpecifier *ss,
|
||||
const AVFormatContext *s, const AVStream *st,
|
||||
void *logctx);
|
||||
|
||||
void stream_specifier_uninit(StreamSpecifier *ss);
|
||||
|
||||
typedef struct SpecifierOpt {
|
||||
// original specifier or empty string
|
||||
char *specifier;
|
||||
// parsed specifier for OPT_FLAG_PERSTREAM options
|
||||
StreamSpecifier stream_spec;
|
||||
|
||||
char *specifier; /**< stream/chapter/program/... specifier */
|
||||
union {
|
||||
uint8_t *str;
|
||||
int i;
|
||||
|
|
@ -182,9 +120,6 @@ typedef struct SpecifierOptList {
|
|||
|
||||
/* Canonical option definition that was parsed into this list. */
|
||||
const struct OptionDef *opt_canon;
|
||||
/* Type corresponding to the field that should be used from SpecifierOpt.u.
|
||||
* May not match the option type, e.g. OPT_TYPE_BOOL options are stored as
|
||||
* int, so this field would be OPT_TYPE_INT for them */
|
||||
enum OptionType type;
|
||||
} SpecifierOptList;
|
||||
|
||||
|
|
@ -319,7 +254,7 @@ typedef struct Option {
|
|||
} Option;
|
||||
|
||||
typedef struct OptionGroupDef {
|
||||
/** group name */
|
||||
/**< group name */
|
||||
const char *name;
|
||||
/**
|
||||
* Option to be used as group separator. Can be NULL for groups which
|
||||
|
|
@ -436,13 +371,11 @@ int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec);
|
|||
* @param codec The particular codec for which the options should be filtered.
|
||||
* If null, the default one is looked up according to the codec id.
|
||||
* @param dst a pointer to the created dictionary
|
||||
* @param opts_used if non-NULL, every option stored in dst is also stored here,
|
||||
* with specifiers preserved
|
||||
* @return a non-negative number on success, a negative error code on failure
|
||||
*/
|
||||
int filter_codec_opts(const AVDictionary *opts, enum AVCodecID codec_id,
|
||||
AVFormatContext *s, AVStream *st, const AVCodec *codec,
|
||||
AVDictionary **dst, AVDictionary **opts_used);
|
||||
AVDictionary **dst);
|
||||
|
||||
/**
|
||||
* Setup AVCodecContext options for avformat_find_stream_info().
|
||||
|
|
@ -532,17 +465,22 @@ void *allocate_array_elem(void *array, size_t elem_size, int *nb_elems);
|
|||
#define GROW_ARRAY(array, nb_elems)\
|
||||
grow_array((void**)&array, sizeof(*array), &nb_elems, nb_elems + 1)
|
||||
|
||||
#define GET_PIX_FMT_NAME(pix_fmt)\
|
||||
const char *name = av_get_pix_fmt_name(pix_fmt);
|
||||
|
||||
#define GET_CODEC_NAME(id)\
|
||||
const char *name = avcodec_descriptor_get(id)->name;
|
||||
|
||||
#define GET_SAMPLE_FMT_NAME(sample_fmt)\
|
||||
const char *name = av_get_sample_fmt_name(sample_fmt)
|
||||
|
||||
#define GET_SAMPLE_RATE_NAME(rate)\
|
||||
char name[16];\
|
||||
snprintf(name, sizeof(name), "%d", rate);
|
||||
|
||||
double get_rotation(const int32_t *displaymatrix);
|
||||
|
||||
/* read file contents into a string */
|
||||
char *file_read(const char *filename);
|
||||
|
||||
/* Remove keys in dictionary b from dictionary a */
|
||||
void remove_avoptions(AVDictionary **a, AVDictionary *b);
|
||||
|
||||
/* Check if any keys exist in dictionary m */
|
||||
int check_avoptions(AVDictionary *m);
|
||||
|
||||
int cmdutils_isalnum(char c);
|
||||
|
||||
#endif /* FFTOOLS_CMDUTILS_H */
|
||||
|
|
|
|||
124
fftools/ffmpeg.c
124
fftools/ffmpeg.c
|
|
@ -68,20 +68,40 @@
|
|||
#include <conio.h>
|
||||
#endif
|
||||
|
||||
#include "libavutil/avassert.h"
|
||||
#include "libavutil/avstring.h"
|
||||
#include "libavutil/bprint.h"
|
||||
#include "libavutil/channel_layout.h"
|
||||
#include "libavutil/dict.h"
|
||||
#include "libavutil/mem.h"
|
||||
#include "libavutil/display.h"
|
||||
#include "libavutil/fifo.h"
|
||||
#include "libavutil/hwcontext.h"
|
||||
#include "libavutil/imgutils.h"
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "libavutil/libm.h"
|
||||
#include "libavutil/mathematics.h"
|
||||
#include "libavutil/opt.h"
|
||||
#include "libavutil/parseutils.h"
|
||||
#include "libavutil/pixdesc.h"
|
||||
#include "libavutil/samplefmt.h"
|
||||
#include "libavutil/thread.h"
|
||||
#include "libavutil/threadmessage.h"
|
||||
#include "libavutil/time.h"
|
||||
#include "libavutil/timestamp.h"
|
||||
|
||||
#include "libavcodec/version.h"
|
||||
|
||||
#include "libavformat/avformat.h"
|
||||
|
||||
#include "libavdevice/avdevice.h"
|
||||
|
||||
#include "libswresample/swresample.h"
|
||||
|
||||
#include "cmdutils.h"
|
||||
#include "ffmpeg.h"
|
||||
#include "ffmpeg_sched.h"
|
||||
#include "ffmpeg_utils.h"
|
||||
#include "graph/graphprint.h"
|
||||
#include "sync_queue.h"
|
||||
|
||||
const char program_name[] = "ffmpeg";
|
||||
const int program_birth_year = 2000;
|
||||
|
|
@ -137,7 +157,7 @@ void term_exit(void)
|
|||
|
||||
static volatile int received_sigterm = 0;
|
||||
static volatile int received_nb_signals = 0;
|
||||
static atomic_int transcode_init_done = 0;
|
||||
static atomic_int transcode_init_done = ATOMIC_VAR_INIT(0);
|
||||
static volatile int ffmpeg_exited = 0;
|
||||
static int64_t copy_ts_first_pts = AV_NOPTS_VALUE;
|
||||
|
||||
|
|
@ -309,12 +329,9 @@ const AVIOInterruptCB int_cb = { decode_interrupt_cb, NULL };
|
|||
|
||||
static void ffmpeg_cleanup(int ret)
|
||||
{
|
||||
if ((print_graphs || print_graphs_file) && nb_output_files > 0)
|
||||
print_filtergraphs(filtergraphs, nb_filtergraphs, input_files, nb_input_files, output_files, nb_output_files);
|
||||
|
||||
if (do_benchmark) {
|
||||
int64_t maxrss = getmaxrss() / 1024;
|
||||
av_log(NULL, AV_LOG_INFO, "bench: maxrss=%"PRId64"KiB\n", maxrss);
|
||||
int maxrss = getmaxrss() / 1024;
|
||||
av_log(NULL, AV_LOG_INFO, "bench: maxrss=%iKiB\n", maxrss);
|
||||
}
|
||||
|
||||
for (int i = 0; i < nb_filtergraphs; i++)
|
||||
|
|
@ -344,9 +361,6 @@ static void ffmpeg_cleanup(int ret)
|
|||
|
||||
av_freep(&filter_nbthreads);
|
||||
|
||||
av_freep(&print_graphs_file);
|
||||
av_freep(&print_graphs_format);
|
||||
|
||||
av_freep(&input_files);
|
||||
av_freep(&output_files);
|
||||
|
||||
|
|
@ -481,51 +495,21 @@ const FrameData *packet_data_c(AVPacket *pkt)
|
|||
return ret < 0 ? NULL : (const FrameData*)pkt->opaque_ref->data;
|
||||
}
|
||||
|
||||
int check_avoptions_used(const AVDictionary *opts, const AVDictionary *opts_used,
|
||||
void *logctx, int decode)
|
||||
void remove_avoptions(AVDictionary **a, AVDictionary *b)
|
||||
{
|
||||
const AVClass *class = avcodec_get_class();
|
||||
const AVClass *fclass = avformat_get_class();
|
||||
const AVDictionaryEntry *t = NULL;
|
||||
|
||||
const int flag = decode ? AV_OPT_FLAG_DECODING_PARAM :
|
||||
AV_OPT_FLAG_ENCODING_PARAM;
|
||||
const AVDictionaryEntry *e = NULL;
|
||||
while ((t = av_dict_iterate(b, t))) {
|
||||
av_dict_set(a, t->key, NULL, AV_DICT_MATCH_CASE);
|
||||
}
|
||||
}
|
||||
|
||||
while ((e = av_dict_iterate(opts, e))) {
|
||||
const AVOption *option, *foption;
|
||||
char *optname, *p;
|
||||
|
||||
if (av_dict_get(opts_used, e->key, NULL, 0))
|
||||
continue;
|
||||
|
||||
optname = av_strdup(e->key);
|
||||
if (!optname)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
p = strchr(optname, ':');
|
||||
if (p)
|
||||
*p = 0;
|
||||
|
||||
option = av_opt_find(&class, optname, NULL, 0,
|
||||
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ);
|
||||
foption = av_opt_find(&fclass, optname, NULL, 0,
|
||||
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ);
|
||||
av_freep(&optname);
|
||||
if (!option || foption)
|
||||
continue;
|
||||
|
||||
if (!(option->flags & flag)) {
|
||||
av_log(logctx, AV_LOG_ERROR, "Codec AVOption %s (%s) is not a %s "
|
||||
"option.\n", e->key, option->help ? option->help : "",
|
||||
decode ? "decoding" : "encoding");
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
av_log(logctx, AV_LOG_WARNING, "Codec AVOption %s (%s) has not been used "
|
||||
"for any stream. The most likely reason is either wrong type "
|
||||
"(e.g. a video option with no video streams) or that it is a "
|
||||
"private option of some decoder which was not actually used "
|
||||
"for any stream.\n", e->key, option->help ? option->help : "");
|
||||
int check_avoptions(AVDictionary *m)
|
||||
{
|
||||
const AVDictionaryEntry *t;
|
||||
if ((t = av_dict_get(m, "", NULL, AV_DICT_IGNORE_SUFFIX))) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Option %s not found.\n", t->key);
|
||||
return AVERROR_OPTION_NOT_FOUND;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
@ -562,7 +546,7 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
|
|||
static int64_t last_time = -1;
|
||||
static int first_report = 1;
|
||||
uint64_t nb_frames_dup = 0, nb_frames_drop = 0;
|
||||
int mins, secs, ms, us;
|
||||
int mins, secs, us;
|
||||
int64_t hours;
|
||||
const char *hours_sign;
|
||||
int ret;
|
||||
|
|
@ -586,7 +570,6 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
|
|||
vid = 0;
|
||||
av_bprint_init(&buf, 0, AV_BPRINT_SIZE_AUTOMATIC);
|
||||
av_bprint_init(&buf_script, 0, AV_BPRINT_SIZE_AUTOMATIC);
|
||||
|
||||
for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) {
|
||||
const float q = ost->enc ? atomic_load(&ost->quality) / (float) FF_QP2LAMBDA : -1;
|
||||
|
||||
|
|
@ -595,7 +578,7 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
|
|||
av_bprintf(&buf_script, "stream_%d_%d_q=%.1f\n",
|
||||
ost->file->index, ost->index, q);
|
||||
}
|
||||
if (!vid && ost->type == AVMEDIA_TYPE_VIDEO) {
|
||||
if (!vid && ost->type == AVMEDIA_TYPE_VIDEO && ost->filter) {
|
||||
float fps;
|
||||
uint64_t frame_number = atomic_load(&ost->packets_written);
|
||||
|
||||
|
|
@ -609,10 +592,8 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
|
|||
if (is_last_report)
|
||||
av_bprintf(&buf, "L");
|
||||
|
||||
if (ost->filter) {
|
||||
nb_frames_dup = atomic_load(&ost->filter->nb_frames_dup);
|
||||
nb_frames_drop = atomic_load(&ost->filter->nb_frames_drop);
|
||||
}
|
||||
nb_frames_dup = atomic_load(&ost->filter->nb_frames_dup);
|
||||
nb_frames_drop = atomic_load(&ost->filter->nb_frames_drop);
|
||||
|
||||
vid = 1;
|
||||
}
|
||||
|
|
@ -677,15 +658,6 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
|
|||
av_bprintf(&buf_script, "speed=%4.3gx\n", speed);
|
||||
}
|
||||
|
||||
secs = (int)t;
|
||||
ms = (int)((t - secs) * 1000);
|
||||
mins = secs / 60;
|
||||
secs %= 60;
|
||||
hours = mins / 60;
|
||||
mins %= 60;
|
||||
|
||||
av_bprintf(&buf, " elapsed=%"PRId64":%02d:%02d.%02d", hours, mins, secs, ms / 10);
|
||||
|
||||
if (print_stats || is_last_report) {
|
||||
const char end = is_last_report ? '\n' : '\r';
|
||||
if (print_stats==1 && AV_LOG_INFO > av_log_get_level()) {
|
||||
|
|
@ -745,7 +717,7 @@ static void print_stream_maps(void)
|
|||
av_log(NULL, AV_LOG_INFO, " (graph %d)", ost->filter->graph->index);
|
||||
|
||||
av_log(NULL, AV_LOG_INFO, " -> Stream #%d:%d (%s)\n", ost->file->index,
|
||||
ost->index, ost->enc->enc_ctx->codec->name);
|
||||
ost->index, ost->enc_ctx->codec->name);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -754,9 +726,9 @@ static void print_stream_maps(void)
|
|||
ost->ist->index,
|
||||
ost->file->index,
|
||||
ost->index);
|
||||
if (ost->enc) {
|
||||
if (ost->enc_ctx) {
|
||||
const AVCodec *in_codec = ost->ist->dec;
|
||||
const AVCodec *out_codec = ost->enc->enc_ctx->codec;
|
||||
const AVCodec *out_codec = ost->enc_ctx->codec;
|
||||
const char *decoder_name = "?";
|
||||
const char *in_codec_name = "?";
|
||||
const char *encoder_name = "?";
|
||||
|
|
@ -837,11 +809,6 @@ static int check_keyboard_interaction(int64_t cur_time)
|
|||
(n = sscanf(buf, "%63[^ ] %lf %255[^ ] %255[^\n]", target, &time, command, arg)) >= 3) {
|
||||
av_log(NULL, AV_LOG_DEBUG, "Processing command target:%s time:%f command:%s arg:%s",
|
||||
target, time, command, arg);
|
||||
for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) {
|
||||
if (ost->fg_simple)
|
||||
fg_send_command(ost->fg_simple, time, target, command, arg,
|
||||
key == 'C');
|
||||
}
|
||||
for (i = 0; i < nb_filtergraphs; i++)
|
||||
fg_send_command(filtergraphs[i], time, target, command, arg,
|
||||
key == 'C');
|
||||
|
|
@ -1029,8 +996,5 @@ finish:
|
|||
|
||||
sch_free(&sch);
|
||||
|
||||
av_log(NULL, AV_LOG_VERBOSE, "\n");
|
||||
av_log(NULL, AV_LOG_VERBOSE, "Exiting with exit code %d\n", ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
280
fftools/ffmpeg.h
280
fftools/ffmpeg.h
|
|
@ -39,7 +39,6 @@
|
|||
#include "libavfilter/avfilter.h"
|
||||
|
||||
#include "libavutil/avutil.h"
|
||||
#include "libavutil/bprint.h"
|
||||
#include "libavutil/dict.h"
|
||||
#include "libavutil/eval.h"
|
||||
#include "libavutil/fifo.h"
|
||||
|
|
@ -113,32 +112,12 @@ typedef struct HWDevice {
|
|||
AVBufferRef *device_ref;
|
||||
} HWDevice;
|
||||
|
||||
enum ViewSpecifierType {
|
||||
// no specifier given
|
||||
VIEW_SPECIFIER_TYPE_NONE = 0,
|
||||
// val is view index
|
||||
VIEW_SPECIFIER_TYPE_IDX,
|
||||
// val is view ID
|
||||
VIEW_SPECIFIER_TYPE_ID,
|
||||
// specify view by its position, val is AV_STEREO3D_VIEW_LEFT/RIGHT
|
||||
VIEW_SPECIFIER_TYPE_POS,
|
||||
// use all views, val is ignored
|
||||
VIEW_SPECIFIER_TYPE_ALL,
|
||||
};
|
||||
|
||||
typedef struct ViewSpecifier {
|
||||
enum ViewSpecifierType type;
|
||||
unsigned val;
|
||||
} ViewSpecifier;
|
||||
|
||||
/* select an input stream for an output stream */
|
||||
typedef struct StreamMap {
|
||||
int disabled; /* 1 is this mapping is disabled by a negative map */
|
||||
int file_index;
|
||||
int stream_index;
|
||||
char *linklabel; /* name of an output link, for mapping lavfi outputs */
|
||||
|
||||
ViewSpecifier vs;
|
||||
} StreamMap;
|
||||
|
||||
typedef struct OptionsContext {
|
||||
|
|
@ -164,7 +143,6 @@ typedef struct OptionsContext {
|
|||
int loop;
|
||||
int rate_emu;
|
||||
float readrate;
|
||||
float readrate_catchup;
|
||||
double readrate_initial_burst;
|
||||
int accurate_seek;
|
||||
int thread_queue_size;
|
||||
|
|
@ -177,7 +155,6 @@ typedef struct OptionsContext {
|
|||
SpecifierOptList hwaccel_devices;
|
||||
SpecifierOptList hwaccel_output_formats;
|
||||
SpecifierOptList autorotate;
|
||||
SpecifierOptList apply_cropping;
|
||||
|
||||
/* output options */
|
||||
StreamMap *stream_maps;
|
||||
|
|
@ -233,7 +210,6 @@ typedef struct OptionsContext {
|
|||
SpecifierOptList filter_scripts;
|
||||
#endif
|
||||
SpecifierOptList reinit_filters;
|
||||
SpecifierOptList drop_changed;
|
||||
SpecifierOptList fix_sub_duration;
|
||||
SpecifierOptList fix_sub_duration_heartbeat;
|
||||
SpecifierOptList canvas_sizes;
|
||||
|
|
@ -263,8 +239,6 @@ enum IFilterFlags {
|
|||
IFILTER_FLAG_AUTOROTATE = (1 << 0),
|
||||
IFILTER_FLAG_REINIT = (1 << 1),
|
||||
IFILTER_FLAG_CFR = (1 << 2),
|
||||
IFILTER_FLAG_CROP = (1 << 3),
|
||||
IFILTER_FLAG_DROPCHANGED = (1 << 4),
|
||||
};
|
||||
|
||||
typedef struct InputFilterOptions {
|
||||
|
|
@ -280,11 +254,6 @@ typedef struct InputFilterOptions {
|
|||
* accurate */
|
||||
AVRational framerate;
|
||||
|
||||
unsigned crop_top;
|
||||
unsigned crop_bottom;
|
||||
unsigned crop_left;
|
||||
unsigned crop_right;
|
||||
|
||||
int sub2video_width;
|
||||
int sub2video_height;
|
||||
|
||||
|
|
@ -294,97 +263,20 @@ typedef struct InputFilterOptions {
|
|||
AVFrame *fallback;
|
||||
} InputFilterOptions;
|
||||
|
||||
enum OFilterFlags {
|
||||
OFILTER_FLAG_DISABLE_CONVERT = (1 << 0),
|
||||
// produce 24-bit audio
|
||||
OFILTER_FLAG_AUDIO_24BIT = (1 << 1),
|
||||
OFILTER_FLAG_AUTOSCALE = (1 << 2),
|
||||
};
|
||||
|
||||
typedef struct OutputFilterOptions {
|
||||
// Caller-provided name for this output
|
||||
char *name;
|
||||
|
||||
// Codec used for encoding, may be NULL
|
||||
const AVCodec *enc;
|
||||
|
||||
int64_t trim_start_us;
|
||||
int64_t trim_duration_us;
|
||||
int64_t ts_offset;
|
||||
|
||||
/* Desired output timebase.
|
||||
* Numerator can be one of EncTimeBase values, or 0 when no preference.
|
||||
*/
|
||||
AVRational output_tb;
|
||||
|
||||
AVDictionary *sws_opts;
|
||||
AVDictionary *swr_opts;
|
||||
|
||||
int64_t nb_threads;
|
||||
|
||||
// A combination of OFilterFlags.
|
||||
unsigned flags;
|
||||
|
||||
int format;
|
||||
int width;
|
||||
int height;
|
||||
enum AVColorSpace color_space;
|
||||
enum AVColorRange color_range;
|
||||
|
||||
enum VideoSyncMethod vsync_method;
|
||||
AVRational frame_rate;
|
||||
AVRational max_frame_rate;
|
||||
|
||||
int sample_rate;
|
||||
AVChannelLayout ch_layout;
|
||||
|
||||
const int *formats;
|
||||
const int *sample_rates;
|
||||
const AVChannelLayout *ch_layouts;
|
||||
const AVRational *frame_rates;
|
||||
const enum AVColorSpace *color_spaces;
|
||||
const enum AVColorRange *color_ranges;
|
||||
|
||||
// for simple filtergraphs only, view specifier passed
|
||||
// along to the decoder
|
||||
const ViewSpecifier *vs;
|
||||
} OutputFilterOptions;
|
||||
|
||||
typedef struct InputFilter {
|
||||
struct FilterGraph *graph;
|
||||
uint8_t *name;
|
||||
int index;
|
||||
|
||||
// filter data type
|
||||
enum AVMediaType type;
|
||||
|
||||
AVFilterContext *filter;
|
||||
|
||||
char *input_name;
|
||||
|
||||
/* for filters that are not yet bound to an input stream,
|
||||
* this stores the input linklabel, if any */
|
||||
uint8_t *linklabel;
|
||||
} InputFilter;
|
||||
|
||||
typedef struct OutputFilter {
|
||||
const AVClass *class;
|
||||
|
||||
struct OutputStream *ost;
|
||||
struct FilterGraph *graph;
|
||||
uint8_t *name;
|
||||
int index;
|
||||
|
||||
AVFilterContext *filter;
|
||||
|
||||
char *output_name;
|
||||
|
||||
/* for filters that are not yet bound to an output stream,
|
||||
* this stores the output linklabel, if any */
|
||||
int bound;
|
||||
uint8_t *linklabel;
|
||||
|
||||
char *apad;
|
||||
|
||||
enum AVMediaType type;
|
||||
|
||||
atomic_uint_least64_t nb_frames_dup;
|
||||
|
|
@ -399,9 +291,6 @@ typedef struct FilterGraph {
|
|||
int nb_inputs;
|
||||
OutputFilter **outputs;
|
||||
int nb_outputs;
|
||||
|
||||
const char *graph_desc;
|
||||
struct AVBPrint graph_print_buf;
|
||||
} FilterGraph;
|
||||
|
||||
enum DecoderFlags {
|
||||
|
|
@ -415,8 +304,6 @@ enum DecoderFlags {
|
|||
DECODER_FLAG_TOP_FIELD_FIRST = (1 << 3),
|
||||
#endif
|
||||
DECODER_FLAG_SEND_END_TS = (1 << 4),
|
||||
// force bitexact decoding
|
||||
DECODER_FLAG_BITEXACT = (1 << 5),
|
||||
};
|
||||
|
||||
typedef struct DecoderOpts {
|
||||
|
|
@ -481,12 +368,22 @@ typedef struct InputStream {
|
|||
int top_field_first;
|
||||
#endif
|
||||
|
||||
int autorotate;
|
||||
|
||||
int fix_sub_duration;
|
||||
|
||||
/* decoded data from this stream goes into all those filters
|
||||
* currently video and audio only */
|
||||
InputFilter **filters;
|
||||
int nb_filters;
|
||||
|
||||
/*
|
||||
* Output targets that do not go through lavfi, i.e. subtitles or
|
||||
* streamcopy. Those two cases are distinguished by the OutputStream
|
||||
* having an encoder or not.
|
||||
*/
|
||||
struct OutputStream **outputs;
|
||||
int nb_outputs;
|
||||
} InputStream;
|
||||
|
||||
typedef struct InputFile {
|
||||
|
|
@ -563,6 +460,13 @@ typedef struct EncStats {
|
|||
int lock_initialized;
|
||||
} EncStats;
|
||||
|
||||
extern const char *const forced_keyframes_const_names[];
|
||||
|
||||
typedef enum {
|
||||
ENCODER_FINISHED = 1,
|
||||
MUXER_FINISHED = 2,
|
||||
} OSTFinished ;
|
||||
|
||||
enum {
|
||||
KF_FORCE_SOURCE = 1,
|
||||
#if FFMPEG_OPT_FORCE_KF_SOURCE_NO_DROP
|
||||
|
|
@ -586,22 +490,7 @@ typedef struct KeyframeForceCtx {
|
|||
int dropped_keyframe;
|
||||
} KeyframeForceCtx;
|
||||
|
||||
typedef struct Encoder {
|
||||
const AVClass *class;
|
||||
|
||||
AVCodecContext *enc_ctx;
|
||||
|
||||
// number of frames/samples sent to the encoder
|
||||
uint64_t frames_encoded;
|
||||
uint64_t samples_encoded;
|
||||
} Encoder;
|
||||
|
||||
enum CroppingType {
|
||||
CROP_DISABLED = 0,
|
||||
CROP_ALL,
|
||||
CROP_CODEC,
|
||||
CROP_CONTAINER,
|
||||
};
|
||||
typedef struct Encoder Encoder;
|
||||
|
||||
typedef struct OutputStream {
|
||||
const AVClass *class;
|
||||
|
|
@ -613,6 +502,12 @@ typedef struct OutputStream {
|
|||
|
||||
int index; /* stream index in the output file */
|
||||
|
||||
/**
|
||||
* Codec parameters for packets submitted to the muxer (i.e. before
|
||||
* bitstream filtering, if any).
|
||||
*/
|
||||
AVCodecParameters *par_in;
|
||||
|
||||
/* input stream that is the source for this output stream;
|
||||
* may be NULL for streams with no well-defined source, e.g.
|
||||
* attachments or outputs from complex filtergraphs */
|
||||
|
|
@ -620,12 +515,21 @@ typedef struct OutputStream {
|
|||
|
||||
AVStream *st; /* stream in the output file */
|
||||
|
||||
AVRational enc_timebase;
|
||||
|
||||
Encoder *enc;
|
||||
AVCodecContext *enc_ctx;
|
||||
|
||||
/* video only */
|
||||
AVRational frame_rate;
|
||||
AVRational max_frame_rate;
|
||||
enum VideoSyncMethod vsync_method;
|
||||
int is_cfr;
|
||||
int force_fps;
|
||||
#if FFMPEG_OPT_TOP
|
||||
int top_field_first;
|
||||
#endif
|
||||
int autoscale;
|
||||
int bitexact;
|
||||
int bits_per_raw_sample;
|
||||
|
||||
|
|
@ -633,18 +537,26 @@ typedef struct OutputStream {
|
|||
|
||||
KeyframeForceCtx kf;
|
||||
|
||||
const char *logfile_prefix;
|
||||
char *logfile_prefix;
|
||||
FILE *logfile;
|
||||
|
||||
// simple filtergraph feeding this stream, if any
|
||||
FilterGraph *fg_simple;
|
||||
OutputFilter *filter;
|
||||
|
||||
AVDictionary *encoder_opts;
|
||||
AVDictionary *sws_dict;
|
||||
AVDictionary *swr_opts;
|
||||
char *apad;
|
||||
|
||||
char *attachment_filename;
|
||||
|
||||
int keep_pix_fmt;
|
||||
|
||||
/* stats */
|
||||
// number of packets send to the muxer
|
||||
atomic_uint_least64_t packets_written;
|
||||
// number of frames/samples sent to the encoder
|
||||
uint64_t frames_encoded;
|
||||
uint64_t samples_encoded;
|
||||
|
||||
/* packet quality factor */
|
||||
atomic_int quality;
|
||||
|
|
@ -664,6 +576,7 @@ typedef struct OutputFile {
|
|||
|
||||
int index;
|
||||
|
||||
const AVOutputFormat *format;
|
||||
const char *url;
|
||||
|
||||
OutputStream **streams;
|
||||
|
|
@ -672,6 +585,7 @@ typedef struct OutputFile {
|
|||
int64_t recording_time; ///< desired length of the resulting file in microseconds == AV_TIME_BASE units
|
||||
int64_t start_time; ///< start time in microseconds == AV_TIME_BASE units
|
||||
|
||||
int shortest;
|
||||
int bitexact;
|
||||
} OutputFile;
|
||||
|
||||
|
|
@ -704,7 +618,6 @@ extern int nb_input_files;
|
|||
extern OutputFile **output_files;
|
||||
extern int nb_output_files;
|
||||
|
||||
// complex filtergraphs
|
||||
extern FilterGraph **filtergraphs;
|
||||
extern int nb_filtergraphs;
|
||||
|
||||
|
|
@ -737,11 +650,7 @@ extern float max_error_rate;
|
|||
|
||||
extern char *filter_nbthreads;
|
||||
extern int filter_complex_nbthreads;
|
||||
extern int filter_buffered_frames;
|
||||
extern int vstats_version;
|
||||
extern int print_graphs;
|
||||
extern char *print_graphs_file;
|
||||
extern char *print_graphs_format;
|
||||
extern int auto_conversion_filters;
|
||||
|
||||
extern const AVIOInterruptCB int_cb;
|
||||
|
|
@ -763,21 +672,20 @@ void term_exit(void);
|
|||
|
||||
void show_usage(void);
|
||||
|
||||
int check_avoptions_used(const AVDictionary *opts, const AVDictionary *opts_used,
|
||||
void *logctx, int decode);
|
||||
void remove_avoptions(AVDictionary **a, AVDictionary *b);
|
||||
int check_avoptions(AVDictionary *m);
|
||||
|
||||
int assert_file_overwrite(const char *filename);
|
||||
AVDictionary *strip_specifiers(const AVDictionary *dict);
|
||||
int find_codec(void *logctx, const char *name,
|
||||
enum AVMediaType type, int encoder, const AVCodec **codec);
|
||||
int parse_and_set_vsync(const char *arg, int *vsync_var, int file_idx, int st_idx, int is_global);
|
||||
|
||||
int filtergraph_is_simple(const FilterGraph *fg);
|
||||
int fg_create_simple(FilterGraph **pfg,
|
||||
InputStream *ist,
|
||||
char *graph_desc,
|
||||
Scheduler *sch, unsigned sched_idx_enc,
|
||||
const OutputFilterOptions *opts);
|
||||
int fg_finalise_bindings(void);
|
||||
int init_simple_filtergraph(InputStream *ist, OutputStream *ost,
|
||||
char *graph_desc,
|
||||
Scheduler *sch, unsigned sch_idx_enc);
|
||||
int fg_finalise_bindings(FilterGraph *fg);
|
||||
|
||||
/**
|
||||
* Get our axiliary frame data attached to the frame, allocating it
|
||||
|
|
@ -790,9 +698,8 @@ const FrameData *frame_data_c(AVFrame *frame);
|
|||
FrameData *packet_data (AVPacket *pkt);
|
||||
const FrameData *packet_data_c(AVPacket *pkt);
|
||||
|
||||
int ofilter_bind_enc(OutputFilter *ofilter,
|
||||
unsigned sched_idx_enc,
|
||||
const OutputFilterOptions *opts);
|
||||
int ofilter_bind_ost(OutputFilter *ofilter, OutputStream *ost,
|
||||
unsigned sched_idx_enc);
|
||||
|
||||
/**
|
||||
* Create a new filtergraph in the global filtergraph list.
|
||||
|
|
@ -852,24 +759,10 @@ void dec_free(Decoder **pdec);
|
|||
*
|
||||
* @param opts filtergraph input options, to be filled by this function
|
||||
*/
|
||||
int dec_filter_add(Decoder *dec, InputFilter *ifilter, InputFilterOptions *opts,
|
||||
const ViewSpecifier *vs, SchedulerNode *src);
|
||||
|
||||
/*
|
||||
* For multiview video, request output of the view(s) determined by vs.
|
||||
* May be called multiple times.
|
||||
*
|
||||
* If this function is never called, only the base view is output. If it is
|
||||
* called at least once, only the views requested are output.
|
||||
*
|
||||
* @param src scheduler node from which the frames corresponding vs
|
||||
* will originate
|
||||
*/
|
||||
int dec_request_view(Decoder *dec, const ViewSpecifier *vs,
|
||||
SchedulerNode *src);
|
||||
int dec_filter_add(Decoder *dec, InputFilter *ifilter, InputFilterOptions *opts);
|
||||
|
||||
int enc_alloc(Encoder **penc, const AVCodec *codec,
|
||||
Scheduler *sch, unsigned sch_idx, void *log_parent);
|
||||
Scheduler *sch, unsigned sch_idx);
|
||||
void enc_free(Encoder **penc);
|
||||
|
||||
int enc_open(void *opaque, const AVFrame *frame);
|
||||
|
|
@ -882,8 +775,7 @@ int enc_loopback(Encoder *enc);
|
|||
*
|
||||
* Open the muxer once all the streams have been initialized.
|
||||
*/
|
||||
int of_stream_init(OutputFile *of, OutputStream *ost,
|
||||
const AVCodecContext *enc_ctx);
|
||||
int of_stream_init(OutputFile *of, OutputStream *ost);
|
||||
int of_write_trailer(OutputFile *of);
|
||||
int of_open(const OptionsContext *o, const char *filename, Scheduler *sch);
|
||||
void of_free(OutputFile **pof);
|
||||
|
|
@ -895,11 +787,9 @@ int64_t of_filesize(OutputFile *of);
|
|||
int ifile_open(const OptionsContext *o, const char *filename, Scheduler *sch);
|
||||
void ifile_close(InputFile **f);
|
||||
|
||||
int ist_use(InputStream *ist, int decoding_needed,
|
||||
const ViewSpecifier *vs, SchedulerNode *src);
|
||||
int ist_output_add(InputStream *ist, OutputStream *ost);
|
||||
int ist_filter_add(InputStream *ist, InputFilter *ifilter, int is_simple,
|
||||
const ViewSpecifier *vs, InputFilterOptions *opts,
|
||||
SchedulerNode *src);
|
||||
InputFilterOptions *opts);
|
||||
|
||||
/**
|
||||
* Find an unused input stream of given type.
|
||||
|
|
@ -916,18 +806,46 @@ OutputStream *ost_iter(OutputStream *prev);
|
|||
|
||||
void update_benchmark(const char *fmt, ...);
|
||||
|
||||
#define SPECIFIER_OPT_FMT_str "%s"
|
||||
#define SPECIFIER_OPT_FMT_i "%i"
|
||||
#define SPECIFIER_OPT_FMT_i64 "%"PRId64
|
||||
#define SPECIFIER_OPT_FMT_ui64 "%"PRIu64
|
||||
#define SPECIFIER_OPT_FMT_f "%f"
|
||||
#define SPECIFIER_OPT_FMT_dbl "%lf"
|
||||
|
||||
#define WARN_MULTIPLE_OPT_USAGE(optname, type, idx, st)\
|
||||
{\
|
||||
char namestr[128] = "";\
|
||||
const SpecifierOpt *so = &o->optname.opt[idx];\
|
||||
const char *spec = so->specifier && so->specifier[0] ? so->specifier : "";\
|
||||
snprintf(namestr, sizeof(namestr), "-%s", o->optname.opt_canon->name);\
|
||||
if (o->optname.opt_canon->flags & OPT_HAS_ALT) {\
|
||||
const char * const *names_alt = o->optname.opt_canon->u1.names_alt;\
|
||||
for (int _i = 0; names_alt[_i]; _i++)\
|
||||
av_strlcatf(namestr, sizeof(namestr), "/-%s", names_alt[_i]);\
|
||||
}\
|
||||
av_log(NULL, AV_LOG_WARNING, "Multiple %s options specified for stream %d, only the last option '-%s%s%s "SPECIFIER_OPT_FMT_##type"' will be used.\n",\
|
||||
namestr, st->index, o->optname.opt_canon->name, spec[0] ? ":" : "", spec, so->u.type);\
|
||||
}
|
||||
|
||||
#define MATCH_PER_STREAM_OPT(name, type, outvar, fmtctx, st)\
|
||||
{\
|
||||
int _ret, _matches = 0, _match_idx;\
|
||||
for (int _i = 0; _i < o->name.nb_opt; _i++) {\
|
||||
char *spec = o->name.opt[_i].specifier;\
|
||||
if ((_ret = check_stream_specifier(fmtctx, st, spec)) > 0) {\
|
||||
outvar = o->name.opt[_i].u.type;\
|
||||
_match_idx = _i;\
|
||||
_matches++;\
|
||||
} else if (_ret < 0)\
|
||||
return _ret;\
|
||||
}\
|
||||
if (_matches > 1 && o->name.opt_canon)\
|
||||
WARN_MULTIPLE_OPT_USAGE(name, type, _match_idx, st);\
|
||||
}
|
||||
|
||||
const char *opt_match_per_type_str(const SpecifierOptList *sol,
|
||||
char mediatype);
|
||||
void opt_match_per_stream_str(void *logctx, const SpecifierOptList *sol,
|
||||
AVFormatContext *fc, AVStream *st, const char **out);
|
||||
void opt_match_per_stream_int(void *logctx, const SpecifierOptList *sol,
|
||||
AVFormatContext *fc, AVStream *st, int *out);
|
||||
void opt_match_per_stream_int64(void *logctx, const SpecifierOptList *sol,
|
||||
AVFormatContext *fc, AVStream *st, int64_t *out);
|
||||
void opt_match_per_stream_dbl(void *logctx, const SpecifierOptList *sol,
|
||||
AVFormatContext *fc, AVStream *st, double *out);
|
||||
|
||||
int view_specifier_parse(const char **pspec, ViewSpecifier *vs);
|
||||
|
||||
int muxer_thread(void *arg);
|
||||
int encoder_thread(void *arg);
|
||||
|
|
|
|||
|
|
@ -16,25 +16,24 @@
|
|||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <stdbit.h>
|
||||
|
||||
#include "libavutil/avassert.h"
|
||||
#include "libavutil/avstring.h"
|
||||
#include "libavutil/dict.h"
|
||||
#include "libavutil/error.h"
|
||||
#include "libavutil/log.h"
|
||||
#include "libavutil/mem.h"
|
||||
#include "libavutil/opt.h"
|
||||
#include "libavutil/pixdesc.h"
|
||||
#include "libavutil/pixfmt.h"
|
||||
#include "libavutil/stereo3d.h"
|
||||
#include "libavutil/time.h"
|
||||
#include "libavutil/timestamp.h"
|
||||
|
||||
#include "libavcodec/avcodec.h"
|
||||
#include "libavcodec/codec.h"
|
||||
|
||||
#include "libavfilter/buffersrc.h"
|
||||
|
||||
#include "ffmpeg.h"
|
||||
#include "ffmpeg_utils.h"
|
||||
#include "thread_queue.h"
|
||||
|
||||
typedef struct DecoderPriv {
|
||||
Decoder dec;
|
||||
|
|
@ -42,7 +41,6 @@ typedef struct DecoderPriv {
|
|||
AVCodecContext *dec_ctx;
|
||||
|
||||
AVFrame *frame;
|
||||
AVFrame *frame_tmp_ref;
|
||||
AVPacket *pkt;
|
||||
|
||||
// override output video sample aspect ratio with this value
|
||||
|
|
@ -52,7 +50,6 @@ typedef struct DecoderPriv {
|
|||
|
||||
// a combination of DECODER_FLAG_*, provided to dec_open()
|
||||
int flags;
|
||||
int apply_cropping;
|
||||
|
||||
enum AVPixelFormat hwaccel_pix_fmt;
|
||||
enum HWAccelID hwaccel_id;
|
||||
|
|
@ -81,23 +78,6 @@ typedef struct DecoderPriv {
|
|||
char log_name[32];
|
||||
char *parent_name;
|
||||
|
||||
// user specified decoder multiview options manually
|
||||
int multiview_user_config;
|
||||
|
||||
struct {
|
||||
ViewSpecifier vs;
|
||||
unsigned out_idx;
|
||||
} *views_requested;
|
||||
int nb_views_requested;
|
||||
|
||||
/* A map of view ID to decoder outputs.
|
||||
* MUST NOT be accessed outside of get_format()/get_buffer() */
|
||||
struct {
|
||||
unsigned id;
|
||||
uintptr_t out_mask;
|
||||
} *view_map;
|
||||
int nb_view_map;
|
||||
|
||||
struct {
|
||||
AVDictionary *opts;
|
||||
const AVCodec *codec;
|
||||
|
|
@ -127,7 +107,6 @@ void dec_free(Decoder **pdec)
|
|||
avcodec_free_context(&dp->dec_ctx);
|
||||
|
||||
av_frame_free(&dp->frame);
|
||||
av_frame_free(&dp->frame_tmp_ref);
|
||||
av_packet_free(&dp->pkt);
|
||||
|
||||
av_dict_free(&dp->standalone_init.opts);
|
||||
|
|
@ -138,9 +117,6 @@ void dec_free(Decoder **pdec)
|
|||
|
||||
av_freep(&dp->parent_name);
|
||||
|
||||
av_freep(&dp->views_requested);
|
||||
av_freep(&dp->view_map);
|
||||
|
||||
av_freep(pdec);
|
||||
}
|
||||
|
||||
|
|
@ -285,10 +261,6 @@ static int64_t video_duration_estimate(const DecoderPriv *dp, const AVFrame *fra
|
|||
const int ts_unreliable = dp->flags & DECODER_FLAG_TS_UNRELIABLE;
|
||||
const int fr_forced = dp->flags & DECODER_FLAG_FRAMERATE_FORCED;
|
||||
int64_t codec_duration = 0;
|
||||
// difference between this and last frame's timestamps
|
||||
const int64_t ts_diff =
|
||||
(frame->pts != AV_NOPTS_VALUE && dp->last_frame_pts != AV_NOPTS_VALUE) ?
|
||||
frame->pts - dp->last_frame_pts : -1;
|
||||
|
||||
// XXX lavf currently makes up frame durations when they are not provided by
|
||||
// the container. As there is no way to reliably distinguish real container
|
||||
|
|
@ -296,13 +268,8 @@ static int64_t video_duration_estimate(const DecoderPriv *dp, const AVFrame *fra
|
|||
// the container has timestamps. Eventually lavf should stop making up
|
||||
// durations, then this should be simplified.
|
||||
|
||||
// frame duration is unreliable (typically guessed by lavf) when it is equal
|
||||
// to 1 and the actual duration of the last frame is more than 2x larger
|
||||
const int duration_unreliable = frame->duration == 1 && ts_diff > 2 * frame->duration;
|
||||
|
||||
// prefer frame duration for containers with timestamps
|
||||
if (fr_forced ||
|
||||
(frame->duration > 0 && !ts_unreliable && !duration_unreliable))
|
||||
if (frame->duration > 0 && (!ts_unreliable || fr_forced))
|
||||
return frame->duration;
|
||||
|
||||
if (dp->dec_ctx->framerate.den && dp->dec_ctx->framerate.num) {
|
||||
|
|
@ -319,8 +286,9 @@ static int64_t video_duration_estimate(const DecoderPriv *dp, const AVFrame *fra
|
|||
|
||||
// when timestamps are available, repeat last frame's actual duration
|
||||
// (i.e. pts difference between this and last frame)
|
||||
if (ts_diff > 0)
|
||||
return ts_diff;
|
||||
if (frame->pts != AV_NOPTS_VALUE && dp->last_frame_pts != AV_NOPTS_VALUE &&
|
||||
frame->pts > dp->last_frame_pts)
|
||||
return frame->pts - dp->last_frame_pts;
|
||||
|
||||
// try frame/codec duration
|
||||
if (frame->duration > 0)
|
||||
|
|
@ -382,8 +350,7 @@ fail:
|
|||
return err;
|
||||
}
|
||||
|
||||
static int video_frame_process(DecoderPriv *dp, AVFrame *frame,
|
||||
unsigned *outputs_mask)
|
||||
static int video_frame_process(DecoderPriv *dp, AVFrame *frame)
|
||||
{
|
||||
#if FFMPEG_OPT_TOP
|
||||
if (dp->flags & DECODER_FLAG_TOP_FIELD_FIRST) {
|
||||
|
|
@ -436,18 +403,6 @@ static int video_frame_process(DecoderPriv *dp, AVFrame *frame,
|
|||
if (dp->sar_override.num)
|
||||
frame->sample_aspect_ratio = dp->sar_override;
|
||||
|
||||
if (dp->apply_cropping) {
|
||||
// lavfi does not require aligned frame data
|
||||
int ret = av_frame_apply_cropping(frame, AV_FRAME_CROP_UNALIGNED);
|
||||
if (ret < 0) {
|
||||
av_log(dp, AV_LOG_ERROR, "Error applying decoder cropping\n");
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
if (frame->opaque)
|
||||
*outputs_mask = (uintptr_t)frame->opaque;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -607,7 +562,7 @@ static int process_subtitle(DecoderPriv *dp, AVFrame *frame)
|
|||
if (!subtitle)
|
||||
return 0;
|
||||
|
||||
ret = sch_dec_send(dp->sch, dp->sch_idx, 0, frame);
|
||||
ret = sch_dec_send(dp->sch, dp->sch_idx, frame);
|
||||
if (ret < 0)
|
||||
av_frame_unref(frame);
|
||||
|
||||
|
|
@ -649,7 +604,7 @@ static int transcode_subtitles(DecoderPriv *dp, const AVPacket *pkt,
|
|||
frame->time_base = pkt->time_base;
|
||||
frame->opaque = (void*)(intptr_t)FRAME_OPAQUE_SUB_HEARTBEAT;
|
||||
|
||||
ret = sch_dec_send(dp->sch, dp->sch_idx, 0, frame);
|
||||
ret = sch_dec_send(dp->sch, dp->sch_idx, frame);
|
||||
return ret == AVERROR_EOF ? AVERROR_EXIT : ret;
|
||||
} else if (pkt && (intptr_t)pkt->opaque == PKT_OPAQUE_FIX_SUB_DURATION) {
|
||||
return fix_sub_duration_heartbeat(dp, av_rescale_q(pkt->pts, pkt->time_base,
|
||||
|
|
@ -733,17 +688,17 @@ static int packet_decode(DecoderPriv *dp, AVPacket *pkt, AVFrame *frame)
|
|||
av_log(dp, AV_LOG_ERROR, "Error submitting %s to decoder: %s\n",
|
||||
pkt ? "packet" : "EOF", av_err2str(ret));
|
||||
|
||||
if (ret == AVERROR_EOF)
|
||||
return ret;
|
||||
if (ret != AVERROR_EOF) {
|
||||
dp->dec.decode_errors++;
|
||||
if (!exit_on_error)
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
dp->dec.decode_errors++;
|
||||
if (exit_on_error)
|
||||
return ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
while (1) {
|
||||
FrameData *fd;
|
||||
unsigned outputs_mask = 1;
|
||||
|
||||
av_frame_unref(frame);
|
||||
|
||||
|
|
@ -792,7 +747,7 @@ static int packet_decode(DecoderPriv *dp, AVPacket *pkt, AVFrame *frame)
|
|||
|
||||
audio_ts_process(dp, frame);
|
||||
} else {
|
||||
ret = video_frame_process(dp, frame, &outputs_mask);
|
||||
ret = video_frame_process(dp, frame);
|
||||
if (ret < 0) {
|
||||
av_log(dp, AV_LOG_FATAL,
|
||||
"Error while processing the decoded data\n");
|
||||
|
|
@ -802,28 +757,10 @@ static int packet_decode(DecoderPriv *dp, AVPacket *pkt, AVFrame *frame)
|
|||
|
||||
dp->dec.frames_decoded++;
|
||||
|
||||
for (int i = 0; i < stdc_count_ones(outputs_mask); i++) {
|
||||
AVFrame *to_send = frame;
|
||||
int pos;
|
||||
|
||||
av_assert0(outputs_mask);
|
||||
pos = stdc_trailing_zeros(outputs_mask);
|
||||
outputs_mask &= ~(1U << pos);
|
||||
|
||||
// this is not the last output and sch_dec_send() consumes the frame
|
||||
// given to it, so make a temporary reference
|
||||
if (outputs_mask) {
|
||||
to_send = dp->frame_tmp_ref;
|
||||
ret = av_frame_ref(to_send, frame);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = sch_dec_send(dp->sch, dp->sch_idx, pos, to_send);
|
||||
if (ret < 0) {
|
||||
av_frame_unref(to_send);
|
||||
return ret == AVERROR_EOF ? AVERROR_EXIT : ret;
|
||||
}
|
||||
ret = sch_dec_send(dp->sch, dp->sch_idx, frame);
|
||||
if (ret < 0) {
|
||||
av_frame_unref(frame);
|
||||
return ret == AVERROR_EOF ? AVERROR_EXIT : ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -998,7 +935,7 @@ static int decoder_thread(void *arg)
|
|||
dp->last_frame_pts + dp->last_frame_duration_est;
|
||||
dt.frame->time_base = dp->last_frame_tb;
|
||||
|
||||
ret = sch_dec_send(dp->sch, dp->sch_idx, 0, dt.frame);
|
||||
ret = sch_dec_send(dp->sch, dp->sch_idx, dt.frame);
|
||||
if (ret < 0 && ret != AVERROR_EOF) {
|
||||
av_log(dp, AV_LOG_FATAL,
|
||||
"Error signalling EOF timestamp: %s\n", av_err2str(ret));
|
||||
|
|
@ -1022,307 +959,10 @@ finish:
|
|||
return ret;
|
||||
}
|
||||
|
||||
int dec_request_view(Decoder *d, const ViewSpecifier *vs,
|
||||
SchedulerNode *src)
|
||||
{
|
||||
DecoderPriv *dp = dp_from_dec(d);
|
||||
unsigned out_idx = 0;
|
||||
int ret;
|
||||
|
||||
if (dp->multiview_user_config) {
|
||||
if (!vs || vs->type == VIEW_SPECIFIER_TYPE_NONE) {
|
||||
*src = SCH_DEC_OUT(dp->sch_idx, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
av_log(dp, AV_LOG_ERROR,
|
||||
"Manually selecting views with -view_ids cannot be combined "
|
||||
"with view selection via stream specifiers. It is strongly "
|
||||
"recommended you always use stream specifiers only.\n");
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
// when multiview_user_config is not set, NONE specifier is treated
|
||||
// as requesting the base view
|
||||
vs = (vs && vs->type != VIEW_SPECIFIER_TYPE_NONE) ? vs :
|
||||
&(ViewSpecifier){ .type = VIEW_SPECIFIER_TYPE_IDX, .val = 0 };
|
||||
|
||||
// check if the specifier matches an already-existing one
|
||||
for (int i = 0; i < dp->nb_views_requested; i++) {
|
||||
const ViewSpecifier *vs1 = &dp->views_requested[i].vs;
|
||||
|
||||
if (vs->type == vs1->type &&
|
||||
(vs->type == VIEW_SPECIFIER_TYPE_ALL || vs->val == vs1->val)) {
|
||||
*src = SCH_DEC_OUT(dp->sch_idx, dp->views_requested[i].out_idx);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// we use a bitmask to map view IDs to decoder outputs, which
|
||||
// limits the number of outputs allowed
|
||||
if (dp->nb_views_requested >= sizeof(dp->view_map[0].out_mask) * 8) {
|
||||
av_log(dp, AV_LOG_ERROR, "Too many view specifiers\n");
|
||||
return AVERROR(ENOSYS);
|
||||
}
|
||||
|
||||
ret = GROW_ARRAY(dp->views_requested, dp->nb_views_requested);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (dp->nb_views_requested > 1) {
|
||||
ret = sch_add_dec_output(dp->sch, dp->sch_idx);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
out_idx = ret;
|
||||
}
|
||||
|
||||
dp->views_requested[dp->nb_views_requested - 1].out_idx = out_idx;
|
||||
dp->views_requested[dp->nb_views_requested - 1].vs = *vs;
|
||||
|
||||
*src = SCH_DEC_OUT(dp->sch_idx,
|
||||
dp->views_requested[dp->nb_views_requested - 1].out_idx);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int multiview_setup(DecoderPriv *dp, AVCodecContext *dec_ctx)
|
||||
{
|
||||
unsigned views_wanted = 0;
|
||||
|
||||
unsigned nb_view_ids_av, nb_view_ids;
|
||||
unsigned *view_ids_av = NULL, *view_pos_av = NULL;
|
||||
int *view_ids = NULL;
|
||||
int ret;
|
||||
|
||||
// no views/only base view were requested - do nothing
|
||||
if (!dp->nb_views_requested ||
|
||||
(dp->nb_views_requested == 1 &&
|
||||
dp->views_requested[0].vs.type == VIEW_SPECIFIER_TYPE_IDX &&
|
||||
dp->views_requested[0].vs.val == 0))
|
||||
return 0;
|
||||
|
||||
av_freep(&dp->view_map);
|
||||
dp->nb_view_map = 0;
|
||||
|
||||
// retrieve views available in current CVS
|
||||
ret = av_opt_get_array_size(dec_ctx, "view_ids_available",
|
||||
AV_OPT_SEARCH_CHILDREN, &nb_view_ids_av);
|
||||
if (ret < 0) {
|
||||
av_log(dp, AV_LOG_ERROR,
|
||||
"Multiview decoding requested, but decoder '%s' does not "
|
||||
"support it\n", dec_ctx->codec->name);
|
||||
return AVERROR(ENOSYS);
|
||||
}
|
||||
|
||||
if (nb_view_ids_av) {
|
||||
unsigned nb_view_pos_av;
|
||||
|
||||
if (nb_view_ids_av >= sizeof(views_wanted) * 8) {
|
||||
av_log(dp, AV_LOG_ERROR, "Too many views in video: %u\n", nb_view_ids_av);
|
||||
ret = AVERROR(ENOSYS);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
view_ids_av = av_calloc(nb_view_ids_av, sizeof(*view_ids_av));
|
||||
if (!view_ids_av) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
ret = av_opt_get_array(dec_ctx, "view_ids_available",
|
||||
AV_OPT_SEARCH_CHILDREN, 0, nb_view_ids_av,
|
||||
AV_OPT_TYPE_UINT, view_ids_av);
|
||||
if (ret < 0)
|
||||
goto fail;
|
||||
|
||||
ret = av_opt_get_array_size(dec_ctx, "view_pos_available",
|
||||
AV_OPT_SEARCH_CHILDREN, &nb_view_pos_av);
|
||||
if (ret >= 0 && nb_view_pos_av == nb_view_ids_av) {
|
||||
view_pos_av = av_calloc(nb_view_ids_av, sizeof(*view_pos_av));
|
||||
if (!view_pos_av) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
ret = av_opt_get_array(dec_ctx, "view_pos_available",
|
||||
AV_OPT_SEARCH_CHILDREN, 0, nb_view_ids_av,
|
||||
AV_OPT_TYPE_UINT, view_pos_av);
|
||||
if (ret < 0)
|
||||
goto fail;
|
||||
}
|
||||
} else {
|
||||
// assume there is a single view with ID=0
|
||||
nb_view_ids_av = 1;
|
||||
view_ids_av = av_calloc(nb_view_ids_av, sizeof(*view_ids_av));
|
||||
view_pos_av = av_calloc(nb_view_ids_av, sizeof(*view_pos_av));
|
||||
if (!view_ids_av || !view_pos_av) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto fail;
|
||||
}
|
||||
view_pos_av[0] = AV_STEREO3D_VIEW_UNSPEC;
|
||||
}
|
||||
|
||||
dp->view_map = av_calloc(nb_view_ids_av, sizeof(*dp->view_map));
|
||||
if (!dp->view_map) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto fail;
|
||||
}
|
||||
dp->nb_view_map = nb_view_ids_av;
|
||||
|
||||
for (int i = 0; i < dp->nb_view_map; i++)
|
||||
dp->view_map[i].id = view_ids_av[i];
|
||||
|
||||
// figure out which views should go to which output
|
||||
for (int i = 0; i < dp->nb_views_requested; i++) {
|
||||
const ViewSpecifier *vs = &dp->views_requested[i].vs;
|
||||
|
||||
switch (vs->type) {
|
||||
case VIEW_SPECIFIER_TYPE_IDX:
|
||||
if (vs->val >= nb_view_ids_av) {
|
||||
av_log(dp, exit_on_error ? AV_LOG_ERROR : AV_LOG_WARNING,
|
||||
"View with index %u requested, but only %u views available "
|
||||
"in current video sequence (more views may or may not be "
|
||||
"available in later sequences).\n",
|
||||
vs->val, nb_view_ids_av);
|
||||
if (exit_on_error) {
|
||||
ret = AVERROR(EINVAL);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
views_wanted |= 1U << vs->val;
|
||||
dp->view_map[vs->val].out_mask |= 1ULL << i;
|
||||
|
||||
break;
|
||||
case VIEW_SPECIFIER_TYPE_ID: {
|
||||
int view_idx = -1;
|
||||
|
||||
for (unsigned j = 0; j < nb_view_ids_av; j++) {
|
||||
if (view_ids_av[j] == vs->val) {
|
||||
view_idx = j;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (view_idx < 0) {
|
||||
av_log(dp, exit_on_error ? AV_LOG_ERROR : AV_LOG_WARNING,
|
||||
"View with ID %u requested, but is not available "
|
||||
"in the video sequence\n", vs->val);
|
||||
if (exit_on_error) {
|
||||
ret = AVERROR(EINVAL);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
views_wanted |= 1U << view_idx;
|
||||
dp->view_map[view_idx].out_mask |= 1ULL << i;
|
||||
|
||||
break;
|
||||
}
|
||||
case VIEW_SPECIFIER_TYPE_POS: {
|
||||
int view_idx = -1;
|
||||
|
||||
for (unsigned j = 0; view_pos_av && j < nb_view_ids_av; j++) {
|
||||
if (view_pos_av[j] == vs->val) {
|
||||
view_idx = j;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (view_idx < 0) {
|
||||
av_log(dp, exit_on_error ? AV_LOG_ERROR : AV_LOG_WARNING,
|
||||
"View position '%s' requested, but is not available "
|
||||
"in the video sequence\n", av_stereo3d_view_name(vs->val));
|
||||
if (exit_on_error) {
|
||||
ret = AVERROR(EINVAL);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
views_wanted |= 1U << view_idx;
|
||||
dp->view_map[view_idx].out_mask |= 1ULL << i;
|
||||
|
||||
break;
|
||||
}
|
||||
case VIEW_SPECIFIER_TYPE_ALL:
|
||||
views_wanted |= (1U << nb_view_ids_av) - 1;
|
||||
|
||||
for (int j = 0; j < dp->nb_view_map; j++)
|
||||
dp->view_map[j].out_mask |= 1ULL << i;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!views_wanted) {
|
||||
av_log(dp, AV_LOG_ERROR, "No views were selected for decoding\n");
|
||||
ret = AVERROR(EINVAL);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
// signal to decoder which views we want
|
||||
nb_view_ids = stdc_count_ones(views_wanted);
|
||||
view_ids = av_malloc_array(nb_view_ids, sizeof(*view_ids));
|
||||
if (!view_ids) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < nb_view_ids; i++) {
|
||||
int pos;
|
||||
|
||||
av_assert0(views_wanted);
|
||||
pos = stdc_trailing_zeros(views_wanted);
|
||||
views_wanted &= ~(1U << pos);
|
||||
|
||||
view_ids[i] = view_ids_av[pos];
|
||||
}
|
||||
|
||||
// unset view_ids in case we set it earlier
|
||||
av_opt_set(dec_ctx, "view_ids", NULL, AV_OPT_SEARCH_CHILDREN);
|
||||
|
||||
ret = av_opt_set_array(dec_ctx, "view_ids", AV_OPT_SEARCH_CHILDREN,
|
||||
0, nb_view_ids, AV_OPT_TYPE_INT, view_ids);
|
||||
if (ret < 0)
|
||||
goto fail;
|
||||
|
||||
if (!dp->frame_tmp_ref) {
|
||||
dp->frame_tmp_ref = av_frame_alloc();
|
||||
if (!dp->frame_tmp_ref) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
||||
fail:
|
||||
av_freep(&view_ids_av);
|
||||
av_freep(&view_pos_av);
|
||||
av_freep(&view_ids);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void multiview_check_manual(DecoderPriv *dp, const AVDictionary *dec_opts)
|
||||
{
|
||||
if (av_dict_get(dec_opts, "view_ids", NULL, 0)) {
|
||||
av_log(dp, AV_LOG_WARNING, "Manually selecting views with -view_ids "
|
||||
"is not recommended, use view specifiers instead\n");
|
||||
dp->multiview_user_config = 1;
|
||||
}
|
||||
}
|
||||
|
||||
static enum AVPixelFormat get_format(AVCodecContext *s, const enum AVPixelFormat *pix_fmts)
|
||||
{
|
||||
DecoderPriv *dp = s->opaque;
|
||||
const enum AVPixelFormat *p;
|
||||
int ret;
|
||||
|
||||
ret = multiview_setup(dp, s);
|
||||
if (ret < 0) {
|
||||
av_log(dp, AV_LOG_ERROR, "Error setting up multiview decoding: %s\n",
|
||||
av_err2str(ret));
|
||||
return AV_PIX_FMT_NONE;
|
||||
}
|
||||
|
||||
for (p = pix_fmts; *p != AV_PIX_FMT_NONE; p++) {
|
||||
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(*p);
|
||||
|
|
@ -1353,26 +993,6 @@ static enum AVPixelFormat get_format(AVCodecContext *s, const enum AVPixelFormat
|
|||
return *p;
|
||||
}
|
||||
|
||||
static int get_buffer(AVCodecContext *dec_ctx, AVFrame *frame, int flags)
|
||||
{
|
||||
DecoderPriv *dp = dec_ctx->opaque;
|
||||
|
||||
// for multiview video, store the output mask in frame opaque
|
||||
if (dp->nb_view_map) {
|
||||
const AVFrameSideData *sd = av_frame_get_side_data(frame, AV_FRAME_DATA_VIEW_ID);
|
||||
int view_id = sd ? *(int*)sd->data : 0;
|
||||
|
||||
for (int i = 0; i < dp->nb_view_map; i++) {
|
||||
if (dp->view_map[i].id == view_id) {
|
||||
frame->opaque = (void*)dp->view_map[i].out_mask;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return avcodec_default_get_buffer2(dec_ctx, frame, flags);
|
||||
}
|
||||
|
||||
static HWDevice *hw_device_match_by_codec(const AVCodec *codec)
|
||||
{
|
||||
const AVCodecHWConfig *config;
|
||||
|
|
@ -1566,12 +1186,13 @@ static int dec_open(DecoderPriv *dp, AVDictionary **dec_opts,
|
|||
|
||||
dp->dec_ctx->opaque = dp;
|
||||
dp->dec_ctx->get_format = get_format;
|
||||
dp->dec_ctx->get_buffer2 = get_buffer;
|
||||
dp->dec_ctx->pkt_timebase = o->time_base;
|
||||
|
||||
if (!av_dict_get(*dec_opts, "threads", NULL, 0))
|
||||
av_dict_set(dec_opts, "threads", "auto", 0);
|
||||
|
||||
av_dict_set(dec_opts, "flags", "+copy_opaque", AV_DICT_MULTIKEY);
|
||||
|
||||
ret = hw_device_setup_for_decode(dp, codec, o->hwaccel_device);
|
||||
if (ret < 0) {
|
||||
av_log(dp, AV_LOG_ERROR,
|
||||
|
|
@ -1580,25 +1201,7 @@ static int dec_open(DecoderPriv *dp, AVDictionary **dec_opts,
|
|||
return ret;
|
||||
}
|
||||
|
||||
ret = av_opt_set_dict2(dp->dec_ctx, dec_opts, AV_OPT_SEARCH_CHILDREN);
|
||||
if (ret < 0) {
|
||||
av_log(dp, AV_LOG_ERROR, "Error applying decoder options: %s\n",
|
||||
av_err2str(ret));
|
||||
return ret;
|
||||
}
|
||||
ret = check_avoptions(*dec_opts);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
dp->dec_ctx->flags |= AV_CODEC_FLAG_COPY_OPAQUE;
|
||||
if (o->flags & DECODER_FLAG_BITEXACT)
|
||||
dp->dec_ctx->flags |= AV_CODEC_FLAG_BITEXACT;
|
||||
|
||||
// we apply cropping ourselves
|
||||
dp->apply_cropping = dp->dec_ctx->apply_cropping;
|
||||
dp->dec_ctx->apply_cropping = 0;
|
||||
|
||||
if ((ret = avcodec_open2(dp->dec_ctx, codec, NULL)) < 0) {
|
||||
if ((ret = avcodec_open2(dp->dec_ctx, codec, dec_opts)) < 0) {
|
||||
av_log(dp, AV_LOG_ERROR, "Error while opening decoder: %s\n",
|
||||
av_err2str(ret));
|
||||
return ret;
|
||||
|
|
@ -1617,6 +1220,10 @@ static int dec_open(DecoderPriv *dp, AVDictionary **dec_opts,
|
|||
dp->dec_ctx->extra_hw_frames = extra_frames;
|
||||
}
|
||||
|
||||
ret = check_avoptions(*dec_opts);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
dp->dec.subtitle_header = dp->dec_ctx->subtitle_header;
|
||||
dp->dec.subtitle_header_size = dp->dec_ctx->subtitle_header_size;
|
||||
|
||||
|
|
@ -1637,11 +1244,6 @@ static int dec_open(DecoderPriv *dp, AVDictionary **dec_opts,
|
|||
param_out->color_range = dp->dec_ctx->color_range;
|
||||
}
|
||||
|
||||
av_frame_side_data_free(¶m_out->side_data, ¶m_out->nb_side_data);
|
||||
ret = clone_side_data(¶m_out->side_data, ¶m_out->nb_side_data,
|
||||
dp->dec_ctx->decoded_side_data, dp->dec_ctx->nb_decoded_side_data, 0);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
param_out->time_base = dp->dec_ctx->pkt_timebase;
|
||||
}
|
||||
|
||||
|
|
@ -1661,8 +1263,6 @@ int dec_init(Decoder **pdec, Scheduler *sch,
|
|||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
multiview_check_manual(dp, *dec_opts);
|
||||
|
||||
ret = dec_open(dp, dec_opts, o, param_out);
|
||||
if (ret < 0)
|
||||
goto fail;
|
||||
|
|
@ -1727,7 +1327,7 @@ int dec_create(const OptionsContext *o, const char *arg, Scheduler *sch)
|
|||
return ret;
|
||||
enc_idx = ret;
|
||||
|
||||
ret = sch_connect(sch, SCH_ENC(enc_idx), SCH_DEC_IN(dp->sch_idx));
|
||||
ret = sch_connect(sch, SCH_ENC(enc_idx), SCH_DEC(dp->sch_idx));
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
|
@ -1735,8 +1335,6 @@ int dec_create(const OptionsContext *o, const char *arg, Scheduler *sch)
|
|||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
multiview_check_manual(dp, dp->standalone_init.opts);
|
||||
|
||||
if (o->codec_names.nb_opt) {
|
||||
const char *name = o->codec_names.opt[o->codec_names.nb_opt - 1].u.str;
|
||||
dp->standalone_init.codec = avcodec_find_decoder_by_name(name);
|
||||
|
|
@ -1749,8 +1347,7 @@ int dec_create(const OptionsContext *o, const char *arg, Scheduler *sch)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int dec_filter_add(Decoder *d, InputFilter *ifilter, InputFilterOptions *opts,
|
||||
const ViewSpecifier *vs, SchedulerNode *src)
|
||||
int dec_filter_add(Decoder *d, InputFilter *ifilter, InputFilterOptions *opts)
|
||||
{
|
||||
DecoderPriv *dp = dp_from_dec(d);
|
||||
char name[16];
|
||||
|
|
@ -1760,5 +1357,5 @@ int dec_filter_add(Decoder *d, InputFilter *ifilter, InputFilterOptions *opts,
|
|||
if (!opts->name)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
return dec_request_view(d, vs, src);
|
||||
return dp->sch_idx;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@
|
|||
#include "libavutil/display.h"
|
||||
#include "libavutil/error.h"
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "libavutil/mem.h"
|
||||
#include "libavutil/opt.h"
|
||||
#include "libavutil/parseutils.h"
|
||||
#include "libavutil/pixdesc.h"
|
||||
|
|
@ -65,20 +64,16 @@ typedef struct DemuxStream {
|
|||
int streamcopy_needed;
|
||||
int have_sub2video;
|
||||
int reinit_filters;
|
||||
int autorotate;
|
||||
int apply_cropping;
|
||||
int drop_changed;
|
||||
|
||||
|
||||
int wrap_correction_done;
|
||||
int saw_first_ts;
|
||||
/// dts of the first packet read for this stream (in AV_TIME_BASE units)
|
||||
///< dts of the first packet read for this stream (in AV_TIME_BASE units)
|
||||
int64_t first_dts;
|
||||
|
||||
/* predicted dts of the next packet read for this stream or (when there are
|
||||
* several frames in a packet) of the next frame in current packet (in AV_TIME_BASE units) */
|
||||
int64_t next_dts;
|
||||
/// dts of the last packet read for this stream (in AV_TIME_BASE units)
|
||||
///< dts of the last packet read for this stream (in AV_TIME_BASE units)
|
||||
int64_t dts;
|
||||
|
||||
const AVCodecDescriptor *codec_desc;
|
||||
|
|
@ -95,12 +90,6 @@ typedef struct DemuxStream {
|
|||
uint64_t nb_packets;
|
||||
// combined size of all the packets read
|
||||
uint64_t data_size;
|
||||
// latest wallclock time at which packet reading resumed after a stall - used for readrate
|
||||
int64_t resume_wc;
|
||||
// timestamp of first packet sent after the latest stall - used for readrate
|
||||
int64_t resume_pts;
|
||||
// measure of how far behind packet reading is against spceified readrate
|
||||
int64_t lag;
|
||||
} DemuxStream;
|
||||
|
||||
typedef struct Demuxer {
|
||||
|
|
@ -134,7 +123,6 @@ typedef struct Demuxer {
|
|||
|
||||
float readrate;
|
||||
double readrate_initial_burst;
|
||||
float readrate_catchup;
|
||||
|
||||
Scheduler *sch;
|
||||
|
||||
|
|
@ -248,7 +236,7 @@ static void ts_discontinuity_detect(Demuxer *d, InputStream *ist,
|
|||
}
|
||||
} else {
|
||||
if (FFABS(delta) > 1LL * dts_error_threshold * AV_TIME_BASE) {
|
||||
av_log(ist, AV_LOG_WARNING,
|
||||
av_log(NULL, AV_LOG_WARNING,
|
||||
"DTS %"PRId64", next:%"PRId64" st:%d invalid dropping\n",
|
||||
pkt->dts, ds->next_dts, pkt->stream_index);
|
||||
pkt->dts = AV_NOPTS_VALUE;
|
||||
|
|
@ -257,7 +245,7 @@ static void ts_discontinuity_detect(Demuxer *d, InputStream *ist,
|
|||
int64_t pkt_pts = av_rescale_q(pkt->pts, pkt->time_base, AV_TIME_BASE_Q);
|
||||
delta = pkt_pts - ds->next_dts;
|
||||
if (FFABS(delta) > 1LL * dts_error_threshold * AV_TIME_BASE) {
|
||||
av_log(ist, AV_LOG_WARNING,
|
||||
av_log(NULL, AV_LOG_WARNING,
|
||||
"PTS %"PRId64", next:%"PRId64" invalid dropping st:%d\n",
|
||||
pkt->pts, ds->next_dts, pkt->stream_index);
|
||||
pkt->pts = AV_NOPTS_VALUE;
|
||||
|
|
@ -269,7 +257,7 @@ static void ts_discontinuity_detect(Demuxer *d, InputStream *ist,
|
|||
int64_t delta = pkt_dts - d->last_ts;
|
||||
if (FFABS(delta) > 1LL * dts_delta_threshold * AV_TIME_BASE) {
|
||||
d->ts_offset_discont -= delta;
|
||||
av_log(ist, AV_LOG_DEBUG,
|
||||
av_log(NULL, AV_LOG_DEBUG,
|
||||
"Inter stream timestamp discontinuity %"PRId64", new offset= %"PRId64"\n",
|
||||
delta, d->ts_offset_discont);
|
||||
pkt->dts -= av_rescale_q(delta, AV_TIME_BASE_Q, pkt->time_base);
|
||||
|
|
@ -484,7 +472,7 @@ static int input_packet_process(Demuxer *d, AVPacket *pkt, unsigned *send_flags)
|
|||
fd->wallclock[LATENCY_PROBE_DEMUX] = av_gettime_relative();
|
||||
|
||||
if (debug_ts) {
|
||||
av_log(ist, AV_LOG_INFO, "demuxer+ffmpeg -> ist_index:%d:%d type:%s pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s duration:%s duration_time:%s off:%s off_time:%s\n",
|
||||
av_log(NULL, AV_LOG_INFO, "demuxer+ffmpeg -> ist_index:%d:%d type:%s pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s duration:%s duration_time:%s off:%s off_time:%s\n",
|
||||
f->index, pkt->stream_index,
|
||||
av_get_media_type_string(ist->par->codec_type),
|
||||
av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &pkt->time_base),
|
||||
|
|
@ -503,42 +491,16 @@ static void readrate_sleep(Demuxer *d)
|
|||
(f->start_time_effective != AV_NOPTS_VALUE ? f->start_time_effective * !start_at_zero : 0) +
|
||||
(f->start_time != AV_NOPTS_VALUE ? f->start_time : 0)
|
||||
);
|
||||
int64_t initial_burst = AV_TIME_BASE * d->readrate_initial_burst;
|
||||
int resume_warn = 0;
|
||||
|
||||
int64_t burst_until = AV_TIME_BASE * d->readrate_initial_burst;
|
||||
for (int i = 0; i < f->nb_streams; i++) {
|
||||
InputStream *ist = f->streams[i];
|
||||
DemuxStream *ds = ds_from_ist(ist);
|
||||
int64_t stream_ts_offset, pts, now, wc_elapsed, elapsed, lag, max_pts, limit_pts;
|
||||
|
||||
if (ds->discard) continue;
|
||||
|
||||
int64_t stream_ts_offset, pts, now;
|
||||
stream_ts_offset = FFMAX(ds->first_dts != AV_NOPTS_VALUE ? ds->first_dts : 0, file_start);
|
||||
pts = av_rescale(ds->dts, 1000000, AV_TIME_BASE);
|
||||
now = av_gettime_relative();
|
||||
wc_elapsed = now - d->wallclock_start;
|
||||
max_pts = stream_ts_offset + initial_burst + wc_elapsed * d->readrate;
|
||||
lag = FFMAX(max_pts - pts, 0);
|
||||
if ( (!ds->lag && lag > 0.3 * AV_TIME_BASE) || ( lag > ds->lag + 0.3 * AV_TIME_BASE) ) {
|
||||
ds->lag = lag;
|
||||
ds->resume_wc = now;
|
||||
ds->resume_pts = pts;
|
||||
av_log_once(ds, AV_LOG_WARNING, AV_LOG_DEBUG, &resume_warn,
|
||||
"Resumed reading at pts %0.3f with rate %0.3f after a lag of %0.3fs\n",
|
||||
(float)pts/AV_TIME_BASE, d->readrate_catchup, (float)lag/AV_TIME_BASE);
|
||||
}
|
||||
if (ds->lag && !lag)
|
||||
ds->lag = ds->resume_wc = ds->resume_pts = 0;
|
||||
if (ds->resume_wc) {
|
||||
elapsed = now - ds->resume_wc;
|
||||
limit_pts = ds->resume_pts + elapsed * d->readrate_catchup;
|
||||
} else {
|
||||
elapsed = wc_elapsed;
|
||||
limit_pts = max_pts;
|
||||
}
|
||||
|
||||
if (pts > limit_pts)
|
||||
av_usleep(pts - limit_pts);
|
||||
now = (av_gettime_relative() - d->wallclock_start) * d->readrate + stream_ts_offset;
|
||||
if (pts - burst_until > now)
|
||||
av_usleep(pts - burst_until - now);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -874,6 +836,7 @@ static void ist_free(InputStream **pist)
|
|||
|
||||
av_dict_free(&ds->decoder_opts);
|
||||
av_freep(&ist->filters);
|
||||
av_freep(&ist->outputs);
|
||||
av_freep(&ds->dec_opts.hwaccel_device);
|
||||
|
||||
avcodec_parameters_free(&ist->par);
|
||||
|
|
@ -907,8 +870,7 @@ void ifile_close(InputFile **pf)
|
|||
av_freep(pf);
|
||||
}
|
||||
|
||||
int ist_use(InputStream *ist, int decoding_needed,
|
||||
const ViewSpecifier *vs, SchedulerNode *src)
|
||||
static int ist_use(InputStream *ist, int decoding_needed)
|
||||
{
|
||||
Demuxer *d = demuxer_from_ifile(ist->file);
|
||||
DemuxStream *ds = ds_from_ist(ist);
|
||||
|
|
@ -955,11 +917,11 @@ int ist_use(InputStream *ist, int decoding_needed,
|
|||
if (use_wallclock_as_timestamps)
|
||||
is_unreliable = 0;
|
||||
|
||||
ds->dec_opts.flags |= (!!ist->fix_sub_duration * DECODER_FLAG_FIX_SUB_DURATION) |
|
||||
(!!is_unreliable * DECODER_FLAG_TS_UNRELIABLE) |
|
||||
(!!(d->loop && is_audio) * DECODER_FLAG_SEND_END_TS)
|
||||
ds->dec_opts.flags = (!!ist->fix_sub_duration * DECODER_FLAG_FIX_SUB_DURATION) |
|
||||
(!!is_unreliable * DECODER_FLAG_TS_UNRELIABLE) |
|
||||
(!!(d->loop && is_audio) * DECODER_FLAG_SEND_END_TS)
|
||||
#if FFMPEG_OPT_TOP
|
||||
| ((ist->top_field_first >= 0) * DECODER_FLAG_TOP_FIELD_FIRST)
|
||||
| ((ist->top_field_first >= 0) * DECODER_FLAG_TOP_FIELD_FIRST)
|
||||
#endif
|
||||
;
|
||||
|
||||
|
|
@ -997,37 +959,43 @@ int ist_use(InputStream *ist, int decoding_needed,
|
|||
ds->sch_idx_dec = ret;
|
||||
|
||||
ret = sch_connect(d->sch, SCH_DSTREAM(d->f.index, ds->sch_idx_stream),
|
||||
SCH_DEC_IN(ds->sch_idx_dec));
|
||||
SCH_DEC(ds->sch_idx_dec));
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
d->have_audio_dec |= is_audio;
|
||||
}
|
||||
|
||||
if (decoding_needed && ist->par->codec_type == AVMEDIA_TYPE_VIDEO) {
|
||||
ret = dec_request_view(ist->decoder, vs, src);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
} else {
|
||||
*src = decoding_needed ?
|
||||
SCH_DEC_OUT(ds->sch_idx_dec, 0) :
|
||||
SCH_DSTREAM(d->f.index, ds->sch_idx_stream);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ist_output_add(InputStream *ist, OutputStream *ost)
|
||||
{
|
||||
DemuxStream *ds = ds_from_ist(ist);
|
||||
int ret;
|
||||
|
||||
ret = ist_use(ist, ost->enc ? DECODING_FOR_OST : 0);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = GROW_ARRAY(ist->outputs, ist->nb_outputs);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ist->outputs[ist->nb_outputs - 1] = ost;
|
||||
|
||||
return ost->enc ? ds->sch_idx_dec : ds->sch_idx_stream;
|
||||
}
|
||||
|
||||
int ist_filter_add(InputStream *ist, InputFilter *ifilter, int is_simple,
|
||||
const ViewSpecifier *vs, InputFilterOptions *opts,
|
||||
SchedulerNode *src)
|
||||
InputFilterOptions *opts)
|
||||
{
|
||||
Demuxer *d = demuxer_from_ifile(ist->file);
|
||||
DemuxStream *ds = ds_from_ist(ist);
|
||||
int64_t tsoffset = 0;
|
||||
int ret;
|
||||
|
||||
ret = ist_use(ist, is_simple ? DECODING_FOR_OST : DECODING_FOR_FILTER,
|
||||
vs, src);
|
||||
ret = ist_use(ist, is_simple ? DECODING_FOR_OST : DECODING_FOR_FILTER);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
|
@ -1038,23 +1006,11 @@ int ist_filter_add(InputStream *ist, InputFilter *ifilter, int is_simple,
|
|||
ist->filters[ist->nb_filters - 1] = ifilter;
|
||||
|
||||
if (ist->par->codec_type == AVMEDIA_TYPE_VIDEO) {
|
||||
const AVPacketSideData *sd = av_packet_side_data_get(ist->par->coded_side_data,
|
||||
ist->par->nb_coded_side_data,
|
||||
AV_PKT_DATA_FRAME_CROPPING);
|
||||
if (ist->framerate.num > 0 && ist->framerate.den > 0) {
|
||||
opts->framerate = ist->framerate;
|
||||
opts->flags |= IFILTER_FLAG_CFR;
|
||||
} else
|
||||
opts->framerate = av_guess_frame_rate(d->f.ctx, ist->st, NULL);
|
||||
if (sd && sd->size >= sizeof(uint32_t) * 4) {
|
||||
opts->crop_top = AV_RL32(sd->data + 0);
|
||||
opts->crop_bottom = AV_RL32(sd->data + 4);
|
||||
opts->crop_left = AV_RL32(sd->data + 8);
|
||||
opts->crop_right = AV_RL32(sd->data + 12);
|
||||
if (ds->apply_cropping && ds->apply_cropping != CROP_CODEC &&
|
||||
(opts->crop_top | opts->crop_bottom | opts->crop_left | opts->crop_right))
|
||||
opts->flags |= IFILTER_FLAG_CROP;
|
||||
}
|
||||
} else if (ist->par->codec_type == AVMEDIA_TYPE_SUBTITLE) {
|
||||
/* Compute the size of the canvas for the subtitles stream.
|
||||
If the subtitles codecpar has set a size, use it. Otherwise use the
|
||||
|
|
@ -1108,22 +1064,20 @@ int ist_filter_add(InputStream *ist, InputFilter *ifilter, int is_simple,
|
|||
if (!opts->name)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
opts->flags |= IFILTER_FLAG_AUTOROTATE * !!(ds->autorotate) |
|
||||
IFILTER_FLAG_REINIT * !!(ds->reinit_filters) |
|
||||
IFILTER_FLAG_DROPCHANGED* !!(ds->drop_changed);
|
||||
opts->flags |= IFILTER_FLAG_AUTOROTATE * !!(ist->autorotate) |
|
||||
IFILTER_FLAG_REINIT * !!(ds->reinit_filters);
|
||||
|
||||
return 0;
|
||||
return ds->sch_idx_dec;
|
||||
}
|
||||
|
||||
static int choose_decoder(const OptionsContext *o, void *logctx,
|
||||
AVFormatContext *s, AVStream *st,
|
||||
static int choose_decoder(const OptionsContext *o, AVFormatContext *s, AVStream *st,
|
||||
enum HWAccelID hwaccel_id, enum AVHWDeviceType hwaccel_device_type,
|
||||
const AVCodec **pcodec)
|
||||
|
||||
{
|
||||
const char *codec_name = NULL;
|
||||
char *codec_name = NULL;
|
||||
|
||||
opt_match_per_stream_str(logctx, &o->codec_names, s, st, &codec_name);
|
||||
MATCH_PER_STREAM_OPT(codec_names, str, codec_name, s, st);
|
||||
if (codec_name) {
|
||||
int ret = find_codec(NULL, codec_name, st->codecpar->codec_type, 0, pcodec);
|
||||
if (ret < 0)
|
||||
|
|
@ -1148,7 +1102,7 @@ static int choose_decoder(const OptionsContext *o, void *logctx,
|
|||
|
||||
for (int j = 0; config = avcodec_get_hw_config(c, j); j++) {
|
||||
if (config->device_type == hwaccel_device_type) {
|
||||
av_log(logctx, AV_LOG_VERBOSE, "Selecting decoder '%s' because of requested hwaccel method %s\n",
|
||||
av_log(NULL, AV_LOG_VERBOSE, "Selecting decoder '%s' because of requested hwaccel method %s\n",
|
||||
c->name, av_hwdevice_get_type_name(hwaccel_device_type));
|
||||
*pcodec = c;
|
||||
return 0;
|
||||
|
|
@ -1189,9 +1143,9 @@ static int add_display_matrix_to_stream(const OptionsContext *o,
|
|||
int hflip_set = 0, vflip_set = 0, rotation_set = 0;
|
||||
int32_t *buf;
|
||||
|
||||
opt_match_per_stream_dbl(ist, &o->display_rotations, ctx, st, &rotation);
|
||||
opt_match_per_stream_int(ist, &o->display_hflips, ctx, st, &hflip);
|
||||
opt_match_per_stream_int(ist, &o->display_vflips, ctx, st, &vflip);
|
||||
MATCH_PER_STREAM_OPT(display_rotations, dbl, rotation, ctx, st);
|
||||
MATCH_PER_STREAM_OPT(display_hflips, i, hflip, ctx, st);
|
||||
MATCH_PER_STREAM_OPT(display_vflips, i, vflip, ctx, st);
|
||||
|
||||
rotation_set = rotation != DBL_MAX;
|
||||
hflip_set = hflip != -1;
|
||||
|
|
@ -1259,20 +1213,19 @@ static DemuxStream *demux_stream_alloc(Demuxer *d, AVStream *st)
|
|||
return ds;
|
||||
}
|
||||
|
||||
static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st, AVDictionary **opts_used)
|
||||
static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st)
|
||||
{
|
||||
AVFormatContext *ic = d->f.ctx;
|
||||
AVCodecParameters *par = st->codecpar;
|
||||
DemuxStream *ds;
|
||||
InputStream *ist;
|
||||
const char *framerate = NULL, *hwaccel_device = NULL;
|
||||
char *framerate = NULL, *hwaccel_device = NULL;
|
||||
const char *hwaccel = NULL;
|
||||
const char *apply_cropping = NULL;
|
||||
const char *hwaccel_output_format = NULL;
|
||||
const char *codec_tag = NULL;
|
||||
const char *bsfs = NULL;
|
||||
char *hwaccel_output_format = NULL;
|
||||
char *codec_tag = NULL;
|
||||
char *bsfs = NULL;
|
||||
char *next;
|
||||
const char *discard_str = NULL;
|
||||
char *discard_str = NULL;
|
||||
int ret;
|
||||
|
||||
ds = demux_stream_alloc(d, st);
|
||||
|
|
@ -1289,39 +1242,12 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st, AVDictiona
|
|||
ds->dec_opts.time_base = st->time_base;
|
||||
|
||||
ds->ts_scale = 1.0;
|
||||
opt_match_per_stream_dbl(ist, &o->ts_scale, ic, st, &ds->ts_scale);
|
||||
MATCH_PER_STREAM_OPT(ts_scale, dbl, ds->ts_scale, ic, st);
|
||||
|
||||
ds->autorotate = 1;
|
||||
opt_match_per_stream_int(ist, &o->autorotate, ic, st, &ds->autorotate);
|
||||
ist->autorotate = 1;
|
||||
MATCH_PER_STREAM_OPT(autorotate, i, ist->autorotate, ic, st);
|
||||
|
||||
ds->apply_cropping = CROP_ALL;
|
||||
opt_match_per_stream_str(ist, &o->apply_cropping, ic, st, &apply_cropping);
|
||||
if (apply_cropping) {
|
||||
const AVOption opts[] = {
|
||||
{ "apply_cropping", NULL, 0, AV_OPT_TYPE_INT,
|
||||
{ .i64 = CROP_ALL }, CROP_DISABLED, CROP_CONTAINER, AV_OPT_FLAG_DECODING_PARAM, .unit = "apply_cropping" },
|
||||
{ "none", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CROP_DISABLED }, .unit = "apply_cropping" },
|
||||
{ "all", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CROP_ALL }, .unit = "apply_cropping" },
|
||||
{ "codec", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CROP_CODEC }, .unit = "apply_cropping" },
|
||||
{ "container", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CROP_CONTAINER }, .unit = "apply_cropping" },
|
||||
{ NULL },
|
||||
};
|
||||
const AVClass class = {
|
||||
.class_name = "apply_cropping",
|
||||
.item_name = av_default_item_name,
|
||||
.option = opts,
|
||||
.version = LIBAVUTIL_VERSION_INT,
|
||||
};
|
||||
const AVClass *pclass = &class;
|
||||
|
||||
ret = av_opt_eval_int(&pclass, opts, apply_cropping, &ds->apply_cropping);
|
||||
if (ret < 0) {
|
||||
av_log(ist, AV_LOG_ERROR, "Invalid apply_cropping value '%s'.\n", apply_cropping);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
opt_match_per_stream_str(ist, &o->codec_tags, ic, st, &codec_tag);
|
||||
MATCH_PER_STREAM_OPT(codec_tags, str, codec_tag, ic, st);
|
||||
if (codec_tag) {
|
||||
uint32_t tag = strtol(codec_tag, &next, 0);
|
||||
if (*next) {
|
||||
|
|
@ -1338,9 +1264,10 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st, AVDictiona
|
|||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
opt_match_per_stream_str(ist, &o->hwaccels, ic, st, &hwaccel);
|
||||
opt_match_per_stream_str(ist, &o->hwaccel_output_formats, ic, st,
|
||||
&hwaccel_output_format);
|
||||
MATCH_PER_STREAM_OPT(hwaccels, str, hwaccel, ic, st);
|
||||
MATCH_PER_STREAM_OPT(hwaccel_output_formats, str,
|
||||
hwaccel_output_format, ic, st);
|
||||
|
||||
if (!hwaccel_output_format && hwaccel && !strcmp(hwaccel, "cuvid")) {
|
||||
av_log(ist, AV_LOG_WARNING,
|
||||
"WARNING: defaulting hwaccel_output_format to cuda for compatibility "
|
||||
|
|
@ -1398,7 +1325,7 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st, AVDictiona
|
|||
}
|
||||
}
|
||||
|
||||
opt_match_per_stream_str(ist, &o->hwaccel_devices, ic, st, &hwaccel_device);
|
||||
MATCH_PER_STREAM_OPT(hwaccel_devices, str, hwaccel_device, ic, st);
|
||||
if (hwaccel_device) {
|
||||
ds->dec_opts.hwaccel_device = av_strdup(hwaccel_device);
|
||||
if (!ds->dec_opts.hwaccel_device)
|
||||
|
|
@ -1406,31 +1333,18 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st, AVDictiona
|
|||
}
|
||||
}
|
||||
|
||||
ret = choose_decoder(o, ist, ic, st, ds->dec_opts.hwaccel_id,
|
||||
ret = choose_decoder(o, ic, st, ds->dec_opts.hwaccel_id,
|
||||
ds->dec_opts.hwaccel_device_type, &ist->dec);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (ist->dec) {
|
||||
ret = filter_codec_opts(o->g->codec_opts, ist->st->codecpar->codec_id,
|
||||
ic, st, ist->dec, &ds->decoder_opts, opts_used);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
ret = filter_codec_opts(o->g->codec_opts, ist->st->codecpar->codec_id,
|
||||
ic, st, ist->dec, &ds->decoder_opts);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ds->reinit_filters = -1;
|
||||
opt_match_per_stream_int(ist, &o->reinit_filters, ic, st, &ds->reinit_filters);
|
||||
|
||||
ds->drop_changed = 0;
|
||||
opt_match_per_stream_int(ist, &o->drop_changed, ic, st, &ds->drop_changed);
|
||||
|
||||
if (ds->drop_changed && ds->reinit_filters) {
|
||||
if (ds->reinit_filters > 0) {
|
||||
av_log(ist, AV_LOG_ERROR, "drop_changed and reinit_filters both enabled. These are mutually exclusive.\n");
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
ds->reinit_filters = 0;
|
||||
}
|
||||
MATCH_PER_STREAM_OPT(reinit_filters, i, ds->reinit_filters, ic, st);
|
||||
|
||||
ist->user_set_discard = AVDISCARD_NONE;
|
||||
|
||||
|
|
@ -1440,7 +1354,7 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st, AVDictiona
|
|||
(o->data_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_DATA))
|
||||
ist->user_set_discard = AVDISCARD_ALL;
|
||||
|
||||
opt_match_per_stream_str(ist, &o->discard, ic, st, &discard_str);
|
||||
MATCH_PER_STREAM_OPT(discard, str, discard_str, ic, st);
|
||||
if (discard_str) {
|
||||
ret = av_opt_set(ist->st, "discard", discard_str, 0);
|
||||
if (ret < 0) {
|
||||
|
|
@ -1450,10 +1364,8 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st, AVDictiona
|
|||
ist->user_set_discard = ist->st->discard;
|
||||
}
|
||||
|
||||
ds->dec_opts.flags |= DECODER_FLAG_BITEXACT * !!o->bitexact;
|
||||
|
||||
av_dict_set_int(&ds->decoder_opts, "apply_cropping",
|
||||
ds->apply_cropping && ds->apply_cropping != CROP_CONTAINER, 0);
|
||||
if (o->bitexact)
|
||||
av_dict_set(&ds->decoder_opts, "flags", "+bitexact", AV_DICT_MULTIKEY);
|
||||
|
||||
/* Attached pics are sparse, therefore we would not want to delay their decoding
|
||||
* till EOF. */
|
||||
|
|
@ -1462,7 +1374,7 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st, AVDictiona
|
|||
|
||||
switch (par->codec_type) {
|
||||
case AVMEDIA_TYPE_VIDEO:
|
||||
opt_match_per_stream_str(ist, &o->frame_rates, ic, st, &framerate);
|
||||
MATCH_PER_STREAM_OPT(frame_rates, str, framerate, ic, st);
|
||||
if (framerate) {
|
||||
ret = av_parse_video_rate(&ist->framerate, framerate);
|
||||
if (ret < 0) {
|
||||
|
|
@ -1474,44 +1386,21 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st, AVDictiona
|
|||
|
||||
#if FFMPEG_OPT_TOP
|
||||
ist->top_field_first = -1;
|
||||
opt_match_per_stream_int(ist, &o->top_field_first, ic, st, &ist->top_field_first);
|
||||
MATCH_PER_STREAM_OPT(top_field_first, i, ist->top_field_first, ic, st);
|
||||
#endif
|
||||
|
||||
break;
|
||||
case AVMEDIA_TYPE_AUDIO: {
|
||||
const char *ch_layout_str = NULL;
|
||||
|
||||
opt_match_per_stream_str(ist, &o->audio_ch_layouts, ic, st, &ch_layout_str);
|
||||
if (ch_layout_str) {
|
||||
AVChannelLayout ch_layout;
|
||||
ret = av_channel_layout_from_string(&ch_layout, ch_layout_str);
|
||||
if (ret < 0) {
|
||||
av_log(ist, AV_LOG_ERROR, "Error parsing channel layout %s.\n", ch_layout_str);
|
||||
return ret;
|
||||
}
|
||||
if (par->ch_layout.nb_channels <= 0 || par->ch_layout.nb_channels == ch_layout.nb_channels) {
|
||||
av_channel_layout_uninit(&par->ch_layout);
|
||||
par->ch_layout = ch_layout;
|
||||
} else {
|
||||
av_log(ist, AV_LOG_ERROR,
|
||||
"Specified channel layout '%s' has %d channels, but input has %d channels.\n",
|
||||
ch_layout_str, ch_layout.nb_channels, par->ch_layout.nb_channels);
|
||||
av_channel_layout_uninit(&ch_layout);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
} else {
|
||||
int guess_layout_max = INT_MAX;
|
||||
opt_match_per_stream_int(ist, &o->guess_layout_max, ic, st, &guess_layout_max);
|
||||
guess_input_channel_layout(ist, par, guess_layout_max);
|
||||
}
|
||||
int guess_layout_max = INT_MAX;
|
||||
MATCH_PER_STREAM_OPT(guess_layout_max, i, guess_layout_max, ic, st);
|
||||
guess_input_channel_layout(ist, par, guess_layout_max);
|
||||
break;
|
||||
}
|
||||
case AVMEDIA_TYPE_DATA:
|
||||
case AVMEDIA_TYPE_SUBTITLE: {
|
||||
const char *canvas_size = NULL;
|
||||
|
||||
opt_match_per_stream_int(ist, &o->fix_sub_duration, ic, st, &ist->fix_sub_duration);
|
||||
opt_match_per_stream_str(ist, &o->canvas_sizes, ic, st, &canvas_size);
|
||||
char *canvas_size = NULL;
|
||||
MATCH_PER_STREAM_OPT(fix_sub_duration, i, ist->fix_sub_duration, ic, st);
|
||||
MATCH_PER_STREAM_OPT(canvas_sizes, str, canvas_size, ic, st);
|
||||
if (canvas_size) {
|
||||
ret = av_parse_video_size(&par->width, &par->height,
|
||||
canvas_size);
|
||||
|
|
@ -1541,7 +1430,7 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st, AVDictiona
|
|||
if (ist->st->sample_aspect_ratio.num)
|
||||
ist->par->sample_aspect_ratio = ist->st->sample_aspect_ratio;
|
||||
|
||||
opt_match_per_stream_str(ist, &o->bitstream_filters, ic, st, &bsfs);
|
||||
MATCH_PER_STREAM_OPT(bitstream_filters, str, bsfs, ic, st);
|
||||
if (bsfs) {
|
||||
ret = av_bsf_list_parse_str(bsfs, &ds->bsf);
|
||||
if (ret < 0) {
|
||||
|
|
@ -1646,9 +1535,10 @@ int ifile_open(const OptionsContext *o, const char *filename, Scheduler *sch)
|
|||
InputFile *f;
|
||||
AVFormatContext *ic;
|
||||
const AVInputFormat *file_iformat = NULL;
|
||||
int err, ret = 0;
|
||||
int err, i, ret = 0;
|
||||
int64_t timestamp;
|
||||
AVDictionary *opts_used = NULL;
|
||||
AVDictionary *unused_opts = NULL;
|
||||
const AVDictionaryEntry *e = NULL;
|
||||
const char* video_codec_name = NULL;
|
||||
const char* audio_codec_name = NULL;
|
||||
const char* subtitle_codec_name = NULL;
|
||||
|
|
@ -1781,9 +1671,8 @@ int ifile_open(const OptionsContext *o, const char *filename, Scheduler *sch)
|
|||
/* open the input file with generic avformat function */
|
||||
err = avformat_open_input(&ic, filename, file_iformat, &o->g->format_opts);
|
||||
if (err < 0) {
|
||||
if (err != AVERROR_EXIT)
|
||||
av_log(d, AV_LOG_ERROR,
|
||||
"Error opening input: %s\n", av_err2str(err));
|
||||
av_log(d, AV_LOG_ERROR,
|
||||
"Error opening input: %s\n", av_err2str(err));
|
||||
if (err == AVERROR_PROTOCOL_NOT_FOUND)
|
||||
av_log(d, AV_LOG_ERROR, "Did you mean file:%s?\n", filename);
|
||||
return err;
|
||||
|
|
@ -1802,9 +1691,9 @@ int ifile_open(const OptionsContext *o, const char *filename, Scheduler *sch)
|
|||
return ret;
|
||||
|
||||
/* apply forced codec ids */
|
||||
for (int i = 0; i < ic->nb_streams; i++) {
|
||||
for (i = 0; i < ic->nb_streams; i++) {
|
||||
const AVCodec *dummy;
|
||||
ret = choose_decoder(o, f, ic, ic->streams[i], HWACCEL_NONE, AV_HWDEVICE_TYPE_NONE,
|
||||
ret = choose_decoder(o, ic, ic->streams[i], HWACCEL_NONE, AV_HWDEVICE_TYPE_NONE,
|
||||
&dummy);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
|
@ -1822,7 +1711,7 @@ int ifile_open(const OptionsContext *o, const char *filename, Scheduler *sch)
|
|||
first frames to get it. (used in mpeg case for example) */
|
||||
ret = avformat_find_stream_info(ic, opts);
|
||||
|
||||
for (int i = 0; i < orig_nb_streams; i++)
|
||||
for (i = 0; i < orig_nb_streams; i++)
|
||||
av_dict_free(&opts[i]);
|
||||
av_freep(&opts);
|
||||
|
||||
|
|
@ -1863,7 +1752,7 @@ int ifile_open(const OptionsContext *o, const char *filename, Scheduler *sch)
|
|||
|
||||
if (!(ic->iformat->flags & AVFMT_SEEK_TO_PTS)) {
|
||||
int dts_heuristic = 0;
|
||||
for (int i = 0; i < ic->nb_streams; i++) {
|
||||
for (i=0; i<ic->nb_streams; i++) {
|
||||
const AVCodecParameters *par = ic->streams[i]->codecpar;
|
||||
if (par->video_delay) {
|
||||
dts_heuristic = 1;
|
||||
|
|
@ -1914,44 +1803,60 @@ int ifile_open(const OptionsContext *o, const char *filename, Scheduler *sch)
|
|||
d->readrate_initial_burst);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
d->readrate_catchup = o->readrate_catchup ? o->readrate_catchup : d->readrate * 1.05;
|
||||
if (d->readrate_catchup < d->readrate) {
|
||||
av_log(d, AV_LOG_ERROR,
|
||||
"Option -readrate_catchup is %0.3f; it must be at least equal to %0.3f.\n",
|
||||
d->readrate_catchup, d->readrate);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
} else {
|
||||
if (o->readrate_initial_burst) {
|
||||
av_log(d, AV_LOG_WARNING, "Option -readrate_initial_burst ignored "
|
||||
"since neither -readrate nor -re were given\n");
|
||||
}
|
||||
if (o->readrate_catchup) {
|
||||
av_log(d, AV_LOG_WARNING, "Option -readrate_catchup ignored "
|
||||
"since neither -readrate nor -re were given\n");
|
||||
}
|
||||
} else if (o->readrate_initial_burst) {
|
||||
av_log(d, AV_LOG_WARNING, "Option -readrate_initial_burst ignored "
|
||||
"since neither -readrate nor -re were given\n");
|
||||
}
|
||||
|
||||
/* Add all the streams from the given input file to the demuxer */
|
||||
for (int i = 0; i < ic->nb_streams; i++) {
|
||||
ret = ist_add(o, d, ic->streams[i], &opts_used);
|
||||
if (ret < 0) {
|
||||
av_dict_free(&opts_used);
|
||||
ret = ist_add(o, d, ic->streams[i]);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
/* dump the file content */
|
||||
av_dump_format(ic, f->index, filename, 0);
|
||||
|
||||
/* check if all codec options have been used */
|
||||
ret = check_avoptions_used(o->g->codec_opts, opts_used, d, 1);
|
||||
av_dict_free(&opts_used);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
unused_opts = strip_specifiers(o->g->codec_opts);
|
||||
for (i = 0; i < f->nb_streams; i++) {
|
||||
DemuxStream *ds = ds_from_ist(f->streams[i]);
|
||||
e = NULL;
|
||||
while ((e = av_dict_iterate(ds->decoder_opts, e)))
|
||||
av_dict_set(&unused_opts, e->key, NULL, 0);
|
||||
}
|
||||
|
||||
for (int i = 0; i < o->dump_attachment.nb_opt; i++) {
|
||||
for (int j = 0; j < f->nb_streams; j++) {
|
||||
e = NULL;
|
||||
while ((e = av_dict_iterate(unused_opts, e))) {
|
||||
const AVClass *class = avcodec_get_class();
|
||||
const AVOption *option = av_opt_find(&class, e->key, NULL, 0,
|
||||
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ);
|
||||
const AVClass *fclass = avformat_get_class();
|
||||
const AVOption *foption = av_opt_find(&fclass, e->key, NULL, 0,
|
||||
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ);
|
||||
if (!option || foption)
|
||||
continue;
|
||||
|
||||
|
||||
if (!(option->flags & AV_OPT_FLAG_DECODING_PARAM)) {
|
||||
av_log(d, AV_LOG_ERROR, "Codec AVOption %s (%s) is not a decoding "
|
||||
"option.\n", e->key, option->help ? option->help : "");
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
av_log(d, AV_LOG_WARNING, "Codec AVOption %s (%s) has not been used "
|
||||
"for any stream. The most likely reason is either wrong type "
|
||||
"(e.g. a video option with no video streams) or that it is a "
|
||||
"private option of some decoder which was not actually used "
|
||||
"for any stream.\n", e->key, option->help ? option->help : "");
|
||||
}
|
||||
av_dict_free(&unused_opts);
|
||||
|
||||
for (i = 0; i < o->dump_attachment.nb_opt; i++) {
|
||||
int j;
|
||||
|
||||
for (j = 0; j < f->nb_streams; j++) {
|
||||
InputStream *ist = f->streams[j];
|
||||
|
||||
if (check_stream_specifier(ic, ist->st, o->dump_attachment.opt[i].specifier) == 1) {
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue