2021-10-12 18:45:00 +00:00
# Working with video
## Video recording
!!! info
2024-03-08 04:50:00 +00:00
H.264 is available on Pi 3 and Pi 4. Older boards won't handle it. Best of all this feature only works for HDMI to CSI bridge. For the USB HDMI dongle, there will be a decrease in FPS to 10-15 for 1080p.
2021-10-12 18:45:00 +00:00
2024-02-17 23:03:42 +00:00
1. Update OS:
{!_update_os.md!}
2. Install ffmpeg:
2021-10-12 18:45:00 +00:00
```
# rw
2024-02-17 23:03:42 +00:00
# pacman -S ffmpeg
2021-10-12 18:45:00 +00:00
```
2024-02-17 23:03:42 +00:00
3. For USB dongle only: Add line `gpu_mem=256` to `/boot/config.txt` .
2021-10-12 18:45:00 +00:00
2024-02-17 23:03:42 +00:00
4. Perform `reboot` command.
2021-10-12 18:45:00 +00:00
2024-02-17 23:03:42 +00:00
5. Run `rw` after the reboot.
2021-10-12 18:45:00 +00:00
6. To record a video, you need to enable the stream (open the web interface or connect via VNC). Then run something like this in the console:
```
# rw
# ustreamer-dump --sink kvmd::ustreamer::h264 --output - | ffmpeg -use_wallclock_as_timestamps 1 -i pipe: -c:v copy test.mp4
```
7. Press `Ctrl+C` to stop recording. Your video will be in the file `test.mp4` .
8. After finishing work, do not forget to switch the file system to read-only mode using `ro` command.
## Take a screenshot via console on PiKVM
!!! note
You must have a stream running
```
# curl --unix-socket /run/kvmd/ustreamer.sock http://localhost/snapshot -o /tmp/screen.jpg
```