Sunday, 13 April 2014

BirdBoxPiCam2014: Streaming video at 30fps

Now that the female has moved on from egg-laying-mode to incubation-mode, I've switched off motion detection in favour of live streaming.

It was more of a struggle than I'd expected to get streaming working, but I can now view the action live (well, live-ish if you ignore the 3 second delay) on one or more clients running VLC.

Video can be recorded on the server (i.e. the Raspberry Pi) or on a client.

Client recording using VLC > Media > Open Network Stream... has the benefit of allowing the live feed to be viewed at the same time. The disadvantage is that any transmission data loss results in pixelation in the recording.

Server recording gives the best quality, but we lose the live video stream.

The Network is the Weakest Link

Having read a bit about video streaming with the Raspberry Pi, I settled on RTSP (Real Time Streaming Protocol) and found this info on the MyBigIdeas website.

So all I had to do was use this command on the RaspberryPi:-

raspivid -o - -t 9999999 | cvlc -vvv stream:///dev/stdin --sout '#rtp{sdp=rtsp://:8554/}' :demux=h264

...and do this using VLC on my Lubuntu laptop:-

rtsp://<>:8554/     {the IP is my RaspberryPi}

...and then it should work.

But it didn't. VLC just gave me:-

VLC is unable to open the MRL 'rtsp://'.
Check the log for details.

...and so started a few hours of internet research (which suggested it was a Samba problem, or maybe I needed Live555) and lots of tinkering.

Eventually I gave up on the internet and (as VLC refused to provide me with previously mentioned Logs) I ran cvlc from the command line.

Long-story-short, the main issue seemed to be that my Mickey Mouse network could not cope with the amount of data being chucked at it.

Success came when I lowered the image resolution, and I'm currently using this command:-

raspivid -o - -w 640 -h 480 -fps 30 -t 9999999 | cvlc stream:///dev/stdin --sout '#rtp{sdp=rtsp://:8554/}' :demux=h264

As previously mentioned, to edit this with Avidemux, I have to apply a video wrapper using MP4Box.


As my RaspberryPi has a nice fast Edimax wifi dongle, I want to try swapping out my 54Mbs Netgear DG834G wifi router (Steady but Slow) with my Netgear DGN2200 (Fast but Flakey).

How many eggs?

The female eventually laid 10 eggs, not bad for a great tit. So the plan has been updated.

Whatever happened to the robins?

Having rejected my perfectly acceptable bird box (with twin analogue cameras) earlier in the year, I managed to track down the robins this weekend.

About 4 years ago I jammed a medium sized, black flower pot into a laurel hedge in the hope that a blackbird would use it as a nest. They didn't, but this year the robin pair did.

Did you spot the chicks?

No comments:

Post a Comment