diff --git a/content/posts/streaming-camera-output-trough-udp/client.jpg b/content/posts/streaming-camera-output-trough-udp/client.jpg new file mode 100644 index 0000000..4468223 Binary files /dev/null and b/content/posts/streaming-camera-output-trough-udp/client.jpg differ diff --git a/content/posts/streaming-camera-output-trough-udp/index.md b/content/posts/streaming-camera-output-trough-udp/index.md new file mode 100644 index 0000000..0c99925 --- /dev/null +++ b/content/posts/streaming-camera-output-trough-udp/index.md @@ -0,0 +1,55 @@ ++++ +title = "Streaming camera output trough UDP" +date = 2024-11-14 + +[taxonomies] +categories = ["Linux"] + +[extra] +author = "Emil Miler" ++++ + +I had an interesting assignment to set up a low-latency video stream from a camera to a TV screen on the third floor of a building for a short event. I came up with a simple solution: streaming it directly over UDP using OBS and capturing the stream with MPV. + + + +## Intro + +The event took place on a stage that needed to be streamed to two screens -- one in the lobby on the ground floor and another deep inside the third floor. The audio team provided a clean audio mix directly to my camera’s audio mixer. + +The building, located in the old town of Prague, had a complicated floor plan, as you might imagine. Connecting to the ground floor screen was straightforward with a direct HDMI link, but reaching the third floor was more challenging without an HDMI-to-Ethernet extender, which I didn’t have. + +![x210](x210.jpg) + +My solution was to lay a UTP cable from the TV on the third floor to my laptop with an HDMI capture card, configure direct routing, and stream from OBS to a client that would output the video and audio over HDMI to the TV. + +## Server setup + +First I set up the network: + +```sh +ip a add 192.168.66.1/24 dev eth0 +ip route add 192.168.66.2 dev eth0 +``` + +The OBS part was a little tricky. I am sure this can be highly optimized. + +![OBS Settings](obs-settings.png) + +## Client setup + +Again, static adress is needed, but no routes have to be defined this time. + +```sh +ip a add 192.168.66.2/24 dev eth0 +``` + +The stream can then by captured with MPV: + +``` +mpv --no-cache udp://@0.0.0.0:8081 +``` + +![Client](client.jpg) + +It does have some latency, but since the TV was hidden deep in the building, it was not a big issue. I might try using something like [UltraGrid](http://www.ultragrid.cz/) in the future. diff --git a/content/posts/streaming-camera-output-trough-udp/obs-settings.png b/content/posts/streaming-camera-output-trough-udp/obs-settings.png new file mode 100644 index 0000000..02b4447 Binary files /dev/null and b/content/posts/streaming-camera-output-trough-udp/obs-settings.png differ diff --git a/content/posts/streaming-camera-output-trough-udp/x210.jpg b/content/posts/streaming-camera-output-trough-udp/x210.jpg new file mode 100644 index 0000000..8312083 Binary files /dev/null and b/content/posts/streaming-camera-output-trough-udp/x210.jpg differ