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.
Related
Youtube has an option to change the playback speed of videos that speeds up or slows down a video's audio without affecting its pitch. I know that there are a number of different algorithms that can do this, but I am curious as to which specific algorithm Youtube uses because it seems to work rather well.
Also, are there any open source libraries implementing this algorithm?
I found this article on the subject dating back to 2017, I presume it's still valid or should give you some pointers: https://www.googblogs.com/variable-speed-playback-on-mobile/
It reads, in part:
"On Android, we used the Sonic library for our audio manipulation in ExoPlayer. Sonic uses PICOLA, a time domain based algorithm. On iOS, AVplayer has a built in playback rate feature with configurable time stretching."
I have a Roku app and some of the videos come from Youtube. I have no problem retrieving the videos but if I select a video with HD it wants to automatically stream the Dash version. I can prevent Dash if I force a non HD version but who wants to watch a SD version..
SO I am wondering is there any way to force the mp4 stream opposed to a Dash stream?
I have read that XP does not play Dash and so I tried using Windows NT 5.1 as the user-agent but that did not work.
Any help would be greatly appreciated.
DASH and MP4 are not mutually exclusive - they perform different functions in the video delivery.
In simple terms you can view it like this:
Camera captures frames - 'raw video'
The 'raw video' is encoded in some way to store it, generally in a way that balances video size vs the quality. The video is then sometimes refereed to by the encoder used (the codec) - for example if a h.264 codec is used the video may be called a h.264 video.
The video stream, i.e. all the individual frames that make up the video, is packaged into a container. This container may contain video and audio streams, and it may even have multiple video streams. The video is then often referred to by the container format - for example if our h.264 encoded video above is packaged into an MP4 container it is often referred to as an MP4 video, even though the MP4 'container' may contain several video and audio tracks.
To improve the quality of video streaming, a video may also use a streaming protocol like MPEG DASH. The theory here is simple: multiple copies of the video are created with different bit rates, and hence different size and quality. Each of these copies is broken up into, for example, 10 second chunks. An index file is created, called a manifest, and a pointer to each video and audio stream is included. A client playing the video, for example a browser, requests each 10 second chunk as it needs it. It chooses which copy of the video it selects the next chunk from depending on the current network conditions. This means if the network is good it can switch to higher quality copy for the next chunk and if there is a problem it can switch down to a lower quality chunk. If we take our example video encoded by h.264 and put into a MP4 container, we can now package it using DASH streaming format. A video packaged like this is often referred to as a DASH video.
The above is a simplified overview, but it hopefully highlights that your videos may be actually MP4 and DASH, and in fact commonly are.
As an additional note, different devices may support different codecs (and even codec profiles), packaging formats and streaming formats - for example iOS devices tend to support HLS rather than DASH at the time of writing. This changes frequently as devices and standards evolve and is one of the reasons it can be tricky to find a single format that will play on all devices and clients - for this reason servers often will provide the same video in multiple codec and streaming formats to support as many devices and clients as possible.
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
Is there any way to tell when a video has been fully encoded at its highest definition via the API?
As far as I can tell, the YouTube API provides the 'state' of a video (processing, restricted, deleted, rejected and failed). However, I can't tell if the API also provides the encoding qualities of the video (240p, 360p, 720i, etc...).
Does anyone know how to get this information?
Taken directly from the docs:
player.getPlaybackQuality():String
This function retrieves the actual video quality of the current video. It returns undefined if there is no current video. Possible return values are highres, hd1080, hd720, large, medium and small.
I'm writing a Boxee app that makes use of YouTube videos and I want to be able to display the highest quality version available. I was looking through the YouTube API, but I can't seem to find a way to detect if 720p and/or 1080p versions of the video are available.
Does anyone know how to do this? I'm already using their Data API to collection information about the video, but there doesn't seem to be anything in the payload about different qualities consumable on the web: http://gdata.youtube.com/feeds/api/videos/NWHfY_lvKIQ
I could just hard code fmt=22 and let it default to a lesser quality version, but then I miss out on 1080p (fmt=387).
The information isn't available through the API, but can be queried and changed via JavaScript after the page has loaded (if you embed a video for example).
http://groups.google.com/group/youtube-api-gdata/browse_thread/thread/da4344cc66959ecc