Bug Report Monitor Capture issue in Portrait mode

josa5521

New Member
hi
I am using OBS 0.461a.

For some reason ,I need to change my monitor from Landscape to Portrait by using rotation function(windows monitor setting or graphic card setting).Then I try to capture the Portrait mode monitor,I got a Portrait output but the direction is wrong.

I have searched forum but no post talking about the issue.
So this may be not the common situation,but still hope someone will fix it.
Thanks for the wonderful software.I really love it.

--
The original Landscape resolution of the monitor is 1024*768,
and Portrait resolution is 768*1024.

OBS output:
QZXqS.jpg
 

Lain

Forum Admin
Lain
Forum Moderator
Developer
I know what causes it, I mean obviously if your monitor is on it's side the output is basically going to be the same way, but I'm not sure how to detect if the monitor is turned on its side like that programmatically at the moment.
 

Voxletum

Member
This is kind of funny. Gotta look into this. Can't we just infer that the monitor is rotated based on the x value being lower than the y in the system's resolution for this screen?

AndreiD, or the original poster, can one of you provide us with a log file? viewtopic.php?f=6&t=97
 

Lain

Forum Admin
Lain
Forum Moderator
Developer
The app logs monitor data in the latest revisions, so if possible give a log file from that and I'll take a look. I'm not sure why someone would want to stream at 9:16 instead of 16:9, it's going to be an opposite aspect ratio of almost everyone watching, but that's your business I suppose.
 

AndreiD

New Member
Hello, the problems I'm having is that I'm trying to stream 16:9, but I have a dual monitor set-up, where my main monitor is 16:9, but my secondary is 9:16, set in landscape mode, and I'm trying to add a screen region from my landscape monitor, but it shows turned by 90 degrees on OBS.
How it looks on the landscape set monitor: http://imgur.com/9AQS8Iv
Log file:
Code:
Open Broadcaster Software v0.48.014b (test build) - 64bit ( ^ω^)
-------------------------------
CPU Name: Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz
CPU Speed: 3400MHz
Physical Memory:  8145MB Total, 4057MB Free
stepping id: 7, model 10, family 6, type 0, extmodel 1, extfamily 0, HTT 1, logical cores 8, total cores 4
monitor 1: pos={-1080, 0}, size={1080, 1920}
monitor 2: pos={0, 0}, size={1920, 1080}
Windows Version: 6.2 Build 9200 
Aero is Enabled
------------------------------------------
Adapter 1
  Video Adapter: NVIDIA GeForce GTX 660 Ti
  Video Adapter Dedicated Video Memory: 2082930688
  Video Adapter Shared System Memory: 2147479552
=====Stream Start: 2013-04-14, 18:21:01===============================================
  Multithreaded optimizations: On
  Base resolution: 1600x900
  Output resolution: 1600x900
------------------------------------------
Loading up D3D10...
Playback device {0.0.0.00000000}.{75f6d137-2290-43e9-8c67-7bddc5c79dd5}
------------------------------------------
Using desktop audio input: Speakers (High Definition Audio Device)
------------------------------------------
Using auxilary audio input: Microphone (High Definition Audio Device)
------------------------------------------
Audio Encoding: AAC
    bitrate: 128
------------------------------------------
------------------------------------------
Using Monitor Capture
------------------------------------------
Video Encoding: x264
    fps: 30
    width: 1600, height: 900
    preset: veryfast
    CBR: no
    CFR: no
    max bitrate: 3500
    buffer size: 3500
    quality: 10
