STRUCT V4L2_CTRL_MPEG2_PICTURE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct v4l2_ctrl_mpeg2_picture(9) β€” the Kernel API Manual, bestie edition πŸŽ€

okay so you're deep in the kernel docs (iconic of you, honestly) and you've stumbled into the Kernel API Manual page for struct v4l2_ctrl_mpeg2_picture β€” say it with me, it's the MPEG-2 picture header πŸ¦‹. yes it's a mouthful. no we're not skipping it. let's go ✨


🌸 NAME 🌸

struct v4l2_ctrl_mpeg2_picture β€” MPEG-2 picture header, literally exactly what it says on the tin πŸ’–


⭐ SYNOPSIS ⭐

here's the whole struct, bestie, character for character, no edits no cap πŸ‘‘

struct v4l2_ctrl_mpeg2_picture {
    __u64 backward_ref_ts;
    __u64 forward_ref_ts;
    __u32 flags;
    __u8 f_code[2][2];
    __u8 picture_coding_type;
    __u8 picture_structure;
    __u8 intra_dc_precision;
    __u8 reserved[5];
 };

🫢 Members 🫢

  • backward_ref_ts β€” timestamp of the V4L2 capture buffer you're using as the reference for backward prediction. that's your time-travel-in-reverse buddy βͺ
  • forward_ref_ts β€” timestamp of the V4L2 capture buffer you're using as the reference for forward prediction. heads up (this is the important bit πŸ™ˆ): these timestamps refer to the timestamp field in struct v4l2_buffer. use v4l2_timeval_to_ns to convert the struct timeval to a __u64 β€” do not freestyle this, fr fr.
  • flags β€” see V4L2_MPEG2_PIC_FLAG_{}. the curly braces are the manpage being mysterious, not me, i promise πŸ’€
  • f_code β€” see MPEG-2 specification. that's the whole vibe. the spec has the tea β˜•
  • picture_coding_type β€” also see MPEG-2 specification ✨
  • picture_structure β€” see V4L2_MPEG2_PIC_{}_FIELD πŸŽ€
  • intra_dc_precision β€” see MPEG-2 specification (again, yes, it's a spec household here) πŸ“–
  • reserved β€” padding field. Should be zeroed by applications. that's not a suggestion, bestie, zero it out πŸ™

πŸ”₯ Description πŸ”₯

all of the members on this structure match the picture header and picture coding extension syntaxes as specified by the MPEG-2 specification. that's it. that's the whole description. it's giving "the spec is the spec" and honestly? respect. πŸ‘‘


🌈 SEE ALSO 🌈

the reading list is long, but every single one of these is here because you deserve the full set, no gatekeeping in this house πŸ’œ

first up, the file itself: Kernel file ./include/uapi/linux/v4l2-controls.h

then, alphabetically-ish by video-codec friend group:

enum v4l2_mpeg_video_av1_profile(9), enum v4l2_mpeg_video_av1_level(9), enum v4l2_stateless_h264_decode_mode(9), enum v4l2_stateless_h264_start_code(9), struct v4l2_ctrl_h264_sps(9), struct v4l2_ctrl_h264_pps(9), struct v4l2_ctrl_h264_scaling_matrix(9), struct v4l2_ctrl_h264_pred_weights(9), struct v4l2_h264_reference(9), struct v4l2_ctrl_h264_slice_params(9), struct v4l2_h264_dpb_entry(9), struct v4l2_ctrl_h264_decode_params(9), struct v4l2_ctrl_fwht_params(9), struct v4l2_vp8_segment(9), struct v4l2_vp8_loop_filter(9), struct v4l2_vp8_quantization(9), struct v4l2_vp8_entropy(9), struct v4l2_vp8_entropy_coder_state(9), struct v4l2_ctrl_vp8_frame(9), struct v4l2_ctrl_mpeg2_sequence(9), struct v4l2_ctrl_mpeg2_quantisation(9), struct v4l2_ctrl_hevc_sps(9), struct v4l2_ctrl_hevc_pps(9), struct v4l2_hevc_dpb_entry(9), struct v4l2_hevc_pred_weight_table(9), struct v4l2_ctrl_hevc_slice_params(9), struct v4l2_ctrl_hevc_decode_params(9), struct v4l2_ctrl_hevc_scaling_matrix(9), struct v4l2_vp9_loop_filter(9), struct v4l2_vp9_quantization(9), struct v4l2_vp9_segmentation(9), struct v4l2_ctrl_vp9_frame(9), struct v4l2_vp9_mv_probs(9), struct v4l2_ctrl_vp9_compressed_hdr(9), struct v4l2_ctrl_av1_sequence(9), struct v4l2_ctrl_av1_tile_group_entry(9), enum v4l2_av1_warp_model(9), enum v4l2_av1_reference_frame(9), struct v4l2_av1_global_motion(9), enum v4l2_av1_frame_restoration_type(9), struct v4l2_av1_loop_restoration(9), struct v4l2_av1_cdef(9), enum v4l2_av1_segment_feature(9), struct v4l2_av1_segmentation(9), struct v4l2_av1_loop_filter(9), struct v4l2_av1_quantization(9), struct v4l2_av1_tile_info(9), enum v4l2_av1_frame_type(9), enum v4l2_av1_interpolation_filter(9), enum v4l2_av1_tx_mode(9), struct v4l2_ctrl_av1_frame(9), struct v4l2_ctrl_av1_film_grain(9)

ngl that's a lot of cross-references but every one of them is real and every one of them is staying. iykyk 🧚

and that's the whole page, bestie β€” you ate πŸ’…

this cutie came out of ./include/uapi/linux, dated October 2026, which is honestly future energy of the highest order β­πŸŒΈπŸ“ go forth and decode your picture headers, main character πŸ«ΆπŸ’–πŸ‘‘

πŸ“¦ where this page comes from