I'm finalizing a release of my gentoo-on-rpi3-64bit image, which given recent stabilizations I've decided will now be shipping with a 4.19.y kernel (rather than 4.14.y, which was the original plan).
Amongst other things, this allows the use of the pi camera module v2 in a full 64-bit system via /dev/video0, which is nice. Some v4l2 m2m codecs also appear (/dev/video10 etc.). But to be honest I am stumbling around with some of this, so I would really appreciate a few pointers on the following:
- To get the camera interfaces to appear, I need to set "start_x=1" in /boot/config.txt, and this is true even for the m2m interfaces; is my understanding on that correct? I.e. if I just want m2m and have no camera module attached, I still need to use start_x=1?
- I am current specifying "dtoverlay=vc4-kms-v3d,cma-256" and "gpu_mem=16" in /boot/config.txt; are those sensible settings? When the v4l2 camera or v4l2 m2m codecs interfaces are in use, does gpu_mem need to be increased or is this irrelevant?
- Would you expect the v4l2 m2m endpoints to operate correctly with a 64-bit userland? I have ffmpeg 4.1.1 compiled with the v4l extensions, but am getting segfaults every time I try to use h264_v4l2m2m. Do I have to set up some other init of the /dev/video1x interfaces to make them usable? Is there a simple ffmpeg incantation on a known (e.g. h264) source somewhere I can try to verify if the m2m stuff is working properly?
Code: Select all
demouser@pi64 ~ $ ffmpeg -f video4linux2 -input_format h264 -video_size 1280x720 -framerate 30 -i /dev/video0 -vcodec copy -an test.h264
Code: Select all
demouser@pi64 ~ $ dd if=/dev/video0 bs=1M count=1 of=test.jpg
Here's what I'm seeing with the camera plugged in for /dev/video*:
Code: Select all
pi64 ~ # uname -a
Linux pi64 4.19.25-v8-78eb13b25d5e-bis+ #2 SMP PREEMPT Tue Feb 26 13:27:47 GMT 2019 aarch64 GNU/Linux
pi64 ~ # v4l2-ctl --all -d /dev/video10
Driver Info (not using libv4l2):
Driver name : bcm2835-codec
Card type : bcm2835-codec
Bus info : platform:bcm2835-codec
Driver version: 4.19.25
Capabilities : 0x84208000
Video Memory-to-Memory
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04208000
Video Memory-to-Memory
Streaming
Extended Pix Format
Priority: 2
Format Video Capture:
Width/Height : 640/480
Pixel Format : 'YU12'
Field : None
Bytes per Line : 640
Size Image : 460800
Colorspace : Rec. 709
Transfer Function : Default (maps to Rec. 709)
YCbCr/HSV Encoding: Default (maps to Rec. 709)
Quantization : Default (maps to Limited Range)
Flags :
Format Video Output:
Width/Height : 640/480
Pixel Format : 'MPG4'
Field : None
Bytes per Line : 0
Size Image : 524288
Colorspace : Rec. 709
Transfer Function : Default (maps to Rec. 709)
YCbCr/HSV Encoding: Default (maps to Rec. 709)
Quantization : Default (maps to Full Range)
Flags :
Selection: compose, Left 0, Top 0, Width 640, Height 480
Selection: compose_default, Left 0, Top 0, Width 640, Height 480
Selection: compose_bounds, Left 0, Top 0, Width 640, Height 480
pi64 ~ # v4l2-ctl --all -d /dev/video11
Driver Info (not using libv4l2):
Driver name : bcm2835-codec
Card type : bcm2835-codec
Bus info : platform:bcm2835-codec
Driver version: 4.19.25
Capabilities : 0x84208000
Video Memory-to-Memory
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04208000
Video Memory-to-Memory
Streaming
Extended Pix Format
Priority: 2
Format Video Capture:
Width/Height : 640/480
Pixel Format : 'H264'
Field : None
Bytes per Line : 0
Size Image : 524288
Colorspace : Rec. 709
Transfer Function : Default (maps to Rec. 709)
YCbCr/HSV Encoding: Default (maps to Rec. 709)
Quantization : Default (maps to Full Range)
Flags :
Format Video Output:
Width/Height : 640/480
Pixel Format : 'YU12'
Field : None
Bytes per Line : 640
Size Image : 460800
Colorspace : Rec. 709
Transfer Function : Default (maps to Rec. 709)
YCbCr/HSV Encoding: Default (maps to Rec. 709)
Quantization : Default (maps to Limited Range)
Flags :
Selection: crop, Left 0, Top 0, Width 640, Height 480
Selection: crop_default, Left 0, Top 0, Width 640, Height 480
Selection: crop_bounds, Left 0, Top 0, Width 640, Height 480
Codec Controls
video_bitrate_mode 0x009909ce (menu) : min=0 max=1 default=0 value=0 flags=update
video_bitrate 0x009909cf (int) : min=25000 max=25000000 step=25000 default=10000000 value=10000000
repeat_sequence_header 0x009909e2 (bool) : default=0 value=0
h264_i_frame_period 0x00990a66 (int) : min=0 max=2147483647 step=1 default=60 value=60
h264_level 0x00990a67 (menu) : min=0 max=13 default=11 value=11
h264_profile 0x00990a6b (menu) : min=0 max=4 default=4 value=4
pi64 ~ # v4l2-ctl --all -d /dev/video12
Driver Info (not using libv4l2):
Driver name : bcm2835-codec
Card type : bcm2835-codec
Bus info : platform:bcm2835-codec
Driver version: 4.19.25
Capabilities : 0x84208000
Video Memory-to-Memory
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04208000
Video Memory-to-Memory
Streaming
Extended Pix Format
Priority: 2
Format Video Capture:
Width/Height : 0/0
Pixel Format : 'YUYV'
Field : None
Bytes per Line : 0
Size Image : 0
Colorspace : Rec. 709
Transfer Function : Default (maps to Rec. 709)
YCbCr/HSV Encoding: Default (maps to Rec. 709)
Quantization : Default (maps to Limited Range)
Flags :
Format Video Output:
Width/Height : 0/0
Pixel Format : 'BA81'
Field : None
Bytes per Line : 0
Size Image : 0
Colorspace : Rec. 709
Transfer Function : Default (maps to Rec. 709)
YCbCr/HSV Encoding: Default (maps to Rec. 709)
Quantization : Default (maps to Full Range)
Flags :
Crop Capability Video Capture:
Bounds : Left 0, Top 0, Width 0, Height 0
Default : Left 0, Top 0, Width 0, Height 0
Pixel Aspect: 1/1
Crop Capability Video Output:
Bounds : Left 0, Top 0, Width 0, Height 0
Default : Left 0, Top 0, Width 0, Height 0
Pixel Aspect: 1/1
Crop: Left 0, Top 0, Width 0, Height 0
Selection: crop, Left 0, Top 0, Width 0, Height 0
Selection: crop_default, Left 0, Top 0, Width 0, Height 0
Selection: crop_bounds, Left 0, Top 0, Width 0, Height 0
Selection: compose, Left 0, Top 0, Width 0, Height 0
Selection: compose_default, Left 0, Top 0, Width 0, Height 0
Selection: compose_bounds, Left 0, Top 0, Width 0, Height 0
Selection: compose_padded, Left 0, Top 0, Width 0, Height 0
Selection: native_size, Left 0, Top 0, Width 0, Height 0
Selection: crop, Left 0, Top 0, Width 0, Height 0
Selection: crop_default, Left 0, Top 0, Width 0, Height 0
Selection: crop_bounds, Left 0, Top 0, Width 0, Height 0
Selection: compose, Left 0, Top 0, Width 0, Height 0
Selection: compose_default, Left 0, Top 0, Width 0, Height 0
Selection: compose_bounds, Left 0, Top 0, Width 0, Height 0
Selection: compose_padded, Left 0, Top 0, Width 0, Height 0
Selection: native_size, Left 0, Top 0, Width 0, Height 0
Code: Select all
pi64 ~ # ffmpeg -codecs | grep -i m2m
ffmpeg version 4.1.1 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 8.2.0 (Gentoo 8.2.0-r6 p1.7)
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --docdir=/usr/share/doc/ffmpeg-4.1.1/html --mandir=/usr/share/man --enable-shared --cc=aarch64-unknown-linux-gnu-gcc --cxx=aarch64-unknown-linux-gnu-g++ --ar=aarch64-unknown-linux-gnu-ar --optflags='-march=armv8-a+crc -mtune=cortex-a53 -O2 -pipe' --disable-static --enable-avfilter --enable-avresample --disable-stripping --disable-optimizations --disable-libcelt --enable-nonfree --disable-indev=oss --disable-indev=jack --disable-outdev=oss --enable-bzlib --disable-runtime-cpudetect --disable-debug --disable-gcrypt --disable-gnutls --disable-gmp --enable-gpl --enable-hardcoded-tables --enable-iconv --disable-libtls --disable-lzma --enable-network --disable-opencl --enable-openssl --enable-postproc --disable-libsmbclient --enable-ffplay --enable-sdl2 --disable-vaapi --disable-vdpau --enable-xlib --enable-libxcb --enable-libxcb-shm --enable-libxcb-xfixes --enable-zlib --disable-libcdio --disable-libiec61883 --disable-libdc1394 --disable-libcaca --disable-openal --enable-opengl --enable-libv4l2 --disable-libpulse --disable-libdrm --disable-libjack --disable-libopencore-amrwb --disable-libopencore-amrnb --disable-libcodec2 --disable-libfdk-aac --disable-libopenjpeg --disable-libbluray --disable-libgme --disable-libgsm --disable-mmal --disable-libmodplug --disable-libopus --disable-libilbc --disable-librtmp --disable-libssh --disable-libspeex --disable-libsrt --enable-librsvg --disable-ffnvcodec --enable-libvorbis --disable-libvpx --disable-libzvbi --disable-appkit --disable-libbs2b --disable-chromaprint --disable-libflite --disable-frei0r --disable-libfribidi --disable-fontconfig --disable-ladspa --disable-libass --disable-lv2 --enable-libfreetype --disable-librubberband --disable-libzmq --disable-libzimg --disable-libsoxr --enable-pthreads --disable-libvo-amrwbenc --enable-libmp3lame --disable-libkvazaar --disable-libaom --disable-libopenh264 --disable-libsnappy --enable-libtheora --disable-libtwolame --disable-libwavpack --disable-libwebp --enable-libx264 --disable-libx265 --enable-libxvid --disable-gnutls --disable-mipsdsp --disable-mipsdspr2 --disable-mipsfpu --disable-altivec --disable-amd3dnow --disable-amd3dnowext --disable-aesni --disable-avx --disable-avx2 --disable-fma3 --disable-fma4 --disable-mmx --disable-mmxext --disable-sse --disable-sse2 --disable-sse3 --disable-ssse3 --disable-sse4 --disable-sse42 --disable-xop --cpu=armv8-a+crc --disable-doc --disable-htmlpages --enable-manpages
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
DEV.L. h263 H.263 / H.263-1996, H.263+ / H.263-1998 / H.263 version 2 (decoders: h263 h263_v4l2m2m ) (encoders: h263 h263_v4l2m2m )
DEV.LS h264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_v4l2m2m ) (encoders: libx264 libx264rgb h264_v4l2m2m )
DEV.L. hevc H.265 / HEVC (High Efficiency Video Coding) (decoders: hevc hevc_v4l2m2m ) (encoders: hevc_v4l2m2m )
DEV.L. mpeg1video MPEG-1 video (decoders: mpeg1video mpeg1_v4l2m2m )
DEV.L. mpeg2video MPEG-2 video (decoders: mpeg2video mpegvideo mpeg2_v4l2m2m )
DEV.L. mpeg4 MPEG-4 part 2 (decoders: mpeg4 mpeg4_v4l2m2m ) (encoders: mpeg4 libxvid mpeg4_v4l2m2m )
D.V.L. vc1 SMPTE VC-1 (decoders: vc1 vc1_v4l2m2m )
DEV.L. vp8 On2 VP8 (decoders: vp8 vp8_v4l2m2m ) (encoders: vp8_v4l2m2m )
D.V.L. vp9 Google VP9 (decoders: vp9 vp9_v4l2m2m )
sakaki