Compare commits

..

50 Commits

Author SHA1 Message Date
Michael Niedermayer
083443d67c RELEASE_NOTES: Based on the version from 5.1
Name suggested by 7 people on ML

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-05 00:31:10 +02:00
Michael Niedermayer
4f0e9457d6 Update for 7.0
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-05 00:26:26 +02:00
Leo Izen
9a4c7b937f avcodec, avformat/ffjni: fix duplicate JNI symbols
Use SHLIBOBJS and STLIBOBJS in the Makefiles for avcodec and avformat,
and add a stub ffjni.c to libavformat, which allows the symbols to be
duplicated for shared builds but not static builds.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
2024-04-04 21:54:22 +02:00
Michael Niedermayer
abaa747ee5 avformat/pcm: Use 64bit in bitrate computation
Fixes: signed integer overflow: 65792 * 65312 cannot be represented in type 'int'
Fixes: 67819/clusterfuzz-testcase-minimized-ffmpeg_dem_WADY_fuzzer-5236100912185344

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit bf3b74142e)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-04 21:12:16 +02:00
Michael Niedermayer
3736130e5b avformat/mxfdec: Check index_edit_rate
Fixes: Assertion b >=0 failed at libavutil/mathematics.c:62
Fixes: 67811/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-5108429687422976

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ed49391961)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-04 21:12:16 +02:00
Michael Niedermayer
e0dd533ad6 swscale/utils: Fix xInc overflow
Fixes: signed integer overflow: 2 * 1073741824 cannot be represented in type 'int'
Fixes: 67802/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-6249515855183872

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 1a9eda65d0)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-04 21:12:16 +02:00
Michael Niedermayer
97751fda3e avformat/iamf_parse: Check sound_system
Fixes: index 13 out of bounds for type 'const struct IAMFSoundSystemMap [13]'
Fixes: 67796/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-4554553191104512

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4593cf7ab3)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-04 21:12:15 +02:00
Michael Niedermayer
1ef084f910 avcodec/wavarc: fix signed integer overflow in block type 6/19
Fixes: signed integer overflow: -2088796289 + -91276551 cannot be represented in type 'int'
Fixes: 67772/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WAVARC_fuzzer-6533568953122816

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 28c7094b25)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-04 21:12:15 +02:00
Michael Niedermayer
839e8baa20 doc/developer: (security) researchers should be credited
Reviewed-by: Tomas Härdin <git@haerdin.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 5a5422196d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-04 21:12:15 +02:00
Michael Niedermayer
d918d9afe0 avformat/isom: Uninit layout in ff_mp4_read_dec_config_descr()
Fixes: memleak
Fixes: 67442/clusterfuzz-testcase-minimized-ffmpeg_dem_CAF_fuzzer-5068813261406208

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit d157725cf7)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-04 21:12:14 +02:00
Marth64
4866aaf7c5 Changelog: fix typos for 7.0 section
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit e3335e9e9e)
2024-04-04 12:44:32 -03:00
Jean-Baptiste Kempf
3b6732bcb3 changelog: update for 7.0
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 486a2b964b)
2024-04-04 10:58:09 -03:00
Andreas Rheinhardt
aeff85620a configure: Fix iamfdec dependencies
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
(cherry picked from commit 9c4558b596)
2024-04-03 23:19:39 +02:00
Andreas Rheinhardt
fd8fb39af9 configure: Add missing libdav1d/av1 decoders->dovi_rpu dependency
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
(cherry picked from commit 924402f783)
2024-04-03 20:13:10 +02:00
Niklas Haas
5cd6683ddc avfilter: properly reduce YUV colorspace format lists
Doing this with REDUCE_FORMATS() instead of swap_color_*() is not only
shorter, but more importantly comes with the benefit of being done
inside a loop, allowing us to correctly propagate complex graphs
involving multiple conversion filters (e.g. -vf scale,zscale).

The latter family of swapping functions is only used to settle the
best *remaining* entry if no exact match was found, and as such was
never the correct solution to YUV colorspaces, which only care about
exact matches.

(cherry picked from commit b89ee26539)
2024-04-03 15:51:31 +02:00
Michael Niedermayer
87e5bc918a avcodec/exr: Dont use 64bits to hold 6bits
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit e3984de6ff)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-03 14:42:13 +02:00
Michael Niedermayer
8146cab801 avcodec/exr: Check for remaining bits in huf_unpack_enc_table()
Fixes: Timeout
Fixes: 67645/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-6308760977997824

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 589fa8a027)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-03 14:42:12 +02:00
Michael Niedermayer
5469ba6d74 avcodec/apedec: Use NABS to avoid undefined negation
Fixes: negation of -2147483648 cannot be represented in type 'int32_t' (aka 'int'); cast to an unsigned type to negate this value to itself
Fixes: 67738/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5444313212321792

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 1887ff250c)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-03 14:42:12 +02:00
Michael Niedermayer
e37d66a72e avcodec/vvc/vvcdec: Do not submit frames without VVCFrameThread
Such frames will crash when pthread functions are called on the NULL pointer

Fixes: member access within null pointer of type 'VVCFrameThread' (aka 'struct VVCFrameThread')
Fixes: 65160/clusterfuzz-testcase-minimized-ffmpeg_BSF_VVC_METADATA_fuzzer-4665241535119360 (partly)
Fixes: 65636/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VVC_fuzzer-5394745824182272

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 84ce5ced31)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-03 14:42:11 +02:00
Michael Niedermayer
cbbe688434 avformat/mpegts: Reset local nb_prg on add_program() failure
add_program() will deallocate the whole array on failure so
we must clear nb_prgs

Fixes: null pointer dereference
Fixes: crash-35a3b39ddcc5babeeb005b7399a3a1217c8781bc

Found-by: Catena cyber
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit cb9752d897)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-03 14:42:11 +02:00
Michael Niedermayer
8194f34b5d avformat/aiffdec: Check for previously set channels
Fixes: out of array access (av_channel_layout_copy())
Fixes: 67087/clusterfuzz-testcase-minimized-ffmpeg_dem_AIFF_fuzzer-4920720268263424

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 23b29f72ee)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-03 14:42:11 +02:00
Michael Niedermayer
54a7f22ee8 avformat/mxfdec: Make edit_unit_byte_count unsigned
Suggested-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f30fe5e8d0)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-03 14:42:11 +02:00
Michael Niedermayer
003e006ccb avformat/movenc: Check that cts fits in 32bit
Fixes: Assertion av_rescale_rnd(start_dts, mov->movie_timescale, track->timescale, AV_ROUND_DOWN) <= 0 failed at libavformat/movenc.c:3694
Fixes: poc2

