localdevices / pyorc

Surface velocity, object tracking, and river flow measurements in an open-source API
GNU Affero General Public License v3.0
140 stars 33 forks source link

ValueError: FPS in video is 0.0 which is not a valid value. Repair the video file before use #83

Closed Mohawker47 closed 3 weeks ago

Mohawker47 commented 2 years ago

Full error message returned when using code from: "setting up a camera configuration for processing a single video" and "open movie and plot a single frame" from pyorc 0.2.3 documentation

Traceback (most recent call last): File "C:\Users\jkret\Documents\pyOpen River Cam\pyorc\test.py", line 10, in video = pyorc.Video(video_file, start_frame=0, end_frame=1) # we only need one frame File "C:\Users\jkret\Documents\pyOpen River Cam\pyorc\pyorc\api\video.py", line 116, in init self.fps = cap.get(cv2.CAP_PROP_FPS) File "C:\Users\jkret\Documents\pyOpen River Cam\pyorc\pyorc\api\video.py", line 220, in fps raise ValueError(f"FPS in video is {fps} which is not a valid value. Repair the video file before use") ValueError: FPS in video is 0.0 which is not a valid value. Repair the video file before use

hcwinsemius commented 1 year ago

@Mohawker47 sorry that we missed this issue. Can you let us know the status? It looks like the video file doesn't exist. Can you check if the path was set correctly?

hcwinsemius commented 1 year ago

A more clear message is needed on possible non-existing files than the default opencv message (0 FPS).

lflowers39 commented 5 months ago

I too currently have this issue.

I first ran into the problem with my own .mp4 file but also have the same error with examples_camera_calib_camera_calib_720p.mkv dk_control.mp4

lflowers39 commented 4 months ago

Has any attention been given to this issue?

lflowers39 commented 1 month ago

Reaching out about this issue.

The path to the video file is set correctly. I have updated, uninstalled, and installed both opencv and pyopenrivercam (and its dependencies).

Traceback (most recent call last): File "C:\Users\lflores\Anaconda3\envs\EAsPyORC\inhere1.py", line 15, in vid = pyorc.Video(fn,start_frame = 0,end_frame = 1) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\lflores\Anaconda3\envs\EAsPyORC\Lib\site-packages\pyorc\api\video.py", line 130, in init self.fps = cap.get(cv2.CAP_PROP_FPS) ^^^^^^^^ File "C:\Users\lflores\Anaconda3\envs\EAsPyORC\Lib\site-packages\pyorc\api\video.py", line 354, in fps raise ValueError(f"FPS in video is {fps} which is not a valid value. Repair the video file before use") ValueError: FPS in video is 0.0 which is not a valid value. Repair the video file before use

lflowers39 commented 1 month ago

For more context, I have installed pyorc using both conda and mamba and each for python versions 3.8 and 3.10. In each case I have also installed in a virtual environment and without and still cannot read in video file without a returned FPS = 0.0. I have also tried this using three different video files.

Is there a preferred python version that should be used? Thank you for the time.