Giter Club home page Giter Club logo

cam_overlay's People

Contributors

meekys avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cam_overlay's Issues

Need to add info to readme on how to exit cam_overlay

The only way I've found to stop cam_overlay once running from the command line is to physically pull the USB plug. I've tried a variety of commands, etc, but nothing works.Obviously pulling the plug isn't practical in a car. A description of how to kill the program needs to be added to the readme.

Can't get it work on RPI4 buster/crankshaft, help

Hi,
I'm struggling to connect RCA camera, connected through USB receiver, connected to RPI4 Buster/Crankshaft, @fazerxlo branch
I use EasyCap receiver, like this
Rear camera is this one,

Tried to build cam_overlay, both master and cpp branch, but no luck,
Tried to enable/disable rpi-config fake KMS. No luck.
master branch gives error:

pi@raspberrypi:~/cam_overlay $ ./cam_overlay.bin
Opened device '/dev/video0'
Dimensions: 640 x 480 Pixel Format: MJPG
cam_overlay.bin: cam_overlay.c:105: init_ogl: Assertion `EGL_FALSE != result' failed.
Aborted

with cpp branch had issues building, in the end it also does not work:

pi@raspberrypi:~ $ ./cam_overlay_cpp/cam_overlay/bin/camoverlay.bin
Initialising DisplayBcm...
Initialising GL context...
* failed to add service - already in use?

Please help.

Additional step needed to compile

Need to add:

cd /opt/vc/src/hello_pi/libs/ilclient
make

to the Raspberry Pi instructions before compiling cam_overlay. Otherwise, it will not compile.
I give credit for this to someone on REDDIT. I had already done that step before compiling another program.

Screen is green

So I installed cheese on raspbian today because with just the straight cam_overlay the image was super exposed. So I wanted to just make sure that the camera could be adjusted with the exposure. Cheese auto adjusted the exposure perfect and the image looked amazing. So I exited Cheese and put the truck back into reverse and had a green screen with some static on top of the image. So I uninstalled cheese in case something from cheese caused this. But even after doing that and rebooting the pi to ensure no libraries were left loaded I am still now just getting a green image. Any thoughts on this? Also any thoughts on how to turn on auto exposure with cam_overlay? Thank you for this awesome code.

Possible to add option without guidelines

Hey,
I have Crankshaft NG running on my pi 3B+.
I want to add a front and back camera.
I will use a switch to change the views.
Pressing forward is front cam. Middle stand is camera off. Pulling backwards is rearcam.
I dont need any guidlines for the front view. But i need them for the back.
Is it possible to make a option for this?
Thanks

VIDIOC_REQBUFS error 12 when firing cam_overlay

Hi there,

I'm just trying to get started using cam_overlay (through crankshaft) to fire up a rear cam in my car. I'm getting a memory issue with the webcam which I'm using to test my setup, and I am not sure whether the problem is coming from my setup, or rather if this is a problem someone has come across before:

pi@CRANKSHAFT-NG:/opt/crankshaft/cam_overlay $ ./cam_overlay.bin 
Opened device '/dev/video0'
Dimensions: 640 x 480 Pixel Format: YUYV
VIDIOC_REQBUFS error 12, Cannot allocate memory

Also I can provide the details of the camera used:

pi@CRANKSHAFT-NG:/opt/crankshaft/cam_overlay $ v4l2-ctl --all
Driver Info (not using libv4l2):
	Driver name   : uvcvideo
	Card type     : Microsoft® LifeCam HD-3000: Mi
	Bus info      : usb-3f980000.usb-1.3
	Driver version: 4.14.98
	Capabilities  : 0x84200001
		Video Capture
		Streaming
		Extended Pix Format
		Device Capabilities
	Device Caps   : 0x04200001
		Video Capture
		Streaming
		Extended Pix Format
Priority: 2
Video input : 0 (Camera 1: ok)
Format Video Capture:
	Width/Height      : 640/480
	Pixel Format      : 'YUYV'
	Field             : None
	Bytes per Line    : 1280
	Size Image        : 3085365528
	Colorspace        : sRGB
	Transfer Function : Default
	YCbCr/HSV Encoding: Default
	Quantization      : Default
	Flags             : 
Crop Capability Video Capture:
	Bounds      : Left 0, Top 0, Width 640, Height 480
	Default     : Left 0, Top 0, Width 640, Height 480
	Pixel Aspect: 1/1
Selection: crop_default, Left 0, Top 0, Width 640, Height 480
Selection: crop_bounds, Left 0, Top 0, Width 640, Height 480
Streaming Parameters Video Capture:
	Capabilities     : timeperframe
	Frames per second: 0.003 (1/353)
	Read buffers     : 0
                     brightness (int)    : min=30 max=255 step=1 default=-8193 value=142
                       contrast (int)    : min=0 max=10 step=1 default=57343 value=5
                     saturation (int)    : min=0 max=200 step=1 default=57343 value=83
 white_balance_temperature_auto (bool)   : default=1 value=1
           power_line_frequency (menu)   : min=0 max=2 default=2 value=0
      white_balance_temperature (int)    : min=2800 max=10000 step=1 default=57343 value=4500 flags=inactive
                      sharpness (int)    : min=0 max=50 step=1 default=57343 value=25
         backlight_compensation (int)    : min=0 max=10 step=1 default=57343 value=5
                  exposure_auto (menu)   : min=0 max=3 default=0 value=3
              exposure_absolute (int)    : min=5 max=20000 step=1 default=156 value=156 flags=inactive
                   pan_absolute (int)    : min=-201600 max=201600 step=3600 default=0 value=0
                  tilt_absolute (int)    : min=-201600 max=201600 step=3600 default=0 value=0
                  zoom_absolute (int)    : min=0 max=10 step=1 default=57343 value=0

* failed to add service - already in use?

Hello,

First, thanks a lot for your work!
I'm a noob in raspberry system, so I need your help.

I'm trying to install a raspberry PI3 B+ with Crankshaft, but the REAR CAM doses not work.
I search a lot to understand why, and I search finish on cam_overlay....

But when I try to launch it with:

. /cam_overlay.bin

I get:

Opened device '/dev/video0'
Dimensions: 352 x 288 Pixel Format: MJPG

  • failed to add service - already in use?

Did I do something wrong?

I hope my message is in the good place...

Thanks

DisplayBCM error in CPP branch using RCA output

I got some new issue, I'm not sure whats the problem yet.

When I'm running the camoverlay.bin I get this error
Initialising DisplayBcm... rearcam.bin: /home/pi/cam_overlay/src/Display/Bcm/src/DisplayBcm.cpp:16: DisplayBcm::DisplayBcm(std::shared_ptr<ILogger>): Assertion success >= 0' failed.
Aborted`