Found-by: Wang Dawei and Zhou Geng, from Zhongguancun Laboratory
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d88c284c18)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-03 14:42:10 +02:00
Michael Niedermayer
d4bb784274 avformat/iamf_reader: Check len before summing
Fixes: integer overflow
Fixes: 67275/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-5438920751906816
Fixes: 67688/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-5970342318243840

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f26ee6e066)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-03 14:42:10 +02:00
Michael Niedermayer
1a9da17c5a avformat/mxfdec: Check first case of offset_temp computation for overflow
This is kind of ugly
Fixes: signed integer overflow: 255 * 1157565362826411919 cannot be represented in type 'long'
Fixes: 67313/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-6250434245230592

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d6ed6f6e8d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-03 14:42:10 +02:00
Michael Niedermayer
7e899776ec avcodec/jpeg2000htdec: warn about non zero roi shift
Suggested-by: Tomas Härdin <git@haerdin.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7b7eea8e63)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-03 14:42:09 +02:00
Michael Niedermayer
cc9d291fb0 avcodec/jpeg2000htdec: Check magp before using it in a shift
Fixes: shift exponent -1 is negative
Fixes: 65378/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-5457678193197056

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 19ad05e9e0)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-03 14:42:09 +02:00
Michael Niedermayer
7570390be6 avfilter/vf_signature: Dont crash on no frames
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3d5f03bbc8)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-03 14:42:09 +02:00
Haihao Xiang
74e4e900bb lavc/vaapi_encode: convert from lambda to qp
When AV_CODEC_FLAG_QSCALE is set, the value of avctx->global_quality is
lambda.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
(cherry picked from commit 1590a96adc)
2024-04-03 10:35:26 +08:00
Fei Wang
2d18c4906f lavc/vaapi_encode: Add VAAPI version check for BLBRC
Fix build fail when VAAPI version less than 0.39.2.

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
(cherry picked from commit 09377887df)
2024-04-03 10:32:59 +08:00
James Almer
4bb04c52fb fate/vvc: disable vvc-conformance-OPI_B_3 and vvc-conformance-VPS_A_3
Both samples rely on a feature our decoder doesn't currently support.

Should fix fate failures on some systems where not even the one single frame
could be generated.

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit e9778d20a4)
2024-04-02 11:56:14 -03:00
James Almer
112fdae9f9 avcodec/vvc_refs: don't ask for a "Inter layer ref" sample
The FATE suite has two already.

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 45b56455ad)
2024-04-02 11:56:14 -03:00
Andreas Rheinhardt
dcbc1fdb3b avcodec/vlc, bitstream: Fix multi VLC with uint8_t syms on BE
VLC_MULTI_ELEM contains an uint8_t array that is supposed
to be treated as an array of uint16_t when the used symbols
have a size of two; otherwise it should be treated as just
an array of uint8_t, but it was not always treated that way:

vlc_multi_gen() initialized the first entry of the array
by writing the symbol via AV_WN16; on big endian systems,
the intended value was instead written into the second entry
of the array (where it would likely be overwritten lateron
during initialization).

read_vlc_multi() also treated this case incorrectly: In case
the code is so long that it needs a classical multi-stage lookup,
the symbol has been written to the destination as if via AV_WN16.
On little endian systems, this sets the correct first symbol and
clobbers (zeroes) the next one, but the next one will be overwritten
lateron anyway, so it won't be recognized. But on big-endian systems,
the first symbol will be set to zero and the actually read symbol
will be put into the slot for the next one (where it will be overwritten
lateron).

This commit fixes this; this fixes the magicyuv and utvideo FATE-tests
on big endian arches.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
(cherry picked from commit 4ab82d2fb6)
2024-04-02 14:32:00 +02:00
Andreas Rheinhardt
efa0670048 avformat/mov: Don't add attached pic if one is already present
Fixes: memleak
Fixes: 67714/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5671570999476224

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
(cherry picked from commit 9d219ff149)
2024-04-02 14:31:43 +02:00
Eugene Zemtsov
d0e5f83ffb avformat/mov: Check if a key is longer than the atom containing it
Stop reading keys and return AVERROR_INVALIDDATA if key_size
is larger than the amount of space left in the atom.

Bug: https://crbug.com/41496983
Signed-off-by: Eugene Zemtsov <eugene@chromium.org>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 8a23a145d8)
2024-04-02 00:14:25 -03:00
James Almer
2ecaef7455 avformat/mov: ensure all items id referenced by a grid are valid
Fixes: null pointer dereference
Fixes: 67494/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-6528714521247744

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Tested-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-01 21:15:21 -03:00
Anton Khirnov
8709604ca1 lavfi/setpts: unset frame durations
Actual frame durations are, in general, not computable without buffering
a frame.

FIxes #10886

(cherry picked from commit fa110c32b5)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-04-01 15:26:44 +02:00
Anton Khirnov
43fd3d5df6 lavf/vf_setpts: unset output framerate
This filter produces VFR output in general.

Avoids dropping frames in the setpts test.

(cherry picked from commit f121d954ac)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-04-01 15:26:40 +02:00
Timo Rothenpieler
4c5a809388 avcodec/nvenc: support SDK 12.2 bit depth API 2024-04-01 01:00:47 +02:00
Timo Rothenpieler
5ff5a431c7 avcodec/nvenc: stop using long deprecated format specifiers 2024-04-01 01:00:41 +02:00
Marton Balint
7ed9ad3467 avfilter/buffersrc: fix overriding unknown channel layouts with negotiated one
Fixes ffplay playback of unknown layouts, when SDL directly supports the audio
format, such as:

ffplay -f lavfi anullsrc=cl=2C,aformat=s16

Without the patch, "Channel layout change is not supported" errors are
generated because buffersrc (unknown 2 channel) and buffersink (stereo)
negotiated a stereo layout, but the stereo layout was never stored in the
BufferSourceContext.

This fixes a regression of 7251f90972, but this
is more of a regression of the avfilter channel layout conversion
(1f96db959c).