------------------------------------------
------------------------------------------
------------------------------------------
------------------------------------------
------------------------------------------
Total frames rendered: 2556, number of frames that lagged: 0 (0.00%) (it's okay for some frames to lag)
Total duplicated frames: 0 (0.00%)
=====Stream End: 2013-04-14, 18:22:26=================================================

Profiler results:

==============================================================
frame - [100%] [avg time: 1.805 ms] [avg calls per frame: 1] [children: 78.4%] [unaccounted: 21.6%]
| scene->Preprocess - [5.87%] [avg time: 0.106 ms] [avg calls per frame: 1]
| video encoding and uploading - [72.5%] [avg time: 1.309 ms] [avg calls per frame: 1] [children: 71.9%] [unaccounted: 0.609%]
| | CopyResource - [0.665%] [avg time: 0.012 ms] [avg calls per frame: 0]
| | conversion to 4:2:0 - [0.111%] [avg time: 0.002 ms] [avg calls per frame: 0]
| | call to encoder - [71.1%] [avg time: 1.283 ms] [avg calls per frame: 0]
| | sending stuff out - [0.0554%] [avg time: 0.001 ms] [avg calls per frame: 0]
==============================================================
 
I'd personally like to be able to set one of my monitors to be recorded in portrait mode because I'd like to record a normal work session of mine; since I write code on a second monitor and test results on the first, it would be incredible helpful to see both monitors in the orientations I have them set in.

MSDN actually advises you detect landscape/portrait mode in a rather naive way, the exact same way mentioned above in this thread...

Code:
#include <windows.h>
//. . .

//Compare the height and width of the screen and act accordingly.
int theScreenWidth = GetSystemMetrics(SM_CXFULLSCREEN);
int theScreenHeight = GetSystemMetrics(SM_CYFULLSCREEN);
if (theScreenWidth > theScreenHeight) 
    //Run the application in landscape, as in:
    MessageBox(NULL,"Run in landscape.","Landscape",MB_OK);
else
    //Run the application in portrait, as in:
    MessageBox(NULL,"Run in portrait.","Portrait",MB_OK);
 

Lain

Forum Admin
Lain
Forum Moderator
Developer
I'm really sorry about this guys, I just haven't had the time, I haven't forgotten about it I've just been kind of busy with other more important things like critical bugs and crash fixes.

Are you serious though? That is the code they recommend? Ugh. Is there a way I can set my monitor to portrait mode myself so I can test this out? I can't actually turn it on its side though.
 

Voxletum

Member
Andrew McWatters said:
I'd personally like to be able to set one of my monitors to be recorded in portrait mode because I'd like to record a normal work session of mine; since I write code on a second monitor and test results on the first, it would be incredible helpful to see both monitors in the orientations I have them set in.

MSDN actually advises you detect landscape/portrait mode in a rather naive way, the exact same way mentioned above in this thread...

Code:
#include <windows.h>
//. . .

//Compare the height and width of the screen and act accordingly.
int theScreenWidth = GetSystemMetrics(SM_CXFULLSCREEN);
int theScreenHeight = GetSystemMetrics(SM_CYFULLSCREEN);
if (theScreenWidth > theScreenHeight) 
    //Run the application in landscape, as in:
    MessageBox(NULL,"Run in landscape.","Landscape",MB_OK);
else
    //Run the application in portrait, as in:
    MessageBox(NULL,"Run in portrait.","Portrait",MB_OK);

Hah. I was right. :P
 

Dopefish

Member
If the user is using NVIDIA or AMD, you could potentially use the NVAPI and/or the ADL SDK libraries to get this information from the drivers.

However, the solution still is not that much different than what MSDN suggests. The only difference is that you can enumerate through each monitor and get that information with the driver libraries. I run a three-monitor set up and use NVIDIA Surround, which makes my monitor appear as one very wide resolution (6056x1080), and if I use portrait it comes out to 3516x1920 (these are with bezel compensation). However, with the drivers I am able to look past this single large resolution and get the information from each display.

NVAPI:
Code:
NvU32 centerWidth = viewports[centerDisplayIdx].right - viewports[centerDisplayIdx].left + 1;
NvU32 centerHeight = viewports[centerDisplayIdx].bottom - viewports[centerDisplayIdx].top + 1;

if (centerWidth > centerHeight) {
// landscape
} else {
// portrait
}

ADL SDK:
Code:
if (pDisplaysInfo[iCurrentDisplaysInfo].displayRectVisible.iWidth > pDisplaysInfo[iCurrentDisplaysInfo].displayRectVisible.iHeight) {
// landscape
} else {
// portrait
}

Also, I have a fall-back in case the user does not use NVIDIA or AMD. (Screen.PrimaryScreen C#)
Code:
if (Screen.PrimaryScreen.Bounds.Width > Screen.PrimaryScreen.Bounds.Height) {
// landscape
} else {
// portrait
}
 

zxrax

New Member
Very old topic that I'm bumping here, but I just ran into the same issue.

Is there a fix that I can use? I stream Xbox gameplay and I'd like to have my computer monitor in vertical because it makes more sense in terms of the screen space I need for everything. I occasionally listen to music while streaming and when I do, I screencap a 300*50 box showing the song artist and title and put that on the stream so that I don't get asked about the music. When I try and screencap this box, the output is a vertical sliver of my monitor rather than a horizontal sliver, and it's in the wrong place.
 

Lain

Forum Admin
Lain
Forum Moderator
Developer
No you're right, I've neglected this issue, I need to probably try to do this with one of my own monitors and fix it properly.

Though I do hate the idea of someone streaming/recording in portrait, a person should be allowed to stream/record however they want.
 

alvinhochun

New Member
Not sure about anything, but when I test with my notebook + second monitor, and on Windows 7 using the Intel Graphics Control Panel to rotate the screen, this is what I get, which is normal and expected:

http://i.imgur.com/CLKxGD8.png (not embedding since that is an 1:1 screenshot)

Although, OBS refuses to use 900x1600 until I quit and restart OBS, probably because I rotate the screen after starting OBS initially.

P.S. Mine is an NVIDIA Optimus setup.
 

Lain

Forum Admin
Lain
Forum Moderator
Developer
Hopefully fixed in 0.54.08, I tested it out myself and everything seemed to be in order.
 
Top