libdatachannel | C/C++ WebRTC network library featuring Data Channels | Websocket library
kandi X-RAY | libdatachannel Summary
kandi X-RAY | libdatachannel Summary
libdatachannel is a standalone implementation of WebRTC Data Channels, WebRTC Media Transport, and WebSockets in C++17 with C bindings for POSIX platforms (including GNU/Linux, Android, FreeBSD, Apple macOS and iOS) and Microsoft Windows. WebRTC is a W3C and IETF standard enabling real-time peer-to-peer data and media exchange between two devices. The library aims at being both straightforward and lightweight with minimal external dependencies, to enable direct connectivity between native applications and web browsers without the pain of importing Google's bloated reference library. The interface consists of somewhat simplified versions of the JavaScript WebRTC and WebSocket APIs present in browsers, in order to ease the design of cross-environment applications.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of libdatachannel
libdatachannel Key Features
libdatachannel Examples and Code Snippets
Community Discussions
Trending Discussions on libdatachannel
QUESTION
I'm encoding a video frame with the ffmpeg
libraries, generating an AVPacket
with compressed data.
Thanks to some recent advice here on S/O, I am trying to send that frame over a network using the WebRTC
library libdatachannel
, specifically by adapting the example here:
https://github.com/paullouisageneau/libdatachannel/tree/master/examples/streamer
I am seeing problems inside h264rtppacketizer.cpp
(part of the library, not the example) which are almost certainly to do with how I'm providing the sample data.
(I don't think that this is anything to do with libdatachannel specifically, it will be an issue with what I'm sending)
The example code reads each encoded frame from a file, and populates a sample
by setting the content of the file to the contents of the file:
sample = *reinterpret_cast *>(&fileContents);
sample
is just a std::vector;
I have naively copied the contents of an AVPacket->data
pointer into the sample
vector:
ANSWER
Answered 2022-Mar-31 at 09:16The input files of the streamer example for libdatachannel use 32-bit length as NAL unit separator. Therefore, the H264RtpPacketizer
instance is created with H264RtpPacketizer::Separator::Length
.
If I'm not mistaken the ffmpeg output will have 4-byte start sequences as NAL unit prefix instead (which is actually more common), so if you change the packetizer setting to H264RtpPacketizer::Separator::LongStartSequence
it should accept your sample.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install libdatachannel
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page