Get thumbnail image of video from video url

后端 未结 8 1688
时光取名叫无心
时光取名叫无心 2021-01-04 19:30

Is it possible to get the thumbnail image from a video Url? I need to thumbnails of videos in a list view.

8条回答
  •  温柔的废话
    2021-01-04 20:25

    It is possible to get a thumbnail from a video file or url using FFMPEG.

    FFMPEG must be built using the NDK (or you can find some Android built FFMPEG binaries). Here is a GitHub project to build FFMPEG:

    https://github.com/guardianproject/android-ffmpeg

    You can then include the FFMPEG binaries with your app and execute FFMPEG from code in your app to generate an image from the video (local or URL) using a command like:

    ffmpeg -i videosite.com/video.flv -ss 00:00:15.000 -vframes 1 thumbnail_out.png
    

    One thing to consider is at what seek time (option -ss) you grab the thumbnail for it to be a meaningful image that represents the video.

提交回复
热议问题