Go to the documentation of this file.
38 case AVERROR(EIO):
return "-EIO";
39 case AVERROR(ENOMEM):
return "-ENOMEM";
40 case AVERROR(EINVAL):
return "-EINVAL";
57 int main(
int argc,
char **argv)
61 int i,
ret, stream_id;
70 for(
i=2;
i<argc;
i+=2){
71 if (!strcmp(argv[
i],
"-seekforw")){
72 seekfirst = atoi(argv[
i+1]);
73 }
else if(!strcmp(argv[
i],
"-seekback")){
74 seekfirst = atoi(argv[
i+1]);
76 }
else if(!strcmp(argv[
i],
"-frames")){
77 frame_count = atoi(argv[
i+1]);
78 }
else if(!strcmp(argv[
i],
"-duration")){
80 }
else if(!strcmp(argv[
i],
"-fastseek")) {
81 if (atoi(argv[
i+1])) {
84 }
else if(argv[
i][0] ==
'-' && argv[
i+1]) {
95 printf(
"usage: %s input_file\n"
105 fprintf(stderr,
"cannot open %s\n", filename);
111 fprintf(stderr,
"%s: could not find codec parameters\n", filename);
125 for(j=0; j<frame_count; j++) {
151 ts_str(ts_buf, timestamp, stream_id < 0 ? AV_TIME_BASE_Q : st->time_base);
152 printf(
"ret:%-10s st:%2d flags:%d ts:%s\n",
ret_str(
ret), stream_id,
i&1, ts_buf);
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
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
#define AVERROR_EOF
End of file.
#define AV_TIME_BASE_Q
Internal time base represented as fractional value.
static const char * ret_str(int v)
AVStream ** streams
A list of all streams in the file.
AVDictionary * format_opts
static void ts_str(char buffer[60], int64_t ts, AVRational base)
int av_read_frame(AVFormatContext *s, AVPacket *pkt)
Return the next frame of a stream.
void avformat_close_input(AVFormatContext **s)
Close an opened input AVFormatContext.
int main(int argc, char **argv)
int flags
Flags modifying the (de)muxer behaviour.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
Rational number (pair of numerator and denominator).
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
Read packets of a media file to get stream information.
AVFormatContext * avformat_alloc_context(void)
Allocate an AVFormatContext.
int avformat_seek_file(AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags)
Seek to timestamp ts.
#define AV_NOPTS_VALUE
Undefined timestamp value.
printf("static const uint8_t my_array[100] = {\n")
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed.
int flags
A combination of AV_PKT_FLAG values.
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values.
#define i(width, name, range_min, range_max)
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
int avformat_open_input(AVFormatContext **ps, const char *url, ff_const59 AVInputFormat *fmt, AVDictionary **options)
Open an input stream and read the header.
#define AV_TIME_BASE
Internal time base represented as integer.
This structure stores compressed data.
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
int64_t pos
byte position in stream, -1 if unknown