Signed-off-by: Marton Balint <cus@passwd.hu>
(cherry picked from commit 2df2b4067e)
2024-03-30 21:23:49 +01:00
James Almer
5a3b625dbc Revert "avformat/mov: ignore item boxes for animated heif"
This reverts commit f6b7b473d4.
The image in the item boxes and the animation in the trak box are not
necessarely the same, so both should be exported.

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit e37b233ee2)
2024-03-30 12:43:03 -03:00
James Almer
799a7200ee avutil/frame: use the same data information as the source entry when cloning side data
src->{data,size} does not need to match src->buf->{data,size}.

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit f8fbec8686)
2024-03-30 10:24:15 -03:00
Timo Rothenpieler
515949a15a avcodec/nvdec: reset bitstream_len/nb_slices when resetting bitstream pointer 2024-03-30 00:16:21 +01:00
Tong Wu
7fa569e34d avcodec/hevc_ps: fix the problem of memcmp losing effectiveness
HEVCHdrParams* receives a pointer which points to a dynamically
allocated memory block. It causes the memcmp always returning 1.
Add a function to do the comparision. A condition is also added to
avoid malloc(0).

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Tong Wu <tong1.wu@intel.com>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 6bf17136a2)
2024-03-29 14:52:48 -03:00
Anton Khirnov
536443919f fftools/ffmpeg_sched: make sure to always run task cleanup
Even in cases where sch_start() failed. This ensures all links are
properly closed and no tasks are left hanging.

Fixes #10916.

(cherry picked from commit 24b9f29ff2)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-03-29 08:58:46 +01:00
Anton Khirnov
da903c558b fftools/ffmpeg_sched: move sch_stop() to the bottom of the file
Will allow avoiding forward declarations in following commits.

(cherry picked from commit af81788f30)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-03-29 08:58:45 +01:00
James Almer
9cfb29baa2 avformat/mov: don't abort on duplicate Mastering Display Metadata boxes
The VP9 spec defines a SmDm box for this information, and the ISOBMFF spec defines a
mdvc one. If both are present, just ignore one of them.
This is in line with clli and CoLL boxes.

Fixes ticket #10711.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-27 13:52:50 -03:00
Zhao Zhili
304208d40c avcodec/h264_mp4toannexb: Fix heap buffer overflow
Fixes: out of array write
Fixes: 64407/clusterfuzz-testcase-minimized-ffmpeg_BSF_H264_MP4TOANNEXB_fuzzer-4966763443650560

mp4toannexb_filter counts the number of bytes needed in the first
pass and allocate the memory, then do memcpy in the second pass.
Update sps/pps size in the loop makes the count invalid in the
case of SPS/PPS occur after IDR slice. This patch process in-band
SPS/PPS before the two pass loops.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
(cherry picked from commit 89e9486bc3)
2024-03-27 20:11:57 +08:00
Zhao Zhili
6ceda54629 tests: Remove fate-libx265-hdr10
The test depends on the compile option of x265. It failed when
HIGH_BIT_DEPTH isn't enabled. It also failed when asan is enabled
because of memory issue inside of x265, which I don't think can
be fixed within FFmpeg.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
(cherry picked from commit edb1f1bc09)
2024-03-27 20:11:46 +08:00
4683 changed files with 102842 additions and 220018 deletions

View File

@@ -1,93 +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
libavcodec/.*jxl.* @lynne
libavcodec/.*opus.* @lynne
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
# 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

View File

@@ -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.

View File

@@ -1,36 +0,0 @@
module.exports = async ({github, context}) => {
const title = (context.payload.pull_request?.title || context.payload.issue?.title || '').toLowerCase();
const labels = [];
const kwmap = {
'avcodec': 'avcodec',
'avdevice': 'avdevice',
'avfilter': 'avfilter',
'avformat': 'avformat',
'avutil': 'avutil',
'swresample': 'swresample',
'swscale': 'swscale',
'fftools': 'CLI'
};
if (context.payload.action === 'opened') {
labels.push('new');
console.log('Detected label: new');
}
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: context.payload.pull_request?.number || context.payload.issue?.number,
labels: labels,
});
}
}

View File

@@ -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/**

View File

@@ -1,36 +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: local
hooks:
- id: aarch64-asm-indent
name: fix aarch64 assembly indentation
files: ^.*/aarch64/.*\.S$
language: script
entry: ./tools/check_arm_indent.sh --apply
pass_filenames: false
- 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)$

View File

@@ -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

View File

@@ -1,28 +0,0 @@
name: Autolabel
on:
pull_request_target:
types: [opened, edited, synchronize]
issues:
types: [opened, edited]
jobs:
pr_labeler:
name: Labeler
runs-on: utilities
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 }}

View File

@@ -1,29 +0,0 @@
name: Lint
on:
push:
branches:
- release/8.0
pull_request:
jobs:
lint:
name: Pre-Commit
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

View File

