Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
btpoole
Channel Surfer

Initiate Stream

Having some trouble with getting my channel to start the stream. The channel is a live feed channel that has to go thru ffmpeg to convert the stream to hls. I have this part. My problem comes in on the xml file. The stream url is setup to http://192.168.xx.xx:8000/playfile.m3u8 where the ip represents my server. I can manually launch a batch file to start the conversion of the stream, go to the roku select the channel and all works. My problem is how do I get my ffmpeg batch file to start on the channel selection. I was told go create a cgi script to start the batch file. Well if I change the url stream to point to the cgi and the cgi starts the batch file how does the roku know what stream to play, the url stream doesn't point to a m3u8 in this case but the cgi. There has to be a way when the channel is selected, the conversion process can start and the roku will know to stream the m3u8 that is created. Any help would be really appreciated.
0 Kudos
3 REPLIES 3
RokuMarkn
Visitor

Re: Initiate Stream

If I understand your setup correctly, you need to make one query to the cgi script to start the process (using roUrlTransfer) before starting to play. This wouldn't be the same URL as the media file, which is given to roVideoPlayer/roVideoScreen.

--Mark
0 Kudos
btpoole
Channel Surfer

Re: Initiate Stream

Thanks. So I need to setup a function using roUrlTransfer to initiate the conversion process? Reading the SDK not a lot of help, at least what I can tell. If I do create a function that creates roUrlTransfer as object, I set the url to the file doing the conversion where is the function placed, in the main app or general utilites. . . Where does the call to the function occur? Sorry for being dense, I have written code before but not with Brightscript or for Roku.
Thanks again
0 Kudos
RokuMarkn
Visitor

Re: Initiate Stream

You would want to call the cgi script right before you start playing the video. It doesn't matter what .brs file you put the new function in.

--Mark
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.