16
General / Re: FPS Monitor
« on: December 28, 2020, 05:54:01 AM »Hi, sorry for the necro, I'm not sure if rand0m still visits here. But what if you incorporated this line?
video.video_flags = Vid.NoAutoStart;
Then change the lines in your example as follows:
video.visible = false to read video.video_playing = false
video.visible = true to read video.video_playing = true
I'm sure you already found a solution, actually I'd be interested to know what you ended up with.
Hi, Vid.NoAutoStart still processes the video file so the FPS drops are same. Oomek helped me out through a "fe.get_art" code, listed below is a little modified version of Oomek's code:
Code: [Select]
local settings =
{
delay_timer = 0,
play_delay = 400,
video_reload = false
}
local vid_txt = fe.add_text( "", 0,0,0,0) //debug
vid_txt.set_bg_rgb(50,50,50) //debug
vid_txt.align = Align.BottomCentre //debug
vid_txt.char_size = 1 //debug
local video = fe.add_image("video", 680,705,472,355)
video.preserve_aspect_ratio = true
video.mipmap = true
video.file_name = ""
function video_on_transition(ttype, var, transition_time)
{
if (ttype == Transition.StartLayout || ttype == Transition.ToNewList || ttype == Transition.ToNewSelection)
{
settings.delay_timer = fe.layout.time
settings.video_reload = true
video.file_name = "" // comment the line if you want the video to stay until EndNavigation
}
return false
}
function video_on_tick(tick_time)
{
if (settings.video_reload && tick_time - settings.delay_timer >= settings.play_delay)
{
vid_txt.msg = fe.get_art("video") //debug
video.file_name = fe.get_art("video")
settings.video_reload = false
}
}
Couple of pointers!
1. This code starts processing the video once you stay on game item for 400 millisec. The way I designed the theme is that video starts running on top of a gameplay snap, so snap is visible in normal browsing and video only runs when you wait for half a sec on an item.
2. FPS drops were reduced from 52-56 to 58-59m, hardly noticeable.
3. I am running AM on HDD, running AM on SSD (where media items are on same SSD) will probably have no FPS drops at all.