Bug 472508 - Scanning AV1 files results in crash
Summary: Scanning AV1 files results in crash
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Thumbs-Video (show other bugs)
Version: 8.1.0
Platform: Microsoft Windows Microsoft Windows
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-22 19:57 UTC by lincoln
Modified: 2023-10-29 17:13 UTC (History)
3 users (show)

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


Attachments
Video encoded with AV1 libsvt video and OPUS audio (1.62 MB, video/mp4)
2023-07-23 15:22 UTC, lincoln
Details
Video encoded with AV1 libaom video and OPUS audio using nmkoder (2.76 MB, video/mp4)
2023-07-23 15:23 UTC, lincoln
Details

Note You need to log in before you can comment on or make changes to this bug.
Description lincoln 2023-07-22 19:57:58 UTC
SUMMARY
If you scan a mp4 video file encoded with av1 video and opus audio, digikam immediately crashes. It happens with WAL enabled or disabled.

STEPS TO REPRODUCE
1. Add folder with av1 opus mp4 videos in configuration page
2. Exit configuration page
3. Scan automatically starts, app hangs, app exits
OR
1. Perform the above steps
2. Reopen digikam
2b. If autoscan is enabled, the scan automatically starts, and the app hangs and exits
3. Go to folder with videos in thumbnail view
4. App hangs and exits

DEBUGVIEW
I have remove personal info from the logs, and the log starts as soon as I click on the folder to see it in the thumbnails view.
[16624] digikam.geoiface: ----
[16624] digikam.geoiface: ----
[16624] digikam.general: Using  12  CPU core to run threads
[16624] digikam.general: Stacked View Mode :  0
[16624] digikam.general: Action Thread run  1  new jobs
[16624] digikam.general: Cancel Main Thread
[16624] digikam.general: One job is done
[16624] digikam.general: Finish Main Thread
[16624] digikam.metaengine: Parse metadada with FFMpeg: "REDACTEDFILEPATH/MVI_4554.mp4"
[16624] digikam.qtav: [FFmpeg:libaom-av1] 3.6.1
[16624] digikam.metaengine: -- FFMpeg video stream metadata entries :
[16624] digikam.metaengine: QMap(("creation_time", "2018-01-16T18:02:37.000000Z")("handler_name", "VideoHandler")("language", "eng")("vendor_id", "[0][0][0][0]"))
[16624] digikam.metaengine: -----------------------------------------
[16624] digikam.metaengine: -- FFMpeg audio stream metadata entries :
[16624] digikam.metaengine: QMap(("creation_time", "2018-01-16T18:02:37.000000Z")("handler_name", "SoundHandler")("language", "eng")("vendor_id", "[0][0][0][0]"))
[16624] digikam.metaengine: -----------------------------------------
[16624] digikam.metaengine: -- FFMpeg root container metadata entries :
[16624] digikam.metaengine: QMap(("com.apple.quicktime.player.movie.audio.balance", "0")("com.apple.quicktime.rating.user", "0")("compatible_brands", "isomav01iso2mp41")("creation_time", "2018-01-16T18:02:37.000000Z")("encoder", "Lavf59.24.100")("major_brand", "isom")("make", "Canon")("make-eng", "Canon")("minor_version", "512")("model", "Canon EOS REBEL T4i")("model-eng", "Canon EOS REBEL T4i"))
[16624] digikam.metaengine: ------------------------------------------
[16624] digikam.metaengine: Check ExifTool availability: true
[16624] digikam.metaengine: ExifTool "Load Chunks" "-TagsFromFile REDACTEDFILEPATH\\MVI_4554.mp4 -all -o -.exv"
[16624] digikam.metaengine: ExifToolProcess::readOutput(): ExifTool command completed
[16624] digikam.metaengine: ExifTool complete command for action "Load Chunks" with elasped time (ms): 591
[16624] digikam.metaengine: EXV chunk size: 5906
[16624] digikam.metaengine: ExifTool parsed command for action "Load Chunks" 1 properties decoded
[16624] digikam.metaengine: ExifTool complete "Load Chunks" for "REDACTEDFILEPATH/MVI_4554.mp4"
[16624] digikam.metaengine: Metadata chunk loaded with ExifTool
[16624] digikam.metaengine: Loading metadata with "Exiv2" backend from "REDACTEDFILEPATH/MVI_4554.mp4"
[16624] digikam.general: Trying to get thumbnail from "REDACTEDFILEPATH/MVI_4554.mp4" ( "video" )
[16624] digikam.general: Trying to load video preview with FFmpeg
[16624] digikam.qtav: [FFmpeg:libaom-av1] 3.6.1


