Thanks for your reply!
Meanwhile I tried to implement pthread attach code to my process and threads as described here:
http://www.cygwin.com/ml/pthreads-win32/2010/msg00010.html
But it had no impact.
Anyway, could that be a problem, that I open the video in the main thread but then call decode in another one created with native windows functions?

Another time I attached pthreads as a shared dll instead of static.
Everything compiles well but the result is still the same.

Would you be so kind and send me your working dlls and libs?
So I can deduce if there is something wrong with my code or if its my ffmpeg compilation.
Does not matter if 32 or 64 bit as I have both versions at hand.
Either by mail or your upload site or or my ftp if you want:

Host: ftp.cppinfo.net
User: f004ec40
Pass: exchange
(write access only)

Thanks,
Ole

Am 25.03.2011 09:21, schrieb Kirill Gavrilov:
Hi,

it seems that nobody signed to this list (especially developers) after developers were divided in two groups (FFmpeg and forked Libav)... I can not see archives of this mail-list while developers' thread is worked well...

    Then somewhere I found a hint to compile with "--enable-pthreads"
    instead of "w32threads".
    So I got myself the pthreads-win32 library source.

I tried to get multithreading decoding to work last days and was confused that it really works only with pthreads flag and doesn't - with w32threads! I had not found any description of this in documentation.

Now I get it worked! I cross-compile FFmpeg too from Linux (because doing that from MSYS is sucks) but I didn't compile pthreads - I get it from external repository as mingw32- and mingw-w64- tools.
Maybe we should share our DLL libraries to check that them built well...

    Now if I leave "codec->thread_count" on 1 it still works (single
    threaded) but if I set it to values > 1 then in case of mp4 or
    xvid videos "avcodec_decode_video2" returns 0 and *got_picture_ptr
    is also 0.

I have no such problems. I replace the old libraries with new ones and code works fine. But I use deprecated avcodec_decode_video() function and I setup multithreading like this:

    int threadsCount = StThread::countLogicalProcessors();
    codecCtx->thread_count = threadsCount;
    avcodec_thread_init(codecCtx, threadsCount);
ST_DEBUG_LOG("FFmpeg: Setup AVcodec to use " + threadsCount + " threads");

    // open VIDEO codec
    if(avcodec_open(codecCtx, codec) < 0) {...

not sure thatavcodec_thread_init() call is needed at all - I read somewhere that it was deprecated now.

    How is multithreaded decoding supposed to work? do I have to
    provide "codec->execute" or "codec->execute2"?

I didn't do something like this...

    Is there some known bug or something?

All I found is a multithreading.txt file. But after experimental multithreading branch was integrated into main repository
I suppose that some new BUGs could be found...

    On which codecs should multithreaded decoding work?

I don't know. But for x264/h264 it works.

-----------------------------------------------
Kirill Gavrilov,
Software designer.


_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to