The weird thing is when the pi is connected via HDMI to my television it works fine.
But in the car I have to use a RCA connection. (I don't want to use more energy by using these HDMI converters, I have a PHEV)

While I'm typing it I think might this be caused by my boot/config.txt where my HDMI is not ingored?

No issue: made a script to switch cameras and a new overlay

So, I have a Chevrolet Volt, which has pretty poor vision to the front.
I wanted to be able to switch camera's when I need to park.

I copied the cam_overlay folder and changed the names of the folder and bin file to some thing with rearcam and frontcam.

I made these overlays.

Frontcam overlay

New Project-2(9)

Rearcam overlay

New Project-2(8)

Illustration of the buttons the script makes

New Project-2

Bash Script

#!/bin/bash
device='/dev/input/event0'

coord_x_check='*type 3 (EV_ABS), code 0 (ABS_X), value*'
coord_y_check='*type 3 (EV_ABS), code 1 (ABS_Y), value*'
running_cam=1
echo "Rearcam activated on default"
~/rearcam_overlay/bin/rearcam.bin -d /dev/v4l/by-id/usb-ARKMICRO_USB2.0_PC_CAMERA-video-index0 &
sudo evtest "$device" | while read line; do
    case $line in
        ($coord_x_check)    x=$(echo $line | awk -F value '{ print $2 }' | tr -dc '0-9');;
        ($coord_y_check)    y=$(echo $line | awk -F value '{ print $2 }' | tr -dc '0-9')
        if (( $x>=1920 && $y<=850 && $running_cam==1 ));
        then
                echo Rearcam deactivated
                killall -wq rearcam.bin &

                echo Frontcam activated X $x  Y $y
                ~/frontcam_overlay/bin/frontcam.bin -d /dev/v4l/by-id/usb-ARKMICRO_USB2.0_PC_CAMERA-video-index0 &
                running_cam=2
                sleep 1
        elif (( $x>=1920 && $y<=850 && $running_cam==2 ));
        then
                echo Frontcam is running allready
        elif (( $x<=1919 && $y<=850 && $running_cam==2 ));
        then
                echo Frontcam deactivated
               killall -wq frontcam.bin &
                echo Rearcam activated X $x Y $y
                ~/cam_overlay/bin/rearcam.bin -d /dev/v4l/by-id/usb-ARKMICRO_USB2.0_PC_CAMERA-video-index0 &
                running_cam=1
                sleep 1
        elif (( $x<=1919 && $y<=850 && $running_cam==1 ));
        then
                echo Rearcam is running allready
        elif (( $y>850 && $running_cam==1 ));
        then
                echo Camview deactivated X $x Y $y
                killall -wq rearcam.bin
                killall -wq test-2.sh
                exit 1
        elif (( $y>850 && $running_cam==2 ));
        then
                echo Camview deactivated X $x Y $y
                killall frontcam.bin &
                killall camview.sh    #this script
                exit 1

        fi
        ;;
    esac
sleep 0.1
done

You should find out using evtest what the min X & Y values and max X & Y values are. Also check where you like to have the buttons and check the values. Use them in this script.

Failed to add service

Good evening,

First off thank you for this project as I am certain this will make my OpenAuto experience just amazing. I purchased a USB camera to use with my pi. I've tested this camera out on my regular Ubuntu box and confirmed it does play well with linux. I've also tested it out with vlc on the pi as well and all is good. However when I fire off the command to start the cam_overlay it throws the following error. I've tried it both as pi and also as root with the same results. I also attempted to compile it as myself and as root as well with the same results. I'm not sure what service its attempting to add here. Thank you very much for your help and for writing the perfect reverse cam app.

`Opened device '/dev/video0'
Dimensions: 800 x 600 Pixel Format: YUYV

  • failed to add service - already in use?
    `

Stretch doesn't work with video input mjpeg

Hello,
I got a camera attached to a video grabber with the following parameters.:
Video: mjpeg, yuvj422p(pc, bt470bg/unknown/unknown), 640x480, -5 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc

For some reason camoverlay wont use the stretch option with this video input.
The picture down here shows only half the video input (only right side).
Also the colors are really off...
image

What do you think is the problem? How can I fix it?

add button to change camview?

Is it possible to add a button to this system to change video in device?
I want to have 2 camera's, one for forward view (i have a car with bad visibility for boulders while parking due to a very low seat. But while parking i want to be able to switch forward and backward views. Or see them both at the same time.

I am very bad in scripting. I don't understand the scripts of cam_overlay for like 90% so that wont be doable for me.

Another Crankshaft related issue about cam_overlay on Pi 3 model B and Pi 4B

Hi,

I have checked most of the issues here and after spending most of all day on this, I feel like I need some help.

I'm trying to use this ( https://www.avsl.com/product/128.836UK-4k-hdmi-video-capture-card ) with a RCA to HDMI converter so I can then look into what reversing camera I can go and get setup with. Not to mention I am using a USB extension as it's too big to fit into the Pi (I'm kinda ok with this for the moment - also I have a RCA to HDMI convertor in case you're wondering that a reversing camera I am borrowing works with).

Let's start with the Pi 3 Model B, cos this is doing what I want (but not quite if you know what I mean) and feel like it's going to be "the easier fix". For context, I am using SSH on my desktop to try and make this easier on myself:

Initially I noticed that I had the issue with issue #29 (specifically, #29 (comment) ) so I commented out the dtoverlay=vc4-fkms-v3d line for the Pi 3, then I was also stuck with the "Cannot open 'shader-MJPG.frag'" error.

In the name of doing more testing, I installed FFMPEG and ran ffplay /dev/video0 which displayed part of the reversing camera I am currently borrowing for testing purposes. Then I decided to try and run cam_overlay.bin again, and this time it displayed in full screen exactly what I would like.

I've therefore done a little more digging, and found that the capture card has two modes as seen below:

image

The final piece of this puzzle, then it's back to being a "me" problem: is there a way of telling/setting the pixel format of V4L2 to use the YUYV format instead of trying to grab the MJPG format? If so, can someone please provide the command to use please?

As for the Pi 4, well, I think the easiest way is for me to say what needs to be done I feel as I'm getting the same error whether I comment out the line above from earlier or not (and getting the dreaded "failed to add service - already in use?" when trying to run cam_overlay.bin

Download Crankshaft using git in SSH
Download CCP branch of cam_overlay
Make/build both, then test again

Issue lies: I'm having difficulty with the git command and building in general, but I would like a list of commands please I am meant to be using, just to make sure I am not making any "newbie" mistakes.

Thankyou for reading this essay. In both cases, please feel free to let me know if you require further information; I'm bound to have forgotten something

overlay.png is forced rendered in perspective

Im not sure of my title is correct.

I made a overlay.png that's should be used full screen since my car dimensions are very wide my lines start from the sides instead of the bottom.
It looks like cam overlay change the picture in dimensions. But I need it rendered full screen like the cam input itself.

Video grabber with profile YUVY not YUYV

Hi,

i adapted your code for crankshaft (pi based android auto headunit) and noticed a prob with a Syntek STK1160 video bridge:
the request profile is not YUYV - it is YUVY. With a easy copy to test it works with wrong colors.
Can you possible add this profile ?

photo_2019-01-30_19-53-20
pojoe1j3jaiuqkiikpfdpt27oh0omgdf7

If you are interested on our free project:
getcrankshaft.com
github.com/opencardev

Thx, Hawkeye

in cpp branch -u and --userp dont work

~/cam_overlay-full/bin $ ./camoverlay.bin -d /dev/video0 --userp
./camoverlay.bin: unrecognized option '--userp'
Usage: ./camoverlay.bin [options]

Version 1.3

AND

~/cam_overlay-full/bin $ ./camoverlay.bin -d /dev/video0 -u
./camoverlay.bin: invalid option -- 'u'
Usage: ./camoverlay.bin [options]

Version 1.3
Options:
-? | --help Print this message
-d | --device name Video device name [/dev/video0]
-i | --input Input module [V4L2MMap]
-o | --output Output module [auto]
-D | --display Display module [X11]
-s | --stretch Stretch image to screen
-r | --rotate Rotate image 180 degrees
-h | --fliph Flip image horizontally
-v | --flipv Flip image vertically

The -u and --userp are writen in the Readme but i dont see it in the options as you see above.

Crankshaft black screen

Hello,

When connecting a USB webcam with crankshaft, I get a black screen whenever I switch to the camera.

The device supports MJPG pixel format, I don't know if this is the cause. I have similar results with this issue. #10

I would very much appreciate any help

[RPI][X11] Compile failure

When compiling on my RPI 3b+ with X11 mode i get this output:

pi@raspberrypi:~/cam_overlay $ make DISPLAY=x11
cc -Ix11  -DSTANDALONE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -D_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -Wall -g -ftree-vectorize -pipe -Wno-psabi  -g -c cam_overlay.c -o cam_overlay.o -Wno-deprecated-declarations
In file included from x11/gl_common.h:2:0,
                 from cam_overlay.c:32:
/usr/include/GLES2/gl2.h:73:25: error: conflicting types for ‘GLsizeiptr’
 typedef khronos_ssize_t GLsizeiptr;
                         ^~~~~~~~~~
In file included from /usr/include/GL/gl.h:2055:0,
                 from x11/gl_common.h:1,
                 from cam_overlay.c:32:
/usr/include/GL/glext.h:468:19: note: previous declaration of ‘GLsizeiptr’ was here
 typedef ptrdiff_t GLsizeiptr;
                   ^~~~~~~~~~
In file included from x11/gl_common.h:2:0,
                 from cam_overlay.c:32:
/usr/include/GLES2/gl2.h:74:26: error: conflicting types for ‘GLintptr’
 typedef khronos_intptr_t GLintptr;
                          ^~~~~~~~
In file included from /usr/include/GL/gl.h:2055:0,
                 from x11/gl_common.h:1,
                 from cam_overlay.c:32:
/usr/include/GL/glext.h:469:19: note: previous declaration of ‘GLintptr’ was here
 typedef ptrdiff_t GLintptr;
                   ^~~~~~~~
In file included from x11/gl_common.h:2:0,
                 from cam_overlay.c:32:
/usr/include/GLES2/gl2.h:393:28: error: conflicting types for ‘PFNGLBUFFERDATAPROC’
 typedef void (GL_APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const void *data, GLenum usage);
                            ^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/GL/gl.h:2055:0,
                 from x11/gl_common.h:1,
                 from cam_overlay.c:32:
/usr/include/GL/glext.h:532:25: note: previous declaration of ‘PFNGLBUFFERDATAPROC’ was here
 typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const void *data, GLenum usage);
                         ^~~~~~~~~~~~~~~~~~~
