My parameters are as follows:
(AVCodecContext*) pCodecContext->pix_fmt = AV_PIX_FMT_YUV420P;
AV_PIX_FMT_YUV420P is the default parameter when code_id is AV_CODEC_ID_HEVC 
and it is one of raw format. So I think the order of frame I get from 
"avcodec_receive_frame(pCodecContext, pFrame);" is PTS and when I try to 
display the frame recieved, it can display properly. But its frame->pts is 
still not incremental.
I tried to set the pix_fmt to AV_PIX_FMT_NV12, but it doesn't work. The pix_fmt 
still change back to AV_PIX_FMT_YUV420P.
Do I set the wrong pix_fmt so that the it doesn't decode to the specific raw 
format?

Thank you for for your last answer,
Carl

________________________________
发件人: Libav-user <[email protected]> 代表 KIM via Libav-user 
<[email protected]>
发送时间: 2023年10月23日 13:02
收件人: This list is about using libavcodec, libavformat, libavutil, libavdevice 
and libavfilter. <[email protected]>
抄送: KIM <[email protected]>
主题: Re: [Libav-user] frame->pts out-of-order when decode hevc

> hello, everyone. this is my first time to use mail list.
Hi! This is my first reply instead.

> the set of pkt->pts is 0,1,2,3,4,5...
> bus the frame->pts received is 0,1,4,5,3,6,2 where the pict_type is I, I, B, 
> B, B, B, P...
> why the frame->pts is not 0,1,2,3,4,5…
PTS (presentation time stamp) tells you the order at which frames should be 
presented, which is not always the same as the order at which frames should be 
decoded! That’s the DTS field (decoding time stamp). After decoding to some raw 
format, you’ll see that PTS are sorted as you expect.

Basically what you’re seeing is the way it is supposed to be! I hope it 
clarifies your doubt.

Cheers,
dmorn


> _______________________________________________
> Libav-user mailing list
> [email protected]
> https://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fffmpeg.org%2Fmailman%2Flistinfo%2Flibav-user&data=05%7C01%7C%7C91facdfa6525428daea808dbd3c869ab%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638336629966421037%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=AObH0aA5PTGBVj1hiO4GirMtfx%2BWCxaHn3c0%2F2tvNVI%3D&reserved=0<https://ffmpeg.org/mailman/listinfo/libav-user>
>
> To unsubscribe, visit link above, or email
> [email protected] with subject "unsubscribe".




_______________________________________________
Libav-user mailing list
[email protected]
https://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fffmpeg.org%2Fmailman%2Flistinfo%2Flibav-user&data=05%7C01%7C%7C91facdfa6525428daea808dbd3c869ab%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638336629966577310%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=NNI5o8%2F0eezh8famHxIOCKbfLzat6TqHeomsm3LuG%2F0%3D&reserved=0<https://ffmpeg.org/mailman/listinfo/libav-user>

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".
_______________________________________________
Libav-user mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/libav-user

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

Reply via email to