@@ -1,80 +0,0 @@
name: Test
on:
push:
branches:
- release/8.0
pull_request:
jobs:
run_fate:
name: Fate (${{ matrix.runner }}, ${{ matrix.shared }}, ${{ matrix.bits }} bit)
strategy:
fail-fast: false
matrix:
runner: [linux-aarch64]
shared: ['static']
bits: ['64']
include:
- runner: linux-amd64
shared: 'static'
bits: '32'
- runner: linux-amd64
shared: 'shared'
bits: '64'
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 \
$([ "${{ matrix.bits }}" != "32" ] || echo --arch=x86_32 --extra-cflags=-m32 --extra-cxxflags=-m32 --extra-ldflags=-m32) \
$([ "${{ matrix.shared }}" != "shared" ] || echo --enable-shared --disable-static) \
|| CFGRES=$? && CFGRES=$?
cat ffbuild/config.log
exit $CFGRES
- 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 -printf "%P %s %T@\n" | 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: LD_LIBRARY_PATH="$(printf "%s:" "$PWD"/lib*)$PWD" make fate fate-build SAMPLES=$PWD/fate-suite -j$(nproc)
compile_only:
name: Fate (Win64, Build-Only)
strategy:
fail-fast: false
matrix:
image: ["ghcr.io/btbn/ffmpeg-builds/win64-gpl-8.0: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)
- name: Run Fate
run: make -j$(nproc) fate-build

1
.gitattributes vendored
View File

@@ -1,2 +1 @@
*.pnm -diff -text
Changelog merge=union

5
.gitignore vendored
View File

@@ -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/

View File

@@ -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
View 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

View File

@@ -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

156
Changelog
View File

@@ -1,161 +1,6 @@
Entries are sorted chronologically from oldest to youngest within each release,
releases are sorted from youngest to oldest.
version 8.0.1:
avutil/common: cast GET_BYTE/GET_16BIT returned value
avfilter/vf_drawtext: fix call GET_UTF8 with invalid argument
avfilter/vf_drawtext: fix incorrect text length
avfilter/vf_drawtext: Account for bbox text separator
avcodec/mediacodecdec_common: Check that the input to mediacodec_wrap_sw_audio_buffer() contains channel * sample_size
avcodec/rv60dec: Clear blk_info
avformat/whip: Fix rtp_ctx->streams access
avcodec/utvideodec: Set B for the width= 1 case in restore_median_planar_il()
avcodec/osq: Fix 32bit sample overflow
avformat/rtpdec_rfc4175: Only change PayloadContext on success
avformat/rtpdec_rfc4175: Check dimensions
avformat/rtpdec_rfc4175: Fix memleak of sampling
avformat/http: Fix off by 1 error
avcodec/exr: spelling
avcodec/rv60dec: add upper bound check for qp
avcodec/exr: use tile dimensions in pxr24 UINT case
avcodec/exr: Simple check for available channels
avformat/sctp: Check size in sctp_write()
avformat/rtmpproto: consider command line argument lengths
avformat/rtmpproto_ Check tcurl and flashver length
avcodec/g723_1enc: Make min_err 64bit
avcodec/vlc: Clear val8/16 in vlc_multi_gen() by av_mallocz()
avformat/rtpenc_h264_hevc: Check space for nal_length_size in ff_rtp_send_h264_hevc()
avcodec/ffv1enc: Consider variation in slice sizes
libavcodec/cbs_apv_syntax_template: limit tile to 2gb
swscale/output: Fix unsigned cast position in yuv2*
swscale/output: Fix integer overflow in yuv2ya16_X_c_template()
avcodec/exr: Check that DWA has 3 channels
avcodec/exr: check ac_size
avcodec/exr: Round dc_w/h up
avcodec/mjpegdec: Explain buf_size/width/height check
configure: strip non numeric trailer from gcc version
avformat/dhav: Fix off by length of read element error
avformat/aviobuf: Keep checksum_ptr consistent in avio_seek()
doc/examples/vaapi_encode: fix invalid check on fwrite
avcodec/librsvgdec: fix compilation with librsvg 2.50.3
avcodec/mfenc: fix memory leak with D3D11 input surfaces
swscale/graph: fix double-free when legacy pass fails initializing
libavformat/udp: Fix call to recvfrom(2)
avfilter/f_ebur128: Fix incorrect ebur128 peak calculation.
avformat/udp: fix warning about unused variable
avdevice/lavfi: stop setting deprecated buffersink options
configure: unbreak glslang build
swscale/range_convert: fix truncation bias in range conversion
lavc/aarch64: Fix addp overflow in ff_pred16x16_plane_neon_10
avcodec/mlpdec: don't depend on context channel layout when setting substream masks
avformat/demux: pass new extradata to the parser
avfilter/af_whisper: fix srt index
avfilter/af_whisper: fix int64 printf format
avfilter/af_whisper: fix srt file format
avfilter/whisper: correct option formatting
avfilter/af_whisper: fix broken output for multibyte character
avformat/rtsp: fix leading space in RTSP reason
avformat/rtsp: do not log invalid values
avformat/http: Handle IPv6 Zone ID in hostname
avformat/dump: fix log level passed to av_log when printing stream group side data
avcodec/hevc/sei: don't attempt to use stale values in HEVCSEITDRDI
avcodec/hevc/sei: prevent storing a potentially bogus num_ref_displays value in HEVCSEITDRDI
avcodec/hevc/refs: don't unconditionally discard non-IRAP frames if no IRAP frame was seen before
libavutil/arm: Rename the HWCAP defines
libavutil/arm: Make use of elf_aux_info() on FreeBSD/OpenBSD
fftools/ffmpeg: fix gracefully shutdown
avcodec/decode: sync initial_pict_type and intra_only_flag with thread worker's avctx
avcodec/x86/pngdsp: add missing emms at the end of add_png_paeth_prediction
avcodec/videotoolboxenc: ensure bitrate is set in low_delay mode
avcodec/videotoolboxenc: allow low latency RC with HEVC
avcodec/videotoolboxenc: support global_quality without qscale
avcodec/videotoolboxenc: fix the loss of precision when calculating quality
fftools/ffmpeg_demux: ensure the display_rotation option is honored
avcodec/mjpegdec: use ff_frame_new_side_data() to export display matrix
avutil/tests/aes_ctr: extend the test to cover payloads smaller than a block
avutil/aes_ctr: reintroduce the block offset state
avfilter/vf_lcevc: support LCEVCdec version 4
avcodec/lcevcdec: support LCEVCdec version 4
movenc: ensure chapters track extradata is not null and populated
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
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:
- DXV DXT1 encoder
- LEAD MCMP decoder
@@ -242,7 +87,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

View File

@@ -1,7 +0,0 @@
{
"drips": {
"ethereum": {
"ownedBy": "0x2f3900e7064eE63D30d749971265858612AA7139"
}
}
}

View File

@@ -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`.
@@ -18,11 +15,3 @@ NOTICE
------
- Non system dependencies (e.g. libx264, libvpx) are disabled by default.
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
some of these 3rd party packages). This avoids circular dependencies during build.

View File

@@ -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`

View File

@@ -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
project server emergencies Árpád Gereöffy, Reimar Doeffinger, Alexander Strasser, Nikolay Aleksandrov
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
@@ -565,12 +535,10 @@ wm4
Releases
========
7.0 Michael Niedermayer
6.1 Michael Niedermayer
5.1 Michael Niedermayer
4.4 Michael Niedermayer
3.4 Michael Niedermayer
2.8 Michael Niedermayer
2.7 Michael Niedermayer
2.6 Michael Niedermayer
2.5 Michael Niedermayer
If you want to maintain an older release, please contact us
@@ -591,7 +559,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

View File

@@ -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) :=