In file included from x11/gl_common.h:2:0,
                 from cam_overlay.c:32:
/usr/include/GLES2/gl2.h:394:28: error: conflicting types for ‘PFNGLBUFFERSUBDATAPROC’
 typedef void (GL_APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void *data);
                            ^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/GL/gl.h:2055:0,
                 from x11/gl_common.h:1,
                 from cam_overlay.c:32:
/usr/include/GL/glext.h:533:25: note: previous declaration of ‘PFNGLBUFFERSUBDATAPROC’ was here
 typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void *data);
                         ^~~~~~~~~~~~~~~~~~~~~~
Makefile.include:14: recipe for target 'cam_overlay.o' failed
make: *** [cam_overlay.o] Error 1

When removing the line #include "GL/gl.h" from x11/gl_common.h i will get:

pi@raspberrypi:~/cam_overlay $ make DISPLAY=x11
cc -Ix11  -DSTANDALONE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -D_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -Wall -g -ftree-vectorize -pipe -Wno-psabi  -g -c cam_overlay.c -o cam_overlay.o -Wno-deprecated-declarations
cc -Ix11  -DSTANDALONE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -D_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -Wall -g -ftree-vectorize -pipe -Wno-psabi  -g -c common.c -o common.o -Wno-deprecated-declarations
cc -Ix11  -DSTANDALONE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -D_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -Wall -g -ftree-vectorize -pipe -Wno-psabi  -g -c display.c -o display.o -Wno-deprecated-declarations
cc -Ix11  -DSTANDALONE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -D_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -Wall -g -ftree-vectorize -pipe -Wno-psabi  -g -c x11/display.c -o x11/display.o -Wno-deprecated-declarations
cc -Ix11  -DSTANDALONE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -D_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -Wall -g -ftree-vectorize -pipe -Wno-psabi  -g -c png_texture.c -o png_texture.o -Wno-deprecated-declarations
cc -o cam_overlay.bin -Wl,--whole-archive cam_overlay.o common.o display.o x11/display.o png_texture.o -lpng std=c99 -lm -lEGL -lGLESv2 -lX11 -Wl,--no-whole-archive -rdynamic
cc: error: std=c99: No such file or directory
Makefile.include:22: recipe for target 'cam_overlay.bin' failed
make: *** [cam_overlay.bin] Error 1
rm cam_overlay.o common.o png_texture.o display.o x11/display.o

