flutter-tizen / plugins

Flutter plugins for Tizen
65 stars 46 forks source link

[video_player] Orientation tag #80

Open bbrto21 opened 3 years ago

bbrto21 commented 3 years ago

As far as I know, each video file has orientation tag, and video player must apply the tag when playing.

While developing a camera plug-in, I created a video with an orientation tag, and played it on Android and Tizen, and found that video_payer_tizen did not use the orientation tag

xuelian-bai commented 3 years ago

we will check if there is such API to get rotation angle from MM player

xuelian-bai commented 3 years ago

Currently, video player plugin use texture method which use MMPlayer software codec(hardware codec is not supported for texture method), but software codec don't support that tag, and right now MMplayer don't provide such an API to get rotation information from metadata. To solve this issue, there are two solution:

  1. Use another video player which implemented based on video hole and plus player(to support local video file, we may need to support MMplayer). Hardware codec can support this video tag and rotate automatically, and video player don't need to do anything.
  2. MMplayer provide an API to get rotation information, so that video plugin can change geometry of the texture.
bbrto21 commented 3 years ago

but software codec don't support that tag, and right now MMplayer don't provide such an API to get rotation information from metadata.

Well, if you can read the rotation metadata from the video file, can you solve it by second way? Here I attach some information those might helpful. https://docs.tizen.org/application/native/guides/multimedia/metadata/#retrieving-metadata https://docs.tizen.org/application/native/api/wearable/4.0/group__CAPI__METADATA__EXTRACTOR__MODULE.html

  metadata_extractor_h metadata_h;
  metadata_extractor_create(&metadata_h);
  metadata_extractor_set_path(metadata_h, video_file_path);

  char *value = nullptr;
  metadata_extractor_get_metadata(metadata_h, METADATA_ROTATE, &value);
xiaowei-guan commented 3 years ago

https://github.com/xiaowei-guan/plugins/commit/7e71c7b10e464ab21b2475d4eaa576eb7b1451e5

we can get rotation value,but set to player, not effect.

bbrto21 commented 3 years ago

xiaowei-guan@7e71c7b

we can get rotation value,but set to player, not effect.

I guess that this approach only works when the player uses the display feature.

error_code = player_set_display(g_player, PLAYER_DISPLAY_TYPE_OVERLAY, GET_DISPLAY(evas_obj));