USB WEBCAM for back-up camera

Here you can find information how to do some cool things with OpenAuto Pro
MarkWard
Posts: 16
Joined: Sun May 05, 2019 2:27 pm

USB WEBCAM for back-up camera

Post by MarkWard » Fri May 10, 2019 2:22 am

Using a usb camera for backup camera. The best streaming option I could find was VLC. It works fast, it is stable and goes full screen. The only problem is that I can’t get it to display over the top of Android Auto when it is running. Displays over OpenAuto fine but not after loading Android Auto. I know that it is work8ng because I can just barely see the top of the video in the upper margin of the screen. Tried VLC options —video-on-top. No joy.

frankpintosr
Posts: 4
Joined: Wed Apr 17, 2019 2:52 pm
Location: Portland, OR, USA

Re: USB WEBCAM for back-up camera

Post by frankpintosr » Thu May 16, 2019 3:14 am

What usb camera are you using?

jimenoma
Posts: 5
Joined: Thu May 16, 2019 3:48 pm

Re: USB WEBCAM for back-up camera

Post by jimenoma » Thu May 16, 2019 4:10 pm

Hi:
I have the same problem, i am using a Sony Play Station Eye with VLC.
The camera works fine, and is very easy to put a usb cable from the Raspi, to the rear of the vehicle, more than a HDMI cable.
The command that i use is:
DISPLAY=:0 cvlc --fullscreen --video-on-top v4l2:///dev/video0 --demux h264
Only if there is not a mobile connected to AA i get video on the top.

Is it possible to simulate from command that the mobile is not connected by usb to AA , even thought is connected?

Thanks,
MarcoA

MarkWard
Posts: 16
Joined: Sun May 05, 2019 2:27 pm

Re: USB WEBCAM for back-up camera

Post by MarkWard » Fri May 17, 2019 2:56 pm

My setup is slightly different but the problem is the same. I have an EACHINE ROTG01 5.8 Ghz receiver. It is receiving a wireless 5.8GHz transmission form the rear camera. This was actually the was the easy part. The setup behaves exactly like a standard usb camera and I am able to get good video from several raspian video streaming sources. I have the required scrips installed and triggered off of the rear lights. All works like a champ. Problem I have is when the Android Auto takes over, the video comes up in the background. I know this because I can see a small strip of the video at the top margin of the screen. The question is - what command to I need to bring the usb video in front of all other screens when Android Auto is casting to the display?

BlueWave
Site Admin
Posts: 524
Joined: Tue Sep 18, 2018 6:30 am

Re: USB WEBCAM for back-up camera

Post by BlueWave » Fri May 17, 2019 9:53 pm

jimenoma wrote:
Thu May 16, 2019 4:10 pm
Hi:
I have the same problem, i am using a Sony Play Station Eye with VLC.
The camera works fine, and is very easy to put a usb cable from the Raspi, to the rear of the vehicle, more than a HDMI cable.
The command that i use is:
DISPLAY=:0 cvlc --fullscreen --video-on-top v4l2:///dev/video0 --demux h264
Only if there is not a mobile connected to AA i get video on the top.

Is it possible to simulate from command that the mobile is not connected by usb to AA , even thought is connected?

Thanks,
MarcoA
If output format of your camera is h264, then it might be a case to set higher display layer level of mmal video output plugin.
Attachments
vlc.png
vlc.png (140.04 KiB) Viewed 123 times

MarkWard
Posts: 16
Joined: Sun May 05, 2019 2:27 pm

Re: USB WEBCAM for back-up camera

Post by MarkWard » Sat May 18, 2019 1:03 am

I managed a work around. In the python script, when the rear tail lights trigger the GPIO, I kill the autoapp and load the video steam. Vice versa when the GPIO is un triggered. Not ideal but apparently the only solution with this software.

BlueWave
Site Admin
Posts: 524
Joined: Tue Sep 18, 2018 6:30 am

Re: USB WEBCAM for back-up camera

Post by BlueWave » Sat May 18, 2019 7:01 am

