openframeworks / openframeworks/openFrameworks

AVFoundation player doesn't load HDV ( non-square pixels ) correctly.

Open
#4,937 6 comments 0 reactions 1 assignee View on GitHub

@ofTheo is already working on this.

Since Feb 23, 2016.

core feature
Dominant language
C++
Stars
10.4k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
9

Description

https://forum.openframeworks.cc/t/issues-with-pixel-ratios-in-ofvideoplayer/22120/10

Test video is here:
https://www.dropbox.com/sh/t2rezaeeghyj581/AAAAkGZvI6uJmG6KYOKEFCNUa?dl=0

On initial research the way to get the true size of the frame is:

CVImageBufferRef imageBuffer = [videoPlayer getCurrentFrame];
  int realW =  CVPixelBufferGetWidth(imageBuffer);
  int realH = CVPixelBufferGetHeight(imageBuffer);

The problem is that this info comes in later ( once the first frame is delivered ).
So for texture playback we need to change the texture coords based on the difference between the reported width ( 1920 ) and the pixel width ( 1440 )

For getting the pixels out we would need to figure out whether we should return the pixels as they are ( 1440 x 1080 ), or scale the pixels up which would add overhead.

ping @i-n-g-o @openframeworks/macos

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.