Temporary change of overscan, how?
#1
Question 
I've been looking at some optimizations (or features) for XBMC when using a HD projector and a 1:2.35 projector screen.
The background for this is that I use XBMC with a Panasonic AE3000 projector onto a 1:2.35 screen. Now in terms of image quality I am very happy with this setup, and since the AE3000 has a zoom memory feature that allows me to easily zoom the image so that a 1:2.35 movie fills the whole screen.

Now, the caveat here is that when zoomed to 1:2.35 I essentially get an image with a huge overscan (parts of the image is outside the screen). What I am trying to do now is to patch XBMC to display the GUI in the 1:2.35 area, but only during playback of 1:2.35 video.

I have partially succeeded by setting the overscan parameters when the movie starts playing, thus forcing the GUI to appear where I want it (inside the 1:2.35 area).

In GUIWindowFullScreen::OnMessage(CGUIMessage& message) I did something like
Code:
bool CGUIWindowFullScreen::OnMessage(CGUIMessage& message)
{
  switch (message.GetMessage())
  {
  case GUI_MSG_WINDOW_INIT:

  // :
  // : Start of patch
  // :
    
      CRect SrcRect,DestRect;
      g_application.m_pPlayer->GetVideoRect(SrcRect,DestRect);
      CLog::Log(LOGDEBUG, "CGUIWindowFullScreen::OnMessage(WINDOW_INIT) - Dest VideoRect: (%f,%f) -> (%f,%f)",DestRect.x1,DestRect.y1,DestRect.x2,DestRect.y2);
      m_videoFrameBottom = (int)DestRect.y2;
      m_videoFrameTop = (int)DestRect.y1;

      if (m_cinemascopeMode)
      {
        RESOLUTION myRes;
        myRes = g_graphicsContext.GetVideoResolution();
        oldOverscan = g_settings.m_ResInfo[myRes].Overscan;
        g_settings.m_ResInfo[myRes].Overscan.top = m_videoFrameTop;
        g_settings.m_ResInfo[myRes].Overscan.bottom = m_videoFrameBottom;
        m_overscanModified = true;
      }

  // :
  // : End of patch
  // :
      // switch resolution
      g_graphicsContext.SetFullScreenVideo(true);

}

At GUI_MSG_WINDOW_DEINIT I revert the overscan settings.

This works, but the problem is that is also modifies the guisettings.xml file.
That, I do not want, since if XBMC crashed or the computer hangs or something of that sort, the GUI will be messed up next time I restart.

Ideally what I want is to modify the overscan parameters for the UI only while a video is playing, without any side effect like writing to guisettings.xml.
After the video is stopped I want to revert the overscan settings.

My question then is: How can I modify the overscan settings (temporarily) without affecting guisettings.xml? Shall I even be doing this in the GUIWindowFullScreen class; perhaps some other place is better suited?

Any input is appreciated.
Thanks
Micke
Reply
#2
You know xbmc can zoom a video too right?
Reply
#3
Wouldn't you get the same outcome using the "zoom" functions for videos inside of XBMC instead of futzing with the projector?
Reply
#4
Actually, if you set "view mode" to "zoom" in the video settings dialog, it will automatically zoom the video to get rid of the black bars.
The settings are saved in CGUIWindowFullScreen::FreeResources, you could make it not call g_settings.Save() if you don't want to save the overscan.
Reply
#5
mikper Wrote:How can I modify the overscan settings (temporarily) without affecting guisettings.xml? Shall I even be doing this in the GUIWindowFullScreen class; perhaps some other place is better suited?

For your purpose the easiest hack might be create a global flag which you set while projecting a 1:2.35 image. Then you just skip the guisettings.xml saving code while that flag is set (CGUISettings::SaveXML I think). Very ugly and very easy, but is probably not something you are going to submit anyway.
Maybe it won't save any other setting you modify while in wide mode, but who cares, I would presume while in wide mode you are enjoying the movie and won't be fiddeling with XBMC...

By the way: I finished the align-subs-with image-border you asked. We are in the same boat here: XBMC is lacking all those nice projector gimmicks. Except I do not have a CIH setup Sad
Reply
#6
Hi all,
thanks for your quick responses.

bobo1on1 Wrote:You know xbmc can zoom a video too right?
Yes, I know... but that does not do what I want, though.

dan1son Wrote:Wouldn't you get the same outcome using the "zoom" functions for videos inside of XBMC instead of futzing with the projector?
No, I would not. If I would set the projector to always fill the screen width (1.2:35) I would have to use XBMC and zoom out to view 16:9 material and then I loose resolution. And when I use the computer with other applications, the desktop would partly be outside the screen.
So, I do want to zoom using the projector. But fortunaltely it is very easy to change the projector zoom between 16:9 and 1:2.35, since it has lens (or zoom) memory.

Actually, my plan is to write a script that automatically zooms the projector to the right zoom mode when a video starts (depending on the aspect ratio of the video). With XBMC this is possible and not too difficult to achieve. And it is in that context that I want to modify the overscan settings.

bobo1on1 Wrote:The settings are saved in CGUIWindowFullScreen::FreeResources, you could make it not call g_settings.Save() if you don't want to save the overscan.
Ok, thanks. I'll have a look at that.

Aardvark Wrote:By the way: I finished the align-subs-with image-border you asked. We are in the same boat here: XBMC is lacking all those nice projector gimmicks.

Oh, thanks Aardvark. But I actually already submitted a patch for this (could not keep from coding Nerd ): http://trac.xbmc.org/ticket/10281.
Hope it will not interfere with the stuff you are working on. It was a very small change to achieve wanted in terms of subtitle position, much thanks to your help. Big Grin
Still, I'd like to see your solution if possible.

Oh, and I would like your input on one thing. As I said in the patch ticket, I added an option in the settings UI for it, but I am considering if that's the right place for it. Maybe it should be more "hidden", like a setting in "advancedsettings.xml". What do you think?

Anyway, it's actually a bit of fun trying to implement some of those projector gimmicks in XBMC. Maybe we should start a thread on what features projector users would like to see...

Cheers,
Mikael
Reply
#7
mikper Wrote:But I actually already submitted a patch for this (could not keep from coding Nerd ): http://trac.xbmc.org/ticket/10281.

Hope it will not interfere with the stuff you are working on. It was a very small change to achieve wanted in terms of subtitle position, much thanks to your help. Big Grin
Still, I'd like to see your solution if possible.

Oh, and I would like your input on one thing. As I said in the patch ticket, I added an option in the settings UI for it, but I am considering if that's the right place for it. Maybe it should be more "hidden", like a setting in "advancedsettings.xml". What do you think?

Well, all of it is answered by my possible patch-to-be: I made a setting which toggles the location between fixed, video-bottom, video-top, above, below.
All the non-fixed locations 'hug' to the edge of the video, while the normal fixed offset-from-screenbottom value is used to create extra distance from the upper or lower video edge. Note that this also means that for subtitles below or video-top the subtitles align vertically upwards instead of downwards.

The reason for all these options is that I have the subs below if I have enough black bar (1:2.35), in the bottom if not (16:9) or in the top of video if 16:9 and hardcoded subs are in the way (ripped from weird chinese discs). And the 'above' is for when you want to recreate that opera-feeling (real opera performances are sometimes above-titled, the translation is on a huge led-bar above the stage) :-)

