树莓派HDMI强制输出
因为前几天用Raspbian自带安装VLC播放1080p MP4严重卡顿,调研了一下;发现默认安装VLC是不带硬件解码的,也即没有发挥BCM2XXX ARM的GPU硬解码能力。
那么最简洁的解决方案是什么:命令行下omxplayer加上GUI外壳TBOplayer,试了一下果然很流畅而且占用cpu个位数,解H264编码的MP4和MKV文件都很流畅(且测试用的是pi2而非pi3)。
但这里边还有个小问题,树莓派如果上电时不接HDMI,物理口上是没输出的;这是个普遍问题,相信对于一个嵌入式设备,很多人都有类似需求(比如关屏不关盒),那么何解呢?
sudo vi /boot/config.txt
1 2 3 4 5 6 |
# uncomment if hdmi display is not detected and composite is being output hdmi_force_hotplug=1 # uncomment to force a specific HDMI mode (this will force VGA) hdmi_group=1 hdmi_mode=16 |
在hdmi_mode上有如下选择,表格来自于Raspbian官方文档。
hdmi_mode | resolution | frequency | notes |
---|---|---|---|
1 | VGA (640×480) | ||
2 | 480p | 60Hz | |
3 | 480p | 60Hz | 16:9 aspect ratio |
4 | 720p | 60Hz | |
5 | 1080i | 60Hz | |
6 | 480i | 60Hz | |
7 | 480i | 60Hz | 16:9 aspect ratio |
8 | 240p | 60Hz | |
9 | 240p | 60Hz | 16:9 aspect ratio |
10 | 480i | 60Hz | pixel quadrupling |
11 | 480i | 60Hz | pixel quadrupling, 16:9 aspect ratio |
12 | 240p | 60Hz | pixel quadrupling |
13 | 240p | 60Hz | pixel quadrupling, 16:9 aspect ratio |
14 | 480p | 60Hz | pixel doubling |
15 | 480p | 60Hz | pixel doubling, 16:9 aspect ratio |
16 | 1080p | 60Hz | |
17 | 576p | 50Hz | |
18 | 576p | 50Hz | 16:9 aspect ratio |
19 | 720p | 50Hz | |
20 | 1080i | 50Hz | |
21 | 576i | 50Hz | |
22 | 576i | 50Hz | 16:9 aspect ratio |
23 | 288p | 50Hz | |
24 | 288p | 50Hz | 16:9 aspect ratio |
25 | 576i | 50Hz | pixel quadrupling |
26 | 576i | 50Hz | pixel quadrupling, 16:9 aspect ratio |
27 | 288p | 50Hz | pixel quadrupling |
28 | 288p | 50Hz | pixel quadrupling, 16:9 aspect ratio |
29 | 576p | 50Hz | pixel doubling |
30 | 576p | 50Hz | pixel doubling, 16:9 aspect ratio |
31 | 1080p | 50Hz | |
32 | 1080p | 24Hz | |
33 | 1080p | 25Hz | |
34 | 1080p | 30Hz | |
35 | 480p | 60Hz | pixel quadrupling |
36 | 480p | 60Hz | pixel quadrupling, 16:9 aspect ratio |
37 | 576p | 50Hz | pixel quadrupling |
38 | 576p | 50Hz | pixel quadrupling, 16:9 aspect ratio |
39 | 1080i | 50Hz | reduced blanking |
40 | 1080i | 100Hz | |
41 | 720p | 100Hz | |
42 | 576p | 100Hz | |
43 | 576p | 100Hz | 16:9 aspect ratio |
44 | 576i | 100Hz | |
45 | 576i | 100Hz | 16:9 aspect ratio |
46 | 1080i | 120Hz | |
47 | 720p | 120Hz | |
48 | 480p | 120Hz | |
49 | 480p | 120Hz | 16:9 aspect ratio |
50 | 480i | 120Hz | |
51 | 480i | 120Hz | 16:9 aspect ratio |
52 | 576p | 200Hz | |
53 | 576p | 200Hz | 16:9 aspect ratio |
54 | 576i | 200Hz | |
55 | 576i | 200Hz | 16:9 aspect ratio |
56 | 480p | 240Hz | |
57 | 480p | 240Hz | 16:9 aspect ratio |
58 | 480i | 240Hz | |
59 | 480i | 240Hz | 16:9 aspect ratio |
一个配置解决问题,方便简洁。
只有一个潜在问题就是,盒子HDMI不会探测显示器对物理分辨率的支持,因为被强制了,这点要注意——如果接到了更低端的显示器上,有可能造成无法显示。
文章的脚注信息由WordPress的wp-posturl插件自动生成