Twitch Broadcasting Api

Hi

I am writing an app that is suppose to live stream to twitch as per link below

https://github.com/justintv/Twitch-API/wiki/Broadcasting-API

My connections settings are like

rtmp://live.twitch.tv:1935/app/MY_Stream_Key

The app seems to connect to RTMP and stream acknowledgement just fine, at-least on wireshark logs, Yet i don’t see anything on my dashboard player.

Are there any more details on Broadcasting Api? OR how to debug the RTMP stream from twitch side?

Here is pcap logs of RTMP Stream

https://www.dropbox.com/s/goj9qyi0ppaabj4/rtmp-h264-24.zip?dl=0

Thanks

I suggest adding a call to https://api.twitch.tv/kraken/ingests and populating a list of ingest locations, and then selecting the closest one.

I don’t think live.twitch.tv works all the time. (I just tried and think I had the same issue as you)

That is very informative. Question thou, the above api returns list of servers, how to know which ones are available or criteria to choose the right server. It seems that even the default cluster has availability 1

name":“US West: San Francisco, CA”,“availability”:1.0,"_id":23,“default”:true,“url_template”:"rtmp://live.twitch.tv/app/{stream_key}

Also from logs its seems that RTMP packets were acknowledged properly, so i doubt that its availability issue.

Each time your program loads, I’d request it, save it. If data exists and you got fresh data, overwrite it. If you get a blank request, API might be broken. So keep old data until you can retrieve fresh data.

Leave it to the user to select the one nearest them. Trying to use anything like GeoIP is never reliable.

Leave the value for “name” available to them in a drop down or radio list. Based on the selection set the URL template.
(Give them a field for manually setting the streamkey of course)

As for live.twitch.tv
I tested with OBS and tried to stream to it, connect was made, session ran, but for some reason my stream never went live. I assume there is some sort of de-sync or linking issue behind the scenes. I’m sure it’s being looked into.

The idea of asking user about server make sense.
On the other note, OBS streams well for me.
My question is more from rtmp debugging point of view, how to determine, if livestream is being “ACTUALLY” streamed or not? OR if in my case, if obs is working and my application is not, is there any way to debug , why it is being rejected or fault information, for stream not to be shown?

There are ways to debug but you said your app claimed to be streaming data, Did you try streaming with your app to an ingest server?

Test this…
Open you OBS and set it manually.

Mode: Live Stream
Streaming Service: Custom
FMS URL: rtmp://live.twitch.tv:1935/app/
Stream key: YOUR KEY

and try to stream. Check your stream from the webpage, is it streaming?
When I tried this, OBS said it was streaming, but the page didn’t go live, like I previously stated, it may be an issue outside of our scope and Twitch staff will have to look into it.

then change your FMS URL to your local ingest, try to stream, is it streaming?
This worked for me, and I assume for you.

If it does work from an ingest server, does the same ingest server work on your app?

If you can’t stream you might want to setup a local RTMP server (Red5 is free) and try to stream to it, watch the server side logs as well as any output you can generate from your app. I run a few Red5 servers and could probably help you get one setup.

The app is streaming to twitch ingest, if that is what you are asking. I dont have any local ingest server. Red5 on mac, is not working for me. I will give it another go thou.

It streams fine, check this https://www.dropbox.com/s/rfmul6hcs0yf7si/Screen%20Shot%202015-09-16%20at%209.48.46%20am.png?dl=0

Interesting case indeed. I’m pretty much out of ideas for you, perhaps someone else will have some good advice for you in a few hours.

If you end up stuck at debugging the RTMP let me know and I’ll see if I can help.

Thanks Thomas, The new verison of Red5 is working well on mac. Now I can do some local testing.
I will let you know the results,

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.