bbc / VideoContext

An experimental HTML5 & WebGL video composition and rendering API.
http://bbc.github.io/VideoContext/
Apache License 2.0
1.32k stars 156 forks source link

Vertical video #195

Open pietrop opened 4 years ago

pietrop commented 4 years ago

👋Hello, Can VideoContext handle vertical video (eg from a phone)? I did a test and it seemed to stretch it side to side...

yakca commented 4 years ago

Hi @pietrop

Running a test locally with a phone recording does suggest we aren't using the rotation metadata which confirms your results.

Looking back at previous issues - https://github.com/bbc/VideoContext/issues/155 - the challenge is that we don't have access to the rotation metadata within JavaScript.

I'd certainly welcome a pull request/contribution if you find a sensible approach or workaround that we can document. Otherwise, this is something I'll note as TODO.

emettely commented 4 years ago

Hey @bevand10, do you have any thoughts on this? :)

pietrop commented 4 years ago

Thanks @yakca, It seems like with ffprobe and exiftool it might be possible to get the rotation ("server side" in node) - "Inspect Video Orientation using Node & fluent-ffmpeg, ExifTool, or MediaInfo"

So was wondering, could there be an optional attribute in the segments of the sequence/playlist/edl eg 'rotation'? And if that's present VideoContext behaves accordingly?

pietrop commented 4 years ago

Also I remember @chrisbaume a while back mentioned using mediainfo lib github.com/buzz/mediainfo.js(demo mediainfo.js.org) and that seems to return a rotation attribute 😮

Screen Shot 2020-03-18 at 11 43 52 AM
yakca commented 4 years ago

mediainfo looks promising, looks the native transpile is the key there.

pietrop commented 4 years ago

ok, just to get an overview, do you know once figured out that first part of getting the rotation metadata info, what else would need to be changed(and where, in the code) for VideoContext to take it into account when showing a clip?

pietrop commented 4 years ago

Also was just looking that, canvas.rotate and canvas.transform might come in handy unless you already have some other way in mind?

yakca commented 4 years ago

Hi @pietrop - sorry for the delay. It will be a month or two before I can personally look at adding this as a feature. The canvas transformation may be useful but it isn't an area I'm familiar with in VC yet. We are in something of a transition phase between maintainers; it is now @emettely and myself and we are both relatively new to the project.

If you get something working, we'd certainly be happy to look at a pull request!