View File

@@ -1 +1 @@
8.0.1
7.0

View File

@@ -1,10 +1,10 @@
┌────────────────────────────────────────┐
│ RELEASE NOTES for FFmpeg 8.0 "Huffman" │
└────────────────────────────────────────┘
┌────────────────────────────────────────
│ RELEASE NOTES for FFmpeg 7.0 "Dijkstra" │
└────────────────────────────────────────
The FFmpeg Project proudly presents FFmpeg 8.0 "Huffman", about 11
months after the release of FFmpeg 7.1.
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

View 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 */

View File

@@ -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);
}

View 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 */

View 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 */

View File

@@ -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 */

View File

@@ -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";

View File

@@ -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__ */

View File

@@ -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)

View File

@@ -50,7 +50,7 @@ typedef struct pthread_t {
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;
@@ -74,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;
}
@@ -82,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;
@@ -118,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;
}

808
configure vendored

File diff suppressed because it is too large Load Diff

View File

@@ -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.

View File

@@ -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 = 8.0.1
PROJECT_NUMBER = 7.0
# 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.

View File

@@ -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

View File

@@ -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

View File

@@ -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.

View File

@@ -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})

View File

@@ -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.

View File

@@ -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

View File

@@ -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}
@@ -564,13 +567,6 @@ prefer to use #EXT-X-START if it's in playlist instead of live_start_index.
@item allowed_extensions
',' separated list of file extensions that hls is allowed to access.
@item extension_picky
This blocks disallowed extensions from probing
It also requires all available segments to have matching extensions to the format
except mpegts, which is always allowed.
It is recommended to set the whitelists correctly instead of depending on extensions
Enabled by default.
@item max_reload
Maximum number of times a insufficient list is attempted to be reloaded.
Default value is 1000.
@@ -855,32 +851,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 +986,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 +1038,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.

View File

@@ -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
@@ -733,11 +638,6 @@ patch is inline or attached per mail.
You can check @url{https://patchwork.ffmpeg.org}, if your patch does not show up, its mime type
likely was wrong.
@subheading How to setup git send-email?
Please see @url{https://git-send-email.io/}.
For gmail additionally see @url{https://shallowsky.com/blog/tech/email/gmail-app-passwds.html}.
@subheading Sending patches from email clients
Using @code{git send-email} might not be desirable for everyone. The
following trick allows to send patches via email clients in a safe
@@ -782,7 +682,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 +697,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 +817,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
@@ -1022,25 +922,6 @@ In case you need finer control over how valgrind is invoked, use the
@code{--target-exec='valgrind <your_custom_valgrind_options>} option in
your configure line instead.
@anchor{Maintenance}
@chapter Maintenance process
@anchor{MAINTAINERS}
@section MAINTAINERS
The developers maintaining each part of the codebase are listed in @file{MAINTAINERS}.
Being listed in @file{MAINTAINERS}, gives one the right to have git write access to
the specific repository.
@anchor{Becoming a maintainer}
@section Becoming a maintainer
People add themselves to @file{MAINTAINERS} by sending a patch like any other code
change. These get reviewed by the community like any other patch. It is expected
that, if someone has an objection to a new maintainer, she is willing to object
in public with her full name and is willing to take over maintainership for the area.
@anchor{Release process}
@chapter Release process

View File

@@ -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
@@ -3232,6 +3045,9 @@ Enable high quality AC prediction.
@item gray
Only encode grayscale.
@item gmc
Enable the use of global motion compensation (GMC).
@item qpel
Enable quarter-pixel motion compensation.
@@ -3243,9 +3059,7 @@ Place global headers in extradata instead of every keyframe.
@end table
@item gmc
Enable the use of global motion compensation (GMC). Default is 0
(disabled).
@item trellis
@item me_quality
Set motion estimation quality level. Possible values in decreasing order of
@@ -3300,9 +3114,6 @@ be better than any of the two specified individually. In other
words, the resulting quality will be the worse one of the two
effects.
@item trellis
Set rate-distortion optimal quantization.
@item ssim
Set structural similarity (SSIM) displaying method. Possible values:
@@ -3342,75 +3153,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 +3235,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 +3242,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 +3436,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 +3488,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 +3532,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 +3731,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 +3965,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 +4313,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 +4340,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

View File

@@ -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;
}

View File

@@ -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);
}

View File

@@ -37,7 +37,6 @@
#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";
@@ -96,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;
@@ -122,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.
@@ -285,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);

View File

@@ -36,7 +36,6 @@
#include <libavformat/avformat.h>
#include <libavfilter/buffersink.h>
#include <libavfilter/buffersrc.h>
#include <libavutil/mem.h>
#include <libavutil/opt.h>
const char *filter_descr = "scale=78:24,transpose=cclock";
@@ -99,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) {
@@ -121,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.
@@ -282,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);

View File

@@ -138,9 +138,11 @@ static int decode_packet(AVCodecContext *dec, const AVPacket *pkt)
ret = output_audio_frame(frame);
av_frame_unref(frame);
if (ret < 0)
return ret;
}
return ret;
return 0;
}
static int open_codec_context(int *stream_idx,

View File

@@ -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;
}

View File

@@ -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>

View File

