# media-ctl -p Media controller API version 5.15.0 Media device information ------------------------ driver atmel_isc_commo model microchip,sama7g5-isc serial bus info platform:microchip-sama7g5-xisc hw revision 0x220 driver version 5.15.0 Device topology - entity 1: atmel_isc_scaler (2 pads, 2 links) type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev0 pad0: Sink [fmt:SBGGR8_1X8/3264x2464 field:none colorspace:srgb crop.bounds:(0,0)/3264x2464 crop:(0,0)/3264x2464] <- "csi2dc":1 [ENABLED,IMMUTABLE] pad1: Source [fmt:SBGGR8_1X8/3264x2464 field:none colorspace:srgb] -> "atmel_isc_common":0 [ENABLED,IMMUTABLE] - entity 4: csi2dc (2 pads, 2 links) type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev1 pad0: Sink [fmt:SRGGB8_1X8/640x480 field:none colorspace:srgb] <- "dw-csi.0":1 [ENABLED] pad1: Source [fmt:SRGGB8_1X8/640x480 field:none colorspace:srgb] -> "atmel_isc_scaler":0 [ENABLED,IMMUTABLE] - entity 7: dw-csi.0 (2 pads, 2 links) type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev2 pad0: Sink [fmt:SBGGR8_1X8/0x0] <- "imx219 1-0010":0 [ENABLED] pad1: Source [fmt:SBGGR8_1X8/0x0] -> "csi2dc":0 [ENABLED] - entity 12: imx219 1-0010 (1 pad, 1 link) type V4L2 subdev subtype Sensor flags 0 device node name /dev/v4l-subdev3 pad0: Source [fmt:SRGGB10_1X10/3280x2464 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range crop.bounds:(8,8)/3280x2464 crop:(8,8)/3280x2464] -> "dw-csi.0":0 [ENABLED] - entity 24: atmel_isc_common (1 pad, 1 link) type Node subtype V4L flags 1 device node name /dev/video0 pad0: Sink <- "atmel_isc_scaler":1 [ENABLED,IMMUTABLE]
# v4l2-ctl -d /dev/v4l-subdev3 --list-subdev-mbus-codes 0 ioctl: VIDIOC_SUBDEV_ENUM_MBUS_CODE (pad=0) 0x300f: MEDIA_BUS_FMT_SRGGB10_1X10 0x3014: MEDIA_BUS_FMT_SRGGB8_1X8
# v4l2-ctl -d /dev/v4l-subdev2 --list-subdev-mbus-codes 0 ioctl: VIDIOC_SUBDEV_ENUM_MBUS_CODE (pad=0) 0x3001: MEDIA_BUS_FMT_SBGGR8_1X8 0x3007: MEDIA_BUS_FMT_SBGGR10_1X10 0x300f: MEDIA_BUS_FMT_SRGGB10_1X10 0x3008: MEDIA_BUS_FMT_SBGGR12_1X12 0x3019: MEDIA_BUS_FMT_SBGGR14_1X14 0x301d: MEDIA_BUS_FMT_SBGGR16_1X16 0x1009: MEDIA_BUS_FMT_RGB666_1X18 0x1007: MEDIA_BUS_FMT_RGB565_2X8_BE 0x1008: MEDIA_BUS_FMT_RGB565_2X8_LE 0x1003: MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE 0x1004: MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE 0x1001: MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE 0x1002: MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE 0x100c: MEDIA_BUS_FMT_RGB888_2X12_LE 0x100b: MEDIA_BUS_FMT_RGB888_2X12_BE 0x100a: MEDIA_BUS_FMT_RGB888_1X24 0x2010: MEDIA_BUS_FMT_VYUY8_1X16 0x2019: MEDIA_BUS_FMT_VYUY10_2X10 0x2001: MEDIA_BUS_FMT_Y8_1X8 0x200a: MEDIA_BUS_FMT_Y10_1X10 # v4l2-ctl -d /dev/v4l-subdev2 --list-subdev-mbus-codes 1 ioctl: VIDIOC_SUBDEV_ENUM_MBUS_CODE (pad=1) 0x3001: MEDIA_BUS_FMT_SBGGR8_1X8 0x3007: MEDIA_BUS_FMT_SBGGR10_1X10 0x300f: MEDIA_BUS_FMT_SRGGB10_1X10 0x3008: MEDIA_BUS_FMT_SBGGR12_1X12 0x3019: MEDIA_BUS_FMT_SBGGR14_1X14 0x301d: MEDIA_BUS_FMT_SBGGR16_1X16 0x1009: MEDIA_BUS_FMT_RGB666_1X18 0x1007: MEDIA_BUS_FMT_RGB565_2X8_BE 0x1008: MEDIA_BUS_FMT_RGB565_2X8_LE 0x1003: MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE 0x1004: MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE 0x1001: MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE 0x1002: MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE 0x100c: MEDIA_BUS_FMT_RGB888_2X12_LE 0x100b: MEDIA_BUS_FMT_RGB888_2X12_BE 0x100a: MEDIA_BUS_FMT_RGB888_1X24 0x2010: MEDIA_BUS_FMT_VYUY8_1X16 0x2019: MEDIA_BUS_FMT_VYUY10_2X10 0x2001: MEDIA_BUS_FMT_Y8_1X8 0x200a: MEDIA_BUS_FMT_Y10_1X10
# v4l2-ctl -d /dev/v4l-subdev1 --list-subdev-mbus-codes 0 ioctl: VIDIOC_SUBDEV_ENUM_MBUS_CODE (pad=0) 0x3014: MEDIA_BUS_FMT_SRGGB8_1X8 0x3001: MEDIA_BUS_FMT_SBGGR8_1X8 0x3002: MEDIA_BUS_FMT_SGRBG8_1X8 0x3013: MEDIA_BUS_FMT_SGBRG8_1X8 0x300f: MEDIA_BUS_FMT_SRGGB10_1X10 0x3007: MEDIA_BUS_FMT_SBGGR10_1X10 0x300a: MEDIA_BUS_FMT_SGRBG10_1X10 0x300e: MEDIA_BUS_FMT_SGBRG10_1X10 0x2008: MEDIA_BUS_FMT_YUYV8_2X8 # v4l2-ctl -d /dev/v4l-subdev1 --list-subdev-mbus-codes 1 ioctl: VIDIOC_SUBDEV_ENUM_MBUS_CODE (pad=1) 0x3014: MEDIA_BUS_FMT_SRGGB8_1X8 0x3001: MEDIA_BUS_FMT_SBGGR8_1X8 0x3002: MEDIA_BUS_FMT_SGRBG8_1X8 0x3013: MEDIA_BUS_FMT_SGBRG8_1X8 0x300f: MEDIA_BUS_FMT_SRGGB10_1X10 0x3007: MEDIA_BUS_FMT_SBGGR10_1X10 0x300a: MEDIA_BUS_FMT_SGRBG10_1X10 0x300e: MEDIA_BUS_FMT_SGBRG10_1X10 0x2008: MEDIA_BUS_FMT_YUYV8_2X8 #
# v4l2-ctl -d /dev/v4l-subdev0 --list-subdev-mbus-codes 0 ioctl: VIDIOC_SUBDEV_ENUM_MBUS_CODE (pad=0) 0x3001: MEDIA_BUS_FMT_SBGGR8_1X8 0x3013: MEDIA_BUS_FMT_SGBRG8_1X8 0x3002: MEDIA_BUS_FMT_SGRBG8_1X8 0x3014: MEDIA_BUS_FMT_SRGGB8_1X8 0x3007: MEDIA_BUS_FMT_SBGGR10_1X10 0x300e: MEDIA_BUS_FMT_SGBRG10_1X10 0x300a: MEDIA_BUS_FMT_SGRBG10_1X10 0x300f: MEDIA_BUS_FMT_SRGGB10_1X10 0x2008: MEDIA_BUS_FMT_YUYV8_2X8 # v4l2-ctl -d /dev/v4l-subdev0 --list-subdev-mbus-codes 1 ioctl: VIDIOC_SUBDEV_ENUM_MBUS_CODE (pad=1) 0x3001: MEDIA_BUS_FMT_SBGGR8_1X8 0x3013: MEDIA_BUS_FMT_SGBRG8_1X8 0x3002: MEDIA_BUS_FMT_SGRBG8_1X8 0x3014: MEDIA_BUS_FMT_SRGGB8_1X8 0x3007: MEDIA_BUS_FMT_SBGGR10_1X10 0x300e: MEDIA_BUS_FMT_SGBRG10_1X10 0x300a: MEDIA_BUS_FMT_SGRBG10_1X10 0x300f: MEDIA_BUS_FMT_SRGGB10_1X10 0x2008: MEDIA_BUS_FMT_YUYV8_2X8
# v4l2-ctl -d /dev/v4l-subdev3 --list-subdev-framesizes pad=0,code=0x300f ioctl: VIDIOC_SUBDEV_ENUM_FRAME_SIZE (pad=0) Size Range: 3280x2464 - 3280x2464 Size Range: 1920x1080 - 1920x1080 Size Range: 1640x1232 - 1640x1232 Size Range: 640x480 - 640x480
# v4l2-ctl -d /dev/v4l-subdev3 --list-subdev-framesizes pad=0,code=0x3001 ioctl: VIDIOC_SUBDEV_ENUM_FRAME_SIZE (pad=0) #
# v4l2-ctl -d /dev/v4l-subdev2 --list-subdev-framesizes pad=0 ioctl: VIDIOC_SUBDEV_ENUM_FRAME_SIZE (pad=0) Size Range: 16x16 - 4000x3000 #
# v4l2-ctl -d /dev/v4l-subdev3 --get-subdev-fmt 0 ioctl: VIDIOC_SUBDEV_G_FMT (pad=0) Width/Height : 3280/2464 Mediabus Code : 0x300f (MEDIA_BUS_FMT_SRGGB10_1X10) Field : None Colorspace : sRGB Transfer Function : sRGB YCbCr/HSV Encoding: ITU-R 601 Quantization : Full Range #
# v4l2-ctl -d /dev/v4l-subdev2 --get-subdev-fmt 0 ioctl: VIDIOC_SUBDEV_G_FMT (pad=0) Width/Height : 0/0 Mediabus Code : 0x3001 (MEDIA_BUS_FMT_SBGGR8_1X8) Field : Any Colorspace : Default Transfer Function : Default (maps to Rec. 709) YCbCr/HSV Encoding: Default (maps to ITU-R 601) Quantization : Default (maps to Full Range) # v4l2-ctl -d /dev/v4l-subdev2 --get-subdev-fmt 1 ioctl: VIDIOC_SUBDEV_G_FMT (pad=1) Width/Height : 0/0 Mediabus Code : 0x3001 (MEDIA_BUS_FMT_SBGGR8_1X8) Field : Any Colorspace : Default Transfer Function : Default (maps to Rec. 709) YCbCr/HSV Encoding: Default (maps to ITU-R 601) Quantization : Default (maps to Full Range) #
media-ctl -d /dev/media0 --set-v4l2 '"imx219 1-0010":0[fmt:SRGGB10_1X10/3280x2464]' media-ctl -d /dev/media0 --set-v4l2 '"dw-csi.0":0[fmt:SRGGB10_1X10/3280x2464]' media-ctl -d /dev/media0 --set-v4l2 '"csi2dc":0[fmt:SRGGB10_1X10/3280x2464]' media-ctl -d /dev/media0 --set-v4l2 '"atmel_isc_scaler":0[fmt:SRGGB10_1X10/3280x2464]'The above sequence of commands will configure the 4 given entities with the format specified. The format string and specification is identical with the one printed by media-ctl -p We can observe the difference in media-ctl output:
# media-ctl -p Media controller API version 5.15.0 Media device information ------------------------ driver atmel_isc_commo model microchip,sama7g5-isc serial bus info platform:microchip-sama7g5-xisc hw revision 0x220 driver version 5.15.0 Device topology - entity 1: atmel_isc_scaler (2 pads, 2 links) type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev0 pad0: Sink [fmt:SRGGB10_1X10/3280x2464 field:none colorspace:srgb crop.bounds:(0,0)/3264x2464 crop:(0,0)/3264x2464] <- "csi2dc":1 [ENABLED,IMMUTABLE] pad1: Source [fmt:SRGGB10_1X10/3280x2464 field:none colorspace:srgb] -> "atmel_isc_common":0 [ENABLED,IMMUTABLE] - entity 4: csi2dc (2 pads, 2 links) type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev1 pad0: Sink [fmt:SRGGB10_1X10/3280x2464 field:none colorspace:srgb] <- "dw-csi.0":1 [ENABLED] pad1: Source [fmt:SRGGB10_1X10/3280x2464 field:none colorspace:srgb] -> "atmel_isc_scaler":0 [ENABLED,IMMUTABLE] - entity 7: dw-csi.0 (2 pads, 2 links) type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev2 pad0: Sink [fmt:SRGGB10_1X10/3280x2464] <- "imx219 1-0010":0 [ENABLED] pad1: Source [fmt:SRGGB10_1X10/3280x2464] -> "csi2dc":0 [ENABLED] - entity 12: imx219 1-0010 (1 pad, 1 link) type V4L2 subdev subtype Sensor flags 0 device node name /dev/v4l-subdev3 pad0: Source [fmt:SRGGB10_1X10/3280x2464 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range crop.bounds:(8,8)/3280x2464 crop:(8,8)/3280x2464] -> "dw-csi.0":0 [ENABLED] - entity 24: atmel_isc_common (1 pad, 1 link) type Node subtype V4L flags 1 device node name /dev/video0 pad0: Sink <- "atmel_isc_scaler":1 [ENABLED,IMMUTABLE]All links now have frame size and mbus code configured.
media-ctl -d /dev/media0 --set-v4l2 '"imx219 1-0010":0[fmt:SRGGB10_1X10/1920x1080]' media-ctl -d /dev/media0 --set-v4l2 '"dw-csi.0":0[fmt:SRGGB10_1X10/1920x1080]' media-ctl -d /dev/media0 --set-v4l2 '"csi2dc":0[fmt:SRGGB10_1X10/1920x1080]' media-ctl -d /dev/media0 --set-v4l2 '"atmel_isc_scaler":0[fmt:SRGGB10_1X10/1920x1080]'
Media controller API version 5.15.0 Media device information ------------------------ driver atmel_isc_commo model microchip,sama7g5-isc serial bus info platform:microchip-sama7g5-xisc hw revision 0x220 driver version 5.15.0 Device topology - entity 1: atmel_isc_scaler (2 pads, 2 links) type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev0 pad0: Sink [fmt:SRGGB10_1X10/1920x1080 field:none colorspace:srgb crop.bounds:(0,0)/3264x2464 crop:(0,0)/3264x2464] <- "csi2dc":1 [ENABLED,IMMUTABLE] pad1: Source [fmt:SRGGB10_1X10/1920x1080 field:none colorspace:srgb] -> "atmel_isc_common":0 [ENABLED,IMMUTABLE] - entity 4: csi2dc (2 pads, 2 links) type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev1 pad0: Sink [fmt:SRGGB10_1X10/1920x1080 field:none colorspace:srgb] <- "dw-csi.0":1 [ENABLED] pad1: Source [fmt:SRGGB10_1X10/1920x1080 field:none colorspace:srgb] -> "atmel_isc_scaler":0 [ENABLED,IMMUTABLE] - entity 7: dw-csi.0 (2 pads, 2 links) type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev2 pad0: Sink [fmt:SRGGB10_1X10/1920x1080] <- "imx219 1-0010":0 [ENABLED] pad1: Source [fmt:SRGGB10_1X10/1920x1080] -> "csi2dc":0 [ENABLED] - entity 12: imx219 1-0010 (1 pad, 1 link) type V4L2 subdev subtype Sensor flags 0 device node name /dev/v4l-subdev3 pad0: Source [fmt:SRGGB10_1X10/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range crop.bounds:(8,8)/3280x2464 crop:(688,700)/1920x1080] -> "dw-csi.0":0 [ENABLED] - entity 24: atmel_isc_common (1 pad, 1 link) type Node subtype V4L flags 1 device node name /dev/video0 pad0: Sink <- "atmel_isc_scaler":1 [ENABLED,IMMUTABLE]
# v4l2-ctl -d /dev/video0 --list-formats ioctl: VIDIOC_ENUM_FMT Type: Video Capture [0]: 'BG10' (10-bit Bayer BGBG/GRGR) [1]: 'GB10' (10-bit Bayer GBGB/RGRG) [2]: 'BA10' (10-bit Bayer GRGR/BGBG) [3]: 'RG10' (10-bit Bayer RGRG/GBGB) [4]: 'AR12' (16-bit ARGB 4-4-4-4) [5]: 'AR15' (16-bit ARGB 1-5-5-5) [6]: 'RGBP' (16-bit RGB 5-6-5) [7]: 'AR24' (32-bit BGRA 8-8-8-8) [8]: 'XR24' (32-bit BGRX 8-8-8-8) [9]: 'YU12' (Planar YUV 4:2:0) [10]: 'UYVY' (UYVY 4:2:2) [11]: 'VYUY' (VYUY 4:2:2) [12]: 'YUYV' (YUYV 4:2:2) [13]: '422P' (Planar YUV 4:2:2) [14]: 'GREY' (8-bit Greyscale) [15]: 'Y10 ' (10-bit Greyscale) [16]: 'Y16 ' (16-bit Greyscale) #
# v4l2-ctl -d /dev/video0 --list-formats-ext ioctl: VIDIOC_ENUM_FMT Type: Video Capture [0]: 'BG10' (10-bit Bayer BGBG/GRGR) Size: Continuous 16x16 - 3264x2464 [1]: 'GB10' (10-bit Bayer GBGB/RGRG) Size: Continuous 16x16 - 3264x2464 [2]: 'BA10' (10-bit Bayer GRGR/BGBG) Size: Continuous 16x16 - 3264x2464 [3]: 'RG10' (10-bit Bayer RGRG/GBGB) Size: Continuous 16x16 - 3264x2464 [4]: 'AR12' (16-bit ARGB 4-4-4-4) Size: Continuous 16x16 - 3264x2464 [5]: 'AR15' (16-bit ARGB 1-5-5-5) Size: Continuous 16x16 - 3264x2464 [6]: 'RGBP' (16-bit RGB 5-6-5) Size: Continuous 16x16 - 3264x2464 [7]: 'AR24' (32-bit BGRA 8-8-8-8) Size: Continuous 16x16 - 3264x2464 [8]: 'XR24' (32-bit BGRX 8-8-8-8) Size: Continuous 16x16 - 3264x2464 [9]: 'YU12' (Planar YUV 4:2:0) Size: Continuous 16x16 - 3264x2464 [10]: 'UYVY' (UYVY 4:2:2) Size: Continuous 16x16 - 3264x2464 [11]: 'VYUY' (VYUY 4:2:2) Size: Continuous 16x16 - 3264x2464 [12]: 'YUYV' (YUYV 4:2:2) Size: Continuous 16x16 - 3264x2464 [13]: '422P' (Planar YUV 4:2:2) Size: Continuous 16x16 - 3264x2464 [14]: 'GREY' (8-bit Greyscale) Size: Continuous 16x16 - 3264x2464 [15]: 'Y10 ' (10-bit Greyscale) Size: Continuous 16x16 - 3264x2464 [16]: 'Y16 ' (16-bit Greyscale) Size: Continuous 16x16 - 3264x2464
# v4l2-ctl -d /dev/video0 --get-fmt-video Format Video Capture: Width/Height : 640/480 Pixel Format : 'BG10' (10-bit Bayer BGBG/GRGR) Field : None Bytes per Line : 1280 Size Image : 614400 Colorspace : sRGB Transfer Function : Default (maps to sRGB) YCbCr/HSV Encoding: Default (maps to ITU-R 601) Quantization : Default (maps to Full Range) Flags : #
# v4l2-ctl -d /dev/video0 --set-fmt-video width=3464,height=2464,pixelformat=RGBP # v4l2-ctl -d /dev/video0 --get-fmt-video Format Video Capture: Width/Height : 3264/2464 Pixel Format : 'RGBP' (16-bit RGB 5-6-5) Field : None Bytes per Line : 6528 Size Image : 16084992 Colorspace : sRGB Transfer Function : Default (maps to sRGB) YCbCr/HSV Encoding: Default (maps to ITU-R 601) Quantization : Default (maps to Full Range) Flags : #
# v4l2-ctl --device /dev/video0 --stream-mmap --stream-to=RGBP_3264_2464.raw --stream-count=1 < # ls -la RGBP_3264_2464.raw -rw-r--r-- 1 root root 16084992 Jan 1 00:00 RGBP_3264_2464.raw #
ffmpeg -f rawvideo -s 3264x2464 -pix_fmt bayer_rggb8 -i frame.raw -frames:v 1 frame.png
ffmpeg -f rawvideo -s 1920x1080 -pix_fmt yuyv422 -i YUYV_1920_1080.raw -frames:v 1 YUYV_1920_1080.png
ffmpeg -f rawvideo -s 1920x1080 -pix_fmt rgb565be -i RGB565_1920_1080.raw -frames:v 1 RGB565_1920_1080.pngTo see ffmpg supported pixel formats, try this:
# ffmpeg -pix_fmtsresolution must match the one configured at the top video driver. ffmpeg cannot guess the resolution from a raw file.
#configure pipeline to 3280x2464 first fswebcam -p RGB565 -r 3280x2464 -S 20 bigRGB565.png fswebcam -p YUYV -r 3280x2464 -S 20 bigYUYV.png fswebcam -p UYVY -r 3280x2464 -S 20 bigUYVY.png fswebcam -p VYUY -r 3280x2464 -S 20 bigVYUY.png fswebcam -p ABGR32 -r 3280x2464 -S 20 bigABGR32.png fswebcam -p Y16 -r 3280x2464 -S 20 bigY16.png fswebcam -p GREY -r 3280x2464 -S 20 bigGREY.png fswebcam -p YUV420P -r 3280x2464 -S 20 bigYUV420P.png # reconfigure pipeline to 1920x1080 first fswebcam -p RGB565 -r 1920x1080 -S 20 smallRGB565.png fswebcam -p YUYV -r 1920x1080 -S 20 smallYUYV.png fswebcam -p UYVY -r 1920x1080 -S 20 smallUYVY.png fswebcam -p VYUY -r 1920x1080 -S 20 smallVYUY.png fswebcam -p ABGR32 -r 1920x1080 -S 20 smallABGR32.png fswebcam -p Y16 -r 1920x1080 -S 20 smallY16.png fswebcam -p GREY -r 1920x1080 -S 20 smallGREY.png fswebcam -p YUV420P -r 1920x1080 -S 20 smallYUV420P.png # reconfigure pipeline to 1640x1232 first fswebcam -p RGB565 -r 1640x1232 -S 20 panoRGB565.png fswebcam -p YUYV -r 1640x1232 -S 20 panoYUYV.png fswebcam -p UYVY -r 1640x1232 -S 20 panoUYVY.png fswebcam -p VYUY -r 1640x1232 -S 20 panoVYUY.png fswebcam -p ABGR32 -r 1640x1232 -S 20 panoABGR32.png fswebcam -p Y16 -r 1640x1232 -S 20 panoY16.png fswebcam -p GREY -r 1640x1232 -S 20 panoGREY.png fswebcam -p YUV420P -r 1640x1232 -S 20 panoYUV420P.png # reconfigure pipeline to 640x480 first fswebcam -p RGB565 -r 640x480 -S 20 tinyRGB565.png fswebcam -p YUYV -r 640x480 -S 20 tinyYUYV.png fswebcam -p UYVY -r 640x480 -S 20 tinyUYVY.png fswebcam -p VYUY -r 640x480 -S 20 tinyVYUY.png fswebcam -p ABGR32 -r 640x480 -S 20 tinyABGR32.png fswebcam -p Y16 -r 640x480 -S 20 tinyY16.png fswebcam -p GREY -r 640x480 -S 20 tinyGREY.png fswebcam -p YUV420P -r 640x480 -S 20 tinyYUV420P.pngEven if we request 3280x2464 and the maximum resolution is 3264x2464, the media controller will resize the output frame and we will still obtain 3264x2464. It is automatically adjusted to best found resolution
gst-launch-1.0 v4l2src device="/dev/video0" num-buffers=1 ! video/x-raw,width=3264,height=2464 ! videoconvert ! jpegenc ! filesink location=capture2.jpgPipeline must be configured before using GStreamer .
# cam -l [3:09:29.602118600] [272] INFO IPAManager ipa_manager.cpp:138 libcamera is not installed. Adding '//src/ipa' to the IPA search path [3:09:29.602612000] [272] WARN IPAManager ipa_manager.cpp:149 No IPA found in '/usr/lib/libcamera' [3:09:29.602773400] [272] INFO Camera camera_manager.cpp:293 libcamera v0.0.0+58645-2021.08-dirty (2021-10-08T16:10:25+03:00) [3:09:29.610875800] [274] WARN CameraSensor camera_sensor.cpp:197 'imx219 1-0010': Recommended V4L2 control 0x009a0922 not supported [3:09:29.611025000] [274] WARN CameraSensor camera_sensor.cpp:249 'imx219 1-0010': The sensor kernel driver needs to be fixed [3:09:29.611092200] [274] WARN CameraSensor camera_sensor.cpp:251 'imx219 1-0010': See Documentation/sensor_driver_requirements.rst in the libcamera sources for more information [3:09:29.617962400] [274] WARN CameraSensor camera_sensor.cpp:414 'imx219 1-0010': Failed to retrieve the camera location [3:09:29.620663000] [274] WARN V4L2 v4l2_pixelformat.cpp:283 Unsupported V4L2 pixel format Y10 [3:09:29.620766200] [274] WARN V4L2 v4l2_pixelformat.cpp:283 Unsupported V4L2 pixel format Y16 [3:09:29.620828600] [274] WARN V4L2 v4l2_pixelformat.cpp:283 Unsupported V4L2 pixel format AR12 [3:09:29.620886800] [274] WARN V4L2 v4l2_pixelformat.cpp:283 Unsupported V4L2 pixel format AR15 Available cameras: 1: 'imx219' (/base/soc/flexcom@e2818000/i2c@600/camera@10) #
cam -c1 -C1 -Fframe.raw -s pixelformat=RGB565
# cd video-capture-at91/imx219 # ./3264x2464.sh Ready to capture at 3264x2464 # # ./fswebcam_3264x2464.sh --- Opening /dev/video0... Trying source module v4l2... /dev/video0 opened. No input was specified, using the first. --- Capturing frame... Skipping 20 frames... Capturing 1 frames... Captured 21 frames in 1.33 seconds. (15 fps) --- Processing captured image... Unable to load font 'sans': Could not find/open font Disabling the the banner. Writing JPEG image to 'bigRGB565.png'. --- Opening /dev/video0... Trying source module v4l2... /dev/video0 opened. No input was specified, using the first. --- Capturing frame... Skipping 20 frames... Capturing 1 frames... Captured 21 frames in 1.33 seconds. (15 fps) --- Processing captured image... Unable to load font 'sans': Could not find/open font Disabling the the banner. Writing JPEG image to 'bigYUYV.png'. --- Opening /dev/video0... Trying source module v4l2... /dev/video0 opened. No input was specified, using the first. --- Capturing frame... Skipping 20 frames... Capturing 1 frames... Captured 21 frames in 1.33 seconds. (15 fps) --- Processing captured image... Unable to load font 'sans': Could not find/open font Disabling the the banner. Writing JPEG image to 'bigUYVY.png'. --- Opening /dev/video0... Trying source module v4l2... /dev/video0 opened. No input was specified, using the first. --- Capturing frame... Skipping 20 frames... Capturing 1 frames... Captured 21 frames in 1.33 seconds. (15 fps) --- Processing captured image... Unable to load font 'sans': Could not find/open font Disabling the the banner. Writing JPEG image to 'bigVYUY.png'. --- Opening /dev/video0... Trying source module v4l2... /dev/video0 opened. No input was specified, using the first. --- Capturing frame... Skipping 20 frames... Capturing 1 frames... Captured 21 frames in 1.33 seconds. (15 fps) --- Processing captured image... Unable to load font 'sans': Could not find/open font Disabling the the banner. Writing JPEG image to 'bigABGR32.png'. --- Opening /dev/video0... Trying source module v4l2... /dev/video0 opened. No input was specified, using the first. --- Capturing frame... Skipping 20 frames... Capturing 1 frames... Captured 21 frames in 1.33 seconds. (15 fps) --- Processing captured image... Unable to load font 'sans': Could not find/open font Disabling the the banner. Writing JPEG image to 'bigY16.png'. --- Opening /dev/video0... Trying source module v4l2... /dev/video0 opened. No input was specified, using the first. --- Capturing frame... Skipping 20 frames... Capturing 1 frames... Captured 21 frames in 1.33 seconds. (15 fps) --- Processing captured image... Unable to load font 'sans': Could not find/open font Disabling the the banner. Writing JPEG image to 'bigGREY.png'. --- Opening /dev/video0... Trying source module v4l2... /dev/video0 opened. No input was specified, using the first. --- Capturing frame... Skipping 20 frames... Capturing 1 frames... Captured 21 frames in 1.33 seconds. (15 fps) --- Processing captured image... Unable to load font 'sans': Could not find/open font Disabling the the banner. Writing JPEG image to 'bigYUV420P.png'.
# ls -la video-capture-at91/ total 24 drwxr-xr-x 6 root root 4096 May 10 2022 . drwx------ 3 root root 4096 Jan 1 02:08 .. drwxr-xr-x 2 root root 4096 May 10 2022 mt9v022 drwxr-xr-x 2 root root 4096 May 10 2022 ov5640 drwxr-xr-x 2 root root 4096 May 10 2022 ov7670 drwxr-xr-x 2 root root 4096 May 10 2022 ov7740
# ./video-capture-at91/mt9v022/ 752x480_Y10.sh fswebcam_752x480.sh # ./video-capture-at91/mt9v022/752x480_Y10.sh Preparing MT9V022 in Y10 10bits mode Ready to capture at 752x480 # # # ./video-capture-at91/mt9v022/fswebcam_752x480.sh --- Opening /dev/video0... Trying source module v4l2... /dev/video0 opened. No input was specified, using the first. --- Capturing frame... Skipping 20 frames... Capturing 1 frames... Captured 21 frames in 0.37 seconds. (56 fps) --- Processing captured image... Writing JPEG image to 'tinyGREY.png'. #
# ./video-capture-at91/ov7740/640x480_raw.sh Preparing OV7440 in RAW BAYER MODE Ready to capture at 640x480 # ./video-capture-at91/ov7740/fswebcam_640x480.sh --- Opening /dev/video0... Trying source module v4l2... /dev/video0 opened. No input was specified, using the first. --- Capturing frame... Skipping 20 frames... Capturing 1 frames... Captured 21 frames in 0.38 seconds. (55 fps) --- Processing captured image... Writing JPEG image to 'tinyRGB565.png'. --- Opening /dev/video0... Trying source module v4l2... /dev/video0 opened. No input was specified, using the first. --- Capturing frame... Skipping 20 frames... Capturing 1 frames... Captured 21 frames in 0.38 seconds. (55 fps) --- Processing captured image... Writing JPEG image to 'tinyYUYV.png'. --- Opening /dev/video0... Trying source module v4l2... /dev/video0 opened. No input was specified, using the first. --- Capturing frame... Skipping 20 frames... Capturing 1 frames... Captured 21 frames in 0.38 seconds. (54 fps) --- Processing captured image... Writing JPEG image to 'tinyABGR32.png'. --- Opening /dev/video0... Trying source module v4l2... /dev/video0 opened. No input was specified, using the first. --- Capturing frame... Skipping 20 frames... Capturing 1 frames... Captured 21 frames in 0.38 seconds. (54 fps) --- Processing captured image... Writing JPEG image to 'tinyGREY.png'. --- Opening /dev/video0... Trying source module v4l2... /dev/video0 opened. No input was specified, using the first. --- Capturing frame... Skipping 20 frames... Capturing 1 frames... Captured 21 frames in 0.38 seconds. (54 fps) --- Processing captured image... Writing JPEG image to 'tinyYUV420P.png'. #
ffmpeg -pix_fmtsMedia controller pipeline must be properly configured before using ffmpeg
v4l2-ctl -v pixelformat=RGBP,height=480,width=640 # corresponding v4l2 format ffmpeg -s vga -pix_fmt rgb565be -f video4linux2 -i /dev/video0 video_vga_rgb565be.avi
v4l2-ctl -v pixelformat=YUYV,height=480,width=640 # corresponding v4l2 format ffmpeg -s vga -pix_fmt yuyv422 -f video4linux2 -i /dev/video0 video_vga_yuyv422.avi
WebFaqBaseForm | |
---|---|
Boards | Sam9x75Curiosity, Sama7g5-ek, Sama5d27WLSom1EK, Sama5d27Som1EK, Sama5d2Xplained |
Components | linux-5.15-mchp, linux-6.1-mchp, linux-6.6-mchp |
Summary | What is Media controller and how to use it with SAM products. |
|
|||||||||||||||
Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.
Microchip and others, are registered trademarks or trademarks of Microchip Technology Inc. and its subsidiaries.
Arm® and others are registered trademarks or trademarks of Arm Limited (or its affiliates). Other terms and product names may be trademarks of others.
Ideas, requests, contributions ? Connect to LinksToCommunities page.