Tuesday, November 6, 2012

Using a Raspberry pi to live stream video to Bambuser

Update: If using Raspberry pi camera module http://www.slickstreamer.info/2013/06/use-raspberrypi-csi-camera-module-to.html

This is a short tutorial how to set up a Raspberry pi to live stream to Bambuser.



We are using adafruits Occidentalis distro it should work with the regular wheezy distro.

Installing ffmpeg
  • sudo apt-get update
  • sudo apt-get install ffmpeg

alternativ use avconv
  • sudo apt-get update
  • sudo apt-get install avconv
Login to Bambuser and get your settings file. You can find it under "Standalone desktop app" and Download your authentication profile.  http://api.bambuser.com/user/fmle_profile.xml

Find the rtmp node and copy url tag and stream key

Get the url and stream id from https://bambuser.com/api/keys

ffmpeg -f video4linux2 -s 320x240 -r 30 -i /dev/video0 -metadata title="title" -f flv [url]/[id]

ffmpeg -f video4linux2 -s 320x240 -r 30 -i /dev/video0 -metadata title="my awesome video"  -f flv rtmp://1234.fme.bambuser.com/b-fme/133713371337133713371337

If using avconv it is the same parameters as for ffmpeg.

We had problem with overheating if we had the raspberry pi in an enclosure.


Marcus & Michael

Updated
Simpler way to get url and stream id. Thank you Tom and Bambuser :)




8 comments:

  1. Thank you! Been looking forward to this and will test out the theory today or tomorrow :-) Great stuff (and reblogging it at www.recantha.co.uk/blog)

    ReplyDelete
  2. Yep! That works! Fantastic stuff :-)
    http://bambuser.com/v/3137396

    ReplyDelete
  3. Nice write-up!

    I added the RTMP streaming key to https://bambuser.com/api/keys
    to make it easier to link to and a bit more human friendly:
    no need to dig through that special purpose XML file anymore.

    ReplyDelete
    Replies
    1. Awesome, thanks! You, and the other guys at Bambuser rocks on customer service :-)

      Delete
  4. hi there, to be honest i am new using raspberry pi, and i have to config a webcam for streaming a game. so could you help me telling me how can i config everything.
    thank you so much in advance

    ReplyDelete
  5. Thanks for the tutorial!
    Unfortunately I'm having trouble starting the stream. When I try tho start the ffmpeg it returns:

    Input #0, video4linux2, from '/dev/video0':
    Duration: N/A, start: 1539.396994, bitrate: 36864 kb/s
    Stream #0.0: Video: rawvideo, yuyv422, 320x240, 36864 kb/s, 30 tbr, 1000k tbn, 30 tbc
    Unable to find a suitable output format for 'flv'

    I've tried booth Occidentalis and wheezy and the error is the same. The camera is a PS Eye and the Raspberry is the 512Mb version.

    Do you have any idea on how I can get this to work?

    Thank you!

    ReplyDelete
  6. Well done! Do you know how to make another version of this but used in audio streaming? It's like those used to record calls, something that they call like outbound call center software. I'd like to connect one on my landline at home because of these prank calls.

    ReplyDelete
  7. I'm streaming the right now using this. I had to drop my framerate back a little because at 30 fps, it kept crashing.

    Side comment to Mark, check out a recent LifeHacker article about using RPi with phones:

    http://lifehacker.com/5981063/block-telemarketers-and-robocalls-for-good-with-the-raspberry-pi+powered-banana-phone

    ReplyDelete