python - 在 python 2.7 的 Windows 上安装 gstreamer 1.0

我一直在尝试在 Windows 上安装 gstreamer 1.0 以用作 python 2.7 模块。我从这里安装了 sdk http://docs.gstreamer.com/display/GstSDK/Installing+on+Windows这允许我import pygst,但它只允许我使用 gstreamer 0.1(如果我尝试 pygst.require(‘1.0’) 我得到一个 pygst.RequiredVersionError 只有版本’0.10’ 可用)。

我四处寻找 gstreamer 1.0 版本的 sdk,但没有成功,所以我希望我可以根据需要更改 0.1 sdk。

我从这里下载了 gstreamer 1.0 http://gstreamer.freedesktop.org/data/pkg/windows/1.5.2/但我实际上不确定在修复 RequiredVersionError/获得正确的 sdk 后如何处理它。任何帮助表示赞赏。

最佳答案

适用于 Python 3.4.3。

从以下位置下载: http://sourceforge.net/projects/pygobjectwin32/files/?source=navbar

在 Windows 中安装 pygi-aio-3.14.0_rev22-setup.exe

在程序.py中:

import gi

gi.require_version('Gst', '1.0')

from gi.repository import Gst

pipeline = Gst.Pipeline.new("player")

src = Gst.ElementFactory.make("audiotestsrc", "src")

sink = Gst.ElementFactory.make("autoaudiosink", "output")

pipeline.add(src)

pipeline.add(sink)

src.link(sink)

pipeline.set_state(Gst.State.PLAYING)
nvidia@ubuntu:~$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EB3E94ADBE1229CF Executing: /tmp/apt-key-gpghome.yUehSg7N9i/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EB3E94ADBE1229CF gpg: 密钥 EB3E94ADBE1229CF:公钥 “Microsoft (Release signing) <gpgsecurity@microsoft.com>” 已导入 gpg: 处理的总数:1 gpg: 已导入:1 nvidia@ubuntu:~$ nvidia@ubuntu:~$ cd /etc/apt/sources.list.d nvidia@ubuntu:/etc/apt/sources.list.d$ sudo rm *ros*.list # 删除名称含"ros"的源文件 nvidia@ubuntu:/etc/apt/sources.list.d$ # 清华源(Ubuntu 18.04) nvidia@ubuntu:/etc/apt/sources.list.d$ sudo sh -c 'echo "deb https://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' nvidia@ubuntu:/etc/apt/sources.list.d$ sudo apt update # 应不再报错 命中:3 http://ports.ubuntu.com/ubuntu-ports focal InRelease 命中:5 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal InRelease 获取:6 https://packages.microsoft.com/repos/code stable InRelease [3,590 B] 获取:7 https://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu focal InRelease [4,679 B] 命中:8 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease 命中:1 https://repo.download.nvidia.cn/jetson/common r35.5 InRelease 命中:2 https://repo.download.nvidia.cn/jetson/t194 r35.5 InRelease 命中:9 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease 命中:4 https://repo.download.nvidia.cn/jetson/ffmpeg r35.5 InRelease 命中:10 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease 错误:6 https://packages.microsoft.com/repos/code stable InRelease 由于没有公钥,无法验证下列签名: NO_PUBKEY EB3E94ADBE1229CF 获取:11 https://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu focal/main arm64 Packages [826 kB] 正在读取软件包列表... 完成 W: GPG 错误:https://packages.microsoft.com/repos/code stable InRelease: 由于没有公钥,无法验证下列签名: NO_PUBKEY EB3E94ADBE1229CF E: 仓库 “https://packages.microsoft.com/repos/code stable InRelease” 没有数字签名。 N: 无法安全地用该源进行更新,所以默认禁用该源。 N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。 nvidia@ubuntu:/etc/apt/sources.list.d$ sudo apt upgrade -y 正在读取软件包列表... 完成 正在分析软件包的依赖关系树 正在读取状态信息... 完成 正在计算更新... 完成 下列软件包是自动安装的并且现在不需要了: libdc1394-25 使用'sudo apt autoremove'来卸载它(它们)。 The following security updates require Ubuntu Pro with 'esm-infra' enabled: libgstreamer-plugins-base1.0-dev libstdc++-10-dev libsoup-gnome2.4-1 libopenjp2-7 poppler-utils gstreamer1.0-alsa libcups2 libprotoc-dev linux-libc-dev xserver-common libpoppler-dev libxml2-utils libpython3.8-dev gir1.2-soup-2.4 gstreamer1.0-plugins-base-apps openssl libblockdev-swap2 ruby2.7 xserver-xorg-core libprotoc17 gir1.2-gdkpixbuf-2.0 libgdk-pixbuf2.0-0 libssh-4 libpython3.8-minimal libsqlite3-dev libwbclient0 git-man libmysqlclient-dev libsystemd0 gcc-10-base gstreamer1.0-plugins-good libgs9 python2.7-minimal libsqlite3-0 python3-protobuf python3-urllib3 libsnmp-base bind9-host libitm1 libcgraph6 libtiff-dev sudo libpython2.7 python2.7 python3-pip libpython3.8 python3.8 xserver-xorg-legacy git libblockdev-crypto2 udev gstreamer1.0-plugins-base libasan6 libblockdev-loop2 libblockdev-fs2 libgstreamer-plugins-good1.0-dev libblockdev-part2 python3-requests liblab-gamut1 libgstreamer-plugins-good1.0-0 libudev1 libsoup2.4-1 gstreamer1.0-pulseaudio systemd-timesyncd libpoppler-private-dev libgcc1 samba-libs xserver-xephyr protobuf-compiler libgcc-10-dev gstreamer1.0-gtk3 libpmix2 libtiff5 udisks2 libsnmp35 libtsan0 libubsan1 libruby2.7 libprotobuf-lite17 libgfortran5 python3.8-minimal libgstreamer-gl1.0-0 systemd-sysv libblockdev2 libxml2-dev libpam-systemd libgstreamer-plugins-base1.0-0 libcdt5 xwayland gstreamer1.0-x ghostscript liblsan0 libpathplan4 systemd libgomp1 libgdk-pixbuf2.0-bin libssh-gcrypt-4 gir1.2-gst-plugins-base-1.0 libssl-dev libblockdev-utils2 ghostscript-x libgvpr2 libgdk-pixbuf2.0-common libsmbclient libgdk-pixbuf2.0-dev libmysqlclient21 libnss-systemd libgs9-common libblockdev-part-err2 libgcc-s1 libxml2 libpython2.7-minimal libpython3.8-stdlib libgnutls30 libudisks2-0 python3.8-dev libatomic1 libssl1.1 libcc1-0 libgvc6 libprotobuf17 libcupsimage2 libpython2.7-stdlib libpoppler-glib8 libstdc++6 libpoppler97 python3-scipy libprotobuf-dev libopenjp2-7-dev graphviz python-pip-whl bind9-libs gstreamer1.0-gl libtiffxx5 libxslt1.1 Learn more about Ubuntu Pro at https://ubuntu.com/pro 升级了 0 个软件包,新安装0 个软件包, 要卸载 0 个软件包,有 0 个软件包未被升级。 nvidia@ubuntu:/etc/apt/sources.list.d$
最新发布
11-20
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值