Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skipped frames on avi videos #306

Open
javiber opened this issue Feb 26, 2024 · 0 comments
Open

Skipped frames on avi videos #306

javiber opened this issue Feb 26, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@javiber
Copy link
Collaborator

javiber commented Feb 26, 2024

Describe the bug
Norfair seems to be skipping frames on .avi videos

To Reproduce
Using this 2 videos as examples:
https://drive.google.com/file/d/10HPhUDNDbZ7tA9309-id8d2n4BX80gZb/view?usp=drive_link
https://drive.google.com/file/d/1aJh1TjPRySPerdUsTo0A8tRnbKLU7ZBm/view?usp=drive_link

and this very simple script:

import argparse

from norfair import Video
from norfair.drawing.drawer import Drawer


def run():
    parser = argparse.ArgumentParser(description="Track objects in a video.")
    parser.add_argument("files", type=str, nargs="+", help="Video files to process")
    args = parser.parse_args()
    for path in args.files:
        video = Video(input_path=path)
        counter = 0
        for frame in video:
            frame = Drawer.text(frame, str(counter), (20,20))
            counter += 1
            video.write(frame)


if __name__ == "__main__":
    run()

Play the output video on any player and you will see that the videos are no longer synchronized.
Also notice that the loading bar when processing the video doesn't reach 100% on any video, this indicates that some frames are being skipped.

Expected behavior
The videos should still be synchronized after processing.

Screenshots or videos

Environment (please complete the following information):

  • OS: macos
  • Python version: 3.8.18
  • Norfair version: master

Additional context
I transformed the videos to mp4 using ffmpeg and the problem is fixed

@javiber javiber added the bug Something isn't working label Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant