shinyoshiaki / werift-webrtc

WebRTC Implementation for TypeScript (Node.js), includes ICE/DTLS/SCTP/RTP/SRTP/WEBM/MP4

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

addTrack/removeTrack regression

koush opened this issue · comments

Caused by 19d1dec

Error: transceiver not found

Don't have time to determine why its failing at the moment, just merged and bisected to find the issue.

It is failing while trying to find a transceiver by mid, which was already removed. That mid is somehow still in the currentDescription. The transceivers had been reused and had different mids.

const transceiver = this.getTransceiverByMid(mid);

I don't know if it's fixed or not because of the lack of hints, but I tried to fix it anyway.

Give it a try.
https://github.com/shinyoshiaki/werift-webrtc/tree/maintain/transceivers

Nope, same issue.

<anonymous> (/Volumes/Dev/src/peerConnection.ts:313)
buildOfferSdp (/Volumes/Dev/src/peerConnection.ts:292)
createOffer (/Volumes/Dev/src/peerConnection.ts:240)
await (Unknown Source:0)
createLocalDescription (/Volumes/Dev/scrypted/plugins/webrtc/src/werift-signaling-session.ts:30)
connectRTCSignalingClients (/Volumes/Dev/scrypted/common/src/rtc-signaling.ts:295)
await (Unknown Source:0)
negotiateRTCSignalingSessionInternal (/Volumes/Dev/scrypted/plugins/webrtc/src/ffmpeg-to-wrtc.ts:412)
negotiateRTCSignalingSession (/Volumes/Dev/scrypted/plugins/webrtc/src/ffmpeg-to-wrtc.ts:399)
handleMessage (/Volumes/Dev/scrypted/server/src/rpc.ts:527)
<anonymous> (/Volumes/Dev/scrypted/server/src/scrypted-plugin-main.ts:18)
[nodejs.internal.kHybridDispatch] (internal/event_target:731)
exports.emitMessage (internal/per_context/messageport:23)
callbackTrampoline (internal/async_hooks:130)

What is the purpose of this fix change? 19d1dec

It seems to touch a lot of different things.

What is the purpose of this fix change?

  • Fixes for additional tests
  • refactoring
  • step-by-step tidying up of direction and currentDirection (not done)

I think it's probably the third one, so I've removed it from the branch and you can check it again to make sure it works
https://github.com/shinyoshiaki/werift-webrtc/tree/maintain/19d1dec2

Thanks. Breaking this up into smaller changes will let me bisect further. I’ll check again shortly.

At first glance, your new branch seems to fix the issue. I'll test further and follow up.

Also, I'm not sure if you're into home automation and have cameras in Homekit, etc: I built a product that uses werift extensively.

Scrypted (open source project) bridges cameras to HomeKit, Google Home, Alexa, and more. The NVR (paid product) does 24/7 recording. NVR Demo: https://demo.scrypted.app/#/demo

I can give you an unlimited license if you're interested.

My motivations are a little selfish, as it would also provide additional real world testing on this upstream dependency :)

I can give you an unlimited license if you're interested.

Sounds good
Please send me private information via email or Twitter.

@shinyoshiaki what is your twitter or email? can reach me at koush@koushikdutta.com

@koush I sent email