You can add a media source to the Stream
's current playlist and play it in its entirety using:
stream1.play("mp4:sample.mp4", 0, -1, true);
And you can use the offset and duration to start 5 seconds into a clip and play 7 seconds of that clip like this:
stream1.play("mp4:sample.mp4", 5, 7, true);
But is there a way to control the playback by frames instead of seconds? Start at frame 320 and play for a duration of 210 frames. Is there any way to achieve this level of granularity?
No, the documentation for the Stream
class doesn't mention a way to set the start
and length
arguments of the play
function using frames.
However, you can change the resolution from seconds to milliseconds using Stream.setTimesInMilliseconds(true)
:
public void setTimesInMilliseconds(boolean timesInMilliseconds)
If true start time and duration and are milliseconds. If false startTime and duration are in seconds.
You can calculate the start and length based the frame rate and frame offsets.
I recommend you also ask on the Wowza forum, since not all new features are properly documented.