Commit Graph

3323 Commits

Author SHA1 Message Date
openvela-robot 5569e7353a hwcontext_vulkan: improve queue family init code
When users zero-init'd the struct, or left it as-is, the encode
queue family matched the graphics queue family, which led it to be
incorrectly logged as being used for encode.

This just improves the logging so this isn't printed anymore.
2026-04-20 20:39:40 +08:00
openvela-robot ea73ba2131 ffmpeg: fix coverity warning
fix resource leaks and self assignment

Signed-off-by: cenzhanquan1 <cenzhanquan1@xiaomi.com>
2026-04-20 20:39:27 +08:00
openvela-robot 4c3136857b avcodec/jpegxl_parser: fix OOB read regression
In f7ac3512f5b5cb8eb149f37300b43461d8e93af3 the size of the dynamically
allocated buffer was shrunk, but it was made too small for very small
alphabet sizes. This patch restores the size to prevent an OOB read.

Reported-by: Cole Dilorenzo <coolkingcole@gmail.com>
Signed-off-by: Leo Izen <leo.izen@gmail.com>
2026-04-20 20:39:20 +08:00
openvela-robot 24a9c5e480 FFMPEG: add strict condition to underflow.
Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
2026-04-20 20:39:16 +08:00
openvela-robot 5a8c3218d2 avcodec/pthread_frame: Remove FF_API_SLICE_OFFSET
Since 432adca5fedcb277b9a715a723cfd40735ec58f8 no decoder
looks at the slice_count and slice_offset fields at all,
so there is no reason to synchronize them between the worker
and the user thread.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-04-20 20:38:41 +08:00
openvela-robot 2337dcdff9 ffmpeg:reduce query times in ff_nuttx_capbility_query_ranges
Signed-off-by: yuexinyi <yuexinyi@xiaomi.com>
2026-04-20 20:38:37 +08:00
openvela-robot a24195dcbf avcodec/error_resilience: Make applying decode_error_flags optional
Add a pointer parameter that if supplied will be used to return
the updated decode_error_flags. This will allow to fix several
races when using frame-threading; these resulted from AVFrame
that the earlier code updated concurrently being used as source
in an av_frame_ref() call in the decoder's update_thread_context.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-04-20 20:38:31 +08:00
openvela-robot e5f93889b0 ffmpeg: correct function name in vsrc_devsrc and asrc_adevsrc filter
Signed-off-by: yuexinyi <yuexinyi@xiaomi.com>
2026-04-20 20:38:28 +08:00
openvela-robot 8168a75c47 avcodec/smcenc: remove useless cast 2026-04-20 20:38:00 +08:00
openvela-robot 24b75f6a39 ffmpeg:add le audio and a2dp audio option
Signed-off-by: chengkai <chengkai@xiaomi.com>
2026-04-20 20:37:56 +08:00
openvela-robot f6d2b5c056 avformat/matroskaenc: Fix writing of markers
When the marker writing code was merged from libav to FFmpeg
in dc62016c, it failed to take into account that the meaning of
cluster_pos had changed in bda5b662; in particular, the special
value for “I'm not currently working on a cluster” had changed
from 0 to -1. This makes the avio_write_marker() call never
be called. Update the if statement to fix it.

Fixes: Ticket9843
Signed-off-by: Steinar H. Gunderson <steinar+ffmpeg@gunderson.no>
Signed-off-by: Martin Storsjö <martin@martin.st>
2026-04-20 20:37:41 +08:00
openvela-robot d45dcff4a8 ffmpeg : member access within null pointer of type 'struct AVCodecContext'
get sample_rate from inlink in place of enc_ctx.

Signed-off-by: libei1 <libei1@xiaomi.com>
2026-04-20 20:37:37 +08:00
openvela-robot b247d70780 fate/matroska: Stop using unicode in command line paramters
The fate-run.sh shell script exports LC_ALL=C before invoking the
test executables; this is probably done for consistency.

When executing Windows binaries with Wine, it normally handles
UTF-8 command line parameters just fine - but with LC_ALL set to
C, it treats them as plain ASCII.

As the unicode command line parameters wasn't the main thing
being tested here, just convert them to plain ASCII, for
portability. This fixes the test for all test configurations that
use Wine.

Signed-off-by: Martin Storsjö <martin@martin.st>
2026-04-20 20:37:29 +08:00
openvela-robot 1685f31803 FFmpeg: Fix compilation warning about size_t format printing
ffmpeg/libavdevice/nuttx_dec.c:107:39: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 8 has type ‘size_t’ {aka ‘unsigned int’} [-Wformat=]
  107 |             snprintf(data, data_size, "%d|%d|%d|%d|%"PRIu64"",
      |                                       ^~~~~~~~~~~~~~~
  108 |                      priv->running, priv->flushing,
  109 |                      priv->period_bytes, priv->periods, dq_count(&priv->bufferq));
      |                                                         ~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                         |
      |                                                         size_t {aka unsigned int}

Signed-off-by: renjianguang <renjianguang@xiaomi.com>
2026-04-20 20:37:25 +08:00
openvela-robot 0bf5f29940 avfilter/vf_ssim: Fix x86 assembly code for SSIM calculation
This commit fixes bug #10495

The code had several bugs related to post-loop compensation code:
- test assembly instruction performs bitwise AND operation and
generate flags used by jz branch instruction. Wrong test condition
leads to incorrect branching
- Incorrect compensation code for some branches

Signed-off-by: Evgeny Pavlov <lucenticus@gmail.com>
2026-04-20 20:37:23 +08:00
openvela-robot f05d9e758f FFmpeg: fix format warning in libavdevice/nuttx_dec.c
107 |             snprintf(data, data_size, "%d|%d|%d|%d|%d",
      |                                                    ~^
      |                                                     |
      |                                                     int
      |                                                    %ld
  108 |                      priv->running, priv->flushing,
  109 |                      priv->period_bytes, priv->periods, dq_count(&priv->bufferq));
      |                                                         ~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                         |
      |                                                         size_t {aka long unsigned int}

Signed-off-by: yangsen5 <yangsen5@xiaomi.com>
2026-04-20 20:37:18 +08:00
openvela-robot 664f23c83f avcodec/exr: tag gamma=1.0 output as linear light
By default the OpenEXR decoder outputs linear light pixel data by
applying a gamma=1.0 transfer (i.e. a no-op). When it does so, it
should tag the data as linear so color-managed filters or other tools
can work with it correctly.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2026-04-20 20:37:15 +08:00
openvela-robot 773d02532e ffmpeg: let bluelet devices report sample formats
Signed-off-by: jihandong <jihandong@xiaomi.com>
2026-04-20 20:37:11 +08:00
openvela-robot c6e235379e avformat/flvdec: handle exheader fourcc correctly in metadata
In metadata fourcc is carried in the AMF number, not as binary.

Partially based on a patch by Steven Liu.

Signed-off-by: Marton Balint <cus@passwd.hu>
2026-04-20 20:36:59 +08:00
openvela-robot c37847a7fe FFmpeg: fix coverity warning in libavdevice/nuttx.c
Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
2026-04-20 20:36:55 +08:00
openvela-robot fd17e1ad7b libswresample: Prevent out of bounds.
We've been fuzzing torchvision with [sydr-fuzz](https://github.com/ispras/oss-sydr-fuzz)
and found out of bounds error in ffmpeg project at audioconvert.c:151.
To prevent error we need to fix checks for in and out fmt in swr_init.

Signed-off-by: Eli Kobrin <kobrineli@ispras.ru>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-04-20 20:36:47 +08:00
openvela-robot 951e11666c ffmpeg : adevsink add support to get current playback timestamp
adevsink add support to get current playback timestamp.

Signed-off-by: libei1 <libei1@xiaomi.com>
2026-04-20 20:36:38 +08:00
openvela-robot 8a3ef023ab fftools/ffprobe: Fix memleak
Fixes Coverity issue #1524491.
Regression since e6126abc6997058ca49ee596b70611bbe367163e.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-04-20 20:36:35 +08:00
openvela-robot 2a63a6b065 ffmpeg:optimize bluelet enc control msg case
optimize bluelet enc control msg case

