我最近下载了一部电影(.mkv
),它在 VLC Android 上运行良好,但在我将它移动到我的电脑上(使用 adb)后,mpv 无法运行它(无法识别文件格式),也无法假释(GStreamer 后端错误:无法确定文件类型);即使在我的 Windows 机器上,VLC 也只是加载。
这是我用来传输文件的命令:
adb pull /storage/0123-4567/Movies/Video.mkv ~/Movies/
我尝试用 bless 打开它来查看该文件是否是使用魔法数字的 Matroska,但开头充满了空字节。
cmp Video.mkv /dev/zero
显示Video.mkv /dev/zero differ: byte 170393601, line 1
。
我还尝试使用 FFmpeg 从文件中提取音轨,输出如下:
$ ffmpeg -i Video.mkv -map 0:a:1 -acodec copy output.mka -loglevel trace
ffmpeg version 5.1.3 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 12 (GCC)
configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' --extra-ldflags='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' --extra-cflags=' -I/usr/include/rav1e' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --enable-chromaprint --disable-crystalhd --enable-fontconfig --enable-frei0r --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libaom --enable-libdav1d --enable-libass --enable-libbluray --enable-libbs2b --enable-libcdio --enable-libdrm --enable-libjack --enable-libjxl --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libilbc --enable-libmp3lame --enable-libmysofa --enable-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-libplacebo --enable-librsvg --enable-librav1e --enable-librubberband --enable-libsmbclient --enable-version3 --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-version3 --enable-vapoursynth --enable-libvpx --enable-vulkan --enable-libshaderc --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libxml2 --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-avfilter --enable-libmodplug --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-lto --enable-libmfx --enable-runtime-cpudetect
libavutil 57. 28.100 / 57. 28.100
libavcodec 59. 37.100 / 59. 37.100
libavformat 59. 27.100 / 59. 27.100
libavdevice 59. 7.100 / 59. 7.100
libavfilter 8. 44.100 / 8. 44.100
libswscale 6. 7.100 / 6. 7.100
libswresample 4. 7.100 / 4. 7.100
libpostproc 56. 6.100 / 56. 6.100
Splitting the commandline.
Reading option '-i' ... matched as input url with argument 'Video.mkv'.
Reading option '-map' ... matched as option 'map' (set input stream mapping) with argument '0:a:1'.
Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'copy'.
Reading option 'output.mka' ... matched as output url.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'trace'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument trace.
Successfully parsed a group of options.
Parsing a group of options: input url Video.mkv.
Successfully parsed a group of options.
Opening an input file: Video.mkv.
[NULL @ 0x55f512f8f200] Opening 'Video.mkv' for reading
[file @ 0x55f512f8fa00] Setting default whitelist 'file,crypto,data'
[matroska,webm @ 0x55f512f8f200] Format matroska,webm detected only with low score of 1, misdetection possible!
[matroska,webm @ 0x55f512f8f200] 0x00 at pos 0 (0x0) invalid as first byte of an EBML number
[matroska,webm @ 0x55f512f8f200] EBML header parsing failed
[AVIOContext @ 0x55f512f97dc0] Statistics: 1048576 bytes read, 0 seeks
Video.mkv: Invalid data found when processing input
使用 USB 和系统文件管理器传输文件后,仍然出现错误。
我的目标是从 mkv 中提取音频并让 mpv 读取该文件,如能得到任何帮助我将不胜感激:)