GithubHelp home page GithubHelp logo

Comments (7)

jkjung-avt avatar jkjung-avt commented on July 25, 2024

This depends on whether gstreamer's "v4l2src" is able to handle the camera device you are using. In other words, it's a compatibility issue between the camera and the gstreamer element. When you do "cv2.VideoCapture(0)", it's leveraging opencv's internal mechanism (probably "libv4l") to handle the camera instead. That's OK too.

I will keep my implementations since I'd like to be able to set different image resolutions, e.g. 1920x1080 or 1280x720, using the gstreamer pipeline.

from tensorrt_demos.

gzz1529657064 avatar gzz1529657064 commented on July 25, 2024

@jkjung-avt Is there a way to solve this compatibility problem? I want to use gstream.

from tensorrt_demos.

jkjung-avt avatar jkjung-avt commented on July 25, 2024

Check out 'v4l2src' documentation, and try to find a gstreamer pipeline which works for your webcam. If you manage to do that, then you could modify the 'open_cam_usb()' function accordingly.

https://gstreamer.freedesktop.org/documentation/video4linux2/v4l2src.html?gi-language=c

Using 'v4l2-ctl' to check all color/resolution formats your webcam supports would also help.

https://superuser.com/questions/639738/how-can-i-list-the-available-video-modes-for-a-usb-webcam-in-linux

from tensorrt_demos.

zychen2016 avatar zychen2016 commented on July 25, 2024

could use MIPI CSI camera?Like Raspberry Pi Camera v2 in Jetson nano

from tensorrt_demos.

jkjung-avt avatar jkjung-avt commented on July 25, 2024

Yes, please refer to this post on my blog.

http://disq.us/p/22rtcid

from tensorrt_demos.

Tetsujinfr avatar Tetsujinfr commented on July 25, 2024

Great repo, thanks!
for those who want to use with a ZED camera (like me):

  1. install the gstreamer plugin for the ZED
  2. in the file /tensorrt_demos/utils/camera.py replace:

gst_str = ('v4l2src device=/dev/video{} ! video/x-raw, width=(int){}, height=(int){} ! videoconvert ! appsink').format(dev, width, height)
with:
gst_str = ('zedsrc stream-type=1 camera-resolution=3 camera-fps=100 ! autovideoconvert ! appsink').format(dev, width, height)

you can tweak the zedsrc source with the parameters mentioned on the zed gstreamer plugin repo readme (e.g. camera-resolution = 0, 1, 2, 3 for resp. 2K, HD, 720p, WGA)

Then execute the demo like with any USB cam, e.g. under /tensorrt_demos/:
python3 trt_yolo.py --usb 0 -m yolov4-416

Hope this will help someone. ciao

from tensorrt_demos.

jkjung-avt avatar jkjung-avt commented on July 25, 2024

@Tetsujinfr Thanks for sharing this (use of ZED camera).

from tensorrt_demos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.