5

I have a YouTube video length is 5 min, how i get 10 seconds video frame total count number? Video frame will count starting from 0 to 10 second.

Edit - Is there are any Code for download YouTube video for first 10 seconds only?

Please write your answer.

Developer
  • 2,676
  • 8
  • 43
  • 65
  • 1
    Hmm I started to flag as duplicate of http://stackoverflow.com/questions/2068344/how-to-get-thumbnail-of-youtube-video-link-using-youtube-api but I was wrong, apologies. I don't believe you can get a thumbnail of an arbitrary point in time without downloading the video and extracting it yourself. consider using [ffmpeg](http://ffmpeg-php.sourceforge.net/) to get the frame as shown [here](http://stackoverflow.com/a/4415141/156755) – Basic Oct 10 '13 at 06:13
  • What about HTML5 video? Surely the existence of post-processing libraries written in JavaScript indicate that this is at least possible: http://www.barbafan.de/html5video?video=tron – David-SkyMesh Oct 10 '13 at 06:17
  • @Basic http://stackoverflow.com/questions/2068344/how-to-get-thumbnail-of-youtube-video-link-using-youtube-api This link shows thumbnail images but my question is how can i get frame that **how many frame created between the 0 to 10 seconds** – Developer Oct 10 '13 at 06:52
  • Sorry, we still don't understand your question. Do you want to [1] *count* frames present in the first 10 seconds of the video, or do you wish to [2] *show* a particular frame (say 10 seconds from the start) of the video? or [3] something else? – David-SkyMesh Oct 10 '13 at 07:48
  • [1] count frames present in the first 10 seconds of the video – Developer Oct 10 '13 at 08:47
  • I said I was wrong, that wasn't a duplicate... @David-SkyMesh it's not possible to post-process a video in any language unless you have the video... So the choices are either A) info exposed by youtube api (I don't think so) or B) get the video and use _something_ to process it. ffmpeg seems like a very commonly used way of manipulating/querying videos so should be appropriate. Since the OP needs to count frames, it might be a case of using ffmpeg to extract frame rate and multiplying by 10. It depends how much accuracy is required. If that's not good enough, OP may need to extract frames – Basic Oct 10 '13 at 11:12
  • @Basic, the post-processing suggesting referred to option [2] of my subsequent comment (and that's extremely possible - folks are doing this in Youtube UserScripts right now). – David-SkyMesh Oct 10 '13 at 11:27
  • Hi i got video duration, frame, frame rate from all video url by using ffmpeg, but problem is i am unable to get details from youtube url. please check http://www.mediacollege.com/video-gallery/testclips/barsandtone.flv `getDuration: 5.9999999848515 getFrameCount: 6000 getFrameRate: 1000` – Developer Oct 10 '13 at 11:33
  • 1
    @David-SkyMesh I think we must be talking at cross purposes. If it's ina userscript, it's been downloaded. It's also using the browser's video handling implementation which isn't available in PHP (server-side) – Basic Oct 10 '13 at 12:07
  • Please check http://www.gif-king.com/ffmpeg.php I got video details from http://www.mediacollege.com/video-gallery/testclips/barsandtone.flv Please help me how to get details from youtube like http://www.gif-king.com/ffmpeg.php – Developer Oct 10 '13 at 12:58
  • Someone post your answer. :( – Developer Dec 04 '13 at 13:48

0 Answers0