68 }
while (pkt->
size > 0);
95 codec_ctx = st->codec;
120 codec_ctx = st->codec;
150 printf(
"stream=%d, decode=%d\n", i, decode);
157 if (!strcmp(opt->
name,
"frame_number"))
211 if (!strcmp(opt->
name,
"frame_number"))
216 if (strcmp(str1, str2)) {
228 int main(
int argc,
char* argv[])
const struct AVCodec * codec
This structure describes decoded (raw) audio or video data.
int avpriv_codec_get_cap_skip_frame_fill_param(const AVCodec *codec)
int main(int argc, char *argv[])
static AVFormatContext * fmt_ctx
int avformat_open_input(AVFormatContext **ps, const char *url, ff_const59 AVInputFormat *fmt, AVDictionary **options)
Open an input stream and read the header.
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
enum AVDiscard skip_frame
Skip decoding for selected frames.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
static int find_video_stream_info(AVFormatContext *fmt_ctx, int decode)
static av_cold int end(AVCodecContext *avctx)
AVStream ** streams
A list of all streams 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 int try_decode_video_frame(AVCodecContext *codec_ctx, AVPacket *pkt, int decode)
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
int avcodec_is_open(AVCodecContext *s)
simple assert() macros that are a bit more flexible than ISO C assert().
const AVOption * av_opt_next(const void *obj, const AVOption *last)
Iterate over all AVOptions belonging to obj.
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
enum AVMediaType codec_type
attribute_deprecated int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, const AVPacket *avpkt)
Decode the video frame of size avpkt->size from avpkt->data into picture.
static int open_and_probe_video_streams(AVFormatContext **fmt_ctx, const char *filename, int decode)
main external API structure.
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
static void dump_video_streams(const AVFormatContext *fmt_ctx, int decode)
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.
AVCodec * avcodec_find_decoder(enum AVCodecID id)
Find a registered decoder with a matching codec ID.
static int check_video_streams(const AVFormatContext *fmt_ctx1, const AVFormatContext *fmt_ctx2)
common internal api header.
void av_init_packet(AVPacket *pkt)
Initialize optional fields of a packet with default values.
void avformat_close_input(AVFormatContext **s)
Close an opened input AVFormatContext.
int av_opt_get(void *obj, const char *name, int search_flags, uint8_t **out_val)
printf("static const uint8_t my_array[100] = {\n")
int codec_info_nb_frames
Number of frames that have been demuxed during avformat_find_stream_info()
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
This structure stores compressed data.