Debugging and Playing live stream wmv content

Hi,
I have deployed package for my channel. I used simplevideoplayer sample and change the url, bitrate and stream format of channel accordingly with my channel. It is live wmv stream. It is running on windows media player and VLC but I am not able to see it playing on my Roku player.

  • Can anyone tell me how I figure out the cause of this issue?
  • How can I debug bright script application?
  • Is Roku player support wmv content?
  • Is there any bright script editor is available?

My channels status is processing… for 2 days.

Thanks

Note that we do not support live wmv streams.

  • Can anyone tell me how I figure out the cause of this issue?

Note that we do not support live wmv streams.

  • How can I debug bright script application?

After setting your box to developer mode, you can telnet 8085 and see the console. Pressing in the console will bring up the brightscript debugger.

  • Is Roku player support wmv content?

It will play wmv vod files, but not live wmv content.

  • Is there any bright script editor is available?

Any text editor. The syntax highlighting is similar to VB, so that mode may work for you if you want syntax highlighting.

  • My channels status is processing… for 2 days.

You should only submit channels for publishing that are ready to be reviewed by Roku employees to be placed in the public channel store. The “processing” state means your channel needs to be reviewed by Roku before being pushed to users.

–Kevin

Hi,
I did try to debug my box via telnet 8085 + <ctrl-c). It does change cursor but not shwoing in debuging inforamtion when I try to play my test channel.

How do I debug my application? How does it break execution?

Thanks
Naeem

You can put a “stop” statement in your brightscript code where you want the debugger to come up so you can step through the functions giving you problems…

–Kevin

Hi,
I debug my new test application and get following exception on display video:
“An unexpected problem (but not server timeout or HTTP error) has been detected.”

I dont know why it is happen. Can anyone look at my application source below: Exception caught at msg.isRequestFailed() in displayVideo() function.
Thanks


Sub Main()
    initTheme()
    screenFacade = CreateObject("roPosterScreen")
    screenFacade.show()

    item = {   ContentType:"episode"
               SDPosterUrl:"file://pkg:/images/img-islamchannel-logo.png"
               HDPosterUrl:"file://pkg:/images/img-islamchannel-logo.png"
               IsHD:False
               HDBranded:False
               ShortDescriptionLine1:"Islam Channel"
               ShortDescriptionLine2:""
               Description:""
               Rating:"NR"
               StarRating:"80"
               Length:1280
               Categories:["Technology","Talk"]
               Title:"Islam Channel"}
    
    showSpringboardScreen(item)    
    screenFacade.showMessage("")
    sleep(25)
End Sub

'Sub initTheme()

    app = CreateObject("roAppManager")
    theme = CreateObject("roAssociativeArray")

    theme.OverhangPrimaryLogoOffsetSD_X = "72"
    theme.OverhangPrimaryLogoOffsetSD_Y = "15"
    theme.OverhangSliceSD = "pkg:/images/Overhang_BackgroundSlice_SD43.png"
    theme.OverhangPrimaryLogoSD  = "pkg:/images/Logo_Overhang_SD43.png"

    theme.OverhangPrimaryLogoOffsetHD_X = "123"
    theme.OverhangPrimaryLogoOffsetHD_Y = "20"
    theme.OverhangSliceHD = "pkg:/images/Overhang_BackgroundSlice_HD.png"
    theme.OverhangPrimaryLogoHD  = "pkg:/images/Logo_Overhang_HD.png"
    
    app.SetTheme(theme)

End Sub

Function showSpringboardScreen(item as object) As Boolean
    port = CreateObject("roMessagePort")
    screen = CreateObject("roSpringboardScreen")

    print "showSpringboardScreen"
    
    screen.SetMessagePort(port)
    screen.AllowUpdates(false)
    if item <> invalid and type(item) = "roAssociativeArray"
        screen.SetContent(item)
    endif

    screen.SetDescriptionStyle("generic") 'audio, movie, video, generic
                                        ' generic+episode=4x3,
    screen.ClearButtons()
    screen.AddButton(1,"Play")
    screen.AddButton(2,"Go Back")
    screen.SetStaticRatingEnabled(false)
    screen.AllowUpdates(true)
    screen.Show()

    downKey=3
    selectKey=6
    while true
        msg = wait(0, screen.GetMessagePort())
        if type(msg) = "roSpringboardScreenEvent"            
            if msg.isScreenClosed()
                print "Screen closed"
                exit while                
            else if msg.isButtonPressed()
                                
                    print "Data: ";msg.GetData()
                    
                    if msg.GetIndex() = 1
                         print "Button pressed: Play"
                         displayVideo()
                    else if msg.GetIndex() = 2
                         print "Button pressed: Go Back"
                         return true
                    endif
            else
                print "Unknown event: "; msg.GetType(); " msg: "; msg.GetMessage()
            endif
        else 
            print "wrong type.... type=";msg.GetType(); " msg: "; msg.GetMessage()
        endif
    end while

    return true
