Bug 484479 - HDR video playback not supported fully on Mac.
Summary: HDR video playback not supported fully on Mac.
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Preview-Video (show other bugs)
Version: 8.3.0
Platform: macOS (DMG) macOS
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-25 21:07 UTC by alfie80
Modified: 2024-12-31 04:21 UTC (History)
5 users (show)

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


Attachments
Some crash info. (65.62 KB, text/rtf)
2024-03-25 21:07 UTC, alfie80
Details
Regular vs HDR video comparison screenshot (135.94 KB, image/jpeg)
2024-12-26 23:17 UTC, MarcP
Details

Note You need to log in before you can comment on or make changes to this bug.
Description alfie80 2024-03-25 21:07:07 UTC
Created attachment 167763 [details]
Some crash info.

STEPS TO REPRODUCE
1. Video playback in MacOs
2. 
3. 

With version 8.3.0 on Mac, I cannot find any settings for video playback in preferences. 

OBSERVED RESULT
1. No sound in playback. 
2. Video controllers not working.
3. HDR videos not rendering in HDR, washed out colour. 

EXPECTED RESULT
Consistent video playback 


SOFTWARE/OS VERSIONS

macOS: 

KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION; 
I have attached some info from the crash log. 
This crash happened when I was trying to do some video playback
Comment 1 Maik Qualmann 2024-03-25 21:15:55 UTC
Sound problem has already been reported with Bug 484360

Maik
Comment 2 caulier.gilles 2024-03-26 08:54:37 UTC
Can you share some video sample using a cloud web-service to reproduce the problem here ?
Comment 3 alfie80 2024-03-26 20:37:35 UTC
This was a random crash. It was not linked to particular video playback. I can’t reproduce that. 
Noted sound problem report.  Can’t see much info about HDR video playback issue on Mac OS. 
Do you want me send a random HDR 4K video. It applies to both HLG and PQ.
Comment 4 caulier.gilles 2024-05-04 13:45:32 UTC
For the MacOS bundle we forget to include GPL3 and nonfree video codecs in ffmpeg. It's now done with 8.4.0 pre-release PKG installer available here :

 https://files.kde.org/digikam/

Please test and report if this file can be closed.

Thanks in advance

Gilles Caulier
Comment 5 alfie80 2024-05-04 18:08:11 UTC
Thank you.
Comment 6 caulier.gilles 2024-05-05 02:49:11 UTC
alfie80,

Did you try the pre-release version ? The video sound problem is fixed, i'm sure. About the 4K suppoet, i'm not sure. Please double check on your computer...

Gilles Caulier
Comment 7 alfie80 2024-05-05 06:16:12 UTC
It will play one or two videos with sound. But when navigate to next video, it makes an artificial sound. Then keep going going like that.
Comment 8 caulier.gilles 2024-05-05 06:49:32 UTC
is the crash reproductible ? How is the HDR color rendering ?
Comment 9 alfie80 2024-05-07 13:17:30 UTC
Yes, it is reproducible. It is not crash. Distorted sound. It is better than before. 
Navigating through different folders with videos. 
After a few videos it will start with distorted sounds only, from speaker. 
I must admit that this sound distortion is erratic, It will play some some videos with correct sound. 
I am unable to figure any particular audio codec as culprit.
Still no HDR playback. 
I have taken some screen recordings of the video playback.
This is a typical video audio encoding: Audio
ID                                       : 2
Format                                   : AAC LC
Format/Info                           : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 1 min 24 s
Bit rate mode                          : Constant
Bit rate                                     : 192 kb/s
Channel(s)                               : 2 channels
Channel layout                         : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 SPF)
Compression mode                   : Lossy
Stream size                              : 1.93 MiB (0%)
Title                                    : SoundHandle
Language                                 : English
Encoded date                             : 2024-03-23 15:26:43 UTC
Tagged date                              : 2024-03-23 15:26:43 UTC
Comment 10 caulier.gilles 2024-05-07 15:42:13 UTC
Can you share a video sample please ?
Comment 11 alfie80 2024-05-08 09:31:25 UTC
https://drive.google.com/drive/folders/11_O--kTgIhFifZ7_rHqPLoGmT5upEOuA?usp=sharing

Please these videos.  2 of them are screen recordings. One is an original video.
Comment 12 caulier.gilles 2024-05-08 10:50:16 UTC
Thanks to share the sample. See my screenshot :

https://i.imgur.com/nLTRLp0.png

There is not major visual difference between VLC and digiKam 8.4.0 on my Macbook ProM1. The video preview work as expected.

Sure VLC has certainly a way to render video with 10 bits per color per pixel (digiKam only support 8 bits for the moment). digiKam video player is not here to replace VLC at all.

For the sound glitch, yes i can here something at video init, perhaps something is not properly set before to play the media.

