Bug 333348 - Audio track is zero length in Advanced Slideshow
Summary: Audio track is zero length in Advanced Slideshow
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-Generic-Presentation (show other bugs)
Version: 8.0.0
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: caulier.gilles
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-12 08:07 UTC by Neale
Modified: 2023-01-08 06:19 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 8.0.0
Sentry Crash Report:


Attachments
screenshot of zero length soundtrack (106.57 KB, application/xml)
2014-04-12 08:14 UTC, Neale
Details
digiKam 8.0.0 presentation tool Sountrack page with MP3 files in list (Linux version) (424.68 KB, image/png)
2022-12-27 10:16 UTC, caulier.gilles
Details
The presensation tool in 7.9.0 work as expected (here MacOS version) (1.09 MB, image/png)
2022-12-27 10:20 UTC, caulier.gilles
Details
Another MP3 album which work this time. (360.50 KB, image/png)
2022-12-27 16:46 UTC, caulier.gilles
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Neale 2014-04-12 08:07:51 UTC
I have created a slideshow with 900+ pictures, and have added 15 sound files so far.  The application (advanced slideshow) is telling me that the sound files have zero length.  "Slide time is greater than soundtrack time".  I have tried adding audio files of different formats, e.g. mp3, wma, and cda, and get the same message.  When I click the preview button on a sound file, it comes up as zero length as well.

Reproducible: Always

Steps to Reproduce:
1.  Open slideshow / advanced slideshow / soundtrack
2.  open Windows Explorer, music, then click and drag tunes into the soundtrack window
3.
Actual Results:  
get the message that the soundtrack is zero length

Expected Results:  
each file/tune added should increase the duration of the soundtrack until I have enough music to match or exceed the duration of the slideshow.  I should also be able to preview the tunes in this window.
Comment 1 Neale 2014-04-12 08:14:57 UTC
Created attachment 86055 [details]
screenshot of zero length soundtrack
Comment 2 caulier.gilles 2015-05-18 12:19:03 UTC
Neale,

This file still valid using last kipi-plugins 4.10.0 ?

Gilles Caulier
Comment 3 caulier.gilles 2015-07-06 07:35:22 UTC
digiKam 4.11.0 Windows installer is available for download :

http://download.kde.org/stable/digikam/digiKam-installer-4.11.0-win32.exe.mirrorlist
Comment 4 caulier.gilles 2015-08-13 08:10:27 UTC
digiKam 4.12.0 is out.

https://www.digikam.org/node/741

Problem still reproducible ?

Gilles Caulier
Comment 5 Neale 2015-08-18 05:31:14 UTC
sorry, the response took too long, so I have moved on to other products.  If I find any spare time, I may try again.
Comment 6 caulier.gilles 2015-12-20 17:38:28 UTC

*** This bug has been marked as a duplicate of bug 356939 ***
Comment 7 caulier.gilles 2016-12-22 17:03:15 UTC
digiKam 5.4.0 bundles will use QtAV framework instead Qt5Multimedia to thumb
and play video/audio. The Slideshow tool will also support video as well.

QtAV use ffmpeg codecs. It's multi-platform and will always available in
OSX, Windows and Linux bundles that digiKam team provide.

For Linux packagers, you will need to turn on video support at compilation time
and solve QtAV dependencies...

See screenshots here :

https://www.flickr.com/photos/digikam/30886133553
https://www.flickr.com/photos/digikam/31679362466
https://www.flickr.com/photos/digikam/31572654722
https://www.flickr.com/photos/digikam/31726086736

Bundles have been recompiled are posted to GDrive for testing :

https://drive.google.com/drive/folders/0BzeiVr-byqt5Y0tIRWVWelRJenM
Comment 8 caulier.gilles 2022-12-27 10:13:25 UTC
Maik,

With 8.0.0, this bug is reproducible. I tried to append mp3 or wav files in the list and soundtrack still a null lenght. 

I don't yet check with qt5-maintenance branch.

Gilles
Comment 9 caulier.gilles 2022-12-27 10:16:01 UTC
Created attachment 154841 [details]
digiKam 8.0.0 presentation tool Sountrack page with MP3 files in list (Linux version)
Comment 10 caulier.gilles 2022-12-27 10:20:46 UTC
Created attachment 154842 [details]
The presensation tool in 7.9.0 work as expected (here MacOS version)
Comment 11 Maik Qualmann 2022-12-27 11:06:30 UTC
Hi Gilles,

I can't reproduce, the playing time adds up to the added title lengths. Are you using FFmpeg5?

Maik
Comment 12 Maik Qualmann 2022-12-27 11:28:47 UTC
Git commit 28efe0b17c62341dd767cd84925fb717b19312be by Maik Qualmann.
Committed on 27/12/2022 at 11:28.
Pushed by mqualmann into branch 'master'.

