Skip to content
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

Can't work in chenged resolution #5

Open
jeonhaeng opened this issue Nov 7, 2022 · 7 comments
Open

Can't work in chenged resolution #5

jeonhaeng opened this issue Nov 7, 2022 · 7 comments

Comments

@jeonhaeng
Copy link

jeonhaeng commented Nov 7, 2022

Default status

Device topology

  • entity 1: sun6i-csi (1 pad, 1 link)
    type Node subtype V4L flags 0
    device node name /dev/video1
    pad0: Sink
    <- "ov5640 2-003c":0 [ENABLED]

  • entity 5: ov5640 2-003c (1 pad, 1 link)
    type V4L2 subdev subtype Sensor flags 0
    device node name /dev/v4l-subdev0
    pad0: Source
    [fmt:UYVY8_2X8/640x480@1/30 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range]
    -> "sun6i-csi":0 [ENABLED]

** work well --> CamLive.py with 640*480
** work well --> gst-launch-1.0 v4l2src device=/dev/video1 ! video/x-raw, width=640, height=480, framerate=30/1 ! videoconvert ! autovideosink

I changed set with

sudo media-ctl --device /dev/media1 --set-v4l2 '"ov5640 2-003c":0[fmt:YUYV8_2X8/1280x720@1/15]'

** do not work --> CamLive.py
** work well --> gst-launch-1.0 v4l2src device=/dev/video1 ! video/x-raw, width=1280, height=720, framerate=15/1 ! videoconvert ! autovideosink

how can I change resolution without error in CamLive.py ?

@Qengineering
Copy link
Owner

Where can I find CamLive.py?

@jeonhaeng
Copy link
Author

jeonhaeng commented Nov 8, 2022

After I set with BananaPi-M2-Zero-OV5640 img uploading, I can find the home/pi/software/python/LiveCam directory, and there's a sample file called LiveCamp.py. I used it for test.
I work in 680,480 mode but didn't work in 1290,720.
I use this opencv code to change resolution in LiveCam.py

cap.set(cv2.CAP_PROP_FRAME_WIDTH, 1280)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 720)

The result is the same if I excute before run it:

sudo media-ctl --device /dev/media1 --set-v4l2 '"ov5640 2-003c":0[fmt:YUYV8_2X8/1280x720@1/15]'

@Qengineering
Copy link
Owner

I'm very sorry, but do we have the same OS?

pi@banana:~$ cat /etc/os-release

PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

pi@banana:~$ media-ctl --print-topology

Media controller API version 5.10.43

Media device information
------------------------
driver          cedrus
model           cedrus
serial          
bus info        platform:cedrus
hw revision     0x0
driver version  5.10.43

Device topology
- entity 1: cedrus-source (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video0
	pad0: Source
		-> "cedrus-proc":0 [ENABLED,IMMUTABLE]

- entity 3: cedrus-proc (2 pads, 2 links)
            type Node subtype Unknown flags 0
	pad0: Sink
		<- "cedrus-source":0 [ENABLED,IMMUTABLE]
	pad1: Source
		-> "cedrus-sink":0 [ENABLED,IMMUTABLE]

- entity 6: cedrus-sink (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video0
	pad0: Sink
		<- "cedrus-proc":1 [ENABLED,IMMUTABLE]

@jeonhaeng
Copy link
Author

jeonhaeng commented Nov 9, 2022

I think it is same. I didn't chane anything..
Refer to this my capture list, please

pi@banana:~$ cat /etc/os-release

PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

pi@banana:~$ media-ctl --print-topology
Media controller API version 5.10.43

Media device information

driver cedrus
model cedrus
serial
bus info platform:cedrus
hw revision 0x0
driver version 5.10.43

Device topology

  • entity 1: cedrus-source (1 pad, 1 link)
    type Node subtype V4L flags 0
    device node name /dev/video0
    pad0: Source
    -> "cedrus-proc":0 [ENABLED,IMMUTABLE]

  • entity 3: cedrus-proc (2 pads, 2 links)
    type Node subtype Unknown flags 0
    pad0: Sink
    <- "cedrus-source":0 [ENABLED,IMMUTABLE]
    pad1: Source
    -> "cedrus-sink":0 [ENABLED,IMMUTABLE]

  • entity 6: cedrus-sink (1 pad, 1 link)
    type Node subtype V4L flags 0
    device node name /dev/video0
    pad0: Sink
    <- "cedrus-proc":1 [ENABLED,IMMUTABLE]

@Qengineering
Copy link
Owner

@jeonhaeng,

I've tested the software and have the same results (not surprising).
Both the C++ and Python (LiveCam) app give the same errors. The limited amount of memory (500 MB) seems to be the problem. I'm afraid there is not much we can do about it. Luckily, streaming is still possible with 1280x720.
However, even 1280x960 is a bridge too far to stream.

@jeonhaeng
Copy link
Author

Then only two mode streaming is possib;e and can't change resolotuion setting in python?

@Qengineering
Copy link
Owner

Indeed, correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants