-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integration in digiKam (Qt5): some helps required. #428
Comments
Screenshot of the AudioPlayer : https://i.imgur.com/Q7JIkbW.png Note that audio track length is well reported here. Screenshot of the VideoPlayer: https://i.imgur.com/2DEaimx.png Gilles Caulier |
Hi Gilles, Is it possible to build digiKam on Ubuntu? |
QAVPlayer returns video frames that you could render as you wish. Technically you can do whatever you want. Idea to use Qt renderers. Which is more efficient is QML. Ic you use QVideoWidget as a video output. https://doc.qt.io/qt-5/qvideowidget.html - not sure if it supports orientations at all. |
do you hear sound? QAVPlayer->position() should show the synced pts of the playback. Audio and video streams are synced. Also, if you need only audio frames, you could disable video streams by on |
If QtAV worked for you and had some renderers, you could try to adapt it for QVideoFrame's ? |
yes, sure, here digikam is compiled under Unbuntu 18.04, 22.04, and 23.10. There is a script to install dependencies here : Warning, this script drop snap from the system. If you want to not touch to this feature, remove lines from there to en end : Gilles Caulier |
yes. it's fine.
I will do it.
But here, there is no video stream as media loaded are always audio track, as m4a, mp3, wav, etc... Did you already test this kind of configuration.
See my previous comment. Gilles Caulier |
No. The goal is to drop definitively qtav code from digiKam core (git/master) Gilles Caulier |
Tested wav, mp3 files, and never seen empty QAVPlayer::position(), |
Ic you already use |
Sure but this code is for the Qt6 version, not the Qt5... Gilles |
added qDebug() << d->player->position() and it works, Elapsed is also updated |
Where did you add the qdebug exactly. because i already do it here: ...and i can see this: digikam.dplugin.generic: Playing: QUrl("file:///home/gilles/Music/Agnes Obel - Myopia (2020)/03 - Island Of Doom.mp3") Gilles Caulier |
doing exactly there, where you mentioned. |
strange that volume does not work, but this helps |
btw doing
|
more and less for the moment. typically the volume must be saved and restored volume between session... Gilles |
All video frames will go to https://doc.qt.io/qt-5/qgraphicsvideoitem.html#videoSurface-prop the same idea as QVideoWidget. |
I sync you last commit in digiKam branch. No i can change the volume. Thanks. Audio position still zero to the console, as i can see... Gilles |
Did you seen this warning from G++ under Ubuntu 23.04 with Qt5.15.10: [ 53%] Building CXX object core/libs/video/QtAVPlayer/CMakeFiles/core_qtavplayer_obj.dir/qavstream.cpp.o Gilles |
Your last changes about audio volume introduce a 2/3s delay before to take effect, as when i change volume or when i stop/pause play. It's visible with simple audio player and with video player (as the video is paused/stopped but audio continue to play a little bit). Gilles |
Right, looks bug, volume is changed only when new frame is arrived which is not nice. Thanks, will fix |
|
ok, i will backport this commit late this evening. Look also all warnings that i can see under Ubuntu 23.10 where ffmpeg 5.1 is present : gilles@KU23: Config detected by cmake at digiKAm config time : -- FFMpeg AVCodec (required) : TRUE (59.37.100) Gilles |
looks made mistake with LIBAVUTIL_VERSION_MAJOR,
Do you know what is LIBAVUTIL_VERSION_MAJOR for you? |
|
yes sure : gilles@KU23:/usr/include/x86_64-linux-gnu/libavutil$ pwd gilles@KU23:/usr/include/x86_64-linux-gnu/libavutil$ cat version.h
/** #ifndef AVUTIL_VERSION_H #include "macros.h" /**
#define AV_VERSION_INT(a, b, c) ((a)<<16 | (b)<<8 | (c)) /**
/**
/**
#define LIBAVUTIL_VERSION_MAJOR 57 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, #define LIBAVUTIL_IDENT "Lavu" AV_STRINGIFY(LIBAVUTIL_VERSION) /**
#define FF_API_D2STR (LIBAVUTIL_VERSION_MAJOR < 58) /**
#endif /* AVUTIL_VERSION_H */ Gilles |
Done. merged back in digiKam core https://invent.kde.org/graphics/digikam/-/commit/9ce21116ad7298900a4e6870b508dea8de06002c Gilles |
Did you have a chance to figure out why player->position() returns 0 for you? but it still sends audio frames? |
yes, I do it now and the audio player work as expected now. position progress well, volume can be changed. Perfect. Now we must implement the video rotation feature. Gilles |
sure. Any plan for the future ? Also, take a look to this report under MacOS. digiKam under Apple do not use Qt6 yet (as Macports only provides an older version of Qt6). So Qt5 is used, and QtAvPlayer too. https://bugs.kde.org/show_bug.cgi?id=486388 My best Gilles Caulier |
Merged some fixes to audio #464, interesting to see if it helps there. |
yes i can reproduce the problem in my macbookpro intel and M1. I will backport the code in digiKam core and recompile the bundles. |
I can help with it, though not sure how easy it is to build on mac. |
If you have a macbook, the PKG installer including your last commit is here : https://files.kde.org/digikam/ Gilles |
you still see the issue there? |
yes, problem still reproducible on my macbook pro M1 with a MOV file taken with my iphone. This is what i seen in the Terminal: digikam.general: Database Info populated for QUrl("file:///System/Volumes/Data/Users/gilles/Pictures/SALAGOU/2021-12-21/66179368138__C05A772F-62BA-48DF-A389-1C7FFC7EE627.MOV") The video is well played without sound. Same file into VLC on the same computer has sound. Gilles |
could you confirm that you use |
btw, how you create QAVAudioOutput? do you use parent somehow? Could you try to avoid parent? upd: ok, fixing this
|
*Direct connection : yes *Avoid parent: no I will fix this last point and rebuild the PKG installer Gilles |
thanks, #467
could you try this fix? and keep parent, as it is |
I removed the parent and apply your last fix : digikam.general: Database Info populated for QUrl("file:///System/Volumes/Data/Users/gilles/Pictures/SALAGOU/2021-12-21/66179368138__C05A772F-62BA-48DF-A389-1C7FFC7EE627.MOV") No sound again. Do i need to restore the parent to the class instantiation as before ? Gilles |
This is how is compiled digiKam. Look especially the ffmpeg setup: digikam version 8.4.0 OpenCV Configuration: Threads features: Parallel framework: gcd Hardware features: SSSE3: Yes Manifests: O2 Snapshoot 2022-02-10: FFmpeg Configuration: Video Encoders: vc2: SMPTE VC-2 Video Decoders: zmbv: Zip Motion Blocks Video Supported Extensions: y4m: YUV4MPEG pipe Audio Encoders: sonicls: Sonic lossless Audio Decoders: xma2: Xbox Media Audio 2 Features: Spell-Checking support: No Gilles |
means that the audio device is null, there is no info about device, very sus |
I merged already a fix to support parents, so it should work for your prev code. |
Do i need to setup something with the audio device ? NOTE: I don't need to do it under Linux I recompile digiKam with the parent passed to the class, it's better for the memory cleanup. Gilles |
sorry, not clear what is version of ffmpeg? 7? brew install qt@5 and checked widget_video example and it works
|
Macports said ffmpeg 4.4.4. Macports have been installed since a while, as few months ago, in 2023. Do you think that i need to re-install all from scratch ? Gilles |
hi, in macport default ffmpeg is 4.4.4. I recompiled digiKam with extra codecs from ffmpeg GPL3 and nonfree. I re-add the parent to the audio device instance. This do not change anything: digikam.general: Event is dispatched to OSX desktop notifier Note: digiKam is compiled as non universal. Only X86_64 target is used. Application run in Rosetta 2 translator like a charm on my M1. Note : on my second macport pro Intel, the result is the same : no sound. |
thanks, |
btw, could you confirm that you have installed libqtaudio_coreaudio.dylib? |
libqtaudio_coreaudio.dylib ??? What's is that ? |
libqtaudio_coreaudio.dylib is not present in the digiKam bundle... |
this is core audio plugin from qtmultimedia, not sure it is installed by default. Used to play audio, without it is unable to play |
Right it's present in the macports install pwd/opt/digikam.org.x86_64/libexec/qt5/plugins/audio ls -altotal 48 I will patch the bundle build script to include it immediatly (:-))) Gilles |
Bundle re-build in progress... |
Adding the Qt plugin fix the sound problem. All work as expected now. Thanks valbok for your support and your patience. Gilles |
Hi,
First, thanks for sharing your code. It's very appreciated.
In digiKam, we would use the ffmpeg backend to play audio and video as the GStreamer backend from Qt5Multimedia is a mess for end users.
For 5/6 years, we have used QtAV for that. It works very well but with recent releases of ffmpeg, QtAV does not work well. QtAV is not maintained, so we need to find an alternative. QtAVPlayer is a good candidate.
digiKam can be compiled with Qt5 or Qt6. QtAvPlayer will be only used with Qt5, as the version of Qt6 requires QtMultimedia 6.5.0 or later as it's based on ffmpeg backend.
I created a git branch in digiKam named qtavplayer. We have a video player and an audio player. Code is here :
https://invent.kde.org/graphics/digikam/-/tree/development/qtavplayer/core/libs/video/player/QtAVPlayer?ref_type=heads
Note: QtAVPlayer code have been hosted in digiKam core without modification:
https://invent.kde.org/graphics/digikam/-/tree/development/qtavplayer/core/libs/video/QtAVPlayer?ref_type=heads
It's work but we faced some problems:
https://invent.kde.org/graphics/digikam/-/blob/development/qtavplayer/core/libs/video/player/QtAVPlayer/mediaplayerview.cpp?ref_type=heads#L328
https://invent.kde.org/graphics/digikam/-/blob/development/qtavplayer/core/libs/video/player/QtAVPlayer/mediaplayerview.cpp?ref_type=heads#L393
--> the audio position while playing is always null:
https://invent.kde.org/graphics/digikam/-/blob/development/qtavplayer/core/libs/video/player/QtAVPlayer/daudioplayer.cpp?ref_type=heads#L70
--> the audio volume cannot be changed (it's always to max), even if we pass a float value [0.0 - 1.0]
Note : with the videoplayer, the 2 last problems are not present.
Thanks in advance for your guidance.
Best regards
Gilles Caulier
The text was updated successfully, but these errors were encountered: