I want to get a thumbnail image for videos from Vimeo.
When getting images from Youtube I just do like this:
http://img.youtube.com/vi/HwP5NG-3e8I/2.jpg
Any idea how to do for Vimeo?
Here is same question, without any answer.
Vimeo offers a few ways to create and upload your thumbnails — making your thumbnail creation process as easy as possible. Choose an auto-generated thumbnail. After uploading your video in Vimeo, click the “Edit thumbnail” button under the Description box in the General tab.
You can take a screenshot from your video that best explains its contents, or you can use a tool like Photoshop or Canva to overlay text or icons on the image. To make a screen capture on a PC, use the Windows Snipping Tool. For Mac users, hit Command+Shift+4 to select the part of your screen you want to capture.
We recommend uploading a JPG or PNG poster that has the dimensions 1080px by 1600px. Your thumbnail should be a JPG, GIF, or PNG file that is the same resolution as your video.
From the Vimeo Simple API docs:
Making a Video Request
To get data about a specific video, use the following url:
http://vimeo.com/api/v2/video/video_id.output
video_id The ID of the video you want information for.
output Specify the output type. We currently offer JSON, PHP, and XML formats.
So getting this URL http://vimeo.com/api/v2/video/6271487.xml
<videos> <video> [skipped] <thumbnail_small>http://ts.vimeo.com.s3.amazonaws.com/235/662/23566238_100.jpg</thumbnail_small> <thumbnail_medium>http://ts.vimeo.com.s3.amazonaws.com/235/662/23566238_200.jpg</thumbnail_medium> <thumbnail_large>http://ts.vimeo.com.s3.amazonaws.com/235/662/23566238_640.jpg</thumbnail_large> [skipped] </videos>
Parse this for every video to get the thumbnail
Here's approximate code in PHP
<?php $imgid = 6271487; $hash = unserialize(file_get_contents("http://vimeo.com/api/v2/video/$imgid.php")); echo $hash[0]['thumbnail_medium'];
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