How to control (start / stop encoding) Flash Media Encoder using ActionScript 3?

1.3k views Asked by At

How to control (start / stop encoding) Flash Media Encoder 3.5 using ActionScript 3 (using Flash CS4) ?

UPDATE: Flash Media Server 3.5 is also installed in same server. It includes an Apache server, which I think can run batch script, if CGI is installed. Is it a solution? Seems dangerous.

1

There are 1 answers

0
Raptor On BEST ANSWER

My final solution is:

Set up a simple PHP site in parallel with FMS using XAMPP. The PHP site runs two simple commands to start and stop the encoder using PHP's system($cmd) command.

To start encoder, the raw command is:

FMLEcmd /p {path_to_profile}/profile.xml /d

To stop encoder, the raw command is:

FMLEcmd /s rtmp://{server}/live/+{stream_name}

by running these commands in PHP, the encoder can be controlled. You can even use Flash to send out URL request, but take note of cross-domain issues.