abhiTronix/deffcode

how to open PTZ camera

Closed this issue · 5 comments

Issue guidelines

Issue Checklist

  • I have searched open or closed issues for my problem and found nothing related or helpful.
  • I have read the Documentation and found nothing related to my problem.

Describe your Question

Hello,

I am trying to open a PTZ Camera on a MAC machine. I get the following errors:

(deff) $ python ex4.py
12:04:20 :: Utilities :: INFO :: Running DeFFcode Version: 0.2.4
12:04:21 :: FFhelper :: DEBUG :: Final FFmpeg Path: ffmpeg
12:04:21 :: FFhelper :: DEBUG :: FFmpeg validity Test Passed!
12:04:21 :: FFhelper :: DEBUG :: Found valid FFmpeg Version: b'5.1.2' installed on this system
12:04:21 :: Sourcer :: DEBUG :: Found valid FFmpeg executable: ffmpeg.
12:04:21 :: Sourcer :: CRITICAL :: Given source 0 is a valid device index. Enforcing 'auto' demuxer.
12:04:21 :: FFhelper :: DEBUG :: Auto-Searching for valid devices...
12:04:21 :: FFhelper :: INFO :: [0]: MINRRAY-TOP
12:04:21 :: FFhelper :: INFO :: [1]: OBS Virtual Camera
12:04:21 :: FFhelper :: INFO :: [2]: Capture screen 0
12:04:21 :: FFhelper :: DEBUG :: Auto-Search completed successfully! Found 3 valid device(s).
12:04:21 :: Sourcer :: DEBUG :: Successfully configured device MINRRAY-TOP at index 0 with demuxer avfoundation.
Traceback (most recent call last):
File "ex4.py", line 6, in
decoder = FFdecoder("0", frame_format="bgr24", verbose=True).formulate()
File "/Users/Projects/CompVis/OpenCV/VideoCapture/deffcode/deff/lib/python3.8/site-packages/deffcode/ffdecoder.py", line 188, in init
Sourcer(
File "/User/Projects/CompVis/OpenCV/VideoCapture/deffcode/deff/lib/python3.8/site-packages/deffcode/sourcer.py", line 307, in probe_stream
raise ValueError(
ValueError: Invalid source with no decodable audio or video stream provided. Aborting!
(deff) $

Terminal log output(Optional)

No response

Python Code(Optional)

No response

DeFFcode Version

0.2.4

Python version

3.10

Operating System version

MAC

Any other Relevant Information?

No response

@shersoni610 I don't think, FFmpeg directly supports PTZ camera You need to setup RTSP stream to be able to open that camera and use that RTSP stream address in FFdecoder.

But why integer index fails with the software. It works fine with opencv.

It works fine with opencv.

@shersoni610 That's because OpenCV supports backends other than FFmpeg, like Gstreamer and v4l2 etc., which supports these cameras. But DeFFcode is made entirely to work with FFmpeg backend only.

I was able to use ffmpeg -i 0:0 to get images from the camera

I was able to use ffmpeg -i 0:0 to get images from the camera

@shersoni610 Paste the output of ffmpeg -i 0:0 here.