MarkWard wrote:
Sat May 18, 2019 1:03 am
I managed a work around. In the python script, when the rear tail lights trigger the GPIO, I kill the autoapp and load the video steam. Vice versa when the GPIO is un triggered. Not ideal but apparently the only solution with this software.
Instead of killing whole OpenAuto Pro, you can try to hide AndroidAuto/Mirroring projection via F6 key. F6 key toggles visiblity of TopBar but that should be enough in your case.

Code: Select all

xdotool key F6

jimenoma
Posts: 5
Joined: Thu May 16, 2019 3:48 pm

Re: USB WEBCAM for back-up camera

Post by jimenoma » Sun May 19, 2019 7:13 pm

BlueWave wrote:
Fri May 17, 2019 9:53 pm
jimenoma wrote:
Thu May 16, 2019 4:10 pm
Hi:
I have the same problem, i am using a Sony Play Station Eye with VLC.
The camera works fine, and is very easy to put a usb cable from the Raspi, to the rear of the vehicle, more than a HDMI cable.
The command that i use is:
DISPLAY=:0 cvlc --fullscreen --video-on-top v4l2:///dev/video0 --demux h264
Only if there is not a mobile connected to AA i get video on the top.

Is it possible to simulate from command that the mobile is not connected by usb to AA , even thought is connected?

Thanks,
MarcoA
If output format of your camera is h264, then it might be a case to set higher display layer level of mmal video output plugin.
Hi:

i have tried to change the VLC options, but the video is ever behind the AA app.

I also tried the xdotool key F6 solution, unsucessfull.

By the moment, the solution is to kill AA, and resume when i have finished the reverse operation, but this is a very bad solution. :(

MarcoA

BlueWave
Site Admin
Posts: 524
Joined: Tue Sep 18, 2018 6:30 am

Re: USB WEBCAM for back-up camera

Post by BlueWave » Sun May 19, 2019 7:50 pm

jimenoma wrote:
Sun May 19, 2019 7:13 pm
BlueWave wrote:
Fri May 17, 2019 9:53 pm
jimenoma wrote:
Thu May 16, 2019 4:10 pm
Hi:
I have the same problem, i am using a Sony Play Station Eye with VLC.
The camera works fine, and is very easy to put a usb cable from the Raspi, to the rear of the vehicle, more than a HDMI cable.
The command that i use is:
DISPLAY=:0 cvlc --fullscreen --video-on-top v4l2:///dev/video0 --demux h264
Only if there is not a mobile connected to AA i get video on the top.

Is it possible to simulate from command that the mobile is not connected by usb to AA , even thought is connected?

Thanks,
MarcoA
If output format of your camera is h264, then it might be a case to set higher display layer level of mmal video output plugin.
Hi:

i have tried to change the VLC options, but the video is ever behind the AA app.

I also tried the xdotool key F6 solution, unsucessfull.

By the moment, the solution is to kill AA, and resume when i have finished the reverse operation, but this is a very bad solution. :(

MarcoA
Could you please desribe how do you run your script? Are you sure that F6 key press is caught?

jimenoma
Posts: 5
Joined: Thu May 16, 2019 3:48 pm

Re: USB WEBCAM for back-up camera

Post by jimenoma » Mon May 20, 2019 5:09 pm

Hi:

Basically:

the script is a python program with user pi that when detect the camera id (PSP eye) is on:
dev = usb.core.find(idVendor=0x1415, idProduct=0x2000)

then it calls OS:
os.system("DISPLAY=:0 cvlc --fullscreen --video-on-top v4l2:///dev/video0 --demux h264")

When AA is not connected to mobile, the VLC runs properly on the top.
But if AA is connected to the mobile, VLC runs "behind" the AA app.

I dont use GPIO input for shooting the program when reverse is activated, because this is not a fixed mounting on the dashboard, and is easier to connect one or two usbs than GPIO inputs. The system is on a Land Rover Defender.

I think that a solution could be (another users "Allow native support of USB cameras") to simulate from command that the mobile is disconnected and later when finish the reverse operation connect again.

Thanks,

Marco

Post Reply