Wowza Community

JWPlayer tutorial does not show how to publish stream ?

This tutorial

https://www.wowza.com/docs/how-to-use-jw-player-with-wowza-streaming-engine

does not show the following, help please. Thank you.

  1. How to publish stream from webcam + mic

  2. How to do Apple HLS streaming for LIVE stream

The following code in the tutorial shows how to play a live stream

Hello there.

You will need an encoder to send the live stream to Wowza. If you are using an Flash Media Live Encoder, or some other RTMP encoder you can follow this guide:

How to set up live streaming using an RTMP-based encoder

Regards,

Salvadore

Hi,

The JW player is not a publishing client it’s a playback client. To play a live stream from Wowza first you must publish the stream to Wowza which can be done using an encoder.

To play the stream via Apple HLS once it’s been successfully published, please follow the Simple RTMP and Apple HLS streaming section of the JW player article.

You’ll need to replace the application name and stream name as required.

Current example (for video on demand):

http://[wowza-ip-address]:1935/vod/sample.mp4/playlist.m3u8

Live example:

http://[wowza-ip-address]:1935/live/myStream/playlist.m3u8

This example assumes you’re using the application called “live” and that you’re publishing a stream called “myStream”.

Regards,

Jason

Hi,

The cupertinoPlaylistChunkCount needs to be a minimum of 3, this is due to the clients (Apple HLS compatible) require a minimum of 3 chunks to begin playing the stream. When setting this Property lower than 3 this defaults back to 3 so the stream is playable on your devices/players. I’m glad you found the correct article on how to reduce the delay, the chunks (set by cupertinoChunkDurationTarget) can only be created on keyframes so with a keyframe interval of 2 seconds the chunks can only be 2 seconds or greater and should be an interval of 2 (2, 4, 6, 8 or 10).

The chunks are currently 2 seconds each and 3 chunks are required making your total of 6+ seconds delay. A keyframe interval of 2 seconds is the ideal settings on the encoder but you could make a keyframe every second if you choose. If you adjust the encoder so that you’re creating a keyframe every second you should be able to set cupertinoChunkDurationTarget: 1000.

After editing, a restart of the application is required for the changes to take effect.

Regards,

Jason

Hi,

A delay is something that can’t be avoided using HTTP based players due to how HTTP streaming works. The device/player needs 3 chunks meaning you’re always behind real time by 3 chunks at a minimum. As for the audio behaviour you’re reporting, Speex is not supported for Apple HLS so transcoding the audio from Speex to AAC is required if you wish to hear the audio using an Apple HLS playback client.

You can use the Wowza Streaming Engine Manager to configure the transcoder and create/edit the transcoding templates.

Please see the Wowza transcoding article for more information and configuration details.

I think you’re confused with what you’re expecting the JW player to do when you disconnect and reconnect to the internet. If you’re referring to an auto-play function I believe this happens when the player is loaded which requires you to refresh the page which the player is on as if you where opening it for the first time to play the stream. The stream should then play without the need to hit the play button.

Please confirm if this is what you’re referring to.

Regards,

Jason

Hi,

I would not expect a player to behave as you have described. If you’re having issues with the configuration of the JW player and it’s functionality then please see the JW player support team.

Regards,

Jason

Hi,

The streams require that you choose H.264 if you’re wanting to change the bitrate of the streams. If you’re using passthrough for the video the bitrate will remain the same.

If you’re wanting to change the audio bitrate then you should choose AAC and use a bitrate which is lower than the bitrate of the audio source.

320 kbps (320000) 
192 kbps (192000)
128 kbps (128000) 
96 kbps (96000)
64 kbps (64000) 
32 kbps (32000)

The default transcoding templates use 96000 and 64000 bps for the bitrate of the audio streams.

Regards,

Jason

Hi,

You’re welcome.

Please let us know if you have further questions.

Regards,

Jason

