[Libav-user] Sending AVpacket data over socket

Richard Hussong rhussong at westpond.com
Tue Dec 10 22:26:27 EET 2019

On Mon, Dec 9, 2019 at 12:19 PM Philippe Noël <
philippe_noel at college.harvard.edu> 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
> Libav-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/libav-user
> To unsubscribe, visit link above, or email
> libav-user-request at ffmpeg.org with subject "unsubscribe".
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20191210/a88dbbd5/attachment.html>

More information about the Libav-user mailing list