Go to the documentation of this file.
34 int res = 0,
flags = O_RDWR;
35 struct v4l2_format fmt = {
36 .type = V4L2_BUF_TYPE_VIDEO_OUTPUT
55 "V4L2 output device supports only a single raw video stream\n");
73 if (ioctl(
s->fd, VIDIOC_G_FMT, &fmt) < 0) {
79 fmt.fmt.pix.width = par->
width;
80 fmt.fmt.pix.height = par->
height;
81 fmt.fmt.pix.pixelformat = v4l2_pixfmt;
84 if (ioctl(
s->fd, VIDIOC_S_FMT, &fmt) < 0) {
116 .
p.
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
enum AVMediaType codec_type
General type of the encoded data.
This struct describes the properties of an encoded stream.
AVStream ** streams
A list of all streams in the file.
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.
int flags
Flags modifying the (de)muxer behaviour.
static av_cold int write_header(AVFormatContext *s1)
AVCodecParameters * codecpar
Codec parameters associated with this stream.
#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
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
#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...
char * url
input or output URL.
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)
void * priv_data
Format private data.
const FFOutputFormat ff_v4l2_muxer
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.