@@ -347,7 +347,8 @@ static int write_audio_frame(AVFormatContext *oc, OutputStream *ost)
if (frame) {
/* convert samples from native format to destination codec format, using the resampler */
/* compute destination number of samples */
dst_nb_samples = swr_get_delay(ost->swr_ctx, c->sample_rate) + frame->nb_samples;
dst_nb_samples = av_rescale_rnd(swr_get_delay(ost->swr_ctx, c->sample_rate) + frame->nb_samples,
c->sample_rate, c->sample_rate, AV_ROUND_UP);
av_assert0(dst_nb_samples == frame->nb_samples);
/* when we pass a frame to the encoder, it may keep a reference to it
@@ -418,7 +419,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");

View File

@@ -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);

View File

@@ -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>
@@ -76,7 +75,8 @@ static int str_to_dict(char* optstr, AVDictionary **opt)
if (value == NULL)
return AVERROR(EINVAL);
av_dict_set(opt, key, value, 0);
} while(1);
} while(key != NULL);
return 0;
}
static int dynamic_set_parameter(AVCodecContext *avctx)
@@ -101,7 +101,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 +180,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 +289,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. */
@@ -334,15 +334,17 @@ static int dec_enc(AVPacket *pkt, const AVCodec *enc_codec, char *optstr)
fail:
av_frame_free(&frame);
if (ret < 0)
return ret;
}
return ret;
return 0;
}
int main(int argc, char **argv)
{
const AVCodec *enc_codec;
int ret = 0;
AVPacket *dec_pkt = NULL;
AVPacket *dec_pkt;
if (argc < 5 || (argc - 5) % 2) {
av_log(NULL, AV_LOG_ERROR, "Usage: %s <input file> <encoder> <output file>"

View File

@@ -28,7 +28,6 @@
* input to the output without transcoding.
*/
#include <libavutil/mem.h>
#include <libavutil/timestamp.h>
#include <libavformat/avformat.h>

View File

@@ -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;

View File

@@ -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

View File

@@ -88,10 +88,6 @@ static int encode_write(AVCodecContext *avctx, AVFrame *frame, FILE *fout)
enc_pkt->stream_index = 0;
ret = fwrite(enc_pkt->data, enc_pkt->size, 1, fout);
av_packet_unref(enc_pkt);
if (!ret) {
ret = AVERROR(errno);
break;
}
}
end:

View File

@@ -215,8 +215,10 @@ static int dec_enc(AVPacket *pkt, const AVCodec *enc_codec)
fail:
av_frame_free(&frame);
if (ret < 0)
return ret;
}
return ret;
return 0;
}
int main(int argc, char **argv)

View File

@@ -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

View File

@@ -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

View File

@@ -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.

View File

@@ -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.

View File

@@ -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">

View File

@@ -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

View File

@@ -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
------------

File diff suppressed because it is too large Load Diff

View File

@@ -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.

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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:
~~~~~~~~
@@ -33,8 +23,6 @@ Web, mail, and public facing git, also website git
fftrac VM:
----------
trac.ffmpeg.org Issue tracking
gpg encrypted backups of the trac repositories are created once a day
and can be downloaded by any of the admins.
ffaux VM:
@@ -77,9 +65,6 @@ Github mirrors are redundantly synced by multiple people
You need a new git repository related to FFmpeg ? contact root at ffmpeg.org
git repositories are managed by gitolite, every change to permissions is
logged, including when, what and by whom
Fate:
~~~~~
@@ -102,47 +87,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
View 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)

View File

@@ -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}.

View File

@@ -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

View File

@@ -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().

File diff suppressed because it is too large Load Diff

View File

@@ -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

View File

@@ -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

View File

@@ -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.

View File

@@ -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

View File

@@ -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:

View File

@@ -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

File diff suppressed because one or more lines are too long

View File

@@ -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.

View File

