[Libav-user] AV_SEEK_FRAME failing for compressed formats like .wmv .mp4

Gonzalo Garramuño ggarra13 at gmail.com
Tue Jul 31 19:58:15 EEST 2018



El 31/07/18 a las 04:16, ganesh mundhe escribió:
>
> Hello all,
>
> I have been trying to decode videos where I need to offset start position.
>
> I have tried to use AV_seek_frame but it works on raw video format 
> (.y4m) but fails on mpeg2 compressed formats.
>
> Generally videos are in mp4 or wmv and I need to write for those 
> directly instead of converting them into .y4m
>
> Here how I’m using it
>
> intfrmaeno = 100;
>
> int64_tpoint = (int64_t(frameno) * pavStream->r_frame_rate.den * 
> pavStream->time_base.den) / (int64_t(pavStream->r_frame_rate.num) 
> *pavStream->time_base.num);
>
> av_seek_frame(fmt_ctx, VideoStreamIndex, point, 0);
>
>
Here point is always 0 as you are dividing integers.   Also, as a flag, 
you may want to use AVSEEK_FLAG_BACKWARD.

-- 
Gonzalo Garramuño

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20180731/37586906/attachment.html>


More information about the Libav-user mailing list