64 *width_ptr =
sizes[i][0];
65 *height_ptr =
sizes[i][1];
75 const char *path,
int max_start)
78 int range, last_index, range1, first_index;
81 for (first_index = 0; first_index < max_start; first_index++) {
96 last_index = first_index;
105 last_index + range1) < 0)
111 if (range >= (1 << 30))
119 *pfirst_index = first_index;
120 *plast_index = last_index;
141 int first_index, last_index, ret = 0;
163 "Could not parse video size: %s.\n", s->
video_size);
168 "Could not parse framerate: %s.\n", s->
framerate);
200 st->
duration = last_index - first_index + 1;
225 int size[3] = { 0 }, ret[3] = { 0 };
240 for (i = 0; i < 3; i++) {
253 filename[strlen(filename) - 1] =
'U' + i;
260 if (f[0]->eof_reached)
272 for (i = 0; i < 3; i++) {
282 if (ret[0] <= 0 || ret[1] < 0 || ret[2] < 0) {
292 #define OFFSET(x) offsetof(VideoDemuxData, x)
293 #define DEC AV_OPT_FLAG_DECODING_PARAM
299 {
"start_number",
"first number in the sequence",
OFFSET(start_number),
AV_OPT_TYPE_INT, { .i64 = 1 }, 1, INT_MAX,
DEC },
303 #if CONFIG_IMAGE2_DEMUXER
304 static const AVClass img2_class = {
318 .priv_class = &img2_class,
321 #if CONFIG_IMAGE2PIPE_DEMUXER
322 static const AVClass img2pipe_class = {
329 .
name =
"image2pipe",
334 .priv_class = &img2pipe_class,
int64_t avio_size(AVIOContext *s)
Get the filesize.
void av_free_packet(AVPacket *pkt)
Free a packet.
int av_parse_video_rate(AVRational *rate, const char *arg)
Parse str and store the detected values in *rate.
AVIOInterruptCB interrupt_callback
Custom interrupt callbacks for the I/O layer.
int av_parse_video_size(int *width_ptr, int *height_ptr, const char *str)
Parse str and put in width_ptr and height_ptr the detected values.
#define AVIO_FLAG_READ
read-only
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
#define FF_ARRAY_ELEMS(a)
int ctx_flags
Flags signalling stream properties.
char * pixel_format
Set by a private option.
int avio_check(const char *url, int flags)
Return AVIO_FLAG_* access flags corresponding to the access permissions of the resource in url...
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
enum AVStreamParseType need_parsing
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
static int img_read_header(AVFormatContext *s1)
AVStream ** streams
A list of all streams in the file.
static int img_read_probe(AVProbeData *p)
#define AVERROR_EOF
End of file.
static const AVOption options[]
enum AVCodecID video_codec_id
Forced video codec_id.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
char * framerate
Set by a private option.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static const int sizes[][2]
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
int avio_close(AVIOContext *s)
Close the resource accessed by the AVIOContext s and free it.
void av_log(void *avcl, int level, const char *fmt,...)
size_t av_strlcpy(char *dst, const char *src, size_t size)
Copy the string src to dst, but no more than size - 1 bytes, and null-terminate dst.
int flags
A combination of AV_PKT_FLAG values.
AVCodecContext * codec
Codec context associated with this stream.
char filename[1024]
input or output filename
enum AVCodecID audio_codec_id
Forced audio codec_id.
int width
picture width / height.
char * video_size
Set by a private option.
enum AVPixelFormat pix_fmt
int av_get_frame_filename(char *buf, int buf_size, const char *path, int number)
Return in 'buf' the path with 'd' replaced by a number.
static int read_header(FFV1Context *f)
enum AVMediaType codec_type
AVIOContext * pb
I/O context.
static int find_image_range(int *pfirst_index, int *plast_index, const char *path, int max_start)
main external API structure.
int av_filename_number_test(const char *filename)
Check whether filename actually is a numbered sequence generator.
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
Describe the class of an AVClass context structure.
rational number numerator/denominator
static int infer_size(int *width_ptr, int *height_ptr, int size)
int avio_open2(AVIOContext **s, const char *url, int flags, const AVIOInterruptCB *int_cb, AVDictionary **options)
Create and initialize a AVIOContext for accessing the resource indicated by url.
This structure contains the data a format has to probe a file.
int64_t duration
Decoding: duration of the stream, in stream time base.
int64_t start_time
Decoding: pts of the first frame of the stream, in stream time base.
static int img_read_packet(AVFormatContext *s1, AVPacket *pkt)
struct AVInputFormat * iformat
The input container format.
enum AVCodecID ff_guess_image2_codec(const char *filename)
void * priv_data
Format private data.
enum AVPixelFormat av_get_pix_fmt(const char *name)
Return the pixel format corresponding to name.
AVPixelFormat
Pixel format.
This structure stores compressed data.