Using the Yi for scheduled video recording.

humble

New Member
Joined
Aug 29, 2016
Messages
6
Reaction score
0
Country
United States
Hello~

I'm in the process of trying to design/implement a video recording system, based on the Yi. Any advice/assistance that you may have, will be greatly appreciated.

Little background:
  • I have a NAS box, in this case it's a Netgear ReadyNAS based system with about 9TB of usable space.
  • This NAS is accessible a number of different ways, including CIFS/NFS/FTP/UPNP/etc.
  • The goal of the NAS, is to capture all of the raw video from all of the cameras, and store it for XX amount of time.
  • Ultimately we're working on scripts to auto-pull all of the video from all of the Yi's, and then auto-upload it all to Youtube under private channels, so we can link the videos back to our paid subscribers/users.
  • I have the Yi's configued in Wifi Client mode, with static IPs, with Telnet & FTP on autostart.
  • Initially i'm starting with 3 cameras, but in this setup we plan to scale to 10.
  • My goal is to pull out the batteries, and run the cameras on 5V USB power 24/7. (I can add heat sinks / custom 3D printer enclosures if needed)
  • We plan to wall mount each camera on a pan/tilt ball joint type mount
  • We can use windows/linux scripts on the LAN to pull the video's off the cameras, and push them to the NAS.
  • We can also use these boxes, to perform our Youtube upload any other functions that the cameras can't do native.

Ok, so where i'm struggling at this part of my POC implementation...
  1. How to get the cameras to start/stop recording at specific times of the day.
  2. Is it possible to have the camera's auto-push videos from MicroSD directly to the NAS using rsync or other?
  3. Is it potentiality possible to mount the NAS NFS export over Wifi, and just record directly to the NAS (assuming Wifi strength/bandwidth permits)
  4. Any gotcha's when using USB power 24/7?

The NetGear has a licensed package called ReadyNAS Surveillance. It's got a lot of cool functionality, I would love to use or reproduce. Including the ability to add/discover cameras. And more importantly configure the recording schedule for each. It has some nice real-time playback functions, that aren't required but would be nice. Unfortunately in the 2000 cameras it does support the Yi isn't one of them. I don't believe it's technically an IP camera, and i'm not entirely trying to use it as one, as I want 1080p 30fps video from each camera.

This 1st attempt i'm working on, is for a buddy who owns a UFC/MMA based gym, and wants to record his daily training sessions, and then offer the footage back to his clients, so they can watch the sessions.

If any hardcore developers or scripters want to seriously assist me in this project, we can discuss potential compensation on this initial POC implementation, and future implementations based on the same canned package.

I could see this having some serious resale potential, once all the features are implemented, and the quality of the cameras at the price, with any custom baked NAS solution, and then using Youtube for the streaming/hosting, with private links back to a Website.

The use cases are potentially enormous.

Thanks in advance, look forward to any comments, even criticism :)
 
1. I believe there was some work to do ntp based timings if you search around.
2&3. Maybe, though it seems slightly more reliable in my usage to pull from the camera instead of relying on the camera to do anything other than take pics.
4. I've run a couple yi's for >24 hours on usb power a couple of times without issue. I take the batteries out, though.

Action cameras are generally ill-suited for the use you're attempting. I'd look into a more viable solution, really, particularly since there's a commercial aspect to it and you have some money to spend. I think you'd end up with a better long-term solution that way and less duct-tape-and-bubble-gum sort of thing.
 
1. I believe there was some work to do ntp based timings if you search around.
2&3. Maybe, though it seems slightly more reliable in my usage to pull from the camera instead of relying on the camera to do anything other than take pics.
4. I've run a couple yi's for >24 hours on usb power a couple of times without issue. I take the batteries out, though.

Action cameras are generally ill-suited for the use you're attempting. I'd look into a more viable solution, really, particularly since there's a commercial aspect to it and you have some money to spend. I think you'd end up with a better long-term solution that way and less duct-tape-and-bubble-gum sort of thing.

Thanks for the tips and advice.

Most of the systems i've seen use IP based cameras that stream video to a recording device, which supports multiple cameras and fully baked scheduling. The vast majority are more for surveillance purposes, and not so much HD video. The problem being the 1080p 30FPS quality systems are in the $10k+ and could easily go to $50k for a 10-20 camera solution with a commercial software license.