any ideas?

MJPG support

Hi @meekys ,

Could you please also add the shader for MJPG. My device only supports MJPG pixel format. I would also appreciate any guidance on how to create the shader. Thanks

pi@raspberrypi:~/cam_overlay $ ./cam_overlay.bin
Opened device '/dev/video0'
Dimensions: 640 x 480 Pixel Format: MJPG
MESA-LOADER: failed to retrieve device information
MESA-LOADER: failed to retrieve device information
MESA-LOADER: failed to retrieve device information
Opened screen 0 @ 800 x 480
Cannot open 'shader-MJPG.frag': 2, No such file or directory
pi@raspberrypi:~/cam_overlay $ v4l2-ctl --all
Driver Info (not using libv4l2):
        Driver name   : uvcvideo
        Card type     : USB2.0 PC CAMERA
        Bus info      : usb-3f980000.usb-1.5
        Driver version: 4.14.79
        Capabilities  : 0x84200001
                Video Capture
                Streaming
                Extended Pix Format
                Device Capabilities
        Device Caps   : 0x04200001
                Video Capture
                Streaming
                Extended Pix Format
Priority: 2
Video input : 0 (Camera 1: ok)
Format Video Capture:
        Width/Height      : 640/480
        Pixel Format      : 'MJPG'
        Field             : None
        Bytes per Line    : 0
        Size Image        : 614400
        Colorspace        : Default
        Transfer Function : Default
        YCbCr/HSV Encoding: Default
        Quantization      : Default
        Flags             :