Signed-off-by: shipei <shipei@xiaomi.com>
2026-04-20 20:36:32 +08:00
openvela-robot 48787dc6df avcodec: move mastering display colour volume SEI handling to h2645_sei
This allows this common H.274 SEI to be parsed from both H.264
as well as HEVC, as well as probably from VVC in the future.

Generally attempts to keep the original code as similar as possible.

FATE test refererence changes only change the order of side data
export within a single frame. Nothing else seems to have changed.
2026-04-20 20:36:26 +08:00
openvela-robot b6455e61f3 ffmpeg: bluelet_dec handles start/stop instead of play/pause
Signed-off-by: jihandong <jihandong@xiaomi.com>
2026-04-20 20:36:23 +08:00
openvela-robot 1b66c53eef hwcontext_vulkan: hide Linux-only header after 571756bf2fe2
major/minor are in <sys/types.h> on BSDs and <sys/mkdev.h> on Solaris-like.

libavutil/hwcontext_vulkan.c:55:10: fatal error: 'sys/sysmacros.h' file not found
#include <sys/sysmacros.h>
^~~~~~~~~~~~~~~~~
2026-04-20 20:36:16 +08:00
openvela-robot 6dcc9fb36f FFMPEG: query sample_format from audio driver.
Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
2026-04-20 20:36:12 +08:00
openvela-robot 18ce7087fe lavd/opengl: select the GL context before drawing
Since “2d924b3a63 fftools/ffmpeg: move each muxer to a separate thread”,
opengl_write_packet() is called from a different thread than
opengl_write_header() and would nothing for lack of a selected context.
2026-04-20 20:35:57 +08:00
openvela-robot a908a5723a FFMPEG: use start/stop command to control device filter.
Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
2026-04-20 20:35:42 +08:00
openvela-robot f903ae1658 avcodec/decode: Return EAGAIN instead of discarding unused packet
Should fix #10457, a regression caused by
69516ab3e917a6e91d26e38d04183c60fd71cbab.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-04-20 20:35:37 +08:00
openvela-robot 434d603b18 ffmpeg:add bluelet leaudio dec/enc handler
Signed-off-by: chengkai <chengkai@xiaomi.com>
2026-04-20 20:35:33 +08:00
openvela-robot 3d4081fba4 lavc: add a header for internal generic-layer APIs
The goal is to distinguish between APIs provided by the generic layer to
individual codecs and APIs internal to the generic layer.

Start by moving ff_{decode,encode}_receive_frame() and
ff_{decode,encode}_preinit() into this new header, as those functions
are called from generic code and should not be visible to individual
codecs.
2026-04-20 20:35:28 +08:00
openvela-robot 7f66e86a15 ffmpeg: adevsrc should report accurate ch_layout
Signed-off-by: jihandong <jihandong@xiaomi.com>
2026-04-20 20:35:24 +08:00
openvela-robot 0fd69129a5 amfenc: Update the min version to 1.4.29.0 for AMF SDK. 2026-04-20 20:35:15 +08:00
openvela-robot 5ed8233148 libavdevice/nuttx : nuttx enc support get_output_timestamp
JIRA-ID:VELAPLATFO-8755

nuttx_enc compute timestamp, and add get_output_timestamp

Signed-off-by: libei1 <libei1@xiaomi.com>
2026-04-20 20:35:11 +08:00
openvela-robot e1b5c84cd3 avformat/evc: use get_ue_golomb_long()
This partially reverts commit d0fc1b3507c, which reintroduced a regression
originally fixed in 5e9986fd2d.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-04-20 20:35:08 +08:00
openvela-robot 2a2eefee82 ffmpeg : improve libavdevice/nuttx captured definition
JIRA-ID:VELAPLATFO-9568

add bool capture for in/out device, add io_bytes for both devices

Signed-off-by: libei1 <libei1@xiaomi.com>
2026-04-20 20:35:05 +08:00
openvela-robot 73855e8f18 doc/filters: correct luma terminology
Partially fixes #10427

See https://poynton.ca/notes/colour_and_gamma/ColorFAQ.html#RTFToC11 for
ref.
2026-04-20 20:35:02 +08:00
openvela-robot 29665002de FFMPEG: code optimizing.
Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
2026-04-20 20:34:58 +08:00
openvela-robot b0a492cdcb avfilter/af_afir: do not use ff_outlink_get_status() on inlinks 2026-04-20 20:34:11 +08:00
openvela-robot 89a65397fa FFMPEG: fix dereference pkt is null
check pkt whether is null avoid avcodec_receive_packet function call av_packet_unref dereference segmentation fault.

Signed-off-by: cenzhanquan1 <cenzhanquan1@xiaomi.com>
2026-04-20 20:34:08 +08:00
openvela-robot 1d98ae6c8a avcodec/av1dec: convert to receive_frame()
This removes the overhead of inserting the av1_frame_split bsf as part of the
decoding process.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-04-20 20:33:49 +08:00
openvela-robot 7f73494f77 FFMPEG: Fix warnings.
ffmpeg/libavdevice/nuttx.c:451:57: warning: format '%u' expects argument of type 'unsigned int', but argument 6 has type 'uint32_t' {aka 'long unsigned int'} [-Wformat=]
  451 |     av_log(NULL, AV_LOG_DEBUG, "[%s][%s] configure, sr:%u ch:%d ret:%d\n",
      |                                                        ~^
      |                                                         |
      |                                                         unsigned int
      |                                                        %lu
  452 |         __func__, priv->devname, priv->sample_rate, priv->ch_layout.nb_channels, ret);
      |                                  ~~~~~~~~~~~~~~~~~
      |                                      |
      |                                      uint32_t {aka long unsigned int}

Signed-off-by: cenzhanquan1 <cenzhanquan1@xiaomi.com>
2026-04-20 20:33:46 +08:00
openvela-robot 035e455b52 fate/tests/ffmpeg: use -idct simple for fate-ffmpeg-input-r
Makes the test bitexact on non-x86_64.
2026-04-20 20:33:42 +08:00
openvela-robot 841a14fc5a external/ffmpeg: check ranges of channels
Signed-off-by: jinxiuxu <jinxiuxu@xiaomi.com>
2026-04-20 20:33:38 +08:00
openvela-robot 9903242bf8 doc/filters/libplacebo: remove outdated example
This example being first is now misleading because round-tripping
through hwdownload/hwupload is neither required nor recommended. Also,
the comment about avoiding format conversion is unnecessary because
`libplacebo` will now inherit the input frame format by default.
2026-04-20 20:32:54 +08:00
openvela-robot ae7e7b05d9 ffmpeg: plentful debug log
N/A

1. device ioctl debug log e.g.
[   26.191100] [14] [ DEBUG] [ap] [ff_nuttx_open][/dev/audio/pcm0p] configure, sr:44100 ch:2 ret:0
[   26.191200] [14] [ DEBUG] [ap] [ff_nuttx_open][/dev/audio/pcm0p] set buffer info, n:4 size:3528
[   26.191300] [14] [ DEBUG] [ap] [ff_nuttx_open][/dev/audio/pcm0p] get buffer info, n:4 size:3528 ret:0
[   26.534200] [14] [ DEBUG] [ap] [ff_nuttx_write_data][/dev/audio/pcm0p] start ret:0

2. format negotiation debug log e.g.
[   21.142400] [14] [ DEBUG] [ap]
                 amix@MixSpeaker   chs: order:1,ch:2,0x3
                  adevsink@pcm0p   chs: order:0,ch:1,0x0 order:0,ch:2,0x0
                 amix@MixSpeaker rates: 44100
                  adevsink@pcm0p rates: 8000 11025 16000 22050 32000 44100 48000
                 amix@MixSpeaker  fmts: s16p
                  adevsink@pcm0p  fmts: s16
[   21.142500] [14] [ DEBUG] [ap]
                 amix@MixSpeaker   chs: order:1,ch:2,0x3
                  adevsink@pcm0p   chs: order:1,ch:2,0x3
                 amix@MixSpeaker rates: 44100
                  adevsink@pcm0p rates: 44100
                 amix@MixSpeaker  fmts: s16p
                  adevsink@pcm0p  fmts: s16
