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/#
Related
I hope you are doing well!
I am working on an eLearning website and came across the topic of the video loading. Since videos are of various sizes, it would be impossible to make the user wait for the entire download of the video for them to start watching, so it must be taken as a stream where the video keeps loading content as the user watches (similar to YouTube I guess). However, I am failing to find how this works? I've been recommended the use of SCORM and xAPI to help with this but I am only finding help on how to upload SCORM files or how to write xAPI code and not how to set them up in our website.
How can we make our videos download as the User watches? Are SCORM and xAPI actually what we should be looking for?
For context, we will be using React JS for our Frontend and will be saving the videos on a server.
I would greatly appreciate any advice you have and thank you for your time!
We tried using xAPI and SCORM however we aren't understanding how they might help
SCORM and xAPI by themselves are not going to assist you with this in general. To stream video via an eLearning course you will need to use a video player (such as the HTML5 video player or video.js) that understands streaming video protocols and to encode the video files in a format supported by that player. I would suggest reading about HLS for instance, though I didn't read the entire page, this is a good place to start: https://www.dacast.com/blog/hls-streaming-protocol/
A traditional eLearning course, such as you would have with SCORM, is going to provide a reasonable way to wrap the playing of video such that it can be launched for a learner via an LMS and may capture data such as completion. xAPI is probably suggested because it provides a more robust way of enabling the capture of interaction data such as when the learner plays, pauses, or seeks in a video. My preferred approach for doing this is to leverage cmi5, and there is an example of xAPI video profile usage within a cmi5 course in the Project CATAPULT sample content, see https://github.com/adlnet/CATAPULT/tree/main/course_examples. It could be adapted to leverage something like HLS and get streaming capability. Confirm with your LMS of choice ahead of time whether it supports cmi5 as adoption is still lower than for SCORM.
SCORM Cloud (a bit of a misnomer, https://cloud.scorm.com/) provides builtin video handling via the cmi5 mechanism and will soon support video streaming beyond just from YouTube without the need to author a course separately.
So this will sound like a stupid question, but I notice that video from youtube works on pretty much all browsers without any setup work. However, use a security DVR or a IP camera, and suddenly you need a custom applet that is OS specific added to run it. Why does youtube just work everywhere? Because all the browser makers set it up by default? If the youtube video presentation method is so universal, why does not every video device use the same method/plugin as youtube?
Thanks.
YouTube doesn't "just" work everywhere. They have hundreds of engineers working to keep it working everywhere. They have several copies of each video that work on a sub set of platforms, and spend a lot of time making sure each platform works and continues to work.
I am building a web application where I will have multiple videos. But besides that there are also plenty of other things I want to be able to do, like click on video and save a video tag, then it will show up next time for other users who see the video (like youtube). Or pause the video, get the time where it is paused and then add a comment to it and save the time and the comment on my database.
Is it possible to do with just ruby on rails or do I need to use api or use other stuff? I will also want to do a bit more complex video manipulations but for now this ones are enough.
I am citing an example for the general HTML5 video tag, which supports few of the popular video formats. But this will be applicable across other popular video players like flowplayer as well
Have a look at link
You can send an ajax at every button(play/pause) press to your controller, which will save the details of the time at the which video was paused, so you can record that in your database. This link will give you an example of most of the properties, that you can play with :)
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.
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.