<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><p style="margin: 0px 0px 1em; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(34, 36, 38); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 19.5px; widows: 1; background-color: rgb(255, 255, 255);" class="">Greetings,</p><p style="margin: 0px 0px 1em; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(34, 36, 38); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 19.5px; widows: 1; background-color: rgb(255, 255, 255);" class="">I am using libFFmpeg to mux h264 and aac packets into an flv container and streaming that via rtmp.</p><p style="margin: 0px 0px 1em; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(34, 36, 38); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 19.5px; widows: 1; background-color: rgb(255, 255, 255);" class="">I want to be able to detect when frames are being sent to the server or the size of the internal buffer, in order to detect the network lag and apply variable bit-rate. However, when I clock the time it takes for <code style="margin: 0px; padding: 1px 5px; border: 0px; font-size: 13px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: pre-wrap; background-color: rgb(238, 238, 238);" class="">av_write_frame</code>, it is much too fast for it to be syncronous (so we can't use this to detect network speed).</p><p style="margin: 0px 0px 1em; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(34, 36, 38); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 19.5px; widows: 1; background-color: rgb(255, 255, 255);" class="">I already tried calling <code style="margin: 0px; padding: 1px 5px; border: 0px; font-size: 13px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: pre-wrap; background-color: rgb(238, 238, 238);" class="">av_write_frame</code> with a null parameter (to flush data) every frame, and also directly calling <code style="margin: 0px; padding: 1px 5px; border: 0px; font-size: 13px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: pre-wrap; background-color: rgb(238, 238, 238);" class="">avio_flush</code> but the bitrate is still too high. So, I am wondering if there is another buffer that I am missing (such as a socket-level buffer).</p><p style="margin: 0px 0px 1em; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(34, 36, 38); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 19.5px; widows: 1; background-color: rgb(255, 255, 255);" class="">I also tried to print the AVIOContext->buf_end, buffer_size, and buf_ptr values but none of those are indicative of my network speed getting throttled (when I limit the bandwidth on my router, I would expect the buffer size to increase).</p><p style="margin: 0px 0px 1em; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(34, 36, 38); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 19.5px; widows: 1; background-color: rgb(255, 255, 255);" class=""><strong style="margin: 0px; padding: 0px; border: 0px;" class="">tl;dr</strong> - I would like to know how to properly detect packets being sent to the server, or the network speed lagging compared to my av_write_frame calls.</p><p style="margin: 0px 0px 1em; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(34, 36, 38); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 19.5px; widows: 1; background-color: rgb(255, 255, 255);" class="">If it makes a difference, this is being run on an arm-v7a Android device.</p><div class=""><br class=""></div><div class="">Thanks!</div><div class="">Rohit</div></body></html>