I want to download a single frame of a video file from a server from my android application. I do not wat to download the full video at front. Use that frame as a thumbnail to display to the user, so that if choosen by user it can be downloaded.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
ffmpeg
can create a thumbnail from a video stream using this command:
ffmpeg -itsoffset -4 -i http://somevideosite/test.avi -vcodec mjpeg -vframes 1\
-an -f rawvideo -s 320x240 thumb.jpg
To get ffmpeg
into android seems doable.
回答2:
It will be easier if your server provided thumbnails for each video like youtube/dailymotion does. You could create this thumbnail when video is added to the server.
Ex: http://img.youtube.com/vi/<VIDEO_ID>
/<1,2,3>
.jpg