Re: When Seeking to specific frame with AVSEEK_FLAG_BACKWARD, libav will seek to exact specified frame

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: When Seeking to specific frame with AVSEEK_FLAG_BACKWARD, libav will seek to exact specified frame

Odiee47 .

 

After some more digging I found out that my videos in question have incorrect starting AVFrame.pkt_dts coded

and start at around 0.5 seconds. Which explains my 13 frame discrepancy when calculating current_frame.

 

I now have a frame_offset that I calculate if I detect this discrepancy with

frame_offset = (pFrame->pkt_dts/pFrame->pkt_duration);

 

But is this really the best way to do that?

 

And event with corrected frames, my

av_seek_frame(ptrFormatCtx_, -1, seekTarget, AVSEEK_FLAG_FRAME  | AVSEEK_FLAG_BACKWARD);

 

still won’t seek to first I-Frame backward. Is this because of incorrect pkt_dts that start well into a file?

And also what do I generally do when this happens?


_______________________________________________
Libav-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: When Seeking to specific frame with AVSEEK_FLAG_BACKWARD, libav will seek to exact specified frame

dario.maljur

Answering my own message the second time because Win10 default mail client cut off my text.

 

After some more digging I found out that my videos in question have incorrect starting AVFrame.pkt_dts coded

and start at around 0.5 seconds. Which explains my 13 frame discrepancy when calculating current_frame.

 

I now have a frame_offset that I calculate if I detect this discrepancy with

frame_offset = (pFrame->pkt_dts/pFrame->pkt_duration);

 

But is this really the best way to do that?

 

And event with corrected frames, my

av_seek_frame(ptrFormatCtx_, -1, seekTarget, AVSEEK_FLAG_FRAME  | AVSEEK_FLAG_BACKWARD);

 

still won’t seek to first I-Frame backward. Is this because of incorrect pkt_dts that start well into a file?

And also what do I generally do when this happens?

 


_______________________________________________
Libav-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".