Go to the documentation of this file.
33 int res = 0,
flags = O_RDWR;
34 struct v4l2_format fmt = {
35 .type = V4L2_BUF_TYPE_VIDEO_OUTPUT
51 if (
s1->nb_streams != 1 ||
54 "V4L2 output device supports only a single raw video stream\n");
58 par =
s1->streams[0]->codecpar;
72 if (ioctl(
s->fd, VIDIOC_G_FMT, &fmt) < 0) {
78 fmt.fmt.pix.width = par->
width;
79 fmt.fmt.pix.height = par->
height;
80 fmt.fmt.pix.pixelformat = v4l2_pixfmt;
83 if (ioctl(
s->fd, VIDIOC_S_FMT, &fmt) < 0) {
115 .
name =
"video4linux2,v4l2",
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
static const AVClass v4l2_class
This struct describes the properties of an encoded stream.
uint32_t ff_fmt_ff2v4l(enum AVPixelFormat pix_fmt, enum AVCodecID codec_id)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static av_cold int write_header(AVFormatContext *s1)
#define LIBAVUTIL_VERSION_INT
Describe the class of an AVClass context structure.
static int write_trailer(AVFormatContext *s1)
const char * av_default_item_name(void *ptr)
Return the context name.
@ AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
const AVOutputFormat ff_v4l2_muxer
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.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
#define flags(name, subs,...)
static int write_packet(AVFormatContext *s1, AVPacket *pkt)
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.