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.32k stars 233 forks source link

How to encode a video without VFR (Variable Frame Rate)? #439

Open InkosiZhong opened 1 year ago

InkosiZhong commented 1 year ago

When I try to use nvc.SeekContext(seek_frame=frame_idx, seek_criteria=nvc.SeekCriteria.BY_NUMBER) to get a frame from a video encoded by VPF, I get this error:

Can't seek by frame number in VFR sequences. Seek by timestamp instead.

When I use ffmpeg -i out/test.mp4 -vf vfrdet -f null - to get the video info, I find VPF encode the video with Variable Frame Rate .

[Parsed_vfrdet_0 @ 0x56413af00e40] VFR:0.793103 (23/6) min: 39999 max: 40000)

So, how can I encode a video without VFR (Variable Frame Rate)?