23 #include "libavutil/avstring.h"
24 #include "libavutil/log.h"
25 #include "libavutil/opt.h"
26 #include "libavutil/pixdesc.h"
27 #include "libavutil/parseutils.h"
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)
270 for (i = 0; i < 3; i++) {
280 if (ret[0] <= 0 || ret[1] < 0 || ret[2] < 0) {
290 #define OFFSET(x) offsetof(VideoDemuxData, x)
291 #define DEC AV_OPT_FLAG_DECODING_PARAM
297 {
"start_number",
"first number in the sequence",
OFFSET(start_number),
AV_OPT_TYPE_INT, { .i64 = 1 }, 1, INT_MAX,
DEC },
301 #if CONFIG_IMAGE2_DEMUXER
302 static const AVClass img2_class = {
316 .priv_class = &img2_class,
319 #if CONFIG_IMAGE2PIPE_DEMUXER
320 static const AVClass img2pipe_class = {
327 .
name =
"image2pipe",
332 .priv_class = &img2pipe_class,
void av_free_packet(AVPacket *pkt)
Free a packet.
AVIOInterruptCB interrupt_callback
Custom interrupt callbacks for the I/O layer.
AVCodecContext * codec
Codec context associated with this stream.
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
int ctx_flags
Flags signalling stream properties.
enum AVPixelFormat av_get_pix_fmt(const char *name)
Return the pixel format corresponding to name.
char * pixel_format
Set by a private option.
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
static int img_read_header(AVFormatContext *s1)
static int img_read_probe(AVProbeData *p)
#define AVERROR_EOF
End of file.
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
static const AVOption options[]
enum AVCodecID video_codec_id
Forced video codec_id.
#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.
void * priv_data
Format private data.
char filename[1024]
input or output filename
static const int sizes[][2]
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
struct AVInputFormat * iformat
The input container format.
AVPixelFormat
Pixel format.
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 av_parse_video_rate(AVRational *rate, const char *str)
Parse str and store the detected values in *rate.
int flags
A combination of AV_PKT_FLAG values.
enum AVCodecID audio_codec_id
Forced audio codec_id.
int width
picture width / height.
char * video_size
Set by a private option.
AVStream ** streams
A list of all streams in the file.
#define FF_ARRAY_ELEMS(a)
enum AVPixelFormat pix_fmt
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.
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
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.
AVIOContext * pb
I/O context.
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)
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)
enum AVCodecID ff_guess_image2_codec(const char *filename)
av_default_item_name
Return the context name.
This structure stores compressed data.