| CARBONIAN-VR-PHONE-ENCODE(1) | Carbonian Manual | CARBONIAN-VR-PHONE-ENCODE(1) |
carbonian-vr-phone-encode - the fallback H.264 encoder (ffmpeg) that Monado's phone target sends frames to
carbonian-vr-phone-encode --size WxH [--fps N] [--host ADDR] [--port PORT] [--bitrate RATE] [--codec CODEC]
When a phone is the headset (carbonian-vr-phone(1)), Monado's phone target (XRT_COMPOSITOR_FORCE_PHONE=1, Carbonian's Monado) renders the eyes without a window and encodes each frame with NVENC itself when it can. When it cannot (no NVIDIA GPU, or a Monado built without NVENC), it starts this program instead and hands it every frame; it is not meant to be run by hand.
Monado starts it with --size and --fps, then the words of XRT_PHONE_ARGS, and two pipes: on descriptor 3 a header for each frame (PHF1, the frame's id, its time, the head's pose at the display time, the width and the height), on the standard input the frame's RGBA pixels, which go straight to ffmpeg(1) untouched. ffmpeg encodes H.264 with no B-frames, at a constant bitrate (with NVENC) and a key frame every 2 seconds. Each encoded unit goes over TCP to the app on the phone with its frame's id, time and pose, so the phone can correct the picture for the head's movement since.
The phone is ADDR, or else the neighbour on the USB tethering interface (a network device driven by rndis_host, cdc_ncm or cdc_ether). While no phone is connected the frames are dropped; the connection is tried again every half second. Every 2 seconds it writes to standard error the frames per second in and out, the bitrate, and the time from the compositor to the socket. It ends when descriptor 3 closes or a header is wrong.
carbonian-vr-phone encode runs the same program.
Read by Monado, not by this program:
/usr/lib/carbonian/vr-phone/phone-encode
carbonian-vr-phone(1), vr-phone.conf(5), carbonian-vr(1), ffmpeg(1)
| 2026-11-03 | Carbonian |