[   21.142700] [14] [ DEBUG] [ap] Setting 'converter' to value '4'
[   21.142800] [14] [ DEBUG] [ap] auto-inserting filter 'auto_aresample' between the filter 'amix@MixSpeaker' and the filter 'adevsink@pcm0p'

Signed-off-by: jihandong <jihandong@xiaomi.com>
2026-04-20 20:32:51 +08:00
openvela-robot 9050404993 avcodec/libx264: add a flush callback
Signed-off-by: James Almer <jamrial@gmail.com>
2026-04-20 20:32:14 +08:00
openvela-robot 24478030d4 FFMPEG: fix system crash when sim boot whithout camera
Signed-off-by: lile7 <lile7@xiaomi.com>
2026-04-20 20:32:11 +08:00
openvela-robot f3b118c812 libavformat/tcp: add local_addr/local_port for network option
Signed-off-by: jackarain <jack.wgm@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2026-04-20 20:32:04 +08:00
openvela-robot d9f83b4739 FFMPEG: add offload option in adevsink.
Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
2026-04-20 20:32:01 +08:00
openvela-robot 5ab7442253 lavc/codec_desc.c: remove AV_CODEC_PROP_TEXT_SUB property from ARIB_CAPTION
To support bitmap subtitle output, remove AV_CODEC_PROP_TEXT_SUB
property from codec descriptor for AV_CODEC_ID_ARIB_CAPTION.
This is similar to `libavcodec/libzvbi-teletextdec.c`
(AV_CODEC_ID_DVB_TELETEXT).

Instead, each subtitle decoder has to specify a subtitile format.
`libavcodec/libaribb24.c` uses same AV_CODEC_ID_ARIB_CAPTION and
expects AV_CODEC_PROP_TEXT_SUB to be set, so this adds a line to
specify a format there.

Signed-off-by: rcombs <rcombs@rcombs.me>
2026-04-20 20:31:57 +08:00
openvela-robot e22343cd0e FFMPEG: add default codec setting in query_format.
dependson:888283

1, Filters which hook query_formats, set codecs in filter_query_formats.
streamselect is exception because it hook sanitize_formats.

2, Filters which doesn't hook query_formats, set codecs in ff_default_query_formats.

Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
2026-04-20 20:31:54 +08:00
openvela-robot 8161f26c12 avcodec/avutil: move dynamic HDR10+ metadata parsing to libavutil
Signed-off-by: Raphaël Zumer <rzumer@tebako.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2026-04-20 20:31:47 +08:00
openvela-robot 96e3f5956c ffmpeg: fix NULL strcmp error
N/A

Signed-off-by: jihandong <jihandong@xiaomi.com>
2026-04-20 20:31:43 +08:00
openvela-robot d82f9ae7d8 lavu/frame: improve AVFrame.opaque[_ref] documentation
Make them match each other, mention interaction with
AV_CODEC_FLAG_COPY_OPAQUE.
2026-04-20 20:31:34 +08:00
openvela-robot a8e85bba00 ffmpeg: nuttx_dec support temparory pause
Signed-off-by: jihandong <jihandong@xiaomi.com>
2026-04-20 20:31:30 +08:00
openvela-robot 51b3e1bb2d avfilter/af_afir: reduce output gain with default parameters
It was unreasonably high. Also change scaling to reduce
rare quantization errors.
2026-04-20 20:30:36 +08:00
openvela-robot dcac24dcec ffmpeg: fix uinit error
0  0x5672bb6e in avformat_free_context (s=0x56d21060) at ffmpeg/libavformat/avformat.c:129
1  0x567ddf8e in adevsink_uninit (ctx=0x56d228b0) at ffmpeg/libavfilter/asink_adevsink.c:169
2  0x56721835 in avfilter_free (filter=0x56d228b0) at ffmpeg/libavfilter/avfilter.c:863
3  0x5672a92e in create_filter (log_ctx=0x56d14590, args=0x56d23050 "format=nuttx:devname=/dev/audio/pcm0p", name=0x56d22f40 "adevsink@pcm0p", index=<optimized out>, ctx=0xfffffffe,
   filt_ctx=0xf6ec3e88) at ffmpeg/libavfilter/graphparser.c:158
4  parse_filter (filt_ctx=filt_ctx@entry=0xf6ec3e88, buf=buf@entry=0xf6ec3e6c, graph=graph@entry=0x56d14590, index=24, log_ctx=0x56d14590) at ffmpeg/libavfilter/graphparser.c:201
5  0x5672af22 in avfilter_graph_parse2 (graph=0x56d14590, filters=<optimized out>, inputs=0xf6ec3ed8, outputs=0xf6ec3edc) at ffmpeg/libavfilter/graphparser.c:438
6  0x5671bc90 in media_graph_load (priv=0x56d16bf0, conf=0x56a5a466 "/etc/media/graph.conf") at media_graph.c:153
7  0x5671c435 in media_graph_create (file=0x56a5a466) at media_graph.c:337
8  0x56713f0b in mediad_main (argc=1, argv=0xf6cb5040) at media_daemon.c:163
9  0x5658de28 in nxtask_startup (entrypt=0x56713e8b <mediad_main>, argc=1, argv=0xf6cb5040) at sched/task_startup.c:70
10 0x5657ff82 in nxtask_start () at task/task_start.c:134
11 0xdeadbeef in ?? ()

Signed-off-by: ligd <liguiding1@xiaomi.com>
2026-04-20 20:30:32 +08:00
openvela-robot edc934782f avcodec/pnmenc: Check av_image_get_buffer_size()
Fixes the crash in ticket #10050.
Also ensure that we don't overflow before ff_get_encode_buffer().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-04-20 20:30:02 +08:00
openvela-robot 1d136bd248 bluelet:fix build error if not enable CONFIG_NET_RPMSG
Signed-off-by: fangzhenwei <fangzhenwei@xiaomi.com>
2026-04-20 20:29:57 +08:00
openvela-robot 6d4e16b532 avfilter/af_firequalizer: switch to TX from lavu 2026-04-20 20:29:50 +08:00
openvela-robot 9299ef8b7b ffmpeg/bluelet:fix warning
libavdevice/bluelet.c:357:33: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘uint32_t’ {aka ‘unsigned int’} [-Wformat=]
  357 |                 "channel_mode=%lu:blocks=%lu:subbands=%lu:alloc_method=%lu:bitpool=%lu",
      |                               ~~^
      |                                 |
      |                                 long unsigned int
      |                               %u
  358 |                 param.channel_mode, param.blocks, param.subbands, param.alloc_method, param.bitpool);
      |                 ~~~~~~~~~~~~~~~~~~
      |                      |
      |                      uint32_t {aka unsigned int}
libavdevice/bluelet.c:357:44: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘uint32_t’ {aka ‘unsigned int’} [-Wformat=]
  357 |                 "channel_mode=%lu:blocks=%lu:subbands=%lu:alloc_method=%lu:bitpool=%lu",
      |                                          ~~^
      |                                            |
      |                                            long unsigned int
      |                                          %u
  358 |                 param.channel_mode, param.blocks, param.subbands, param.alloc_method, param.bitpool);
      |                                     ~~~~~~~~~~~~
      |                                          |
      |                                          uint32_t {aka unsigned int}

Signed-off-by: fangzhenwei <fangzhenwei@xiaomi.com>
2026-04-20 20:29:47 +08:00
openvela-robot 0e99873ffa avfilter/af_loudnorm: fix incorrect gain when audio is shorter than 3s
The input data is multiplied by `s->offset` to get normalized output.
`s->target_tp` and `true_peak` is not in dB,
so `s->offset` should be calculated by division instead of subtraction.

