/** * @brief get a frame at a certain time * @return an image, null of error */ DefaultImageT VideoPlayer::getFrame( const double nFrame ) { try { std::unique_lock<std::mutex> lock( _mutexPlayer ); _currentPosition = nFrame;
_graph->compute( _outputCache, *_nodeFinal, tuttle::host::ComputeOptions( nFrame ) );
DefaultImageT img = cache().get( _nodeFinal->getName(), nFrame );
/// @{ Just for the proof of bug: the image are sometimes the sames.
typedef boost::gil::rgb8_image_t SourceImageT; const SourceImageT::view_t originalFrameView = img->getGilView<SourceImageT::view_t>(); boost::gil::jpeg_write_view( std::string( "/Users/djarwood/image_" ) + std::to_string( nFrame ) + ".jpeg" , originalFrameView ); /// @}
_outputCache.clearUnused(); return img; } catch( ... ) { TUTTLE_LOG_CURRENT_EXCEPTION; return DefaultImageT(); } }
OK, thank you very much, please tell me if you need help / tests
This looks like the exact problem! I will think about this interesting feature.
Many thanks for your investigation,
Kind regards
Eloi