[Libav-user] AV_SEEK_FRAME failing for compressed formats like .wmv .mp4
ganesh mundhe
ganeshmundhe007 at gmail.com
Thu Aug 2 08:10:19 EEST 2018
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, <ggarra13 at gmail.com> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20180802/4985723e/attachment.html>
More information about the Libav-user
mailing list