#!/usr/bin/env bash
# scripts/manual/video-stream.sh
#
# Manual: stream live server video into a local GStreamer preview.
# Not part of CI; requires grpcurl, jq, and GStreamer.
set -euo pipefail

grpcurl -plaintext \
  -d '{"id":0,"max_bitrate":6000}' \
  -import-path ./../../common/proto -proto lesavka.proto \
  192.168.42.253:50051 \
  lesavka.relay.Relay/CaptureVideo |
  jq -r '.data' |
  base64 -d |
  gst-launch-1.0 fdsrc ! h264parse ! avdec_h264 ! autovideosink
