我必須創建一個視頻庫,用戶將在其中上傳閃爍視頻鏈接。我需要視頻縮略圖。我如何使用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