vf_dnn_processing.c and vf_dnn_detect.c both declare an uninitialized
DNNData model_input before using it. This commit initialize it.
Signed-off-by: younengxiao <steven.xiao@amd.com>
Add a new muxer option mpegts_pcr_pid that generates PCR on a dedicated
adaptation-field-only PID, separate from any elementary stream.
ISDB-T 1seg receivers require PCR on a standalone PID. When PCR shares
the video PID, these receivers acquire the service but refuse to decode
video and audio. This is standard practice in Japanese digital
terrestrial broadcasting per ARIB TR-B14.
When mpegts_pcr_pid is set to a valid PID value:
- PCR packets are generated as adaptation-field-only packets on the
specified PID at the interval set by pcr_period
- The video stream adaptation fields do not carry PCR flags
- The PMT PCR_PID field is set to the specified PID
When mpegts_pcr_pid is -1 (default): existing behavior is unchanged.
The existing mpegts_insert_pcr_only function is refactored into a
parameterized mpegts_insert_pcr_only_pid(s, pid, cc, discontinuity)
to avoid code duplication.
Fixes: https://code.ffmpeg.org/FFmpeg/FFmpeg/issues/23649
Signed-off-by: shadowcaster3 <vasyl.samoilov@gmail.com>
Use m aliases instead of xmm registers directly so that certain macros
can work (e.g. SWAP); likewise replace movdqa with mova
Signed-off-by: Zuxy Meng <zuxy.meng@gmail.com>
RTSP redirects retain URL credentials and authentication state when a
Location URI changes to another origin. This can forward reusable
credentials to a server with a different scheme, host, or port.
Clear the stored credentials and authentication state when the redirect
crosses an origin boundary. Preserve them for same-origin redirects.
Fixes: cross-origin credential disclosure
Fixes: rtsp_redirect_auth_leak_poc.py
Fixes: VaKaPOnfN02z
We only need the shuffle a byte in the lower quadword;
also notice that we don't need the clamping provided
by packuswb as these values are averages of byte values.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Avoids saving and restoring volatile xmm registers on Windows;
no change in benchmarks here (on Unix64).
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
The pred{8x8,16x16}_plane functions only use five xmm register.
The inflated number of seven (which leads to saving and restoring
xmm6 on Win64) has been introduced in
d20f133ef9, probably because
the mmx version of these functions used seven mmx register.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
The output stream no longer has Atmos metadata, so the
AV_PROFILE_TRUEHD_ATMOS profile, if it was set, is no longer valid.
Fixes issue #23195.
Signed-off-by: James Almer <jamrial@gmail.com>
The output stream no longer has Atmos metadata, so the
AV_PROFILE_EAC3_DDP_ATMOS profile, if it was set, is no longer valid.
Signed-off-by: James Almer <jamrial@gmail.com>
WebM VP8/VP9 alpha is a second bitstream attached via a Matroska
BlockAdditional element (BlockAddID 1). Only the libvpx wrapper
decoders merge it into the output frame; the native vp8/vp9 decoders
have no code path for it and silently return an opaque frame.
Warn once per decoder instance instead of failing silently, pointing
at the decoder that does support it. The av_log_once() state is
synchronized across frame-thread contexts to avoid duplicate warnings
with frame threading.
Reported in https://trac.ffmpeg.org/ticket/11165 and
https://github.com/renpy/renpy/issues/1402.
Signed-off-by: wangnov <wangnov6@gmail.com>
STTS sample deltas follow decode order, while AVPacket.duration is
defined as the interval to the next PTS in presentation order. Assigning
the deltas directly therefore produces incorrect packet durations for
VFR video with reordered frames.
After index construction and edit-list processing, sort samples by PTS
and set every duration with a following PTS from adjacent presentation
timestamps. This reorders STTS durations where possible and derives
intervals produced by the STTS/CTTS combination when necessary. Keep the
original timing table if allocation fails or timestamps are invalid.
Add FATE coverage for the official VFR H.264 sample and for a generated
MPEG-4 case whose presentation intervals are not a permutation of its
STTS deltas. Update the HEVC dts2pts CRA reference for the corrected
presentation-order durations.
Signed-off-by: panboxiaosa <panboxiaosa@gmail.com>
The check on variable subblock durations had an inverted comparison, rejecting valid multi-subblock parameters and failing to catch subblock durations exceeding the remaining time.
tls_open() installed a peer-identity target only when the URL host was
non-numeric. For a numeric-IP target the whole block was skipped, so
with verify=1 OpenSSL validated the chain to a trusted CA but bound no
identity, and any publicly-trusted certificate for any name was accepted
(e.g. tls://203.0.113.10?verify=1).
Run the identity block for every non-listening connection. Classify
s->host with the same getaddrinfo(AI_NUMERICHOST) rule tls.c uses. A
numeric host is pinned to the certificate's iPAddress SAN by handing
OpenSSL the parsed binary address via X509_VERIFY_PARAM_set1_ip();
everything else, including a verifyhost=<name> override, binds by name
via SSL_set1_host(). Passing the binary address rather than re-probing
the ASCII form pins legacy numeric spellings such as 2130706433 as IPs
instead of letting them fall back to hostname matching. SNI is still
suppressed for numeric transport hosts (RFC 6066 sec. 3) via
s->numerichost.
The identity target is installed unconditionally for non-listening
connections; whether the certificate is actually verified stays
controlled separately by SSL_CTX_set_verify() under s->verify, so
disabling verification keeps the prior behaviour. Sets AVERROR_EXTERNAL
with an explicit log line on failure.
dtls_open() sets s->is_dtls and then calls tls_open(), so DTLS client
connections run through the same identity block and are covered here.
Found-by: Claude (Anthropic). Human-verified and reported by
Omkhar Arasaratnam <omkhar@linkedin.com>.
Signed-off-by: Omkhar Arasaratnam <omkhar@linkedin.com>
When loading a TorchScript model that does not contain any learnable
parameters (e.g., a purely functional model), the Torch backend would
crash during inference. This occurred because the code attempted to
dereference the first iterator of the model's parameter list
`parameters().begin()` to determine the device, which results in
Undefined Behavior when the parameter list is empty.
This commit fixes the issue by determining the inference device directly
from the user-configured `ctx->device` string instead of probing the
model parameters, allowing parameterless models to execute safely.
Testing:
1. Generate a parameterless model:
cat << 'EOF' > generate_model.py
import torch
class DummyModel(torch.nn.Module):
def forward(self, x):
return x
scripted_model = torch.jit.script(DummyModel())
scripted_model.save("dummy_model.pt")
EOF
python3 generate_model.py
2. Run inference (previously crashed, now succeeds):
./ffmpeg -y -i input.mp4 -vf 'format=rgb24,dnn_processing=dnn_backend=torch:model=dummy_model.pt' -frames:v 5 -f null -
Signed-off-by: Raja Rathour <imraja729@gmail.com>
amf_init_filter_config() returned the hardware pixel format (e.g.
AV_PIX_FMT_D3D11) as in_format when the input link carries D3D11VA or
DXVA2 hw frames. av_av_to_amf_format() maps hw formats to
AMF_SURFACE_UNKNOWN, so every AMF filter failed its component Init()
with AMF_INVALID_ARG (VQEnhancer, FRC) or AMF_NOT_SUPPORTED
(Converter, HQScaler). Return the underlying software format instead,
which is already validated against AMF a few lines above. Apply the
same mapping to the default output sw format, which otherwise ends up
as the hw pixel format in hwframes_out->sw_format when the output link
uses a hwaccel format.
Fixes e.g.:
ffmpeg -hwaccel d3d11va -hwaccel_output_format d3d11 -i in.mp4 -vf frc_amf -c:v hevc_amf out.mp4
Note: with D3D11VA input, the compute-based components (VQEnhancer,
HQScaler, VideoConverter) additionally require decode textures created
with D3D11_BIND_SHADER_RESOURCE, e.g.:
-init_hw_device d3d11va=dx11:,SHADER=1 -hwaccel_device dx11
FRC and DXVA2 input work with default decode textures.
vtenc_cm_to_avpacket converts output CMSampleBuffer timestamps back
to codec timebase by dividing pts.value by avctx->time_base.num.
This relies on the output CMTime having the same timescale as the
one passed to VTCompressionSessionEncodeFrame. Apple does not
guarantee this, and the output timescale can differ from the input.
Use av_rescale_q with the actual CMTime timescale so that the
conversion is correct regardless of what timescale VideoToolbox
returns.
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
first_timestamp is taken from the first packet in mux order, which is
not necessarily the earliest timestamp in the segment. Lower it while
packets of that segment are still arriving, so the seek timeline is
anchored at the true segment start.
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Segment starts on the seek timeline are derived from EXTINF durations,
so the first keyframe of the target segment can have a slightly lower
DTS than the snapped seek position, in which case the packet discard
loop would skip it and resume playback one segment late. Make sure we
start at the very beginning of the stream in this case.
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Rebase the first packet's timestamp onto the start of the segment list
regardless of playlist type, and report it as start_time. Previously
only EVENT playlists did this and live streams took start_time from the
first loaded segment at the live edge. Which is not correct as some
servers provide very deep (hours even) time shift in live playlist. The
evicted segments are already tracked by EXT-X-MEDIA-SEQUENCE. This
allows us to use all available segments, not only the future ones on
live playlist.
Also prefer PTS over DTS, as EXTINF durations and start_time are
presentation time.
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Live (and EVENT) playlists are seekable within the currently known
segment list. Seeks before the list start clamp to the oldest segment,
past the end to the live edge. Live playlist can evict old segments, we
track that by reading EXT-X-MEDIA-SEQUENCE. Previusly the code assumed
that the live playlist, don't have past segments, however some servers
has very deep usable timeshift.
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Substream 0xa0 packets without the DVD-Video dynamic range control
marker byte were assumed to be MLP, while in DVD-Audio AOBs substream
0xa0 always carries LPCM (MLP uses 0xa1), so hi-res LPCM streams were
misdetected and decoded as garbage. Classify them as PCM_DVDA and keep
the private stream header in the packet for the decoder to parse, as
its length is variable and it carries the audio format.
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Decodes the LPCM variant found in DVD-Audio AOB streams. Unlike
DVD-Video LPCM it supports up to 192 kHz sample rates and splits
channels in two channel groups, which may use different quantization.
Samples are grouped in sets of 2 samples over all channels, with the
second channel group's data stored first within each set, as 16-bit
big-endian most significant parts followed by the remaining bits.
Based on information from expired US 6,580,671 patent et al.
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>