Hi all,

I'm totally new to ffmpeg-lib so bare with me.

I'm working on a project to extract x frames from a video, from start to
end, and save them as an jpeg. I've been using
"pFormatCtx->streams[videoStream]->duration" to get the total length of the
video.
Now to my question, what is the best way to seek in a video file?

I've been using the "av_seek_frame" but it only seems to be seeking to the
nearest keyframe. I don't need the seek to be super accurate, but close.
Is it possible to seek by a timecode instead?

Best regards

Hi,

> I'm totally new to ffmpeg-lib so bare with me.
so I'm about one step ahead ;)

I do this:

int64_t targetPos = (int64_t)(fSearch * AV_TIME_BASE);
av_seek_frame(m_pFormatCtx, -1, targetPos, AVSEEK_FLAG_BACKWARD);

with fSearch in seconds and it works fine.

Regards,

Thomas
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to