[Libav-user] Measure sent bytes to network

Gyula Hatalyák hatalyak.gyula at artklikk.hu
Wed Dec 4 17:16:50 CET 2013


As I know every format has its own packet write function. Thus rtmp format
has its own.
It might be synchronous (blocking) or asynchronous (non-blocking).
I assume a network format has an internal buffer as a FIFO queue to store
packets and then send them to network as network capacity / bandwidth
allows. I assume RTMP format has a non-blocking write function.
Please agree or disagree if you know something certain about this.
What I want to know whether this buffer is going to overflow or is in
balance. Read-write flow must be balanced otherwise buffer will overflow.


On Wed, Dec 4, 2013 at 7:16 AM, Taha Ansari <mtaha.ansari at gmail.com> wrote:

>
>
>
> 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
>>
>>
>
> _______________________________________________
> 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/7530784a/attachment.html>


More information about the Libav-user mailing list