End Function

Function displayVideo()
    print "Displaying video... "
    p = CreateObject("roMessagePort")
    video = CreateObject("roVideoScreen")
    video.setMessagePort(p)
      
    videoclip = CreateObject("roAssociativeArray")            
    videoclip.StreamUrls = ["http://92.48.78.127/ibcomtest/test.mp4"]    
    videoclip.StreamBitrates = [252]
    videoclip.StreamQualities = ["SD"]    
    videoclip.StreamFormat = "mp4"
    videoclip.Live = False
    videoclip.HDBranded = False
    videoclip.Title = "islam channel test"    
 
    video.SetContent(videoclip)
    video.show()

    lastSavedPos   = 0
    statusInterval = 10 'position must change by more than this number of seconds before saving

    while true
        msg = wait(0, video.GetMessagePort())
        if type(msg) = "roVideoScreenEvent"
            if msg.isScreenClosed() then 'ScreenClosed event
                print "Closing video screen"
                exit while
            else if msg.isPlaybackPosition() then
                nowpos = msg.GetIndex()
                if nowpos > 10000
                    
                end if
                if nowpos > 0
                    if abs(nowpos - lastSavedPos) > statusInterval
                        lastSavedPos = nowpos
                    end if
                end if
            else if msg.isRequestFailed()
                print "play failed: error_no = ";msg.GetData();" error_msg = "; msg.GetMessage()
            else
                print "Unknown event: "; msg.GetType(); " msg: "; msg.GetMessage()
            endif
        end if
    end while
End Function

This looks like a video encoding issue. (252 kpbs is also very low… the lowest bitrate should still be at 350 kbps).

How did you encode this video?

–Kevin

I get the same error message on my quickly whipped up attempt at implementing HLS. I know it’s not a video encoding issue in my case because the DVP never gets as far as trying to request the video. Doing a packet capture I can see the request for the m3u8 file, but that’s it. The video file is never requested. I realize I’m jumping into this far too early and should wait for the documentation, but I thought it would be interesting to try something new. For what it’s worth, nothing I try in the m3u file makes a difference. I’ve stripped it down to this:

#EXTM3U
#EXT-X-TARGETDURATION:60,Test
#EXTINF:60,
http://192.168.1.102/test.ts
#EXT-X-ENDLIST

I can also get strange things to happen depending on what meta-data attributes I pass to the video player. For example, if I leave “Qualities” out completely, the m3u file is never even requested and the video screen comes up in perpetual retrieving (I don’t know what it thinks it’s retrieving). I’m guessing there’s either meta-data attributes that are important for HLS that weren’t before, or something’s missing in the m3u file. Hopefully the documentation will clear it all up when it comes out.

-JT

Thanks for replies.
I change the bitrate to 350, now it is giving exception of "The Connection is timeout ". But the file is playing properly on VLC with this path.

Any idea what going wrong now?

renojim, I’m not sure if this is the whole issue, but there is an error in your m3u8 syntax. The EXT-X-TARGETDURATION line should have only one parameter. See if it works better if you remove the “,Test” at the end of the line.

–Mark

“RokuMarkn” wrote:
renojim, I’m not sure if this is the whole issue, but there is an error in your m3u8 syntax. The EXT-X-TARGETDURATION line should have only one parameter. See if it works better if you remove the “,Test” at the end of the line.

–Mark
Oops! I actually added that after I copied it into the post. I meant to add Test to the end of the #EXTINF line. The Simple Playlist File from the draft spec just had a comma at the end of the #EXTINF line with no title given. I’ve tried it with and without a title with the same results. My m3u8 file does not have Test at the end of the #EXT-X-TARGETDURATION line.

-JT

Are you running build 388? I think there may have been a bug in 385 that prevented single-level playlists from working correctly.

If that doesn’t solve it, can you verify that you:

  1. are setting StreamFormat to “hls”
  2. have one stream in the StreamXXX arrays (the m3u8 file)
  3. are setting StreamQuality to 0
  4. are using the correct IP address in the URL in the m3u8

–Mark

It won’t let me update to 388; I’ve tried several times from different servers. As soon as I get it I’ll let you know if it made a difference.

I was going to start a new thread since I didn’t really want to hijack this one, but I’ll put this here anyway. I tried stripping my code down to the bare minimum and creating a m3u8 file on the fly on the tmp device (maybe this isn’t allowed, but I get the same result whether the m3u file is retrieved from my server or tmp). Maybe you can spot the problem?

