Help: Get video thumbnails without seek

This forum is about all development around libVLC.
jichi
New Cone
New Cone
Posts: 3
Joined: 30 Jun 2011 09:58

Help: Get video thumbnails without seek

Postby jichi » 29 May 2012 10:28

Hi,

I am using libvlc/libvlccore to build a player in C++. I want to add a function to be able to popup thumbnails of the video after the user hovers over the position slider.
In order to do that, I think I need some APIs from libvlc in order to get the thumbnail of a given time into memory without seeking.

I know libvlc_video_take_snapshot could take a thumbnail at the current time. But I will have to seek to the hovered time to get the thumbnail, which is not feasible while playing the same video.
I also looked into the source code of vlc, it seems that libvlc_video_take_snapshot will set up a timer/trigger in the current frame buffer, and then the next frame coming to that buffer will be saved on to the disk as image file. In order to get the frame into that buffer, seeking is still required. I wonder is there some other way to get thumbnails without seeking.

I know ffmpeg could achieve this. However, as I am using libvlc to play remote media stream rather than local file, I think it could involve so much work to add ffmpeg just for thumbnails. I really hope to solve this within vlc. Any suggestions are appreciated.

Thanks!

Rémi Denis-Courmont
Developer
Developer
Posts: 15135
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Help: Get video thumbnails without seek

Postby Rémi Denis-Courmont » 29 May 2012 10:40

I don't think ffmpeg can achieve this directly. Thing is, there is really no efficient and generic way to do this. I mean, there is no computationally efficient way to a specific frame from its time code.

I could be wrong, I believe YouTube precomputes the snapshots on the server side when the video is uploaded. Note how you only get a few snapshots at regular interval when hovering...
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

jichi
New Cone
New Cone
Posts: 3
Joined: 30 Jun 2011 09:58

Re: Help: Get video thumbnails without seek

Postby jichi » 29 May 2012 10:55

Precomputing does make sense. Thanks for your quick reply!


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 7 guests