I’m trying to get the size of a YouTube video. I’m using a Gdata API call to retrieve the basic informations (title, URLs, thumbnails and categories) but I can’t find the video dimensions.
I’m embedding some videos on a website using YouTube Data API server-side calls like this: http://gdata.youtube.com/feeds/api/videos/z_AbfPXTKms?0=v&1=2&alt=json. Unfortunately, there is no reliable information on video dimensions (all the preview images are in 4/3 rate even with widescreen videos).
What I am trying to accomplish is to fit the video exactly into the player; the player width is fixed, so I just need the original dimensions or at least the proportion.
Is there any way to retrieve this kind of data with the Youtube API?
(My fallback plan is to set the player size to 4/3 and never watch back, but any help is appreciated!)
Right-click the file and click Properties. Click the Details or Summary tab. In the Details under Video, you will see the frame width and frame height, and additional important video information.
Standard YouTube videos: Aspect ratio: 16:9 only; Dimensions supported (in pixels): 426 x 240, 640 x 360, 854 x 480, 1280 x 720, 1920 x 1080, 2560 x 1440, 3840 x 2160; Size limit: 128 GB maximum (or 12 hours irrespective of size);
You can also get it thanks to the oEmbed implementation of YouTube. Example:
https://www.youtube.com/oembed?url=https://www.youtube.com/watch?v=hUvbb_eUP84&format=xml
format=json
is also accepted.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With