STRUCT V4L2_FORMAT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 β€” an enum 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 holding pix, pix_mp, win, vbi, sliced, sdr, meta and raw_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