cberner / raptorq

Rust implementation of RaptorQ (RFC6330)
Apache License 2.0
264 stars 47 forks source link

With the decoder, is it possible to return any decoded data, even if channel loss is too high and not enough packets are available at the decoder? #168

Closed mr10abb closed 4 months ago

mr10abb commented 4 months ago

My apologies for using the issue system to ask this question, I couldn't see any other way to get in contact.

For context, I am using your Python package to encode an RTP video stream in _X_ms chunks. The data is then sent via multicast to multiple end users via a lossy WiFi channel. At each decoder, I would like to be able to retrieve any packets that have been successfully decoded. Currently I am using:

for packet in received_packets:
    result = decoder.decode(packet)
    if result is not None:
        break

As per your Python example. This however only returns the original data if it has been 100% successfully decoded. Is there a way to stop the decoding process after I have run out of received packets (i.e., the loss was too high and result is still None?), and then return any data that has been decoded successfully? Or even return the best guess?

In my example, I am simply concatenating the RTP packets into the _X_ms chunks which are then encoded, so after decoding, I would then split the chunk back into RTP packets, and check their CRCs to determine if they should be forwarded onto the video application.

Thank you for taking the time to read this, and thank you for developing this project!

The work am I undertaking is part of my research into SDN control, and I intended to make it open source alongside publications.

Kind regards, Matt, University of Hertfordshire, m.robinson20 AT herts.ac.uk

cberner commented 4 months ago

iirc, all the initial blocks contain the original data, only the repair blocks contain parity data. So you can take the data from the initial source blocks and reassembly it. Unfortunately, that's about all the guidance I can provide. I've never tried doing that and am no longer actively developing this project. But I recall that the spec is quite clear on how to construct the initial source packets

On Thu, Apr 11, 2024 at 4:48 AM Matthew Robinson @.***> wrote:

My apologies for using the issue system to ask this question, I couldn't see any other way to get in contact.

For context, I am using your Python package to encode an RTP video stream in _X_ms chunks. The data is then sent via multicast to multiple end users via a lossy WiFi channel. At each decoder, I would like to be able to retrieve any packets that have been successfully decoded. Currently I am using:

for packet in received_packets: result = decoder.decode(packet) if result is not None: break

As per your Python example. This however only returns the original data if it has been 100% successfully decoded. Is there a way to stop the decoding process after I have run out of received packets (i.e., the loss was too high and result is still None?), and then return any data that has been decoded successfully? Or even return the best guess?

In my example, I am simply concatenating the RTP packets into the _X_ms chunks which are then encoded, so after decoding, I would then split the chunk back into RTP packets, and check their CRCs to determine if they should be forwarded onto the video application.

Thank you for taking the time to read this, and thank you for developing this project!

The work am I undertaking is part of my research into SDN control, and I intended to make it open source alongside publications.

Kind regards, Matt, University of Hertfordshire, m.robinson20 AT herts.ac.uk

— Reply to this email directly, view it on GitHub https://github.com/cberner/raptorq/issues/168, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGNXQCIU4YY6RQ5R6TGG7TY4Z2AHAVCNFSM6AAAAABGCESVP6VHI2DSMVQWIX3LMV43ASLTON2WKOZSGIZTONJUGE2TIMA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

mr10abb commented 4 months ago

Thanks for your info, I might look into this and try to retrieve the semi-decoded source packets.