Skip to content

Raspberry PI and ffmpeg

Goal: access to PI Camera V3 by ffmpeg directly

Hardware: Raspberry Pi 5, PI Camera V3

State:

root@raspberrypi5:~# v4l2-ctl --list-devices
pispbe (platform:1000880000.pisp_be):
    /dev/video20
    /dev/video21
    /dev/video22
    /dev/video23
    /dev/video24
    /dev/video25
    /dev/video26
    /dev/video27
    /dev/video28
    /dev/video29
    /dev/video30
    /dev/video31
    /dev/video32
    /dev/video33
    /dev/video34
    /dev/video35
    /dev/video36
    /dev/video37
    /dev/media1
    /dev/media3

rp1-cfe (platform:1f00128000.csi):
    /dev/video0
    /dev/video1
    /dev/video2
    /dev/video3
    /dev/video4
    /dev/video5
    /dev/video6
    /dev/video7
    /dev/media0

rpivid (platform:rpivid):
    /dev/video19
    /dev/media2

root@raspberrypi5:~# libcamera-hello --list-cameras 
Available cameras
-----------------
0 : imx708 [4608x2592 10-bit RGGB] (/base/axi/pcie@120000/rp1/i2c@80000/imx708@1a)
    Modes: 'SRGGB10_CSI2P' : 1536x864 [120.13 fps - (768, 432)/3072x1728 crop]
                             2304x1296 [56.03 fps - (0, 0)/4608x2592 crop]
                             4608x2592 [14.35 fps - (0, 0)/4608x2592 crop]

root@raspberrypi5:~# ffplay -f video4linux2 -list_formats all /dev/video0

ffplay version 5.1.4-0+rpt3+deb12u1 Copyright (c) 2003-2023 the FFmpeg developers
  built with gcc 12 (Debian 12.2.0-14)
  configuration: --prefix=/usr --extra-version=0+rpt3+deb12u1 --toolchain=hardened --incdir=/usr/include/aarch64-linux-gnu --enable-gpl --disable-stripping --disable-mmal --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sand --enable-sdl2 --disable-sndio --enable-libjxl --enable-neon --enable-v4l2-request --enable-libudev --enable-epoxy --libdir=/usr/lib/aarch64-linux-gnu --arch=arm64 --enable-pocketsphinx --enable-librsvg --enable-libdc1394 --enable-libdrm --enable-vout-drm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libplacebo --enable-librav1e --enable-shared
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
[video4linux2,v4l2 @ 0x7fff04000c20] Raw       :     yuyv422 :           YUYV 4:2:2 : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Raw       :     uyvy422 :           UYVY 4:2:2 : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Raw       : Unsupported :           YVYU 4:2:2 : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Raw       : Unsupported :           VYUY 4:2:2 : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Raw       :    rgb565le :     16-bit RGB 5-6-5 : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Raw       :    rgb565be :  16-bit RGB 5-6-5 BE : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Raw       :    rgb555le : 16-bit A/XRGB 1-5-5-5 : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Raw       :    rgb555be : 16-bit A/XRGB 1-5-5-5 BE : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Raw       :       rgb24 :     24-bit RGB 8-8-8 : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Raw       :       bgr24 :     24-bit BGR 8-8-8 : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Raw       :        0rgb : 32-bit A/XRGB 8-8-8-8 : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Raw       : bayer_bggr8 : 8-bit Bayer BGBG/GRGR : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Raw       : bayer_gbrg8 : 8-bit Bayer GBGB/RGRG : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Raw       : bayer_grbg8 : 8-bit Bayer GRGR/BGBG : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Raw       : bayer_rggb8 : 8-bit Bayer RGRG/GBGB : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Raw       : Unsupported : 10-bit Bayer BGBG/GRGR Packed : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Raw       : Unsupported : 10-bit Bayer GBGB/RGRG Packed : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Raw       : Unsupported : 10-bit Bayer GRGR/BGBG Packed : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Raw       : Unsupported : 10-bit Bayer RGRG/GBGB Packed : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Raw       : Unsupported : 12-bit Bayer BGBG/GRGR Packed : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Raw       : Unsupported : 12-bit Bayer GBGB/RGRG Packed : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Raw       : Unsupported : 12-bit Bayer GRGR/BGBG Packed : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Raw       : Unsupported : 12-bit Bayer RGRG/GBGB Packed : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Raw       : Unsupported : 14-bit Bayer BGBG/GRGR Packed : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Raw       : Unsupported : 14-bit Bayer GBGB/RGRG Packed : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Raw       : Unsupported : 14-bit Bayer GRGR/BGBG Packed : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Raw       : Unsupported : 14-bit Bayer RGRG/GBGB Packed : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Raw       : Unsupported : 16-bit Bayer BGBG/GRGR : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Raw       : Unsupported : 16-bit Bayer GBGB/RGRG : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Raw       : Unsupported : 16-bit Bayer GRGR/BGBG : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Raw       : Unsupported : 16-bit Bayer RGRG/GBGB : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Compressed: Unsupported : PiSP Bayer Compressed Format : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Compressed: Unsupported : PiSP Bayer Compressed Format : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Compressed: Unsupported : PiSP Bayer Compressed Format : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Compressed: Unsupported : PiSP Bayer Compressed Format : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Raw       :        gray :      8-bit Greyscale : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Raw       : Unsupported : 10-bit Greyscale (MIPI Packed) : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Raw       : Unsupported : 12-bit Greyscale (MIPI Packed) : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Raw       : Unsupported : 14-bit Greyscale (MIPI Packed) : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Raw       :    gray16le :     16-bit Greyscale : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x7fff04000c20] Compressed: Unsupported : PiSP Bayer Compressed Format : {16-16384, 2}x{16-16384, 1}
/dev/video0: Immediate exit requested

Result - negative

ffmpeg can not use any devices as source directly. it works only via rpicam-vid. %(