I'll try to post my patch on this forum for you to judge. Or as I do not think I can upload files here (I do not see any button) I could put it in the same trac ticket as an alternative. Not sure if that would be polite though :-)

Quote:Anyway, it's actually a bit of fun trying to implement some of those projector gimmicks in XBMC. Maybe we should start a thread on what features projector users would like to see...

Good idea, done: see 'projector friendly thread in XBMC suggestions forum.
Reply
#8
mikper Wrote:No, I would not. If I would set the projector to always fill the screen width (1.2:35) I would have to use XBMC and zoom out to view 16:9 material and then I loose resolution. And when I use the computer with other applications, the desktop would partly be outside the screen.
So, I do want to zoom using the projector. But fortunaltely it is very easy to change the projector zoom between 16:9 and 1:2.35, since it has lens (or zoom) memory.

Ah, I was stuck thinking your screen was 4:3 and you were trying to chop the sides off to fill it vertically. My mistake for not reading thoroughly.

That projector seems rather nice as well.
Reply
#9
Aardvark Wrote:I'll try to post my patch on this forum for you to judge. Or as I do not think I can upload files here (I do not see any button) I could put it in the same trac ticket as an alternative. Not sure if that would be polite though :-)



Good idea, done: see 'projector friendly thread in XBMC suggestions forum.

Don't worry about polite, not sensitive in that way ;-)
The projector friendly thread looks good by the way. I might add some thoughts there (I will be away for a few days from tomorrow, though).
Reply
#10
Submitted patch for extended control of subtitle positioning at http://trac.xbmc.org/ticket/10281
Reply
#11
Have you been successful in making this work. I also have a Panasonic ae4000 with auto zoom. Could you help me with you same problem when watching zoomed movies. The menu will show on the wall below my screen. Any help would be appreciated

thanks
Reply
#12
Hi shawndaddy,
I have almost got it working, so that the UI gets the same aspect ratio as the video.

I have a problem with that the GUI sometimes gets stuck in zoomed mode, and in that case I have to go into guisettings.xml and manually edit the "<resolution>" entries. This problem appears at refresh rate change on start (and end) of video playback. As you probably know this happens when using the projector as display and have the "change refresh rate" option enabled...

What makes it a bit difficult to debug is that it does not happen on my develoment rig (can't get a refresh rate change on video start).

I have an idea on how to work around that. (The problem is to get the time to do it, as it is now I might get a one or two hours a week to work on this.)
The idea is to define a secondary overscan entry for each resolution in guisettings.xml and be sure to use that for 2.35 aspect videos.

If and when I get this sorted I could let you know and you could try a patch and see if it works. I can't promise anything, but with a bit of luck I might be able to fix it within two or three weeks.
Reply
#13
ok thanks for your effort on the matter
Reply

Logout Mark Read Team Forum Stats Members Help
Temporary change of overscan, how?0