<HTML><BODY>Hi everybody!<br>Here's the part of c++ code that I'm using to access my webcam.<br><br>**********************************************************************<br>**********************************************************************<br><pre><code>int Camera::Init(char* file_name,
char* device_name,
char* format,
char* resolution,
char* frame_rate,
char* pixel_format)
{
av_log(NULL, AV_LOG_INFO, "---INIT STARTED---\n");
avdevice_register_all();
av_register_all();
AVDictionary* properties_collection = NULL;
av_dict_set(&properties_collection, "f", format, NULL);
av_dict_set(&properties_collection, "video_size", resolution, NULL);
av_dict_set(&properties_collection, "framerate", frame_rate, NULL);
av_dict_set(&properties_collection, "pix_fmt", pixel_format, NULL);
AVInputFormat *input_format = av_find_input_format("dshow");
char command_line[256];
sprintf(command_line, "video=%s", device_name);
AVFormatContext *input_context = avformat_alloc_context();
//input_context->flags |= AVFMT_FLAG_NOBUFFER; //DOESN'T HELP
//input_context->max_picture_buffer = 0; //ERR
int err_code = 0;
err_code = avformat_open_input(&input_context,
command_line,
input_format,
&properties_collection);<br><br><code>////////////////////////////////////// </code><br>//////////PROBLEM SECTION/////////////
<code>////////////////////////////////////// </code><br> int i = 0;
while (i++ < 30)
{
Sleep(1000);
//avformat_flush(input_context); //DOESN'T HELP
//av_free(input_context); //ERR
}<br><code>////////////////////////////////////// </code><br> system("pause");
return 0;
}</code></pre>**********************************************************************<br>**********************************************************************<br><br>Right after "<strong>avformat_open_input()</strong>" it starts reading frames to some internal buffer without me even calling "<strong>av_read_frame()</strong>". After about 10 seconds it start's giving me error messages:<br><br><pre><em><code>[dshow @ 0014ed40] real-time buffer [VirtualBox Webcam - FULL HD 1080P Webcam] [video input]
too full or near too full (62% of size: 3041280 [rtbufsize parameter])!
frame dropped!
...
...
...
[dshow @ 0014ed40] real-time buffer [VirtualBox Webcam - FULL HD 1080P Webcam] [video input]
too full or near too full (100% of size: 3041280 [rtbufsize parameter])!
</code><code>frame dropped!</code><code><br></code><code></code><code><br><br></code></em></pre><p><strong>Q: How to clear this buffer or avoid using it?</strong></p><p>Thanks in advance.</p><p><br><br>P.S.Please pardon my english.</p><p>P.P.S.Have a good day.</p><br></BODY></HTML>