27 #define Y4M_LINE_MAX 256 33 int raten, rated, aspectn, aspectd, n;
35 const char *colorspace =
"";
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 = frame->
data[0];
122 for (i = 0; i <
height; i++) {
135 ptr1 = frame->
data[1];
136 ptr2 = frame->
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),
enum AVChromaLocation chroma_location
AVOutputFormat ff_yuv4mpegpipe_muxer
enum AVFieldOrder field_order
Video only.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
This structure describes decoded (raw) audio or video data.
static int yuv4_write_packet(AVFormatContext *s, AVPacket *pkt)
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (%s)\, len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt), use_generic ? ac->func_descr_generic :ac->func_descr)
AVStream ** streams
A list of all streams in the file.
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. ...
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
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.
Passthrough codec, AVFrames wrapped in AVPacket.
if(ac->has_optimized_func)
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
AVIOContext * pb
I/O context.
static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost)
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)
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)
AVCodecParameters * codecpar
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_CEIL_RSHIFT(a, b)
Fast a / (1 << b) rounded toward +inf, assuming a >= 0 and b >= 0.