Sub displayHls()
    port = CreateObject("roMessagePort")
    videoScreen = CreateObject("roVideoScreen")
    videoScreen.setMessagePort(port)

    videoclip = CreateObject("roAssociativeArray")
    videoclip.title = "HLS Test"
    videoclip.ContentType = "movie"
    videoclip.StreamFormat = "hls"
    videoclip.StreamBitrates = [500]
    videoclip.StreamQualities = ["0"]

    m3u="#EXTM3U"+chr(10)+"#EXT-X-TARGETDURATION:60"+chr(10)+"#EXTINF:60,Test Title"+chr(10)+"http://192.168.1.102/test.ts"+chr(10)+"#EXT-X-ENDLIST"+chr(10)
    WriteAsciiFile("tmp:/test.m3u8",m3u)
    videoclip.StreamUrls = ["tmp:/test.m3u8"]
    videoScreen.SetContent(videoclip)
    videoScreen.show()

    while true
        msg = wait(0, port)
        if type(msg) = "roVideoScreenEvent"
            if msg.isScreenClosed() then 'ScreenClosed event'
                print "Closing video screen"
                exit while
            else if msg.isPlaybackPosition() then
                print "isPlaybackPosition"
            else if msg.isRequestFailed()
                print "play failed: "; msg.GetMessage()
            else if msg.isFullResult()
                print "isFullResult"
                'exit while
            else if msg.isPartialResult()
                print "isPartialResult"
                'exit while
            else
                print "Unknown event: "; msg.GetType(); " msg: "; msg.GetMessage()
            end if
        end if
    end while
End Sub

The result is always the “play failed: An unexpected problem (but not server timeout or HTTP error) has been detected.” message.

-JT

“renojim” wrote:
The result is always the “play failed: An unexpected problem (but not server timeout or HTTP error) has been detected.” message.

For what it’s worth, I’m having the same issues under build 388. In my case, I’m using an m3u8 provided by a 3rd party, so I can’t tweak it. It looks something like this…

#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=300000, CODECS="avc1.66.30, mp4a.40.5"
http://iphone.domain.com/streams/live/playlist.m3u8?sessionid=1358836792
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=64000, CODECS="mp4a.40.5"
http://iphone.domain.com/streams/live_audio/playlist.m3u8?sessionid=1519427599

Hi,
This change in code now playing live WOWZA stream on Roku but it does not encode audio, although same stream playing with audion on iPhone.

can you please tell me what is going wrong now?


videoclip.StreamUrls = ["http://192.168.0.49:1935/rtplive/vlc.sdp/playlist.m3u8"]    
videoclip.StreamBitrates = [500]
videoclip.StreamQualities = ["0"]   'can be one of these HD, SD, 0
videoclip.StreamFormat = "hls"      'can be one of these mp4, wmv, hls
videoclip.Live = True

Thanks

Sorry to both of you for a piece of misinformation – it’s StreamBitrates that should be set to 0 (that is, to an array containing one zero). StreamQualities should be “SD” or “HD” as usual.

malik – the Roku player supports only LC profile AAC audio. I think Wowza has a bug that tags all AAC audio streams as Main profile. I’ll get you more information on this shortly.

renojim – until you upgrade to build 388, you might try building a two-level playlist and see if that works. You’d have a top level playlist like this:


#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=1500000
http://server/secondlevel.m3u8

where the secondlevel.m3u8 line contains the URL of the playlist you’re currently using.

–Mark

Hi
StreamBitrates = [0] does not work at all and it throws exception. I set StreamBitrates = [500] and StreamQualities = [“SD”] and it work perfectly with audio and video. There is no bug in WOWZA related to AAC audio stream.

Thanks for all your help

Can you give me some more information about the exception you see when you set StreamBitrates = [0]? We’ve used that without problems.

The Wowza bug has been confirmed by several other parties. Wowza doesn’t know the audio profile of the input stream, so it just sets the ADTS headers in the output to indicate Main profile. We have discussed this with Wowza and expect them to issue a patch, hopefully soon.

–Mark

“RokuMarkn” wrote:
Sorry to both of you for a piece of misinformation – it’s StreamBitrates that should be set to 0 (that is, to an array containing one zero). StreamQualities should be “SD” or “HD” as usual.

renojim – until you upgrade to build 388, you might try building a two-level playlist and see if that works. You’d have a top level playlist like this:


#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=1500000
http://server/secondlevel.m3u8

where the secondlevel.m3u8 line contains the URL of the playlist you’re currently using.

–Mark
That did it. I still can’t seem to get 388. I was able to create the top level m3u on the tmp: device, but trying to specify the second level EXT-X-STREAM-INF as tmp:/test.m3u8 didn’t work. It worked when I directed it to one on my server. Now I just have to figure out why the video doesn’t play. I’ll go back and look at the spec, but is it safe to say that just because an m4v file will play normally on the Roku DVP doesn’t necessarily mean it meets the spec for an HLS video?

Thanks for your help,
-JT

You must remux the h264 data in a .m4v file to a .ts mpeg transport stream file. In HLS, the m3u8 file must point to mpeg transport stream file segments. Many developers are using the Wowza server for this purpose.

–Kevin

Thanks Kevin, I will look into it.

Edit: Just thought I’d report back. I was finally able to get 388 and my single level m3u file works. Time to look into encoders, I guess.

Thanks again,
-JT