Ticket #694 (new New Feature)

Opened 2 years ago

Last modified 21 months ago

Implement FMS's "Smart Pause" feature

Reported by: Sanford Owned by: mondain
Priority: Major Component: Streaming and Networking
Version: Keywords: smart pause buffer flush
Cc:

Description

It would be great to implement FMS's "Smart Pause" feature with Red5.

Whenever I pause a stream, the buffer flushes and then refills from empty on play(). I want the buffer to be kept so that when the user again presses "play" the stream will start with no delay.

Adobe says this can be done with FMS 3 and Flash 9.0.115, as described here:

 http://kb2.adobe.com/cps/403/kb403029.html

I couldn't find how this is done internally. I wonder if it could be done by simply not sending to the client the pause notification that triggers the buffer flush.

By the way, Paul, this seems to assign it to you by default. I have a guy who might be able to do the work if we can get pointers about the right way to implement it.

Ideas?

Many thanks, Sanford

Change History

Changed 2 years ago by Sanford

Update, I just found this, which explains how the feature works:
 http://www.sargeway.com/blog/index.cfm/2008/1/25/FMS-Smart-Pause-Feature

Flash Media Server 3.0 includes a Smart Pause feature. This feature allows Flash Player 9 Updater 3 (9.0.115.0) to continue to buffer content while pausing the stream without clearing the buffer. Previous versions of the player would clear the buffer when resuming from a pause event (NetStream.pause()) -- causing rebuffering which could lead to latency and unfavorable playback. Smart Buffer does not send the pause event to FMS until the Flash Player buffer limit is reached. The buffer limit (NetStream.bufferLength) is the greater of 60 secs or NetStream.bufferTime. Smart Pause in FMS 3.0 is also backwards compatible with NetSteam.pause() in AS 2.0.

Smart Pause can help to alleviate some of the latency previously experienced when pausing in previous versions of FMS and Flash Player. See TechNote kb403029 ( http://kb2.adobe.com/cps/403/kb403029.html) for more details. Since the NetStream.pause() is not immediately sent to FMS, some of your FMSIS authorization adaptors E_PAUSE events may not fire. See TechNote kb403040 ( http://kb2.adobe.com/cps/403/kb403040.html) for more details.

Changed 2 years ago by Sanford

Update: I found the events used to communicate smart pause actions to the FMS:

 http://help.adobe.com/en_US/FlashMediaServer/3.5_AdminGuide/WS5b3ccc516d4fbf351e63e3d119f2926bcf-79d1.html

* client-pause: Client smart pauses a stream. The stream is paused but the server still sends data to the client so the player has enough data to play when the client unpauses.
* client-unpause: Client smart unpauses a stream.

The "Smart Pause" feature may work as follows:
1. FMS sets a Flash Player configuration to activate smart pause
2. the NetStream is paused by the user and the Flash Player sends sends a "client-pause" event to the server and keeps streaming to fill the buffer
3. if the NetStream.bufferLength exceeds the "buffer limit" (defined as the greater of NetStream.bufferTime or 60 seconds), then the player sends a normal "pause" event to the server, which results in a pause.notify() sent back to the Flash Player, which then flushes the buffer

If this guess is correct, then implementing this could be pretty simple:
* allow Red5 to send the "smart pause" configuration notification
* have Red5 accept and log the "client-pause" and "client-unpause" events

Is there more to it?

To be sure how this works, someone would have to monitor the communication between FMS3 and the Flash Player to spot how the configuration flag is passed. How is that done?

Changed 22 months ago by bascorp

Note: See TracTickets for help on using tickets.