Crop Capability Video Capture:
        Bounds      : Left 0, Top 0, Width 640, Height 480
        Default     : Left 0, Top 0, Width 640, Height 480
        Pixel Aspect: 1/1
Selection: crop_default, Left 0, Top 0, Width 640, Height 480
Selection: crop_bounds, Left 0, Top 0, Width 640, Height 480
Streaming Parameters Video Capture:
        Capabilities     : timeperframe
        Frames per second: 60.000 (60/1)
        Read buffers     : 0
                     brightness (int)    : min=0 max=255 step=1 default=-8193 value=128
                       contrast (int)    : min=0 max=255 step=1 default=57343 value=128
                     saturation (int)    : min=0 max=255 step=1 default=57343 value=70
                            hue (int)    : min=-127 max=127 step=1 default=-8193 value=0
                          gamma (int)    : min=1 max=8 step=1 default=57343 value=4
                           gain (int)    : min=0 max=65535 step=1 default=57343 value=16
           power_line_frequency (menu)   : min=0 max=2 default=1 value=1
                      sharpness (int)    : min=0 max=255 step=1 default=57343 value=3

Originally posted by @andreimoraru in #7 (comment)

Cannot compile on raspberry pi due to conflict between gl and gles2

Hi,
I cannot compile the cpp branch on a raspberry pi 3b due to a conflict between glext.h and gl2.h.
Running cmake works, but when I try to run make, it gets to 8% and then errors out, due to some typedefs being duplicated between glext.h and gl2.h

