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"))
161 printf(
" %s=%s\n", opt->
name, str);
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
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.
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.
AVCodec * avcodec_find_decoder(enum AVCodecID id)
Find a registered decoder with a matching codec ID.
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.
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)
int codec_info_nb_frames
Number of frames that have been demuxed during avformat_find_stream_info()
int avformat_open_input(AVFormatContext **ps, const char *url, AVInputFormat *fmt, AVDictionary **options)
Open an input stream and read the header.
This structure stores compressed data.
void av_register_all(void)
Initialize libavformat and register all the muxers, demuxers and protocols.