Gilles Caulier
Comment 13 alfie80 2024-05-09 17:17:26 UTC
Video playback improved. Also improvement with audio playback. I got a mixture of 8 & 10 bit videos. 
Strange as it sounds, Digikam plays 10 bit videos with all audio without any problems. 8 bit videos do have all the sound problems. 
I will upload some videos over the weekend for demonstration. I will try to get example videos HDR too.
Comment 14 alfie80 2024-05-24 10:22:47 UTC
Sorry for the delay. 
In these videos 8 bit encodes videos with same audio codecs do have sound problems. 
10 bit videos encoded with same sound codecs appears to play sound better. 
Please see the shared videos. Original sounds were low. Please listen for distorted sounds.

https://drive.google.com/drive/folders/11_O--kTgIhFifZ7_rHqPLoGmT5upEOuA?usp=sharing
Comment 15 caulier.gilles 2024-06-15 07:53:04 UTC
Git commit 57536d9f6188f0370d120dd84605a41549651a7b by Gilles Caulier.
Committed on 15/06/2024 at 07:45.
Pushed by cgilles into branch 'master'.

Update media player with git/master branch from GitHub
Related: bug 485468, bug 487031

M  +2    -2    core/libs/video/QtAVPlayer/QtAVPlayer_manifest.txt
M  +3    -0    core/libs/video/QtAVPlayer/qavhwdevice_d3d11.cpp
M  +1    -1    core/libs/video/QtAVPlayer/qavhwdevice_vaapi_drm_egl.cpp
M  +1    -0    core/libs/video/QtAVPlayer/qavsubtitleframe.cpp
M  +3    -1    core/libs/video/QtAVPlayer/qtavplayerglobal.h

https://invent.kde.org/graphics/digikam/-/commit/57536d9f6188f0370d120dd84605a41549651a7b
Comment 16 caulier.gilles 2024-07-17 06:22:41 UTC
Hi,

It's reproducible with last 8.4.0 release ?

https://download.kde.org/stable/digikam/8.4.0/

Best

Gilles Caulier
Comment 17 alfie80 2024-07-17 21:44:46 UTC
Yes the sound issue partially resolved. Now it can play, lot of erratic behavior  of sound playback. Sometimes, sound stop after few seconds. At times some videos with distorted sounds. 
 Video playback is OK. Still No HDR support in MAC. All native players support HDR playback, Quicktime and Elmedia. In Digikam HDR video colours are washed out. 
So I need to open videos in default player to get it work.
Comment 18 caulier.gilles 2024-09-16 14:16:37 UTC
With the bug #487031 now closed, digiKam for macOS version 8.5.0 pre-release use ffmpeg 6.1 and Qt6Multimedia 6.7.2 for the video playback:

https://i.imgur.com/u4lXXYy.jpg

All the dysfunctions disappears, excepted the rendering of HDR colors. In other words, the Video controllers are working now. 

Maik, i don't know if we can do something about the HDR support in digiKam.

Gilles
Comment 19 Maik Qualmann 2024-09-16 15:33:33 UTC
When I look at the screenshot, I like the colors in digiKam better from the video than from the macOS Player ((:-))
QMediaPlayer currently does not have support for the BT.2020 color space, for example.
Is there a difference when Darwin is used?

Maik
Comment 20 caulier.gilles 2024-09-16 16:15:35 UTC
Maik,

The stand alone video player in my last screenshot is... VLC (:=)))...

Gilles
Comment 21 caulier.gilles 2024-09-16 20:42:06 UTC
Using Drawing backend or the external Apple video player (QuickTime), give exactly the same result...
Comment 22 caulier.gilles 2024-12-02 06:41:24 UTC
Hi,

digiKam 8.5.0. is out with many fixes and improvements.

https://www.digikam.org/news/2024-11-16-8.5.0_release_announcement/

This report still valid with this version?
Thanks in advance

Gilles Caulier
Comment 23 MarcP 2024-12-25 21:05:39 UTC
Hi, I'd like to report that on Windows 10 there's the same issue with HDR video playback. Videos filmed with an iPhone without HDR look ok on digikam, but those with HDR on look all washed out. Using external players, like VLC, they play with the correct colors.

I'm using Digikam 8.6.0 built 3/12/2024 14:01
Comment 24 Maik Qualmann 2024-12-25 21:21:39 UTC
Hi Marc,

In digiKam-8.6.0 in the Settings-> Miscellaneous-> System there are 2 settings that relate to video. Test it without video hardware acceleration and/or without texture conversion. Both options only take effect after a digiKam restart. Otherwise a short video sample would be necessary.

Maik
Comment 25 MarcP 2024-12-25 23:20:17 UTC
Hi Maik,

I tested checking and unchecking those options (closing digikam in between) but I couldn't appreciate any change; the video with HDR still looks washed out. Here's a sample, video IMG_1082.MOV has HDR enabled, and IMG_1087.MOV doesn't.

http://158.101.198.126:9011/share/lLx3_o4j (IMG_1082.MOV)
http://158.101.198.126:9011/share/56Q_Zt7S (IMG_1087.MOV)

