I have a roPosterScreen (arced-landscape) with 30 posters.
I’m storing the posters on a server with links to them in an xml file. I read in the xml and set the SDPosterURL and HDPosterURL to the respective URLs. The images download and display, but when I’m navigating, it takes about 1-2 seconds to move from 1 selection to the next.
I thought maybe it was taking so long because it was downloading the image each time I selected a new one, so I packaged the images into the channel and referenced them local, but it’s still very slow.
Here is my screen code
Function showTeamPosterScreen(screen As Object) As Integer
if validateParam(screen, "roPosterScreen", "showPosterScreen") = false return -1
m.curShow = 0
teams = getTeams()
screen.SetContentList(teams)
screen.Show()
while true
msg = wait(0, screen.GetMessagePort())
if type(msg) = "roPosterScreenEvent" then
print "showTeamPosterScreen | msg = "; msg.GetMessage() " | index = "; msg.GetIndex()
if msg.isListFocused() then
m.curShow = 0
screen.SetFocusedListItem(m.curShow)
print "msg.GetIndex = "; msg.GetIndex()
if msg.GetIndex() = 0 then
screen.SetContentList(getShowsForLive())
else if msg.GetIndex() = 1 then
screen.SetContentList(getVodCategories())
end if
print "list focused | current category = "; m.curCategory
else if msg.isListItemSelected() then
m.curShow = msg.GetIndex()
print "list item selected | current show = "; m.curShow
if teams[m.curShow].SubCat = 3 then
print "preShowTeamGamesScreen"
subScreen = preShowTeamGamesScreen("On-Demand by Team", teams[m.curShow].Title)
if subScreen=invalid then
print "unexpected error in preShowTeamGamesScreen"
return -1
end if
showTeamGamesScreen(subScreen, teams[m.curShow].TeamId)
end if
screen.SetFocusedListItem(m.curShow)
print "list item updated | new show = "; m.curShow
else if msg.isScreenClosed() then
return -1
end if
end If
end while
End Function
You can have the server resize the images before sending them to the roku, or have the server resize them and upload the changed sizes to the content server with their names before generating the xml.
That’s what one of our channels does and it works great.
The problem is when you use images from a server you have no control over. The Pentagon Channel I did is an example. There’s no reason for the box to scale the posters every time you move through the screen. Do it once, cache the images and be done with it.
I understand what you’re saying, however, with images at 30-40KB each you can just as easily copy/upload them to a server you do have control over. Just with some bugs existing for multiple years on Roku, I wouldn’t count on having any fixes appear for this for a long time.
“renojim” wrote:
The problem is when you use images from a server you have no control over. The Pentagon Channel I did is an example. There’s no reason for the box to scale the posters every time you move through the screen. Do it once, cache the images and be done with it.
-JT
I’m having this same posterscreen delay on my channels that grab the posterurl images from rss files that I have no control of. What would be the correct method of caching the images? I assume you’re saving them to tmp:/ but I’m unclear of the actual mechanics of doing that.
I’m using the generic parsing code like this this:
“agmark” wrote:
With a couple dozen or more of images, my posterscreen is painfully slow. Can anyone help speed things up?
TIA
Mark
It’s not the fetching of the images that’s the problem; it’s the box scaling the images that’s so slow. What size are the images you’re using for your posters? If their size is significantly different than the artwork sizes given in the Component Reference then the poster screen becomes painfully slow. Unless the firmware is changed to cache the scaled image rather than scaling it every time something on the screen changes, there isn’t much you can do unless you can send the image somewhere to be scaled and then you use that scaled image.
“agmark” wrote:
With a couple dozen or more of images, my posterscreen is painfully slow. Can anyone help speed things up?
TIA
Mark
It’s not the fetching of the images that’s the problem; it’s the box scaling the images that’s so slow. What size are the images you’re using for your posters?
-JT
Thanks JT. A quick look at a few of the images served up by the feeds looks like their size is in the 640x360 area. Not small but not huge either. I’m going to go through more of the channel feeds I’m using and see if there are any that are way too big. I’m guessing they’re all in that medium sized range. I quess I was hoping there was a way to cache the “resized” images, but apparently not. Bummer. It would be a HUGE performance boost if the box would do that. I suggest that be closely looked at since I assume many developers don’t have access to the images being served up.
I’ve been using the arced-landscape style which uses an HD image at 290x218. The arced-16x9 style uses 385x218. I wonder if that would help any? I’ll try it and see.
Have you tried using the different SetListDisplayMode options (scale-to-fill, scale-to-fit, zoom-to-fill, photo-fit) to see if the different scaling methods each one uses improves performance with the particular images you’re using?
For what it’s worth, the grid screen doesn’t suffer from this problem, so if your channel is easily adaptable to a grid layout, that might be another option.