NVIDIA / VideoProcessingFramework

Set of Python bindings to C++ libraries which provides full HW acceleration for video decoding, encoding and GPU-accelerated color space and pixel format conversions
Apache License 2.0
1.31k stars 233 forks source link

How to extract the same number of frames as with ffmpeg #555

Open darkAlert opened 10 months ago

darkAlert commented 10 months ago

For ffmpeg I use a simple command: ffmpeg -i input.mp4 -qscale:v 2 %6d.jpeg

I initialize the VPF decoder like this: decoder = nvc.PyNvDecoder(video_path, gpu_id)

I check the number of frames like this: decoder.Numframes()

I have some h264 encoded videos at 30fps. And I get a different number of frames (sometimes more with ffmpeg, sometimes with VPF).

For me this is critical. Because I have annotated data extracted using ffmpeg and I want to test a model using VPF but can't compare the results frame by frame.

RomanArzumanyan commented 8 months ago

Hi @darkAlert

Apologies for big delay in response. Please consider checking out https://github.com/RomanArzumanyan/VALI repository. It's a VPF spin-off which is actively developed and maintained. It has compatible API and package naming.

Just clone your issue there. Thanks!