jump to a specific frame

This forum is about all development around libVLC.
andreahmed
New Cone
New Cone
Posts: 6
Joined: 20 Mar 2012 09:55

jump to a specific frame

Postby andreahmed » 26 Mar 2012 15:17

Is it possible to jump to a specific frame ?

freesunshine
Blank Cone
Blank Cone
Posts: 32
Joined: 18 Mar 2012 13:37

Re: jump to a specific frame

Postby freesunshine » 27 Mar 2012 07:52

it is not easy especially when the frame is not a key frame. you should jump forward and decode.
unfortunately vlc do not provide such functions so you should write by yourself.

andreahmed
New Cone
New Cone
Posts: 6
Joined: 20 Mar 2012 09:55

Re: jump to a specific frame

Postby andreahmed » 27 Mar 2012 08:36

Thanks for your reply.

Is it possible to use libvlc_media_player_get_length and libvlc_media_player_get_fps to get the number of frames and then use set_pos to jump to a specific frame?

freesunshine
Blank Cone
Blank Cone
Posts: 32
Joined: 18 Mar 2012 13:37

Re: jump to a specific frame

Postby freesunshine » 27 Mar 2012 13:02

it's absolutely possible,but difficult. it depends on video format a lot.
ffmpeg provides a function seek by frame ( av_seek_frame),but i have not tried;
in vlc,you can calculate the specific frame's time stamp and set_time to the nearest key frame,then get next frame until the time stamp is the nearest to your expectation


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 21 guests