Strange behavior with cache

4 views
Skip to first unread message

Eloi Du Bois

unread,
Jul 14, 2015, 5:56:19 PM7/14/15
to tuttle...@googlegroups.com
Hi,

I just updated my tuttle version and I get a strange behavior: the frames I get from the cache doesn't seems to be the right ones.

Does this code looks wrong to you?

_graph->compute( _outputCache, *_nodeFinal, tuttle::host::ComputeOptions( nFrame ) );
img = _outputCache.get( _nodeFinal->getName(), nFrame );

Many thanks,
Eloi.

Eloi Du Bois

unread,
Jul 15, 2015, 7:32:57 AM7/15/15
to tuttle...@googlegroups.com
Hi again,

I did some tests and I confirm that there is a problem with the cache. This bug is critical for me.
Here is my graph:
input - > JpegReader on a sequence of 9 frames -> jpeg2000 writer -> component (to RGB) -> bitdepth (to 8bits) -> output

What I see is that the output jpeg2000 frames are correct, but the ones in the cache aren't.

Here is the getFrame function:
/**
 * @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(); } }

Please note that:
I am using the last checkout of tuttle (develop branch).
I am using boost-1.58

Kind regards,
Eloi.

Clément Champetier

unread,
Jul 16, 2015, 5:13:19 AM7/16/15
to tuttle...@googlegroups.com, eloi.d...@gmail.com, eloi.d...@gmail.com
Hi Eloi,

Your code looks good.
I understand your problem, and I will test Graph::compute method with a custom cache. I will come back to you with more explanations (and maybe a fix) at the beginning of next week.

Regards,
Clement

Eloi Du Bois

unread,
Jul 16, 2015, 5:17:35 AM7/16/15
to Clément Champetier, tuttle...@googlegroups.com

OK, thank you very much, please tell me if you need help / tests

Clément Champetier

unread,
Jul 27, 2015, 12:11:40 PM7/27/15
to tuttleofx-dev, eloi.d...@gmail.com, eloi.d...@gmail.com
Hello,

I think your problem is related to one of our recent update, which concerns the default behavior of writer nodes.
Since few commits in develop branch (see PR https://github.com/tuttleofx/TuttleOFX/pull/427), there is a new parameters 'copyToOutput' for all writers. If activated, it copies the input to the output clip of the node. Before that, this feature was enable by default. If you want to do some other process after the write, you need to add this parameter (copyToOutput=True).

Hope this help.

Regards,
Clement

Eloi Du Bois

unread,
Jul 27, 2015, 12:20:10 PM7/27/15
to Clément Champetier, tuttleofx-dev

This looks like the exact problem! I will think about this interesting feature.

Many thanks for your investigation,
Kind regards
Eloi

Reply all
Reply to author
Forward
0 new messages