Raspberry Pi Youtube/Facebook Live Video Streamer with Sixfab 3G, 4G/LTE Shield

Sixfab 3G, 4G/LTE Base Shield with appropriate module provides very high speed internet connection. Use Raspberry Pi camera and you can make live stream to Youtube and Facebook. You can use the following transactions for work.

  1. First follow PPP installer or QMI interface to connect your Raspberry Pi to the internet.
  2. For live stream you can use FFMpeg.
    1. Install h264 Support
      • cd /usr/src
      • git clone git://git.videolan.org/x264
      • cd x264
      • ./configure –host=arm-unknown-linux-gnueabi –enable-static –disable-opencl
      • make
      • sudo make install
    2. Install FFMpeg
      • cd /usr/src
      • git clone https://github.com/FFmpeg/FFmpeg.git
      • cd FFmpeg
      • sudo ./configure –arch=armel –target-os=linux –enable-gpl –enable-libx264 –enable-nonfree
      • make if you have a Model B+ and later version, you can use make -j4 instead of just make to take advantage of all four cores!
      • sudo make install
  3. Signup for a Facebook or Youtube account and get [SERVER URL]/[STREAM NAME]
  4. At last, run this command to start live
    raspivid -o - -t 0 -vf -hf -fps 30 -b 6000000 | ffmpeg -re -ar 44100 -ac 2 -acodec pcm_s16le -f s16le -ac 2 -i /dev/zero-f h264 -i - -vcodec copy -acodec aac -ab 128k -g 50 -strict experimental -f flv [SERVER URL]/[STREAM NAME]

     

23 thoughts

  1. Excellent tutorial! Works perfectly for YouTube.

    For Facebook, if you get a “BAD_AUTH” / “Operation not permitted” error, try adding quotes around the RTMP server string that you enter in the final step.

    *Example error message:*
    Server error: Error publishing stream: code=9, msg=ERR, BAD_AUTH, URL=Domain: live-api-s.facebook.com, url: /rtmp/1234567890?ds=1
    rtmp://live-api-s.facebook.com:80/rtmp/1234567890?ds=1: Operation not permitted

    *Solution*
    raspivid -o – -t 0 -vf -hf -fps 30 -b 6000000 | ffmpeg -re -ar 44100 -ac 2 -acodec pcm_s16le -f s16le -ac 2 -i /dev/zero -f h264 -i – -vcodec copy -acodec aac -ab 128k -g 50 -strict experimental -f flv “[SERVER URL]/[STREAM NAME]”

    Credit: https://raspberrypi.stackexchange.com/questions/54756/ffmpeg-raspberry-pi-to-facebook-live-stream

  2. Hello, I’m interested to your 3g/4g shield, plus the EC25-E module, plus the LTE full band BCB antenna…. However it seems that this shield can be controlled only by AT commands. Is it correct? On the other hand, currently I’m simply looking for a HAT board that could simply provide 3g or 4g connectivity (like as commercial internet key, but with a higher level of stablility). Do you think your shield satisfy my requirements?

  3. Hello my team and I are receiving the error of protocol not found when we are trying to stream over to Facebook live any suggestions or comments on how we can fix the issue would be greatly appreciated.

    • Hello,

      Did you check if you have an active internet connection?
      Which interface are you using for internet connection?
      Could you please share the whole log?

      • ffmpeg version N-93640-ga087764847 Copyright (c) 2000-2019 the FFmpeg developers
        built with gcc 6.3.0 (Raspbian 6.3.0-18+rpi1+deb9u1) 20170516
        configuration: –arch=armel –target-os=linux –enable-gpl –enable-libx264 –enable-nonfree
        libavutil 56. 26.100 / 56. 26.100
        libavcodec 58. 52.100 / 58. 52.100
        libavformat 58. 27.103 / 58. 27.103
        libavdevice 58. 7.100 / 58. 7.100
        libavfilter 7. 49.100 / 7. 49.100
        libswscale 5. 4.100 / 5. 4.100
        libswresample 3. 4.100 / 3. 4.100
        libpostproc 55. 4.100 / 55. 4.100
        Guessed Channel Layout for Input Stream #0.0 : stereo
        Input #0, s16le, from ‘/dev/zero’:
        Duration: N/A, bitrate: 1411 kb/s
        Stream #0:0: Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s
        mmal: Cannot read camera info, keeping the defaults for OV5647
        mmal: mmal_vc_component_create: failed to create component ‘vc.ril.camera’ (1:ENOMEM)
        mmal: mmal_component_create_core: could not create component ‘vc.ril.camera’ (1)
        mmal: Failed to create camera component
        mmal: main: Failed to create camera component
        mmal: Camera is not detected. Please check carefully the camera module is installed correctly

        [h264 @ 0x2bd7db0] Could not find codec parameters for stream 0 (Video: h264, none): unspecified size
        Consider increasing the value for the ‘analyzeduration’ and ‘probesize’ options
        Input #1, h264, from ‘pipe:’:
        Duration: N/A, bitrate: N/A
        Stream #1:0: Video: h264, none, 25 tbr, 1200k tbn, 50 tbc
        Codec AVOption g (set the group of picture (GOP) size) specified for output file #0 (rtmps://live-api-s.facebook.com:443/rtmp/]/[888957638120330?s_sw=0) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
        rtmps://live-api-s.facebook.com:443/rtmp/]/[888957638120330?s_sw=0: Protocol not found

        • We manged to fix the camera issue, but it doesn’t seem to like the [Stream URL]/[Stream Name] part of the command. We are always met with “Protocol not found”. Are brackets included or not?

  4. I guess you’re too busy to reply. I’ll be reviewing this product online as well as reviewing the quality of tek support offered.

  5. I have QMI running on my RPI 4 and i get error when doing setup for this

    cd /usr/src
    git clone git://git.videolan.org/x264

    git clone git://git.videolan.org/x264
    fatal: could not create work tree dir ‘x264’: Permission denied

    Whats is wrong here, sudo in front of git wont help

Leave a Reply

Your email address will not be published. Required fields are marked *