(let me know if you have any issues with these links, and I'll use a more standard file sharing method).
Comment 26 Maik Qualmann 2024-12-26 07:44:41 UTC
Hi Marc,

Here under Linux with fairly recent FFmpeg, the videos look OK to me. The HDR video is a bit darker, but not washed out. They look identical in VLC and digiKam. I'll test the Windows version of digiKam in my company tomorrow to see if there's a difference.

@Gilles and Michael, can you test it on macOS?

Maik
Comment 27 MarcP 2024-12-26 23:17:56 UTC
Created attachment 176895 [details]
Regular vs HDR video comparison screenshot

Left: regular video. Right: HDR video.
Comment 28 caulier.gilles 2024-12-27 03:53:25 UTC
Hi Maik,

This is my comparison under my macbook pro M1 running :

- MacOS Somona 14.7.1
- digiKam 8.6.0 Qt6 build at 26 december (arm64 version)
- VLC 3.0.20 (arm64 version)

1/ Playing with digiKam settings: 

- video hardware acceleration = ON
- video textures conversion = ON
- Decoding backend = FFMPEG

HDR video file IMG_1082.MOV (VLC on the left, digiKam on the right):

https://i.imgur.com/FhEVWx7.png

Regular video file IMG_1087.MOV (VLC on the left, digiKam on the right):

https://i.imgur.com/iLoTsiA.png

2/ Playing with digiKam settings: 

- video hardware acceleration = ON
- video textures conversion = OFF
- Decoding backend = FFMPEG

HDR video file IMG_1082.MOV (VLC on the left, digiKam on the right):

https://i.imgur.com/ct9KKIm.jpg

Regular video file IMG_1087.MOV (VLC on the left, digiKam on the right):

https://i.imgur.com/XWDpGrQ.jpg

3/ Playing with digiKam settings: 

- video hardware acceleration = OFF
- video textures conversion = OFF
- Decoding backend = FFMPEG

HDR video file IMG_1082.MOV (VLC on the left, digiKam on the right):

https://i.imgur.com/YFJfaT5.jpg

Regular video file IMG_1087.MOV (VLC on the left, digiKam on the right):

https://i.imgur.com/CRFbPhL.jpg

--------------------------------------

Conclusion with FFMPEG backend: "video hardware acceleration" must be ON to prevent washed out color on HDR video. This has no effect on regular video. The digiKam player always render HDR video as a regular video.

Best regards and Merry Christmas

Gilles Caulier
Comment 29 Maik Qualmann 2024-12-27 09:22:49 UTC
Hi Gilles, I don't quite understand your comment about video acceleration, all your screenshots look correct.
I don't see the error like in Comment 27.

A test here on 2 Windows computers also shows no problems.

Maik
Comment 30 caulier.gilles 2024-12-27 09:40:58 UTC
Did you compare left and right views properly. You don't see the differences ? digiKam video preview is always different than VLC.

The washed out in highlight problem is always reproducible in digiKam video preview when video hardware acceleration is OFF. 

Note : open the images in browser and disable color management, just to be sure to see the differences.
Comment 31 caulier.gilles 2024-12-27 09:47:38 UTC
Ok i understand why with ImgUr the screenshot look very similar.

Use my GDrive directory contents directly:

https://drive.google.com/drive/folders/1ZreenpH5WOJrm2zAsMVYZ6uF4orqrCSH?usp=sharing

All are original PNG files uploaded in ImgUr. You must seen the differences.

Gilles
Comment 32 Maik Qualmann 2024-12-27 10:13:35 UTC
Yes, slight differences can be seen. But none look like in Comment 27.

Maik
Comment 33 Maik Qualmann 2024-12-27 10:21:15 UTC
There are still some open bugs related to HDR support. However, some have already been closed for Qt-6.8.0.

https://bugreports.qt.io/browse/QTBUG-121883

Maik
Comment 34 caulier.gilles 2024-12-27 11:09:39 UTC
MacOS Qt6 built arm64 still use 6.7.2 not 6.8.0 or 6.8.1. Last time i tried to rebuild Macports from scratch, it fails. I seen few comments in Macports mailing list about these problems, and I will wait that Macports team fix these issues before to try again. Usually, open source guys works faster while holidays, so it's in my TODO list before 8.6.0 release.
Comment 35 slipry79 2024-12-30 12:19:19 UTC
Here is some additional info on the washed out video issue.  I am seeing it with .mov files from iPhone.  I am running digiKam-8.5.0-Qt6-Win64.exe on Windows 11.  
- With FFmpeg decoder, enabled "Use the OpenCL hardware acceleration".  Problem still occurs.
- With FFmpeg decoder, enabled all three video related options in Miscellaneous->System.  Problem still occurs.
- Switched to WMF decoder with or without all three video related options enabled.  Problem does *not* occur.

Thanks
Comment 36 caulier.gilles 2024-12-31 04:21:22 UTC
Git commit 8450e8329dc8f00d319d53ddcb3a7506e47fc6b8 by Gilles Caulier.
Committed on 31/12/2024 at 04:19.
Pushed by cgilles into branch 'master'.

Online doc: add note about better results obtained with alternative video backend when playing HDR media.
FIXED-IN: 8.6.0

M  +4    -0    setup_application/miscs_settings.rst

https://invent.kde.org/documentation/digikam-doc/-/commit/8450e8329dc8f00d319d53ddcb3a7506e47fc6b8