RomanArzumanyan / VALI

Video processing in Python
Apache License 2.0
33 stars 4 forks source link

packet dts, pos, bsl #74

Closed Yves33 closed 2 weeks ago

Yves33 commented 1 month ago

Hi again... keep reporting issues, although they may not impact my programs...

in sample_decode_show.ipynb

RomanArzumanyan commented 1 month ago

Hi @Yves33

The PacketData structure is filled out here: https://github.com/RomanArzumanyan/VALI/blob/e5529dbcdc6c3d12605d8b6013a2684eccadf170/src/TC/src/TaskDecodeFrame.cpp#L396-L402

With v.3.2.10 key frame is now updated to either 0 or 1 which looks logical.

WRT other fields:

Can you check with SW decoder ?

evergreennha commented 1 month ago

Timestamp pts seems to be not working properly Screenshot from 2024-07-24 18-09-22 Here is my video https://drive.google.com/drive/folders/1vtxiQiViG4O54wyaGeIOsoMKQzAefirx?usp=sharing Have you used ffmpeg to get timestamp for PacketData.pts ?

RomanArzumanyan commented 1 month ago

Hi @Yves33

Have you used ffmpeg to get timestamp for PacketData.pts ?

Yes I do. As you can see from my code sample above, PacketData.pts is copied directly from m_frame->pts which is FFMpeg AVFrame.

Here is my video

Thanks, I'll repro on my machine a bit later.

Yves33 commented 1 month ago

In notebook sample_decode_show.ipynb, pyDecoder.Duration() reports wrong values

RomanArzumanyan commented 1 month ago

@Yves33

In notebook sample_decode_show.ipynb, pyDecoder.Duration() reports wrong values

This alone isn't very helpful. What's the correct value in your opinion ?

RomanArzumanyan commented 2 weeks ago

Hi @Yves33 and @evergreennha

It looks like these values you see are put there by decoder: https://github.com/FFmpeg/FFmpeg/blob/b730defd52ad96dbdd6ac49a6f18f3c4c5f17008/libavcodec/cuviddec.c#L661-L667

        /* CUVIDs opaque reordering breaks the internal pkt logic.
         * So set pkt_pts and clear all the other pkt_ fields.
         */
        frame->duration = 0;
#if FF_API_FRAME_PKT
FF_DISABLE_DEPRECATION_WARNINGS
        frame->pkt_pos = -1;
        frame->pkt_size = -1;
FF_ENABLE_DEPRECATION_WARNINGS
#endif

So unless something changes in FFMpeg, this behavior will persist.