Download first frame of video android programmatically

删除回忆录丶 提交于 2020-01-01 07:03:33

问题


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



来源:https://stackoverflow.com/questions/11046422/download-first-frame-of-video-android-programmatically

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!