Player APIs (BrightScript & Ja...
...
Object Reference
Presentation and Widget Object...
roStreamQueue
14min
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") file requirements video files must meet the following requirements to work with the rostreamqueue object files must be transport stream ( ts ) formatted all files in a queue should have identical pids files must begin and end with a closed gop files must have regular pcrs at intervals of 100ms or shorter note that the default interval for ffmpeg is 1000ms unless it is configured for cbr muxing (in which case the interval is set to 20ms) the following is an example of an appropriate command line tp remux avconv i clip short ts vcodec copy acodec copy muxrate 15m clip short2 ts ifstreamqueue 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 rovideoplayer docid\ ztuz0ldazcml2kqmdbkcn in the passed string setpreferredvideo(description as string) as boolean chooses an audio stream from the video input based on the rovideoplayer docid\ ztuz0ldazcml2kqmdbkcn in the passed string keeppadding(enabled as boolean) if enabled=true , all pids in the input stream (including padding packets) are passed through to the output this allows the cbr bitstream profile to be preserved when re streaming to the network it cannot be used when feeding a local decoder 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 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 example (rovideoplayer) 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() example (romediastreamer) queue = createobject("rostreamqueue") queue queuefile("file1 ts") queue queuefile("file2 ts") queue loop(true) m = createobject("romediastreamer") m setpipeline(\[queue, "udp\ //239 0 156 101 5000/?maxbitrate=0"]) m start() we strongly suggest appending the "maxbitrate=0" parameter to udp streams when using rostreamqueue this prevents the romediastreamer instance from rate limiting an rostreamqueue stream that is already running at a precise, correct rate