Bug 438098

Summary: baloo does not always detect the aspect ratio of video files
Product: [Frameworks and Libraries] frameworks-kfilemetadata Reporter: Patrick Silva <bugseforuns>
Component: generalAssignee: Pinak Ahuja <pinak.ahuja>
Status: RESOLVED NOT A BUG    
Severity: normal CC: baloo-bugs-null, meven29
Priority: NOR    
Version: 5.82.0   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
URL: https://trac.ffmpeg.org/ticket/9293
Latest Commit: Version Fixed In:
Attachments: test video files
screenshot of Dolphin

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.