62 const char *str = strrchr(img->
path,
'.');
87 struct tm *tm, tmpbuf;
90 if (!strftime(filename,
sizeof(filename), img->
path, tm)) {
97 "Could not get frame filename number %d from pattern '%s' (either set updatefirst or use a pattern like %%03d within the filename pattern)\n",
101 for (i = 0; i < 4; i++) {
110 filename[strlen(filename) - 1] =
"UVAx"[i];
132 }
else if (img->
muxer) {
175 #define OFFSET(x) offsetof(VideoMuxData, x)
176 #define ENC AV_OPT_FLAG_ENCODING_PARAM
180 {
"start_number",
"set first number in the sequence",
OFFSET(img_number),
AV_OPT_TYPE_INT, { .i64 = 1 }, 0, INT_MAX,
ENC },
185 #if CONFIG_IMAGE2_MUXER
186 static const AVClass img2mux_class = {
196 .extensions =
"bmp,dpx,jls,jpeg,jpg,ljpg,pam,pbm,pcx,pgm,pgmyuv,png,"
197 "ppm,sgi,tga,tif,tiff,jp2,j2c,j2k,xwd,sun,ras,rs,im1,im8,im24,"
198 "sunras,xbm,xface,pix,y",
204 .priv_class = &img2mux_class,
207 #if CONFIG_IMAGE2PIPE_MUXER
209 .
name =
"image2pipe",
void av_free_packet(AVPacket *pkt)
Free a packet.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt)
Write a packet to an output media file ensuring correct interleaving.
AVIOInterruptCB interrupt_callback
Custom interrupt callbacks for the I/O layer.
int avformat_write_header(AVFormatContext *s, AVDictionary **options)
Allocate the stream private data and write the stream header to an output media file.
#define LIBAVUTIL_VERSION_INT
#define AVIO_FLAG_WRITE
write-only
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
int av_dup_packet(AVPacket *pkt)
int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)
Copy the settings of the source AVCodecContext into the destination AVCodecContext.
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
#define av_assert0(cond)
assert() equivalent, that is always enabled.
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
int id
Format-specific stream ID.
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
AVStream ** streams
A list of all streams in the file.
static const AVOption muxoptions[]
static int write_header(AVFormatContext *s)
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
struct AVOutputFormat * oformat
The output container format.
static int write_packet(AVFormatContext *s, AVPacket *pkt)
uint16_t depth_minus1
Number of bits in the component minus 1.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
simple assert() macros that are a bit more flexible than ISO C assert().
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.
AVCodecContext * codec
Codec context associated with this stream.
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
static av_always_inline void update(SilenceDetectContext *s, AVFrame *insamples, int is_silence, int64_t nb_samples_notify, AVRational time_base)
uint8_t nb_components
The number of components each pixel has, (1-4)
int void avio_flush(AVIOContext *s)
Force flushing of buffered data.
char filename[1024]
input or output filename
int av_strcasecmp(const char *a, const char *b)
Locale-independent case-insensitive compare.
static struct tm * localtime_r(const time_t *clock, struct tm *result)
int width
picture width / height.
#define FF_CEIL_RSHIFT(a, b)
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.
AVIOContext * pb
I/O context.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
main external API structure.
int av_copy_packet(AVPacket *dst, const AVPacket *src)
Copy packet, including contents.
Describe the class of an AVClass context structure.
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.
void avformat_free_context(AVFormatContext *s)
Free an AVFormatContext and all its streams.
int split_planes
use independent file for each Y, U, V plane
void * priv_data
Format private data.
int av_write_trailer(AVFormatContext *s)
Write the stream trailer to an output media file and free the file private data.
This structure stores compressed data.
int avio_closep(AVIOContext **s)
Close the resource accessed by the AVIOContext *s, free it and set the pointer pointing to it to NULL...
#define AV_PIX_FMT_FLAG_PLANAR
At least one pixel component is not in the first data plane.