Developers

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Captions Problem!

I am working on an application that uses a custom screen to display videos with subtitles. I am using roVideoPlayer with roCaptionRenderer in custom mode. This application was working just fine until now. But now sometimes it starts to play captions from the previous clip in the list on current video and sometimes starts to work just fine. As far as I know we have no control over subtitles even in custom mode of roCaptionRenderer so there must be a glitch in the firmware because of which this is happening? I have checked the list of videos and subtitles that I am feeding to roVideoPlayer it has correct pairs of video + subtitles.

Edit:
What I have found out is if some video is not played by any reason no availabilty, no url given etc but its subtitles is fine then its subtitle is played with next video and then this keeps happening till the end of the video list.
Tags (1)
0 Kudos
8 REPLIES 8
destruk
Streaming Star

Re: Captions Problem!

Maybe you need to check for a playback failure and then clear the caption for the failed video. Or rather than feeding it an entire content playlist, feed it one caption and one video at a time until the list is completed.
Tags (1)
0 Kudos

Re: Captions Problem!

"destruk" wrote:
Maybe you need to check for a playback failure and then clear the caption for the failed video. Or rather than feeding it an entire content playlist, feed it one caption and one video at a time until the list is completed.


Thanks for the suggestions, I do not think first solution is possible as, as far as I know we cannot clear captions ourself as these are sent as event message to us by Roku firmware. Second option can be implemented but why should we play our content one by one when roVideoPlayer supports a list of content? Shouldn't this issue be handled by roVideoPlayer itself?
Tags (1)
0 Kudos
destruk
Streaming Star

Re: Captions Problem!

"as far as I know we cannot clear captions ourself as these are sent as event message to us by Roku firmware."
"In firmware version 2.6, we've introduced support for SRT files. Please see the content meta-data parameter SubtitleUrl for pointing to a matching SRT file for your video content."

This means your xml feed should already have the location of the SRT files - roku doesn't 'magically obtain that' -- it's set manually just like the other content-metadata like HDPosterURL/SDPosterURL/Streams/etc etc
You can clear the url yourself by setting it to invalid, or resetting the url -
In the example above -

Categories.Kids[iSelected].SubititleURL=invalid

or

Categories.Kids[iSelected].SubititleURL="http://server/subtitlefilename.srt"

Before sending it to the videoplayer screen.


With roCaptionrenderer here --
http://sdkdocs.roku.com/display/sdkdoc/ ... onRenderer
Your metadata is TrackIDSubtitle: "ism/textstream_eng"
so you should be able to change that with --
Categories.Kids[iSelected].TrackIDSubtitle="ism/subtitlefilename.eng"

If it is cached, you can try adding a cachebreaker by adding a variable to the filename or disabling caching on the server.
ism/subtitlefilename.eng?timestamp=283493843
Tags (1)
0 Kudos
destruk
Streaming Star

Re: Captions Problem!

I would think something like this would work for your situation, still using the playlist -
I haven't tested it but the logic makes sense to me.

currentvideo=0 goes before your event loop starts for the video player (in the video player routine)
The code in the event loop goes into your event loop for the video player routine.


currentvideo=0 'initialize counter -- maybe this isn't necessary but it is here for legibility so I know later it will be an integer and what it is used for
....event loop....
else if type(msg) = "roVideoPlayerEvent"
If msg.isrequestfailed()
errormessage=msg.info()
playlist=videoPlayer.GetContentList()
for x=0 to playlist.count()-1
If errormessage.url=playlist[X].stream.url then 'once bad stream has been found, no need to search for it so break out of the for loop
currentvideo=X
exit for
end if
next
for x=0 to currentvideo 'it failed so delete everything that has already played as well as current video that tried to play
playlist.delete[X]
next
if playlist.count()>0 'if there are items left to play
videoPlayer.SetContentList(playlist)
videoPlayer.Show() 'might not be necessary, but show the screen again to restart the videos with the altered new playlist
end if
end if
Tags (1)
0 Kudos
destruk
Streaming Star

Re: Captions Problem!

If you need it to loop (always something, right?) then rather than deleting everything up to the point of failure in the playlist, you could remove just the failed item, track what item was removed, and reset the playlist followed by SetNext to restart where it left off with the next piece of valid content.
http://sdkdocs.roku.com/display/sdkdoc/ ... egerasVoid

SetNext(item as Integer) as Void
Set what the next item to be played within the Content List should be.

I'd still recommend deleting the entire piece of bad content so the number of subtitle urls that are valid will match up with the number of valid video urls - as that seems to be the problem for the rovideoplayer/rocaption
Tags (1)
0 Kudos

Re: Captions Problem!

"destruk" wrote:
I would think something like this would work for your situation, still using the playlist -
I haven't tested it but the logic makes sense to me.

currentvideo=0 goes before your event loop starts for the video player (in the video player routine)
The code in the event loop goes into your event loop for the video player routine.


currentvideo=0 'initialize counter -- maybe this isn't necessary but it is here for legibility so I know later it will be an integer and what it is used for
....event loop....
else if type(msg) = "roVideoPlayerEvent"
If msg.isrequestfailed()
errormessage=msg.info()
playlist=videoPlayer.GetContentList()
for x=0 to playlist.count()-1
If errormessage.url=playlist[X].stream.url then 'once bad stream has been found, no need to search for it so break out of the for loop
currentvideo=X
exit for
end if
next
for x=0 to currentvideo 'it failed so delete everything that has already played as well as current video that tried to play
playlist.delete[X]
next
if playlist.count()>0 'if there are items left to play
videoPlayer.SetContentList(playlist)
videoPlayer.Show() 'might not be necessary, but show the screen again to restart the videos with the altered new playlist
end if
end if


Thanks for the code representation of the solution to the problem it seems that it will work according to logic. I will implement it and then will post if any else issue came. Thanks once again for your help.
Tags (1)
0 Kudos

Re: Captions Problem!

"destruk" wrote:
If you need it to loop (always something, right?) then rather than deleting everything up to the point of failure in the playlist, you could remove just the failed item, track what item was removed, and reset the playlist followed by SetNext to restart where it left off with the next piece of valid content.
http://sdkdocs.roku.com/display/sdkdoc/ ... egerasVoid

SetNext(item as Integer) as Void
Set what the next item to be played within the Content List should be.

I'd still recommend deleting the entire piece of bad content so the number of subtitle urls that are valid will match up with the number of valid video urls - as that seems to be the problem for the rovideoplayer/rocaption


I have added the filter on my server side to exclude videos that does not have a playback URL but I was keen to reach a permanent solution because this issue happens even if a valid url could not be played because of any reason. So I will edit my event loop to make it more reliable and delete all the content till bad URL as I do not need to loop same list. I hope that Roku team removes this issue as it seems to be issue in their firmware. Thanks
Tags (1)
0 Kudos
destruk
Streaming Star

Re: Captions Problem!

You're welcome - hopefully it works.
Tags (1)
0 Kudos
Community is Being Upgraded!

We’re upgrading Roku Community to bring you a faster, more mobile-friendly experience. You may notice limited functionality or read-only access during this time. Read more here.

Planned Downtime:
Community will be unavailable for up to 24–48 hours during the upgrade window during the week of May 19th and you may notice reduced functionality. In the meantime, for additional assistance, visit our Support Site.

We're sorry for this disruption — we’re excited to share what’s next!