BabylonJS / Extensions

Extensions for Babylon.js
175 stars 156 forks source link

Amp360Video - how to check if video is 360 or non-360 #158

Closed itorian closed 5 years ago

itorian commented 5 years ago

This plugin applies to all azure media service videos, so non-360 videos started looking horrible. We need to deliver 360 as well as non-360 videos, so how do I identify incoming video is 360 or non-360?

sebavan commented 5 years ago

Hello, unfortunately there is nothing the plugin can do for this. It does not have access to the video content and even reading the video frame would be highly challenging to determine wether or not the video is a 360 one.

Could you not enable the plugin only if the video you are trying to play is 360 ? the person uploading the video should be able to provide the info ?

itorian commented 5 years ago

The person uploading the video can do this too but let's learn from others, like I never told YouTube that this is a 360 video, they automatically detect it and render player to play 360 and non-360 content. I will try few more today and update here.

sebavan commented 5 years ago

I wonder if it is not rather done server side during the video processing as it sometimes takes a bit of time to be available as 360 ? Question would then be is it easily achievable fast enough in javascript ?

I am more than happy to add some simple tool to detect it if you are aware of any cause I am not sure how efficient and reliable it would be to automate in the browser on low end devices.

itorian commented 5 years ago

Just noticed Google has created a tool which takes 360 mp4 file and inject 360 related metadata to it. After that we upload this 360 video on YouTube and they recognize it and attach 360 player.

Tool: https://github.com/google/spatial-media/releases/tag/v2.0 Demo: https://www.youtube.com/watch?v=D13e5VvYUQ4

How this will fit into Amp360Video, rather than asking user about it?

sebavan commented 5 years ago

It still does not change that the user who uploaded the video made a special action to define that it is 360. so having it in the metadata is better but not ideal as it is not an official standard (agree it is probably the most frequent one).

I could easily add a way to turn on off the plugin on demand and then it would be consumer's responsibility to take the information from where they store it (metadata, server side, client side) ?

itorian commented 5 years ago

Hmm, make sense. Facebook also uses same metadata injector tool for their 360 playback, ref. https://www.youtube.com/watch?v=REJaSecXdZg

Think, this way YouTube/Facebook didn't updated their apps to ask this from user's input, but updated their service to read and understand metadata, off-course user has added that metadata.

I think this is becoming standards, so I still advocate to build/update Amp360Video plugin or azure media service or amp to read and understand that metadata. This process will not require consumer's app update to ask this from user's input, all they need is to add metadata to video if they think it is 360 or he can use existing 360 video file which he uploaded on YouTube, Facebook.

sebavan commented 5 years ago

This would be amazing if Azure Media Service was providing the metadata to the player as it would solve the biggest chunk of the issue.

Let me try to contact the team there to see if something is doable.

itorian commented 5 years ago

You can refer this feature request by me in back 2016 https://feedback.azure.com/forums/169396-azure-media-services/suggestions/11682312-360-degree-video-playback-support-on-azure-media-p

sebavan commented 5 years ago

@itorian sorry about the long wait, the team is looking into a solution I should have an answer in the new year as vacation period has started.

itorian commented 5 years ago

No problem @sebavan

sebavan commented 5 years ago

Still under discussion internally, not something I can fix on my side. Thanks again for your understanding and sorry for the huge wait.

sebavan commented 5 years ago

So I am closing the issue as it is not a client one we can develop or fix on the Babylon side. I still keep you updated in this thread if anything was moving server side. The current status is still under discussion internally in the relevant teams.

sebavan commented 5 years ago

And please stay ensured that I will integrate it in the client the day the info has been made available :-)