Glimesh / broadcast-box

A broadcast, in a box.
MIT License
1.47k stars 86 forks source link

Trouble with Gstreamer WHEP #43

Closed erikherz closed 11 months ago

erikherz commented 1 year ago

I can see video in Chrome after publishing this via WHIP:

gst-launch-1.0 v4l2src ! "video/x-raw,format=YUY2,width=1920,height=1080,pixel-aspect-ratio=1/1,framerate=60/1" ! videoconvert ! "video/x-raw,width=1920,height=1080,framerate=60/1,format=I420" ! svtav1enc target-bitrate=5000000 crf=63 preset=8 ! av1parse ! rtpav1pay ! 'application/x-rtp,media=video,encoding-name=AV1,payload=97,clock-rate=90000' ! whip.sink_0 audiotestsrc ! opusenc ! rtpopuspay ! 'application/x-rtp,media=audio,encoding-name=OPUS,payload=96,clock-rate=48000,encoding-params=(string)2' ! whip.sink_1 whipsink name=whip auth-token=test whip-endpoint=https://bb.vivoh.io/api/whip

(note: this is not a public server)

But I am not able to see video with this WHEP pipeline:

gst-launch-1.0 whepsrc name=whip auth-token=test whep-endpoint=https://bb.vivoh.io/api/whep ! videoconvert ! autovideosink

However no debug errors are thrown:

vivoh@vivoh-linux:~/Desktop/test$ GST_DEUBG=2 ./whep.sh 
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
^C^Xhandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:02:43.718775370
Setting pipeline to NULL ...
Freeing pipeline ...
vivoh@vivoh-linux:~/Desktop/test$

whep.sh is:

vivoh@vivoh-linux:~/Desktop/test$ cat whep.sh
#!/bin/bash                                                                                                                                    

export VIVOH_HOME=/usr/local/vivoh

export LD_LIBRARY_PATH=$VIVOH_HOME/lib/x86_64-linux-gnu
export GST_PLUGIN_PATH=$VIVOH_HOME/lib/x86_64-linux-gnu/gstreamer-1.0
#export GST_PLUGIN_SCANNER=$VIVOH_HOME/libexec/gstreamer-1.0/gst-plugin-scanner
export PATH=$PATH:$VIVOH_HOME/bin

gst-launch-1.0 whepsrc name=whip auth-token=test whep-endpoint=https://bb.vivoh.io/api/whep ! videoconvert ! autovideosink
Sean-Der commented 11 months ago

This conversation was moved to discord here

The pipeline that ended up working was

gst-launch-1.0 whepsrc name=whep auth-token=seanTest whep-endpoint=https://b.siobud.com/api/whep video-caps="application/x-rtp,payload=127,encoding-name=H264,media=video,clock-rate=90000" audio-caps="application/x-rtp,payload=96,encoding-name=OPUS,media=audio,clock-rate=48000" \
whep. ! rtpopusdepay ! fakesink \
whep. ! rtph264depay ! h264parse ! decodebin ! autovideosink