[Libav-user] how to continue to read growing flv file after first eof?

Zsolt V vtkzsolt at gmail.com
Fri Aug 26 15:37:41 CEST 2011


Hi,

I am new in using libav and cannot find a solution to my problem. We have a
server program that can capture video from webcam and save the stream into
an flv file (on linux). This program was not written by us, we cannot modify
it. My task is to write a program that listens to a target directory, and if
new flv file appears, start processing it immediately. I use libavformat and
libavcodec to read from flv and decode frames.

The problem is that I start reading the flv file before it is finished. When
av_read_frame reaches EOF, it will not continue any more, even if new data
arrive later. This is because av_find_stream_info reads the packets into a
buffer at the beginning (when the flv file is small), and when the end of
this buffer is reached, it is not updated, no new data are added to it. I
did not find the solution how to update the buffer, or how to treat the file
as an endless stream.

The corresponding part of my code is attached.

Thanks for help in advance,
Zsolt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20110826/69fa0f98/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: code.cc
Type: text/x-c++src
Size: 2955 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20110826/69fa0f98/attachment.bin>


More information about the Libav-user mailing list