Hello All:

Just recently I have been testing ffmpeg library (Not OSG's ffmpeg plugin) use within some tools we are doing. Over the past couple of days we have been hammering video in a multi threaded environment and it has come to our attention that ffmpeg is not thread safe. I have not locked down where in ffmpeg it uses global structures besides the registerall calls. In our code we had to do a shared mutex lock on all calls to the ffmpeg library. So for instance a call to avcodec_open could fail if you are doing a code decode at the same time.

Example:

When we were grabbing a frame from one file and opening another file the open could fail which gave strong indication of shared global data within ffmpeg. After lock down with a comon critical section mutex we were able to use the ffmpeg in a multi threaded environment.


I wanted to pass this along because I have seen the ffmpeg plugin added to OSG.


If anyone knows the exact API calls or found docs specifying the exact calls in ffmpeg library that is not thread safe please pass it along. For now, I have just wrapped all calls as critical and everything works robustly in a multi threaded environment.


Take care

Garrett

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to