31 struct v4l2_format fmt = {
32 .type = V4L2_BUF_TYPE_VIDEO_OUTPUT
52 "V4L2 output device supports only a single raw video stream\n");
65 if (ioctl(s->
fd, VIDIOC_G_FMT, &fmt) < 0) {
71 fmt.fmt.pix.width = enc_ctx->
width;
72 fmt.fmt.pix.height = enc_ctx->
height;
73 fmt.fmt.pix.pixelformat = v4l2_pixfmt;
76 if (ioctl(s->
fd, VIDIOC_S_FMT, &fmt) < 0) {
AVCodecContext * codec
Codec context 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.
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.
static av_cold int write_header(AVFormatContext *s1)
#define av_err2str(errnum)
int av_image_get_buffer_size(enum AVPixelFormat pix_fmt, int width, int height, int align)
Return the size in bytes of the amount of data required to store an image with the given parameters...
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void * priv_data
Format private data.
char filename[1024]
input or output filename
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
AVOutputFormat ff_v4l2_muxer
unsigned int nb_streams
A list of all streams in the file.
int width
picture width / height.
static int write_trailer(AVFormatContext *s1)
enum AVMediaType codec_type
uint32_t avpriv_fmt_ff2v4l(enum AVPixelFormat pix_fmt, enum AVCodecID codec_id)
main external API structure.
static void close(AVCodecParserContext *s)
Main libavdevice API header.
This structure stores compressed data.
static int write_packet(AVFormatContext *s1, AVPacket *pkt)