22 #include "libavutil/pixdesc.h"
27 #define Y4M_LINE_MAX 256
33 int raten, rated, aspectn, aspectd, n;
48 if (aspectn == 0 && aspectd == 1)
54 default: inter =
'p';
break;
59 colorspace =
" Cmono";
62 colorspace =
" C411 XYSCSS=411";
68 default: colorspace =
" C420jpeg XYSCSS=420JPEG";
break;
72 colorspace =
" C422 XYSCSS=422";
75 colorspace =
" C444 XYSCSS=444";
80 n = snprintf(buf,
Y4M_LINE_MAX,
"%s W%d H%d F%d:%d I%c A%d:%d%s\n",
81 Y4M_MAGIC, width, height, raten, rated, inter,
82 aspectn, aspectd, colorspace);
106 "Error. YUV4MPEG stream header write failed.\n");
121 ptr = picture->
data[0];
122 for (i = 0; i <
height; i++) {
132 width = -(-width >> h_chroma_shift);
133 height = -(-height >> v_chroma_shift);
135 ptr1 = picture->
data[1];
136 ptr2 = picture->
data[2];
137 for (i = 0; i <
height; i++) {
141 for (i = 0; i <
height; i++) {
163 "stream, some mjpegtools might not work.\n");
169 "yuv422p, yuv420p, yuv411p and gray pixel formats. "
170 "Use -pix_fmt to select one.\n");
179 .
name =
"yuv4mpegpipe",
183 .priv_data_size =
sizeof(int),
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
AVOutputFormat ff_yuv4mpegpipe_muxer
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static int yuv4_write_packet(AVFormatContext *s, AVPacket *pkt)
int linesize[AV_NUM_DATA_POINTERS]
number of bytes per line
AVCodecContext * codec
Codec context associated with this stream.
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
four components are given, that's all.
uint8_t * data[AV_NUM_DATA_POINTERS]
enum AVChromaLocation chroma_sample_location
This defines the location of chroma samples.
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
void * priv_data
Format private data.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
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.
int width
picture width / height.
AVStream ** streams
A list of all streams in the file.
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
if(ac->has_optimized_func)
AVIOContext * pb
I/O context.
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.
static int yuv4_generate_header(AVFormatContext *s, char *buf)
static void write_header(FFV1Context *f)
enum AVFieldOrder field_order
Field order.
enum AVColorSpace colorspace
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.