Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[camera] Added orientation metadata to iOS recorded videos. #1452

Conversation

quentinleguennec
Copy link
Contributor

@quentinleguennec quentinleguennec commented Apr 5, 2019

Description

This adds rotation metadata to recorded videos on iOS (they are already here in Android). It also ensure that videos recorded on Android and iOS will have the same metadata (as seen with ffprobe -show_streams).
By achieving consistency of recorded video metadata between platform we can ensure consistency when reading video recorded from multiple platform with the video_player. But the video player still need a fix on iOS, which is addressed in this other PR: #1451

Related Issues

flutter/flutter#27201
flutter/flutter#29951

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See [Contributor Guide]).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (flutter analyze) does not report any problems on my PR.
  • I read and followed the [Flutter Style Guide].
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I updated pubspec.yaml with an appropriate new version according to the [pub versioning philosophy].
  • I updated CHANGELOG.md to add a description of the change.
  • I signed the [CLA].
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate a breaking change in CHANGELOG.md and increment major revision).
  • No, this is not a breaking change.

@Dwarfie
Copy link

Dwarfie commented May 15, 2019

This has fixed the issue of video captured in Landscape being rotated 90 degrees in iOS when using the camera plugin.

@quentinleguennec
Copy link
Contributor Author

@mklim @bparrishMines
Hi, could we get an ETA for review of this PR?
There was a discussion on several PRs I made to the camera ad video_player plugins on this issue (which the PRs fix):
flutter/flutter#29951
Thanks

@quentinleguennec
Copy link
Contributor Author

quentinleguennec commented May 21, 2019

I'll drop this here while we wait for the PR review, it's a fix for the camera plugin and video plugin recording quality and rotation issues. For people interested in a fix have a look at the discussion on this issue: flutter/flutter#29951

Copy-paste, for more fixes (like issues with aspect ratio) check the previous link:
When I worked on solving those issue I did 4 fixes in the camera plugin and video_player plugin. And it is quite possible it will only work well only with the 4 fixes together. Here is the list of PR (only one of them has been merged so far and I have yet to get any answer from reviewers on the others):

flutter/plugins#1452
flutter/plugins#1403
flutter/plugins#1451
flutter/plugins#1470

I created a branch with those 4 fixes merged together, I suggest you try this branch first and see if it works on your side:
https://github.com/Tengio/plugins/tree/tested4you_video_player_camera_merge

You can use it by adding this in your pubspec.yaml:

 video_player:
    git:
      url: git://github.com/tengio/plugins.git
      ref: 310a8f06c4981121a5553b0f6f3a8cdf475b8af1
      path: packages/video_player
  camera:
    git:
      url: git://github.com/tengio/plugins.git
      ref: 310a8f06c4981121a5553b0f6f3a8cdf475b8af1
      path: packages/camera

@bparrishMines
Copy link
Contributor

Hi @quentinleguennec,

Thank you for the contribution!

Since we are still deciding on the direction of the camera plugin (including writing tests), current and new features are not properly covered by tests. In order to maintain a quality bar for flutter/plugins we are going to avoid adding new features or substantial changes that aren't critical.

Our best recommendation for now would be to fork the current version of the plugin. (As it looks like you are doing already).

Once we make a decision for the camera plugin, we'll update all related issues and PRs.

@mklim mklim removed their request for review February 14, 2020 22:12
julianscheel pushed a commit to jusst-engineering/plugins that referenced this pull request Mar 11, 2020
* Skip flaky firebase_performance driver tests
@pajama
Copy link

pajama commented Apr 21, 2020

@quentinleguennec ty so much for the fix! The orientation metadata is there now, but I've noticed with your version my video recording quality is much worse. I wonder if there was another fix for that in the master branch after? Do you have plans for updating your pr with the latest? I can try to take a stab, but some of the code is foreign to me.

@quentinleguennec
Copy link
Contributor Author

Hi @pajama

To be honest I wrote this fix a year ago, things must have changed a lot from master since then, especially since Google wanted to do a big refactoring of the camera plugin (see bparrishMines comment of 5 Jun 2019 above).

Did you try the branch I created which contained this fix and a few others? I was trying to fix a few issues at the time, can't remember all of them from the top of my head ^^'. See my comment from 21 May 2019 above. This branch will be very out of date with the current state of the camera plugin on master though, you will need to see if it doesn't break anything on your side.

@cizhaoyang
Copy link

cizhaoyang commented Jul 28, 2020

This problem still exists. How can i solve this problem when shooting video horizontally in ios, the camera version is 0.5.8+2

@AlexeyRottCr
Copy link

AlexeyRottCr commented Sep 18, 2020

Problem still exists! Please, fix it

shangyilim added a commit to shangyilim/plugins that referenced this pull request Oct 22, 2020
shangyilim added a commit to shangyilim/plugins that referenced this pull request Oct 22, 2020
@kuyazee
Copy link

kuyazee commented Oct 28, 2020

Currently using the ff

  • camera: 0.5.8+11
  • video_player: 0.10.12+5

Issue still persists

shay127 added a commit to shay127/flutter_better_camera that referenced this pull request Nov 3, 2020
@yurijdvornyk
Copy link

yurijdvornyk commented Dec 10, 2020

I'm having the same issue with recording video in landscape mode.
Looks like this fix could be a solution.
@bparrishMines, when do you expect to review it?

@quentinleguennec, there are also several conflicts here that need to be resolved.

@bparrishMines
Copy link
Contributor

@yurijdvornyk We currently have a separate team working on updating and improving the camera plugin. This requires many structural changes and implementing the federated plugin model. Due to this, it may be better to close this PR and create a new one from the improved implementation of the plugin. However, I still can't give an estimate on when the bug will be worked on.

@mvanbeusekom
Copy link
Contributor

@quentinleguennec, @yurijdvornyk, we have reimplemented this pull request (a long with some other orientation issues related to Android and iOS) as part of #3390. These also adhere to the new structural changes mentioned by @bparrishMines.

I will therefore be closing this pull request in favour of tracking progress in #3390.

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

Successfully merging this pull request may close these issues.

10 participants