Supported hardware
IP Cameras
OnVif compliant IP cameras (supporting the RTSP protocol)
Initial configuration of IP cameras can be a hurdle:
Many IP cameras typically require a half-broken Active-X (!) web-extension you have to download (to use with some outdated version of internet explorer).
Once you have sorted out those manufacturer-dependent issues you are good to go with OnVif and the RTSP protocol (as supported by libValkka).
Axis cameras, on the other hand, have a decent (standard javascript) web-interface for camera initial configuration.
Once you have done succesfull initial configuration, you can test the rtsp connection, with, say, using ffmpeg:
ffmpeg rtsp://user:password@ip-address
USB Cameras
USB Cameras capable of streaming H264
We have tested against Logitech HD Pro Webcam C920
Codecs
For the moment, the only supported codec is H264
Linux clients
libValkka uses OpenGL and OpenGL texture streaming, so it needs a robust OpenGL implementation. The current situation is:
Intel: the stock i915 driver is OK
Nvidia: use nvidia proprietary driver
ATI: not tested
OpenGL version 3 or greater is required. You can check your OpenGL version with the command glxinfo.
Hardware Acceleration
Please first read this word of warning.
VAAPI
Comes in the basic libValkka installation (and uses ffmpeg/libav infrastructure) - no additional packages needed.
First of all, the user using VAAPI, must belong to the “video” user group:
groups $USER
# run the following command if the user does not appear in the video group
sudo usermod -a -G video $USER
# after that you still need to logout & login
In order to use the VAAPI acceleration, just replace AVThread with VAAPIThread, i.e. instead of
avthread = AVThread("avthread", target_filter)
use this:
avthread = VAAPIThread("avthread", target_filter)
For more details about VAAPI, you can read this, this and this.
Oftentimes it happens that with the latest ubuntu distribution, VAAPI is broken to begin with (the driver itself, driver talking with the kernel, whatever).
A minimal test is to try to run VAAPI acceleration with the ffmpeg that came with the distro, i.e.:
`
LIBVA_DRIVER_NAME=i965 ffmpeg -hwaccel vaapi -i rtsp://user:passwd@ip -c:v rawvideo -pix_fmt yuv420p -f sdl "Video"
`
If that busts, then you should not try to use VAAPI with your ubuntu distro.
WARNING: VAAPI, especially the intel implementation, comes with a memory leak, which seems to be feature, not a bug - see discussions in here and here. I have confirmed this memory leak myself with libva 2.6.0.
The opensource Mesa implementation (“i965”) is (surprise!) more stable and libValkka enforces i965 internally by setting the environment variable LIBVA_DRIVER_NAME to i965 (this happens when you do from valkka.core import *).
If you really want to use other libva implementation, you can set
export VALKKA_LIBVA_DRIVER_NAME=your-driver-name
If you wish to use VAAPI in a docker environment, you should start docker with
--device=/dev/dri:/dev/dri
And be sure that the host machine has all required vaapi-related libraries installed (the easiest way: install libValkka on the host as well).
Finally, you can follow the GPU usage in realtime with:
sudo intel_gpu_top
NVidia / CUDA
Provided as a separate package that installs into the valkka.nv namespace and is used like this:
from valkka.nv import NVThread
avthread = NVThread("avthread", target_filter, gpu_index)
Available here
Huawei / CANN
Provided as a separate package. Very experimental and not guaranteed to work.
Available here