[FFmpeg-devel] ffmpeg & static & state

Michael Niedermayer michaelni
Mon Oct 8 17:08:30 CEST 2007


Hi

On Mon, Oct 08, 2007 at 05:47:29PM +0300, Denis Otchenashko wrote:
> Hi everybody
> 
> We have a problem on repeatitive  video encodings within one process.
> First encoding passes OK but all the next fails because of incorrect state
> inside ffmpeg library.
> 
> Details.
> We are working on video recognition system and it is necessary to have some
> kind of decoding/encoding library inside our engine.
> It shall work without interrupting and exiting a process after each video.
> So it needs to decode/encode batch of files/streams without exiting a
> process in one endless cycle.
> 
> We have taken ffmpeg.c code as a base and substituted a main function body
> with facade.
> The difference between main function and this facade is the last one
> processes a number of "command lines"
> The first command line is succesfully processed, but the next one is not.
> 
> After reviewing ffmpeg code we noticed a lot of static variables which
> accumulates state between functions' calls.
> These statics are present in codecs and others parts. It works for the first
> iteration, but the state accumulated in the
>  first decoding/encoding iteration  does not  allow  to  make  the
> second/next iteration properly.
> 
> We need to work out this problem in clean way.

if you dont want to call the ffmpeg executable then you should use libavcodec
and libavformat directly. ffmpeg.c is not designed to be used like you do

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I have often repented speaking, but never of holding my tongue.
-- Xenocrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071008/6628c5c6/attachment.pgp>



More information about the ffmpeg-devel mailing list