Skip to content
This repository was archived by the owner on Jun 10, 2024. It is now read-only.
This repository was archived by the owner on Jun 10, 2024. It is now read-only.

Wrong frames count with PyFfmpegDecoder #536

Closed
@Derianer

Description

@Derianer

Describe the bug
Wrong frames count with PyFfmpegDecoder, ffmpeg shows 299 frames got 297

To Reproduce

import PyNvCodec as nvc
import numpy as np

gt_num_frames = 299
decoders = [nvc.PyNvDecoder("video.mkv", 0), nvc.PyFfmpegDecoder("video.mkv", {})]
frame = np.ndarray(shape=(0), dtype=np.uint8)

def decode_all_frames(dec, num_frames):
    my_frames = 0
    while(True):
        if not dec.DecodeSingleFrame(frame):
            break
        my_frames += 1
    assert num_frames == my_frames, f"{dec.__class__.__name__} got {my_frames} should be {num_frames}"

for dec in decoders:
    decode_all_frames(dec, gt_num_frames)

video.mkv.zip

Desktop (please complete the following information):

  • OS: Linux
  • Nvidia driver version 535.104.12
  • CUDA Version 11.8
  • Python Version 3.11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions