This article gives information about the Linux® V4L2 video codec framework.
1. Framework purpose[edit source]
The V4L2 Linux kernel framework[1] allows the control of video hardware codecs in order to decode and encode compressed video contents such as H264, VP8 or JPEG video bitstreams.
This could be typically used, with the help of other Linux multimedia frameworks, and applications, to play local videos, stream video contents, make a video recording or even remotely stream video compressed images from the camera sensor.
2. System overview[edit source]
2.1. Component description[edit source]
- media-ctl (User space)
A V4L2 utility relying on Media Controller Linux kernel interface[2] aiming to configure, and link each sub devices composing the camera subsystem in order to configure it.
- Application (User space)
Any application relying on V4L2 Linux kernel interface[3] or libv4l abstraction layer. GStreamer framework provides such application.
- V4L2 utilities (User space)
A set of tools to test, configure, and use the whole camera subsystem, including the external camera sensor, and the camera interface. v4l2-ctl is one of the most useful utility.
- V4L2 libraries (libv4l) (User space)
A set of libraries on top of the V4L2 Linux kernel interface[3] which abstract the kernel interface in order to simplify, keep compatibility or add some hooks between V4L-based applications, and the V4L2 kernel interface.
- V4L2 core (Kernel space)
This layer represents the standard Linux kernel V4L2 Framework.
- hantro_vpu (Kernel space)
This V4L2 Linux device driver handles the VDEC hardware block and the VENC hardware block.
- VDEC (Hardware)
The Video DECoder hardware block.
- VENC (Hardware)
The Video ENCoder hardware block.
2.2. APIs description[edit source]
The V4L2 userland API is documented in the Linux Media subsystem documentation[3]
More specifically, the V4L2 video memory-to-memory userland API is documented in the chapter[4]
The V4L2 kernel framework internal API is documented in the V4L2 Kernel Support section of the Linux kernel documentation[5]
The Media Controller API is documented in the Linux Media subsystem documentation[2]
3. Configuration[edit source]
3.1. Kernel configuration[edit source]
The STM32 hantro_vpu driver is enabled by default in STMicroelectronics deliveries.
Nevertheless, this could not be the case when using the upstream kernel version. In this case, the hantro_vpu V4L2 driver with its STM32MP25 backend can be enabled using Linux kernel menuconfig tool:
[*] Device Drivers ---> [*] Multimedia support ---> [*] Media drivers ---> [*] Media platform devices ---> [*] Hantro VPU driver ---> [*] Hantro STM32MP25 support
3.2. Device tree configuration[edit source]
Refer to VDEC device tree configuration and VENC device tree configuration articles for Linux kernel device tree details.
4. How to use the framework[edit source]
The use cases described here are enabled using media-ctl, v4l2-ctl, gst-launch or gst-play command line utilities.
4.1. List the video codec devices and their capabilities[edit source]
List all the available video devices using v4l2-ctl --list-devices option:
v4l2-ctl --list-devices
st,stm32mp25-vdec-dec (platform: hantro-vpu): /dev/video0 /dev/media0 st,stm32mp25-venc-enc (platform: hantro-vpu): /dev/video1 /dev/media1
If several devices are available, use -d option after any v4l2-ctl commands to target a specific device. If -d option is not specified, /dev/video0 is targeted by default.
In order to have information on a specific device, use -D option.
/dev/video0 is the video decoder device:
v4l2-ctl -d /dev/video0 -D
Driver Info:
Driver name : hantro-vpu
Card type : st,stm32mp25-vdec-dec
Bus info : platform: hantro-vpu
Driver version : 6.1.28
Capabilities : 0x84204000
Video Memory-to-Memory Multiplanar
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04204000
Video Memory-to-Memory Multiplanar
Streaming
Extended Pix Format
Media Driver Info:
Driver name : hantro-vpu
Model : hantro-vpu
Serial :
Bus info : platform: hantro-vpu
Media version : 6.1.28
Hardware revision: 0x00000000 (0)
Driver version : 6.1.28
Interface Info:
ID : 0x0300000c
Type : V4L Video
Entity Info:
ID : 0x00000001 (1)
Name : st,stm32mp25-vdec-dec-source
Function : V4L2 I/O
Pad 0x01000002 : 0: Source
Link 0x02000008: to remote pad 0x1000004 of entity 'st,stm32mp25-vdec-dec-proc' (Video Decoder): Data, Enabled, Immutable
/dev/video1 is the encoder device:
v4l2-ctl -d /dev/video1 -D
Driver Info:
Driver name : hantro-vpu
Card type : st,stm32mp25-venc-enc
Bus info : platform: hantro-vpu
Driver version : 6.1.28
Capabilities : 0x84204000
Video Memory-to-Memory Multiplanar
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04204000
Video Memory-to-Memory Multiplanar
Streaming
Extended Pix Format
Media Driver Info:
Driver name : hantro-vpu
Model : hantro-vpu
Serial :
Bus info : platform: hantro-vpu
Media version : 6.1.28
Hardware revision: 0x00000000 (0)
Driver version : 6.1.28
Interface Info:
ID : 0x0300000c
Type : V4L Video
Entity Info:
ID : 0x00000001 (1)
Name : st,stm32mp25-venc-enc-source
Function : V4L2 I/O
Pad 0x01000002 : 0: Source
Link 0x02000008: to remote pad 0x1000004 of entity 'st,stm32mp25-venc-enc-proc' (Video Encoder): Data, Enabled, Immutable
4.2. Get the supported compressed format, pixel format and resolution[edit source]
Use v4l2-ctl --list-formats-out-ext option to get the supported compressed formats and resolutions supported by the decoder:
v4l2-ctl --list-formats-out-ext ioctl: VIDIOC_ENUM_FMT [0]: 'VP8F' (VP8 Frame, compressed) Size: Stepwise 96x96 - 4080x4080 with step 16/16 [1]: 'S264' (H.264 Parsed Slice Data, compressed) Size: Stepwise 96x96 - 4080x4080 with step 16/16
Both VP8 and H264 bitstream decoding are supported up to 4080x4080.
Use --list-formats-ext option to get the supported output pixel formats:
v4l2-ctl -d /dev/video0 --list-formats-ext ioctl: VIDIOC_ENUM_FMT [0]: 'NV12' (Y/UV 4:2:0)
Only YUV420 semi-planar is supported in output of decoder.
Informations are also available at GStreamer level by inspecting v4l2slvp8dec and v4l2slh264dec decoder elements using commands:
gst-inspect-1.0 --no-colors v4l2slvp8dec [...] Pad Templates: SINK template: 'sink' Availability: Always Capabilities: video/x-vp8 SRC template: 'src' Availability: Always Capabilities: video/x-raw format: { (string)NV12, (string)YUY2, (string)NV12_4L4, (string)NV12_32L32, (string)NV12_16L32S, (string)I420, (string)P010_10LE, (string)RGB16, (string)BGRx, (string)RGBx, (string)xBGR, (string)xRGB } width: [ 1, 2147483647 ] height: [ 1, 2147483647 ] framerate: [ 0/1, 2147483647/1 ] [...]
gst-inspect-1.0 --no-colors v4l2slh264dec [...] Pad Templates: SINK template: 'sink' Availability: Always Capabilities: video/x-h264 SRC template: 'src' Availability: Always Capabilities: video/x-raw format: { (string)NV12, (string)YUY2, (string)NV12_4L4, (string)NV12_32L32, (string)NV12_16L32S, (string)I420, (string)P010_10LE, (string)RGB16, (string)BGRx, (string)RGBx, (string)xBGR, (string)xRGB } width: [ 1, 2147483647 ] height: [ 1, 2147483647 ] framerate: [ 0/1, 2147483647/1 ] [...]
Same can be applied for the encoder:
v4l2-ctl -d /dev/video1 --list-formats-out-ext ioctl: VIDIOC_ENUM_FMT [0]: 'NV12' (Y/UV 4:2:0) [1]: 'YM12' (Planar YUV 4:2:0 (N-C)) [2]: 'NM12' (Y/UV 4:2:0 (N-C)) [3]: 'YUYV' (YUYV 4:2:2) [4]: 'UYVY' (UYVY 4:2:2) [5]: 'RGBP' (16-bit RGB 5-6-5) [6]: 'XR24' (32-bit BGRX 8-8-8-8) [7]: 'BGR4' (32-bit BGRA/X 8-8-8-8) [8]: 'XB24' (32-bit RGBX 8-8-8-8) [9]: 'RX24' (32-bit XBGR 8-8-8-8) [10]: 'BX24' (32-bit XRGB 8-8-8-8) [11]: 'RGB4' (32-bit A/XRGB 8-8-8-8)
Encoder can be fed with YUV420 semi-planar and YUV420 planar, YUV422 coplanar, RGB565 16 bits and RGB 32 bits pixels formats.
v4l2-ctl -d /dev/video1 --list-formats-ext [0]: 'JPEG' (JFIF JPEG, compressed) Size: Stepwise 96x32 - 8176x8176 with step 16/16 [1]: 'VP8F' (VP8 Frame, compressed) Size: Stepwise 96x96 - 4080x4080 with step 16/16
Encoder can generate JPEG up to 8176 and VP8 bitstream up to 4080.
Informations are also available at GStreamer level by inspecting v4l2slvp8enc and v4l2jpegenc encoder elements using command:
gst-inspect-1.0 --no-colors v4l2slvp8enc [...] Pad Templates: SINK template: 'sink' Availability: Always Capabilities: video/x-raw format: { (string)NV12, (string)YUY2, (string)NV12_4L4, (string)NV12_32L32, (string)NV12_16L32S, (string)I420, (string)P010_10LE, (string)RGB16, (string)BGRx, (string)RGBx, (string)xBGR, (string)xRGB } width: [ 1, 2147483647 ] height: [ 1, 2147483647 ] framerate: [ 0/1, 2147483647/1 ] SRC template: 'src' Availability: Always Capabilities: video/x-vp8 [...]
gst-inspect-1.0 --no-colors v4l2jpegenc [...] Pad Templates: SINK template: 'sink' Availability: Always Capabilities: video/x-raw format: { (string)I420, (string)YUY2, (string)UYVY, (string)RGB16, (string)BGRA, (string)RGBx, (string)xBGR, (string)ARGB, (string)xRGB, (string)BGRx, (string)NV12 } width: [ 1, 32768 ] height: [ 1, 32768 ] framerate: [ 0/1, 2147483647/1 ] SRC template: 'src' Availability: Always Capabilities: image/jpeg parsed: true [...]
4.3. Playing/streaming a video[edit source]
When using high level utilities such as gst-play or complex GStreamer bins such as playbin, playbin3 or decodebin, decodebin3, hardware acceleration is abstracted to user and automatically selected to achieve the best level of performances.
Refer to gst-play GStreamer command line utility, for examples of "how to play audio/video files" or "how to stream content on STM32 board".
4.4. Encoding a video[edit source]
When using complex GStreamer bins such as encodebin or encodebin2, hardware acceleration is abstracted to user and automatically selected to achieve the best level of performances.
Here is an example with a local encoding of a 10s video test pattern in VP8:
gst-launch-1.0 videotestsrc num-buffers=300 ! video/x-raw, width=640, height=480, framerate=30/1 ! encodebin profile="video/x-vp8" ! matroskamux ! filesink location=v_vp8_640x480_30fps.webm
[...]
Got EOS from element "pipeline0".
Execution ended after 0:00:01.229040368
[...]
Play back the file to check encoded content:
gst-play-1.0 v_vp8_640x480_30fps.webm [...] 0:00:10.0 / 0:00:10.0 Reached end of play list.
4.5. Controlling encoder[edit source]
It is interesting to tune quality, bitrate and I frames refresh to better fit to application requirements. Local video recording from camera requires good image quality with variable bitrate to adapt to image complexity while video streaming or visiophony requires bandwidth respect with constant bitrate dealing with quality tradeoff.
There are no yet common controls at encodebin level to tune quality, bitrate and key frames refresh rate, to do so, the encoder element must be directly controlled:
gst-inspect-1.0 --no-colors v4l2slvp8enc [...] Element Properties: bitrate : Set bitrate target flags: readable, writable Unsigned Integer64. Range: 0 - 4294967295 Default: 100000 keyframe-interval : Interval between keyframes flags: readable, writable Integer. Range: 0 - 2147483647 Default: 30 max-quality : Set upper quality limit (lower number equates to higher quality but more bits) flags: readable, writable Integer. Range: 0 - 63 Default: 63 media-device : Path to the media device node flags: readable, writable String. Default: "/dev/media2" min-force-key-unit-interval: Minimum interval between force-keyunit requests in nanoseconds flags: readable, writable Unsigned Integer64. Range: 0 - 18446744073709551615 Default: 0 min-quality : Set lower quality limit (lower number equates to higher quality but more bits) flags: readable, writable Integer. Range: 0 - 63 Default: 0
For quality: the less value is, better is the quality. Default keyframe interval is 30, ie one entire key frame generated every 1s at 30fps.
encodebin can still be used while tuning encoder with a custom "profile=<video> | element-properties,<property=value>" property. Here are some example to tune quality.
#best quality gst-launch-1.0 -e videotestsrc num-buffers=300 horizontal-speed=3 ! video/x-raw, width=640, height=480, framerate=30/1 ! encodebin profile="video/x-vp8|element-properties,min-quality=0,max-quality=0" ! matroskamux ! filesink location=v_vp8_640x480_30fps_best.webm
#worst quality gst-launch-1.0 -e videotestsrc num-buffers=300 horizontal-speed=3 ! video/x-raw, width=640, height=480, framerate=30/1 ! encodebin profile="video/x-vp8|element-properties,min-quality=63,max-quality=63" ! matroskamux ! filesink location=v_vp8_640x480_30fps_worst.webm
ls -s v_vp8_640x480_30fps_best.webm v_vp8_640x480_30fps_worst.webm 14132 v_vp8_640x480_30fps_best.webm 3804 v_vp8_640x480_30fps_worst.webm
We can see that quality impacts by 4 the size of encoded video.
Here are some examples to tune key-frame refresh rate:
gst-launch-1.0 -e videotestsrc num-buffers=300 horizontal-speed=3 ! video/x-raw, width=640, height=480, framerate=30/1 ! encodebin profile="video/x-vp8|element-properties,keyframe-interval=100" ! matroskamux ! filesink location=v_vp8_640x480_30fps_key_3s.webm
gst-launch-1.0 filesrc location=v_vp8_640x480_30fps_key_3s.webm ! matroskademux ! identity silent=false ! fakesink -v 2>&1 | grep chain | grep -v delta-unit
/GstPipeline:pipeline0/GstIdentity:identity0: last-message = chain ******* (identity0:sink) (47070 bytes, dts: none, pts: 0:00:00.000000000, duration: 0:00:00.033333333, offset: -1, offset_end: -1, flags: 000 04040 discont tag-memory , meta: none) 0x17c547e0 /GstPipeline:pipeline0/GstIdentity:identity0: last-message = chain ******* (identity0:sink) (11495 bytes, dts: none, pts: 0:00:03.033000000, duration: 0:00:00.033333333, offset: -1, offset_end: -1, flags: 000 04000 tag-memory , meta: none) 0x17c546c0 /GstPipeline:pipeline0/GstIdentity:identity0: last-message = chain ******* (identity0:sink) (11706 bytes, dts: none, pts: 0:00:06.067000000, duration: 0:00:00.033333333, offset: -1, offset_end: -1, flags: 000 04000 tag-memory , meta: none) 0x17c545a0
3 key-frames for 10s video which conforms to one key-frames every 100 frames at 30fps.
gst-launch-1.0 -e videotestsrc num-buffers=300 horizontal-speed=3 ! video/x-raw, width=640, height=480, framerate=30/1 ! encodebin profile="video/x-vp8|element-properties,keyframe-interval=30" ! matroskamux ! filesink location=v_vp8_640x480_30fps_key_1s.webm
gst-launch-1.0 filesrc location=v_vp8_640x480_30fps_key_1s.webm ! matroskademux ! identity silent=false ! fakesink -v 2>&1 | grep chain | grep -v delta-unit
/GstPipeline:pipeline0/GstIdentity:identity0: last-message = chain ******* (identity0:sink) (47070 bytes, dts: none, pts: 0:00:00.000000000, duration: 0:00:00.033333333, offset: -1, offset_end: -1, flags: 000 04040 discont tag-memory , meta: none) 0x217186c0 /GstPipeline:pipeline0/GstIdentity:identity0: last-message = chain ******* (identity0:sink) (19478 bytes, dts: none, pts: 0:00:01.033000000, duration: 0:00:00.033333333, offset: -1, offset_end: -1, flags: 000 04000 tag-memory , meta: none) 0x217187e0 /GstPipeline:pipeline0/GstIdentity:identity0: last-message = chain ******* (identity0:sink) (11813 bytes, dts: none, pts: 0:00:02.067000000, duration: 0:00:00.033333333, offset: -1, offset_end: -1, flags: 000 04000 tag-memory , meta: none) 0x21718a20 /GstPipeline:pipeline0/GstIdentity:identity0: last-message = chain ******* (identity0:sink) (11688 bytes, dts: none, pts: 0:00:03.100000000, duration: 0:00:00.033333333, offset: -1, offset_end: -1, flags: 000 04000 tag-memory , meta: none) 0x217186c0 /GstPipeline:pipeline0/GstIdentity:identity0: last-message = chain ******* (identity0:sink) (11627 bytes, dts: none, pts: 0:00:04.133000000, duration: 0:00:00.033333333, offset: -1, offset_end: -1, flags: 000 04000 tag-memory , meta: none) 0x217185a0 /GstPipeline:pipeline0/GstIdentity:identity0: last-message = chain ******* (identity0:sink) (11576 bytes, dts: none, pts: 0:00:05.167000000, duration: 0:00:00.033333333, offset: -1, offset_end: -1, flags: 000 04000 tag-memory , meta: none) 0x21718a20 /GstPipeline:pipeline0/GstIdentity:identity0: last-message = chain ******* (identity0:sink) (11602 bytes, dts: none, pts: 0:00:06.200000000, duration: 0:00:00.033333333, offset: -1, offset_end: -1, flags: 000 04000 tag-memory , meta: none) 0x217186c0 /GstPipeline:pipeline0/GstIdentity:identity0: last-message = chain ******* (identity0:sink) (11785 bytes, dts: none, pts: 0:00:07.233000000, duration: 0:00:00.033333333, offset: -1, offset_end: -1, flags: 000 04000 tag-memory , meta: none) 0x217185a0 /GstPipeline:pipeline0/GstIdentity:identity0: last-message = chain ******* (identity0:sink) (11515 bytes, dts: none, pts: 0:00:08.267000000, duration: 0:00:00.033333333, offset: -1, offset_end: -1, flags: 000 04000 tag-memory , meta: none) 0x21718a20 /GstPipeline:pipeline0/GstIdentity:identity0: last-message = chain ******* (identity0:sink) (11637 bytes, dts: none, pts: 0:00:09.300000000, duration: 0:00:00.033333333, offset: -1, offset_end: -1, flags: 000 04000 tag-memory , meta: none) 0x217187e0
10 key-frames for 10s video which conforms to one key-frames every 30 frames at 30fps.
4.6. Audio/Video encoding[edit source]
encodebin can handle both video and audio track by connecting an audio source to audio_0 encodebin pad while specifying a profile which handles both audio & video like webm profile which will encode video to VP8 format and audio to Vorbis format: Here is an example with an audio tone generator:
gst-launch-1.0 videotestsrc num-buffers=300 ! video/x-raw, width=640, height=480, framerate=30/1 ! encodebin name=encoder profile="webm" ! filesink location=av_vp8_640x480_vorbis.webm \ audiotestsrc num-buffers=400 ! encoder.audio_0
Use gst-discoverer to check back encoded content:
gst-discoverer-1.0 av_vp8_640x480_vorbis.webm [...] container #0: WebM video #1: VP8 Width: 640 Height: 480 Depth: 24 Frame rate: 30/1 audio #2: Vorbis Channels: 1 (unknown layout) Sample rate: 44100 Depth: 32 Bitrate: 80000
4.7. Pictures streaming over network[edit source]
Refer to How to stream RAW camera over network article to get some examples on how to stream camera content over network using encodebin.
5. How to trace and debug[edit source]
5.1. How to monitor[edit source]
5.1.1. Check of devicetree configuration[edit source]
Here are some commands to verify that VDEC and VENC are enabled and log details about devicetree configuration:
echo "#!/bin/bash" > dtdumpentry.sh;echo "hexdump -e '\"=\"' -e '20/1 \"%c\"\"\t\"' -e '20/1 \"%02x\"\"\n\"' \$1" >> dtdumpentry.sh;chmod +x dtdumpentry.sh echo "#!/bin/bash" > dtdump.sh;echo "find \$1* -type f -print0 -exec ./dtdumpentry.sh {} \;" >> dtdump.sh;chmod +x dtdump.sh
rm ~/devicetree.txt echo "[devicetree]" >> ~/devicetree.txt echo "|-[vdec]" >> ~/devicetree.txt dtdump.sh /proc/device-tree/soc/rifsc@42080000/vdec@480d0000 | sed 's/\/proc\/device-tree\/soc\/rifsc@42080000\//| |-/' >> ~/devicetree.txt echo "|" >> ~/devicetree.txt echo "|-[venc]" >> ~/devicetree.txt dtdump.sh /proc/device-tree/soc/rifsc@42080000/venc@480e0000 | sed 's/\/proc\/device-tree\/soc\/rifsc@42080000\//| |-/' >> ~/devicetree.txt echo "|" >> ~/devicetree.txt cat ~/devicetree.txt
[devicetree] |-[vdec] | |-vdec@480d0000/clock-names=vdec-clk 766465632d636c6b00 | |-vdec@480d0000/resets=C 0000000700004320 | |-vdec@480d0000/interrupts=u 000000000000007500000004 | |-vdec@480d0000/clocks=� 00000007000000e5 | |-vdec@480d0000/feature-domains=Y 0000000a00000059 | |-vdec@480d0000/compatible=st,stm32mp25-vdec 73742c73746d33326d7032352d7664656300 | |-vdec@480d0000/interrupt-names=vdec 7664656300 | |-vdec@480d0000/phandle=� 000000db | |-vdec@480d0000/name=vdec 7664656300 | |-[venc] | |-venc@480e0000/clock-names=venc-clk 76656e632d636c6b00 | |-venc@480e0000/resets=C@ 0000000700004340 | |-venc@480e0000/interrupts=性 00000000000000a700000004 | |-venc@480e0000/clocks=� 00000007000000e6 | |-venc@480e0000/feature-domains=Z 0000000a0000005a | |-venc@480e0000/compatible=st,stm32mp25-venc 73742c73746d33326d7032352d76656e6300 | |-venc@480e0000/interrupt-names=venc 76656e6300 | |-venc@480e0000/reg=H 480e000000000800 | |-venc@480e0000/phandle=� 000000dc | |-venc@480e0000/reset-names=venc-rst 76656e632d72737400 | |-venc@480e0000/name=venc 76656e6300
5.2. How to trace[edit source]
5.2.1. V4L2 userland API tracing[edit source]
Tracing of V4L2 userland API[3] can be enabled using command:
echo 0x3 > /sys/devices/platform/soc/42080000.rifsc/480d0000.vdec/video4linux/video0/dev_debug echo 0x3 > /sys/devices/platform/soc/42080000.rifsc/480e0000.venc/video4linux/video1/dev_debug
Traces are output in kernel log buffer (dmesg).
Trace after a video decoding:
gst-play-1.0 v_vp8_640x480_short.webm dmesg
[ 7540.785769] video0: VIDIOC_QUERYCAP: driver=hantro-vpu, card=st,stm32mp25-vdec-dec, bus=platform: hantro-vpu, version=0x0006011c, capabilities=0x84204000, device_caps=0x04204000 [ 7540.785813] video0: VIDIOC_ENUM_FMT: index=0, type=vid-out-mplane, flags=0x1, pixelformat=VP8F little-endian (0x46385056), mbus_code=0x0000, description='VP8 Frame' [ 7540.785858] video0: VIDIOC_S_FMT: type=vid-out-mplane, width=320, height=240, format=VP8F little-endian (0x46385056), field=none, colorspace=0, num_planes=1, flags=0x0, ycbcr_enc=0, quantization=0, xfer_fun0 [ 7540.785883] plane 0: bytesperline=0 sizeimage=262144 [ 7540.785894] video0: VIDIOC_G_FMT: type=vid-cap-mplane, width=320, height=240, format=NV12 little-endian (0x3231564e), field=none, colorspace=0, num_planes=1, flags=0x0, ycbcr_enc=0, quantization=0, xfer_fun0 [ 7540.785916] plane 0: bytesperline=320 sizeimage=115200 [ 7540.785951] video0: VIDIOC_ENUM_FRAMESIZES: error -25: index=0, pixelformat=NV12 little-endian (0x3231564e), type=0 [ 7540.785976] video0: VIDIOC_ENUM_FMT: index=0, type=vid-cap-mplane, flags=0x0, pixelformat=NV12 little-endian (0x3231564e), mbus_code=0x0000, description='Y/UV 4:2:0' [ 7540.786002] video0: VIDIOC_ENUM_FRAMESIZES: error -25: index=0, pixelformat=NV12 little-endian (0x3231564e), type=0 [ 7540.786039] video0: VIDIOC_ENUM_FMT: error -22: index=1, type=vid-cap-mplane, flags=0x0, pixelformat=.... little-endian (0x00000000), mbus_code=0x0000, description='' [ 7540.786308] video0: VIDIOC_ENUM_FMT: index=1, type=vid-out-mplane, flags=0x1, pixelformat=S264 little-endian (0x34363253), mbus_code=0x0000, description='H.264 Parsed Slice Data' [ 7540.786345] video0: VIDIOC_S_FMT: type=vid-out-mplane, width=320, height=240, format=S264 little-endian (0x34363253), field=none, colorspace=0, num_planes=1, flags=0x0, ycbcr_enc=0, quantization=0, xfer_fun0 [ 7540.786369] plane 0: bytesperline=0 sizeimage=262144 [ 7540.786378] video0: VIDIOC_G_FMT: type=vid-cap-mplane, width=320, height=240, format=NV12 little-endian (0x3231564e), field=none, colorspace=0, num_planes=1, flags=0x0, ycbcr_enc=0, quantization=0, xfer_fun0 [ 7540.786401] plane 0: bytesperline=320 sizeimage=134432 [ 7540.786416] video0: VIDIOC_ENUM_FRAMESIZES: error -25: index=0, pixelformat=NV12 little-endian (0x3231564e), type=0 [ 7540.786440] video0: VIDIOC_ENUM_FMT: index=0, type=vid-cap-mplane, flags=0x0, pixelformat=NV12 little-endian (0x3231564e), mbus_code=0x0000, description='Y/UV 4:2:0' [ 7540.786465] video0: VIDIOC_ENUM_FRAMESIZES: error -25: index=0, pixelformat=NV12 little-endian (0x3231564e), type=0 [ 7540.786492] video0: VIDIOC_ENUM_FMT: error -22: index=1, type=vid-cap-mplane, flags=0x0, pixelformat=.... little-endian (0x00000000), mbus_code=0x0000, description='' [ 7540.786519] video0: VIDIOC_QUERY_EXT_CTRL: id=0xa40902, type=512, name=H264 Sequence Parameter Set, min/max=0/0, step=0, default=0, flags=0x00000100, elem_size=1048, elems=1, nr_of_dims=0, dims=0,0,0,0 [ 7540.786545] video0: VIDIOC_QUERY_EXT_CTRL: id=0xa40903, type=513, name=H264 Picture Parameter Set, min/max=0/0, step=0, default=0, flags=0x00000100, elem_size=12, elems=1, nr_of_dims=0, dims=0,0,0,0 [ 7540.786571] video0: VIDIOC_QUERY_EXT_CTRL: id=0xa40904, type=514, name=H264 Scaling Matrix, min/max=0/0, step=0, default=0, flags=0x00000100, elem_size=480, elems=1, nr_of_dims=0, dims=0,0,0,0 [ 7540.786596] video0: VIDIOC_QUERY_EXT_CTRL: id=0xa40907, type=516, name=H264 Decode Parameters, min/max=0/0, step=0, default=0, flags=0x00000100, elem_size=560, elems=1, nr_of_dims=0, dims=0,0,0,0 [ 7540.786621] video0: VIDIOC_QUERY_EXT_CTRL: error -22: id=0xa40906, type=0, name=, min/max=0/0, step=0, default=0, flags=0x00000000, elem_size=0, elems=0, nr_of_dims=0, dims=0,0,0,0 [ 7540.786648] video0: VIDIOC_QUERY_EXT_CTRL: error -22: id=0xa40905, type=0, name=, min/max=0/0, step=0, default=0, flags=0x00000000, elem_size=0, elems=0, nr_of_dims=0, dims=0,0,0,0 [ 7540.786720] video0: VIDIOC_ENUM_FMT: error -22: index=2, type=vid-out-mplane, flags=0x0, pixelformat=.... little-endian (0x00000000), mbus_code=0x0000, description='' [ 7540.787879] video0: VIDIOC_QUERYCAP: driver=hantro-vpu, card=st,stm32mp25-vdec-dec, bus=platform: hantro-vpu, version=0x0006011c, capabilities=0x84204000, device_caps=0x04204000 [ 7540.850887] video0: VIDIOC_S_FMT: type=vid-out-mplane, width=640, height=480, format=VP8F little-endian (0x46385056), field=none, colorspace=0, num_planes=1, flags=0x0, ycbcr_enc=0, quantization=0, xfer_fun0 [ 7540.850937] plane 0: bytesperline=0 sizeimage=460800 [ 7540.850964] video0: VIDIOC_S_EXT_CTRLS: which=0x0, count=1, error_idx=0, request_fd=0, name=VP8 Frame Parameters, id/size=0xa409c8/1232 [ 7540.850996] video0: VIDIOC_G_FMT: type=vid-cap-mplane, width=640, height=480, format=NV12 little-endian (0x3231564e), field=none, colorspace=0, num_planes=1, flags=0x0, ycbcr_enc=0, quantization=0, xfer_fun0 [ 7540.851019] plane 0: bytesperline=640 sizeimage=460800 [ 7540.851041] video0: VIDIOC_ENUM_FRAMESIZES: error -25: index=0, pixelformat=NV12 little-endian (0x3231564e), type=0 [ 7540.851069] video0: VIDIOC_ENUM_FMT: index=0, type=vid-cap-mplane, flags=0x0, pixelformat=NV12 little-endian (0x3231564e), mbus_code=0x0000, description='Y/UV 4:2:0' [ 7540.851095] video0: VIDIOC_ENUM_FRAMESIZES: error -25: index=0, pixelformat=NV12 little-endian (0x3231564e), type=0 [ 7540.851125] video0: VIDIOC_ENUM_FMT: error -22: index=1, type=vid-cap-mplane, flags=0x0, pixelformat=.... little-endian (0x00000000), mbus_code=0x0000, description='' [ 7540.861871] video0: VIDIOC_G_FMT: type=vid-cap-mplane, width=640, height=480, format=NV12 little-endian (0x3231564e), field=none, colorspace=0, num_planes=1, flags=0x0, ycbcr_enc=0, quantization=0, xfer_fun0 [ 7540.861917] plane 0: bytesperline=640 sizeimage=460800 [ 7540.902656] video0: VIDIOC_REQBUFS: count=2, type=vid-out-mplane, memory=mmap [ 7540.902710] video0: VIDIOC_QUERYBUF: 00:00:00.000000 index=0, type=vid-out-mplane, request_fd=0, flags=0x00004000, field=any, sequence=0, memory=mmap [ 7540.902734] plane 0: bytesused=0, data_offset=0x00000000, offset/userptr=0x0, length=460800 [ 7540.902742] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000 [ 7540.902788] video0: VIDIOC_EXPBUF: fd=14, type=vid-out-mplane, index=0, plane=0, flags=0x00080002 [ 7540.902834] video0: VIDIOC_QUERYBUF: 00:00:00.000000 index=0, type=vid-out-mplane, request_fd=0, flags=0x00004001, field=any, sequence=0, memory=mmap [ 7540.902856] plane 0: bytesused=0, data_offset=0x00000000, offset/userptr=0x0, length=460800 [ 7540.902863] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000 [ 7540.902891] video0: VIDIOC_EXPBUF: fd=15, type=vid-out-mplane, index=1, plane=0, flags=0x00080002 [ 7540.903739] video0: VIDIOC_REQBUFS: count=6, type=vid-cap-mplane, memory=mmap [ 7540.903764] video0: VIDIOC_QUERYBUF: 00:00:00.000000 index=0, type=vid-cap-mplane, request_fd=0, flags=0x00004000, field=any, sequence=0, memory=mmap [ 7540.903786] plane 0: bytesused=0, data_offset=0x00000000, offset/userptr=0x40000000, length=460800 [ 7540.903793] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000 [ 7540.903816] video0: VIDIOC_EXPBUF: fd=16, type=vid-cap-mplane, index=0, plane=0, flags=0x00080002 [ 7540.903845] video0: VIDIOC_QUERYBUF: 00:00:00.000000 index=0, type=vid-cap-mplane, request_fd=0, flags=0x00004001, field=any, sequence=0, memory=mmap [ 7540.903867] plane 0: bytesused=0, data_offset=0x00000000, offset/userptr=0x40000000, length=460800 [ 7540.903874] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000 [ 7540.903894] video0: VIDIOC_EXPBUF: fd=17, type=vid-cap-mplane, index=1, plane=0, flags=0x00080002 [ 7540.903947] video0: VIDIOC_QUERYBUF: 00:00:00.000000 index=0, type=vid-cap-mplane, request_fd=0, flags=0x00004001, field=any, sequence=0, memory=mmap [ 7540.903969] plane 0: bytesused=0, data_offset=0x00000000, offset/userptr=0x40000000, length=460800 [ 7540.903976] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000 [ 7540.903998] video0: VIDIOC_EXPBUF: fd=18, type=vid-cap-mplane, index=2, plane=0, flags=0x00080002 [ 7540.904023] video0: VIDIOC_QUERYBUF: 00:00:00.000000 index=0, type=vid-cap-mplane, request_fd=0, flags=0x00004001, field=any, sequence=0, memory=mmap [ 7540.904044] plane 0: bytesused=0, data_offset=0x00000000, offset/userptr=0x40000000, length=460800 [ 7540.904051] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000 [ 7540.904074] video0: VIDIOC_EXPBUF: fd=19, type=vid-cap-mplane, index=3, plane=0, flags=0x00080002 [ 7540.904100] video0: VIDIOC_QUERYBUF: 00:00:00.000000 index=0, type=vid-cap-mplane, request_fd=0, flags=0x00004001, field=any, sequence=0, memory=mmap [ 7540.904122] plane 0: bytesused=0, data_offset=0x00000000, offset/userptr=0x40000000, length=460800 [ 7540.904129] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000 [ 7540.904149] video0: VIDIOC_EXPBUF: fd=20, type=vid-cap-mplane, index=4, plane=0, flags=0x00080002 [ 7540.904174] video0: VIDIOC_QUERYBUF: 00:00:00.000000 index=0, type=vid-cap-mplane, request_fd=0, flags=0x00004001, field=any, sequence=0, memory=mmap [ 7540.904195] plane 0: bytesused=0, data_offset=0x00000000, offset/userptr=0x40000000, length=460800 [ 7540.904202] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000 [ 7540.904241] video0: VIDIOC_EXPBUF: fd=21, type=vid-cap-mplane, index=5, plane=0, flags=0x00080002 [ 7540.904897] video0: VIDIOC_STREAMON: type=vid-out-mplane [ 7540.904922] video0: VIDIOC_STREAMON: type=vid-cap-mplane [ 7540.905172] video0: VIDIOC_S_EXT_CTRLS: which=0xf010000, count=1, error_idx=0, request_fd=26, name=VP8 Frame Parameters, id/size=0xa409c8/1232 [ 7540.905697] video0: VIDIOC_S_EXT_CTRLS: which=0xf010000, count=1, error_idx=0, request_fd=29, name=VP8 Frame Parameters, id/size=0xa409c8/1232 [ 7540.997351] video0: VIDIOC_STREAMOFF: type=vid-out-mplane [ 7540.997457] video0: VIDIOC_STREAMOFF: type=vid-cap-mplane [ 7540.997484] video0: VIDIOC_REQBUFS: count=0, type=vid-out-mplane, memory=mmap [ 7540.997790] video0: VIDIOC_REQBUFS: count=0, type=vid-cap-mplane, memory=mmap
Trace after a video encoding:
gst-launch-1.0 videotestsrc num-buffers=2 ! video/x-raw, width=640, height=480, framerate=30/1 ! encodebin profile="video/x-vp8" ! matroskamux ! filesink location=v_vp8_640x480_short.webm dmesg
[ 8309.136707] video0: VIDIOC_QUERYCAP: driver=hantro-vpu, card=st,stm32mp25-vdec-dec, bus=platform: hantro-vpu, version=0x0006011c, capabilities=0x84204000, device_caps=0x04204000 [ 8309.136751] video0: VIDIOC_ENUM_FMT: index=0, type=vid-out-mplane, flags=0x1, pixelformat=VP8F little-endian (0x46385056), mbus_code=0x0000, description='VP8 Frame' [ 8309.136791] video0: VIDIOC_S_FMT: type=vid-out-mplane, width=320, height=240, format=VP8F little-endian (0x46385056), field=none, colorspace=0, num_planes=1, flags=0x0, ycbcr_enc=0, quantization=0, xfer_fun0 [ 8309.136816] plane 0: bytesperline=0 sizeimage=262144 [ 8309.136827] video0: VIDIOC_G_FMT: type=vid-cap-mplane, width=320, height=240, format=NV12 little-endian (0x3231564e), field=none, colorspace=0, num_planes=1, flags=0x0, ycbcr_enc=0, quantization=0, xfer_fun0 [ 8309.136849] plane 0: bytesperline=320 sizeimage=115200 [ 8309.136941] video0: VIDIOC_ENUM_FRAMESIZES: error -25: index=0, pixelformat=NV12 little-endian (0x3231564e), type=0 [ 8309.136967] video0: VIDIOC_ENUM_FMT: index=0, type=vid-cap-mplane, flags=0x0, pixelformat=NV12 little-endian (0x3231564e), mbus_code=0x0000, description='Y/UV 4:2:0' [ 8309.136993] video0: VIDIOC_ENUM_FRAMESIZES: error -25: index=0, pixelformat=NV12 little-endian (0x3231564e), type=0 [ 8309.137034] video0: VIDIOC_ENUM_FMT: error -22: index=1, type=vid-cap-mplane, flags=0x0, pixelformat=.... little-endian (0x00000000), mbus_code=0x0000, description='' [ 8309.137271] video0: VIDIOC_ENUM_FMT: index=1, type=vid-out-mplane, flags=0x1, pixelformat=S264 little-endian (0x34363253), mbus_code=0x0000, description='H.264 Parsed Slice Data' [ 8309.137304] video0: VIDIOC_S_FMT: type=vid-out-mplane, width=320, height=240, format=S264 little-endian (0x34363253), field=none, colorspace=0, num_planes=1, flags=0x0, ycbcr_enc=0, quantization=0, xfer_fun0 [ 8309.137328] plane 0: bytesperline=0 sizeimage=262144 [ 8309.137337] video0: VIDIOC_G_FMT: type=vid-cap-mplane, width=320, height=240, format=NV12 little-endian (0x3231564e), field=none, colorspace=0, num_planes=1, flags=0x0, ycbcr_enc=0, quantization=0, xfer_fun0 [ 8309.137360] plane 0: bytesperline=320 sizeimage=134432 [ 8309.137375] video0: VIDIOC_ENUM_FRAMESIZES: error -25: index=0, pixelformat=NV12 little-endian (0x3231564e), type=0 [ 8309.137398] video0: VIDIOC_ENUM_FMT: index=0, type=vid-cap-mplane, flags=0x0, pixelformat=NV12 little-endian (0x3231564e), mbus_code=0x0000, description='Y/UV 4:2:0' [ 8309.137423] video0: VIDIOC_ENUM_FRAMESIZES: error -25: index=0, pixelformat=NV12 little-endian (0x3231564e), type=0 [ 8309.137450] video0: VIDIOC_ENUM_FMT: error -22: index=1, type=vid-cap-mplane, flags=0x0, pixelformat=.... little-endian (0x00000000), mbus_code=0x0000, description='' [ 8309.137476] video0: VIDIOC_QUERY_EXT_CTRL: id=0xa40902, type=512, name=H264 Sequence Parameter Set, min/max=0/0, step=0, default=0, flags=0x00000100, elem_size=1048, elems=1, nr_of_dims=0, dims=0,0,0,0 [ 8309.137502] video0: VIDIOC_QUERY_EXT_CTRL: id=0xa40903, type=513, name=H264 Picture Parameter Set, min/max=0/0, step=0, default=0, flags=0x00000100, elem_size=12, elems=1, nr_of_dims=0, dims=0,0,0,0 [ 8309.137527] video0: VIDIOC_QUERY_EXT_CTRL: id=0xa40904, type=514, name=H264 Scaling Matrix, min/max=0/0, step=0, default=0, flags=0x00000100, elem_size=480, elems=1, nr_of_dims=0, dims=0,0,0,0 [ 8309.137552] video0: VIDIOC_QUERY_EXT_CTRL: id=0xa40907, type=516, name=H264 Decode Parameters, min/max=0/0, step=0, default=0, flags=0x00000100, elem_size=560, elems=1, nr_of_dims=0, dims=0,0,0,0 [ 8309.137577] video0: VIDIOC_QUERY_EXT_CTRL: error -22: id=0xa40906, type=0, name=, min/max=0/0, step=0, default=0, flags=0x00000000, elem_size=0, elems=0, nr_of_dims=0, dims=0,0,0,0 [ 8309.137603] video0: VIDIOC_QUERY_EXT_CTRL: error -22: id=0xa40905, type=0, name=, min/max=0/0, step=0, default=0, flags=0x00000000, elem_size=0, elems=0, nr_of_dims=0, dims=0,0,0,0 [ 8309.137672] video0: VIDIOC_ENUM_FMT: error -22: index=2, type=vid-out-mplane, flags=0x0, pixelformat=.... little-endian (0x00000000), mbus_code=0x0000, description='' [ 8309.137920] video1: VIDIOC_QUERYCAP: driver=hantro-vpu, card=st,stm32mp25-venc-enc, bus=platform: hantro-vpu, version=0x0006011c, capabilities=0x84204000, device_caps=0x04204000 [ 8309.137946] video1: VIDIOC_ENUM_FMT: index=0, type=vid-cap-mplane, flags=0x1, pixelformat=JPEG little-endian (0x4745504a), mbus_code=0x0000, description='JFIF JPEG' [ 8309.137968] video1: VIDIOC_ENUM_FMT: index=1, type=vid-cap-mplane, flags=0x1, pixelformat=VP8F little-endian (0x46385056), mbus_code=0x0000, description='VP8 Frame' [ 8309.137995] video1: VIDIOC_QUERY_EXT_CTRL: id=0xa40af5, type=640, name=VP8 Encode Parameters, min/max=0/0, step=0, default=0, flags=0x00000100, elem_size=20, elems=1, nr_of_dims=0, dims=0,0,0,0 [ 8309.138021] video1: VIDIOC_QUERY_EXT_CTRL: id=0xa40af6, type=1, name=VP8 Encode QP, min/max=0/127, step=1, default=0, flags=0x00000000, elem_size=4, elems=1, nr_of_dims=0, dims=0,0,0,0 [ 8309.138137] video1: VIDIOC_ENUM_FMT: error -22: index=2, type=vid-cap-mplane, flags=0x0, pixelformat=.... little-endian (0x00000000), mbus_code=0x0000, description='' [ 8309.168457] video1: VIDIOC_QUERYCAP: driver=hantro-vpu, card=st,stm32mp25-venc-enc, bus=platform: hantro-vpu, version=0x0006011c, capabilities=0x84204000, device_caps=0x04204000 [ 8309.173895] video1: VIDIOC_G_FMT: type=vid-out-mplane, width=96, height=32, format=NV12 little-endian (0x3231564e), field=none, colorspace=7, num_planes=1, flags=0x0, ycbcr_enc=0, quantization=0, xfer_func=0 [ 8309.173937] plane 0: bytesperline=96 sizeimage=4608 [ 8309.173968] video1: VIDIOC_ENUM_FMT: index=0, type=vid-out-mplane, flags=0x0, pixelformat=NV12 little-endian (0x3231564e), mbus_code=0x0000, description='Y/UV 4:2:0' [ 8309.173994] video1: VIDIOC_ENUM_FMT: index=1, type=vid-out-mplane, flags=0x0, pixelformat=YM12 little-endian (0x32314d59), mbus_code=0x0000, description='Planar YUV 4:2:0 (N-C)' [ 8309.174017] video1: VIDIOC_ENUM_FMT: index=2, type=vid-out-mplane, flags=0x0, pixelformat=NM12 little-endian (0x32314d4e), mbus_code=0x0000, description='Y/UV 4:2:0 (N-C)' [ 8309.174040] video1: VIDIOC_ENUM_FMT: index=3, type=vid-out-mplane, flags=0x0, pixelformat=YUYV little-endian (0x56595559), mbus_code=0x0000, description='YUYV 4:2:2' [ 8309.174062] video1: VIDIOC_ENUM_FMT: index=4, type=vid-out-mplane, flags=0x0, pixelformat=UYVY little-endian (0x59565955), mbus_code=0x0000, description='UYVY 4:2:2' [ 8309.174084] video1: VIDIOC_ENUM_FMT: index=5, type=vid-out-mplane, flags=0x0, pixelformat=RGBP little-endian (0x50424752), mbus_code=0x0000, description='16-bit RGB 5-6-5' [ 8309.174106] video1: VIDIOC_ENUM_FMT: index=6, type=vid-out-mplane, flags=0x0, pixelformat=XR24 little-endian (0x34325258), mbus_code=0x0000, description='32-bit BGRX 8-8-8-8' [ 8309.174130] video1: VIDIOC_ENUM_FMT: index=7, type=vid-out-mplane, flags=0x0, pixelformat=BGR4 little-endian (0x34524742), mbus_code=0x0000, description='32-bit BGRA/X 8-8-8-8' [ 8309.174153] video1: VIDIOC_ENUM_FMT: index=8, type=vid-out-mplane, flags=0x0, pixelformat=XB24 little-endian (0x34324258), mbus_code=0x0000, description='32-bit RGBX 8-8-8-8' [ 8309.174176] video1: VIDIOC_ENUM_FMT: index=9, type=vid-out-mplane, flags=0x0, pixelformat=RX24 little-endian (0x34325852), mbus_code=0x0000, description='32-bit XBGR 8-8-8-8' [ 8309.174200] video1: VIDIOC_ENUM_FMT: index=10, type=vid-out-mplane, flags=0x0, pixelformat=BX24 little-endian (0x34325842), mbus_code=0x0000, description='32-bit XRGB 8-8-8-8' [ 8309.174223] video1: VIDIOC_ENUM_FMT: index=11, type=vid-out-mplane, flags=0x0, pixelformat=RGB4 little-endian (0x34424752), mbus_code=0x0000, description='32-bit A/XRGB 8-8-8-8' [ 8309.174245] video1: VIDIOC_ENUM_FMT: error -22: index=12, type=vid-out-mplane, flags=0x0, pixelformat=.... little-endian (0x00000000), mbus_code=0x0000, description='' [ 8309.186999] video1: VIDIOC_G_FMT: type=vid-out-mplane, width=96, height=32, format=NV12 little-endian (0x3231564e), field=none, colorspace=7, num_planes=1, flags=0x0, ycbcr_enc=0, quantization=0, xfer_func=0 [ 8309.187049] plane 0: bytesperline=96 sizeimage=4608 [ 8309.187077] video1: VIDIOC_ENUM_FMT: index=0, type=vid-out-mplane, flags=0x0, pixelformat=NV12 little-endian (0x3231564e), mbus_code=0x0000, description='Y/UV 4:2:0' [ 8309.187103] video1: VIDIOC_ENUM_FMT: index=1, type=vid-out-mplane, flags=0x0, pixelformat=YM12 little-endian (0x32314d59), mbus_code=0x0000, description='Planar YUV 4:2:0 (N-C)' [ 8309.187126] video1: VIDIOC_ENUM_FMT: index=2, type=vid-out-mplane, flags=0x0, pixelformat=NM12 little-endian (0x32314d4e), mbus_code=0x0000, description='Y/UV 4:2:0 (N-C)' [ 8309.187149] video1: VIDIOC_ENUM_FMT: index=3, type=vid-out-mplane, flags=0x0, pixelformat=YUYV little-endian (0x56595559), mbus_code=0x0000, description='YUYV 4:2:2' [ 8309.187172] video1: VIDIOC_ENUM_FMT: index=4, type=vid-out-mplane, flags=0x0, pixelformat=UYVY little-endian (0x59565955), mbus_code=0x0000, description='UYVY 4:2:2' [ 8309.187193] video1: VIDIOC_ENUM_FMT: index=5, type=vid-out-mplane, flags=0x0, pixelformat=RGBP little-endian (0x50424752), mbus_code=0x0000, description='16-bit RGB 5-6-5' [ 8309.187215] video1: VIDIOC_ENUM_FMT: index=6, type=vid-out-mplane, flags=0x0, pixelformat=XR24 little-endian (0x34325258), mbus_code=0x0000, description='32-bit BGRX 8-8-8-8' [ 8309.187238] video1: VIDIOC_ENUM_FMT: index=7, type=vid-out-mplane, flags=0x0, pixelformat=BGR4 little-endian (0x34524742), mbus_code=0x0000, description='32-bit BGRA/X 8-8-8-8' [ 8309.187261] video1: VIDIOC_ENUM_FMT: index=8, type=vid-out-mplane, flags=0x0, pixelformat=XB24 little-endian (0x34324258), mbus_code=0x0000, description='32-bit RGBX 8-8-8-8' [ 8309.187284] video1: VIDIOC_ENUM_FMT: index=9, type=vid-out-mplane, flags=0x0, pixelformat=RX24 little-endian (0x34325852), mbus_code=0x0000, description='32-bit XBGR 8-8-8-8' [ 8309.187309] video1: VIDIOC_ENUM_FMT: index=10, type=vid-out-mplane, flags=0x0, pixelformat=BX24 little-endian (0x34325842), mbus_code=0x0000, description='32-bit XRGB 8-8-8-8' [ 8309.187333] video1: VIDIOC_ENUM_FMT: index=11, type=vid-out-mplane, flags=0x0, pixelformat=RGB4 little-endian (0x34424752), mbus_code=0x0000, description='32-bit A/XRGB 8-8-8-8' [ 8309.187356] video1: VIDIOC_ENUM_FMT: error -22: index=12, type=vid-out-mplane, flags=0x0, pixelformat=.... little-endian (0x00000000), mbus_code=0x0000, description='' [ 8309.205616] video1: VIDIOC_G_FMT: type=vid-out-mplane, width=96, height=32, format=NV12 little-endian (0x3231564e), field=none, colorspace=7, num_planes=1, flags=0x0, ycbcr_enc=0, quantization=0, xfer_func=0 [ 8309.205669] plane 0: bytesperline=96 sizeimage=4608 [ 8309.205701] video1: VIDIOC_ENUM_FMT: index=0, type=vid-out-mplane, flags=0x0, pixelformat=NV12 little-endian (0x3231564e), mbus_code=0x0000, description='Y/UV 4:2:0' [ 8309.205728] video1: VIDIOC_ENUM_FMT: index=1, type=vid-out-mplane, flags=0x0, pixelformat=YM12 little-endian (0x32314d59), mbus_code=0x0000, description='Planar YUV 4:2:0 (N-C)' [ 8309.205752] video1: VIDIOC_ENUM_FMT: index=2, type=vid-out-mplane, flags=0x0, pixelformat=NM12 little-endian (0x32314d4e), mbus_code=0x0000, description='Y/UV 4:2:0 (N-C)' [ 8309.205775] video1: VIDIOC_ENUM_FMT: index=3, type=vid-out-mplane, flags=0x0, pixelformat=YUYV little-endian (0x56595559), mbus_code=0x0000, description='YUYV 4:2:2' [ 8309.205798] video1: VIDIOC_ENUM_FMT: index=4, type=vid-out-mplane, flags=0x0, pixelformat=UYVY little-endian (0x59565955), mbus_code=0x0000, description='UYVY 4:2:2' [ 8309.205820] video1: VIDIOC_ENUM_FMT: index=5, type=vid-out-mplane, flags=0x0, pixelformat=RGBP little-endian (0x50424752), mbus_code=0x0000, description='16-bit RGB 5-6-5' [ 8309.205842] video1: VIDIOC_ENUM_FMT: index=6, type=vid-out-mplane, flags=0x0, pixelformat=XR24 little-endian (0x34325258), mbus_code=0x0000, description='32-bit BGRX 8-8-8-8' [ 8309.205866] video1: VIDIOC_ENUM_FMT: index=7, type=vid-out-mplane, flags=0x0, pixelformat=BGR4 little-endian (0x34524742), mbus_code=0x0000, description='32-bit BGRA/X 8-8-8-8' [ 8309.205889] video1: VIDIOC_ENUM_FMT: index=8, type=vid-out-mplane, flags=0x0, pixelformat=XB24 little-endian (0x34324258), mbus_code=0x0000, description='32-bit RGBX 8-8-8-8' [ 8309.205911] video1: VIDIOC_ENUM_FMT: index=9, type=vid-out-mplane, flags=0x0, pixelformat=RX24 little-endian (0x34325852), mbus_code=0x0000, description='32-bit XBGR 8-8-8-8' [ 8309.205936] video1: VIDIOC_ENUM_FMT: index=10, type=vid-out-mplane, flags=0x0, pixelformat=BX24 little-endian (0x34325842), mbus_code=0x0000, description='32-bit XRGB 8-8-8-8' [ 8309.205959] video1: VIDIOC_ENUM_FMT: index=11, type=vid-out-mplane, flags=0x0, pixelformat=RGB4 little-endian (0x34424752), mbus_code=0x0000, description='32-bit A/XRGB 8-8-8-8' [ 8309.205981] video1: VIDIOC_ENUM_FMT: error -22: index=12, type=vid-out-mplane, flags=0x0, pixelformat=.... little-endian (0x00000000), mbus_code=0x0000, description='' [ 8309.216242] video1: VIDIOC_G_FMT: type=vid-out-mplane, width=96, height=32, format=NV12 little-endian (0x3231564e), field=none, colorspace=7, num_planes=1, flags=0x0, ycbcr_enc=0, quantization=0, xfer_func=0 [ 8309.216287] plane 0: bytesperline=96 sizeimage=4608 [ 8309.216315] video1: VIDIOC_ENUM_FMT: index=0, type=vid-out-mplane, flags=0x0, pixelformat=NV12 little-endian (0x3231564e), mbus_code=0x0000, description='Y/UV 4:2:0' [ 8309.216341] video1: VIDIOC_ENUM_FMT: index=1, type=vid-out-mplane, flags=0x0, pixelformat=YM12 little-endian (0x32314d59), mbus_code=0x0000, description='Planar YUV 4:2:0 (N-C)' [ 8309.216364] video1: VIDIOC_ENUM_FMT: index=2, type=vid-out-mplane, flags=0x0, pixelformat=NM12 little-endian (0x32314d4e), mbus_code=0x0000, description='Y/UV 4:2:0 (N-C)' [ 8309.216387] video1: VIDIOC_ENUM_FMT: index=3, type=vid-out-mplane, flags=0x0, pixelformat=YUYV little-endian (0x56595559), mbus_code=0x0000, description='YUYV 4:2:2' [ 8309.216411] video1: VIDIOC_ENUM_FMT: index=4, type=vid-out-mplane, flags=0x0, pixelformat=UYVY little-endian (0x59565955), mbus_code=0x0000, description='UYVY 4:2:2' [ 8309.216432] video1: VIDIOC_ENUM_FMT: index=5, type=vid-out-mplane, flags=0x0, pixelformat=RGBP little-endian (0x50424752), mbus_code=0x0000, description='16-bit RGB 5-6-5' [ 8309.216455] video1: VIDIOC_ENUM_FMT: index=6, type=vid-out-mplane, flags=0x0, pixelformat=XR24 little-endian (0x34325258), mbus_code=0x0000, description='32-bit BGRX 8-8-8-8' [ 8309.216479] video1: VIDIOC_ENUM_FMT: index=7, type=vid-out-mplane, flags=0x0, pixelformat=BGR4 little-endian (0x34524742), mbus_code=0x0000, description='32-bit BGRA/X 8-8-8-8' [ 8309.216502] video1: VIDIOC_ENUM_FMT: index=8, type=vid-out-mplane, flags=0x0, pixelformat=XB24 little-endian (0x34324258), mbus_code=0x0000, description='32-bit RGBX 8-8-8-8' [ 8309.216525] video1: VIDIOC_ENUM_FMT: index=9, type=vid-out-mplane, flags=0x0, pixelformat=RX24 little-endian (0x34325852), mbus_code=0x0000, description='32-bit XBGR 8-8-8-8' [ 8309.216550] video1: VIDIOC_ENUM_FMT: index=10, type=vid-out-mplane, flags=0x0, pixelformat=BX24 little-endian (0x34325842), mbus_code=0x0000, description='32-bit XRGB 8-8-8-8' [ 8309.216573] video1: VIDIOC_ENUM_FMT: index=11, type=vid-out-mplane, flags=0x0, pixelformat=RGB4 little-endian (0x34424752), mbus_code=0x0000, description='32-bit A/XRGB 8-8-8-8' [ 8309.216596] video1: VIDIOC_ENUM_FMT: error -22: index=12, type=vid-out-mplane, flags=0x0, pixelformat=.... little-endian (0x00000000), mbus_code=0x0000, description='' [ 8309.222522] video1: VIDIOC_G_FMT: type=vid-out-mplane, width=96, height=32, format=NV12 little-endian (0x3231564e), field=none, colorspace=7, num_planes=1, flags=0x0, ycbcr_enc=0, quantization=0, xfer_func=0 [ 8309.222565] plane 0: bytesperline=96 sizeimage=4608 [ 8309.222592] video1: VIDIOC_ENUM_FMT: index=0, type=vid-out-mplane, flags=0x0, pixelformat=NV12 little-endian (0x3231564e), mbus_code=0x0000, description='Y/UV 4:2:0' [ 8309.222620] video1: VIDIOC_ENUM_FMT: index=1, type=vid-out-mplane, flags=0x0, pixelformat=YM12 little-endian (0x32314d59), mbus_code=0x0000, description='Planar YUV 4:2:0 (N-C)' [ 8309.222644] video1: VIDIOC_ENUM_FMT: index=2, type=vid-out-mplane, flags=0x0, pixelformat=NM12 little-endian (0x32314d4e), mbus_code=0x0000, description='Y/UV 4:2:0 (N-C)' [ 8309.222667] video1: VIDIOC_ENUM_FMT: index=3, type=vid-out-mplane, flags=0x0, pixelformat=YUYV little-endian (0x56595559), mbus_code=0x0000, description='YUYV 4:2:2' [ 8309.222690] video1: VIDIOC_ENUM_FMT: index=4, type=vid-out-mplane, flags=0x0, pixelformat=UYVY little-endian (0x59565955), mbus_code=0x0000, description='UYVY 4:2:2' [ 8309.222711] video1: VIDIOC_ENUM_FMT: index=5, type=vid-out-mplane, flags=0x0, pixelformat=RGBP little-endian (0x50424752), mbus_code=0x0000, description='16-bit RGB 5-6-5' [ 8309.222734] video1: VIDIOC_ENUM_FMT: index=6, type=vid-out-mplane, flags=0x0, pixelformat=XR24 little-endian (0x34325258), mbus_code=0x0000, description='32-bit BGRX 8-8-8-8' [ 8309.222759] video1: VIDIOC_ENUM_FMT: index=7, type=vid-out-mplane, flags=0x0, pixelformat=BGR4 little-endian (0x34524742), mbus_code=0x0000, description='32-bit BGRA/X 8-8-8-8' [ 8309.222783] video1: VIDIOC_ENUM_FMT: index=8, type=vid-out-mplane, flags=0x0, pixelformat=XB24 little-endian (0x34324258), mbus_code=0x0000, description='32-bit RGBX 8-8-8-8' [ 8309.222805] video1: VIDIOC_ENUM_FMT: index=9, type=vid-out-mplane, flags=0x0, pixelformat=RX24 little-endian (0x34325852), mbus_code=0x0000, description='32-bit XBGR 8-8-8-8' [ 8309.222830] video1: VIDIOC_ENUM_FMT: index=10, type=vid-out-mplane, flags=0x0, pixelformat=BX24 little-endian (0x34325842), mbus_code=0x0000, description='32-bit XRGB 8-8-8-8' [ 8309.222854] video1: VIDIOC_ENUM_FMT: index=11, type=vid-out-mplane, flags=0x0, pixelformat=RGB4 little-endian (0x34424752), mbus_code=0x0000, description='32-bit A/XRGB 8-8-8-8' [ 8309.222877] video1: VIDIOC_ENUM_FMT: error -22: index=12, type=vid-out-mplane, flags=0x0, pixelformat=.... little-endian (0x00000000), mbus_code=0x0000, description='' [ 8309.230210] video1: VIDIOC_G_FMT: type=vid-out-mplane, width=96, height=32, format=NV12 little-endian (0x3231564e), field=none, colorspace=7, num_planes=1, flags=0x0, ycbcr_enc=0, quantization=0, xfer_func=0 [ 8309.230253] plane 0: bytesperline=96 sizeimage=4608 [ 8309.230279] video1: VIDIOC_ENUM_FMT: index=0, type=vid-out-mplane, flags=0x0, pixelformat=NV12 little-endian (0x3231564e), mbus_code=0x0000, description='Y/UV 4:2:0' [ 8309.230306] video1: VIDIOC_ENUM_FMT: index=1, type=vid-out-mplane, flags=0x0, pixelformat=YM12 little-endian (0x32314d59), mbus_code=0x0000, description='Planar YUV 4:2:0 (N-C)' [ 8309.230330] video1: VIDIOC_ENUM_FMT: index=2, type=vid-out-mplane, flags=0x0, pixelformat=NM12 little-endian (0x32314d4e), mbus_code=0x0000, description='Y/UV 4:2:0 (N-C)' [ 8309.230352] video1: VIDIOC_ENUM_FMT: index=3, type=vid-out-mplane, flags=0x0, pixelformat=YUYV little-endian (0x56595559), mbus_code=0x0000, description='YUYV 4:2:2' [ 8309.230375] video1: VIDIOC_ENUM_FMT: index=4, type=vid-out-mplane, flags=0x0, pixelformat=UYVY little-endian (0x59565955), mbus_code=0x0000, description='UYVY 4:2:2' [ 8309.230397] video1: VIDIOC_ENUM_FMT: index=5, type=vid-out-mplane, flags=0x0, pixelformat=RGBP little-endian (0x50424752), mbus_code=0x0000, description='16-bit RGB 5-6-5' [ 8309.230420] video1: VIDIOC_ENUM_FMT: index=6, type=vid-out-mplane, flags=0x0, pixelformat=XR24 little-endian (0x34325258), mbus_code=0x0000, description='32-bit BGRX 8-8-8-8' [ 8309.230443] video1: VIDIOC_ENUM_FMT: index=7, type=vid-out-mplane, flags=0x0, pixelformat=BGR4 little-endian (0x34524742), mbus_code=0x0000, description='32-bit BGRA/X 8-8-8-8' [ 8309.230467] video1: VIDIOC_ENUM_FMT: index=8, type=vid-out-mplane, flags=0x0, pixelformat=XB24 little-endian (0x34324258), mbus_code=0x0000, description='32-bit RGBX 8-8-8-8' [ 8309.230490] video1: VIDIOC_ENUM_FMT: index=9, type=vid-out-mplane, flags=0x0, pixelformat=RX24 little-endian (0x34325852), mbus_code=0x0000, description='32-bit XBGR 8-8-8-8' [ 8309.230515] video1: VIDIOC_ENUM_FMT: index=10, type=vid-out-mplane, flags=0x0, pixelformat=BX24 little-endian (0x34325842), mbus_code=0x0000, description='32-bit XRGB 8-8-8-8' [ 8309.230538] video1: VIDIOC_ENUM_FMT: index=11, type=vid-out-mplane, flags=0x0, pixelformat=RGB4 little-endian (0x34424752), mbus_code=0x0000, description='32-bit A/XRGB 8-8-8-8' [ 8309.230561] video1: VIDIOC_ENUM_FMT: error -22: index=12, type=vid-out-mplane, flags=0x0, pixelformat=.... little-endian (0x00000000), mbus_code=0x0000, description='' [ 8309.231251] video1: VIDIOC_G_FMT: type=vid-out-mplane, width=96, height=32, format=NV12 little-endian (0x3231564e), field=none, colorspace=7, num_planes=1, flags=0x0, ycbcr_enc=0, quantization=0, xfer_func=0 [ 8309.231279] plane 0: bytesperline=96 sizeimage=4608 [ 8309.231296] video1: VIDIOC_ENUM_FMT: index=0, type=vid-out-mplane, flags=0x0, pixelformat=NV12 little-endian (0x3231564e), mbus_code=0x0000, description='Y/UV 4:2:0' [ 8309.231321] video1: VIDIOC_ENUM_FMT: index=1, type=vid-out-mplane, flags=0x0, pixelformat=YM12 little-endian (0x32314d59), mbus_code=0x0000, description='Planar YUV 4:2:0 (N-C)' [ 8309.231344] video1: VIDIOC_ENUM_FMT: index=2, type=vid-out-mplane, flags=0x0, pixelformat=NM12 little-endian (0x32314d4e), mbus_code=0x0000, description='Y/UV 4:2:0 (N-C)' [ 8309.231367] video1: VIDIOC_ENUM_FMT: index=3, type=vid-out-mplane, flags=0x0, pixelformat=YUYV little-endian (0x56595559), mbus_code=0x0000, description='YUYV 4:2:2' [ 8309.231389] video1: VIDIOC_ENUM_FMT: index=4, type=vid-out-mplane, flags=0x0, pixelformat=UYVY little-endian (0x59565955), mbus_code=0x0000, description='UYVY 4:2:2' [ 8309.231411] video1: VIDIOC_ENUM_FMT: index=5, type=vid-out-mplane, flags=0x0, pixelformat=RGBP little-endian (0x50424752), mbus_code=0x0000, description='16-bit RGB 5-6-5' [ 8309.231433] video1: VIDIOC_ENUM_FMT: index=6, type=vid-out-mplane, flags=0x0, pixelformat=XR24 little-endian (0x34325258), mbus_code=0x0000, description='32-bit BGRX 8-8-8-8' [ 8309.231456] video1: VIDIOC_ENUM_FMT: index=7, type=vid-out-mplane, flags=0x0, pixelformat=BGR4 little-endian (0x34524742), mbus_code=0x0000, description='32-bit BGRA/X 8-8-8-8' [ 8309.231478] video1: VIDIOC_ENUM_FMT: index=8, type=vid-out-mplane, flags=0x0, pixelformat=XB24 little-endian (0x34324258), mbus_code=0x0000, description='32-bit RGBX 8-8-8-8' [ 8309.231500] video1: VIDIOC_ENUM_FMT: index=9, type=vid-out-mplane, flags=0x0, pixelformat=RX24 little-endian (0x34325852), mbus_code=0x0000, description='32-bit XBGR 8-8-8-8' [ 8309.231525] video1: VIDIOC_ENUM_FMT: index=10, type=vid-out-mplane, flags=0x0, pixelformat=BX24 little-endian (0x34325842), mbus_code=0x0000, description='32-bit XRGB 8-8-8-8' [ 8309.231549] video1: VIDIOC_ENUM_FMT: index=11, type=vid-out-mplane, flags=0x0, pixelformat=RGB4 little-endian (0x34424752), mbus_code=0x0000, description='32-bit A/XRGB 8-8-8-8' [ 8309.231572] video1: VIDIOC_ENUM_FMT: error -22: index=12, type=vid-out-mplane, flags=0x0, pixelformat=.... little-endian (0x00000000), mbus_code=0x0000, description='' [ 8309.231938] video1: VIDIOC_G_FMT: type=vid-out-mplane, width=96, height=32, format=NV12 little-endian (0x3231564e), field=none, colorspace=7, num_planes=1, flags=0x0, ycbcr_enc=0, quantization=0, xfer_func=0 [ 8309.231968] plane 0: bytesperline=96 sizeimage=4608 [ 8309.231986] video1: VIDIOC_ENUM_FMT: index=0, type=vid-out-mplane, flags=0x0, pixelformat=NV12 little-endian (0x3231564e), mbus_code=0x0000, description='Y/UV 4:2:0' [ 8309.232011] video1: VIDIOC_ENUM_FMT: index=1, type=vid-out-mplane, flags=0x0, pixelformat=YM12 little-endian (0x32314d59), mbus_code=0x0000, description='Planar YUV 4:2:0 (N-C)' [ 8309.232034] video1: VIDIOC_ENUM_FMT: index=2, type=vid-out-mplane, flags=0x0, pixelformat=NM12 little-endian (0x32314d4e), mbus_code=0x0000, description='Y/UV 4:2:0 (N-C)' [ 8309.232057] video1: VIDIOC_ENUM_FMT: index=3, type=vid-out-mplane, flags=0x0, pixelformat=YUYV little-endian (0x56595559), mbus_code=0x0000, description='YUYV 4:2:2' [ 8309.232080] video1: VIDIOC_ENUM_FMT: index=4, type=vid-out-mplane, flags=0x0, pixelformat=UYVY little-endian (0x59565955), mbus_code=0x0000, description='UYVY 4:2:2' [ 8309.232101] video1: VIDIOC_ENUM_FMT: index=5, type=vid-out-mplane, flags=0x0, pixelformat=RGBP little-endian (0x50424752), mbus_code=0x0000, description='16-bit RGB 5-6-5' [ 8309.232123] video1: VIDIOC_ENUM_FMT: index=6, type=vid-out-mplane, flags=0x0, pixelformat=XR24 little-endian (0x34325258), mbus_code=0x0000, description='32-bit BGRX 8-8-8-8' [ 8309.232147] video1: VIDIOC_ENUM_FMT: index=7, type=vid-out-mplane, flags=0x0, pixelformat=BGR4 little-endian (0x34524742), mbus_code=0x0000, description='32-bit BGRA/X 8-8-8-8' [ 8309.232170] video1: VIDIOC_ENUM_FMT: index=8, type=vid-out-mplane, flags=0x0, pixelformat=XB24 little-endian (0x34324258), mbus_code=0x0000, description='32-bit RGBX 8-8-8-8' [ 8309.232193] video1: VIDIOC_ENUM_FMT: index=9, type=vid-out-mplane, flags=0x0, pixelformat=RX24 little-endian (0x34325852), mbus_code=0x0000, description='32-bit XBGR 8-8-8-8' [ 8309.232218] video1: VIDIOC_ENUM_FMT: index=10, type=vid-out-mplane, flags=0x0, pixelformat=BX24 little-endian (0x34325842), mbus_code=0x0000, description='32-bit XRGB 8-8-8-8' [ 8309.232241] video1: VIDIOC_ENUM_FMT: index=11, type=vid-out-mplane, flags=0x0, pixelformat=RGB4 little-endian (0x34424752), mbus_code=0x0000, description='32-bit A/XRGB 8-8-8-8' [ 8309.232263] video1: VIDIOC_ENUM_FMT: error -22: index=12, type=vid-out-mplane, flags=0x0, pixelformat=.... little-endian (0x00000000), mbus_code=0x0000, description='' [ 8309.232619] video1: VIDIOC_STREAMOFF: type=vid-out-mplane [ 8309.232642] video1: VIDIOC_STREAMOFF: type=vid-cap-mplane [ 8309.232659] video1: VIDIOC_G_FMT: type=vid-cap-mplane, width=96, height=32, format=JPEG little-endian (0x4745504a), field=none, colorspace=7, num_planes=1, flags=0x0, ycbcr_enc=0, quantization=0, xfer_func=0 [ 8309.232684] plane 0: bytesperline=0 sizeimage=6768 [ 8309.232701] video1: VIDIOC_S_FMT: type=vid-cap-mplane, width=640, height=480, format=VP8F little-endian (0x46385056), field=none, colorspace=7, num_planes=1, flags=0x0, ycbcr_enc=0, quantization=0, xfer_fun0 [ 8309.232725] plane 0: bytesperline=0 sizeimage=460800 [ 8309.232734] video1: VIDIOC_G_FMT: type=vid-out-mplane, width=640, height=480, format=NV12 little-endian (0x3231564e), field=none, colorspace=7, num_planes=1, flags=0x0, ycbcr_enc=0, quantization=0, xfer_fun0 [ 8309.232757] plane 0: bytesperline=640 sizeimage=460800 [ 8309.240286] video1: VIDIOC_REQBUFS: count=4, type=vid-out-mplane, memory=mmap [ 8309.240353] video1: VIDIOC_QUERYBUF: 00:00:00.000000 index=0, type=vid-out-mplane, request_fd=0, flags=0x00004000, field=any, sequence=0, memory=mmap [ 8309.240377] plane 0: bytesused=0, data_offset=0x00000000, offset/userptr=0x0, length=460800 [ 8309.240385] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000 [ 8309.240441] video1: VIDIOC_EXPBUF: fd=12, type=vid-out-mplane, index=0, plane=0, flags=0x00080002 [ 8309.240525] video1: VIDIOC_QUERYBUF: 00:00:00.000000 index=0, type=vid-out-mplane, request_fd=0, flags=0x00004001, field=any, sequence=0, memory=mmap [ 8309.240548] plane 0: bytesused=0, data_offset=0x00000000, offset/userptr=0x0, length=460800 [ 8309.240555] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000 [ 8309.240580] video1: VIDIOC_EXPBUF: fd=13, type=vid-out-mplane, index=1, plane=0, flags=0x00080002 [ 8309.240609] video1: VIDIOC_QUERYBUF: 00:00:00.000000 index=0, type=vid-out-mplane, request_fd=0, flags=0x00004001, field=any, sequence=0, memory=mmap [ 8309.240632] plane 0: bytesused=0, data_offset=0x00000000, offset/userptr=0x0, length=460800 [ 8309.240639] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000 [ 8309.240661] video1: VIDIOC_EXPBUF: fd=14, type=vid-out-mplane, index=2, plane=0, flags=0x00080002 [ 8309.240689] video1: VIDIOC_QUERYBUF: 00:00:00.000000 index=0, type=vid-out-mplane, request_fd=0, flags=0x00004001, field=any, sequence=0, memory=mmap [ 8309.240711] plane 0: bytesused=0, data_offset=0x00000000, offset/userptr=0x0, length=460800 [ 8309.240718] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000 [ 8309.240740] video1: VIDIOC_EXPBUF: fd=15, type=vid-out-mplane, index=3, plane=0, flags=0x00080002 [ 8309.248249] video1: VIDIOC_REQBUFS: count=4, type=vid-cap-mplane, memory=mmap [ 8309.248315] video1: VIDIOC_QUERYBUF: 00:00:00.000000 index=0, type=vid-cap-mplane, request_fd=0, flags=0x00004000, field=any, sequence=0, memory=mmap [ 8309.248338] plane 0: bytesused=0, data_offset=0x00000000, offset/userptr=0x40000000, length=460800 [ 8309.248347] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000 [ 8309.248398] video1: VIDIOC_EXPBUF: fd=18, type=vid-cap-mplane, index=0, plane=0, flags=0x00080002 [ 8309.248452] video1: VIDIOC_QUERYBUF: 00:00:00.000000 index=0, type=vid-cap-mplane, request_fd=0, flags=0x00004001, field=any, sequence=0, memory=mmap [ 8309.248475] plane 0: bytesused=0, data_offset=0x00000000, offset/userptr=0x40000000, length=460800 [ 8309.248482] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000 [ 8309.248507] video1: VIDIOC_EXPBUF: fd=19, type=vid-cap-mplane, index=1, plane=0, flags=0x00080002 [ 8309.248534] video1: VIDIOC_QUERYBUF: 00:00:00.000000 index=0, type=vid-cap-mplane, request_fd=0, flags=0x00004001, field=any, sequence=0, memory=mmap [ 8309.248556] plane 0: bytesused=0, data_offset=0x00000000, offset/userptr=0x40000000, length=460800 [ 8309.248563] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000 [ 8309.248585] video1: VIDIOC_EXPBUF: fd=20, type=vid-cap-mplane, index=2, plane=0, flags=0x00080002 [ 8309.248611] video1: VIDIOC_QUERYBUF: 00:00:00.000000 index=0, type=vid-cap-mplane, request_fd=0, flags=0x00004001, field=any, sequence=0, memory=mmap [ 8309.248633] plane 0: bytesused=0, data_offset=0x00000000, offset/userptr=0x40000000, length=460800 [ 8309.248640] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000 [ 8309.248662] video1: VIDIOC_EXPBUF: fd=21, type=vid-cap-mplane, index=3, plane=0, flags=0x00080002 [ 8309.249682] video1: VIDIOC_STREAMON: type=vid-out-mplane [ 8309.251027] video1: VIDIOC_STREAMON: type=vid-cap-mplane [ 8309.251058] video1: VIDIOC_QUERY_EXT_CTRL: id=0xa40af6, type=1, name=VP8 Encode QP, min/max=0/127, step=1, default=0, flags=0x00000000, elem_size=4, elems=1, nr_of_dims=0, dims=0,0,0,0 [ 8309.252133] video1: VIDIOC_S_EXT_CTRLS: which=0xf010000, count=2, error_idx=1, request_fd=24, name=VP8 Encode Parameters, id/size=0xa40af5/20, name=VP8 Encode QP, id/size=0xa40af6/4 [ 8309.257729] video1: VIDIOC_S_EXT_CTRLS: which=0xf010000, count=2, error_idx=1, request_fd=24, name=VP8 Encode Parameters, id/size=0xa40af5/20, name=VP8 Encode QP, id/size=0xa40af6/4 [ 8309.263950] video1: VIDIOC_STREAMOFF: type=vid-out-mplane [ 8309.264171] video1: VIDIOC_STREAMOFF: type=vid-cap-mplane [ 8309.264207] video1: VIDIOC_REQBUFS: count=0, type=vid-out-mplane, memory=mmap [ 8309.264647] video1: VIDIOC_REQBUFS: count=0, type=vid-cap-mplane, memory=mmap
5.2.2. V4L2 core framework tracing[edit source]
Tracing of the V4L2 core framework[5] can be enabled using commands:
echo 0x3 > /sys/module/videobuf2_common/parameters/debug echo 0x3 > /sys/module/videobuf2_v4l2/parameters/debug
Traces are output in kernel log buffer (dmesg).
Trace after a video decoding:
dmesg
[ 8729.602252] videobuf2_common: [out-00000000809b1516] __setup_offsets: buffer 0, plane 0 offset 0x00000000 [ 8729.611459] videobuf2_common: [out-00000000809b1516] __setup_offsets: buffer 1, plane 0 offset 0x00071000 [ 8729.619976] videobuf2_common: [out-00000000809b1516] __vb2_queue_alloc: allocated 2 buffers, 1 plane(s) each [ 8729.629864] videobuf2_common: [out-00000000809b1516] vb2_core_expbuf: buffer 0, plane 0 exported as 14 descriptor [ 8729.640129] videobuf2_common: [out-00000000809b1516] vb2_core_expbuf: buffer 1, plane 0 exported as 15 descriptor [ 8729.652433] videobuf2_common: [cap-00000000942614f9] __setup_offsets: buffer 0, plane 0 offset 0x00000000 [ 8729.662330] videobuf2_common: [cap-00000000942614f9] __setup_offsets: buffer 1, plane 0 offset 0x00071000 [ 8729.671509] videobuf2_common: [cap-00000000942614f9] __setup_offsets: buffer 2, plane 0 offset 0x000e2000 [ 8729.681304] videobuf2_common: [cap-00000000942614f9] __setup_offsets: buffer 3, plane 0 offset 0x00153000 [ 8729.690711] videobuf2_common: [cap-00000000942614f9] __setup_offsets: buffer 4, plane 0 offset 0x001c4000 [ 8729.700356] videobuf2_common: [cap-00000000942614f9] __setup_offsets: buffer 5, plane 0 offset 0x00235000 [ 8729.708688] videobuf2_common: [cap-00000000942614f9] __vb2_queue_alloc: allocated 6 buffers, 1 plane(s) each [ 8729.718568] videobuf2_common: [cap-00000000942614f9] vb2_core_expbuf: buffer 0, plane 0 exported as 16 descriptor [ 8729.728844] videobuf2_common: [cap-00000000942614f9] vb2_core_expbuf: buffer 1, plane 0 exported as 17 descriptor [ 8729.739135] videobuf2_common: [cap-00000000942614f9] vb2_core_expbuf: buffer 2, plane 0 exported as 18 descriptor [ 8729.749300] videobuf2_common: [cap-00000000942614f9] vb2_core_expbuf: buffer 3, plane 0 exported as 19 descriptor [ 8729.759544] videobuf2_common: [cap-00000000942614f9] vb2_core_expbuf: buffer 4, plane 0 exported as 20 descriptor [ 8729.769849] videobuf2_common: [cap-00000000942614f9] vb2_core_expbuf: buffer 5, plane 0 exported as 21 descriptor [ 8729.780703] videobuf2_common: [out-00000000809b1516] vb2_core_streamon: successful [ 8729.787519] videobuf2_common: [cap-00000000942614f9] vb2_core_streamon: successful [ 8729.795478] videobuf2_common: [out-00000000809b1516] vb2_core_qbuf: qbuf of buffer 0 succeeded [ 8729.803682] videobuf2_common: [cap-00000000942614f9] vb2_core_qbuf: qbuf of buffer 0 succeeded [ 8729.812289] videobuf2_common: [out-00000000809b1516] vb2_core_qbuf: qbuf of buffer 0 succeeded [ 8729.821400] videobuf2_common: [out-00000000809b1516] vb2_core_qbuf: qbuf of buffer 1 succeeded [ 8729.829507] videobuf2_common: [cap-00000000942614f9] vb2_core_qbuf: qbuf of buffer 1 succeeded [ 8729.838000] videobuf2_common: [out-00000000809b1516] vb2_core_qbuf: qbuf of buffer 1 succeeded [ 8729.846664] videobuf2_common: [out-00000000809b1516] vb2_core_dqbuf: returning done buffer [ 8729.854853] videobuf2_common: [out-00000000809b1516] vb2_core_dqbuf: dqbuf of buffer 0, state: dequeued [ 8729.864264] videobuf2_common: [cap-00000000942614f9] vb2_core_dqbuf: returning done buffer [ 8729.872548] videobuf2_common: [cap-00000000942614f9] vb2_core_dqbuf: dqbuf of buffer 0, state: dequeued [ 8729.892426] videobuf2_common: [out-00000000809b1516] vb2_core_dqbuf: returning done buffer [ 8729.903680] videobuf2_common: [out-00000000809b1516] vb2_core_dqbuf: dqbuf of buffer 1, state: dequeued [ 8729.915020] videobuf2_common: [cap-00000000942614f9] vb2_core_dqbuf: returning done buffer [ 8729.922151] videobuf2_common: [cap-00000000942614f9] vb2_core_dqbuf: dqbuf of buffer 1, state: dequeued [ 8729.972009] videobuf2_common: [out-00000000809b1516] vb2_core_streamoff: successful [ 8729.979418] videobuf2_common: [cap-00000000942614f9] vb2_core_streamoff: successful [ 8729.987113] videobuf2_common: [out-00000000809b1516] vb2_core_reqbufs: memory in use, orphaning buffers [ 8729.996517] videobuf2_common: [out-00000000809b1516] __vb2_buf_mem_free: freed plane 0 of buffer 0 [ 8730.005414] videobuf2_common: [out-00000000809b1516] __vb2_buf_mem_free: freed plane 0 of buffer 1 [ 8730.014664] videobuf2_common: [cap-00000000942614f9] vb2_core_reqbufs: memory in use, orphaning buffers [ 8730.023759] videobuf2_common: [cap-00000000942614f9] __vb2_buf_mem_free: freed plane 0 of buffer 0 [ 8730.032649] videobuf2_common: [cap-00000000942614f9] __vb2_buf_mem_free: freed plane 0 of buffer 1 [ 8730.041657] videobuf2_common: [cap-00000000942614f9] __vb2_buf_mem_free: freed plane 0 of buffer 2 [ 8730.050510] videobuf2_common: [cap-00000000942614f9] __vb2_buf_mem_free: freed plane 0 of buffer 3 [ 8730.059522] videobuf2_common: [cap-00000000942614f9] __vb2_buf_mem_free: freed plane 0 of buffer 4 [ 8730.068421] videobuf2_common: [cap-00000000942614f9] __vb2_buf_mem_free: freed plane 0 of buffer 5
Trace after a video encoding:
dmesg
[ 8578.924729] videobuf2_common: [out-000000006798f690] vb2_core_streamoff: successful [ 8578.931032] videobuf2_common: [cap-00000000cbeec6f9] vb2_core_streamoff: successful [ 8578.941950] videobuf2_common: [out-000000006798f690] __setup_offsets: buffer 0, plane 0 offset 0x00000000 [ 8578.951686] videobuf2_common: [out-000000006798f690] __setup_offsets: buffer 1, plane 0 offset 0x00071000 [ 8578.961691] videobuf2_common: [out-000000006798f690] __setup_offsets: buffer 2, plane 0 offset 0x000e2000 [ 8578.971585] videobuf2_common: [out-000000006798f690] __setup_offsets: buffer 3, plane 0 offset 0x00153000 [ 8578.979824] videobuf2_common: [out-000000006798f690] __vb2_queue_alloc: allocated 4 buffers, 1 plane(s) each [ 8578.990407] videobuf2_common: [out-000000006798f690] vb2_core_expbuf: buffer 0, plane 0 exported as 12 descriptor [ 8578.999972] videobuf2_common: [out-000000006798f690] vb2_core_expbuf: buffer 1, plane 0 exported as 13 descriptor [ 8579.010114] videobuf2_common: [out-000000006798f690] vb2_core_expbuf: buffer 2, plane 0 exported as 14 descriptor [ 8579.020335] videobuf2_common: [out-000000006798f690] vb2_core_expbuf: buffer 3, plane 0 exported as 15 descriptor [ 8579.032594] videobuf2_common: [cap-00000000cbeec6f9] __setup_offsets: buffer 0, plane 0 offset 0x00000000 [ 8579.041845] videobuf2_common: [cap-00000000cbeec6f9] __setup_offsets: buffer 1, plane 0 offset 0x00071000 [ 8579.052201] videobuf2_common: [cap-00000000cbeec6f9] __setup_offsets: buffer 2, plane 0 offset 0x000e2000 [ 8579.062087] videobuf2_common: [cap-00000000cbeec6f9] __setup_offsets: buffer 3, plane 0 offset 0x00153000 [ 8579.070339] videobuf2_common: [cap-00000000cbeec6f9] __vb2_queue_alloc: allocated 4 buffers, 1 plane(s) each [ 8579.080100] videobuf2_common: [cap-00000000cbeec6f9] vb2_core_expbuf: buffer 0, plane 0 exported as 18 descriptor [ 8579.090375] videobuf2_common: [cap-00000000cbeec6f9] vb2_core_expbuf: buffer 1, plane 0 exported as 19 descriptor [ 8579.100641] videobuf2_common: [cap-00000000cbeec6f9] vb2_core_expbuf: buffer 2, plane 0 exported as 20 descriptor [ 8579.110920] videobuf2_common: [cap-00000000cbeec6f9] vb2_core_expbuf: buffer 3, plane 0 exported as 21 descriptor [ 8579.122030] videobuf2_common: [out-000000006798f690] vb2_core_streamon: successful [ 8579.133472] videobuf2_common: [cap-00000000cbeec6f9] vb2_core_streamon: successful [ 8579.140835] videobuf2_common: [out-000000006798f690] vb2_core_qbuf: qbuf of buffer 0 succeeded [ 8579.148292] videobuf2_common: [cap-00000000cbeec6f9] vb2_core_qbuf: qbuf of buffer 0 succeeded [ 8579.157014] videobuf2_common: [out-000000006798f690] vb2_core_qbuf: qbuf of buffer 0 succeeded [ 8579.168099] videobuf2_common: [out-000000006798f690] vb2_core_dqbuf: returning done buffer [ 8579.174975] videobuf2_common: [out-000000006798f690] vb2_core_dqbuf: dqbuf of buffer 0, state: dequeued [ 8579.184357] videobuf2_common: [cap-00000000cbeec6f9] vb2_core_dqbuf: returning done buffer [ 8579.192624] videobuf2_common: [cap-00000000cbeec6f9] vb2_core_dqbuf: dqbuf of buffer 0, state: dequeued [ 8579.203489] videobuf2_common: [out-000000006798f690] vb2_core_qbuf: qbuf of buffer 1 succeeded [ 8579.212259] videobuf2_common: [cap-00000000cbeec6f9] vb2_core_qbuf: qbuf of buffer 1 succeeded [ 8579.220759] videobuf2_common: [out-000000006798f690] vb2_core_qbuf: qbuf of buffer 1 succeeded [ 8579.232331] videobuf2_common: [out-000000006798f690] vb2_core_dqbuf: returning done buffer [ 8579.240550] videobuf2_common: [out-000000006798f690] vb2_core_dqbuf: dqbuf of buffer 1, state: dequeued [ 8579.250421] videobuf2_common: [cap-00000000cbeec6f9] vb2_core_dqbuf: returning done buffer [ 8579.258355] videobuf2_common: [cap-00000000cbeec6f9] vb2_core_dqbuf: dqbuf of buffer 1, state: dequeued [ 8579.271795] videobuf2_common: [out-000000006798f690] vb2_core_streamoff: successful [ 8579.279386] videobuf2_common: [cap-00000000cbeec6f9] vb2_core_streamoff: successful [ 8579.286914] videobuf2_common: [out-000000006798f690] vb2_core_reqbufs: memory in use, orphaning buffers [ 8579.296253] videobuf2_common: [out-000000006798f690] __vb2_buf_mem_free: freed plane 0 of buffer 0 [ 8579.305177] videobuf2_common: [out-000000006798f690] __vb2_buf_mem_free: freed plane 0 of buffer 1 [ 8579.314090] videobuf2_common: [out-000000006798f690] __vb2_buf_mem_free: freed plane 0 of buffer 2 [ 8579.323092] videobuf2_common: [out-000000006798f690] __vb2_buf_mem_free: freed plane 0 of buffer 3 [ 8579.332442] videobuf2_common: [cap-00000000cbeec6f9] vb2_core_reqbufs: memory in use, orphaning buffers [ 8579.341365] videobuf2_common: [cap-00000000cbeec6f9] __vb2_buf_mem_free: freed plane 0 of buffer 0 [ 8579.350251] videobuf2_common: [cap-00000000cbeec6f9] __vb2_buf_mem_free: freed plane 0 of buffer 1 [ 8579.359290] videobuf2_common: [cap-00000000cbeec6f9] __vb2_buf_mem_free: freed plane 0 of buffer 2 [ 8579.368194] videobuf2_common: [cap-00000000cbeec6f9] __vb2_buf_mem_free: freed plane 0 of buffer 3
5.2.3. hantro_vpu V4L2 kernel driver tracing[edit source]
DCMIPP dynamic debug traces[6] can be enabled using command:
echo "module stm32_dcmipp +p" > /sys/kernel/debug/dynamic_debug/control echo "module dcmipp_bytecap +p" > /sys/kernel/debug/dynamic_debug/control echo "module dcmipp_byteproc +p" > /sys/kernel/debug/dynamic_debug/control echo "module dcmipp_parallel +p" > /sys/kernel/debug/dynamic_debug/control
Here is an example with a 5Mp jpeg capture:
media-ctl -d /dev/media0 --set-v4l2 "'gc2145 1-003c':0[fmt:RGB565_2X8_BE/640x480@1/30 field:none]" media-ctl -d /dev/media0 --set-v4l2 "'dcmipp_parallel':0[fmt:RGB565_2X8_BE/640x480]" media-ctl -d /dev/media0 --set-v4l2 "'dcmipp_parallel':0[fmt:RGB565_2X8_LE/640x480]" media-ctl -d /dev/media0 --set-v4l2 "'dcmipp_dump_postproc':0[fmt:RGB565_2X8_LE/640x480]"
v4l2-ctl --set-fmt-video=width=640,height=480,pixelformat=RGBP --stream-mmap --stream-count=1 --stream-to=grab-640x480-rgb565.raw
dmesg [ 236.968937] dcmipp-parallel dcmipp-parallel.1.auto: dcmipp_parallel: format update: old:640x480 (0x1007, 8, 1, 2, 1) new:640x480 (0x1007, 3, 0, 0, 0)
5.3. How to debug[edit source]
5.3.1. Errors[edit source]
Errors are unconditionally traced in kernel log:
dmesg [ 1947.932915] dcmipp-bytecap dcmipp-bytecap.3.auto: Stop streaming, errors=1 (overrun=0, limit=0), vsync=2, frame=2, buffers=2, it=4
5.3.2. Memory tracking[edit source]
Frames require large chunks of contiguous memory. They are allocated by V4L2 framework through DMA backend. Those allocations can be traced using:
echo "module dma_contiguous +p" > /sys/kernel/debug/dynamic_debug/control echo "module videobuf2_dma_contig +p" > /sys/kernel/debug/dynamic_debug/control
Here is the trace after a VGA YUV422 capture.
[11311.617688] vb2_dc_mmap: mapped dma addr 0xf1900000 at 0xb3b6a000, size 614400 [11311.617986] vb2_dc_mmap: mapped dma addr 0xf1a00000 at 0xb3ad4000, size 614400 [11311.618071] vb2_dc_mmap: mapped dma addr 0xf1b00000 at 0xb3a3e000, size 614400 [11311.764146] vb2_dc_mmap: mapped dma addr 0xf1c00000 at 0xb307c000, size 614400
4 frames of VGA YUV422 frames: 640x480x2=614400 bytes
6. Source code location[edit source]
6.1. User space[edit source]
6.2. Kernel space[edit source]
7. References[edit source]
- ↑ Information about V4L2 Linux kernel framework on wikipedia.
- ↑ 2.0 2.1 Linux Media Infrastructure userspace API » Part IV - Media Controller API
- ↑ 3.0 3.1 3.2 3.3 Linux Media Infrastructure userspace API » Part I - Video for Linux API
- ↑ Linux Media Infrastructure userspace API » Part I - Video for Linux API » 4. Interfaces » 4.5. Video Memory-To-Memory Interface
- ↑ 5.0 5.1 Media subsystem kernel internal API » 1. Video4Linux devices
- ↑ How to use the kernel dynamic debug