The problem seems to be caused by using both gl.h and gl2.h

Here is the output of make:

[  5%] Built target core
[  8%] Building CXX object src/Gl/CMakeFiles/gl.dir/src/Buffer.cpp.o
In file included from /home/pi/cam_overlay/src/Gl/include/Gl/GlCommon.hpp:11:0,
                 from /home/pi/cam_overlay/src/Gl/include/Gl/Buffer.hpp:3,
                 from /home/pi/cam_overlay/src/Gl/src/Buffer.cpp:1:
/usr/include/GLES2/gl2.h:73:25: error: conflicting declaration ‘typedef khronos_ssize_t GLsizeiptr’
 typedef khronos_ssize_t GLsizeiptr;
                         ^~~~~~~~~~
In file included from /usr/include/GL/gl.h:2055:0,
                 from /home/pi/cam_overlay/src/Gl/include/Gl/GlCommon.hpp:9,
                 from /home/pi/cam_overlay/src/Gl/include/Gl/Buffer.hpp:3,
                 from /home/pi/cam_overlay/src/Gl/src/Buffer.cpp:1:
/usr/include/GL/glext.h:468:19: note: previous declaration as ‘typedef ptrdiff_t GLsizeiptr’
 typedef ptrdiff_t GLsizeiptr;
                   ^~~~~~~~~~
