remote streaming to red5 server to jwplayer

1,068 views
Skip to first unread message

joshua lee

unread,
Apr 8, 2013, 2:57:26 PM4/8/13
to red5in...@googlegroups.com
Hi everyone, I have successfully installed red5 and configured it to the best of my ability.
I am able to connect to the server remotely with no problem and record videos without any issues. 
I'm scratching my head on two things:
1) When I use the publisher on my local network, I can set it to flash and stream to jwplayer embedded on a webpage; but when I access the publisher app remotely, connect to the server, and try to stream to the jwplayer it will not show on the jwplayer. Any ideas?
jwplayer gives error: server not found: rtmpt:localhost:80/oflaDemo
What I did (remotely):
went to <domain Name>:5080/demos/publisher.html
connected to server rtmp://<domain Name>/oflaDemo
connection success
location set to rtmp://<domain name>/oflaDemo
file name: stream
I set up the video and audio, and I was able to record the stream with no issue, and then I saw the recorded video in the oflaDemo page (although video isn't playing don't know why) 
jwplayer embed code was set to:
</div><script type="text/javascript"> 
var flashvars = {
file:'stream',
streamer:'rtmp://localhost/oflaDemo',
image:'islamwallpaper.jpg',
bufferlength:'2',
backcolor:'#000000',
frontcolor:'#166EBA',
screencolor:'#999999',
lightcolor:'#990000',
autostart:'true',
repeat:'none',
stretching:'',
playlist:'bottom',
playlistsize:'160',
};
var params = { allowfullscreen:'true', allowscriptaccess:'always', wmode:'transparent' };
var attributes = { id:'player1', name:'player1' };
swfobject.embedSWF('player.swf','player','100%','800','9.0.0','true',flashvars, params, attributes);
</script>
and 2) I've been using VLC to stream a playlist of videos to a plugin on a webpage, and from what I understand, VLC and Red5 aren't able to work together because vlc doesnt have rtmp (yet) Is there anyway to stream prerecorded videos in a live broadcast to be shown on the jwplayer embedded  on webpage? I was thinking: VLC stream ing-> Xuggler(haven't installed yet)->red5 server->jwplayer 
I appreciate any help. BTW I'm on linux ubuntu.

joshua lee

unread,
Apr 9, 2013, 7:10:42 PM4/9/13
to red5in...@googlegroups.com
Ok here's an update:
I was able to install xuggler which is running. I followed the wiki: http://red5wiki.com/wiki/Live_streaming#Subscribe_to_stream_via_flash_.28JWPlayer.29
and was able to get the stream running with tweaking it a bit. I found this command: 
ffmpeg -i testfile.mp4 -re -acodec copy -vcodec copy -f flv rtmp://localhost:1935/live/testStream 
I tried an mp4 file, but no video shows and it eventually will stop. I tried an flv file and it works like a charm. Audio has some chirps in it, but the video doesnt freeze and the player doesn't begin the "endless buffer" 
Also, I set the player buffer to 20, I just decided, "lets try it" and it works. Don't know why. 
If there's some information that will improve this setup, please let me know. 
If anyone can inform me on how to play a playlist on Xuggler, please let me know and if anyone else reads this, and needs some help let me know.

shahzaib shahzaib

unread,
Apr 10, 2013, 2:56:51 AM4/10/13
to red5in...@googlegroups.com
I am also been able to come this far, but looking for playlist which should be played like a TV-station i.e the user wouldn't be able to reverse or forward the stream. Whenever user arrived on the stream he'll watch stream whether from the beginning or from the middle just like a Tv station but i am unable to sort out any way for it :(


--
 
---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to red5interest...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

joshua lee

unread,
Apr 10, 2013, 6:50:28 PM4/10/13
to red5in...@googlegroups.com
I'm looking around the FFmpeg website, I will post my findings IA. Please check back and post info if you find it.

joshua lee

unread,
Apr 10, 2013, 8:21:07 PM4/10/13
to red5in...@googlegroups.com
ok, so I figured out this: VLC-> FFmpeg-> red5 check out the new thread I made!


On Wednesday, April 10, 2013 1:56:51 AM UTC-5, shahzaib shahzaib wrote:

joshua lee

unread,
Apr 10, 2013, 9:51:49 PM4/10/13
to red5in...@googlegroups.com
correction: I'm trying to make it work but problem is that when it switches to a new video, ffmpeg stops
which is very frustrating. 

joshua lee

unread,
Apr 10, 2013, 11:26:35 PM4/10/13
to red5in...@googlegroups.com
only way this will work: merge the files together and stream it! I found a post on mencoder which can be used (supposedly) sudo apt-get install mencoder
and I found this command: mencoder -forceidx -of lavf -oac copy -ovc copy -o output.flv clip1.flv clip2.flv
put the file names where clip1 and clip2 are and we should have something....... we're about to find out

Andy Shaules

unread,
Apr 11, 2013, 2:52:14 AM4/11/13
to red5in...@googlegroups.com
Not sure how it will compile against the head version, but check out the demo number 1

http://code.google.com/p/comserver/wiki/Demos

"Demo one server code will load all the flv files in the top level of the streams directory and use them to create a global feed for all live flv streams you target with the client."


That means every stream you try to play with a client will be the continuous feed of all flv files on the server in a loop. It runs even when noone is viewing, just like TV.

Andy

shahzaib shahzaib

unread,
Apr 11, 2013, 2:54:52 AM4/11/13
to red5in...@googlegroups.com
mencoder also didn't work for me, i need a kind of loop which will keep streaming the videos after one another like a TV station. @andy well i need something like you said, gonna looking into comserver. I'll update you guyz on finding something useful. Thanks

Andy Shaules

unread,
Apr 11, 2013, 3:05:12 AM4/11/13
to red5in...@googlegroups.com
its easy.

1) ready all the flv resources in to a list.

2) get the vod service and request each file in the list.

3) with each file read each tag-event in the file.

Tasks:
A) Keep track of accumulated milliseconds based on tag time-stamps. When a new file starts, stream time keeps advancing.... dont start sending the new timestamps which will be zero....

b) Create a ClientBroadcastStream and register it as a live stream. Use this stream to publish the packets.


This is the entirety of what I did to accomplish your goal in the past, and it is exactly what the comserver demo does. It is old code, so im not sure how well it works these days, but the above steps are how you do it.

Andy

Andy Shaules

unread,
Apr 11, 2013, 3:08:09 AM4/11/13
to red5in...@googlegroups.com
Here is how you load and read tags.


http://code.google.com/p/comserver/wiki/FLV

 msg = msgIn.pullMessage();

if(msg==null)
	//end of file



On 4/10/2013 11:54 PM, shahzaib shahzaib wrote:

shahzaib shahzaib

unread,
Apr 11, 2013, 3:10:09 AM4/11/13
to red5in...@googlegroups.com
Thanks a lot Andy, but i am not aware of java-scripting and want to ask would i still be able to work on it ? Because i am totally blank on your instructions yet and i needed to get it done somehow :(

shahzaib shahzaib

unread,
Apr 11, 2013, 3:13:02 AM4/11/13
to red5in...@googlegroups.com
Can you guide me a bit from where should i start to work with comserver ?

Andy Shaules

unread,
Apr 11, 2013, 3:24:20 AM4/11/13
to red5in...@googlegroups.com
Comserver was primarily designed to be a data pump for multi user experiences.

In cases where there is a shared experience that is controlled by the server such as a live TV made from VOD files something like comserver can be used.

For instance,  multiple users can each publish a netstream and send invokes of some coordinates of their avatar. At the same time the server could stream global events to every client.

In your case, the data pump would read FLV files and change the timestamps to be ever incrementing as they are sent out to clients.


Look at this java runnable class that does all the dirty work or reading the tags.

http://code.google.com/p/comserver/source/browse/trunk/demo/demo1/java/demo/WEB-INF/src/comdemo/internal/feeds/FLVFeed.java


The main doc is here.

http://code.google.com/p/comserver/downloads/detail?name=comserverDocV1-1.pdf&can=2&q=

shahzaib shahzaib

unread,
Apr 11, 2013, 3:43:17 AM4/11/13
to red5in...@googlegroups.com
Thanks a lot Andy for helping me, i am going to work on it. :)
Reply all
Reply to author
Forward
0 new messages