Help: Get video thumbnails without seek
Posted: 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!
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!