27 #define Y4M_LINE_MAX 256
33 int raten, rated, aspectn, aspectd,
n;
35 const char *colorspace =
"";
36 const char *colorrange =
"";
51 if (aspectn == 0 && aspectd == 1)
56 if (field_order != st->codec->field_order && st->codec->field_order !=
AV_FIELD_UNKNOWN)
57 field_order = st->codec->field_order;
63 colorrange =
" XCOLORRANGE=LIMITED";
66 colorrange =
" XCOLORRANGE=FULL";
72 switch (field_order) {
77 default: inter =
'p';
break;
82 colorspace =
" Cmono";
85 colorspace =
" Cmono9";
88 colorspace =
" Cmono10";
91 colorspace =
" Cmono12";
94 colorspace =
" Cmono16";
97 colorspace =
" C411 XYSCSS=411";
100 colorspace =
" C420jpeg XYSCSS=420JPEG";
101 colorrange =
" XCOLORRANGE=FULL";
104 colorspace =
" C422 XYSCSS=422";
105 colorrange =
" XCOLORRANGE=FULL";
108 colorspace =
" C444 XYSCSS=444";
109 colorrange =
" XCOLORRANGE=FULL";
115 default: colorspace =
" C420jpeg XYSCSS=420JPEG";
break;
119 colorspace =
" C422 XYSCSS=422";
122 colorspace =
" C444 XYSCSS=444";
125 colorspace =
" C420p9 XYSCSS=420P9";
128 colorspace =
" C422p9 XYSCSS=422P9";
131 colorspace =
" C444p9 XYSCSS=444P9";
134 colorspace =
" C420p10 XYSCSS=420P10";
137 colorspace =
" C422p10 XYSCSS=422P10";
140 colorspace =
" C444p10 XYSCSS=444P10";
143 colorspace =
" C420p12 XYSCSS=420P12";
146 colorspace =
" C422p12 XYSCSS=422P12";
149 colorspace =
" C444p12 XYSCSS=444P12";
152 colorspace =
" C420p14 XYSCSS=420P14";
155 colorspace =
" C422p14 XYSCSS=422P14";
158 colorspace =
" C444p14 XYSCSS=444P14";
161 colorspace =
" C420p16 XYSCSS=420P16";
164 colorspace =
" C422p16 XYSCSS=422P16";
167 colorspace =
" C444p16 XYSCSS=444P16";
173 Y4M_MAGIC, width, height, raten, rated, inter,
174 aspectn, aspectd, colorspace, colorrange);
198 "Error. YUV4MPEG stream header write failed.\n");
212 ptr = frame->
data[0];
252 for (i = 0; i <
height; i++) {
267 ptr1 = frame->
data[1];
268 ptr2 = frame->
data[2];
269 for (i = 0; i <
height; i++) {
273 for (i = 0; i <
height; i++) {
297 "stream, some mjpegtools might not work.\n");
329 "Use '-strict -1' to encode to this pixel format.\n",
334 "Mjpegtools will not work.\n");
338 "yuv444p, yuv422p, yuv420p, yuv411p and gray8 pixel formats. "
339 "And using 'strict -1' also yuv444p9, yuv422p9, yuv420p9, "
340 "yuv444p10, yuv422p10, yuv420p10, "
341 "yuv444p12, yuv422p12, yuv420p12, "
342 "yuv444p14, yuv422p14, yuv420p14, "
343 "yuv444p16, yuv422p16, yuv420p16, "
344 "gray9, gray10, gray12 "
345 "and gray16 pixel formats. "
346 "Use -pix_fmt to select one.\n");
355 .
name =
"yuv4mpegpipe",
358 .priv_data_size =
sizeof(
int),
static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int unqueue)
enum AVChromaLocation chroma_location
AVOutputFormat ff_yuv4mpegpipe_muxer
enum AVFieldOrder field_order
Video only.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
MPEG-2/4 4:2:0, H.264 default for 4:2:0.
This structure describes decoded (raw) audio or video data.
#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.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
#define AV_PIX_FMT_YUV420P12
int strict_std_compliance
Allow non-standard and experimental extension.
#define AV_PIX_FMT_GRAY10
#define AV_PIX_FMT_GRAY12
AVStream ** streams
A list of all streams in the file.
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
#define AV_PIX_FMT_YUV444P16
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
#define AV_PIX_FMT_YUV422P12
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
#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 AV_PIX_FMT_YUV444P10
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
#define AV_PIX_FMT_YUV422P9
#define AV_PIX_FMT_GRAY16
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
ITU-R 601, SMPTE 274M 296M S314M(DV 4:1:1), mpeg2 4:2:2.
enum AVColorRange color_range
Video only.
Passthrough codec, AVFrames wrapped in AVPacket.
#define AV_PIX_FMT_YUV444P9
the normal 2^n-1 "JPEG" YUV ranges
#define AV_PIX_FMT_YUV420P16
#define AV_PIX_FMT_YUV420P14
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
AVIOContext * pb
I/O context.
#define AV_PIX_FMT_YUV420P10
#define FF_COMPLIANCE_NORMAL
#define AV_PIX_FMT_YUV420P9
#define AV_PIX_FMT_YUV422P14
#define AV_PIX_FMT_YUV422P10
#define AV_PIX_FMT_YUV444P12
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
the normal 219*2^(n-8) "MPEG" YUV ranges
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
#define FF_DISABLE_DEPRECATION_WARNINGS
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
static int yuv4_generate_header(AVFormatContext *s, char *buf)
#define FF_ENABLE_DEPRECATION_WARNINGS
void * priv_data
Format private data.
static void write_header(FFV1Context *f)
AVCodecParameters * codecpar
Codec parameters associated with this stream.
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.
#define AV_PIX_FMT_YUV422P16
int avio_printf(AVIOContext *s, const char *fmt,...) av_printf_format(2
#define AV_CEIL_RSHIFT(a, b)