this should fix it to always show play time

M  +12   -7    core/dplugins/generic/view/presentation/audio/presentationaudiolist.cpp
M  +1    -0    core/dplugins/generic/view/presentation/audio/presentationaudiolist.h

https://invent.kde.org/graphics/digikam/commit/28efe0b17c62341dd767cd84925fb717b19312be
Comment 13 caulier.gilles 2022-12-27 11:30:25 UTC
No ffmpeg 4:

gilles@U22:~/Devel/DK.doc/menu_descriptions$ ffmpeg --version
ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.2.0-19ubuntu1)

Gilles
Comment 14 caulier.gilles 2022-12-27 14:00:40 UTC
Maik,

It's not better. Look the messages from the console :

digikam.qtav: avformat_open_input: url:'/home/gilles/Music/Tord Gustavsen - Changing Places (2003)/13 - Song Of Yearning (Solo).mp3' ret:0
digikam.qtav: avfmtctx.flags: 2097153 iformat.flags 256
digikam.qtav.warn: invalid index 0 ( valid is 0 ~ 0 ) for stream type 2
digikam.qtav: notify_interval: 500
digikam.qtav: stream: 0 duration= 3922698240 ( 277968 ms), time_base= 7.08617e-08
digikam.qtav: codec: mp3(MP3 (MPEG audio layer 3))
digikam.qtav: stream: 1 duration= 25017208 ( 277968 ms), time_base= 1.11111e-05
digikam.qtav: codec: mjpeg(Motion JPEG)
digikam.qtav: 90000/1
digikam.qtav: avfmtctx.flags: 2097153 iformat.flags 256
digikam.qtav.warn: invalid index 0 ( valid is 0 ~ 0 ) for stream type 2
digikam.qtav: notify_interval: 500
digikam.qtav: stream: 0 duration= 1684684800 ( 119379 ms), time_base= 7.08617e-08
digikam.qtav: codec: mp3(MP3 (MPEG audio layer 3))
digikam.qtav: stream: 1 duration= 10744163 ( 119379 ms), time_base= 1.11111e-05
digikam.qtav: codec: mjpeg(Motion JPEG)
digikam.qtav: 90000/1
digikam.qtav: avformat_open_input: url:'/home/gilles/Music/Tord Gustavsen - Changing Places (2003)/11 - Your Eyes.mp3' ret:0
digikam.qtav: avfmtctx.flags: 2097153 iformat.flags 256
digikam.qtav.warn: invalid index 0 ( valid is 0 ~ 0 ) for stream type 2
digikam.qtav: notify_interval: 500
digikam.qtav: stream: 0 duration= 4424048640 ( 313495 ms), time_base= 7.08617e-08
digikam.qtav: codec: mp3(MP3 (MPEG audio layer 3))
digikam.qtav: stream: 1 duration= 28214596 ( 313495 ms), time_base= 1.11111e-05
digikam.qtav: codec: mjpeg(Motion JPEG)
digikam.qtav: 90000/1

There are warnings about invalid index...

Did you see these messages ?

Gilles
Comment 15 Maik Qualmann 2022-12-27 14:08:44 UTC
Gilles, the index is reported to me as well. However, 2 streams with different lengths are found in your MP3 files, plus Motion JPEG.
Please send me a file.

Maik
Comment 16 caulier.gilles 2022-12-27 16:41:24 UTC
Maik,

MP3 album is now shared with you through GDrive.

Gilles
Comment 17 caulier.gilles 2022-12-27 16:46:26 UTC
Created attachment 154849 [details]
Another MP3 album which work this time.

Maik,

You are right, the problem come from the MP3 track. Another MP3 album give the right length under Linux and version 8.0.0

Gilles
Comment 18 Maik Qualmann 2022-12-27 17:04:51 UTC
I don't have any problems with your audio files either, the playing time is displayed. When you open the audio file in the media player, is a running time displayed?

As an alternative, we could also use the ExifToolParser here, we would get all the information, artist, title, duration...

However, I know from a bug report from ExifTool that the duration is only calculated and can be wrong.

Maik
Comment 19 caulier.gilles 2022-12-27 17:16:53 UTC
The Presentation Soundtrack preview do not work at all. There are plenty of error messages on the console about the video stream, not the audio stream.