Signed-off-by: Rui Zhu <real.zhurui@gmail.com>
2026-04-20 20:29:37 +08:00
openvela-robot 5de2d251c8 FFmpeg/bluelet:adapt to 5.1.1 version
Signed-off-by: jihandong <jihandong@xiaomi.com>
Signed-off-by: fangzhenwei <fangzhenwei@xiaomi.com>
2026-04-20 20:29:34 +08:00
openvela-robot d4c7951080 avfilter/vf_pseudocolor: add spectral preset 2026-04-20 20:29:22 +08:00
openvela-robot 90eb42bda6 Merge branch 'origin511' into sync511 2026-04-20 20:29:19 +08:00
openvela-robot e4e6bf1c1e avformat/dashenc: Disable streaming for webm output
Currently streaming for webm output doesn't work.
Disabling explicitly will make sure that the manifest will get generated correctly.
2026-04-20 20:07:10 +08:00
openvela-robot 6f5fe076ef configure: Include time.h when checking for gmtime_r and localtime_r
These functions are available in time.h (conditional on posix thread
safe functions) on mingw.

Previously, these functions weren't detected by configure, and
libavutil/time_internal.h provided replacements, even if time.h
actually contained definitions of them.

These mingw inline functions are currently defined as
 "extern __inline __attribute__((__gnu_inline__))". In this case,
redefining a new static inline version of the same function with the
same name is tolerated.

Signed-off-by: Martin Storsjö <martin@martin.st>
2026-04-20 20:07:06 +08:00
openvela-robot 8bdc1bb6e0 avdevice/decklink_dec: set configs before listing formats
Format list can be input and profile dependant.

Signed-off-by: Marton Balint <cus@passwd.hu>
2026-04-20 20:06:59 +08:00
openvela-robot 421b75708c rtsp: add pkt_size option
This allows users to specify an upper limit on the size of outgoing packets
when publishing via RTSP.

