[Libav-user] Decoding H264 frames on Windows

Alex Grosu agrosu at c-s.ro
Mon Oct 3 14:55:52 EEST 2016

Hi Carl

I built libavcodec some time ago on Windows and I am calling the API 
functions from my C app. (avcodec_find_decoder, avcodec_open, 
avcodec_decode_video2, sws_scale). Now, having big frames with a lot of 
details, the time decoding increased > 55 ms, which is greater than the 
time a frame should be displayed (40 ms). I have to do some threading 
logic programatically, using libavcodec, not from command line. Or maybe 
I am not fully understanding your hint

Thank you


On 10/3/2016 2:45 PM, Carl Eugen Hoyos wrote:
> 2016-10-03 12:52 GMT+02:00 Alex Grosu <agrosu at c-s.ro>:
>> I am having some issues with time decoding H.264 frames with libavcodec. I
>> am receiving 1920x1080 frames at 25 FPS, thus a frame should be displayed
>> each 40 ms. But the decoding time per frame is between 55 ms and 83 ms, way
>> too much.
>> I am thinking at the following strategy: create 4 threads, each thread will
>> decode a I-Frame slice (composed by SPS and PPS and IDR + all NACs until the
>> next SPS&PPS&IDR). In theory, this should work on a >4CPUs processor.
>> My question is: is there any other way in handling this kind of situation?
> FFmpeg already contains a multi-threaded H.264 decoder: While it scales badly
> I don't expect a wrapper implementation to work much better.
> (Unless you really have full control over gop size, in this case you know
> something that the FFmpeg decoder cannot know.)
> Carl Eugen
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user

More information about the Libav-user mailing list