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 =
" Cmono16";
76 colorspace =
" C411 XYSCSS=411";
82 default: colorspace =
" C420jpeg XYSCSS=420JPEG";
break;
86 colorspace =
" C422 XYSCSS=422";
89 colorspace =
" C444 XYSCSS=444";
92 colorspace =
" C420p9 XYSCSS=420P9";
95 colorspace =
" C422p9 XYSCSS=422P9";
98 colorspace =
" C444p9 XYSCSS=444P9";
101 colorspace =
" C420p10 XYSCSS=420P10";
104 colorspace =
" C422p10 XYSCSS=422P10";
107 colorspace =
" C444p10 XYSCSS=444P10";
110 colorspace =
" C420p12 XYSCSS=420P12";
113 colorspace =
" C422p12 XYSCSS=422P12";
116 colorspace =
" C444p12 XYSCSS=444P12";
119 colorspace =
" C420p14 XYSCSS=420P14";
122 colorspace =
" C422p14 XYSCSS=422P14";
125 colorspace =
" C444p14 XYSCSS=444P14";
128 colorspace =
" C420p16 XYSCSS=420P16";
131 colorspace =
" C422p16 XYSCSS=422P16";
134 colorspace =
" C444p16 XYSCSS=444P16";
140 Y4M_MAGIC, width, height, raten, rated, inter,
141 aspectn, aspectd, colorspace);
164 "Error. YUV4MPEG stream header write failed.\n");
178 ptr = frame->
data[0];
211 for (i = 0; i <
height; i++) {
225 ptr1 = frame->
data[1];
226 ptr2 = frame->
data[2];
227 for (i = 0; i <
height; i++) {
231 for (i = 0; i <
height; i++) {
255 "stream, some mjpegtools might not work.\n");
280 "Use '-strict -1' to encode to this pixel format.\n",
285 "Mjpegtools will not work.\n");
289 "yuv444p, yuv422p, yuv420p, yuv411p and gray8 pixel formats. "
290 "And using 'strict -1' also yuv444p9, yuv422p9, yuv420p9, "
291 "yuv444p10, yuv422p10, yuv420p10, "
292 "yuv444p12, yuv422p12, yuv420p12, "
293 "yuv444p14, yuv422p14, yuv420p14, "
294 "yuv444p16, yuv422p16, yuv420p16 "
295 "and gray16 pixel formats. "
296 "Use -pix_fmt to select one.\n");
305 .
name =
"yuv4mpegpipe",
308 .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.
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
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)