Bug 438098 - baloo does not always detect the aspect ratio of video files
Summary: baloo does not always detect the aspect ratio of video files
Status: RESOLVED NOT A BUG
Alias: None
Product: frameworks-kfilemetadata
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.82.0
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Pinak Ahuja
URL: https://trac.ffmpeg.org/ticket/9293
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-05 00:26 UTC by Patrick Silva
Modified: 2021-06-28 08:20 UTC (History)
2 users (show)

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


Attachments
test video files (2.45 MB, application/gzip)
2021-06-05 00:26 UTC, Patrick Silva
Details
screenshot of Dolphin (100.52 KB, image/png)
2021-06-05 00:30 UTC, Patrick Silva
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Silva 2021-06-05 00:26:48 UTC
Created attachment 139005 [details]
test video files

STEPS TO REPRODUCE
1. download attached archive containing test video files
2. extract the downloaded archive to a location indexed by baloo
3. set details view mode in Dolphin
4. enable Aspect Ratio column

OBSERVED RESULT
empty Aspect Ratio column. Please see the attached screenshot.

EXPECTED RESULT
Aspect Ratio column should show the aspect ratio of the test video files

SOFTWARE/OS VERSIONS
Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.22.80
KDE Frameworks Version: 5.83.0
Qt Version: 5.15.3
Graphics Platform: Wayland
Comment 1 Patrick Silva 2021-06-05 00:30:22 UTC
Created attachment 139006 [details]
screenshot of Dolphin
Comment 2 Méven Car 2021-06-05 11:07:11 UTC
This is a bug for ffmpeg : we use ffmpeg's av_guess_sample_aspect_ratio to get video file aspect ratios, but this functions fails for the files you sent.

Reproducible with
ffmpeg -i Screen_recordings/2021-02-18\ 03-36-58.mkv
The SAR (sample aspect ratior) is missing for the video stream.

I'd recommend you open a bug there.

Code is there https://ffmpeg.org/doxygen/2.7/libavformat_2utils_8c_source.html#l04188
Comment 3 Patrick Silva 2021-06-17 14:59:29 UTC
Thank you Méven.
Reported to ffmpeg devs: https://trac.ffmpeg.org/ticket/9293
Comment 4 Méven Car 2021-06-27 12:44:01 UTC
I read ffmpeg upstream bug response.

I see the issue some video files simply won't contain aspect ratio data.

I guess that we can use the video size to compute the aspect ratio as it should be what video player would do.

I made a MR to do that :
https://invent.kde.org/frameworks/kfilemetadata/-/merge_requests/33
Comment 5 Méven Car 2021-06-28 08:20:38 UTC
A video without aspect ratio is valid.
The issue is with the encoder that did not provide one.