In this tutorial, we will dig in to the tips and tricks with tools as a follow up of our tutorial five minute streaming tutorial or our API but not seeing streams play back. We will explore this in depth to help debug the errors.
For the livepeer.com UI, you’ll find your playback URL on that specific stream’s page. The URL to that stream page should look something like this: livepeer.com/dashboard/streams/7d91a8d4-c9df-45e3-abe3-dcdeb26ab2aa.
If you’re using the API directly, take a look at this guide on finding your playback URL by combining a base URL with a playbackId. If you don't know your stream playbackId, you can retrieve it via a GET request to the stream endpoint, followed by the stream’s id: GET /stream/<stream-id>.
Once you have access to a video player in your own application, or to a test player you typically use, determine what issue you’re having when loading the playback URL into the player:
If you don’t have a player you’re testing with, or if the issue is happening in a player you don’t have access to, go onto the next step.
Load the playback URL in Livepeer.com test player. If you get a "Stream not found" error, confirm that your URL is correct. It should look something like this: https://cdn.livepeer.com/hls/123456abcdef7890/index.m3u8
Once you load your Playback URL into the Livepeer Test Player, does anything play back?
Check the stream status below the Livepeer.com test player. Is it active?
Confirm your or your streamer’s broadcast software RTMP configuration is set up properly. If you are using OBS to stream into Livepeer, check out steps 4-5 in this blog post and make sure all looks correct on your end.
Is there only one profile listed next to Playback settings below the Livepeer.com test player?
Make sure your broadcasting workflow is stable - the RTMP stream hitting Livepeer's ingest server seems to be having issues.There may be something wrong with your source stream. If you can, set the keyframe interval to 2 in your/your streamer’s broadcasting software. Try ensuring a stronger internet connection at the source via a wired ethernet connection or by broadcasting on a more reliable network. If the resolution, FPS and/or bitrate of the source stream is very high and if your internet bandwidth is low, playback will be slow and choppy. Consider transcoding your livestreams.
For advanced users: see addendum to learn about curling your playlist to extract information from your playback URL directly.
Make a GET request to the Livepeer API stream endpoint with your stream-id to check the stream’s profiles. Do all of the profiles have the same FPS?
For advanced users: see addendum to learn about curling your playlist to extract information from your playback URL directly.
Go back to the Livepeer.com test player and make sure your playback URL is loaded.
The left player shows your source stream, as served by the Livepeer.com CDN with the transcoded renditions via the playback URL. This player is configured to only playback the highest resolution available. Except for in rare occasions, the highest resolution is the non-transcoded source stream i.e. the stream sent from your broadcast software.
Compare the source video in the left player with the transcoded renditions in the right player. On the right player, you can manually switch between transcoded renditions by clicking on the ⋮ symbol in the lower right corner of the player. Does the transcoded video on the right player show more problems than the source video on the left player?
Take a look at some background information on important parts of the video playback experience. The HLS and Manifest Files sections are especially relevant.
An easy and quick way to make sure video is being ingested into Livepeer and transcoded is to curl your Livepeer playback URL in your terminal. Example: `curl https://cdn.livepeer.com/hls/6a35pdxxxxxxxxxx/index.m3u8`. You could use this curl command to replace steps 6 and 7 in the above debugging guide.
If curling the playback URL outputs an error, make sure you are streaming video into the RTMP ingest URL that matches the region of your playback URL, and go back to step 1 of this guide to continue debugging.
We’ll break down what a non-error response means below, but it should look something like this:
#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2650912,RESOLUTION=1792x1120,FRAME-RATE=30,CODECS="avc1.640028,mp4a.40.2"
1_0/index.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=539704,RESOLUTION=1280x800,FRAME-RATE=29.97,CODECS="avc1.4d4020,mp4a.40.2"
2_0/index.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=256352,RESOLUTION=854x534,FRAME-RATE=29.97,CODECS="avc1.4d401f,mp4a.40.2"
3_0/index.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=222792,RESOLUTION=640x400,FRAME-RATE=29.97,CODECS="avc1.4d401e,mp4a.40.2"
4_0/index.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=179976,RESOLUTION=426x266,FRAME-RATE=29.97,CODECS="avc1.4d4015,mp4a.40.2"
5_0/index.m3u8
The response is a list of rendition “manifests”, which tells a player what different streams and corresponding resolutions/bitrates are available for playback (read here for more background info on resolutions/bitrates). The player then uses the list to select the most appropriate stream to display.
Each line starting with `EXT-X-STREAM-INF:` represents a different rendition. If you take a look at the first one, you’ll see that that rendition’s resolution is `1792x1120` and its FPS or frame rate is 30. We can see that this source stream is being transcoded into 5 different renditions that all have the same FPS, with give or take a .03 of a difference.
What did you think of this guide? Get in touch with any thoughts or questions at hello@livepeer.com.