Legacy App - Knowledge Base

FFmpeg Live Streaming on the Dacast Platform for MacOS (Legacy App)

By Jose Guevara

5 Min Read

author avatar

Jose Guevara

Jose is a part of the Dacast Customer Onboarding team and started working with the company in 2016. He has vast experience in customer service/engagement and live streaming support.

Table of Contents

    Share this post

    Table of Contents

      You are here:
      < Back

      Are you interested in streaming on Dacast under Mac OS with ffmpeg? This guide provides a step-by-step explanation to get you started!
      To stream on Dacast under Linux with ffmpeg, click here.

      Requirements:

      You will need to compile ffmpeg with the help of brew (https://brew.sh/) and specific librtmp parameters detailed below.

      Development tools:

      Before getting started, please make sure to install the brew package manager and have an updated version of Xcode Command Line Tools included for free with your Mac OS distribution.
      For more information on how to install Xcode Command Line Tools, please click here.

      To install brew, just copy-paste in your terminal:

      /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

      Then, follow the instructions.

      Installation:

      1. librtmp, libx264, libfdk-aac

      • First, install  librtmp with brew
      $ brew install librtmp
      • Then, install  libx264 with brew
      $ brew install libx264
      • Finally, install  libfdk-aac with brew
      $ brew install fdk-aac

      2. ffmpeg

      Install ffmpeg with all the specific libraries:

      brew install ffmpeg --enable-libfdk-aac --with-x264 --with-rtmpdump

      Usage

      Open your Web Browser, navigate to the Dacast website, and then access your live channel’s settings. Once there, please browse to the Encoder Setup section, as pictured below:

      ffmpeg

      From here, make sure to select Other RTMP Encoder.

      ffmpeg

      At this point, you should see the following information on your screen.

      ffmpeg

      Once here, you’ll need the following data:

      Login 123456
      Password 789123
      Stream URL rtmp://p.ep246802.i.akamaientrypoint.net/EntryPoint
      Stream Name dclive_1_1@246802

      Next, please run the following command:

      $ ffmpeg -re -f lavfi -i testsrc -c:v libx264 -b:v 1600k -preset ultrafast -b 900k -c:a libfdk_aac -b:a 128k -s 1920x1080 -x264opts keyint=50 -g 25 -pix_fmt yuv420p -f flv "rtmp://p.ep246802.i.akamaientrypoint.net/EntryPoint flashver=FMLE/3.020(compatible;20FMSc/1.0) live=true pubUser=123456 pubPasswd=789123 playpath=dclive_1_1@246802"

      Important Notes (please read carefully)

      Note 1: if your credentials are rejected
      You must have followed all the steps above and the librtmp manual compilation or this is not gonna work: your credentials will be rejected by the server.

       

      Note 2: common error
      A recurring typo in fdk aac usage is that, during the installation process, you need to enter “–enable-fdkaac” but when you use it in the command it is: “-c:a libfdk_aac”

       

      Note 3: insert your source  path
      You want to replace

      -f lavfi -i testsrc

      with

      -i /your_source_path

      Otherwise, you will just have the test screen (as shown below), not your live stream. If you have not replaced “-f lavfi -i testsrc” with “-i /your source path”, you will see the following test screen:

      ffmpeg

       

      Note 4: increase buffer for smoother playback
      If your playback is not smooth enough, you can increase the size of your buffer by replacing:

      -b 900k

      with

      -bufsize 3000k

      Your command will look like this:

      $ ffmpeg -re -i /your_source_path -c:v libx264 -b:v 1600k -preset ultrafast -bufsize 3000k -c:a libfdk_aac -b:a 128k -s 1920x1080 -x264opts keyint=50 -g 25 -pix_fmt yuv420p -f flv "rtmp://p.ep246802.i.akamaientrypoint.net/EntryPoint flashver=FMLE/3.020(compatible;20FMSc/1.0) live=true pubUser=123456 pubPasswd=789123 playpath=dclive_1_1@246802"

       

      Note 5: better quality for powerful system
      If you want better quality and your system is powerful enough, you may replace

      -preset ultrafast

      with

      -preset fast

      Your command will look like this:

      $ ffmpeg -re -i /your_source_path -c:v libx264 -b:v 1600k -preset fast -b 900k -c:a libfdk_aac -b:a 128k -s 1920x1080 -x264opts keyint=50 -g 25 -pix_fmt yuv420p -f flv "rtmp://p.ep246802.i.akamaientrypoint.net/EntryPoint flashver=FMLE/3.020(compatible;20FMSc/1.0) live=true pubUser=123456 pubPasswd=789123 playpath=dclive_1_1@246802"

       

      Note 6: lowest latency for very powerful system 
      If your goal is to get the lowest latency and you have a very powerful system, you may add the following to the initial command:

      -tune zerolatency

      Your command will look like this:

      $ ffmpeg -re -i /your_source_path -c:v libx264 -b:v 1600k -preset ultrafast -tune zerolatency -b 900k -c:a libfdk_aac -b:a 128k -s 1920x1080 -x264opts keyint=50 -g 25 -pix_fmt yuv420p -f flv "rtmp://p.ep246802.i.akamaientrypoint.net/EntryPoint flashver=FMLE/3.020(compatible;20FMSc/1.0) live=true pubUser=123456 pubPasswd=789123 playpath=dclive_1_1@246802"

      Feel free to get in touch with Dacast directly if you need further support with this process.

      author avatar

      Jose Guevara

      Jose is a part of the Dacast Customer Onboarding team and started working with the company in 2016. He has vast experience in customer service/engagement and live streaming support.

      Sign up for a 30-Day trial.

      Read Next

      article featured

      Can I Add Subtitles to Video Content on Dacast?

      author avatar

      Harmonie Duhamel

      3 Min Read

      article featured

      How to Get an M3U8 Live Stream URL Link for Your Live Streaming Channels

      author avatar

      Jose Guevara

      5 Min Read

      article featured

      Does Dacast Support X264 Streaming?

      author avatar

      Harmonie Duhamel

      4 Min Read