digikam.qtav: Loading  QVariant(QString, "/home/gilles/Music/Tord Gustavsen - Changing Places (2003)/12 - Graceful Touch, Variation.mp3") ...
digikam.qtav: all closed and reseted
digikam.qtav: avformat_open_input: d->format_ctx:'0x7f7e480abe00', url:'/home/gilles/Music/Tord Gustavsen - Changing Places (2003)/12 - Graceful Touch, Variation.mp3'...
digikam.qtav: avformat_open_input: url:'/home/gilles/Music/Tord Gustavsen - Changing Places (2003)/12 - Graceful Touch, Variation.mp3' ret:0
digikam.qtav: avfmtctx.flags: 2097153 iformat.flags 256
digikam.qtav.warn: invalid index 0 ( valid is 0 ~ 0 ) for stream type 2
digikam.qtav: notify_interval: 500
digikam.qtav: stream: 0 duration= 3922698240 ( 277968 ms), time_base= 7.08617e-08
digikam.qtav: codec: mp3(MP3 (MPEG audio layer 3))
digikam.qtav: stream: 1 duration= 25017208 ( 277968 ms), time_base= 1.11111e-05
digikam.qtav: codec: mjpeg(Motion JPEG)
digikam.qtav: 90000/1
digikam.qtav: has audio
digikam.qtav: QtAV::AudioDecoderFFmpeg thread type: Single, count: 1
digikam.qtav: AudioOutput format:  QtAV::AudioFormat(0Hz, 0Bytes, channelCount:0, channelLayout: "0 channels", sampleFormat: "") ; requested:  QtAV::AudioFormat(44100Hz, 4Bytes, channelCount:2, channelLayout: "stereo", sampleFormat: "fltp")
digikam.qtav: Trying video decoder: FFmpeg
digikam.qtav: QtAV::VideoDecoderFFmpeg thread type: Single, count: 1
digikam.qtav: Video decoder found: 0x55ba6fb622e0
digikam.qtav: stream: 1 duration= 25017208 ( 277968 ms), time_base= 1.11111e-05
digikam.qtav: codec: mjpeg(Motion JPEG)
digikam.qtav: 90000/1
digikam.qtav: Clock initial value: 0.025000
digikam.qtav: Starting video thread...
digikam.qtav: get av queue a/v thread = 0x0 0x55ba74b61a60
digikam.qtav: AVClock started...
digikam.qtav: End of file. erreof=1 feof=1
digikam.qtav: video thread gets an eof packet.
digikam.qtav.warn: no frame could be decompressed: Success 3 / 3
digikam.qtav: video decode eof done. d.render_pts0: -1.000
digikam.qtav: Invalid packet! flush video codec context!!!!!!!!!! video packet queue size: 0
digikam.qtav: Invalid packet! flush video codec context!!!!!!!!!! video packet queue size: 0
digikam.qtav: Invalid packet! flush video codec context!!!!!!!!!! video packet queue size: 0
digikam.qtav: Invalid packet! flush video codec context!!!!!!!!!! video packet queue size: 0
digikam.qtav: Invalid packet! flush video codec context!!!!!!!!!! video packet queue size: 0
digikam.qtav: Invalid packet! flush video codec context!!!!!!!!!! video packet queue size: 0
digikam.qtav: Invalid packet! flush video codec context!!!!!!!!!! video packet queue size: 0
digikam.qtav: Invalid packet! flush video codec context!!!!!!!!!! video packet queue size: 0
...

Gilles
Comment 20 caulier.gilles 2022-12-27 17:19:34 UTC
VLC can play audio track without problem.

AVPlayer cannot.

Gilles
Comment 21 Maik Qualmann 2022-12-27 17:25:41 UTC
No problem here with the soundtrack preview, my log:

digikam.dplugin.generic: Tracks :  (QUrl("file:///home/maik/Musik/Tord Gustavsen - Changing Places (2003)/02 - Graceful Touch.mp3"))
digikam.qtav: Registered audio backends:  ("OpenAL", "PortAudio", "Pulse", "null")
digikam.qtav: QVector("Internes Audio Analog Stereo", "Oland/Hainan/Cape Verde/Pitcairn HDMI Audio [Radeon HD 7000 Series] Digital Stereo (HDMI)")
digikam.qtav: OpenAL opening default device: OpenAL Soft
digikam.qtav: AudioOutputOpenAL creating context...
digikam.dplugin.generic: Tracks :  (QUrl("file:///home/maik/Musik/Tord Gustavsen - Changing Places (2003)/02 - Graceful Touch.mp3"))
digikam.qtav: Loading  QVariant(QString, "/home/maik/Musik/Tord Gustavsen - Changing Places (2003)/02 - Graceful Touch.mp3") ...
digikam.qtav: all closed and reseted
digikam.qtav: avformat_open_input: d->format_ctx:'0x7f4710047440', url:'/home/maik/Musik/Tord Gustavsen - Changing Places (2003)/02 - Graceful Touch.mp3'...
digikam.qtav: avformat_open_input: url:'/home/maik/Musik/Tord Gustavsen - Changing Places (2003)/02 - Graceful Touch.mp3' ret:0
digikam.qtav: avfmtctx.flags: 2097153 iformat.flags 256
digikam.qtav.warn: invalid index 0 ( valid is 0 ~ 0 ) for stream type 2
digikam.qtav: notify_interval: 500
digikam.qtav: stream: 0 duration= 3308175360 ( 234422 ms), time_base= 7.08617e-08
digikam.qtav: codec: mp3(MP3 (MPEG audio layer 3))
digikam.qtav: stream: 1 duration= 21098057 ( 234422 ms), time_base= 1.11111e-05
digikam.qtav: codec: mjpeg(Motion JPEG)
digikam.qtav: 90000/1
digikam.qtav: has audio
digikam.qtav: QtAV::AudioDecoderFFmpeg thread type: Single, count: 1
digikam.qtav: OpenAL audio format: 0x10011 ch:2, sample format: flt
digikam.qtav: alcDestroyContext(0x25e7340)
digikam.qtav: alcCloseDevice(0xdba55e0)
digikam.qtav: AudioOutput format:  QtAV::AudioFormat(44100Hz, 4Bytes, channelCount:2, channelLayout: "stereo", sampleFormat: "flt") ; requested:  QtAV::AudioFormat(44100Hz, 4Bytes, channelCount:2, channelLayout: "stereo", sampleFormat: "fltp")
digikam.qtav: OpenAL opening default device: OpenAL Soft
digikam.qtav: AudioOutputOpenAL creating context...
digikam.qtav: OpenAL 1.1 ALSOFT 1.22.2 vendor: OpenAL Community; renderer: OpenAL Soft
digikam.qtav: device: 0xdba55e0, context: 0x25e7340
digikam.qtav: OpenAL audio format: 0x10011 ch:2, sample format: flt
digikam.qtav: AudioOutputOpenAL open ok...
digikam.qtav: AudioOutputOpenAL: !AL_PLAYING alSourcePlay
digikam.qtav.warn: src audio parameters 'channel layout(or channels),sample rate and sample format must be set before initialize resampler
digikam.qtav: new audio thread
digikam.qtav: demux thread setAudioThread
digikam.qtav: output not changed: 0x193e980
digikam.qtav: set AVThread output
digikam.qtav: stream: 0 duration= 3308175360 ( 234422 ms), time_base= 7.08617e-08
digikam.qtav: codec: mp3(MP3 (MPEG audio layer 3))
digikam.qtav: Trying video decoder: FFmpeg
digikam.qtav: QtAV::VideoDecoderFFmpeg thread type: Single, count: 1
digikam.qtav: Video decoder found: 0xd824750
digikam.qtav: setCapture 0xd7c5d30
digikam.qtav: stream: 1 duration= 21098057 ( 234422 ms), time_base= 1.11111e-05
digikam.qtav: codec: mjpeg(Motion JPEG)
digikam.qtav: 90000/1
digikam.qtav: auto select clock: audio > external
digikam.qtav: Using AudioClock
digikam.qtav: Clock initial value: 0.025000
digikam.qtav: Starting audio thread...
digikam.qtav: Starting video thread...
digikam.qtav: get av queue a/v thread = 0xd84f170 0xd75d860
digikam.qtav: AVClock started...
digikam.qtav: swr speed=1.00
digikam.qtav: out: {cl: 3, fmt: flt, freq: 44100}
digikam.qtav: in {cl: 3, fmt: fltp, freq: 44100}

Is that the FFmpeg version of Ubuntu or compiled yourself?

Maik
Comment 22 Maik Qualmann 2022-12-27 17:56:37 UTC
The video track comes from the embedded album cover image in motion jpeg. It seems your FFmpeg version has a problem with it.

Maik
Comment 23 caulier.gilles 2022-12-27 18:13:26 UTC
No, ffmpeg is installed from the ubuntu repository (here Kubuntu 22.04)

Gilles
Comment 24 Maik Qualmann 2022-12-27 18:30:52 UTC
I don't know how Ubuntu handles copyrighted codecs, maybe not included?

Maik
Comment 25 caulier.gilles 2022-12-27 22:54:32 UTC
ffmpeg 4.4.2 from Ubuntu 22.04 has mp3lame as dependency, so it must not be the problem:

gilles@U22:~/Devel/8.x$ ffmpeg --version
ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.2.0-19ubuntu1)
  configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
Comment 26 caulier.gilles 2023-01-08 06:19:41 UTC
Ok, i tried with digiKam 8.0.0 beta1 AppImage under Ubuntu, and... all work as expected.

This want mean that the problem come from the native ffmpeg 4.4.2 provided by Ubuntu. Even if codec are here, there are probably compiled without full features support. I'm sure, the ffmpeg hosted in the AppImage is compiled with all features.

So this problem is a DOWNSTREAM bug.

Gilles