Hi Garramuno,
Thank you very much for reply. Point comes as int_64 in videostream timebase (always non zero for non zero frameno). I used Avseek_flag_backwards but it will not seek non keyframes rather seek to backwards perfect keyframe. With frame->pts and point value I can skip some frames till I go to Point non keyframe. But incase of any wmv video frame->pts is always 0. (Frame - frame received after decoding) On Tue 31 Jul, 2018, 10:28 PM Gonzalo Garramuño, <[email protected]> wrote: > > > 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 > > > > int frmaeno = 100; > > int64_t point = (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 > >
_______________________________________________ Libav-user mailing list [email protected] http://ffmpeg.org/mailman/listinfo/libav-user
