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

//When using with time
       double t = 5;//time in seconds
       int64_t timestamp = t * AV_TIME_BASE; //destination time
       AVRational r = av_make_q(1, AV_TIME_BASE);
       if (VideoStreamIndex >= 0) {
              timestamp = av_rescale_q(timestamp, r,
                     fmt_ctx->streams[VideoStreamIndex]->time_base);
       }

       av_seek_frame(fmt_ctx, VideoStreamIndex, timestamp, AVSEEK_FLAG_ANY);
or
if I know the frame no

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);




Tried with avformat_seek_file api too but still failing.
Need help here.


Thanks & Warm Regards,
Ganesh MUNDHE






















This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systemes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.

For other languages, go to http://www.3ds.com/terms/email-disclaimer
_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to