How I can get the first Frame in Youtube video as Image ?
or I have to use external too to help me to do this task?
thanks
To get first frame image from video you can upload the video on this URL (ezgif.com) and get image sequence preferably by generating image sequence between 0 to 1 second.
On the Selection and media controls toolbar, click the Extract Frames button and select Extract Current Frame. In the Extract Current Frame dialog box, select a folder in which to save your file. In the File name field, type a filename. Click the Save as type drop-down list and select a file format.
For instance, if the video link is http://www.youtube.com/watch?v=JJrNopvzCy8
Extract the value of v
and use it to download the the image..
Like:
http://img.youtube.com/vi/JJrNopvzCy8/0.jpg
I hope this will solve your problem,
Just be careful with the ?v=xxxxxxxx
code
Note: For different frames, you may change the Number from 0.jpg to 1.jpg or more to fetch next frames of video in-case first starting frame of video is not required!
The Image will be by Default first frame of Video Size, so specify the image size in img tag, OR if sepcific size is must then use this YouTube Dev. API
Specific section in API link Thumbnails Section
OR we can try following example:
Video: https://www.youtube.com/watch?v=JJrNopvzCy8
Default Thumb: http://i.ytimg.com/vi/JJrNopvzCy8/default.jpg
MaxRes Thumb: http://i.ytimg.com/vi/JJrNopvzCy8/maxresdefault.jpg
HQ Thumb: http://i.ytimg.com/vi/JJrNopvzCy8/hqdefault.jpg
MQ Thumb: http://i.ytimg.com/vi/JJrNopvzCy8/mqdefault.jpg
SD Thumb: http://i.ytimg.com/vi/JJrNopvzCy8/sddefault.jpg
Note: Some of the sizes will vary (OR may not be available as that follows resolutions available for the Video link)
Edit: For First Frame use this: http://img.youtube.com/vi/JJrNopvzCy8/0.jpg
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