@@ -54,24 +54,12 @@ sub get_formatting_function($$) {
}
# determine texinfo version
my $package_version = ff_get_conf('PACKAGE_VERSION');
$package_version =~ s/\+dev$//;
my $program_version_num = version->declare($package_version)->numify;
my $program_version_num = version->declare(ff_get_conf('PACKAGE_VERSION'))->numify;
my $program_version_6_8 = $program_version_num >= 6.008000;
# no navigation elements
ff_set_from_init_file('HEADERS', 0);
my %sectioning_commands = %Texinfo::Common::sectioning_commands;
if (scalar(keys(%sectioning_commands)) == 0) {
%sectioning_commands = %Texinfo::Commands::sectioning_heading_commands;
}
my %root_commands = %Texinfo::Common::root_commands;
if (scalar(keys(%root_commands)) == 0) {
%root_commands = %Texinfo::Commands::root_commands;
}
sub ffmpeg_heading_command($$$$$)
{
my $self = shift;
@@ -89,9 +77,6 @@ sub ffmpeg_heading_command($$$$$)
return $result;
}
# no need to set it as the $element_id is output unconditionally
my $heading_id;
my $element_id = $self->command_id($command);
$result .= "<a name=\"$element_id\"></a>\n"
if (defined($element_id) and $element_id ne '');
@@ -99,40 +84,24 @@ sub ffmpeg_heading_command($$$$$)
print STDERR "Process $command "
.Texinfo::Structuring::_print_root_command_texi($command)."\n"
if ($self->get_conf('DEBUG'));
my $output_unit;
if ($root_commands{$command->{'cmdname'}}) {
if ($command->{'associated_unit'}) {
$output_unit = $command->{'associated_unit'};
} elsif ($command->{'structure'}
and $command->{'structure'}->{'associated_unit'}) {
$output_unit = $command->{'structure'}->{'associated_unit'};
} elsif ($command->{'parent'}
and $command->{'parent'}->{'type'}
and $command->{'parent'}->{'type'} eq 'element') {
$output_unit = $command->{'parent'};
}
my $element;
if ($Texinfo::Common::root_commands{$command->{'cmdname'}}
and $command->{'parent'}
and $command->{'parent'}->{'type'}
and $command->{'parent'}->{'type'} eq 'element') {
$element = $command->{'parent'};
}
if ($output_unit) {
if ($element) {
$result .= &{get_formatting_function($self, 'format_element_header')}($self, $cmdname,
$command, $output_unit);
$command, $element);
}
my $heading_level;
# node is used as heading if there is nothing else.
if ($cmdname eq 'node') {
if (!$output_unit or
(((!$output_unit->{'extra'}->{'section'}
and $output_unit->{'extra'}->{'node'}
and $output_unit->{'extra'}->{'node'} eq $command)
or
((($output_unit->{'extra'}->{'unit_command'}
and $output_unit->{'extra'}->{'unit_command'} eq $command)
or
($output_unit->{'unit_command'}
and $output_unit->{'unit_command'} eq $command))
and $command->{'extra'}
and not $command->{'extra'}->{'associated_section'}))
if (!$element or (!$element->{'extra'}->{'section'}
and $element->{'extra'}->{'node'}
and $element->{'extra'}->{'node'} eq $command
# bogus node may not have been normalized
and defined($command->{'extra'}->{'normalized'}))) {
if ($command->{'extra'}->{'normalized'} eq 'Top') {
@@ -142,15 +111,7 @@ sub ffmpeg_heading_command($$$$$)
}
}
} else {
if (defined($command->{'extra'})
and defined($command->{'extra'}->{'section_level'})) {
$heading_level = $command->{'extra'}->{'section_level'};
} elsif ($command->{'structure'}
and defined($command->{'structure'}->{'section_level'})) {
$heading_level = $command->{'structure'}->{'section_level'};
} else {
$heading_level = $command->{'level'};
}
$heading_level = $command->{'level'};
}
my $heading = $self->command_text($command);
@@ -158,8 +119,8 @@ sub ffmpeg_heading_command($$$$$)
# if there is an error in the node.
if (defined($heading) and $heading ne '' and defined($heading_level)) {
if ($root_commands{$cmdname}
and $sectioning_commands{$cmdname}) {
if ($Texinfo::Common::root_commands{$cmdname}
and $Texinfo::Common::sectioning_commands{$cmdname}) {
my $content_href = $self->command_contents_href($command, 'contents',
$self->{'current_filename'});
if ($content_href) {
@@ -179,13 +140,7 @@ sub ffmpeg_heading_command($$$$$)
}
}
my $in_preformatted;
if ($program_version_num >= 7.001090) {
$in_preformatted = $self->in_preformatted_context();
} else {
$in_preformatted = $self->in_preformatted();
}
if ($in_preformatted) {
if ($self->in_preformatted()) {
$result .= $heading."\n";
} else {
# if the level was changed, set the command name right
@@ -194,25 +149,21 @@ sub ffmpeg_heading_command($$$$$)
$cmdname
= $Texinfo::Common::level_to_structuring_command{$cmdname}->[$heading_level];
}
# format_heading_text expects an array of headings for texinfo >= 7.0
if ($program_version_num >= 7.000000) {
$result .= &{get_formatting_function($self,'format_heading_text')}($self,
$cmdname, [$cmdname], $heading,
$heading_level +$self->get_conf('CHAPTER_HEADER_LEVEL') -1,
$heading_id, $command);
} else {
$result .= &{get_formatting_function($self,'format_heading_text')}(
$heading = [$heading];
}
$result .= &{get_formatting_function($self,'format_heading_text')}(
$self, $cmdname, $heading,
$heading_level +
$self->get_conf('CHAPTER_HEADER_LEVEL') - 1, $command);
}
}
}
$result .= $content if (defined($content));
return $result;
}
foreach my $command (keys(%sectioning_commands), 'node') {
foreach my $command (keys(%Texinfo::Common::sectioning_commands), 'node') {
texinfo_register_command_formatting($command, \&ffmpeg_heading_command);
}
@@ -237,56 +188,28 @@ sub ffmpeg_begin_file($$$)
my $filename = shift;
my $element = shift;
my ($element_command, $node_command, $command_for_title);
if ($element) {
if ($element->{'unit_command'}) {
$element_command = $element->{'unit_command'};
} elsif ($self->can('tree_unit_element_command')) {
$element_command = $self->tree_unit_element_command($element);
} elsif ($self->can('tree_unit_element_command')) {
$element_command = $self->element_command($element);
}
$node_command = $element_command;
if ($element_command and $element_command->{'cmdname'}
and $element_command->{'cmdname'} ne 'node'
and $element_command->{'extra'}
and $element_command->{'extra'}->{'associated_node'}) {
$node_command = $element_command->{'extra'}->{'associated_node'};
}
$command_for_title = $element_command if ($self->get_conf('SPLIT'));
my $command;
if ($element and $self->get_conf('SPLIT')) {
$command = $self->element_command($element);
}
my ($title, $description, $keywords, $encoding, $date, $css_lines, $doctype,
$root_html_element_attributes, $body_attributes, $copying_comment,
$after_body_open, $extra_head, $program_and_version, $program_homepage,
my ($title, $description, $encoding, $date, $css_lines,
$doctype, $bodytext, $copying_comment, $after_body_open,
$extra_head, $program_and_version, $program_homepage,
$program, $generator);
if ($program_version_num >= 7.001090) {
($title, $description, $keywords, $encoding, $date, $css_lines, $doctype,
$root_html_element_attributes, $body_attributes, $copying_comment,
$after_body_open, $extra_head, $program_and_version, $program_homepage,
$program, $generator) = $self->_file_header_information($command_for_title,
$filename);
} elsif ($program_version_num >= 7.000000) {
($title, $description, $encoding, $date, $css_lines, $doctype,
$root_html_element_attributes, $copying_comment, $after_body_open,
if ($program_version_num >= 7.000000) {
($title, $description, $encoding, $date, $css_lines,
$doctype, $bodytext, $copying_comment, $after_body_open,
$extra_head, $program_and_version, $program_homepage,
$program, $generator) = $self->_file_header_information($command_for_title,
$filename);
$program, $generator) = $self->_file_header_information($command);
} else {
($title, $description, $encoding, $date, $css_lines,
$doctype, $root_html_element_attributes, $copying_comment,
$after_body_open, $extra_head, $program_and_version, $program_homepage,
$program, $generator) = $self->_file_header_informations($command_for_title);
$doctype, $bodytext, $copying_comment, $after_body_open,
$extra_head, $program_and_version, $program_homepage,
$program, $generator) = $self->_file_header_informations($command);
}
my $links;
if ($program_version_num >= 7.000000) {
$links = $self->_get_links($filename, $element, $node_command);
} else {
$links = $self->_get_links ($filename, $element);
}
my $links = $self->_get_links ($filename, $element);
my $head1 = $ENV{"FFMPEG_HEADER1"} || <<EOT;
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
@@ -329,25 +252,13 @@ sub ffmpeg_program_string($)
if (defined($self->get_conf('PROGRAM'))
and $self->get_conf('PROGRAM') ne ''
and defined($self->get_conf('PACKAGE_URL'))) {
if ($program_version_num >= 7.001090) {
return $self->convert_tree(
$self->cdt('This document was generated using @uref{{program_homepage}, @emph{{program}}}.',
{ 'program_homepage' => {'text' => $self->get_conf('PACKAGE_URL')},
'program' => {'text' => $self->get_conf('PROGRAM') }}));
} else {
return $self->convert_tree(
return $self->convert_tree(
$self->gdt('This document was generated using @uref{{program_homepage}, @emph{{program}}}.',
{ 'program_homepage' => {'text' => $self->get_conf('PACKAGE_URL')},
'program' => {'text' => $self->get_conf('PROGRAM') }}));
}
{ 'program_homepage' => $self->get_conf('PACKAGE_URL'),
'program' => $self->get_conf('PROGRAM') }));
} else {
if ($program_version_num >= 7.001090) {
return $self->convert_tree(
$self->cdt('This document was generated automatically.'));
} else {
return $self->convert_tree(
$self->gdt('This document was generated automatically.'));
}
return $self->convert_tree(
$self->gdt('This document was generated automatically.'));
}
}
if ($program_version_6_8) {

0
doc/texi2pod.pl Executable file → Normal file
View File

2
doc/texidep.pl Executable file → Normal file
View 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>

View File

@@ -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.

View File

@@ -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.

View File

@@ -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)

View File

@@ -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);

View File

@@ -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 = $@
@@ -139,46 +139,6 @@ else
$(BIN2C) $(patsubst $(SRC_PATH)/%,$(SRC_LINK)/%,$<) $@ $(subst .,_,$(basename $(notdir $@)))
endif
# 1) Preprocess CSS to a minified version
%.css.min: TAG = SED
%.css.min: %.css
$(M)sed 's!/\\*.*\\*/!!g' $< \
| tr '\n' ' ' \
| tr -s ' ' \
| sed 's/^ //; s/ $$//' \
> $@
ifdef CONFIG_RESOURCE_COMPRESSION
# 2) Gzip the minified CSS
%.css.min.gz: TAG = GZIP
%.css.min.gz: %.css.min
$(M)gzip -nc9 $< > $@
# 3) Convert the gzipped CSS to a .c array
%.css.c: %.css.min.gz $(BIN2CEXE)
$(BIN2C) $< $@ $(subst .,_,$(basename $(notdir $@)))
# 4) Gzip the HTML file (no minification needed)
%.html.gz: TAG = GZIP
%.html.gz: %.html
$(M)gzip -nc9 $< > $@
# 5) Convert the gzipped HTML to a .c array
%.html.c: %.html.gz $(BIN2CEXE)
$(BIN2C) $< $@ $(subst .,_,$(basename $(notdir $@)))
else # NO COMPRESSION
# 2) Convert the minified CSS to a .c array
%.css.c: %.css.min $(BIN2CEXE)
$(BIN2C) $< $@ $(subst .,_,$(basename $(notdir $@)))
# 3) Convert the plain HTML to a .c array
%.html.c: %.html $(BIN2CEXE)
$(BIN2C) $< $@ $(subst .,_,$(basename $(notdir $@)))
endif
clean::
$(RM) $(BIN2CEXE) $(CLEANSUFFIXES:%=ffbuild/%)
@@ -199,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)
@@ -208,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)
@@ -229,10 +191,9 @@ SKIPHEADERS += $(ARCH_HEADERS:%=$(ARCH)/%) $(SKIPHEADERS-)
SKIPHEADERS := $(SKIPHEADERS:%=$(SUBDIR)%)
HOBJS = $(filter-out $(SKIPHEADERS:.h=.h.o),$(ALLHEADERS:.h=.h.o))
PTXOBJS = $(filter %.ptx.o,$(OBJS))
RESOURCEOBJS = $(filter %.css.o %.html.o,$(OBJS))
$(HOBJS): CCFLAGS += $(CFLAGS_HEADERS)
checkheaders: $(HOBJS)
.SECONDARY: $(HOBJS:.o=.c) $(PTXOBJS:.o=.c) $(PTXOBJS:.o=.gz) $(PTXOBJS:.o=) $(RESOURCEOBJS:.o=.c) $(RESOURCEOBJS:%.css.o=%.css.min) $(RESOURCEOBJS:%.css.o=%.css.min.gz) $(RESOURCEOBJS:%.html.o=%.html.gz) $(RESOURCEOBJS:.o=)
.SECONDARY: $(HOBJS:.o=.c) $(PTXOBJS:.o=.c) $(PTXOBJS:.o=.gz) $(PTXOBJS:.o=)
alltools: $(TOOLS)
@@ -245,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.gz *.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
@@ -262,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)

