如何从youtube获得第一帧作为照片? [英] How I can get First Frame as Photo from youtube?
问题描述
如何将Youtube视频中的第一帧视为图像?
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?
谢谢
推荐答案
例如,如果视频链接是 http://www.youtube.com/watch?v=2Jnpizxdrf
For instance, if the video link is http://www.youtube.com/watch?v=2Jnpizxdrf
提取 v <的值/ code>并用它来下载图片..
Extract the value of v
and use it to download the the image..
赞:
http://img.youtube.com/vi/2Jnpizxdrf/0.jpg
我希望这能解决您的问题,
I hope this will solve your problem,
请注意?v = xxxxxxxx
代码
注意:对于不同的帧,您可以将数字从0.jpg更改为1.jpg或更多以获取下一帧视频,以防第一个视频的起始帧不需要!
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!
图像将默认为视频大小的第一帧,因此请在img标记中指定图像大小,如果必须包含特定大小,则使用此 YouTube Dev。 API
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
API链接中的特定部分缩略图部分
Specific section in API link Thumbnails Section
或者我们可以尝试以下示例:
OR we can try following example:
视频: https://www.youtube.com/watch?v=K6AfSckWSZA
-
默认拇指:
http://i.ytimg.com/vi/K6AfSckWSZA/default.jpg
MaxRes Thumb: http://i.ytimg.com/vi/K6AfSckWSZA/maxresdefault.jpg
MaxRes Thumb: http://i.ytimg.com/vi/K6AfSckWSZA/maxresdefault.jpg
HQ Thumb: http://i.ytimg.com/vi/K6AfSckWSZA/hqdefault.jpg
HQ Thumb: http://i.ytimg.com/vi/K6AfSckWSZA/hqdefault.jpg
MQ Thumb: http://i.ytimg.com/vi/K6AfSckWSZA/mqdefault.jpg
MQ Thumb: http://i.ytimg.com/vi/K6AfSckWSZA/mqdefault.jpg
SD Thumb: http://i.ytimg.com/vi/K6AfSckWSZA/sddefault.jpg
SD Thumb: http://i.ytimg.com/vi/K6AfSckWSZA/sddefault.jpg
注意:某些尺寸会有所不同(或者可能无法提供视频链接可用的分辨率)
Note: Some of the sizes will vary (OR may not be available as that follows resolutions available for the Video link)
这篇关于如何从youtube获得第一帧作为照片?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!