Ubuntu下安装mplayer
Ubuntu下安装mplayer
记一次在Ubuntu下安装mplayer。
使用源码编译安装比较复杂,这里直接介绍用命令安装的方法。
准备:
使用whereis mplayer查看虚拟机是否已经存在mplayer,如下即还没安装mplayer
如果是已经安装了,应该是这样
已经安装的mplayer不能使用,可以卸载了再按下面步骤安装
卸载命令为 sudo apt-get remove mplayer
安装:
一、 先确定虚拟机可以上网
二、 更新源
1.先备份cp /etc/apt/sources.list /etc/apt/sources.list.bak
2.
将sources.list的内容删除,将下面的源复制到其中
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://archive.canonical.com/ubuntu/ xenial partner
deb http://extras.ubuntu.com/ubuntu/ xenial main
3.最后执行下面两行命令
sudo apt-get update
sudo apt-get upgrade
三、 输入sudo apt-get install mplayer命令,安装mplayer
四、 在命令行中输入mplayer 若有下面的打印结果说明mplayer已经安装成功
五、 输入mplayer + 文件路径,即可播放视频和音乐,如下
六、 播放时发现视频无声音,解决方法如下
1.下载pavucontrol
2.打开Volume Control
3.检查之后,发现虚拟机没加声卡,按照下图方式加声卡
(虚拟机->设置->硬件)