Stream from 4k through Raspberry Pi to MATLAB

oduross

New Member
Joined
Feb 6, 2019
Messages
1
Reaction score
0
Country
United States
Good evening,

I would like to stream live video from a Yi 4K to MATLAB running on a PC, but I still do not know how to view a stream without sending it to Facebook or YouTube.
I also saw on the MATLAB website it says "The URL must be for a Motion JPEG (mjpeg) HTTP or RTSP stream, so the URL must start with http", so this is also something else I will need to plan for.

I have connected to it as root via telnet, so I can modify files on the Yi 4k. I also have a Raspberry Pi I would like to use as a WiFi / Video stream relay in the future as well, and can also potentially use this to do some video stream conversions if necesarry.

I saw here...
https://dashcamtalk.com/forum/threads/using-xiaomi-yi-sports-camera-with-iphone-and-vlc.10436/page-2
and here...
https://dashcamtalk.com/forum/threads/yi-4k-action-camera-research.19928/
it said use...
{"msg_id":257,"token":0,"param":0}
on reply get "param" parameter is a token

Yi 4K
> {"msg_id":257,"param":0,"token":0,"heartbeat":1}
<< {"rval":0,"msg_id":257,"param":1,"model":"Z16","rtsp":"rtsp://192.168.42.1/live"}

So I am hoping I can use those tomorrow to setup the tsp server, and then relay it through the Wifi to the pi to Matlab on another computer.

Does anyone know in advance if this will work, or have suggestions for how I can make this work? I only have the camera part of the time as I am working in a group on a bigger project, and when I was working on it today I did not make a lot of progress.
 
Hello,

Long time ago you have written.
If you did not find, I may have a solution for you.

You can start and stop the inner RTSP server of the Yi with the unique button !
How ?
1/ Update your Yi with my 1.10.50 firmware (you need the event manager)
2/ Create a folder named "events" on the root of your SDcard
3/ Copy scipts from https://github.com/psolyca/Yi_4k_Events_Manager/tree/master/start_VF@button_press in the "events" folder
4/ Reboot your Yi
5/ Push the button and connect VLC (for exemple) to rtsp://YourYiAddress/live (prefer sta mode for wifi)
What it does ?
Pushing the button will start recording but this record is stopped, files created are suppressed and stream on address RTSP://YourYiAddress/live is started.
Pushing again the button will start recording but this record is stopped, files created are suppressed and stream is stopped.
Why record is started ?
Cause yet I can not bypass the standard behaviour of the button
Can I keep my files on the SDcard ?
Yes, edit the file "video_record_complete.py" in events folder with notepadd++ and add # in front of lines #16 and #17 Have to modify the script.
Remove files *.pyc in events folder

Or more simple, you can control any version of the firmware with a Python API installed on your Raspberry Pi : https://github.com/NikolayRag/Yi4kAPI (my event manager is based on this, embedded version)
 
Back
Top