我全新安装了 Ubuntu 19.04,无法在 Totem 中播放 MP4 视频。按照建议安装必要的解码器失败。我必须安装哪些编解码器才能播放此视频文件,它使用 H.264(High Profile)视频编解码器和 MPEG-4 AAC 音频编解码器?
在安装过程中,我选中了安装第三方图形软件和其他媒体格式的复选框:
我已启用主存储库、宇宙存储库、受限存储库和多元宇宙存储库。
我已经安装了多个 gstreamer 包和编解码器:
tom@desktop:~$ apt list --installed | grep gstreamer
gir1.2-gstreamer-1.0/disco,now 1.15.90-1ubuntu1 amd64 [installed,automatic]
gstreamer1.0-alsa/disco,now 1.15.90-1 amd64 [installed,automatic]
gstreamer1.0-clutter-3.0/disco,now 3.0.27-1 amd64 [installed,automatic]
gstreamer1.0-gl/disco,now 1.15.90-1 amd64 [installed,automatic]
gstreamer1.0-gtk3/disco,now 1.15.90-1ubuntu1 amd64 [installed,automatic]
gstreamer1.0-libav/disco,now 1.15.90-1 amd64 [installed,automatic]
gstreamer1.0-packagekit/disco,now 1.1.12-5 amd64 [installed,automatic]
gstreamer1.0-plugins-bad/disco,now 1.15.90-1ubuntu1 amd64 [installed,automatic]
gstreamer1.0-plugins-base-apps/disco,now 1.15.90-1 amd64 [installed,automatic]
gstreamer1.0-plugins-base/disco,now 1.15.90-1 amd64 [installed,automatic]
gstreamer1.0-plugins-good/disco,now 1.15.90-1ubuntu1 amd64 [installed,automatic]
gstreamer1.0-plugins-ugly/disco,now 1.15.90-1 amd64 [installed,automatic]
gstreamer1.0-pulseaudio/disco,now 1.15.90-1ubuntu1 amd64 [installed,automatic]
gstreamer1.0-tools/disco,now 1.15.90-1ubuntu1 amd64 [installed,automatic]
gstreamer1.0-vaapi/disco-updates,now 1.15.90-1ubuntu1 amd64 [installed,automatic]
gstreamer1.0-x/disco,now 1.15.90-1 amd64 [installed,automatic]
libgstreamer-gl1.0-0/disco,now 1.15.90-1 amd64 [installed,automatic]
libgstreamer-plugins-bad1.0-0/disco,now 1.15.90-1ubuntu1 amd64 [installed,automatic]
libgstreamer-plugins-base1.0-0/disco,now 1.15.90-1 amd64 [installed,automatic]
libgstreamer-plugins-good1.0-0/disco,now 1.15.90-1ubuntu1 amd64 [installed,automatic]
libgstreamer1.0-0/disco,now 1.15.90-1ubuntu1 amd64 [installed,automatic]
libreoffice-avmedia-backend-gstreamer/disco-updates,disco-security,now 1:6.2.5-0ubuntu0.19.04.1 amd64 [installed,automatic]
我已经安装了 Totem,带有默认软件包和插件:
tom@desktop:~$ apt list --installed | grep totem
gir1.2-totem-1.0/disco,now 3.32.0-1ubuntu1 amd64 [installed,automatic]
gir1.2-totemplparser-1.0/disco,now 3.26.3-1ubuntu1 amd64 [installed,automatic]
libtotem-plparser-common/disco,disco,now 3.26.3-1ubuntu1 all [installed,automatic]
libtotem-plparser18/disco,now 3.26.3-1ubuntu1 amd64 [installed,automatic]
libtotem0/disco,now 3.32.0-1ubuntu1 amd64 [installed,automatic]
totem-common/disco,disco,now 3.32.0-1ubuntu1 all [installed,automatic]
totem-plugins/disco,now 3.32.0-1ubuntu1 amd64 [installed,automatic]
totem/disco,now 3.32.0-1ubuntu1 amd64 [installed,automatic]
我没有安装,ubuntu-restricted-extras
因为我不需要额外的软件包(微软字体等...),但我已经手动安装了libavcodec-extra
libavcodec-extra58
随附的 AV 编解码器():
tom@desktop:~$ apt-cache depends ubuntu-restricted-extras
ubuntu-restricted-extras
Depends: ubuntu-restricted-addons
Recommends: libavcodec-extra
libavcodec-extra58
Recommends: ttf-mscorefonts-installer
Recommends: unrar
我注意到,我可以通过将视频文件从 Nautilus 拖到空的 Firefox 或 Chromium 选项卡中来播放它,但 Totem 无法播放它。
当我单击“在 Ubuntu 软件中查找”按钮时,Ubuntu 软件会显示消息“无法找到请求的软件”(最后一点可能是错误,但我不介意,我只需要知道要手动安装哪些软件包)。有什么建议吗?如何在全新安装的 19.04 上在 Totem 中播放此文件?
编辑:经过进一步的故障排除,我发现如果文件是 MKV 容器格式而不是 MP4,Totem 会播放相同的文件。我使用youtube-dl
(最新版本,不是来自存储库)下载 BBC iPlayer 视频。我可以设置选项--merge-output-format mkv
并播放下载的文件。如果没有该选项,它会输出到 MP4,我无法播放。这是一个不错的解决方法,但我很想知道究竟是什么干扰了 MP4 播放并修复它。
如果您位于 iPlayer 服务区域并且想要进行测试,我使用了这个三分钟的简短视频https://www.bbc.co.uk/iplayer/episode/p07hlmxr/the-news-explained-a-tale-of-two-tankers
,该视频下载了文件The_News_Explained_A_Tale_of_Two_Tankers.fstream-uk-iptv_streaming_concrete_combined_hd_mf_limelight_uk_dash_https-video=5070000.mp4
,The_News_Explained_A_Tale_of_Two_Tankers.fstream-uk-iptv_streaming_concrete_combined_hd_mf_limelight_uk_dash_https-audio_eng_1=128000.m4a
然后将它们合并为 MP4 或 MKV。
命令输出vainfo
(来自评论):
error: XDG_RUNTIME_DIR not set in the environment.
libva info: VA-API version 1.4.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/nouveau_drv_video.so
libva info: Found init function __vaDriverInit_1_4
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.4 (libva 2.4.0)
vainfo: Driver version: Mesa Gallium driver 19.0.2 for NV136
vainfo: Supported profile and entrypoints
VAProfileNone : VAEntrypointVideoProc
命令输出vdpauinfo
(来自评论):
display: :0 screen: 0
API version: 1
Information string: G3DVL VDPAU Driver Shared Library version 1.0
Video surface:
name width height types
-------------------------------------------
420 16384 16384 NV12 YV12
422 16384 16384 UYVY YUYV
444 16384 16384 Y8U8V8A8 V8U8Y8A8
Decoder capabilities:
name level macbs width height
----------------------------------------------------
MPEG1 --- not supported ---
MPEG2_SIMPLE --- not supported ---
MPEG2_MAIN --- not supported ---
H264_BASELINE --- not supported ---
H264_MAIN --- not supported ---
H264_HIGH --- not supported ---
VC1_SIMPLE --- not supported ---
VC1_MAIN --- not supported ---
VC1_ADVANCED --- not supported ---
MPEG4_PART2_SP --- not supported ---
MPEG4_PART2_ASP --- not supported ---
DIVX4_QMOBILE --- not supported ---
DIVX4_MOBILE --- not supported ---
DIVX4_HOME_THEATER --- not supported ---
DIVX4_HD_1080P --- not supported ---
DIVX5_QMOBILE --- not supported ---
DIVX5_MOBILE --- not supported ---
DIVX5_HOME_THEATER --- not supported ---
DIVX5_HD_1080P --- not supported ---
H264_CONSTRAINED_BASELINE --- not supported ---
H264_EXTENDED --- not supported ---
H264_PROGRESSIVE_HIGH --- not supported ---
H264_CONSTRAINED_HIGH --- not supported ---
H264_HIGH_444_PREDICTIVE --- not supported ---
HEVC_MAIN --- not supported ---
HEVC_MAIN_10 --- not supported ---
HEVC_MAIN_STILL --- not supported ---
HEVC_MAIN_12 --- not supported ---
HEVC_MAIN_444 --- not supported ---
Output surface:
name width height nat types
----------------------------------------------------
B8G8R8A8 16384 16384 y NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 A4I4 I4A4 A8I8 I8A8
R8G8B8A8 16384 16384 y NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 A4I4 I4A4 A8I8 I8A8
R10G10B10A2 16384 16384 y NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 A4I4 I4A4 A8I8 I8A8
B10G10R10A2 16384 16384 y NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 A4I4 I4A4 A8I8 I8A8
Bitmap surface:
name width height
------------------------------
B8G8R8A8 16384 16384
R8G8B8A8 16384 16384
R10G10B10A2 16384 16384
B10G10R10A2 16384 16384
A8 16384 16384
Video mixer:
feature name sup
------------------------------------
DEINTERLACE_TEMPORAL y
DEINTERLACE_TEMPORAL_SPATIAL -
INVERSE_TELECINE -
NOISE_REDUCTION y
SHARPNESS y
LUMA_KEY y
HIGH QUALITY SCALING - L1 y
HIGH QUALITY SCALING - L2 -
HIGH QUALITY SCALING - L3 -
HIGH QUALITY SCALING - L4 -
HIGH QUALITY SCALING - L5 -
HIGH QUALITY SCALING - L6 -
HIGH QUALITY SCALING - L7 -
HIGH QUALITY SCALING - L8 -
HIGH QUALITY SCALING - L9 -
parameter name sup min max
-----------------------------------------------------
VIDEO_SURFACE_WIDTH y 48 4096
VIDEO_SURFACE_HEIGHT y 48 4096
CHROMA_TYPE y
LAYERS y 0 4
attribute name sup min max
-----------------------------------------------------
BACKGROUND_COLOR y
CSC_MATRIX y
NOISE_REDUCTION_LEVEL y 0.00 1.00
SHARPNESS_LEVEL y -1.00 1.00
LUMA_KEY_MIN_LUMA y
LUMA_KEY_MAX_LUMA y
答案1
由于依赖关系, gstreamer1.0-vaapi
请首先进行模拟,但出现问题。apt --dry-run purge gstreamer1.0-vaapi
答案2
我最近遇到了类似的问题,安装gstreamer1.0-libav
后就解决了。
答案3
使用 totem 3.34.1 会弹出一个对话框来搜索 Ubuntu 软件中的 GStreamer 多媒体编解码器。
安装该类别的GStreamer plugins from the "bad" set
版本后,totem 能够播放 avi。1.16.2-2.1ubuntu1
Add-ons → Codecs
GStreamer 劣质插件是一组与其他插件相比达不到标准的插件。它们的质量可能接近优质,但缺少一些东西 - 无论是良好的代码审查、一些文档、一组测试、真正的现场维护者,还是一些实际的广泛使用。