google / spatial-media

Specifications and tools for 360º video and spatial audio.
Other
1.86k stars 429 forks source link

How do I change CroppedArea by using the command? #96

Closed tomtomtong closed 8 years ago

tomtomtong commented 8 years ago

Hello. I would like to insert metadata into a panorama video. How do I change the croppedArea by using the command? Thank for any help.

suderman-google commented 8 years ago

Hey tomtomtong,

The command line utility has a --crop flag you can use. You can use it as follows

python spatialmedia --inject --crop a:b:c:d:e:f input.mp4 output.mp4

The crop values are integers measuring the crop in pixels. Each value is as follows a - CroppedAreaImageWidthPixels b - CroppedAreaImageHeightPixels c - FullPanoWidthPixels d - FullPanoHeightPixels e - CroppedAreaLeftPixels f - CroppedAreaTopPixels

So assuming you had a 1024 by 256 image that was 360 degrees by 90 degrees, the values would be as follows:

python spatialmedia --inject --crop 1024:256:1024:512:0:128 input.mp4 output.mp4

As an aside: if you intend to use the file with YouTube, the platform does not support cropping metadata at this point in time. Hope this was helpful and please follow up if you have trouble.

BrianLeishman commented 1 year ago

Has support from YouTube changed at all regarding adjusting the crop amount?