VideoReader Failed to init Ubuntu 18.04

前两天使用服务器上matlab跑代码时,遇到一个解析视频方面的问题,找了很久,发现答案都很古老了,很多都行不通,故此记录一下。
搬运我在mathwork上面的回答:链接

报错信息

I’m trying to process video with matlab 2020b on Ubuntu 20.04. But I receive this log:
Error using VideoReader/initReader (line 734)
Could not read file due to an unexpected error. Reason: Unable to initialize the video properties

最新我的解决办法

I had a similar issue in Matlab R2021a, Ubuntu 18.04,
The best thing is to install all the packages of gstreamer. but i can not install that
so, i also find this: link: https://www.insidentally.com/articles/000012/
在 Ubuntu 中安装多媒体解码器
通过使用“ubuntu-restricted-extras”包,可以将必要的多媒体编解码器安装在 Ubuntu 及其衍生发行版中。它是一个包含各种多媒体包的软件包。
为了安装多媒体编解码器,您需要启用由 Ubuntu 创建的软件库 “multiverse”,这个库向用户提供非开源软件。
运行以下命令以启用 multiverse 和 restricted 存储库:
要启用“multiverse”存储库,请运行:
$ sudo add-apt-repository multiverse
要启用“restricted”存储库,请运行:
$ sudo add-apt-repository restricted
然后更新仓库索引,运行:
$ sudo apt update
最后,运行以下命令安装多媒体编解码器。它会让你进行两次确认,你只需要通过点击“回车”按钮进行确认。
$ sudo apt install ubuntu-restricted-extras
and if you can not install this ‘ubuntu-restricted-extras’, such as:
(如果你遇到如下错误!:

"
Connection failed [IP: 91.189.88.152 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
"

try this link: https://zhuanlan.zhihu.com/p/61228593 ( change the ubuntu source)
给你的ubuntu换一个国内源吧!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值