27 #define Y4M_LINE_MAX 256 33 int raten, rated, aspectn, aspectd,
n;
35 const char *colorspace =
"";
50 if (aspectn == 0 && aspectd == 1)
55 if (field_order != st->codec->field_order && st->codec->field_order !=
AV_FIELD_UNKNOWN)
56 field_order = st->codec->field_order;
60 switch (field_order) {
65 default: inter =
'p';
break;
70 colorspace =
" Cmono";
73 colorspace =
" Cmono9";
76 colorspace =
" Cmono10";
79 colorspace =
" Cmono12";
82 colorspace =
" Cmono16";
85 colorspace =
" C411 XYSCSS=411";
91 default: colorspace =
" C420jpeg XYSCSS=420JPEG";
break;
95 colorspace =
" C422 XYSCSS=422";
98 colorspace =
" C444 XYSCSS=444";
101 colorspace =
" C420p9 XYSCSS=420P9";
104 colorspace =
" C422p9 XYSCSS=422P9";
107 colorspace =
" C444p9 XYSCSS=444P9";
110 colorspace =
" C420p10 XYSCSS=420P10";
113 colorspace =
" C422p10 XYSCSS=422P10";
116 colorspace =
" C444p10 XYSCSS=444P10";
119 colorspace =
" C420p12 XYSCSS=420P12";
122 colorspace =
" C422p12 XYSCSS=422P12";
125 colorspace =
" C444p12 XYSCSS=444P12";
128 colorspace =
" C420p14 XYSCSS=420P14";
131 colorspace =
" C422p14 XYSCSS=422P14";
134 colorspace =
" C444p14 XYSCSS=444P14";
137 colorspace =
" C420p16 XYSCSS=420P16";
140 colorspace =
" C422p16 XYSCSS=422P16";
143 colorspace =
" C444p16 XYSCSS=444P16";
149 Y4M_MAGIC, width, height, raten, rated, inter,
150 aspectn, aspectd, colorspace);
173 "Error. YUV4MPEG stream header write failed.\n");
187 ptr = frame->
data[0];
223 for (i = 0; i <
height; i++) {
238 ptr1 = frame->
data[1];
239 ptr2 = frame->
data[2];
240 for (i = 0; i <
height; i++) {
244 for (i = 0; i <
height; i++) {
268 "stream, some mjpegtools might not work.\n");
296 "Use '-strict -1' to encode to this pixel format.\n",
301 "Mjpegtools will not work.\n");
305 "yuv444p, yuv422p, yuv420p, yuv411p and gray8 pixel formats. " 306 "And using 'strict -1' also yuv444p9, yuv422p9, yuv420p9, " 307 "yuv444p10, yuv422p10, yuv420p10, " 308 "yuv444p12, yuv422p12, yuv420p12, " 309 "yuv444p14, yuv422p14, yuv420p14, " 310 "yuv444p16, yuv422p16, yuv420p16, " 311 "gray9, gray10, gray12 " 312 "and gray16 pixel formats. " 313 "Use -pix_fmt to select one.\n");
322 .
name =
"yuv4mpegpipe",
325 .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.
#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
ITU-R 601, SMPTE 274M 296M S314M(DV 4:1:1), mpeg2 4:2:2.
Passthrough codec, AVFrames wrapped in AVPacket.
#define AV_PIX_FMT_YUV444P9
#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.
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
#define FF_DISABLE_DEPRECATION_WARNINGS
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)