how to stream to stereo-pi apk ?

OpenCV, Python and other image processing questions
Post Reply
User avatar
zoldaten
Posts: 48
Joined: Fri Apr 26, 2019 7:07 am

how to stream to stereo-pi apk ?

Post by zoldaten »

hi!

i use python image opencv from your source.
cameras work well.
i simply want to stream in stereomode to stereopi application :
https://play.google.com/store/apps/deta ... eopi&hl=en

how to do that without using SLP image ?

User avatar
Realizator
Site Admin
Posts: 900
Joined: Tue Apr 16, 2019 9:23 am
Contact:

Re: how to stream to stereo-pi apk ?

Post by Realizator »

Hi Zoldaten,
To say briefly - it is really difficult. OpenCV is not so good at live stream. And also our application is focused on RAW H264, not friendly for OpenCV.
You can use one special approach. Like capture a video, "split" it into two streams, and use one stream for the live stream, and another for the OpenCV processing. You need to use a pipe for this. We use this approach in SLP image, to do recording/live stream to the browser/live stream to the application simultaneously. If you'll look into our code, you can find a "splitter" binary. It does this works.
Eugene a.k.a. Realizator

User avatar
zoldaten
Posts: 48
Joined: Fri Apr 26, 2019 7:07 am

Re: how to stream to stereo-pi apk ?

Post by zoldaten »

Thanks for fast answer.
I really dont need opencv at this point - i mean i just use image with openCV (not SLP).
Do you have any ready-to-use scripts to start streaming in stereomode to apk ?

ps. i dont use SLP image cause of ready-only system troubles, lack of opencv installed, etc.

pps.
As to opencv streaming - not bad solution is here -
https://www.pyimagesearch.com/2019/04/1 ... -imagezmq/
But cameras work separately.

User avatar
Realizator
Site Admin
Posts: 900
Joined: Tue Apr 16, 2019 9:23 am
Contact:

Re: how to stream to stereo-pi apk ?

Post by Realizator »

Hi Zoldaten,
Actually mentioned pyimagesearch livestream solution is not so good. Try this way to get insights :-) It is for another purposes, not for the real-time low-latency.
As for the scripts:
1. Take a look at the /opt/StereoPi/scripts/video-source.sh
The last row activates the livestream. Here is this code:

Code: Select all

    	./bin/raspivid -t 0 $DEC_STR $UP_DOWN -w $video_width -h $video_height -fps $video_fps --bitrate $video_bitrate --profile $video_profile $VMOD_STR $PREVIEW3D --intra $video_fps --inline --flush --awb $video_wb --exposure $exposure --sharpness $sharpness --contrast $contrast --digitalgain $digitalgain -o - | ./bin/splitter -c 127.0.0.1:5000,127.0.0.1:3001$UDP_CLIENTS_LIST$USB_DST$MPEGTS_DST$RTMP_DST$REC_DST$SKYBOX_MPEGTS_DST -m 1400
2. Instead of PHP parameters you can use a digits you need (like replacing $video_fps with the 30). You can find all parameters description in this file (they are actually taken from the admin panel GUI).

3. Grab /opt/StereoPi/bin/splitter binary, put it in your Raspberry OS.

4. If you need a stereoscopic preview on HDMI - also take our fixed raspivid here: /opt/StereoPi/bin/raspivid. If you don't need it, use a system raspivid, but remove a key "-fs" (i.e. $PREVIEW3D variable). This key is supported by our version of raspivid only, it forces the stereoscopic preview on HDMI poutput.

5. Our application usually listening for the port 3000. So if you know the IP address of your Android device, put it in this line as a UDP client. This should work.
Eugene a.k.a. Realizator

User avatar
zoldaten
Posts: 48
Joined: Fri Apr 26, 2019 7:07 am

Re: how to stream to stereo-pi apk ?

Post by zoldaten »

Hi!

As there is no dir named /opt/StereoPi/ in image with OpenCV, i copied it in from such image.
Then tried to start video-source.sh - seen no errors in cmd.
But no any video-streams on http://127.0.0.1:5000 or 127.0.0.1:3000

After that i tried in cmd raw command:

./bin/raspivid -t 0 $DEC_STR $UP_DOWN -w $video_width -h $video_height -fps $video_fps --bitrate $video_bitrate --profile $video_profile $VMOD_STR $PREVIEW3D --intra $video_fps --inline --flush --awb $video_wb --exposure $exposure --sharpness $sharpness --contrast $contrast --digitalgain $digitalgain -o - | ./bin/splitter -c 127.0.0.1:5000,127.0.0.1:3001$UDP_CLIENTS_LIST$USB_DST$MPEGTS_DST$RTMP_DST$REC_DST$SKYBOX_MPEGTS_DST -m 1400

but it asked me to put all the parameters - width, height, etc. - so no result.

More over tried just boot up using sd-card with SLP image installed - but surprisely booted from EMMC (
As far as i remember - sd-card should have a priority in booting ?

Whats wrong ?

Post Reply