FFmpeg

Using FFmpeg to publish

Requirements

  1. Dolby.io account.
  2. FFMPEG.

From the Dolby.io developer portal you will need to create your stream label. You will also need your stream token and stream name from your portal. Dolby.io Real-time Streaming allow publishing in RTMP and RTMPS.

The following are examples that will need to be updated with your stream name and token.

Update the following.

kteky1rs?token=2dcb22462b3f6800dcda6625f86f3d57a6a97f1f9e2a393cf6e98dcd4878e3eq

To ensure stutter free video use -vprofile baseline -bf 0

Dolby.io Real-time Streaming paths from the developer portal

rtmps://live-rtmp-pub.millicast.com/v2/pub/
kteky1rs?token=2dcb22462b3f6800dcda6625f86f3d57a6a97f1f9e2a393cf6e98dcd4878e3eq
rtmp://live-rtmp-pub.millicast.com:1935/v2/pub/
kteky1rs?token=2dcb22462b3f6800dcda6625f86f3d57a6a97f1f9e2a393cf6e98dcd4878e3eq

FFmpeg Options

Bitrate is 3000k -vb 3000k
Video codec is h264 -vcodec libx264
Audio channels 2 -ac 2
Audio bit rate is 96k aac -ab 96000
Audio code AAC -acodec aac
Path to video source C:\PATH\VIDEO.mp4

Publishing RTMP with video

ffmpeg -re -i C:\PATH\VIDEO.mp4 -vcodec libx264  -preset veryfast
-bf 0 -g 60 -vb 3000k -vprofile baseline -level 3.0 
-acodec aac -ab 96000 -ar 48000 -ac 2 -strict experimental -f flv
rtmp://live-rtmp-pub.millicast.com:1935/v2/pub/
kteky1rs?token=2dcb22462b3f6800dcda6625f86f3d57a6a97f1f9e2a393cf6e98dcd4878e3eq

Publishing RTMPS with video

ffmpeg -re -i C:\PATH\VIDEO.mp4 -vcodec libx264  -preset veryfast
-bf 0 -g 60 -vb 3000k -vprofile baseline -level 3.0 -acodec
aac -ab 96000 -ar 48000 -ac 2 -strict experimental -f flv 
rtmp://live-rtmp-pub.millicast.com:1935/v2/pub/
kteky1rs?token=2dcb22462b3f6800dcda6625f86f3d57a6a97f1f9e2a393cf6e98dcd4878e3eq

Publishing RTMP with RTSP source

ffmpeg -re -i rtsp://98.116.xx.xx:5545/axis-media/media.amp -vcodec libx264  -preset veryfast
-bf 0 -g 60 -vb 3000k -vprofile baseline -level 3.0 -acodec
aac -ab 96000 -ar 48000 -ac 2 -strict experimental -f flv 
rtmp://live-rtmp-pub.millicast.com:1935/v2/pub/
kteky1rs?token=2dcb22462b3f6800dcda6625f86f3d57a6a97f1f9e2a393cf6e98dcd4878e3eq

Publishing RTMP with RTSP source

ffmpeg -re -i rtsp://98.116.xx.xx:5545/axis-media/media.amp -vcodec libx264  -preset veryfast
-bf 0 -g 60 -vb 3000k -vprofile baseline -level 3.0 -acodec
aac -ab 96000 -ar 48000 -ac 2 -strict experimental -f flv 
rtmps://live-rtmp-pub.millicast.com:/v2/pub/
kteky1rs?token=2dcb22462b3f6800dcda6625f86f3d57a6a97f1f9e2a393cf6e98dcd4878e3eq

Create a batch script to loop a video.

Update the following and save at NAME.bat

@echo off
cls
:start
ffmpeg -re -i C:\PATH\VIDEO.mp4 -vcodec libx264 -preset veryfast -bf 0 -g 60 -vb 3000k
-vprofile baseline -level 3.0 -acodec aac -ab 96000 -ar 48000 -ac 2 -strict experimental
-f flv rtmps://live-rtmp-pub.millicast.com/v2/pub/
kteky1rs?token=2dcb22462b3f6800dcda6625f86f3d57a6a97f1f9e2a393cf6e98dcd4878e3eq
goto start

Testing

Open a command prompt or terminal. If successful you will see FFmpeg running.

632632

Open your viewer from the Dolby.io developer portal to stream and share.


Did this page help you?