abhiTronix / deffcode

A cross-platform High-performance FFmpeg based Real-time Video Frames Decoder in Pure Python 🎞️⚡
https://abhitronix.github.io/deffcode
Apache License 2.0
178 stars 3 forks source link

how to open PTZ camera #35

Closed shersoni610 closed 1 year ago

shersoni610 commented 1 year ago

Issue guidelines

Issue Checklist

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

abhiTronix commented 1 year ago

@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.

shersoni610 commented 1 year ago

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

abhiTronix commented 1 year ago

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.

shersoni610 commented 1 year ago

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

abhiTronix commented 1 year ago

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.