1 /*
2 * Image format
3 * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
4 * Copyright (c) 2004 Michael Niedermayer
5 *
6 * This file is part of FFmpeg.
7 *
8 * FFmpeg is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * FFmpeg is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with FFmpeg; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
32
34 const AVClass *
class;
/**< Class for private options. */
37 int split_planes;
/**< use independent file for each Y, U, V plane */
43
45 {
49
51
52 /* find format */
55 else
57
61 const char *str = strrchr(img->
path,
'.');
65 && desc
68 }
69 return 0;
70 }
71
73 {
76 char filename[1024];
79 int i;
80
85 time_t now0;
86 struct tm *tm;
87 time(&now0);
88 tm = localtime(&now0);
89 if (!strftime(filename,
sizeof(filename), img->
path, tm)) {
92 }
96 "Could not get frame filename number %d from pattern '%s' (either set updatefirst or use a pattern like %%03d within the filename pattern)\n",
99 }
100 for (i = 0; i < 4; i++) {
105 }
106
108 break;
109 filename[strlen(filename) - 1] = "UVAx"[i];
110 }
111 } else {
113 }
114
119 ysize *= 2;
120 usize *= 2;
121 }
130 }
131 }
else if (img->
muxer) {
136
138
140 if (ret < 0)
143 if (!st) {
146 }
148
159 }
162 } else {
164 }
168 }
169
171 return 0;
172 }
173
174 #define OFFSET(x) offsetof(VideoMuxData, x)
175 #define ENC AV_OPT_FLAG_ENCODING_PARAM
179 {
"start_number",
"set first number in the sequence",
OFFSET(img_number),
AV_OPT_TYPE_INT, { .i64 = 1 }, 0, INT_MAX,
ENC },
181 { NULL },
182 };
183
184 #if CONFIG_IMAGE2_MUXER
185 static const AVClass img2mux_class = {
190 };
191
195 .extensions = "bmp,dpx,jls,jpeg,jpg,ljpg,pam,pbm,pcx,pgm,pgmyuv,png,"
196 "ppm,sgi,tga,tif,tiff,jp2,j2c,j2k,xwd,sun,ras,rs,im1,im8,im24,"
197 "sunras,webp,xbm,xface,pix,y",
203 .priv_class = &img2mux_class,
204 };
205 #endif
206 #if CONFIG_IMAGE2PIPE_MUXER
208 .
name =
"image2pipe",
215 };
216 #endif