60 #define OFFSET(x) offsetof(MovieContext, x)
61 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM
101 "Failed to avformat_open_input '%s'\n", movie->
file_name);
114 "%s: seek value overflow with start_time:%"PRId64
" seek_point:%"PRId64
"\n",
157 av_log(ctx,
AV_LOG_VERBOSE,
"seek_point:%"PRIi64
" format_name:%s file_name:%s stream_index:%d\n",
197 outlink->
w = movie->
w;
198 outlink->
h = movie->
h;
208 int ret, frame_decoded;
226 "movie_get_frame(): file:'%s' pts:%"PRId64
" time:%f aspect:%d/%d\n",
279 .priv_class = &movie_class,
285 .
outputs = avfilter_vsrc_movie_outputs,
void av_free_packet(AVPacket *pkt)
Free a packet.
This structure describes decoded (raw) audio or video data.
#define AV_LOG_WARNING
Something somehow does not look correct.
static const AVFilterPad outputs[]
Main libavfilter public API header.
int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options)
Open an input stream and read the header.
int h
agreed upon image height
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
av_dlog(ac->avr,"%d samples - audio_convert: %s to %s (%s)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt), use_generic?ac->func_descr_generic:ac->func_descr)
static int config_output_props(AVFilterLink *outlink)
Macro definitions for various function/variable attributes.
const char * name
Pad name.
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
static int request_frame(AVFilterLink *outlink)
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
AVStream ** streams
A list of all streams in the file.
static double av_q2d(AVRational a)
Convert rational to double.
AVFrame * frame
video frame to store the decoded images in
#define AVERROR_EOF
End of file.
#define AV_LOG_VERBOSE
Detailed information.
A filter pad used for either input or output.
A link between two filters.
int av_find_best_stream(AVFormatContext *ic, enum AVMediaType type, int wanted_stream_nb, int related_stream, AVCodec **decoder_ret, int flags)
Find the "best" stream in the file.
int avcodec_close(AVCodecContext *avctx)
Close a given AVCodecContext and free all the data associated with it (but not the AVCodecContext its...
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static const AVClass movie_class
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
static av_cold int movie_init(AVFilterContext *ctx)
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link...
void av_log(void *avcl, int level, const char *fmt,...)
AVCodecContext * codec
Codec context associated with this stream.
int w
agreed upon image width
AVInputFormat * av_find_input_format(const char *short_name)
Find AVInputFormat based on the short name of the input format.
int width
picture width / height.
static const AVFilterPad avfilter_vsrc_movie_outputs[]
static av_cold void uninit(AVFilterContext *ctx)
int refcounted_frames
If non-zero, the decoded audio and video frames returned from avcodec_decode_video2() and avcodec_dec...
AVFilterContext * src
source filter
static int query_formats(AVFilterContext *ctx)
main external API structure.
AVCodec * avcodec_find_decoder(enum AVCodecID id)
Find a registered decoder with a matching codec ID.
AVRational sample_aspect_ratio
Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
AVCodecContext * codec_ctx
Describe the class of an AVClass context structure.
static const AVFilterPad inputs[]
int64_t seek_point
seekpoint in microseconds
const char * name
Filter name.
int avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options)
Initialize the AVCodecContext to use the given AVCodec.
int av_read_frame(AVFormatContext *s, AVPacket *pkt)
Return the next frame of a stream.
int64_t pkt_pts
PTS copied from the AVPacket that was decoded to produce this frame.
int64_t start_time
Position of the first frame of the component, in AV_TIME_BASE fractional seconds. ...
int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
Seek to the keyframe at timestamp.
static const char * movie_get_name(void *ctx)
static AVInputFormat * iformat
int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
Read packets of a media file to get stream information.
void avformat_close_input(AVFormatContext **s)
Close an opened input AVFormatContext.
static const AVOption movie_options[]
AVFormatContext * format_ctx
int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, AVPacket *avpkt)
Decode the video frame of size avpkt->size from avpkt->data into picture.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
static av_cold int init(AVFilterContext *ctx)
AVPixelFormat
Pixel format.
This structure stores compressed data.
void av_register_all(void)
Initialize libavformat and register all the muxers, demuxers and protocols.
#define AV_NOPTS_VALUE
Undefined timestamp value.
static int movie_get_frame(AVFilterLink *outlink)