View File

@@ -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)

View File

@@ -1,4 +1,3 @@
#!/bin/sh
toupper(){
echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
}

View File

@@ -50,7 +50,7 @@ includedir=${source_path}
prefix=
exec_prefix=
libdir=\${pcfiledir}/../../../$name
includedir=${includedir}
includedir=${source_path}
Name: $fullname
Description: $comment

View File

@@ -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,34 +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) \
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
@@ -58,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))
@@ -71,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
@@ -92,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/%)

View File

@@ -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])
@@ -595,7 +581,7 @@ static const AVOption *opt_find(void *obj, const char *name, const char *unit,
return o;
}
#define FLAGS ((o->type == AV_OPT_TYPE_FLAGS && (arg[0]=='-' || arg[0]=='+')) ? AV_DICT_APPEND : 0)
#define FLAGS (o->type == AV_OPT_TYPE_FLAGS && (arg[0]=='-' || arg[0]=='+')) ? AV_DICT_APPEND : 0
int opt_default(void *optctx, const char *opt, const char *arg)
{
const AVOption *o;
@@ -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;
}

View File

@@ -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 */

View File

@@ -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;
@@ -286,9 +306,8 @@ static int read_key(void)
}
//Read it
if(nchars != 0) {
if (read(0, &ch, 1) == 1)
return ch;
return 0;
read(0, &ch, 1);
return ch;
}else{
return -1;
}
@@ -309,12 +328,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 +360,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 +494,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 +545,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 +569,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 +577,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 +591,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 +657,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 +716,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 +725,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 = "?";
@@ -806,6 +777,8 @@ static int check_keyboard_interaction(int64_t cur_time)
{
int i, key;
static int64_t last_time;
if (received_nb_signals)
return AVERROR_EXIT;
/* read_key() returns 0 on EOF */
if (cur_time - last_time >= 100000) {
key = read_key();
@@ -835,11 +808,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');
@@ -889,9 +857,6 @@ static int transcode(Scheduler *sch)
while (!sch_wait(sch, stats_period, &transcode_ts)) {
int64_t cur_time= av_gettime_relative();
if (received_nb_signals)
break;
/* if 'q' pressed, exits */
if (stdin_interaction)
if (check_keyboard_interaction(cur_time) < 0)
@@ -1030,8 +995,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;
}

Some files were not shown because too many files have changed in this diff Show More