That is not the questions I am asking. I dont have any problems with set up live streaming using an RTMP-based encoder. What I am asking is how to use JW Player in code to publish the stream, the tutorial Wowza provided ( https://www.wowza.com/docs/how-to-use-jw-player-with-wowza-streaming-engine ) does not show JW Player code for these two questions:

  1. How to publish stream from webcam + mic

  2. How to do Apple HLS streaming for LIVE stream

Thank you for telling me that The JW player is not a publishing client it’s a playback client. Yesterday, before your answer, I have guessed and put playlist.m3u8 at the end of the string for HLS live. A problem occured. It is the delay of the HLS stream. Then, I have changed the configuration according to this article https://www.wowza.com/docs/how-to-configure-apple-hls-packetization-cupertinostreaming I have set cupertinoChunkDurationTarget to 2000, cupertinoMaxChunkCount to 10,

cupertinoPlaylistChunkCount to 1 , cupertinoRepeaterChunkCount to 1. And in my Flash publish encoder, I use cam.setKeyFrameInterval (2);

Then, The delay is about 6,7 seconds. I tried to put cupertinoChunkDurationTarget lower, 1000, but the test shows that the video looks not responding in this case. So, I put it back to 2000.

Can you tell me how to make the delay <=3 seconds ? Thank you very much.

Thank you for your answer. I set cupertinoChunkDurationTarget: 1000 and in the encoder : cam.setKeyFrameInterval (15) (means the 15th frame is the keyframe means 1 keyframe in 1 sec because I set 15fps with cam.setMode (w,h,15,true) ) Earlier the number 2 I used in cam.setKeyFrameInterval (2) maybe too small key frame interval.

I use HLS for mobile streaming. After that, the delay is about 3, 4 seconds. In many loads, the video works okay with delay of 3, 4 sec. However, in some load, the video stops responding after 10 sec (but it is probably okay, only few times - However after some hours, I checked again and the number of stop responding times increased --> I have the feeling that 1 sec is not as reliable as 2 secs. The bad thing is that JW Player does not play again when it stops, it just stops forever and need a reload ).

This is not as good as RTMP streaming. RTMP streaming the delay is only around 1 sec.

Another problem related to the SOUND occurred so please help me to resolve this. I would appreciate.

  • There is no sound in the HLS streaming but the RTMP player (JW Player) on desktop browser can hear the sound of the video. Do I have to make any configuration for the sound to appear for HLS?

After a while, I found out the solution is to use Wowza Transcoder. I enable Wowza Transcoder but that is not enough for the audio to work and I can not find out a document to make the translation from Speex to AAC ON THE WOWZA STREAMING MANAGER . I would like to use the Wowza Streaming Manager. Not the create files in folder way.

  • So is there any way to make delay 1 sec with HLS? With 1 sec, it already looks not very reliable.

  • The code in the tutorial

jwplayer(“player”).onError ( function(event) {

setTimeout(function()

{

jwplayer(“player”).play(true);

},2000);

does not work when I disconnect from the Internet and reconnect again to the Internet. The JW player does not keep playing as expected. (this test was made in an easy environment- a desktop browser).

Thank you.

  • Thank for your article about Wowza transcoder. I choose video codec passthrough (because I already got H.264 in the source stream) anđ AAC in the audio settings. What is the correct Audio Bitrate I should use ? Valid values range from 3000 to 1000000 bps. But what are the correct and suitable ones ?

  • About JW Player article, I am not referring to autostart. I am talking about the Internet disconnect case as I describe. The video is playing then I disconnect my Internet connection --> video stops playing . Then I connect to the Internet again --> the video does not keep playing (it should keep playing). The code

jwplayer(“player”).onError ( function(event) {

setTimeout(function()

{

jwplayer(“player”).play(true);

},2000);

does not work

The video should play again and this code does not do that.

what about the Audio Bitrate? Sorry the last post I edited a bit late.

I choose video codec passthrough (because I already got H.264 in the source stream) anđ AAC in the audio settings. What is the correct Audio Bitrate I should use ? Valid values range from 3000 to 1000000 bps. But what are the correct and suitable ones ?

Thank you very much for your answers.