[Libav-user] Measure sent bytes to network

Taha Ansari mtaha.ansari at gmail.com
Wed Dec 4 07:16:24 CET 2013


On Tue, Dec 3, 2013 at 11:05 PM, Gyula Hatalyák
<hatalyak.gyula at artklikk.hu>wrote:

> Thanks for your reply, but this is not what I am looking for.
> Since I am streaming out to network, I want to know whether I overload
> (e.g. exceed) the network bandwith limit.
>

Since in your original post, you mention:

"I am streaming out in flv (rtmp) format to a remote host."

RTMP uses TCP protocol, so transmission is guaranteed; so if library says
bytes were written, we may assume they are. link:
http://en.wikipedia.org/wiki/Real_Time_Messaging_Protocol


> So it would be useful to see/check how many packets/data have been
> succesfully written to the network.
> Should I examine the AVIOContext's buffer and related fields? I started to
> do this, but it is not that straightforward.
> Any extra hints? :)
>

In case you want to implement more robust application for detecting packets
transmission, you might try to use libpcap/winpcap library, which is
designed for such kind of purposes. link:
http://en.wikipedia.org/wiki/Winpcap


> Thanks in advance,
> Gyula
>
>
> On Tue, Dec 3, 2013 at 6:30 AM, Taha Ansari <mtaha.ansari at gmail.com>wrote:
>
>> When you call av_interleaved_write_frame(oc, &pkt), pkt.size contains the
>> number of bytes sent/written, you can use/accumulate this on your end for a
>> quicker implementation...
>>
>>
>> On Mon, Dec 2, 2013 at 9:29 PM, Gyula Hatalyák <
>> hatalyak.gyula at artklikk.hu> wrote:
>>
>>> Hi!
>>>
>>> How do I measure sent bytes to network by avformat?
>>> I am streaming out in flv (rtmp) format to a remote host.
>>> I use av_interleaved_write_frame to write packets to flv format.
>>> As I know av_interleaved_write_frame returns immediately.
>>> So I don't know how much data have been actually sent to network by the
>>> underlying levels in avformat.
>>> Any best practice?
>>>
>>> Thanks in advance,
>>> Gyula
>>>
>>> _______________________________________________
>>> Libav-user mailing list
>>> Libav-user at ffmpeg.org
>>> http://ffmpeg.org/mailman/listinfo/libav-user
>>>
>>>
>>
>> _______________________________________________
>> Libav-user mailing list
>> Libav-user at ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/libav-user
>>
>>
>
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20131204/a709dc87/attachment.html>


More information about the Libav-user mailing list