我必须创建一个视频库,用户将在其中上传闪烁视频链接。我需要视频缩略图。我如何使用JavaScript/PHP做到这一点?提取闪烁视频缩略图
1
A
回答
2
假设你需要这个视频http://www.flickr.com/photos/mariareyesmcdavis/3478595161/
制作的缩略图下使用PHP卷曲的HTTP请求。
http://www.flickr.com/services/oembed/?url={flicker video url}&format=json
http://www.flickr.com/services/oembed/?url=http%3A//www.flickr.com/photos/mariareyesmcdavis/3478595161/&format=json
你将从闪烁的JSON响应
{
"type":"video",
"title":"Wordpress Blog Design and Social Marketing Project",
"author_name":"Maria Reyes-McDavis",
"author_url":"http:\/\/www.flickr.com\/photos\/mariareyesmcdavis\/",
"width":500,"height":375,
"web_page":"http:\/\/www.flickr.com\/photos\/mariareyesmcdavis\/3478595161\/",
"thumbnail_url":"http:\/\/farm4.staticflickr.com\/3570\/3478595161_7c2845616e_m.jpg",
"thumbnail_width":"240",
"thumbnail_height":"180",
"web_page_short_url":"http:\/\/flic.kr\/p\/6ioH9D",
"html":"<object type=\"application\/x-shockwave-flash\" width=\"500\" height=\"375\" data=\"http:\/\/www.flickr.com\/apps\/video\/stewart.swf?v=109786\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"> <param name=\"flashvars\" value=\"intl_lang=en-us&photo_secret=7c2845616e&photo_id=3478595161&flickr_show_info_box=true\"><\/param> <param name=\"movie\" value=\"http:\/\/www.flickr.com\/apps\/video\/stewart.swf?v=109786\"><\/param> <param name=\"bgcolor\" value=\"#000000\"><\/param> <param name=\"allowFullScreen\" value=\"true\"><\/param><embed type=\"application\/x-shockwave-flash\" src=\"http:\/\/www.flickr.com\/apps\/video\/stewart.swf?v=109786\" bgcolor=\"#000000\" allowfullscreen=\"true\" flashvars=\"intl_lang=en-us&photo_secret=7c2845616e&photo_id=3478595161&flickr_show_info_box=true\" height=\"375\" width=\"500\"><\/embed><\/object>",
"license":"Attribution-ShareAlike License",
"license_url":"http:\/\/creativecommons.org\/licenses\/by-sa\/2.0\/",
"license_id":"5","version":"1.0",
"cache_age":3600,
"provider_name":"Flickr",
"provider_url":"http:\/\/www.flickr.com\/"
}
现在从响应来自Flickr的嵌入代码抢 “thumbnail_url”
0
提取照片的身份证件 & 照片秘密(你已经很清楚)
然后,按照它:
$hash = unserialize(file_get_contents("http://api.flickr.com/services/rest/?method=flickr.photos.getInfo&api_key=7bcd4d0a48fc6fe0e86ec660f95541a9&photo_id=$flickr_photo_id&secret=$flickr_photo_secret&format=php_serial"));
$video_url = $hash['photo']['urls']['url'][0]['_content'];
$hash2 = unserialize(file_get_contents("http://www.flickr.com/services/oembed/?url=$video_url&format=php_serial"));
return $hash2['thumbnail_url'];
相关问题
- 1. FFmpeg的视频缩略图帧提取
- 2. DirectX闪烁视频
- 3. 视频缩略图
- 4. 试图获取视频缩略图
- 5. 通过视频闪烁WPF图像
- 6. MPMoviePlayerController交换视频闪烁
- 7. 视频嵌入闪烁
- 8. 使用FFMPEG从视频提取更快的缩略图/图像?
- 9. 从视频中提取缩略图图像 - jQuery插件?
- 10. 获取iPhone视频缩略图
- 11. 从vimeo获取视频缩略图
- 12. 使用AForge.Video.FFMPEG.dll抓取视频缩略图
- 13. 如何获取视频缩略图?
- 14. 获取屏幕视频缩略图url
- 15. 获取网络视频的缩略图
- 16. 获取缩略图的视频快照
- 17. 从视频网址获取视频的缩略图图像
- 18. 缩略图视频C#
- 19. Carrierwave视频缩略图
- 20. Brightcove视频缩略图
- 21. 安卓视频缩略图
- 22. 视频的缩略图
- 23. Silverlight视频的缩略图
- 24. Android:视频缩略图
- 25. 使用Qt/C++从视频中提取缩略图
- 26. 使用亚马逊s3上传视频和提取缩略图
- 27. 从TED嵌入代码中提取视频缩略图
- 28. 从线程中的视频url中提取缩略图
- 29. App Engine Java - 从mp4视频中提取缩略图
- 30. UIImagePickerController从视频库中选取的视频缩略图
是的,它的工作原理。谢谢! – Arif