OBSERVED RESULT
crash

EXPECTED RESULT
no crash

OS VERSION
Windows: 22H2

ADDITIONAL INFORMATION
installed from chocolatey
Comment 1 Maik Qualmann 2023-07-23 04:56:02 UTC
It looks like the same problem as Bug 471797 and Bug 471269 with the libaom.
Can you provide a sample video of the camera?

Maik
Comment 2 Maik Qualmann 2023-07-23 05:48:21 UTC
Git commit ab3e2e5adb8d9e51cda6973e57828569dff21141 by Maik Qualmann.
Committed on 23/07/2023 at 07:46.
Pushed by mqualmann into branch 'master'.

try new settings to compile libaom
Related: bug 471797, bug 471269

M  +2    -1    project/bundles/3rdparty/ext_libaom/CMakeLists.txt

https://invent.kde.org/graphics/digikam/-/commit/ab3e2e5adb8d9e51cda6973e57828569dff21141
Comment 3 lincoln 2023-07-23 15:22:01 UTC
Created attachment 160469 [details]
Video encoded with AV1 libsvt video and OPUS audio
Comment 4 lincoln 2023-07-23 15:23:33 UTC
Created attachment 160470 [details]
Video encoded with AV1 libaom video and OPUS audio using nmkoder
Comment 5 lincoln 2023-07-23 15:24:44 UTC
Both the aom and svt files cause a crash on thumbnail generation.
Comment 6 Maik Qualmann 2023-07-23 17:20:33 UTC
Thanks for the test videos. As with the bug reports with the AVIF images, I cannot reproduce a crash in a Windows 10 VM. Thumbnails are created and the videos can be played. I'll test it tomorrow on 2 real Windows 10 machines. There is something about libaom (compilation?) that is system dependent.

Gilles, can you please create a new digiKam-8.2.0 Windows bundle with the latest change in compile flags to libaom?

Maik
Comment 7 caulier.gilles 2023-07-23 18:19:39 UTC
Hi Maik,

I will do it tomorrow morning. Today I'm on the road...

Gilles
Comment 8 caulier.gilles 2023-07-24 07:31:17 UTC
Hi Maik,

Build is under progress..

Note that we use currently KF5 version 5.106. In KImageFormat we can see these changes:

5.107:

    pcx: multiple fixes (2)
    Avoid unnecessary conversions
    RGB/SGI writer: fix alpha detection and image limit size
    TGA writer: fix alpha detection and performance improvements
    pcx: multiple fixes
    PCX: Fix reading of the extended palette (bug 463951)

5.108: 

    jxl: add support for libjxl v0.9, drop support for old 0.6.1

Nothing about AOM support improvement or fix. So i'm not sure if updating KF5 will help in this file.

Best

Gilles
Comment 9 caulier.gilles 2023-07-24 08:44:32 UTC
Windows build is now ready at usual place and recompiled with the new libaom configuration:

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

Gilles
Comment 10 Maik Qualmann 2023-07-24 09:32:46 UTC
Here on a real Windows 10 machine with Intel Core I5, I have no problems with the sample videos or AVIF images from the other bug reports.

Maik
Comment 11 caulier.gilles 2023-07-24 10:03:45 UTC
Maik, did you check with the last Windows installer ?

Gilles
Comment 12 Maik Qualmann 2023-07-24 10:33:32 UTC
Yes, I checked it with today's current Windows Installer. But we already know the problem from AVIF images that I could not reproduce a crash with libaom on any of my Windows machines.
We'll have to wait and see what the bug reporters write.

Maik
Comment 13 caulier.gilles 2023-10-15 03:15:31 UTC
@lincoln@vandymail.com,

This problem still reproducible with the new digiKam 8.2.0 pre-release Windows
installer available at usual place:

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

This new bundle is based on last Qt framework 5.15.11 and KDE framework 5.110.

Thanks in advance

Gilles Caulier
Comment 14 caulier.gilles 2023-10-29 11:09:31 UTC
@Ping all...

Any feedback here following my last comment #13

Thanks in advance

Gilles Caulier
Comment 15 Antonio 2023-10-29 17:05:35 UTC
I'm trying right now with a folder that contains videos that crash the current version. Seems that now it works well.
Comment 16 caulier.gilles 2023-10-29 17:13:58 UTC
Perfect, thanks for the feedback