ffmpeg impasse

Steven Robbins steve at sumost.ca
Thu Oct 27 06:09:00 BST 2022


After staring at ffmpeg docs and digikam/qtav code for a couple days: it seems 
to me the qtav  code is fundamentally mismatched for decoding.

As far as I can work out, the ffmpeg model is that a single packet from the 
demuxer may generate an arbitrary number of frames.  In contrast, qtav assumes 
that a packet may generate only a single frame.

On the ffmpeg side, example code [1] shows the avcodec_receive_frame() loop 
after sending the packet to the codec.

[1] https://ffmpeg.org/doxygen/5.1/filtering_audio_8c-example.html

On the qtav side, the AudioDecoderFFmpeg::decode() function [2] has a single 
avcodec_receive_frame() following the avcodec_send_packet().

[2] https://invent.kde.org/graphics/digikam/-/blob/master/core/libs/video/

Have I overlooked something in this analysis?  The qtav code uses layers 
exuberantly so I may well have gotten confused. 

If the analysis is correct: I don't see a simple path forward.  I think it 
will need rewriting the AVDecoder class hierarchy -- because that is where 
decode() is declared.

Also of note: as far as I can work out, this code has always been wrong, even 
for ffmpeg version 4.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/digikam-devel/attachments/20221027/36c5989b/attachment.sig>

More information about the Digikam-devel mailing list