That being said, the Yi @ $70 has the video quality I want, runs a Linux OS, so I'm hoping to exploit that fact, and get the minimal functionality I need out of the camera, and develop a mostly open-source based solution, and the tie it together with a few custom pieces of script/code. I have a few Web guys who could potentially build a control app, but I have to tell them how to interface with my Camera+NAS solution. i.e. Do we telnet to the cameras and push commands, do we CRON job the cameras to record without remote control options, and how do we edit the schedule going forward etc.

I'm not entirely convinced that a duct-tape and bubble-gum solution isn't entirely what i'm after right now, because once that nutt is cracked, taking it to the commercial level seems easy.
 
Still struggling here, if anyone has any advice. Also wasnt able to find the NTP based recording schedule thread.
 
If I had to do the same thing you want, I think I will :
- Run the Yi in wifi client mode
- Use the C&C python code from Andy_S to remote control the Yi from the NAS
 
If I had to do the same thing you want, I think I will :
- Run the Yi in wifi client mode
- Use the C&C python code from Andy_S to remote control the Yi from the NAS

I'm struggling a bit here... I have my Yi in Wifi Client mode, can telnet/FTP/ping it.

I have the latest and greatest Python 2.7 installed with the python-tk package added.
When I try the Camera_Get.py script , I was successfull once...
Ever since then, no matter what I try, I can't communicate with the camera at all.
I can see the connection open via netstat on the camera on port 7878, from my linux based NAS.
But it just hangs forever.
 
Making some progress (finally)... Using straight up telnet and JSON commands, we have a basic proof of concept in place. We can remote trigger the camera record/stop functions, which conveniently returns the path to the video on the MicroSD. Using regex to filter that file, we can pass that to wget (http or ftp) and pull down the video to the NAS.

Some interesting findings so far... we're limited by wifi strength for file copy bandwidth. (obviously, but it was more potent then we expected).
i.e. We got anywhere from 30KBs to about 510KBs depending on how close we put the camera to the Wifi router. All our cameras are going to be wall mounted around a large gymnasium, so data via USB, or manually retrieving the MicroSDs for data xfer is out of the question :)

Next steps, wrapping a WebGui around camera setup/config, a customizable recording schedule, and the underlying scripts that push the schedule to the cameras.

Future projects include adding uPNP/DNLA to the NAS, pointing it to the video archive directory, so we can setup streaming directly from the NAS.
(Not part of our project goals, but why not...), and ultimately this could be ported to a video surveillance function of this system.

Again our function is primarily HD video recording , archiving, and uploading to YouTube, so it can be streamed back down to members of the Gym we're building the system for. But who wouldnt wan't a HD video recording system for the price of a few Yi's & a linux based NAS?

Few more questions, if anyone has ideas...
1) Is the 500KBs for FTP/HTTP file transfer over Wifi Client mode the max we should expect?
- I thought I saw video streaming directly from the camera/wifi reach > 1.5MBit/s
- Is it something to do with the service running at a low background priority or something?
- Any ideas / protocols / methods for faster file xfer over Wifi would be awesome.

2) Any good open source references for examples of a daily/weekly recording schedule, that can be customized?
- Doesn't have to be video related, but some video surveillance packages out there are spot on for what we're doing

3) Thoughts on video quality/size for our purpose, and how it pertains to limits/issues on pulling the files down and ultimately uploading to Youtube?
- We'll have to play with our video quality to optimize our file size per 1hr of recording. (Classes are generally 1hr in length)
- We expect each camera will record about 4-6hrs a day. (Sometimes back-to-back for multiple sessions)
- So let's say we have 18hrs of non-recording time, the camera's are available for uploading all video to the NAS
hours minutes seconds @KB/s KB MB GB​
18 1080 64800 500 32,400,000 31,641 31
- My mathz says each camera could potentially record up to 31GB/day (6hrs recording / 18hrs copying)
- Assuming that the NAS can sustain 5MB/s random writes coming from 10x streams [fairly safe assumption]
- Assuming the Wifi Network doesnt poop over 10x Cameras doing copies at the same time :)
 
Back
Top