Replies: 3 comments 11 replies
-
The streamer example input file use 32-bit length as NAL unit separator. Therefore, the 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 |
Beta Was this translation helpful? Give feedback.
-
Thanks! that definitely seems to help - it isn't falling over any more anyway. The video isn't showing in the browser but it's progress! |
Beta Was this translation helpful? Give feedback.
-
So as expected, I could do with another pointer or two :-)
and unsurprisingly there is a non-zero count for When using the AVPacket based stream, the top of the same stats looks like this:
This seems like Chrome doesn't recognise the codec and can't decode the frames. I am encoding using ffmpeg codec name to update, if I encode using |
Beta Was this translation helpful? Give feedback.
-
I have cross posted this on S/O so apologies if you are reading it twice, I will try to keep them both up to date.
I'm encoding a video frame with the
ffmpeg
libraries, generating anAVPacket
with compressed data.Thanks to some recent advice on S/O, I am trying to send that frame over a network using
libdatachannel
, specifically by adapting the streaming example.You will be able to tell I am quite new to streaming...
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..
I have naively copied the contents of an
AVPacket->data
pointer into thesample
vector in the example:but the packetizer is falling over when trying to get length values out of that data.
Specifically, in the following code, the first iteration gets a length of 1, but the second, looking up index 5, gives 1119887324. This is way too big for my data, which is only 3526 bytes (the whole frame is a single colour so likely to be small once encoded):
Here is a dump of
for the first few elements of the message (
*lengthPtr
in parentheses):I am fairly sure I am just missing something basic. E.g. am I supposed to do something with the
AVPacket
side_data
, does AVPacket have or miss some header info?If I just fwrite the
pkt->data
for a single frame to disk, I can read the codec information with ffprobe:I would really appreciate any help this community can offer!
Beta Was this translation helpful? Give feedback.
All reactions