ON THIS PAGE
This object allows you to play a list of video files seamlessly (i.e. without any blank frames or interrupts between one video and the next). You can link roStreamQueue to an roVideoPlayer instance for seamless video playback or to an roMediaStreamer instance for seamless video streaming.
Object Creation: This object is created with no parameters.
CreateObject("roStreamQueue")
Note
The roStreamQueue object only works with Transport Stream (.ts) files. All files in the queue should have identical PIDs, and each file must begin and end with a closed GOP.
ifSteamQueue
QueueFile(filename As String) As Boolean
Adds the specified video file to the queue.
Loop(loop As Boolean) As Boolean
Specifies that playback/streaming should return to the beginning of the queue once it reaches the end. If Loop(false)
and LoopLast(false)
are both called, playback/streaming will stop once the end of the queue is reached. This is also the default behavior.
LoopLast(loop_last As Boolean) As Boolean
Specifies that playback/streaming should loop the last file in the queue once it reaches the end. This method has no effect if Loop(true)
is called as well.
SetPreferredAudio(description As String) As Boolean
Chooses a video stream from the video input based on the parameters in the passed string.
SetPreferredVideo(description As String) As Boolean
Chooses an audio stream from the video input based on the parameters in the passed string.
NextFile(a As Boolean) As Boolean
Start() As Boolean
ifMessagePort
SetPort(port As roMessagePort)
Posts messages of type roStreamQueueEvent to the attached message port. An event is raised whenever the end of the queue is reached.
ifUserData
SetUserData(user_data As Object)
Sets the user data that will be returned when events are raised.
GetUserData() As Object
Returns the user data that has previously been set via SetUserData()
. It will return Invalid if no data has been set.
ifIdentity
GetIdentity() As Integer
Returns a unique number that can be used to identify when events originate from this object.
Note
The ifIdentity interface has been deprecated. We recommend using the ifUserData interface instead.
Playing and Streaming Queues
To use roStreamQueue as a streaming playlist, include it as the source component in an roMediaStreamer.SetPipeline() call. For video playback, use an roVideoPlayer instance as the destination component in the SetPipeline()
call.
q=createobject("rostreamqueue") q.queuefile("sd:/Test_Count_Up_Blue_Frames.ts") q.queuefile("sd:/Test_Count_Up_Green_Frames.ts") q.loop(true) c=createobject("romediastreamer") r=createobject("rorectangle",0,0,1920,1080) v=createobject("rovideoplayer") v.setrectangle(r) c.setpipeline([q, v]) c.start()
q=createobject("rostreamqueue") m=createobject("romediastreamer") q.queueFile("sd://encoder_1080p59_8mbps.ts") q.loop(true) didStream = m.setpipeline([q, "decoder:", "encoder:vformat=1080p60&vbitrate=3000", "udp://239.0.156.101:5000/"]) ? "didStream: "; q m.Start()