[Ffmpeg-devel] Wrapper

Michel Bardiaux mbardiaux
Mon Jan 8 10:47:19 CET 2007


Ignazio Castrogiovanni wrote:
> I'm trying to make a library, a sort of facade that wrap all the ffmpeg, in
> special way the file ffmpeg.c.
> I need it to include in a plugin of an application. In this way I have to
> pass only some parameter to the
> method of the wrapper library to obtain what I want... for example a video
> segment.
> I can make a lot of working methods but they only works if I use one time.
> If i call two method in a test main()
> I get a segment fault error.
> I know that ffmpeg.c was designed to start only once... (At the end of the
> main it exit.. I had to remove it). So what I have to do if I want to call
> many times functions of the ffmpeg.c with different parameters?

Instead of linking 'normally' to your ffmpeg.o, make a shared lib 
ffmpeg.so, and dlopen it, locate 'first' with dlsym, call it, dlclose. 
Then do all of that again.

> 
> P.S. I have renamed the main() of ffmpeg first(int argc, int argv**) and I
> pass the parameters to that function from my plugin. For example
>       a function of the plugin should be able to extract a segment from a
> video and then to extract each keyframe from it.
>       I can pass the parameters to the function first(.... )for each of the
> two functionality and all works perfectly if I do it separately.
>       But when I do:
>       extract_video_segment(... . .. . .);
>       extract_keyframe_from_video_segment(... ... ... )
>       I get the segment fault
>       What can I do?
> Thanks in advance


-- 
Michel Bardiaux
R&D Director
T +32 [0] 2 790 29 41
F +32 [0] 2 790 29 02
E mailto:mbardiaux at mediaxim.be

Mediaxim NV/SA
Vorstlaan 191 Boulevard du Souverain
Brussel 1160 Bruxelles
http://www.mediaxim.com/




More information about the ffmpeg-devel mailing list