Closed ChinaChenMingQuan closed 3 years ago
hi there @ChinaChenMingQuan this might not be related directly with ffmpeg/libav, but by using avio + c async io, isnt?
But if that's not the case, I found this seek async piece of code, it might help you.
@leandromoreira, I need asynchronous IO like the C# language.
Example:
Pseudocode: await fread_async(buffer, 1, count, handle_stream); await av_read_frame_async(pFormatContext, pPacket);
C Code: fread_async(buffer, 1, count, handle_stream, callback_on_completion); av_read_frame_async(pFormatContext, pPacket, callback_on_completion);
C++ Code: co_await fread_async(buffer, 1, count, handle_stream); co_await av_read_frame_async(pFormatContext, pPacket);
I want to call the FFmpeg API, Don't want to change the FFmpeg code. I don't like the GPL.
But FFmpeg API avio_alloc_context does not support asynchronous IO. It's so hard to find a modern codec library.
@leandromoreira, FFmpeg has no asynchronous IO. Server needs asynchronous IO to wait for client code. Cannot host a client in one thread.
@leandromoreira, Only multiple processes can be selected to solve. If you have a method, I hope you can give an example.
Note: It is asynchronous IO, not synchronous IO.