STRUCT V4L2_FORMAT(9)
π struct v4l2_format(9) π
okay bestie, welcome to the Kernel API Manual β yes we're in the kernel API manual and yes it's still cute. this one is all about struct v4l2_format, aka stream data format. it's giving "the master container for whatever your video stream is shaped like" π
β¨ NAME β¨
struct v4l2_format β stream data format πΈ
π¦ SYNOPSIS π¦
struct v4l2_format {
__u32 type;
union {
struct v4l2_pix_format pix;
struct v4l2_pix_format_mplane pix_mp;
struct v4l2_window win;
struct v4l2_vbi_format vbi;
struct v4l2_sliced_vbi_format sliced;
struct v4l2_sdr_format sdr;
struct v4l2_meta_format meta;
__u8 raw_data[200];
} fmt;
};
likeβ¦ look at her. one __u32 and then a whole little union family reunion inside fmt. iconic structure, no notes π
π Members π
typeβ anenum v4l2_buf_type; it tells you what kind of data stream we're dealing with. the vibe check of the whole struct, honestly.fmtβ the union holdingpix,pix_mp,win,vbi,sliced,sdr,metaandraw_data. it's a whole closet and only one outfit is worn at a time β¨fmt.pixβ the definition of an image format πΌοΈfmt.pix_mpβ the definition of a multiplanar image format (she's fancy, she has planes) π§fmt.winβ the definition of an overlaid image πfmt.vbiβ raw VBI capture or output parameters πΌfmt.slicedβ sliced VBI capture or output parameters πͺ (not literally, it's a VBI thing, don't panic)fmt.raw_dataβ the placeholder for future extensions and custom formats π«Ά the "save this seat for later" energy, we love a forward-thinking king
β SEE ALSO β
Kernel file ./include/uapi/linux/videodev2.h β and then the whole friend group: struct v4l2_capability(9), struct v4l2_plane(9), struct v4l2_buffer(9), v4l2_timeval_to_ns(9), struct v4l2_exportbuffer(9), struct v4l2_selection(9), struct v4l2_plane_pix_format(9), struct v4l2_pix_format_mplane(9), struct v4l2_sdr_format(9), struct v4l2_meta_format(9), struct v4l2_event_motion_det(9), struct v4l2_create_buffers(9), struct v4l2_remove_buffers(9)
go read all of them, iykyk ππ
lowkey a reminder bestie: raw_data[200] is literally a placeholder for future extensions and custom formats, so don't go inventing behaviour for it, fr fr π
and that's the whole page!! mwah π this was brought to you from ./include/uapi/linux, dated October 2026, and filed under struct v4l2_format(9) β periodt, go format some streams π¦β¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms