Eyevinn / srt-whep

SRT to WHEP (WebRTC)
Apache License 2.0
69 stars 9 forks source link

whipsink element factory missing #21

Closed smanemann closed 1 year ago

smanemann commented 1 year ago

Hey,

i was trying to play around with this, but I'm getting this error, regardless of running the docker or compiling from scratch in debian:

{"v":0,"name":"srt_whep","msg":"[HTTP REQUEST - END]","level":30,"hostname":"xxxxx","pid":8309,"time":"2023-06-29T07:39:15.388239309Z","target":"tracing_actix_web::root_span_builder","line":41,"file":"/home/admin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tracing-actix-web-0.7.5/src/root_span_builder.rs","http.route":"/channel","otel.name":"HTTP POST /channel","http.status_code":500,"http.user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36","http.method":"POST","exception.message":"Failed to add client","http.scheme":"http","http.flavor":"1.1","otel.status_code":"ERROR","exception.details":"Failed to add client\n\nCaused by:\n\tFailed to find element factory with name 'whipsink' for creating element\n","otel.kind":"server","http.client_ip":"yyyyyy","http.target":"/channel","request_id":"530ae23c-f302-40a0-8b41-53609f8bf0ba","http.host":"xxxxxxx:8000","elapsed_milliseconds":0}

Any Idea what that could relate to?

Thanks in advance!

birme commented 1 year ago

Can you check @Wkkkkk ? It looks to me like missing some gstreamer deps

smanemann commented 1 year ago

that was my feeling too :)

Wkkkkk commented 1 year ago

Hi smanemann, thanks for trying it out. If you are using debian, could you try run cmd gst-inspect-1.0 -v whipsink? This should verify if the deps are installed correctly or not.

smanemann commented 1 year ago

It seems like the whipsink plugin is not installed at all.

No such element or plugin 'whipsink'

is there any way to install it manually ? ( just found the plugins-good/bad etc.). btw. it's the same missing dependency is the container eyevinn/srt-whep:latest

Wkkkkk commented 1 year ago

A quick update on this problem. It turns out that 'whipsink' was added to gstreamer-1.22 while most Ubuntu distro only have 1.20 available.

Will post updates here once found.

sdroege commented 1 year ago

As this is written in Rust, you could statically link in the plugin with whip/whep. It's available on crates.io: https://crates.io/crates/gst-plugin-webrtchttp

You'd only need to call its initialization function some time after gst::init() then.

sdroege commented 1 year ago

Also, Ubuntu does not ship whipsink together with 1.22 either. They didn't package that plugin and you should ask them to do that if you use Ubuntu.

For the time being the simplest would be to include the plugin statically inside this application.

Wkkkkk commented 1 year ago

Thanks a lot for the valuable feedback!

Wkkkkk commented 1 year ago

Hi @smanemann , I have a fix for this problem under a new branch. Would you like to check that out?

I was using a Debian machine for testing and would like to know more about your OS/architecture.

smanemann commented 1 year ago

Hey @Wkkkkk , yes, I have seen and tested that. The issue seems to be resolved with that one.

Initially I tested using the container running on docker desktop in windows. Now I'm using an EC2 running on a Debian 11 AMI. Nothing special I think ;)

Wkkkkk commented 1 year ago

Glad to know that. Could you double-confirm that you can play out your test SRT stream on Chrome?

smanemann commented 1 year ago

I wish I could :)

There seems to be a gstreamer Issue linking the Video queue with the whip-sink :

{"v":0,"name":"srt_whep","msg":"[HTTP REQUEST - EVENT] Error encountered while processing the incoming HTTP request: Failed to add client\n\nCaused by:\n\tFailed to link elements 'video-queue-bb00328d-e48a-4924-8262-6d2cd1e81255' and 'whip-sink-bb00328d-e48a-4924-8262-6d2cd1e81255'\n","level":50,"hostname":"ip-172-31-1-180","pid":1,"time":"2023-06-29T19:07:10.709441493Z","target":"tracing_actix_web::middleware","line":258,"file":"/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tracing-actix-web-0.7.5/src/middleware.rs","http.flavor":"1.1","http.user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36","http.target":"/channel","request_id":"824597ea-98a9-4d7f-b7fa-f2191fe1e1d1","http.status_code":500,"http.method":"POST","http.scheme":"http","http.route":"/channel","otel.status_code":"ERROR","exception.message":"Failed to add client","exception.details":"Failed to add client\n\nCaused by:\n\tFailed to link elements 'video-queue-bb00328d-e48a-4924-8262-6d2cd1e81255' and 'whip-sink-bb00328d-e48a-4924-8262-6d2cd1e81255'\n","otel.name":"HTTP POST /channel","http.host":"3.70.210.67:8000","http.client_ip":"45.155.142.110","otel.kind":"server"}

Wkkkkk commented 1 year ago

I had the same issue on my Linux Mint machine and it relates to vaapi. Similar issues can be seen here.

Will keep you updated once there is a fix.

Wkkkkk commented 1 year ago

Hi @smanemann , I've tested it on Linux Mint / Ubuntu and it should work now. Please check the updated instructions and let me know if you have any questions.