Skip to content

VideoStreamCv2 does not work with gstreamer pipelines #276

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

Closed
Breakthrough opened this issue Jul 11, 2022 · 1 comment
Closed

VideoStreamCv2 does not work with gstreamer pipelines #276

Breakthrough opened this issue Jul 11, 2022 · 1 comment
Labels
Milestone

Comments

@Breakthrough
Copy link
Owner

Breakthrough commented Jul 11, 2022

gstreamer pipelines are specified by using a ! character. This check needs to also treat a path including a ! as a stream/URL case. This was found in the following discussion.

It might also be a good idea for v0.6.1 to allow constructing a VideoStreamCv2 directly from an existing VideoCapture object, which would avoid requiring any fixes like this in the future.


@Breakthrough Thanks for the example.
With the use case i am trying to get this run, the input is from a gstreamer pipe.
Like:

# in opencv how i read 
cap = cv2.VideoCapture("videotestsrc ! appsink")
# As per the example you shared
cam = VideoStreamCv2("videotestsrc ! appsink")

when i tried the example with this it throws error

    cam = VideoStreamCv2(source)
  File "/usr/local/lib/python3.6/dist-packages/scenedetect/backends/opencv.py", line 92, in __init__
    self._open_capture(framerate)
  File "/usr/local/lib/python3.6/dist-packages/scenedetect/backends/opencv.py", line 297, in _open_capture
    raise OSError('Video file not found.')

Originally posted by @research-boy in #151 (comment)

@Breakthrough Breakthrough added this to the v0.6.1 milestone Jul 11, 2022
@Breakthrough Breakthrough changed the title VideoStreamCv2 does not work with gstreamer pipes VideoStreamCv2 does not work with gstreamer pipelines Jul 11, 2022
@Breakthrough
Copy link
Owner Author

Ended up pursuing the latter approach and adding a new VideoCapture adapter for this purpose. Can see updated example in the v0.6.1 branch.

Breakthrough added a commit that referenced this issue Jul 12, 2022
This is better suited for devices/pipes as opposed to VideoStreamCv2,
which now focuses on files/image sequences/network streams. (#276)

Add tests demonstrating use of a callback when detecting scenes (#273).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant