Live Streaming from Video File
Copy link to clipboard
Copied
Hi everyone,,, im newbie in programming streaming video with flash....ater reading documentations i tried the instructions on doc, i got a question that i've not been solved. How to make a "live streaming" from "video file". It likes a live streaming from camera but it uses video file as the source.... many thanks
Copy link to clipboard
Copied
Do you mean you have video file but you want to publish it as live stream , am i right? If yes following is the solution, but before that let me clarify you will need server to do it , i mean there is no way Flash client (i.e. .swf file running in Flash Player) can publish file from local disk.
Now let me tell you how to do it from server:
Place your video file under "streams" folder of your application i.e. say "myVideo.flv" under <FMS root>/applications/myApp/streams/_definst_
Now write following code in your main.asc file (this file would be under <FMS root>/applications/myApp )
var mystream;
application.onAppStart = function(){
mystream = Stream.get("livestream");
mystream.play("myVideo",0,-1,true);
}
This will publish "myVideo" file as live stream under name of "livestream". Client would have to subscriber using NetStream and
use ns.play("livestream",-1,-1)
You might have to write some extra code if you want to loop same file else once play of recorded file gets over , live publish will automatically stop.
let me know if this solves your problem
Copy link to clipboard
Copied
Thanks for your reply..
.
I've FMS as Streaming Server and Flowplayer as Flash Client...
and the scenario is.
I have video file let's say the filename is video1.flv, and i want to publish it @ 5 pm, so when 5 clients connect to the server they will see video video1.flv simultaneously then when other users connect to the server they will see the same video that 5 clients seeing.
Sorry for my bad english
