Re: ffmpeg impasse
Maik Qualmann <[email protected]> Thu, 27 Oct 2022 07:54:51 +0200
| Newsgroups | gmane.comp.kde.digikam.devel |
|---|---|
| Message-ID | <5614960.DvuYhMxLoT@linux-tpgn> |
Qt6 Multimedia has recently added an FFmpeg plugin. Maybe it makes sense to look at the code as it was solved there. https://github.com/qt/qtmultimedia/tree/dev/src/plugins/multimedia/ffmpeg[1] The Qt-AV code has certainly grown over many FFmpeg versions and has only ever been adapted to "working". Maik Am Donnerstag, 27. Oktober 2022, 07:09:00 CEST schrieb Steven Robbins: > Hello, > > 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/ > qtav/codec/audio/AudioDecoderFFmpeg.cpp#L110 > > > 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. > > -Steve -------- [1] https://github.com/qt/qtmultimedia/tree/dev/src/plugins/multimedia/ffmpeg