mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-09 00:10:00 +01:00
Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e0723b7e4e | ||
|
|
6fbd4d2285 | ||
|
|
fa511b03d3 | ||
|
|
5767941df8 | ||
|
|
e6584a3f19 | ||
|
|
e8a51675ea | ||
|
|
1c06f776e6 | ||
|
|
e95f80c8df | ||
|
|
6a78425604 | ||
|
|
288ef1939f | ||
|
|
cd894807fe | ||
|
|
22878e8177 | ||
|
|
d6a1e5980b | ||
|
|
83feded492 | ||
|
|
2720715dab | ||
|
|
e04cb59ecc | ||
|
|
b21d387d6f |
18
RELEASE_NOTES
Normal file
18
RELEASE_NOTES
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
┌────────────────────────────────────────────┐
|
||||
│ RELEASE NOTES for FFmpeg 5.1 "Riemann" LTS │
|
||||
└────────────────────────────────────────────┘
|
||||
|
||||
The FFmpeg Project proudly presents FFmpeg 5.1 "Riemann" LTS, about 6
|
||||
months after the release of FFmpeg 5.0, our first Long Term Support
|
||||
release. While several past FFmpeg releases have enjoyed long term
|
||||
support, this is the first release where such an intention is made
|
||||
clear at release.
|
||||
|
||||
A complete Changelog is available at the root of the project, and the
|
||||
complete Git history on https://git.ffmpeg.org/gitweb/ffmpeg.git
|
||||
|
||||
We hope you will like this release as much as we enjoyed working on it, and
|
||||
as usual, if you have any questions about it, or any FFmpeg related topic,
|
||||
feel free to join us on the #ffmpeg IRC channel (on irc.libera.chat) or ask
|
||||
on the mailing-lists.
|
||||
@@ -38,7 +38,7 @@ PROJECT_NAME = FFmpeg
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER =
|
||||
PROJECT_NUMBER = 5.1
|
||||
|
||||
# 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
|
||||
|
||||
@@ -518,6 +518,21 @@ see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1)
|
||||
Like the @code{-ss} option but relative to the "end of file". That is negative
|
||||
values are earlier in the file, 0 is at EOF.
|
||||
|
||||
@item -isync @var{input_index} (@emph{input})
|
||||
Assign an input as a sync source.
|
||||
|
||||
This will take the difference between the start times of the target and reference inputs and
|
||||
offset the timestamps of the target file by that difference. The source timestamps of the two
|
||||
inputs should derive from the same clock source for expected results. If @code{copyts} is set
|
||||
then @code{start_at_zero} must also be set. If either of the inputs has no starting timestamp
|
||||
then no sync adjustment is made.
|
||||
|
||||
Acceptable values are those that refer to a valid ffmpeg input index. If the sync reference is
|
||||
the target index itself or @var{-1}, then no adjustment is made to target timestamps. A sync
|
||||
reference may not itself be synced to any other input.
|
||||
|
||||
Default value is @var{-1}.
|
||||
|
||||
@item -itsoffset @var{offset} (@emph{input})
|
||||
Set the input time offset.
|
||||
|
||||
|
||||
@@ -118,6 +118,7 @@ typedef struct OptionsContext {
|
||||
float readrate;
|
||||
int accurate_seek;
|
||||
int thread_queue_size;
|
||||
int input_sync_ref;
|
||||
|
||||
SpecifierOpt *ts_scale;
|
||||
int nb_ts_scale;
|
||||
@@ -410,6 +411,7 @@ typedef struct InputFile {
|
||||
at the moment when looping happens */
|
||||
AVRational time_base; /* time base of the duration */
|
||||
int64_t input_ts_offset;
|
||||
int input_sync_ref;
|
||||
|
||||
int64_t ts_offset;
|
||||
int64_t last_ts;
|
||||
|
||||
@@ -235,6 +235,7 @@ static void init_options(OptionsContext *o)
|
||||
o->chapters_input_file = INT_MAX;
|
||||
o->accurate_seek = 1;
|
||||
o->thread_queue_size = -1;
|
||||
o->input_sync_ref = -1;
|
||||
}
|
||||
|
||||
static int show_hwaccels(void *optctx, const char *opt, const char *arg)
|
||||
@@ -287,6 +288,58 @@ static int parse_and_set_vsync(const char *arg, int *vsync_var, int file_idx, in
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int apply_sync_offsets(void)
|
||||
{
|
||||
for (int i = 0; i < nb_input_files; i++) {
|
||||
InputFile *ref, *self = input_files[i];
|
||||
int64_t adjustment;
|
||||
int64_t self_start_time, ref_start_time, self_seek_start, ref_seek_start;
|
||||
int start_times_set = 1;
|
||||
|
||||
if (self->input_sync_ref == -1 || self->input_sync_ref == i) continue;
|
||||
if (self->input_sync_ref >= nb_input_files || self->input_sync_ref < -1) {
|
||||
av_log(NULL, AV_LOG_FATAL, "-isync for input %d references non-existent input %d.\n", i, self->input_sync_ref);
|
||||
exit_program(1);
|
||||
}
|
||||
|
||||
if (copy_ts && !start_at_zero) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Use of -isync requires that start_at_zero be set if copyts is set.\n");
|
||||
exit_program(1);
|
||||
}
|
||||
|
||||
ref = input_files[self->input_sync_ref];
|
||||
if (ref->input_sync_ref != -1 && ref->input_sync_ref != self->input_sync_ref) {
|
||||
av_log(NULL, AV_LOG_ERROR, "-isync for input %d references a resynced input %d. Sync not set.\n", i, self->input_sync_ref);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (self->ctx->start_time_realtime != AV_NOPTS_VALUE && ref->ctx->start_time_realtime != AV_NOPTS_VALUE) {
|
||||
self_start_time = self->ctx->start_time_realtime;
|
||||
ref_start_time = ref->ctx->start_time_realtime;
|
||||
} else if (self->ctx->start_time != AV_NOPTS_VALUE && ref->ctx->start_time != AV_NOPTS_VALUE) {
|
||||
self_start_time = self->ctx->start_time;
|
||||
ref_start_time = ref->ctx->start_time;
|
||||
} else {
|
||||
start_times_set = 0;
|
||||
}
|
||||
|
||||
if (start_times_set) {
|
||||
self_seek_start = self->start_time == AV_NOPTS_VALUE ? 0 : self->start_time;
|
||||
ref_seek_start = ref->start_time == AV_NOPTS_VALUE ? 0 : ref->start_time;
|
||||
|
||||
adjustment = (self_start_time - ref_start_time) + !copy_ts*(self_seek_start - ref_seek_start) + ref->input_ts_offset;
|
||||
|
||||
self->ts_offset += adjustment;
|
||||
|
||||
av_log(NULL, AV_LOG_INFO, "Adjusted ts offset for Input #%d by %"PRId64" us to sync with Input #%d.\n", i, adjustment, self->input_sync_ref);
|
||||
} else {
|
||||
av_log(NULL, AV_LOG_INFO, "Unable to identify start times for Inputs #%d and %d both. No sync adjustment made.\n", i, self->input_sync_ref);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int opt_filter_threads(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
av_free(filter_nbthreads);
|
||||
@@ -1305,6 +1358,7 @@ static int open_input_file(OptionsContext *o, const char *filename)
|
||||
f->ist_index = nb_input_streams - ic->nb_streams;
|
||||
f->start_time = o->start_time;
|
||||
f->recording_time = o->recording_time;
|
||||
f->input_sync_ref = o->input_sync_ref;
|
||||
f->input_ts_offset = o->input_ts_offset;
|
||||
f->ts_offset = o->input_ts_offset - (copy_ts ? (start_at_zero && ic->start_time != AV_NOPTS_VALUE ? ic->start_time : 0) : timestamp);
|
||||
f->nb_streams = ic->nb_streams;
|
||||
@@ -3489,6 +3543,8 @@ int ffmpeg_parse_options(int argc, char **argv)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
apply_sync_offsets();
|
||||
|
||||
/* create the complex filtergraphs */
|
||||
ret = init_complex_filters();
|
||||
if (ret < 0) {
|
||||
@@ -3603,6 +3659,9 @@ const OptionDef options[] = {
|
||||
{ "accurate_seek", OPT_BOOL | OPT_OFFSET | OPT_EXPERT |
|
||||
OPT_INPUT, { .off = OFFSET(accurate_seek) },
|
||||
"enable/disable accurate seeking with -ss" },
|
||||
{ "isync", HAS_ARG | OPT_INT | OPT_OFFSET |
|
||||
OPT_EXPERT | OPT_INPUT, { .off = OFFSET(input_sync_ref) },
|
||||
"Indicate the input index for sync reference", "sync ref" },
|
||||
{ "itsoffset", HAS_ARG | OPT_TIME | OPT_OFFSET |
|
||||
OPT_EXPERT | OPT_INPUT, { .off = OFFSET(input_ts_offset) },
|
||||
"set the input ts offset", "time_off" },
|
||||
|
||||
@@ -1241,7 +1241,8 @@ static int decode_block(AVCodecContext *avctx, void *tdata,
|
||||
td->ysize = FFMIN(s->tile_attr.ySize, s->ydelta - tile_y * s->tile_attr.ySize);
|
||||
td->xsize = FFMIN(s->tile_attr.xSize, s->xdelta - tile_x * s->tile_attr.xSize);
|
||||
|
||||
if (td->xsize * (uint64_t)s->current_channel_offset > INT_MAX)
|
||||
if (td->xsize * (uint64_t)s->current_channel_offset > INT_MAX ||
|
||||
av_image_check_size2(td->xsize, td->ysize, s->avctx->max_pixels, AV_PIX_FMT_NONE, 0, s->avctx) < 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
td->channel_line_size = td->xsize * s->current_channel_offset;/* uncompress size of one line */
|
||||
@@ -1265,7 +1266,8 @@ static int decode_block(AVCodecContext *avctx, void *tdata,
|
||||
td->ysize = FFMIN(s->scan_lines_per_block, s->ymax - line + 1); /* s->ydelta - line ?? */
|
||||
td->xsize = s->xdelta;
|
||||
|
||||
if (td->xsize * (uint64_t)s->current_channel_offset > INT_MAX)
|
||||
if (td->xsize * (uint64_t)s->current_channel_offset > INT_MAX ||
|
||||
av_image_check_size2(td->xsize, td->ysize, s->avctx->max_pixels, AV_PIX_FMT_NONE, 0, s->avctx) < 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
td->channel_line_size = td->xsize * s->current_channel_offset;/* uncompress size of one line */
|
||||
|
||||
@@ -883,7 +883,14 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe,
|
||||
if (buf_size < avctx->width * avctx->height / (128*8))
|
||||
return AVERROR_INVALIDDATA;
|
||||
} else {
|
||||
if (buf_size < avctx->height / 8)
|
||||
int w = avctx->width;
|
||||
int s = 1 + w / (1<<23);
|
||||
|
||||
w /= s;
|
||||
|
||||
for (i = 0; w > (1<<ff_log2_run[i]); i++)
|
||||
w -= ff_log2_run[i];
|
||||
if (buf_size < (avctx->height + i + 6) / 8 * s)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
|
||||
@@ -143,11 +143,22 @@ static void copy_CTB(uint8_t *dst, const uint8_t *src, int width, int height,
|
||||
|
||||
if (((intptr_t)dst | (intptr_t)src | stride_dst | stride_src) & 15) {
|
||||
for (i = 0; i < height; i++) {
|
||||
for (j = 0; j < width; j+=8)
|
||||
for (j = 0; j < width - 7; j+=8)
|
||||
AV_COPY64U(dst+j, src+j);
|
||||
dst += stride_dst;
|
||||
src += stride_src;
|
||||
}
|
||||
if (width&7) {
|
||||
dst += ((width>>3)<<3) - stride_dst * height;
|
||||
src += ((width>>3)<<3) - stride_src * height;
|
||||
width &= 7;
|
||||
for (i = 0; i < height; i++) {
|
||||
for (j = 0; j < width; j++)
|
||||
dst[j] = src[j];
|
||||
dst += stride_dst;
|
||||
src += stride_src;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < height; i++) {
|
||||
for (j = 0; j < width; j+=16)
|
||||
|
||||
@@ -409,6 +409,9 @@ output_zeros:
|
||||
if (zero_run) {
|
||||
zero_run = 0;
|
||||
i += esc_count;
|
||||
if (i > end - dst ||
|
||||
i >= src_end - src)
|
||||
return AVERROR_INVALIDDATA;
|
||||
memcpy(dst, src, i);
|
||||
dst += i;
|
||||
l->zeros_rem = lag_calc_zero_run(src[i]);
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
*/
|
||||
|
||||
#include "libavutil/thread.h"
|
||||
#include "libavutil/imgutils.h"
|
||||
|
||||
#include "avcodec.h"
|
||||
#include "bytestream.h"
|
||||
@@ -477,6 +478,9 @@ static int mss4_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
|
||||
width, height);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if (av_image_check_size2(width, height, avctx->max_pixels, AV_PIX_FMT_NONE, 0, avctx) < 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
if (quality < 1 || quality > 100) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid quality setting %d\n", quality);
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
@@ -965,6 +965,9 @@ static int dng_decode_tiles(AVCodecContext *avctx, AVFrame *frame,
|
||||
int pos_x = 0, pos_y = 0;
|
||||
int ret;
|
||||
|
||||
if (s->tile_width <= 0 || s->tile_length <= 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
has_width_leftover = (s->width % s->tile_width != 0);
|
||||
has_height_leftover = (s->height % s->tile_length != 0);
|
||||
|
||||
|
||||
@@ -75,9 +75,11 @@ int avdevice_list_devices(AVFormatContext *s, AVDeviceInfoList **device_list)
|
||||
ret = s->oformat->get_device_list(s, *device_list);
|
||||
else
|
||||
ret = s->iformat->get_device_list(s, *device_list);
|
||||
if (ret < 0)
|
||||
if (ret < 0) {
|
||||
avdevice_free_list_devices(device_list);
|
||||
return ret;
|
||||
return ret;
|
||||
}
|
||||
return (*device_list)->nb_devices;
|
||||
}
|
||||
|
||||
static int list_devices_for_context(AVFormatContext *s, AVDictionary *options,
|
||||
|
||||
@@ -104,7 +104,7 @@ typedef struct ASFContext {
|
||||
int ts_is_pts;
|
||||
int packet_multi_size;
|
||||
int packet_time_delta;
|
||||
int packet_time_start;
|
||||
int64_t packet_time_start;
|
||||
int64_t packet_pos;
|
||||
|
||||
int stream_index;
|
||||
|
||||
@@ -463,6 +463,8 @@ static int parse_keyframes_index(AVFormatContext *s, AVIOContext *ioc, int64_t m
|
||||
goto invalid;
|
||||
if (current_array == × && (d <= INT64_MIN / 1000 || d >= INT64_MAX / 1000))
|
||||
goto invalid;
|
||||
if (avio_feof(ioc))
|
||||
goto invalid;
|
||||
current_array[0][i] = d;
|
||||
}
|
||||
if (times && filepositions) {
|
||||
|
||||
@@ -7540,6 +7540,8 @@ static int mov_read_iloc(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
||||
|
||||
for (int i = 0; i < item_count; i++) {
|
||||
int item_id = (version < 2) ? avio_rb16(pb) : avio_rb32(pb);
|
||||
if (avio_feof(pb))
|
||||
return AVERROR_INVALIDDATA;
|
||||
if (version > 0)
|
||||
avio_rb16(pb); // construction_method.
|
||||
avio_rb16(pb); // data_reference_index.
|
||||
|
||||
@@ -200,6 +200,8 @@ static int decode_main_header(NUTContext *nut)
|
||||
int tmp_stream, tmp_mul, tmp_pts, tmp_size, tmp_res, tmp_head_idx;
|
||||
|
||||
length = get_packetheader(nut, bc, 1, MAIN_STARTCODE);
|
||||
if (length == (uint64_t)-1)
|
||||
return AVERROR_INVALIDDATA;
|
||||
end = length + avio_tell(bc);
|
||||
|
||||
nut->version = ffio_read_varlen(bc);
|
||||
|
||||
@@ -166,6 +166,17 @@ static AVBufferRef *wrap_texture_buf(AVHWFramesContext *ctx, ID3D11Texture2D *te
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (s->nb_surfaces <= s->nb_surfaces_used) {
|
||||
frames_hwctx->texture_infos = av_realloc_f(frames_hwctx->texture_infos,
|
||||
s->nb_surfaces_used + 1,
|
||||
sizeof(*frames_hwctx->texture_infos));
|
||||
if (!frames_hwctx->texture_infos) {
|
||||
ID3D11Texture2D_Release(tex);
|
||||
return NULL;
|
||||
}
|
||||
s->nb_surfaces = s->nb_surfaces_used + 1;
|
||||
}
|
||||
|
||||
frames_hwctx->texture_infos[s->nb_surfaces_used].texture = tex;
|
||||
frames_hwctx->texture_infos[s->nb_surfaces_used].index = index;
|
||||
s->nb_surfaces_used++;
|
||||
@@ -284,7 +295,7 @@ static int d3d11va_frames_init(AVHWFramesContext *ctx)
|
||||
}
|
||||
}
|
||||
|
||||
hwctx->texture_infos = av_calloc(ctx->initial_pool_size, sizeof(*hwctx->texture_infos));
|
||||
hwctx->texture_infos = av_realloc_f(NULL, ctx->initial_pool_size, sizeof(*hwctx->texture_infos));
|
||||
if (!hwctx->texture_infos)
|
||||
return AVERROR(ENOMEM);
|
||||
s->nb_surfaces = ctx->initial_pool_size;
|
||||
|
||||
@@ -246,6 +246,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
case AV_CODEC_ID_LOCO: maxpixels /= 1024; break;
|
||||
case AV_CODEC_ID_VORBIS: maxsamples /= 1024; break;
|
||||
case AV_CODEC_ID_LSCR: maxpixels /= 16; break;
|
||||
case AV_CODEC_ID_MMVIDEO: maxpixels /= 256; break;
|
||||
case AV_CODEC_ID_MOTIONPIXELS:maxpixels /= 256; break;
|
||||
case AV_CODEC_ID_MP4ALS: maxsamples /= 65536; break;
|
||||
case AV_CODEC_ID_MSA1: maxpixels /= 16384; break;
|
||||
|
||||
Reference in New Issue
Block a user