109 *width_ptr =
sizes[i][0];
110 *height_ptr =
sizes[i][1];
118 str= strrchr(str,
'.');
136 int range, last_index, range1, first_index;
139 for(first_index = 0; first_index < 5; first_index++) {
150 if (first_index == 5)
154 last_index = first_index;
163 last_index + range1) < 0)
169 if (range >= (1 << 30))
177 *pfirst_index = first_index;
178 *plast_index = last_index;
201 #if FF_API_GUESS_IMG2_CODEC
202 enum CodecID av_guess_image2_codec(
const char *filename){
210 int first_index, last_index, ret = 0;
236 #if FF_API_LOOP_INPUT
238 s->
loop = s1->loop_input;
268 st->
duration = last_index - first_index + 1;
292 int size[3]={0}, ret[3]={0};
318 filename[ strlen(filename) - 1 ]=
'U' + i;
325 if (f[0]->eof_reached)
345 if (ret[0] <= 0 || ret[1]<0 || ret[2]<0) {
355 #if CONFIG_IMAGE2_MUXER || CONFIG_IMAGE2PIPE_MUXER
387 "Could not get frame filename number %d from pattern '%s'\n",
400 filename[ strlen(filename) - 1 ]=
'U' + i;
431 }
else if(pkt->
size < 8 ||
452 #define OFFSET(x) offsetof(VideoData, x)
453 #define DEC AV_OPT_FLAG_DECODING_PARAM
463 #if CONFIG_IMAGE2_DEMUXER
464 static const AVClass img2_class = {
478 .priv_class = &img2_class,
481 #if CONFIG_IMAGE2PIPE_DEMUXER
482 static const AVClass img2pipe_class = {
489 .
name =
"image2pipe",
494 .priv_class = &img2pipe_class,
499 #if CONFIG_IMAGE2_MUXER
503 .extensions =
"bmp,dpx,jpeg,jpg,ljpg,pam,pbm,pcx,pgm,pgmyuv,png,"
504 "ppm,sgi,tga,tif,tiff,jp2",
512 #if CONFIG_IMAGE2PIPE_MUXER
514 .
name =
"image2pipe",
enum PixelFormat pix_fmt
Pixel format, see PIX_FMT_xxx.
int64_t avio_size(AVIOContext *s)
Get the filesize.
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.
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
static const IdStrMap img_tags[]
#define AVIO_FLAG_READ
read-only
#define AVIO_FLAG_WRITE
write-only
#define FF_ARRAY_ELEMS(a)
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
int ctx_flags
Format-specific flags, see AVFMTCTX_xx.
enum CodecID video_codec_id
Forced video codec_id.
static int infer_size(int *width_ptr, int *height_ptr, int size)
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
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
void av_free_packet(AVPacket *pkt)
Free a packet.
#define AVERROR_EOF
End of file.
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
static av_always_inline void ffio_wfourcc(AVIOContext *pb, const uint8_t *s)
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
struct AVOutputFormat * oformat
char * video_size
String describing video size, set by a private option.
preferred ID for MPEG-1/2 video decoding
#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,...)
AVStream * avformat_new_stream(AVFormatContext *s, AVCodec *c)
Add a new stream to a media file.
static int read_header(AVFormatContext *s1, AVFormatParameters *ap)
static int read_packet(AVFormatContext *s1, AVPacket *pkt)
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
int void avio_flush(AVIOContext *s)
char filename[1024]
input or output filename
char * framerate
Set by a private option.
int av_strcasecmp(const char *a, const char *b)
int width
picture width / height.
enum CodecID ff_guess_image2_codec(const char *filename)
static int read_probe(AVProbeData *p)
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.
enum CodecID audio_codec_id
Forced audio codec_id.
enum AVMediaType codec_type
main external API structure.
int av_filename_number_test(const char *filename)
Check whether filename actually is a numbered sequence generator.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static enum CodecID av_str2id(const IdStrMap *tags, const char *str)
Describe the class of an AVClass context structure.
rational number numerator/denominator
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.
static const AVOption options[]
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.
char * pixel_format
Set by a private option.
struct AVInputFormat * iformat
Can only be iformat or oformat, not both at the same time.
CodecID
Identify the syntax and semantics of the bitstream.
static int64_t video_size
void * priv_data
Format private data.
void avio_wb32(AVIOContext *s, unsigned int val)
static const int sizes[][2]
#define MKTAG(a, b, c, d)
static int find_image_range(int *pfirst_index, int *plast_index, const char *path)
enum PixelFormat av_get_pix_fmt(const char *name)
Return the pixel format corresponding to name.