I recently downloaded a movie (.mkv), it works perfectly on VLC Android, but after I moved it to my computer (with adb), mpv could not run it (Failed to recognize file format), nor parole (GStreamer backend error: Could not determine the type of file); even on my windows machine VLC was just loading.
This is the command I used to transfer the file:
adb pull /storage/0123-4567/Movies/Video.mkv ~/Movies/
I tried to open it with bless to see if the file was a Matroska using the magic number but the beginning is full of null bytes.
cmp Video.mkv /dev/zero shows Video.mkv /dev/zero differ: byte 170393601, line 1.
I also tried to extract an audio track from the file with FFmpeg, this was the output:
$ 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
After transferring the file with USB and the system file manager, it still gives me the error.
My goal is to extract the audio from the mkv and make mpv read the file, any help is appreciated :)
