64 const char *
str = strrchr(
img->path,
'.');
70 &&
desc->nb_components >= 3;
141 }
else if (
img->use_strftime) {
143 struct tm *tm, tmpbuf;
146 if (!strftime(filename,
sizeof(filename),
img->path, tm)) {
150 }
else if (
img->frame_pts) {
158 img->img_number > 1) {
160 "Could not get frame filename number %d from pattern '%s'. "
161 "Use '-frames:v 1' for a single image, or '-update' option, or use a pattern such as %%03d within the filename.\n",
162 img->img_number,
img->path);
165 for (
i = 0;
i < 4;
i++) {
180 if (!
img->split_planes ||
i+1 >=
desc->nb_components)
182 filename[strlen(filename) - 1] =
"UVAx"[
i];
187 if (
img->split_planes) {
190 if (
desc->comp[0].depth >= 9) {
199 if (
desc->nb_components > 3) {
203 }
else if (
img->muxer) {
212 for (
i = 0;
i < nb_renames;
i++) {
240 #define OFFSET(x) offsetof(VideoMuxData, x)
241 #define ENC AV_OPT_FLAG_ENCODING_PARAM
244 {
"start_number",
"set first number in the sequence",
OFFSET(img_number),
AV_OPT_TYPE_INT, { .i64 = 1 }, 0, INT_MAX,
ENC },
247 {
"atomic_writing",
"write files atomically (using temporary files and renames)",
OFFSET(use_rename),
AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1,
ENC },
248 {
"protocol_opts",
"specify protocol options for the opened files",
OFFSET(protocol_opts),
AV_OPT_TYPE_DICT, {0}, 0, 0,
ENC },
252 #if CONFIG_IMAGE2_MUXER
253 static const AVClass img2mux_class = {
263 .extensions =
"bmp,dpx,exr,jls,jpeg,jpg,ljpg,pam,pbm,pcx,pfm,pgm,pgmyuv,png,"
264 "ppm,sgi,tga,tif,tiff,jp2,j2c,j2k,xwd,sun,ras,rs,im1,im8,im24,"
265 "sunras,xbm,xface,pix,y",
272 .priv_class = &img2mux_class,
275 #if CONFIG_IMAGE2PIPE_MUXER
277 .
name =
"image2pipe",
static av_always_inline void update(SilenceDetectContext *s, AVFrame *insamples, int is_silence, int current_sample, int64_t nb_samples_notify, AVRational time_base)
simple assert() macros that are a bit more flexible than ISO C assert().
#define FF_COMPLIANCE_NORMAL
int ff_rename(const char *url_src, const char *url_dst, void *logctx)
Wrap avpriv_io_move and log if error happens.
#define AVIO_FLAG_WRITE
write-only
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
void avio_flush(AVIOContext *s)
Force flushing of buffered data.
#define flags(name, subs,...)
int avcodec_parameters_copy(AVCodecParameters *dst, const AVCodecParameters *src)
Copy the contents of src to dst.
#define AV_CEIL_RSHIFT(a, b)
const OptionDef options[]
AVCodecID
Identify the syntax and semantics of the bitstream.
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
int av_packet_ref(AVPacket *dst, const AVPacket *src)
Setup a new reference to the data described by a given packet.
void avformat_free_context(AVFormatContext *s)
Free an AVFormatContext and all its streams.
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
av_warn_unused_result int avformat_write_header(AVFormatContext *s, AVDictionary **options)
Allocate the stream private data and write the stream header to an output media file.
int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt)
Write a packet to an output media file ensuring correct interleaving.
int av_write_trailer(AVFormatContext *s)
Write the stream trailer to an output media file and free the file private data.
int av_get_frame_filename2(char *buf, int buf_size, const char *path, int number, int flags)
Return in 'buf' the path with 'd' replaced by a number.
#define AV_FRAME_FILENAME_FLAGS_MULTIPLE
Allow multiple d.
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values.
int av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags)
Copy entries from one AVDictionary struct into another.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
const char * av_default_item_name(void *ptr)
Return the context name.
int av_strcasecmp(const char *a, const char *b)
Locale-independent case-insensitive compare.
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.
#define LIBAVUTIL_VERSION_INT
const IdStrMap ff_img_tags[]
static const AVOption muxoptions[]
static int write_packet(AVFormatContext *s, AVPacket *pkt)
static int write_packet_pipe(AVFormatContext *s, AVPacket *pkt)
static int write_muxed_file(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt)
static int query_codec(enum AVCodecID id, int std_compliance)
static int write_header(AVFormatContext *s)
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
#define AV_PIX_FMT_FLAG_PLANAR
At least one pixel component is not in the first data plane.
#define FF_ARRAY_ELEMS(a)
Describe the class of an AVClass context structure.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
This struct describes the properties of an encoded stream.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
AVIOContext * pb
I/O context.
This structure stores compressed data.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int id
Format-specific stream ID.
AVDictionary * protocol_opts
int split_planes
use independent file for each Y, U, V plane