Opened 3 years ago

Closed 2 years ago

#9293 closed defect (invalid)

ffmpeg is unable to identify the aspect ratio of some video files

Reported by: strangiato Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords: mov aspect
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by strangiato)

Summary of the bug:
Hi

I use ffmpeg 2:4.4-4 on Arch Linux.

My file manager called Dolphin is unable to display the aspect ratio of some video files when its detailed view mode is used.

This issue was initially reported on KDE bug tracker, here is the link of the report:
https://bugs.kde.org/show_bug.cgi?id=438098

In the comment 2, KDE contributor Méven Car said that Dolphin uses ffmpeg to extract details of video files, that for some reason is unable to identify the aspect ratio of the test files attached in the bug report.

How to reproduce:

  1. download any video file attached to this report
  2. run ffmpeg -i <any_video_file_downloaded_in_the_step_1>
    % ffmpeg -i output:
    The SAR (sample aspect ratior) is missing for video stream.
    
    video stream of 701D2C8E-A096-4BC7-9D97-2DA9C0321DB5.MOV fie:
    Stream #0:1(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720, 4730 kb/s, 29.99 fps, 29.97 tbr, 600 tbn, 1200 tbc (default)
    
    video stream of 2021-02-18\ 03-36-58.mkv file:
    Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 2560x1080, 60 fps, 60 tbr, 1k tbn, 120 tbc (default)
    
    ffmpeg version 4.4
    built on Arch Linux
    

Attachments (2)

701D2C8E-A096-4BC7-9D97-2DA9C0321DB5.MOV (2.0 MB ) - added by strangiato 3 years ago.
2021-02-18 03-36-58.mkv (629.4 KB ) - added by strangiato 3 years ago.

Change History (5)

by strangiato, 3 years ago

by strangiato, 3 years ago

Attachment: 2021-02-18 03-36-58.mkv added

comment:1 by strangiato, 3 years ago

Description: modified (diff)

comment:2 by Cigaes, 3 years ago

$ mkvinfo 2021-02-18\ 03-36-58.mkv 
…
|  + Video track
|   + Pixel width: 2560
|   + Pixel height: 1080
|   + Display unit: 4
|   + Video colour information
|    + Colour transfer: 1
|    + Colour matrix coefficients: 1
|    + Colour primaries: 1
|    + Colour range: 1
|  + Codec's private data: size 49 (H.264 profile: High @L5.1)
| + Track

Compare with the output for a video just created with ffmpeg:

|  + Video track
|   + Pixel width: 320
|   + Pixel height: 240
|   + Interlaced: 2
|   + Display width: 8
|   + Display height: 3
|   + Display unit: 3 (aspect ratio)
|  + Codec's private data: size 46 (H.264 profile: High @L1.3)

This video does not contain any aspect ratio information. Therefore, ffmpeg does not print it.

The same probably applies to the MOV file, but I do not know the tools to examine it.

comment:3 by Carl Eugen Hoyos, 2 years ago

Keywords: mov aspect added
Resolution: invalid
Status: newclosed

The mov file does not contain a pasp atom (that would contain an aspect ratio) and the display matrix in the tkhd atom is the identity matrix. The remaining question is if the identify matrix in the QuickTime tkhd atom indicates no aspect ratio or an aspect ratio of 1:1.

Note: See TracTickets for help on using tickets.