Go to the documentation of this file.
38 #define OFFSET(x) offsetof(FreezeFramesContext, x)
39 #define FLAGS (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
56 if (sourcelink->
w != replacelink->
w || sourcelink->
h != replacelink->
h) {
58 "Input frame sizes do not match (%dx%d vs %dx%d).\n",
59 sourcelink->
w, sourcelink->
h,
60 replacelink->
w, replacelink->
h);
64 outlink->
w = sourcelink->
w;
65 outlink->
h = sourcelink->
h;
78 int drop =
ctx->inputs[0]->frame_count_out >=
s->first &&
79 ctx->inputs[0]->frame_count_out <=
s->last;
80 int replace =
ctx->inputs[1]->frame_count_out ==
s->replace;
85 if (drop &&
s->replace_frame) {
112 if (replace &&
frame) {
121 if (!drop || (drop &&
s->replace_frame))
123 if (!
s->replace_frame)
156 .
name =
"freezeframes",
159 .priv_class = &freezeframes_class,
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
static int config_output(AVFilterLink *outlink)
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
This structure describes decoded (raw) audio or video data.
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
const char * name
Filter name.
A link between two filters.
static av_cold void uninit(AVFilterContext *ctx)
int ff_inlink_consume_frame(AVFilterLink *link, AVFrame **rframe)
Take a frame from the link's FIFO and update the link's stats.
#define FF_FILTER_FORWARD_STATUS_BACK_ALL(outlink, filter)
Forward the status on an output link to all input links.
const AVFilter ff_vf_freezeframes
static const AVFilterPad freezeframes_inputs[]
A filter pad used for either input or output.
trying all byte sequences megabyte in length and selecting the best looking sequence will yield cases to try But first
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVRational sample_aspect_ratio
agreed upon sample aspect ratio
AVRational frame_rate
Frame rate of the stream on the link, or 1/0 if unknown or variable; if left to 0/0,...
AVFrame * av_frame_clone(const AVFrame *src)
Create a new frame that references the same data as src.
static const AVOption freezeframes_options[]
#define FILTER_INPUTS(array)
Describe the class of an AVClass context structure.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
AVFilterContext * src
source filter
FF_FILTER_FORWARD_WANTED(outlink, inlink)
int w
agreed upon image width
const char * name
Pad name.
static int activate(AVFilterContext *ctx)
int h
agreed upon image height
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link.
AVFILTER_DEFINE_CLASS(freezeframes)
FF_FILTER_FORWARD_STATUS(inlink, outlink)
#define FILTER_OUTPUTS(array)
static const AVFilterPad freezeframes_outputs[]