Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support fragmentation packets for MediaRecorder #149

Open
potmat opened this issue Dec 29, 2021 · 3 comments
Open

Support fragmentation packets for MediaRecorder #149

potmat opened this issue Dec 29, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@potmat
Copy link

potmat commented Dec 29, 2021

If trying to use MediaRecorder with an H264 stream which contains fragmentation packets, attempts to record will error out with:

    at Function.concat (node:buffer:544:19)
    at basicCodecParser (/Users/me/Source/webrtctest/node_modules/werift/lib/rtp/src/processor/webm.js:119:33)
    at WebmOutput.dePacketizeRtpPackets (/Users/me/Source/webrtctest/node_modules/werift/lib/rtp/src/processor/webm.js:130:24)
    at WebmOutput.onRtpPackets (/Users/me/Source/webrtctest/node_modules/werift/lib/rtp/src/processor/webm.js:93:43)
    at Object.promise (/Users/me/Source/webrtctest/node_modules/werift/lib/rtp/src/processor/webm.js:85:36)
    at PromiseQueue.run (/Users/me/Source/webrtctest/node_modules/werift/lib/common/src/promise.js:18:24)
    at /Users/me/Source/webrtctest/node_modules/werift/lib/common/src/promise.js:11:22
    at new Promise (<anonymous>)
    at PromiseQueue.push (/Users/me/Source/webrtctest/node_modules/werift/lib/common/src/promise.js:8:34)
    at WebmOutput.pushRtpPackets (/Users/me/Source/webrtctest/node_modules/werift/lib/rtp/src/processor/webm.js:85:20)

Seems to be because here https://github.com/shinyoshiaki/werift-webrtc/blob/develop/packages/rtp/src/codec/h264.ts#L77 if the unit type is 28/29 it will return a packet with an undefined payload.

@shinyoshiaki
Copy link
Owner

Since werift does not support fragmentation mode at the moment, so I think change packetization-mode=1 to packetization-mode=0 in RTCRtpCodecParameters.parameters to make it work.

@shinyoshiaki shinyoshiaki added the enhancement New feature or request label Dec 30, 2021
@potmat
Copy link
Author

potmat commented Jan 9, 2022

I found a workaround such that I don't need to use MediaRecorder.

@kolserdav
Copy link
Contributor

I found a workaround such that I don't need to use MediaRecorder.

Can you please give a hint how you do it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants