diff --git a/README.md b/README.md new file mode 100644 index 0000000..e266bc8 --- /dev/null +++ b/README.md @@ -0,0 +1,41 @@ +# What is it? + +In this repository collected different pipelines with workarounds for zero latency streaming. +Main idea for now is using of docker container with running Ubuntu 22.04 distro inside, mostly for testing purposes. +We must passthrough in this case GPU and Decklink devices for this purpose it is necessary to have similar driver versions on host and container system, otherwise it just will not work. +Component diagram showing what we want to achieve +```plantuml +``@startuml +node "Host" { + package "Docker" { + interface "UDP socket" as USock + package "Container" { + USock - [Gst Pipeline] + } + } + + USock ..> NetworkBridge + [Kernel] -left- GPU + DeckLink -up- [Kernel] + NetworkBridge - [Docker] + NetworkAdapter -left- [Kernel] + + [Gst Pipeline] ..> GPU + [Gst Pipeline] ..> DeckLink + NetworkBridge ..> NetworkAdapter +} +node "Router" { + port PhysicalPort1 + port PhysicalPort2 + NetworkAdapter --> PhysicalPort2 +} +node "Oculus" { + interface WiFi + component MedicineApp + MedicineApp <-- WiFi + WiFi --> PhysicalPort1 +} +@enduml +```sh +sudo docker run --runtime=nvidia --gpus all -v ~/git/gstreamer-pipelines/:/app deepstream-gst:12.6 +``` diff --git a/Dockerfile b/container/Dockerfile similarity index 96% rename from Dockerfile rename to container/Dockerfile index b461097..086f0db 100644 --- a/Dockerfile +++ b/container/Dockerfile @@ -21,7 +21,7 @@ ENV NVIDIA_DRIVER_CAPABILITIES $NVIDIA_DRIVER_CAPABILITIES,video ENV DISPLAY :0 ENV FILENAME=nvdummy.sh # Copy your pipeline script -COPY $FILENAME /app/ +COPY ../$FILENAME /app/ RUN chmod +x /app/$FILENAME # Set working directory diff --git a/nvdummy.sh b/nvdummy.sh new file mode 100755 index 0000000..f8d7089 --- /dev/null +++ b/nvdummy.sh @@ -0,0 +1,14 @@ +#!/bin/bash +GST_DEBUG_COLOR_MODE=off \ + GST_TRACERS="latency(flags=pipeline+element)" \ + GST_DEBUG="GST_TRACER:7" \ + GST_DEBUG_FILE=latency_traces.log \ + gst-launch-1.0 videotestsrc pattern=smpte ! \ + capsfilter caps="video/x-raw, width=1920, height=1080, framerate=30/1" ! \ + nvvideoconvert ! \ + capsfilter caps="video/x-raw(memory:NVMM)" ! \ + nvv4l2h264enc bitrate=10000000 control-rate=1 idrinterval=1 tuning-info-id=3 preset-id=3 profile=2 ! \ + video/x-h264, profile=main ! \ + nvv4l2decoder ! \ + nvvideoconvert ! \ + fakesink