Bug 462810 - Video preview audio only plays once. Clicking on a different video results in no sound at all until DigiKam is restarted
Summary: Video preview audio only plays once. Clicking on a different video results i...
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Preview-Video (show other bugs)
Version: 8.0.0
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-09 09:05 UTC by Nikki Cooper
Modified: 2024-01-26 12:50 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 8.3.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nikki Cooper 2022-12-09 09:05:08 UTC
SUMMARY
Clicking on a video presents the video as expected along with sound.  However, clicking on a different video results in a video preview with no sound.  The sound cannot be heard again until DigiKam is restarted.   

STEPS TO REPRODUCE
1. Run DigiKam from a fresh start
2. Click on any video (MP4, AVI, ETC.  Type doesn't matter) 
3. Video-preview will present as it should, along with sound.
4. Click on a different video, Video-preview willl play but with no sound.
5.  Sound can only be restored after restarting DigiKam. and then sound will be heard only on the very first video.
 
OBSERVED RESULT
Video always plays correctly the first time, however, any subsequent clicks on a video of any type (MP4, AVI,  ETC) will result in the video-preview playing as expected, except with no sound.  DigiKam must be restarted before sound can be heard again, with the same result as outlined above.    Something is prohibiting sound from working within digiKam after the first video is clicked. 

EXPECTED RESULT
Video-Preview both video and sound should always work when clicking on a video.  

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:  Kbuntu 22.04.1 LTS
Kernel Version: 5.15.0-52-generic(64-bit)
KDE Plasma Version: 5.24.7 
KDE Frameworks Version:  5.98.0
Qt Version:  5.15.3
Graphics platform:  X11

ADDITIONAL INFORMATION
Latest git pull as of 09:00 Dec 9, 2022 UTC
Attempted searching for a preexisting bug related to this, but was unsuccessful.  Please accept my apologies if my search arguments proved to be inadequate.
Comment 1 caulier.gilles 2022-12-09 09:20:44 UTC

*** This bug has been marked as a duplicate of bug 448681 ***
Comment 2 Maik Qualmann 2022-12-09 20:04:51 UTC
Git commit de5e60668d5653c008d7748f40130a14ab77cc72 by Maik Qualmann.
Committed on 09/12/2022 at 20:03.
Pushed by mqualmann into branch 'master'.

try opening audio before playing

M  +1    -0    core/libs/video/player/mediaplayerview.cpp

https://invent.kde.org/graphics/digikam/commit/de5e60668d5653c008d7748f40130a14ab77cc72
Comment 3 Nikki Cooper 2022-12-09 20:35:44 UTC
(In reply to Maik Qualmann from comment #2)

Tried your commit but unfortunately, the problem is still there.  If you need more info or testing, no problem!
Comment 4 Maik Qualmann 2022-12-09 20:44:34 UTC
Well, the problem is not reproducible here on openSUSE or Windows. But since you can compile it yourself, we can try to narrow down the problem. First, we will not close the audio device.

Maik
Comment 5 Maik Qualmann 2022-12-09 20:46:59 UTC
Git commit 68f0580fc6f7603b260a9f2645f30000f98cc340 by Maik Qualmann.
Committed on 09/12/2022 at 20:46.
Pushed by mqualmann into branch 'master'.

try not to close the audio device

M  +4    -4    core/libs/video/player/mediaplayerview.cpp

https://invent.kde.org/graphics/digikam/commit/68f0580fc6f7603b260a9f2645f30000f98cc340
Comment 6 Nikki Cooper 2022-12-09 21:28:17 UTC
(In reply to Maik Qualmann from comment #5)
> Git commit 68f0580fc6f7603b260a9f2645f30000f98cc340 by Maik Qualmann.
> Committed on 09/12/2022 at 20:46.

Here is the program output upon clicking a video for the first time:

digikam.qtav.warn: invalid index 0 ( valid is 0 ~ 0 ) for stream type 2
digikam.qtav.warn: src audio parameters 'channel layout(or channels),sample rate and sample format must be set before initialize resampler
[ DELETED REDUNDANT ERRORS ABOUT  INVALID VIDEO FRAME FROM DECODER ]

Program output upon clicking the second video:

digikam.qtav.warn: Invalid plane! Valid range is [0, 0)
digikam.qtav.warn: Invalid plane! Valid range is [0, 0)
digikam.qtav.warn: Invalid plane! Valid range is [0, 0)
digikam.qtav.warn: Can not copy codec properties when it's open
digikam.qtav.warn: Can not copy codec properties when it's open
digikam.qtav.warn: invalid index 0 ( valid is 0 ~ 0 ) for stream type 2
digikam.qtav.warn: Open portaudio stream error: PortAudio not initialized
[ DELETED REDUNDANT ERRORS ABOUT  INVALID VIDEO FRAME FROM DECODER ]

Of particular notice is the "invalid index for stream type 2"  as well as:  "portaudio stream error: Portaudio not initialized"
Comment 7 Maik Qualmann 2022-12-09 21:38:04 UTC
Git commit 0d191a3d6e79c1ece9727b5a92a2314c2bde841b by Maik Qualmann.
Committed on 09/12/2022 at 21:37.
Pushed by mqualmann into branch 'master'.

set QtAV player configuration only once at the start

M  +12   -5    core/libs/video/player/mediaplayerview.cpp

https://invent.kde.org/graphics/digikam/commit/0d191a3d6e79c1ece9727b5a92a2314c2bde841b
Comment 8 Maik Qualmann 2022-12-10 07:34:56 UTC
Git commit 211ca859f46b637b65883d500ebdb94b036d3ce0 by Maik Qualmann.
Committed on 10/12/2022 at 07:34.
Pushed by mqualmann into branch 'master'.

set new video config only if changed

M  +24   -22   core/libs/video/player/mediaplayerview.cpp
M  +2    -2    core/libs/video/player/mediaplayerview.h
M  +9    -14   core/libs/video/player/slidevideo.cpp
M  +0    -4    core/libs/video/player/slidevideo.h

https://invent.kde.org/graphics/digikam/commit/211ca859f46b637b65883d500ebdb94b036d3ce0
Comment 9 caulier.gilles 2024-01-03 16:19:20 UTC
Git commit 5c0ce6aa787931b22bde21c50c6fa492883ae564 by Gilles Caulier.
Committed on 03/01/2024 at 16:56.
Pushed by cgilles into branch 'master'.

Add ffmpeg CLI binary finder for Video Slideshow.
Prepare to port the plugin to use the FFmpeg CLI tool instead QtAV (Qt6Multimedia cannot be used here).
NOTE: VideoSlideshow plugin is the last part of the Qt6 port of digiKam using QtAV.
Related: bug 472503, bug 425284, bug 427221, bug 139781, bug 448681

M  +1    -1    core/dplugins/generic/tools/videoslideshow/videoslideshowplugin.cpp
M  +1    -0    core/libs/video/CMakeLists.txt
A  +43   -0    core/libs/video/manager/ffmpegbinary.cpp     [License: GPL(v2.0+)]
A  +38   -0    core/libs/video/manager/ffmpegbinary.h     [License: GPL(v2.0+)]

https://invent.kde.org/graphics/digikam/-/commit/5c0ce6aa787931b22bde21c50c6fa492883ae564
Comment 10 caulier.gilles 2024-01-03 17:17:25 UTC
Git commit 420608c891d65372095db103bf8e795ffb289359 by Gilles Caulier.
Committed on 03/01/2024 at 18:16.
Pushed by cgilles into branch 'master'.

restore previous videoslideshow settings including audio track support
Related: bug 472503, bug 425284, bug 427221, bug 139781, bug 448681

M  +173  -10   core/libs/video/manager/qtav/vidslidetask.cpp
M  +1    -1    core/libs/video/manager/qtav/vidslidetask.h
M  +5    -1    core/libs/video/manager/vidslidesettings.cpp
M  +3    -1    core/libs/video/manager/vidslidesettings.h

https://invent.kde.org/graphics/digikam/-/commit/420608c891d65372095db103bf8e795ffb289359
Comment 11 caulier.gilles 2024-01-03 22:34:34 UTC
Git commit 4ff9e0d9fedf3189f62cbd3f0de64657bcc64116 by Gilles Caulier.
Committed on 03/01/2024 at 23:34.
Pushed by cgilles into branch 'master'.

add ffmpeg path tp the settings
Related: bug 472503, bug 425284, bug 427221, bug 139781, bug 448681

M  +1    -0    core/libs/video/manager/vidslidesettings.h

https://invent.kde.org/graphics/digikam/-/commit/4ff9e0d9fedf3189f62cbd3f0de64657bcc64116
Comment 12 caulier.gilles 2024-01-03 22:47:38 UTC
Git commit 982a06b8e1973a8447cac2ab92503f20a3f4fdfc by Gilles Caulier.
Committed on 03/01/2024 at 23:46.
Pushed by cgilles into branch 'master'.

add FFMpeg binary search in the wizard
Related: bug 472503, bug 425284, bug 427221, bug 139781, bug 448681

M  +12   -9    core/dplugins/generic/tools/videoslideshow/wizard/vidslidefinalpage.cpp
M  +45   -9    core/dplugins/generic/tools/videoslideshow/wizard/vidslideintropage.cpp
M  +3    -8    core/dplugins/generic/tools/videoslideshow/wizard/vidslideoutputpage.cpp
M  +3    -8    core/dplugins/generic/tools/videoslideshow/wizard/vidslidevideopage.cpp

https://invent.kde.org/graphics/digikam/-/commit/982a06b8e1973a8447cac2ab92503f20a3f4fdfc
Comment 13 caulier.gilles 2024-01-04 10:30:16 UTC
Git commit 2eb84eeb93994d93c4b3f4bdb001cba2fba67fb1 by Gilles Caulier.
Committed on 04/01/2024 at 11:26.
Pushed by cgilles into branch 'master'.

Complete isolation of QtAv code.
Tested with Qt5 and Qt5.
Tested with and without mediaplayer cmake option.
The linking problem with QtAv was the auto reccursive parsing of header file in whole source repository. QtAv was always parsed and add to the compilation rules.
Not qtav and qtmm are removed from the parse and add at the demand when necessary.
Continue to port VideoSlideshw to FFmpeg CLI tool to drop QtAV (Qt5 and Qt6).
Related: bug 472503, bug 425284, bug 427221, bug 139781, bug 448681

M  +6    -2    core/CMakeLists.txt
M  +27   -0    core/cmake/rules/RulesMediaPlayer.cmake
M  +1    -1    core/dplugins/generic/tools/CMakeLists.txt
M  +3    -4    core/dplugins/generic/tools/videoslideshow/wizard/vidslidefinalpage.cpp
M  +6    -8    core/libs/video/CMakeLists.txt

https://invent.kde.org/graphics/digikam/-/commit/2eb84eeb93994d93c4b3f4bdb001cba2fba67fb1
Comment 14 caulier.gilles 2024-01-04 12:43:22 UTC
Git commit 002af12bc3aad5cdfff34f2e6dd4eed71310df66 by Gilles Caulier.
Committed on 04/01/2024 at 13:42.
Pushed by cgilles into branch 'master'.

add C++17 support
use QString instead QUrl for the video output path
Related: bug 472503, bug 425284, bug 427221, bug 139781, bug 448681

M  +5    -9    core/dplugins/generic/tools/videoslideshow/wizard/vidslidealbumspage.cpp
M  +8    -15   core/dplugins/generic/tools/videoslideshow/wizard/vidslidefinalpage.cpp
M  +4    -6    core/dplugins/generic/tools/videoslideshow/wizard/vidslideimagespage.cpp
M  +9    -15   core/dplugins/generic/tools/videoslideshow/wizard/vidslideoutputpage.cpp
M  +12   -24   core/dplugins/generic/tools/videoslideshow/wizard/vidslidevideopage.cpp
M  +11   -21   core/dplugins/generic/tools/videoslideshow/wizard/vidslidewizard.cpp
M  +2    -2    core/libs/video/manager/vidslidesettings.cpp
M  +1    -1    core/libs/video/manager/vidslidesettings.h

https://invent.kde.org/graphics/digikam/-/commit/002af12bc3aad5cdfff34f2e6dd4eed71310df66
Comment 15 caulier.gilles 2024-01-04 14:10:46 UTC
Git commit 58ece9388d0a3ef6ba90db979902ba7cbf2a9b84 by Gilles Caulier.
Committed on 04/01/2024 at 15:07.
Pushed by cgilles into branch 'master'.

new video slideshow task to encode frame as temporary JPEG files.
This JPEG stream will be pipe to the FFmpeg cli tool to encode as video.

M  +2    -3    core/libs/video/CMakeLists.txt
D  +0    -452  core/libs/video/manager/qtav/vidslidetask.cpp
A  +184  -0    core/libs/video/manager/vidslidetask.cpp     [License: GPL(v2.0+)]
R  +0    -0    core/libs/video/manager/vidslidetask.h [from: core/libs/video/manager/qtav/vidslidetask.h - 100% similarity]

https://invent.kde.org/graphics/digikam/-/commit/58ece9388d0a3ef6ba90db979902ba7cbf2a9b84
Comment 16 caulier.gilles 2024-01-04 14:18:07 UTC
Git commit ae723b3daa572b4fa26fbe820b4f9b3131979b6c by Gilles Caulier.
Committed on 04/01/2024 at 15:16.
Pushed by cgilles into branch 'master'.

start the encoding thread to generate temprary JPEG frame before encode video with FFMPEG
Related: bug 472503, bug 425284, bug 427221, bug 139781, bug 448681

M  +13   -9    core/dplugins/generic/tools/videoslideshow/wizard/vidslidefinalpage.cpp

https://invent.kde.org/graphics/digikam/-/commit/ae723b3daa572b4fa26fbe820b4f9b3131979b6c
Comment 17 caulier.gilles 2024-01-04 15:26:14 UTC
Git commit 7c0981484d4371bd1e5ff7db5da6785f9393f65b by Gilles Caulier.
Committed on 04/01/2024 at 16:25.
Pushed by cgilles into branch 'master'.

Create a temporary directory to host JPEG frames
Related: bug 472503, bug 425284, bug 427221, bug 139781, bug 448681

M  +1    -1    core/dplugins/generic/tools/CMakeLists.txt
M  +23   -8    core/libs/video/manager/vidslidetask.cpp

https://invent.kde.org/graphics/digikam/-/commit/7c0981484d4371bd1e5ff7db5da6785f9393f65b
Comment 18 caulier.gilles 2024-01-05 13:50:42 UTC
Git commit dd325854d3021dacb139d387bd37544bf89d3df8 by Gilles Caulier.
Committed on 05/01/2024 at 14:45.
Pushed by cgilles into branch 'master'.

First version for testing of the new video slideshow tool based on FFmpeg CLI tool to encode images as video.

A small demo is available here: https://drive.google.com/file/d/1posBo2rqkatU7N6qkbZWGBbOELsUGdgg/view?usp=sharing

It still plenty of features to restore, as to adjust the codecs, the size, the frame rate, the format. The audio track must be supported too.
Currently the temporary directory containing frames to encode is not yet deleted at end, it's for debuging.
It's planed to remove temp dir when all features will be completed.
Related: bug 472503, bug 425284, bug 427221, bug 139781, bug 448681

M  +1    -3    core/dplugins/generic/tools/CMakeLists.txt
M  +1    -1    core/dplugins/generic/tools/videoslideshow/wizard/vidslidefinalpage.cpp
M  +6    -6    core/libs/video/manager/ffmpeglauncher.cpp
M  +17   -4    core/libs/video/manager/vidslidethread.cpp
M  +15   -1    core/libs/video/manager/vidslidethread.h

https://invent.kde.org/graphics/digikam/-/commit/dd325854d3021dacb139d387bd37544bf89d3df8
Comment 19 caulier.gilles 2024-01-07 11:21:42 UTC
Git commit 90b508130131d470ef6051e0296d24f058bd85b1 by Gilles Caulier.
Committed on 07/01/2024 at 12:20.
Pushed by cgilles into branch 'master'.

run the ffmpeg process in a separate thread to not block the GUI while encoding frames.
Related: bug 472503, bug 425284, bug 427221, bug 139781, bug 448681

M  +6    -1    core/libs/threads/processlauncher.cpp
M  +6    -2    core/libs/threads/processlauncher.h

https://invent.kde.org/graphics/digikam/-/commit/90b508130131d470ef6051e0296d24f058bd85b1
Comment 20 caulier.gilles 2024-01-26 12:50:17 UTC
Fixed with bug 448681