Signed-off-by: Martin Storsjö <martin@martin.st>
2026-04-20 20:06:54 +08:00
openvela-robot 4b0e5391a6 lavu/opencl: replace va_ext.h with standard name
Khronos OpenCL header (https://github.com/KhronosGroup/OpenCL-Headers)
uses cl_va_api_media_sharing_intel.h. And Intel's official OpenCL driver
for Intel GPU (https://github.com/intel/compute-runtime) was compiled
against Khronos OpenCL header. So it's better to align with Khronos.

Signed-off-by: Ruiling Song <ruiling.song@intel.com>
2026-04-20 20:06:39 +08:00
openvela-robot 21d48ad714 arm: Implement a NEON version of 422 h264_h_loop_filter_chroma
Previously, the 420 version was used even for 422.

This fixes occasional checkasm failures.

Signed-off-by: Martin Storsjö <martin@martin.st>
2026-04-20 20:06:37 +08:00
openvela-robot 18c5d7c990 avfilter/af_anlmdn: add output mode option 2026-04-20 20:05:58 +08:00
openvela-robot 07986530f9 h264/arm64: implement missing 4:2:2 chroma loop filter neon functions 2026-04-20 20:05:55 +08:00
openvela-robot 502d5ab63d libavcodec/zmbvenc: block scoring improvements/bug fixes
- Improve block choices by counting 0-bytes in the entropy score
- Make histogram use uint16_t type, to allow byte counts from 16*16
(current block size) up to 255*255 (maximum allowed 8bpp block size)
- Make sure score table is big enough for a full block's worth of bytes
- Calculate *xored without using code in inner loop
2026-04-20 20:05:33 +08:00
openvela-robot a9d4b932f6 libavcodec: vp8 neon optimizations for aarch64
Partial port of the ARM Neon for aarch64.

Benchmarks from fate:

benchmarking with Linux Perf Monitoring API
nop: 58.6
checkasm: using random seed 1760970128
NEON:
 - vp8dsp.idct       [OK]
 - vp8dsp.mc         [OK]
 - vp8dsp.loopfilter [OK]
checkasm: all 21 tests passed
vp8_idct_add_c: 201.6
vp8_idct_add_neon: 83.1
vp8_idct_dc_add_c: 107.6
vp8_idct_dc_add_neon: 33.8
vp8_idct_dc_add4y_c: 426.4
vp8_idct_dc_add4y_neon: 59.4
vp8_loop_filter8uv_h_c: 688.1
vp8_loop_filter8uv_h_neon: 216.3
vp8_loop_filter8uv_inner_h_c: 649.3
vp8_loop_filter8uv_inner_h_neon: 195.3
vp8_loop_filter8uv_inner_v_c: 544.8
vp8_loop_filter8uv_inner_v_neon: 131.3
vp8_loop_filter8uv_v_c: 706.1
vp8_loop_filter8uv_v_neon: 141.1
vp8_loop_filter16y_h_c: 668.8
vp8_loop_filter16y_h_neon: 242.8
vp8_loop_filter16y_inner_h_c: 647.3
vp8_loop_filter16y_inner_h_neon: 224.6
vp8_loop_filter16y_inner_v_c: 647.8
vp8_loop_filter16y_inner_v_neon: 128.8
vp8_loop_filter16y_v_c: 721.8
vp8_loop_filter16y_v_neon: 154.3
vp8_loop_filter_simple_h_c: 387.8
vp8_loop_filter_simple_h_neon: 187.6
vp8_loop_filter_simple_v_c: 384.1
vp8_loop_filter_simple_v_neon: 78.6
vp8_put_epel8_h4v4_c: 3971.1
vp8_put_epel8_h4v4_neon: 855.1
vp8_put_epel8_h4v6_c: 5060.1
vp8_put_epel8_h4v6_neon: 989.6
vp8_put_epel8_h6v4_c: 4320.8
vp8_put_epel8_h6v4_neon: 1007.3
vp8_put_epel8_h6v6_c: 5449.3
vp8_put_epel8_h6v6_neon: 1158.1
vp8_put_epel16_h6_c: 6683.8
vp8_put_epel16_h6_neon: 831.8
vp8_put_epel16_h6v6_c: 11110.8
vp8_put_epel16_h6v6_neon: 2214.8
vp8_put_epel16_v6_c: 7024.8
vp8_put_epel16_v6_neon: 799.6
vp8_put_pixels8_c: 112.8
vp8_put_pixels8_neon: 78.1
vp8_put_pixels16_c: 131.3
vp8_put_pixels16_neon: 129.8

This contains a fix to include guards by Carl Eugen Hoyos.

Signed-off-by: Martin Storsjö <martin@martin.st>
2026-04-20 20:05:29 +08:00
openvela-robot c9bf4df9a2 avcodec/cuviddec: Add support for decoding HEVC 4:4:4 content
This is the equivalent change for cuviddec after the previous change
for nvdec. I made similar changes to the copying routines to handle
pixel formats in a more generic way.

Note that unlike with nvdec, there is no confusion about the ability
of a codec to output 444 formats. This is because the cuvid parser is
used, meaning that 444 JPEG content is still indicated as using a 420
output format.
2026-04-20 20:05:25 +08:00
openvela-robot 072316a06e tests: Convert image2pipe tests to non-legacy test scripts 2026-04-20 20:05:22 +08:00
openvela-robot 915de33032 avcodec/hevc_ps: Expose all SPS and PPS range extension flags
We need all the flags to be exposed to be able to pass them on to
HW decoders. I did not attempt to nuance any of the warnings about
flags being unsupported as there's no way, at the point we extract
flags, to say whether an HW decoder is being used.
2026-04-20 20:05:18 +08:00
openvela-robot 82b771b005 build: Rename OBJDIRS variable to OUTDIRS
These directories are not just for object files.
2026-04-20 20:05:15 +08:00
openvela-robot 02e4cfb88f tests/api/api-h264-test: Add AV_NOPTS_VALUE check for AVFrame.pkt_dts/pts
Use av_ts2str() for AVFrame.pkt_dts/pts to avoid print the
pkt_dts/pts as negative number like:
"0,    3616613, -9223372036854775808,     1001,  3110400, 0x75e37a65"

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Jun Zhao <mypopydev@gmail.com>
2026-04-20 20:05:11 +08:00
openvela-robot e81ab92a8c srt: Set srto_sender flag to sender srt socket
SRT API Documentation:
This flag is superfluous if both parties are at least version 1.3.0
(this shall be enforced by setting this value to SRTO_MINVERSION if
you expect that it be true) and therefore support HSv5 handshake,
where the SRT extended handshake is done with the overall handshake
process.

This flag is however obligatory if at least one party may be using
SRT below version 1.3.0 and does not support HSv5.
2026-04-20 20:05:08 +08:00
openvela-robot 60228adbd0 avcodec: add ARBC decoder
Thanks Kostya for great help in reversing binary.
2026-04-20 20:04:59 +08:00
openvela-robot 19c9003c2e h264/x86: sign extend int stride in deblock functions
Fixes checkasm errors after adding the h264 deblock tests.
2026-04-20 20:04:56 +08:00
openvela-robot b32b1dc31f h2645_parse: Make ff_h2645_packet_split reference-compatible
This is in preparation for a patch for cbs_h2645. Now the packet's
rbsp_buffer can be owned by an AVBuffer.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@googlemail.com>
2026-04-20 20:04:45 +08:00
openvela-robot 01716fe34a avcodec/libdav1d: properly free all output picture references
Dav1dPictures contain more than one buffer reference, so we're forced to use the
API properly to free them all.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-04-20 20:04:37 +08:00
openvela-robot 2cb18a564f avformat/utils: add support for reading ID3 tags at start of wav
Fixes #4140.
2026-04-20 20:04:09 +08:00
openvela-robot 51cfd36764 libdav1d: update API usage to the first stable release
The color fields were moved to another struct, and a way to propagate
timestamps and other input metadata was introduced, so the packet
fifo can be removed.

Add support for 12bit streams, an option to disable film grain, and
read the profile from the sequence header referenced by the ouput
picture instead of guessing based on output pix_fmt.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-04-20 20:04:06 +08:00
openvela-robot 0fe013bb01 avutil/hwcontext_cuda: Define and use common CHECK_CU()
We have a pattern of wrapping CUDA calls to print errors and
normalise return values that is used in a couple of places. To
avoid duplication and increase consistency, let's put the wrapper
implementation in a shared place and use it everywhere.

Affects:

* avcodec/cuviddec
* avcodec/nvdec
* avcodec/nvenc
* avfilter/vf_scale_cuda
* avfilter/vf_scale_npp
* avfilter/vf_thumbnail_cuda
* avfilter/vf_transpose_npp
* avfilter/vf_yadif_cuda
2026-04-20 20:03:45 +08:00
openvela-robot 0862568f69 libdav1d: fix build after a recent API break
Signed-off-by: James Almer <jamrial@gmail.com>
2026-04-20 20:03:42 +08:00
openvela-robot f754ef6f7c avfilter/avf_showspectrum: improve magma colors 2026-04-20 20:03:34 +08:00
openvela-robot ab457c1150 pixfmt: Add GRAY10
Based on 7471352f by Luca Barbato.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-04-20 20:03:31 +08:00
openvela-robot 84f049ebfa libavutil: Undeprecate the AVFrame reordered_opaque field
This was marked as deprecated (but only in the doxygen, not with an
actual deprecation attribute) in 81c623fae0 in 2011, but was
undeprecated in ad1ee5fa7.

Signed-off-by: Martin Storsjö <martin@martin.st>
2026-04-20 20:03:27 +08:00
openvela-robot 1c03272fcd libavutil: Undeprecate the AVFrame reordered_opaque field
This was marked as deprecated (but only in the doxygen, not with an
actual deprecation attribute) in 81c623fae0 in 2011, but was
undeprecated in ad1ee5fa7.

Signed-off-by: Martin Storsjö <martin@martin.st>
2026-04-20 20:03:24 +08:00
openvela-robot 04189dd1be tests/api-h264-slice-test: use the correct function to free the AVHashContext
Fixes memleaks.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-04-20 20:03:15 +08:00
openvela-robot 2ce8e6cae4 Revert "decode: copy the output parameters from the last bsf in the chain back to the AVCodecContext"
This reverts commit 662558f985.

The avcodec_parameters_to_context() call was freeing and reallocating
AVCodecContext->extradata, essentially taking ownership of it, which according
to the doxy is user owned. This is an API break and has produces crashes in
some library users like Firefox.
Revert until a better solution is found to internally propagate the filtered
extradata back into the decoder context.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-04-20 20:03:12 +08:00
openvela-robot bddaa5ca6c avcodec/aacdec_template: Allow duplicated elements
Such streams are invalid according to
4.5.2.1 Top level payloads for the audio object types AAC main, AAC SSR, AAC LC and AAC LTP
4.5.2.1.1 Definitions
...cIn the raw_data_block(), several instances of the
same syntactic element may occur, but must have a different 4 bit
element_instance_tag, except for data_stream_element()'s and
fill_element()'s.

Fixes: Ticket7477

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-04-20 20:03:00 +08:00
openvela-robot 8bbb4980a3 avcodec/libaomenc: remove AVOption related to frame partitions
Support for it was apparently never in the codebase, and the enum
value was recently removed from the public headers [1]

[1] https://aomedia.googlesource.com/aom/+/df4ffb73140fe31bebdabd17c1a7b53721e74838

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2026-04-20 20:02:57 +08:00
openvela-robot dc574c4272 libavformat/ty: use decimal constant for shift
This was the only case in the source that uses a hexadecimal shift value.
The change removed a special case in respect to greping

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-04-20 20:02:51 +08:00
openvela-robot e929f09c1b avcodec/extract_extradata: Zero-initialize the padding bytes in all allocated buffers
Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2026-04-20 20:02:48 +08:00
openvela-robot 5572bfdb2d avfilter/af_afir: make IR gain control more flexible
For this reason introduce two more options.
2026-04-20 20:02:31 +08:00
openvela-robot 98cb664887 avcodec/bsf: Add ff_bsf_get_packet_ref() function
Use of this function can save unnecessary malloc operation
in bitstream filter.

Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2026-04-20 20:02:27 +08:00
openvela-robot e2ec5988c6 Merge commit 'a2041a6522642859ce64af1c618d6fb90a50d4af'
* commit 'a2041a6522642859ce64af1c618d6fb90a50d4af':
  qsvenc: AV_PIX_FMT_QSV path should release frame

Merged-by: James Almer <jamrial@gmail.com>
2026-04-20 20:02:15 +08:00
openvela-robot b1da717a56 qsvenc: AV_PIX_FMT_QSV path should release frame
Fixes high memory usage and prevents over allocation of the frames via
proper unref.

Can be checked as:
-hwaccel qsv -c:v h264_qsv -i ../h264-conformance/CANL2_Sony_E.jsv -c:v
h264_qsv -b:v 2000k -y qsv.mp4
2026-04-20 20:02:12 +08:00
openvela-robot aa2f85dcec fate: add 10-bit test for hue video filter
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
2026-04-20 20:01:14 +08:00
openvela-robot e2c904db0e network: Add RFC 8305 style "Happy Eyeballs"/"Fast Fallback" helper function
For cases with dual stack (IPv4 + IPv6) connectivity, but where one
stack potentially is less reliable, strive to trying to connect over
both protocols in parallel, using whichever address connected first.

In cases with a hostname resolving to multiple IPv4 and IPv6
addresses, the current connection mechanism would try all addresses
in the order returned by getaddrinfo (with all IPv6 addresses ordered
before the IPv4 addresses normally). If connection attempts to the
IPv6 addresses return quickly with an error, this was no problem, but
if they were unsuccessful leading up to timeouts, the connection process
would have to wait for timeouts on all IPv6 target addresses before
attempting any IPv4 address.

Similar to what RFC 8305 suggests, reorder the list of addresses to
try connecting to, interleaving address families. After starting one
connection attempt, start another one in parallel after a small delay
(200 ms as suggested by the RFC).

For cases with unreliable IPv6 but reliable IPv4, this should make
connection attempts work as reliably as with plain IPv4, with only an
extra 200 ms of connection delay.

Signed-off-by: Martin Storsjö <martin@martin.st>
2026-04-20 20:01:11 +08:00
openvela-robot fe63be9e22 avcodec/av1_parse: take trailing bits into account when initializing the GetBitContext
Also only initialize it in ff_av1_packet_split() and not ff_av1_extract_obu(),
same as h2645_parse, so GetBitContext specific failures may not affect the
latter.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-04-20 20:01:01 +08:00
openvela-robot d815975b4e bsf: add a flushing mechanism to AVBSFContext
Meant to reset the internal bsf state without the need to reinitialize it.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-04-20 20:00:58 +08:00
openvela-robot f63401a884 avutil/encryption_info: Fix size calculation.
Found by Chrome's ClusterFuzz: https://crbug.com/873693

Signed-off-by: Jacob Trimble <modmaker@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-04-20 20:00:53 +08:00
openvela-robot e4d06a57e6 http: pass return code from http_open_cnx_internal() on its failure
Previously, AVERROR(EIO) was returned on failure of
http_open_cnx_internal(). Now the value is passed to upper level, thus
it is possible to distinguish ECONNREFUSED, ETIMEDOUT, ENETUNREACH etc.

Signed-off-by: Martin Storsjö <martin@martin.st>
2026-04-20 20:00:50 +08:00
openvela-robot 575425daed lavc/qsvenc: expose qp of encoded frames
Requirement from ticket #7254.
Currently only H264 supported by MSDK.

Signed-off-by: Zhong Li <zhong.li@intel.com>
2026-04-20 20:00:44 +08:00
openvela-robot 901b964121 qsv: enforcing continuous memory layout
we need to make sure that memory allocation for Y/UV planes is continuous and re-used from a
pool

Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
2026-04-20 20:00:42 +08:00
openvela-robot faee3b16b2 avcodec/libaomenc: correct range for cpu-used
Valid range is [0,8] as stated in aom.git:aom/aomcx.h

Fixes #7343
2026-04-20 20:00:38 +08:00
openvela-robot 9f9c644593 frame: Simplify the video allocation 2026-04-20 20:00:36 +08:00
openvela-robot 4a1b5b9c88 avcodec/av1_parse: check for OBU header overread
Signed-off-by: James Almer <jamrial@gmail.com>
2026-04-20 20:00:31 +08:00
openvela-robot ba0aeb4aea avconv: make sure packets put into the muxing FIFO are refcounted
Some callers (like do_subtitle_out(), or do_streamcopy()) call this
with an AVPacket that is not refcounted. This can cause undefined
behavior.

Calling av_packet_move_ref() does not make a packet refcounted if it
isn't yet. (And it can't be made to, because it always succeeds,
and can't return ENOMEM.)

Call av_packet_ref() instead to make sure it's refcounted.

Cc: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2026-04-20 20:00:28 +08:00
openvela-robot f2861be1ec lavf/tcp: add option to setting Maximum Segment Size
This can change the the MSS value announced to the other end in
the initial TCP packet, it's can be used when failed Path MTU
discovery.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
2026-04-20 20:00:18 +08:00
openvela-robot 159fccafa4 avcodec/qsv: fix async support
Current implementations of qsv components incorrectly work with async level, they
actually try to work in async+1 level stepping into MFX_WRN_DEVICE_BUSY and polling
loop. This change address this misbehaviour.

Signed-off-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
Cc: Maxym Dmytrychenko <maxim.d33@gmail.com>
Cc: Zhong Li <zhong.li@intel.com>
Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
2026-04-20 20:00:11 +08:00
openvela-robot 2496eb4338 libavformat/yuv4mpeg: Add color range support for Y4M Add color_range support in Y4M.
Set pixel format and color_range for YUVJ pixel formats. Also set
color_range based on AVFormatContext.

Signed-off-by: Wang Cao <wangcao@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-04-20 19:59:58 +08:00
openvela-robot cbaba4384f configure: fix inline asm checks
Commit 8c893aa3cd removed quotes that were required to detect
inline asm:

check_insn armv5te qadd r0, r0, r0
.../test.c:1:34: error: expected string literal in 'asm'
void foo(void){ __asm__ volatile(qadd r0, r0, r0); }

The correct code is:

void foo(void){ __asm__ volatile("qadd r0, r0, r0"); }

Commit message written by Frank Liberato <liberato@chromium.org>

Signed-off-by: Martin Storsjö <martin@martin.st>
2026-04-20 19:59:55 +08:00
openvela-robot 63f3a69638 avdevice/decklink_dec: use a custom memory allocator
The default memory allocator is limited in the max number of frames available,
and therefore caused frame drops if the frames were not freed fast enough.

Signed-off-by: Marton Balint <cus@passwd.hu>
2026-04-20 19:59:43 +08:00
openvela-robot cc4e110e34 qsvenc: remove vcm option on Linux
1. vcm mode is only available for H264.
2. vcm is not supported on Linux, but it is shown when run "./avconv -h
encoder=h264_qsv |grep vcm". This shouldn't happen.

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
2026-04-20 19:59:40 +08:00
openvela-robot 1ea213be26 fftools/ffmpeg: fix for all forced key frames when 'copyts' is enabled
Forced key frames generation functionality was assuming the first PTS
value as zero, but, when 'copyts' is enabled, the first PTS can be any
big number. This was eventually forcing all the frames as key frames.
To resolve this issue, update has been made to use first input pts as
reference pts.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-04-20 19:59:25 +08:00
openvela-robot 04ff6f1282 avformat/libsrt: add latency options and deprecate tspbdelay
Signed-off-by: Sven Dueking <sven.dueking@nablet.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2026-04-20 19:59:20 +08:00
openvela-robot 45a8316949 mov: Properly abide by the track's media duration
The track's media duration from the mdhd atom takes precedence
over both the stts and elst atom for calculating and setting
the track's total duraion.

Technically, we shouldn't be using the stts atom at all for
calculating stream durations.

This fixes incorrect stream and final packet durations on files
with edit lists that are longer than the media duration.

The FATE changes are expected, and output is more correct (the
AAC frame is not 1028 samples).

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2026-04-20 19:58:50 +08:00
openvela-robot b7a8f4bb1a tls_mbedtls: Use non-deprecated header file
/usr/include/mbedtls/net.h:29:2: warning: #warning "Deprecated header file: Superseded by mbedtls/net_sockets.h" [-Wcpp]
2026-04-20 19:58:47 +08:00
openvela-robot e91bf4a968 make swresample optional for ffmpeg
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2026-04-20 19:58:42 +08:00
openvela-robot 0aca94cc1d libavformat: add mbedTLS based TLS
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2026-04-20 19:58:39 +08:00
openvela-robot dea16945ab avformat/utils: ignore outlier durations on subtitle/data streams as well
Similar to 4c9c4fe8b2, but for durations. This fixes #7151, where
the report duration and bitrate on a mpegts stream is wildly off
due to the dvb_teletext stream's timings.

Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-04-20 19:58:34 +08:00
openvela-robot 48873a1037 build: Group external library protocols separately 2026-04-20 19:58:31 +08:00
openvela-robot c13346fe21 avformat/mov: Fix memory leak in encryption info.
Signed-off-by: Jacob Trimble <modmaker@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-04-20 19:58:27 +08:00
openvela-robot 8c8f039891 amfenc: Retain a reference to D3D frames used as input during the encoding process
This fixes frame corruption issue when decoder started reusing frames
while they are still in use of encoding process

Issue with frame corruption  was reproduced using:

    avconv.exe -y -hwaccel d3d11va -hwaccel_output_format d3d11 -i input.h264 -an -c:v h264_amf output.mkv

It is recommended to use -extra_hw_frames 16 option in case if hw frames
number in pool is not enough

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2026-04-20 19:58:25 +08:00
openvela-robot 08bdcf9dfb configure: fix clang-cl check in the MSVC section
Without properly grouping the checks, the second test would execute for
MSVC cl.exe, which results in configure getting stuck since cl.exe -? is
an interactive paginated help screen, waiting for input.
2026-04-20 19:58:21 +08:00
openvela-robot f80bf8679c random_seed: use bcrypt instead of the old wincrypt API
Remove the wincrypt API calls since we don't support XP anymore and
bcrypt is available since Vista, even on Windows Store builds.

Signed-off-by: Martin Storsjö <martin@martin.st>
2026-04-20 19:58:19 +08:00
openvela-robot 79f6878313 avformat/hlsenc: avformat/hlsenc: add error message for encrypt fmp4 mode
and refine the warning message when use both hls_key_info_file and hls_enc

Reviewed-by: Gyan Doshi <ffmpeg@gyani.pro>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2026-04-20 19:58:12 +08:00
openvela-robot 1c2cdb0c2b x86: Don't declare a non-static function as inline
This fixes building with clang in msvc mode, which does support
gcc style inline assembly.
2026-04-20 19:58:09 +08:00
openvela-robot e635fa13f5 lavf/segafilmenc: Do not mix variable declaration and code.
Fixes two warnings: ISO C90 forbids mixed declarations and code
2026-04-20 19:57:52 +08:00
openvela-robot 0ebb1b65b5 avprobe: Support printing strings with empty keys 2026-04-20 19:57:49 +08:00
openvela-robot 311a80e3db avcodec/movtextdec: Check style_start/end
Limits based on 3GPP TS 26.245 V14.0.0
Fixes: Timeout
Fixes: 6377/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MOVTEXT_fuzzer-5175929115508736

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-04-20 19:57:46 +08:00
openvela-robot f3fa27898a lavc/qsvdec: expose frame pic_type and key_frame
Currently pict_type and key_frame are unset.
Add an extra param to fetch the picture type from qsv decoder

The judgement “key frame is equal to IDR frame” only suitable for H264.
For HEVC, all IRAP frames are key frames, and other codecs have no IDR
frame.

Signed-off-by: ChaoX A Liu <chaox.a.liu@intel.com>
Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
2026-04-20 19:57:43 +08:00
openvela-robot 947a7eb87d avcodec/decode: fix warning when decoding pseudo paletted formats
The pseudo palette allocation is optional now. But if it's still
allocated (like the internal get_buffer2 implementation does, for
compatibility), it shouldn't print a warning.
2026-04-20 19:57:38 +08:00
openvela-robot 2e1f06c164 libaom: remove references to RGB pixfmts
Support for it was apparently never in the codebase, and the enum
values were recently removed from the public headers [1]

Fixes build with latest libaom build.

[1] https://aomedia.googlesource.com/aom/+/3f29cc20e3a4c348cb41a797c68de856ddb84e12

Signed-off-by: James Almer <jamrial@gmail.com>
2026-04-20 19:57:35 +08:00
openvela-robot b9d95d3a91 avfilter: bump version for the latest API change
And fix the entry in doc/APIchanges

Signed-off-by: James Almer <jamrial@gmail.com>
2026-04-20 19:57:29 +08:00
openvela-robot 6c9c17b6ac libaom: remove references to yuv440p pixfmt
Support for it was apparently never in the codebase, and the enum
values were recently removed from the public headers [1]

Fixes build with latest libaom build.

[1] https://aomedia.googlesource.com/aom/+/2e3cd5c5c30fa02134681cda900c32486807af3f

Signed-off-by: James Almer <jamrial@gmail.com>
2026-04-20 19:57:26 +08:00
openvela-robot 3e84f66987 avcodec/ac3: fix out of array access introduced previously
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2026-04-20 19:57:17 +08:00
openvela-robot 34da0a25ed configure: Revert some incorrect uses of check_cc() 2026-04-20 19:57:14 +08:00
openvela-robot ffa572f358 avcodec/libaomenc: minor cosmetics
Signed-off-by: James Almer <jamrial@gmail.com>
2026-04-20 19:56:59 +08:00
openvela-robot 5bd9cf1d37 avcodec: rename the AV1 profiles
Use the proper names instead of numbers

Signed-off-by: James Almer <jamrial@gmail.com>
2026-04-20 19:56:56 +08:00
openvela-robot 9255782c27 Merge commit '9c37d765ef28b027414f86b0088b0c282a3c46d8'
* commit '9c37d765ef28b027414f86b0088b0c282a3c46d8':
  configure: Add check_cc/require_cc helper functions to simplify some expressions

Merged-by: James Almer <jamrial@gmail.com>
2026-04-20 19:56:44 +08:00
openvela-robot bdc805ea04 Add Haivision SRT protocol
The protocol requires libsrt (https://github.com/Haivision/srt) to be
installed

Signed-off-by: Sven Dueking <sven.dueking@nablet.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2026-04-20 19:56:42 +08:00
openvela-robot f892a1b690 avcodec/avpacket: remove unnecessary check in av_packet_make_writable()
Zero sized packets are already handled below in the function.
This is more in line with av_packet_ref().

Signed-off-by: James Almer <jamrial@gmail.com>
2026-04-20 19:56:38 +08:00
openvela-robot 2efd420673 configure: Drop unused helper function test_cflags_cpp() 2026-04-20 19:56:34 +08:00
openvela-robot 0bcf7151fb libavfilter: Add OpenCL convolution filter
Behaves like existing convolution filter.

Signed-off-by: Mark Thompson <sw@jkqxz.net>
2026-04-20 19:56:28 +08:00
openvela-robot 7badc4e7b8 configure: Document available options for the --toolchain parameter 2026-04-20 19:56:22 +08:00
openvela-robot 8b3c1291db libavformat/dashenc: Option to set timeout for socket I/O operation 2026-04-20 19:56:11 +08:00
openvela-robot 40f50cc4aa configure: Don't assume a 16 byte aligned stack on BSDs on i386
With GCC, request it to maintain 16 byte alignment, and the existing
entry points already align it via attribute_align_arg.

With clang, do the same as for mingw; disable the aligned stack
and let the assembly functions that require it do the alignment
instead.

Signed-off-by: Martin Storsjö <martin@martin.st>
2026-04-20 19:56:08 +08:00
openvela-robot d07a6f35fc cmdutils: remove a superfluous line break
Signed-off-by: James Almer <jamrial@gmail.com>
2026-04-20 19:56:03 +08:00
openvela-robot b7c124a960 qsvenc: add the Access Unit Delimiter NAL Unit support
Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2026-04-20 19:56:00 +08:00
openvela-robot 43af9ebba5 avcodec/hap : move parse_section_header to hap.c in order to be use by new bsf filter 2026-04-20 19:55:52 +08:00
openvela-robot dd7a3c0269 configure: Don't assume an aligned stack on clang on windows
If we'd enable a 16 byte aligned stack, clang/llvm would also assume
that alignment everywhere and produce code that strictly requires it.
That would require adding realignment (via attribute_align_arg) on every
single public library function or enable -mstackrealign (which does the
same on every single function).

Also relatedly; the parameter currently tested (-mllvm
-stack-alignment=16) hasn't actually been supported for quite some
time; current clang versions use -mstack-alignment=16 for the same.
Actually testing for that parameter would be a different change
though, since it has a real risk of changing behaviour on any other
platform where clang is used.

Signed-off-by: Martin Storsjö <martin@martin.st>
2026-04-20 19:55:49 +08:00
openvela-robot 2d0628bde6 avformat/hlsenc: fix for zero EXTINF tag duration
This is the fix for bug https://trac.ffmpeg.org/ticket/7073

Tested-by: Brainiarc7
Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
2026-04-20 19:55:46 +08:00
openvela-robot c5dcd5b1c7 Support AV1 encoding using libaom 2026-04-20 19:55:43 +08:00
openvela-robot f5c4f4b3be avcodec/mediacodecdec: add debug logging around hw buffer lifecycle
Some Android devices are very finicky about how quicky output buffers
are returned back to the decoder, especially when they are associated
with a Surface.

This commit adds a new counter that keeps track of exactly how many hw
output buffers are being retained by the user, along with DEBUG level
logging that makes it easy to track the lifecycle of these buffers.

Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
2026-04-20 19:55:40 +08:00
openvela-robot 8e157a7361 ivf: Support VP9 and AV1 as well 2026-04-20 19:55:37 +08:00
openvela-robot 42f3cffc2e lavc/videotoolbox: fix threaded decoding
AVHWAccel.end_frame can run on a worker thread. The assumption of the
frame threading code is that the worker thread will change the AVFrame
image data, not the AVFrame fields. So the AVFrame fields are not synced
back to the main thread. But this breaks videotoolbox due to its special
requirements (everything else is fine). It actually wants to update
AVFrame fields.

The actual videotoolbox frame is now stored in the dummy AVBufferRef, so
it mimics what happens in non-videotoolbox cases. (Changing the
AVBufferRef contents is a bit like changing the image data.) The
post_process callback copies that reference to the proper AVFrame field.

Based on a patch by wm4.

Signed-off-by: Aman Gupta <aman@tmm1.net>
2026-04-20 19:55:32 +08:00
openvela-robot 73dcb226d1 configure: Restore original endianness test
Previously the bit pattern for the endianness test was declared as a
global, instead of a local, variable. This ensures that the pattern
appears unchanged in the object file and is not optimized out.
2026-04-20 19:55:29 +08:00
openvela-robot 6e173f5d36 avcodec/aacdec: log configuration change details
Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-04-20 19:55:25 +08:00
openvela-robot 2cd9749bda configure: Fix logic of AMF external library check
Fail if AMF is requested but unavailable, as we do for all
other external libraries that need to be explicitly enabled.
2026-04-20 19:55:22 +08:00
openvela-robot 1b1e7f8e74 avcodec/mediacodec_wrapper: fix false positives in swdec blacklist
'OMX.SEC.avc.dec' is a valid hardware decoder, while the decoders
we seek to blacklist all match 'OMX.SEC.*.sw.dec'.
2026-04-20 19:55:19 +08:00
openvela-robot dc0da53272 examples: Use new API for transcoding example
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2026-04-20 19:55:16 +08:00
openvela-robot d79fed1d40 avcodec/mediacodec_wrapper: blacklist more software decoders
Additionally blacklist ffmpeg, Samsung and Qualcomm
software implementations offered through MediaCodec.

Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
2026-04-20 19:55:12 +08:00
openvela-robot ef941d04ed hls: Add a discontinuity marker on recover
It seems to improve the compatibility with the js demuxers.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2026-04-20 19:55:10 +08:00
openvela-robot 1c2a54310c avformat/dashenc: add option to change HTTP method 2026-04-20 19:54:59 +08:00
openvela-robot 8e220aa68d fate: Error out more gracefully on configure failure
If configure fails before config.fate is generated, the report file misses
some values and gets discarded by the FATE server. In these cases, print
those values as "failed" along with the failing configure command line.
2026-04-20 19:54:56 +08:00
openvela-robot fcc3fe47f3 Merge commit '2651352988212531038326c44754ece1728c4a3b'
* commit '2651352988212531038326c44754ece1728c4a3b':
  cbs: Allocate the context inside the init function

This commit is a noop, see 6734eef6b8

Merged-by: Mark Thompson <sw@jkqxz.net>
2026-04-20 19:54:34 +08:00
openvela-robot 7e49adfbc3 cbs: Allocate the context inside the init function
... instead of making callers allocate it themselves.  This is more
consistent with other APIs in libav.
2026-04-20 19:54:30 +08:00
openvela-robot 3448c84a04 avcodec/mediacodecdec: refactor to take advantage of new decoding api
This refactor splits up the main mediacodec decode loop into two
send/receive helpers, which are then used to rewrite the receive_frame
callback and take full advantage of the new decoding api. Since we
can now request packets on demand with ff_decode_get_packet(), the
fifo buffer is no longer necessary and has been removed.

This change was motivated by behavior observed on certain Android TV
devices, featuring hardware mpeg2/h264 decoders which also deinterlace
content (to produce multiple frames per field). Previously, this code
caused buffering issues because queueInputBuffer() was always invoked
before each dequeueOutputBuffer(), even though twice as many output
buffers were being generated.

With this patch, the decoder will always attempt to drain new frames
first before sending more data into the underlying codec.

Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
2026-04-20 19:54:24 +08:00
openvela-robot d7e2623a60 Revert "configure: Stop using dlltool to create an import library"
This reverts commit 67c72f08a4.

While the linker produced import libraries might work with MSVC in
simple test cases, they don't if e.g. linking to multiple GNU ld
produced import libraries at the same time. (They end up importing
functions from the wrong libraries.) The ones produced by dlltool
work fine though.

This issue was pointed out by Hendrik Leppkes.

Signed-off-by: Martin Storsjö <martin@martin.st>
2026-04-20 19:54:22 +08:00
openvela-robot 9b45b98e10 h264_idct: enable unmacro on newer NASM versions
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2026-04-20 19:54:05 +08:00
openvela-robot 320af4b0da avcodec/vc1dec: fix mby_start for interlaced content
Bug-Id: 1100
Bug-Id: ffmpeg/Ticket2531
Cc: libav-stable@libav.org
2026-04-20 19:54:02 +08:00
openvela-robot 95825d3085 Merge commit '6829a079444e10818a847e153121fb458cc5c0a8'
* commit '6829a079444e10818a847e153121fb458cc5c0a8':
  qsvdec: Relax the surface vs coded dimension check

Merged-by: James Almer <jamrial@gmail.com>
2026-04-20 19:53:50 +08:00
openvela-robot 5e6a2149c6 lavc/qsv: default la_ds to MFX_LOOKAHEAD_DS_UNKNOWN
MFX_LOOKAHEAD_DS_UNKNOWN means auto.
-1 is not a valid value.

Signed-off-by: Ruiling Song <ruiling.song@intel.com>
Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
2026-04-20 19:53:48 +08:00
openvela-robot 5f7cf2031d fate/libavcodec: add codec_desc test
Remove runtime check at codec_desc.c

Reviewed-by: wm4 <nfxjfg@googlemail.com>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2026-04-20 19:53:45 +08:00
openvela-robot 11800e5ce0 lavc: Add support for increasing hardware frame pool sizes
AVCodecContext.extra_hw_frames is added to the size of hardware frame
pools created by libavcodec for APIs which require fixed-size pools.
This allows the user to keep references to a greater number of frames
after decode, which may be necessary for some use-cases.

It is also added to the initial_pool_size value returned by
avcodec_get_hw_frames_parameters() if a fixed-size pool is required.
2026-04-20 19:53:42 +08:00
openvela-robot c45b913aac lavc: add new API for iterating codecs and codec parsers
Based on an unfinished patch by atomnuker.
2026-04-20 19:53:35 +08:00
openvela-robot d2c59c1ae4 configure: Simplify restrict keyword handling
Skip a variable indirection and only redefine restrict if necessary.
2026-04-20 19:53:33 +08:00
openvela-robot 220feab5f9 rtsp: rename certain options after a deprecation period
The "timeout" option name inherently clashes with the meaning of the
HTTP libavformat protocol option with the same name. Rename it after a
deprecation period to make it compatible with the HTTP one.
2026-04-20 19:53:29 +08:00
openvela-robot 8727fa1d3e hwcontext: Fix documentation for av_hwdevice_ctx_alloc()
From ffmpeg commit 9365dfcbf6.

Signed-off-by: Jun Zhao <jun.zhao@intel.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
2026-04-20 19:53:27 +08:00
openvela-robot 4756ac5c06 configure: update minimum required version of libvmaf
At least version 0.6.2 is needed since commit
df3222d4bb.

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2026-04-20 19:52:45 +08:00
openvela-robot 30f8a55e46 Add support for H.264 and HEVC hardware encoding for AMD GPUs based on AMF SDK
Requires AMF headers for at least version 1.4.4.1.

Signed-off-by: Mikhail Mironov <mikhail.mironov@amd.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2026-04-20 19:52:43 +08:00
openvela-robot 121d2753b3 configure: bump year
Happy new year!
2026-04-20 19:52:38 +08:00
openvela-robot f372382cc3 cmdutils: update copyright year to 2018 2026-04-20 19:52:35 +08:00
openvela-robot 2d445d4482 configure: add missing avcodec dep to avfilter for de/convolve filters 2026-04-20 19:52:28 +08:00
openvela-robot e9657caeb1 x264: Support version 153
It has native simultaneus 8 and 10 bit support.
2026-04-20 19:52:25 +08:00
openvela-robot 3e55220e8e avfilter/vf_psnr: add more gbrap formats
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2026-04-20 19:52:16 +08:00
openvela-robot 81675aa8ec mmaldec: Fix compilation after 2fcb0090
Signed-off-by: Martin Storsjö <martin@martin.st>
2026-04-20 19:52:13 +08:00
openvela-robot 121c408a70 configure: Fix case of static libmp3lame
Fixes #6918.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-04-20 19:52:10 +08:00
openvela-robot f7568e9bcb lavc: Add codec metadata to indicate hardware support 2026-04-20 19:52:07 +08:00