View: 955|Reply: 1

Control camera bitrate, resolution and framerate

[Copy link]

2

Threads

2

Posts

12

Credits

Newbie

Rank: 1

Credits
12
Post time 2023-8-18 23:15:32 | Show all posts |Read mode
I have a RaspTank Pro and Raspberry pi. I have a Raspberry pi high resolution camera and I replaced the original camera of car with my new high resolution camera. But I see after that, the Pi cannot process the video very well. The servo motor and video start lagging.
I undrstand that the Pi may not process the high resolution, bitrate or framerate. How can I change camera resolution, bit rate from OpenCV?
Reply

Use magic Report

0

Threads

53

Posts

201

Credits

Administrator

Rank: 9Rank: 9Rank: 9

Credits
201
Post time 2023-8-23 18:26:00 | Show all posts
You can try to modify the server/camera_opencv.py file, add below line 418
code:

  1.          camera.set(6,cv2.VideoWriter.fourcc('M','J','P','G'))
  2.          camera.set(3,640) #FRAME WIDTH
  3.          camera.set(4,480) # FRAME HEIGHT
  4.          #camera.set(cv2.CAP_PROP_FPS, 60) # frame
Copy the Code

You can also debug the parameters and fill in the parameters suitable for your camera.

Reply

Use magic Report

You have to log in before you can reply Login | Sign Up

Points Rules