In file included from /home/pi/cam_overlay/src/Gl/include/Gl/GlCommon.hpp:11:0,
                 from /home/pi/cam_overlay/src/Gl/include/Gl/Buffer.hpp:3,
                 from /home/pi/cam_overlay/src/Gl/src/Buffer.cpp:1:
/usr/include/GLES2/gl2.h:74:26: error: conflicting declaration ‘typedef khronos_intptr_t GLintptr’
 typedef khronos_intptr_t GLintptr;
                          ^~~~~~~~
In file included from /usr/include/GL/gl.h:2055:0,
                 from /home/pi/cam_overlay/src/Gl/include/Gl/GlCommon.hpp:9,
                 from /home/pi/cam_overlay/src/Gl/include/Gl/Buffer.hpp:3,
                 from /home/pi/cam_overlay/src/Gl/src/Buffer.cpp:1:
/usr/include/GL/glext.h:469:19: note: previous declaration as ‘typedef ptrdiff_t GLintptr’
 typedef ptrdiff_t GLintptr;
                   ^~~~~~~~
src/Gl/CMakeFiles/gl.dir/build.make:62: recipe for target 'src/Gl/CMakeFiles/gl.dir/src/Buffer.cpp.o' failed
make[2]: *** [src/Gl/CMakeFiles/gl.dir/src/Buffer.cpp.o] Error 1
CMakeFiles/Makefile2:176: recipe for target 'src/Gl/CMakeFiles/gl.dir/all' failed
make[1]: *** [src/Gl/CMakeFiles/gl.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

I am running crankshaft-ng with everything up to date. I just did an apt-get update & apt-get upgrade a few hours ago.

I tried removing one or the other of the files that cause the errors, but than it obviously doesn't work, because it can't find the file...

split screen front and rearview

I was wondering if it is possible to add a second camera view. And a way to switch back and forth.
Something like the WhatsApp video call view.
One little screen for one of the views and a big view window for the other cam
Or just split screen.
I would like a rear and front camera for easier parking.
But I also want to use them as dashcams.
The front camera will be mounted underneath the front licenseplate

can't build cpp branch

Hello,

I'm currently trying to build cam_overlay_cpp on Crankshaft-NG. Unfortunately, I'm getting the following error message in CMakeLists.txt:
No project() command is present. The top-level CMakeLists.txt file must
contain a literal, direct call to the project() command. Add a line of
code such as
project(ProjectName)

near the top of the file, but after cmake_minimum_required().

CMake is pretending there is a "project(Project)" command on the first
line.
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY)
Call Stack (most recent call first):
/usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.16/Modules/FindOpenGL.cmake:397 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
src/Gl/CMakeLists.txt:4 (find_package)

-- Configuring incomplete, errors occurred!
See also "/opt/crankshaft/cam_overlay-cpp/CMakeFiles/CMakeOutput.log".

Does anyone have any ideas regarding this?
I've already tried modifying RaspberryPi.cmake l (ike this post #25 (comment)), but without success.

Request: Fix picture shift

Would be possible to fix picture shift? Picture has bigger height than screen and bottom is cutted.
(Great feature will be option to configure picture position, height and width)

Regards

More v4l2 command line options

