EmguFFmpeg icon indicating copy to clipboard operation
EmguFFmpeg copied to clipboard

From RTP packet (Audio and or Video) create MediaFame

Open ChristopheI opened this issue 2 years ago • 6 comments

I wondering it's its possible to decode RTP packets (Audio and/or Video) ?

I have already them in memory - RTP Header and RTP Payload. I have the SDP associated (if necessary).

But I'm wondering how to create an MrdiaFrame using all that ...

Do you have any idea / hints about this ?

Thanks.

ChristopheI avatar Dec 21 '22 17:12 ChristopheI

How do I implement the same test environment as you? Can you provide more specific information about your scenario?

IOL0ol1 avatar Dec 22 '22 10:12 IOL0ol1

I have a SIP or WebRTC communication created using a SDP (with Audio and/or Video) Then I receive from the Peer RTP packets. I would like to decode this packets using MediaFrame.

If you want I can share with you:

  • a SDP File
  • a file which contains a "List<byte[]>": Audio RTP packets (with Header + Payload)
  • a file which contains a "List<byte[]: Video RTP packets (with Header + Payload)

ChristopheI avatar Dec 22 '22 14:12 ChristopheI

I have a SIP or WebRTC communication created using a SDP (with Audio and/or Video) Then I receive from the Peer RTP packets. I would like to decode this packets using MediaFrame.

If you want I can share with you:

  • a SDP File
  • a file which contains a "List<byte[]>": Audio RTP packets (with Header + Payload)
  • a file which contains a "List<byte[]: Video RTP packets (with Header + Payload)

Yes, I am very interested in your application scenario, please share it with me.

IOL0ol1 avatar Dec 22 '22 15:12 IOL0ol1

In both VideoRTP.zi and AudioRTP.zip you'll find RTP stored as "List<byte[]>" in 3 files: RTP headers only, RTP payloads only and RTP packets (Header + Payload). Just in case.

The video is a screen sharing of video clips(low fps). The audio is a recording from them using a microphone from my headset... The sound should be bad ...

And two SDP files, from the remote and the local Peer.

Audio is using OPUS Video is using VP8

If you need any other info don't hesitate. And thank you for your help !

videoRTP.zip AudioRTP.zip SDPFileFromLocalPeer.txt SDPFileFromRemotePeer.txt

ChristopheI avatar Dec 22 '22 16:12 ChristopheI

Just in case the code used to save data to file

private List<byte[]> audioRTPPayloadList = new();
...
using (Stream stream = File.Open(fileNameRTPPayload, FileMode.OpenOrCreate, FileAccess.Write))
{
    var bformatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
    bformatter.Serialize(stream, audioRTPPayloadList);
}

ChristopheI avatar Dec 22 '22 16:12 ChristopheI

There is 10000 RTP Audio packets and 5000 RTP Video packets

ChristopheI avatar Dec 22 '22 16:12 ChristopheI