Record an H264 video at full 1920×1080 resolution, 30 fps
This is the simplest case, as no particular applications are needed to record a video in H264, the dd system command is enough for the job. For example:
raspberrypi ~ $ uv4l --driver raspicam --auto-video_nr --encoding h264 --width 1920 --height 1080 [notice] [core] Device detected! [notice] [core] Registering device node /dev/video0
Alternatively, if the driver has been previously loaded with another initial configuration, change it on the fly:
raspberrypi ~ $ sudo apt-get install v4l-utils raspberrypi ~ $ v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat="H264" -d /dev/video0
Since, by default, the system read I/O interface on RPi is too slow for recording at full resolution without data loss, we will give the uv4l process a real-time scheduling priority:
raspberrypi ~ $ sudo chrt -a -r -p 99 `pgrep uv4l`
Now we can record a 10s video:
raspberrypi ~ $ dd if=/dev/video0 of=video.h264 bs=1M & pid=$! ; sleep 10; kill $pid
The driver also supports the more efficient Video4Linux2 Streaming I/O API, but this will require a Video4Linux-complaiant application implementing the mentioned I/O method.
As an alternative to manually setting the real time scheduling priority to the uv4l process each time, you can run the driver with the –sched-rr option, which requires root priviligies by default:
raspberrypi ~ $ sudo uv4l --sched-rr --driver raspicam --auto-video_nr --encoding h264 --width 1920 --height 1080