I think this issue may need to be expanded. I'm using a generic EasyCap, with the Empia chipset and a generic NTSC backup camera. (BTW, there are at least 4 different chipsets, STK1160 being one of the others, used in Easycaps, described here: https://www.linuxtv.org/wiki/index.php/Easycap). My EasyCap defaults to Pal output and S-video input, so I get no picture in Cam_overlay at all unless I go into V4L2 settings after each statup and reset things to NTSC and composite input. There are numerous other settings that could be changed also depending on which capture device is used. Unfortunately, there is no way short of a script to reset things at each restart of the RPi using V4l2-ctl. Even the V4l2 capture utility does not carry settings across restarts. This can be done with a startup script, or udev as outlined here: https://askubuntu.com/questions/295637/v4l2-change-default-setting. Raspbian works the same as Ubuntu in this case.

Obviously, this approach is not user friendly. If cam_overlay (or Crankshaft) could read the device options, and allow them to be set
once as persistent settings, this would simplify things greatly. Cam_overlay already has a number of settable options, so it would appear these could be added.

Originally posted by @jonlowe in #7 (comment)

Assertion `state->surface != EGL_NO_SURFACE' failed

Hello @meekys,

I have captured an issue when running cam_overlay compiled as shown at the bottom of current text.

It throws an error:

pi@raspberrypi:~/cam_overlay $ ./cam_overlay.bin -V -d /dev/video1
Opened device '/dev/video1'
Dimensions: 800 x 600 Pixel Format: YUYV
cam_overlay.c:97:init_ogl(): eglGetDisplay
cam_overlay.c:103:init_ogl(): eglInitialize
MESA-LOADER: failed to retrieve device information
MESA-LOADER: failed to retrieve device information
MESA-LOADER: failed to retrieve device information
cam_overlay.c:126:init_ogl(): eglChooseConfig
cam_overlay.c:144:init_ogl(): eglCreateContext
x11/display.c:18:init_window(): XOpenDisplay
x11/display.c:22:init_window(): DefaultScreen
x11/display.c:24:init_window(): RootWindow
x11/display.c:33:init_window(): XCreateSimpleWindow
x11/display.c:47:init_window(): XStoreName
x11/display.c:55:init_window(): XMapWindow
cam_overlay.c:151:init_ogl(): eglCreateWindowSurface
cam_overlay.bin: cam_overlay.c:153: init_ogl: Assertion `state->surface != EGL_NO_SURFACE' failed.

pi@raspberrypi:~/cam_overlay $ make DISPLAY=x11 debug
cc -Ix11 -DDEBUG -DSTANDALONE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -D_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -Wall -g -ftree-vectorize -pipe -Wno-psabi  -g -c cam_overlay.c -o cam_overlay.o -Wno-deprecated-declarations
cc -Ix11 -DDEBUG -DSTANDALONE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -D_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -Wall -g -ftree-vectorize -pipe -Wno-psabi  -g -c common.c -o common.o -Wno-deprecated-declarations
cc -Ix11 -DDEBUG -DSTANDALONE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -D_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -Wall -g -ftree-vectorize -pipe -Wno-psabi  -g -c display.c -o display.o -Wno-deprecated-declarations
cc -Ix11 -DDEBUG -DSTANDALONE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -D_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -Wall -g -ftree-vectorize -pipe -Wno-psabi  -g -c x11/display.c -o x11/display.o -Wno-deprecated-declarations
cc -Ix11 -DDEBUG -DSTANDALONE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -D_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -Wall -g -ftree-vectorize -pipe -Wno-psabi  -g -c png_texture.c -o png_texture.o -Wno-deprecated-declarations
cc -o cam_overlay.bin -Wl,--whole-archive cam_overlay.o common.o display.o x11/display.o png_texture.o -lpng -std=c99 -lm -lEGL -lGLESv2 -lX11 -Wl,--no-whole-archive -rdynamic
rm cam_overlay.o common.o png_texture.o display.o x11/display.o

Able to make a screenshot?

Hey,
I'm wondering if it is possible to make a screenshot or capture an image when camera view is enabled.
This would help me to be able to tell if my videograbber gets any input. (Needed for a script)

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.