27 #define Y4M_LINE_MAX 256
33 int raten, rated, aspectn, aspectd,
n;
48 if (aspectn == 0 && aspectd == 1)
56 default: inter =
'p';
break;
61 colorspace =
" Cmono";
64 colorspace =
" Cmono16";
67 colorspace =
" C411 XYSCSS=411";
73 default: colorspace =
" C420jpeg XYSCSS=420JPEG";
break;
77 colorspace =
" C422 XYSCSS=422";
80 colorspace =
" C444 XYSCSS=444";
83 colorspace =
" C420p9 XYSCSS=420P9";
86 colorspace =
" C422p9 XYSCSS=422P9";
89 colorspace =
" C444p9 XYSCSS=444P9";
92 colorspace =
" C420p10 XYSCSS=420P10";
95 colorspace =
" C422p10 XYSCSS=422P10";
98 colorspace =
" C444p10 XYSCSS=444P10";
101 colorspace =
" C420p12 XYSCSS=420P12";
104 colorspace =
" C422p12 XYSCSS=422P12";
107 colorspace =
" C444p12 XYSCSS=444P12";
110 colorspace =
" C420p14 XYSCSS=420P14";
113 colorspace =
" C422p14 XYSCSS=422P14";
116 colorspace =
" C444p14 XYSCSS=444P14";
119 colorspace =
" C420p16 XYSCSS=420P16";
122 colorspace =
" C422p16 XYSCSS=422P16";
125 colorspace =
" C444p16 XYSCSS=444P16";
131 Y4M_MAGIC, width, height, raten, rated, inter,
132 aspectn, aspectd, colorspace);
149 picture = &picture_tmp;
156 "Error. YUV4MPEG stream header write failed.\n");
170 ptr = picture->
data[0];
203 for (i = 0; i <
height; i++) {
216 ptr1 = picture->
data[1];
217 ptr2 = picture->
data[2];
218 for (i = 0; i <
height; i++) {
222 for (i = 0; i <
height; i++) {
246 "stream, some mjpegtools might not work.\n");
271 "Use '-strict -1' to encode to this pixel format.\n",
276 "Mjpegtools will not work.\n");
280 "yuv444p, yuv422p, yuv420p, yuv411p and gray8 pixel formats. "
281 "And using 'strict -1' also yuv444p9, yuv422p9, yuv420p9, "
282 "yuv444p10, yuv422p10, yuv420p10, "
283 "yuv444p12, yuv422p12, yuv420p12, "
284 "yuv444p14, yuv422p14, yuv420p14, "
285 "yuv444p16, yuv422p16, yuv420p16 "
286 "and gray16 pixel formats. "
287 "Use -pix_fmt to select one.\n");
296 .
name =
"yuv4mpegpipe",
299 .priv_data_size =
sizeof(int),
AVOutputFormat ff_yuv4mpegpipe_muxer
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
int linesize[AV_NUM_DATA_POINTERS]
number of bytes per line
mpeg2/4 4:2:0, h264 default for 4:2:0
#define AV_PIX_FMT_YUV444P14
static int yuv4_write_packet(AVFormatContext *s, AVPacket *pkt)
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
#define AV_LOG_WARNING
Something somehow does not look correct.
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
#define AV_PIX_FMT_YUV420P12
int strict_std_compliance
Allow non-standard and experimental extension.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointers to the image data planes
AVStream ** streams
A list of all streams in the file.
#define AV_PIX_FMT_YUV444P16
#define AV_PIX_FMT_YUV422P12
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
enum AVChromaLocation chroma_sample_location
This defines the location of chroma samples.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift)
Utility function to access log2_chroma_w log2_chroma_h from the pixel format AVPixFmtDescriptor.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
#define FF_COMPLIANCE_NORMAL
#define AV_PIX_FMT_YUV444P10
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
AVCodecContext * codec
Codec context associated with this stream.
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
#define AV_PIX_FMT_YUV422P9
#define AV_PIX_FMT_GRAY16
int width
picture width / height.
#define FF_CEIL_RSHIFT(a, b)
ITU-R 601, SMPTE 274M 296M S314M(DV 4:1:1), mpeg2 4:2:2.
#define AV_PIX_FMT_YUV444P9
#define AV_PIX_FMT_YUV420P16
#define AV_PIX_FMT_YUV420P14
AVIOContext * pb
I/O context.
BYTE int const BYTE int int int height
#define AV_PIX_FMT_YUV420P10
#define AV_PIX_FMT_YUV420P9
#define AV_PIX_FMT_YUV422P14
#define AV_PIX_FMT_YUV422P10
#define AV_PIX_FMT_YUV444P12
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
static int yuv4_generate_header(AVFormatContext *s, char *buf)
void * priv_data
Format private data.
static void write_header(FFV1Context *f)
enum AVFieldOrder field_order
Field order.
enum AVColorSpace colorspace
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
static int yuv4_write_header(AVFormatContext *s)
This structure stores compressed data.
static int write_packet(AVFormatContext *s1, AVPacket *pkt)
#define AV_PIX_FMT_YUV422P16
int avio_printf(AVIOContext *s, const char *fmt,...) av_printf_format(2