linux 視頻輸出xrandr設置命令


linux 視頻輸出xrandr設置命令

沈祥佑
0.4392019.03.28 17:44:09字數 397閱讀 3,264

xrandr

不帶參數的xrandr 命令會列出系統支持的視頻接口名稱和設備連接情況,還可以從輸出信息里看到當前分辨率current,以及支持的最大分辨率。
帶*的表示當前分辨率。

$xrandr
Screen 0: minimum 8 x 8, current 1080 x 1920, maximum 32767 x 32767 DSI1 connected (normal left inverted right x axis y axis) 1024x600 60.00 + 1024x576 59.90 59.82 960x540 59.63 59.82 800x600 60.32 56.25 864x486 59.92 59.57 640x480 59.94 720x405 59.51 58.99 640x360 59.84 59.32 512x300 60.00 DP1 disconnected (normal left inverted right x axis y axis) DP2 disconnected (normal left inverted right x axis y axis) HDMI1 disconnected (normal left inverted right x axis y axis) HDMI2 connected primary 1080x1920+0+0 right (normal left inverted right x axis y axis) 480mm x 270mm 1920x1080 60.00*+ 1600x1200 60.00 1680x1050 59.88 1400x1050 59.95 1280x1024 75.02 60.02 1440x900 59.90 1280x960 60.00 1152x864 75.00 1024x768 75.03 70.07 60.00 832x624 74.55 800x600 72.19 75.00 60.32 56.25 640x480 75.00 72.81 66.67 59.94 720x400 70.08 VIRTUAL1 disconnected (normal left inverted right x axis y axis) 

1. 將視頻輸出發送到某個接口設備:

$ xrandr --output DFP1 --auto 

2. 設置分辨率時需要指定設置的output及mode,如將LVDS-1的分辨率改為1920×1080,命令就是:

 xrandr --output eDP1 --mode 1920x1080 
 --output:指定顯示器。 
 --mode:指定一種有效的分辨率。 
 --rate:指定刷新率。

3. 添加有效分辨率

如果xrandr查詢結果中沒有合適的分辨率,則可以通過newmode來

添加,下面將給出eDP1添加1280x1024x60的分辨率方法。

3.1 使用cvt生成一個modeline,命令如下:

$cvt 1280  1024  60
 #1280x1024 59.89 Hz (CVT 1.31M4) hsync: 63.67 kHz; pclk: 109.00 MHz
 Modeline "1280x1024_60.00"  109.00  1280 1368 1496 1712  1024 1027 1034 1063 -hsync +vsync

3.2 使用newmode創建一個mode,參數就是上面的modeline后的內容:

$xrandr --newmode "1280x1024_60.00"  109.00  1280 1368 1496 1712  1024 1027 1034 1063 -hsync +vsync

3.3 新建模式,將新模式添加至當前輸出設備,如果出錯,則說明不支持此模式

$xrandr --addmode eDP1 1280x1024_60.00

3.4 設置newmode為當前分辨率

$xrandr --output eDP1 --mode 1280x1024_60.00

4 . 關閉某個接口設備的視頻輸出。

 $ xrandr --output LVDS --off 

5.設置雙屏幕顯示:

(1)打開外接顯示器,雙屏幕顯示相同的內容--克隆,(auto為最高分辨率)

xrandr --output VGA-0 --same-as DVI-D-0 --auto 

(2)若要指定外接顯示器的分辨率可以使用下面的命令(1280*1024):

 xrandr --output VGA-0 --same-as DVI-D-0 --mode 1280x1024 

(3)打開外接顯示器,設置為右側擴展

 xrandr --output VGA-0 --right-of DVI-D-0 --auto 

(4)關閉顯示器

 xrandr --output VGA-0 --off

(5)打開VGA-0接口顯示器,關閉DVI-D-0接口顯示器

 xrandr --output VGA-0 --auto --output DVI-D-0 --off 

(6設置HDMI2為主屏幕

$ xrandr --output HDMI2 --auto --primary 

(7) 設置eDp1在HDMI2的右面

$ xrandr --output eDP1 --right-of HDMI2 --auto
 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM