[Libav-user] Sending AVpacket data over socket

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Libav-user] Sending AVpacket data over socket

Philippe Noël
Hi,

What is the most efficient/fastest way to send AVpacket frame data (stored in data) through a socket?

I understand that since it is a byte array, I think I would need to memcpy + serialize it, to avoid the 0x00 error. Is there a faster way/way to send the byte array directly? I'm interested in the lowest possible latency at all cost and I worry serializing will be too slow.

Thanks for your help!

Phil

_______________________________________________
Libav-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Sending AVpacket data over socket

Richard Hussong


On Mon, Dec 9, 2019 at 12:19 PM Philippe Noël <[hidden email]> wrote:
Hi,

What is the most efficient/fastest way to send AVpacket frame data (stored in data) through a socket?

I understand that since it is a byte array, I think I would need to memcpy + serialize it, to avoid the 0x00 error. Is there a faster way/way to send the byte array directly? I'm interested in the lowest possible latency at all cost and I worry serializing will be too slow.

Sockets do not interpret the data you send through them using send() or write(), so there is no "0x00 error". You are probably trying to compute the length of the frame data using strlen(). Just use the "size" field of the AVPacket instead; it contains the length of the buffer in bytes.

Thanks for your help!

Phil
_______________________________________________
Libav-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".

_______________________________________________
Libav-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".