Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poster Images Stretched In Media Player #5832

Open
1 task
joncameron opened this issue May 16, 2024 · 2 comments
Open
1 task

Poster Images Stretched In Media Player #5832

joncameron opened this issue May 16, 2024 · 2 comments
Assignees
Labels

Comments

@joncameron
Copy link
Contributor

joncameron commented May 16, 2024

Description

Videos that do not match the ratio of the media player are stretched to fit.

Example

https://avalon-dev.dlib.indiana.edu/master_files/4m90dv50r

Before Playback

Screenshot 2024-05-16 at 11 52 52 AM

During Playback

Screenshot 2024-05-16 at 11 53 08 AM

Done Looks Like

  • Thumbnails are saved in the original aspect ratio with the same pixel width and height as the source
@joncameron joncameron added the bug label May 21, 2024
@masaball masaball self-assigned this Jun 7, 2024
@masaball
Copy link
Contributor

masaball commented Jun 7, 2024

@joncameron Can you retest this? I downloaded the media file from the linked item and have tried uploading it locally and into a new item on Avalon-dev and the thumbnail is created how I would expect:
Screenshot_20240607_133114.png

I also tested the results of creating a new thumbnail and that also generated the image with the proper aspect ratio.

Maybe this example item was a weird one-off glitch?

@joncameron
Copy link
Contributor Author

After testing it looks like this is due to the media file and how Avalon is storing metadata.

Two files to demonstrate: https://drive.google.com/drive/folders/1tlKzE2l-p61uSveianBbb6Db54G1YO2s

  • pexels-roman-odintsov-7691954 (correct ratio stored in record)
  • IMG_4190 (shows as the correct ratio in media player but not in thumbnail)

IMG_4190.MOV is hevc taken from my iPhone. It's a vertical video, but inside the MOV it's being stored as a horizontal ratio, then the rotation is marked in item metadata. Here's FFprobe output for this file:

 Stream #0:0[0x1](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 164 kb/s (default)
      Metadata:
        creation_time   : 2024-01-26T15:32:32.000000Z
        handler_name    : Core Media Audio
        vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](und): Video: hevc (Main 10) (hvc1 / 0x31637668), yuv420p10le(tv, bt2020nc/bt2020/arib-std-b67), 1280x720, 2302 kb/s, 30 fps, 30 tbr, 600 tbn (default)
      Metadata:
        creation_time   : 2024-01-26T15:32:32.000000Z
        handler_name    : Core Media Video
        vendor_id       : [0][0][0][0]
        encoder         : HEVC
      Side data:
        DOVI configuration record: version: 1.0, profile: 8, level: 3, rpu flag: 1, el flag: 0, bl flag: 1, compatibility id: 4
        displaymatrix: rotation of -90.00 degrees
        Ambient Viewing Environment, ambient_illuminance=314.000000, ambient_light_x=0.312700, ambient_light_y=0.329000

You can see this error clearly here: https://avalon-dev.dlib.indiana.edu/encode_records/942.
The input is reported at 1280x720, but the derivatives are in the 720x1280 ratio. This is probably because Avalon is naively taking the width and height and not accounting for aspect metadata.

Updating the masterfile with correct metadata for these types of situations would be best, possibly based on the end output of the encoding process. Or maybe there's some way could get the computed actual width and height accounting for rotation and other factors, and store that in the record.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants