Results 1 to 7 of 7

Thread: Streaming from NDI to Facebook with ffmpeg

  1. #1
    Registered User
    Join Date
    Apr 2017
    Location
    Massachusetts
    Posts
    142

    Streaming from NDI to Facebook with ffmpeg

    Last night I ran into a show-stopping issue with my TC1, namely the "Missing or Invalid broadcast URL or Stream ID" error when trying to stream to Facebook.

    After rebooting and logging out of Facebook and back in, then doing a special dance, I gave up on the TriCaster and figured out how to stream directly to Facebook with ffmpeg.

    ffmpeg is a free and insanely powerful tool, and NewTek has included a version pre-compiled with NDI support with their Windows NDI SDK.

    I am using a Mac, and compiled my own version of ffmpeg with NDI since NewTek won't, but they work the same way.

    This guide assumes you are capable of opening and interacting with a command line (cmd) window.

    1. Obtain NDI-enabled ffmpeg (compile your own or get the Windows version from the NDI SDK: https://www.newtek.com/ndi/sdk/ )
    2. Go to https://www.facebook.com/live and click "Go Live" in the upper right corner
    3. Change the tab from "Camera" to "Connect"
    4. Make sure "Use SSL" and "Use persistent stream key" are unchecked
    5. You will see your rtsp URL and stream key on the "Connect Your Live Stream to the Live API" Page, combine them into one URL and note it down:
    Server Url: rtmp://live-api-s.facebook.com:80/rtmp/
    Stream Key: 101XXXXXXXXXXXXXX?ds=1&s_vt=api-s&a=ATivxXXXXXXXXXX
    Server URL + Stream Key = rtmp://live-api-s.facebook.com:80/rtmp/101XXXXXXXXXXXXXX?ds=1&s_vt=api-s&a=ATivxXXXXXXXXXX
    6. Open a command line and navigate to your NDI-enabled ffmpeg


    Here is a sample ffmpeg command to get you started. I'll go through each option to explain what it does:

    Code:
    ffmpeg.exe -f libndi_newtek -i "NC1IO-RCTV (IN 4)" -vf yadif -c:v libx264 -preset veryfast -crf 20 -c:a aac -f flv "rtmp://live-api-s.facebook.com:80/rtmp/101XXXXXXXXXXXXXX?ds=1&s_vt=api-s&a=ATivxXXXXXXXXXX"
    ffmpeg.exe: Must be the NDI-enabled version
    -f libndi_newtek: Tells ffmpeg to use the NDI plugin
    "NC1IO-RCTV (IN 4)": Tells the NDI plugin to ingest this particular NDI feed, wrapped in quotes due to spaces and odd characters
    -vf yadif: Tells ffmpeg to apply the "yadif" video filter to the source. My source is 1080i60 and I want to deinterlace it nicely, you can omit this if your source is progressive
    -c:v libx264: Tells ffmpeg to reencode the source video using the libx264 codec (MPEG-4)
    -preset veryfast: Tells libx264 to use the "veryfast" encoding preset
    -crf 20: Tells libx264 to use a crf (constant rate factor, basically the quality level) of 20, an alternative to forcing a specific bitrate
    -c:a aac: Tells ffmpeg to reencode the source audio using the aac codec with default options
    -f flv: Tells ffmpeg to make the output container format flash video compatible (required by Facebook)
    "rtmp://live-api-s.facebook.com:80/rtmp/101XXXXXXXXXXXXXX?ds=1&s_vt=api-s&a=ATivxXXXXXXXXXX": Your combined Stream URL + Stream key, wrapped in quotes for compatibility

    Hope this can help someone!
    Last edited by lukerctv; 07-11-2018 at 10:44 AM.
    TriCaster TC1 #1
    TriCaster TC1 #2
    NC1 Studio I/O Module
    TriCaster Mini SDI Advanced #1
    TriCaster Mini SDI Advanced #2
    Video Nerd

  2. #2
    'the write stuff' SBowie's Avatar
    Join Date
    Feb 2003
    Location
    The stars at night are big and bright
    Posts
    18,706
    AFAIK, streaming to Facebook is busted (thanks Facebook). This is being addressed as a matter of urgency, but my understanding is that a bunch of people have been similarly affected without any warning, not just TC.
    --
    Regards, Steve
    Forum Moderator
    ("You've got to ask yourself one question ... 'Do I feel lucky?' Well, do ya, spammer?")

  3. #3
    Product and Vertical Market Manager - Digital Broadcast
    Join Date
    Sep 2005
    Location
    NewTek
    Posts
    1,583
    The custom streaming method still works https://support.newtek.com/hc/en-us/...-Custom-Stream.
    Zane Condren
    Product and Vertical Market Manager - Digital Broadcast
    NewTek Inc.
    new.tk/call

  4. #4
    Registered User
    Join Date
    Jan 2018
    Location
    Winter Park
    Posts
    151
    Are you trying to record an mp4 to disk on the same encoder channel you are trying to send to Facebook?

  5. #5
    'the write stuff' SBowie's Avatar
    Join Date
    Feb 2003
    Location
    The stars at night are big and bright
    Posts
    18,706
    Quote Originally Posted by stp_productions View Post
    Are you trying to record an mp4 to disk on the same encoder channel you are trying to send to Facebook?
    Different issue...
    --
    Regards, Steve
    Forum Moderator
    ("You've got to ask yourself one question ... 'Do I feel lucky?' Well, do ya, spammer?")

  6. #6
    Registered User
    Join Date
    Jun 2012
    Location
    peru
    Posts
    359
    for a quick solution, i think is possible install on a PC virtual input app from NDI tools. go to facebook- fanpage- publishing tools-live and choose Camera.
    on camera device on the left select the NDI source that virtual input gets

    i will test now

    Tricaster is the best thing that i've used since I played with my atari
    Gear Used:
    Tricaster: All 3Play:440
    Cam: JVC GY-HM600, GY-HM150U
    Facebook
    Twitter

  7. #7
    Product and Vertical Market Manager - Digital Broadcast
    Join Date
    Sep 2005
    Location
    NewTek
    Posts
    1,583
    Facebook resolved the issue on their end.
    Zane Condren
    Product and Vertical Market Manager - Digital Broadcast
    NewTek Inc.
    new.tk/call

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •