How to use the YouTube API V3 to query only 360 videos - youtube

I have been unsuccessful in finding a way of using the YouTube API to query videos based on features. I would like to be able to search only videos that are 360 degrees. YouTube in a browser offers filters for searches as seen below.
Is there any method that allows searching based on these features or based on specific video metadata, like whether a video is sperical or not?

I've tried to look for supporting documents regarding 360 degree videos too and I only found about property contentDetails.projection in Videos with the following valid values:
360
rectangular
Currently, there still has no mention for ways on searching 360 degree videos in VideoCategories: list or in Videos: list.
Looking further, it was mentioned in Watch 360 degree videos in Cardboard to use #360Video in searching for these kind of videos if you wish to watch in YouTube. However, it's not included in any documents if we can use it in getting the list of videos.
I hope that helps. :)

Related

Pulling percentage video viewed youtube api

I'm going to create the automate API for youtube report. Is there a way to pull the number of users of each percentage (25%,50%) or second of video viewed via youtube analytics API? I use python language from link as shown below:
https://developers.google.com/youtube/analytics/v1/data_model
I found a metric name "audienceWatchRatio", but I'm not sure that's what I want or not? I tried to run the script including this metric with and without "elapsedVideoTimeRatio" dimension, and it always shows "The query is not supported."
Well, I found here in the Analytics and Reporting APIs on how to get the percentage viewed in the video. By using the averageViewPercentage you will get the average percentage of a video watched during a video playback. The only problem here is this parameter get the total percentage of the channel, not the specific or individual video.
Check this link if you want to check on how to use this parameter.
I also found a related question about your issue, but this question uses Javascript. So just check if it can help and give idea to you.
Calculate percentage of youtube video viewed with API

How to find 360° videos using Youtube Data API

I am looking for a way to find all of the 360° videos from Youtube using Youtube APIs for my research. Currently I haven't been able to find this feature from the Youtube APIs, or hack a work-around using available API functions.
Search results on Yuotube webpage can be filtered by featureto just show the 360° videos among the search results. Even replicating this functionality using available API methods would be a good starting point to my needs. Maybe this could be accomplished by using snippet's tags, but I haven't been able to make it work.
(This question is quite similar ;-) to :
Searching 360 degree videos using YouTube Data API?
. But that question remains unanswered after 8 moths, even though Google Youtube Data API support page states: "We support the YouTube Data API on Stack Overflow. Google engineers monitor and answer questions with the youtube-api, youtube-data-api, and youtube-v3-api tags." As I just came across this problem, I hope the question gets some attention.)
I have been struggling with this problem as well and have used a combination of approaches with limited results:
First, we use this method and add a publishedBefore filter for subsequent fresh searches (no pageToken) of the oldest result we have found. This enables us to get more than the 1000 results youtube apparently limits you to.
Second we found good lots of good results for the query #360Video, and we perform 2 sets of searches for that string: videoDimension: '2d' and videoDimension: '3d'. For all results, we query their contentDetails and make filter out those who's contentDetails.projection does not equal '360'. For good measure, we also do a '3d' dimension search without the query string.
Finally we combine all of the sets of results we retrieved. Unfortunately we do still seem to miss quite a few videos we spot test by hand. So far we have only been to query ~1000 videos. It seems like finding all 360 videos could require lots of manual work.
update: We have employed a manual step where we regularly scrape a list of user accounts, channels, and playlists with many 360 videos. This has yielded several hundred more videos at the least with, arguably, better quality. There might be a further step where we check all of the "recommended" videos for each of those videos and so on.
Well, I found in this thread that YouTube rolls out support for 360-degree live streams and spatial audio. And if you check the YouTube API documentation, there is no guide there that shows you how to use the 360 videos in YouTube.
So, YouTube 360 videos are not fully supported in YouTube API as of the moment. It is currently filed as a feature request that you can find here.
Hope it helps you.

Filtering 4K and 60FPS results from Youtube API and Search->List

I'm using the Youtube API v3 with a website for searching Gaming streams. For Gaming, 4K and 60FPS are critical for some users...
While the Search->List seems quite extensive, it's missing filters for 4K and 60 FPS. The only relevant option seems to be videoDefinition='high' (720p+). Also, Video->List->FileDetails information is only available to channel owners. Am I missing something? How do I filter the search to only 4K and/or 48+ FPS?
Well, I think there is no method in the YouTube API now that can filter the result base on FPS. Like you said the only way to filter the video by its quality is by using the videoDefinition but only has standard and high option.
I try to check the quality of different video by using the Videos: list method and use the contentDetails as a part to view the definition. By using this way, I only get a definition result of "hd". All the high quality videos that I try has the same result of "hd"
Here is the example request that I use to check this video
https://www.googleapis.com/youtube/v3/videos?part=contentDetails&id=6pxRHBw-k8M&key=YOUR_API_KEY

PHP get screenshot from YouTube video

I have a website that has a variety of embedded YouTube videos. When a user pauses a given video I want a screenshot to be taken of the playing video. Now, I've taken many approaches in tackling this problem such as copying the video frame to canvas (this doesn't work because the videos are external to my site), and also through the use of FFMpeg, and FFMpeg-PHP. The latter two- although very powerful- also do not work as the given piece of media has to be hosted on my server.
I'm at my wits end about what to do as I've spent countless hours trying to do this, and I'm ready to accept defeat.
Any ideas?
Regards,
Andre.
There's no supported method in the YouTube Player or Data API to take a screenshot of an arbitrary frame of a video.
I used the img.youtube.com/vi path to get the image. The function getScreen basically parses the youtube url and grabs the &v= argument to get the video id.
Since I use youtube.com/embed/ url format, then I had to rework the function a little to get the video id.
http://mistonline.in/wp/get-youtube-video-screenshot-using-simple-php-and-javascript/#

Youtube get camera type

Consider these videos:
http://www.youtube.com/watch?v=U_kZ5Lj-59E
http://www.youtube.com/watch?v=f0pdwd0miqs
The first is probably filmed with a mobile phone's camera, the second with a professional one. I would like to determine this difference.
Q: Is anybody aware of a way of retrieving information about the camera type that was used for a video on Youtube?
Q: Or, is there a more generic way for videos to determine video recording quality?
There is no way to get the camera metadata from a video on YouTube at this point. Theoretically YouTube could capture this information for some videos (and make it available in the future), but not every video file has camera metadata on it. In fact, a lot of videos use more than one camera.
Technically there are other methods of determining "recording quality", but they won't be perfect. For example, you could use the assumption that if a video is available in 1080p it might be better quality than one only available in 480p. However, there can still be a big difference in two videos both available in 1080p.
You can't rely on bitrate either, because YouTube could change the bitrate on you depending on your internet speed.
You can determine a video is available in HD, for example if you execute this query (API V3): https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.videos.list?id=L8oEtD_CEs0&part=contentDetails&_h=1&, you'll notice I've recorded it in HD ("definition": "hd"), though I did use my shaky hand and phone camera :)
For API V2 we have element described here: http://apiblog.youtube.com/2011/10/more-ways-to-find-what-youre-looking.html.

Resources