75 #define OFFSET(x) offsetof(FPSContext, x) 76 #define V AV_OPT_FLAG_VIDEO_PARAM 77 #define F AV_OPT_FLAG_FILTERING_PARAM 162 if (first_pts < INT64_MIN || first_pts > INT64_MAX) {
163 av_log(ctx,
AV_LOG_ERROR,
"Start time %f cannot be represented in internal time base\n",
172 av_log(ctx,
AV_LOG_VERBOSE,
"Set first pts to (in:%"PRId64
" out:%"PRId64
") from start time %f\n",
350 .priv_class = &fps_class,
352 .
inputs = avfilter_vf_fps_inputs,
353 .
outputs = avfilter_vf_fps_outputs,
int frames_out
number of frames on output
int ff_inlink_consume_frame(AVFilterLink *link, AVFrame **rframe)
Take a frame from the link's FIFO and update the link's stats.
static const AVOption fps_options[]
This structure describes decoded (raw) audio or video data.
static int config_props(AVFilterLink *outlink)
#define AV_LOG_WARNING
Something somehow does not look correct.
Main libavfilter public API header.
#define FFERROR_NOT_READY
Filters implementation helper functions.
AVFrame * frames[2]
buffered frames
int drop
number of framed dropped
static void ff_outlink_set_status(AVFilterLink *link, int status, int64_t pts)
Set the status field of a link from the source filter.
const char * name
Pad name.
AVFilterLink ** inputs
array of pointers to input links
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
int64_t out_pts_off
output frame pts offset for start_time handling
int frames_in
number of frames on input
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
static av_cold int init(AVFilterContext *ctx)
#define AV_LOG_VERBOSE
Detailed information.
static void update_eof_pts(AVFilterContext *ctx, FPSContext *s, AVFilterLink *inlink, AVFilterLink *outlink, int64_t status_pts)
#define FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink)
Forward the status on an output link to an input link.
A filter pad used for either input or output.
A link between two filters.
int ff_inlink_acknowledge_status(AVFilterLink *link, int *rstatus, int64_t *rpts)
Test and acknowledge the change of status on the link.
int dup
number of frames duplicated
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVRational frame_rate
Frame rate of the stream on the link, or 1/0 if unknown or variable; if left to 0/0, will be automatically copied from the first input of the source filter if it exists.
int eof_action
action performed for last frame in FIFO
static av_cold void uninit(AVFilterContext *ctx)
int frames_count
number of buffered frames
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void * priv
private data for use by the filter
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
static const AVFilterPad avfilter_vf_fps_inputs[]
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link...
Round to nearest and halfway cases away from zero.
simple assert() macros that are a bit more flexible than ISO C assert().
static const AVFilterPad avfilter_vf_fps_outputs[]
static int write_frame(AVFilterContext *ctx, FPSContext *s, AVFilterLink *outlink, int *again)
#define FF_FILTER_FORWARD_WANTED(outlink, inlink)
Forward the frame_wanted_out flag from an output link to an input link.
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
#define AV_TIME_BASE
Internal time base represented as integer.
static int read_frame(AVFilterContext *ctx, FPSContext *s, AVFilterLink *inlink, AVFilterLink *outlink)
int64_t next_pts
pts of the next frame to output
AVFilterContext * src
source filter
static const AVFilterPad inputs[]
AVFrame * av_frame_clone(const AVFrame *src)
Create a new frame that references the same data as src.
static const AVFilterPad outputs[]
#define AV_TIME_BASE_Q
Internal time base represented as fractional value.
Describe the class of an AVClass context structure.
Rational number (pair of numerator and denominator).
int ff_inlink_check_available_frame(AVFilterLink *link)
Test if a frame is available on the link.
offset must point to AVRational
const char * name
Filter name.
static AVFrame * shift_frame(AVFilterContext *ctx, FPSContext *s)
AVFilterLink ** outputs
array of pointers to output links
AVFILTER_DEFINE_CLASS(fps)
static int activate(AVFilterContext *ctx)
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
AVRational framerate
target framerate
int status
buffered input status
void ff_filter_set_ready(AVFilterContext *filter, unsigned priority)
Mark a filter ready and schedule it for activation.
Flag telling rescaling functions to pass INT64_MIN/MAX through unchanged, avoiding special cases for ...
int cur_frame_out
number of times current frame has been output
int64_t status_pts
buffered input status timestamp
int rounding
AVRounding method for timestamps.
int64_t av_rescale_q_rnd(int64_t a, AVRational bq, AVRational cq, enum AVRounding rnd)
Rescale a 64-bit integer by 2 rational numbers with specified rounding.
int64_t in_pts_off
input frame pts offset for start_time handling
double start_time
pts, in seconds, of the expected first frame
#define AV_NOPTS_VALUE
Undefined timestamp value.