Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mpv fails to play archive underneath directory #15096

Open
6 tasks done
shachter opened this issue Oct 15, 2024 · 8 comments
Open
6 tasks done

mpv fails to play archive underneath directory #15096

shachter opened this issue Oct 15, 2024 · 8 comments
Labels

Comments

@shachter
Copy link

mpv Information

$ mpv --version
mpv 0.39.0-UNKNOWN Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
 built on Oct 14 2024 20:40:02
libplacebo version: v7.341.0
FFmpeg version: 7.0.2
FFmpeg library versions:
   libavcodec      61.3.100
   libavdevice     61.1.100
   libavfilter     10.1.100
   libavformat     61.1.100
   libavutil       59.8.100
   libswresample   5.1.100
   libswscale      8.1.100

Other Information

- Linux version:NAME="Springdale Open Enterprise Linux"
PRETTY_NAME="Springdale Open Enterprise Linux 9.2 (Parma)"
CPE_NAME="cpe:/o:springdale:enterprise_linux:9::baseos"
- Kernel Version:Linux m5 5.14.0-284.11.1.el9_2.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 11 00:10:15 EDT 2023 x86_64 x86_64 x86_64 GNU/Linux
- GPU Model:00:02.0 VGA compatible controller [0300]: Intel Corporation HD Graphics 530 [8086:191b] (rev 06)
- Mesa/GPU Driver Version:OpenGL version string: 4.6 (Compatibility Profile) Mesa 22.3.0
- Window Manager and Version:
- Source mpv: I downloaded it from you just a couple of hours ago
- Introduced in version:

Reproduction Steps

Mpv will play -- as expected -- a zip archive (and presumably any other kind of archive) when the filename is explicitly passed. Behold:

$ mpv --no-config /mnt/zpool3/opt/multimedia/music/prokofiev/symphonies/Symphony\ #2/symphony-no.-2_202012.zip
Playing: archive:///mnt/zpool3/opt/multimedia/music/prokofiev/symphonies/Symphony #2/symphony-no.-2_202012.zip|/01 Allegro ben articolato.mp3
[libarchive] possibly unsupported seeking - switching to reopening
[ffmpeg/demuxer] mp3: Estimating duration from bitrate, this may be inaccurate
● Audio --aid=1 (mp3 2ch 44100 Hz 320 kbps)
AO: [pulse] 44100Hz stereo 2ch float
A: 00:00:04 / 00:11:31 (1%) Cache: 687s/40MB
Exiting... (Quit)
$

However, she will not play the archive file when the directory containing it is passed. Behold:

$ mpv --no-config /mnt/zpool3/opt/multimedia/music/prokofiev/symphonies/Symphony\ #2/
Failed to recognize file format.
Exiting... (Errors when loading file)
$

If the directory contains other files, the other files are played, and the archive file is ignored. If the directory contains no other files, then mpv emits the error message you just saw, "Filed to recognize file format." which is the error message that is emitted when mpv is given an empty directory.

I do not know whether to suspect libarchive or playlist.c (or something else entirely). I downloaded the latest version of libarchive (3.7.7), built it, and installed it into /usr/local, and verified with ldd that mpv is linking to it. Similarly, I downloaded -- today -- the latest version of mpv, built it, and installed it into /usr/local, and that is the version that I am running.

(I also downloaded and built and installed, yesterday, the latest version of ffmpeg, although I doubt that ffmpeg is implicated in this kind of bug.)

This is not the correct behavior, nor is it the behavior that I formerly observed (although perhaps not on this OS). Has this been reported before? How do I restore the correct behavior? Thank you in advance for any and all replies. -- Jay F. Shachter

Expected Behavior

I expected mpv to play all contents of the specified directory, including the archive.

Actual Behavior

Mpv plays all contents of the specified directory, except the archive.

Log File

[ 0.000][d][global] user path: 'output.txt' -> 'output.txt'
[ 0.002][v][cplayer] mpv 0.39.0-UNKNOWN Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
[ 0.002][v][cplayer] built on Oct 14 2024 20:40:02
[ 0.002][v][cplayer] libplacebo version: v7.341.0
[ 0.002][v][cplayer] FFmpeg version: 7.0.2
[ 0.002][v][cplayer] FFmpeg library versions:
[ 0.002][v][cplayer] libavcodec 61.3.100
[ 0.002][v][cplayer] libavdevice 61.1.100
[ 0.002][v][cplayer] libavfilter 10.1.100
[ 0.002][v][cplayer] libavformat 61.1.100
[ 0.002][v][cplayer] libavutil 59.8.100
[ 0.002][v][cplayer] libswresample 5.1.100
[ 0.002][v][cplayer] libswscale 8.1.100
[ 0.002][v][cplayer] Configuration:
[ 0.002][v][cplayer] List of enabled features: alsa build-date caca cdda cplugins cuda-hwaccel cuda-interop debug dmabuf-interop-gl drm dvbin dvdnav egl egl-drm egl-x11 ffmpeg ffnvcodec gbm gl glibc-thread-name glob glob-posix gpl iconv jack javascript jpeg lcms2 libarchive libass libavdevice libbluray libdl libplacebo linux-fstatfs luajit memrchr posix posix-shm ppoll pthread-condattr-setclock pulse rubberband rubberband-3 uchardet vaapi vaapi-drm vaapi-x11 vapoursynth vdpau vector vk-khr-display vt.h vulkan x11 zimg zimg-st428 zlib
[ 0.002][v][cplayer] Command line options: '--no-config' '/mnt/zpool3/opt/multimedia/music/prokofiev/symphonies/Symphony #2/' '--gpu-debug' '--log-file=output.txt'
[ 0.002][v][cplayer] mpv 0.39.0-UNKNOWN Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
[ 0.002][v][cplayer] built on Oct 14 2024 20:40:02
[ 0.002][v][cplayer] libplacebo version: v7.341.0
[ 0.002][v][cplayer] FFmpeg version: 7.0.2
[ 0.002][v][cplayer] FFmpeg library versions:
[ 0.002][v][cplayer] libavcodec 61.3.100
[ 0.002][v][cplayer] libavdevice 61.1.100
[ 0.002][v][cplayer] libavfilter 10.1.100
[ 0.002][v][cplayer] libavformat 61.1.100
[ 0.002][v][cplayer] libavutil 59.8.100
[ 0.002][v][cplayer] libswresample 5.1.100
[ 0.002][v][cplayer] libswscale 8.1.100
[ 0.002][v][cplayer] Configuration:
[ 0.002][v][cplayer] List of enabled features: alsa build-date caca cdda cplugins cuda-hwaccel cuda-interop debug dmabuf-interop-gl drm dvbin dvdnav egl egl-drm egl-x11 ffmpeg ffnvcodec gbm gl glibc-thread-name glob glob-posix gpl iconv jack javascript jpeg lcms2 libarchive libass libavdevice libbluray libdl libplacebo linux-fstatfs luajit memrchr posix posix-shm ppoll pthread-condattr-setclock pulse rubberband rubberband-3 uchardet vaapi vaapi-drm vaapi-x11 vapoursynth vdpau vector vk-khr-display vt.h vulkan x11 zimg zimg-st428 zlib
[ 0.002][d][global] home path: '' -> '-'
[ 0.002][d][global] user path: '~~home/' -> ''
[ 0.002][d][global] user path: '~~old_home/' -> ''
[ 0.003][v][cplayer] Setting option 'config' = 'no' (flags = 8)
[ 0.003][v][cplayer] Setting option 'gpu-debug' = '' (flags = 8)
[ 0.003][v][cplayer] Setting option 'log-file' = 'output.txt' (flags = 8)
[ 0.005][d][global] user path: 'output.txt' -> 'output.txt'
[ 0.005][d][osc] Loading lua script @osc.lua...
[ 0.005][d][ytdl_hook] Loading lua script @ytdl_hook.lua...
[ 0.005][d][stats] Loading lua script @stats.lua...
[ 0.005][d][console] Loading lua script @console.lua...
[ 0.006][d][auto_profiles] Loading lua script @auto_profiles.lua...
[ 0.006][d][select] Loading lua script @select.lua...
[ 0.006][d][osc] loading mp.defaults
[ 0.006][d][stats] loading mp.defaults
[ 0.006][d][ytdl_hook] loading mp.defaults
[ 0.006][d][console] loading mp.defaults
[ 0.006][v][cplayer] Waiting for scripts...
[ 0.006][d][select] loading mp.defaults
[ 0.006][d][auto_profiles] loading mp.defaults
[ 0.007][d][auto_profiles] loading @auto_profiles.lua
[ 0.007][d][stats] loading @stats.lua
[ 0.007][d][osc] loading @osc.lua
[ 0.007][d][ytdl_hook] loading @ytdl_hook.lua
[ 0.007][d][console] loading @console.lua
[ 0.007][d][select] loading @select.lua
[ 0.008][d][cplayer] Run command: define-section, flags=64, args=[name="input_select", contents="", flags="default"]
[ 0.008][d][cplayer] Run command: enable-section, flags=64, args=[name="input_select", flags="allow-hide-cursor+allow-vo-dragging"]
[ 0.008][d][cplayer] Run command: define-section, flags=64, args=[name="input_forced_select", contents="", flags="force"]
[ 0.008][d][cplayer] Run command: enable-section, flags=64, args=[name="input_forced_select", flags="allow-hide-cursor+allow-vo-dragging"]
[ 0.008][d][ytdl_hook] reading options for ytdl_hook
[ 0.008][d][ytdl_hook] script-opts/ytdl_hook.conf not found.
[ 0.008][d][ytdl_hook] lua-settings/ytdl_hook.conf not found.
[ 0.009][d][stats] reading options for stats
[ 0.009][d][stats] script-opts/stats.conf not found.
[ 0.009][d][stats] lua-settings/stats.conf not found.
[ 0.009][d][console] reading options for console
[ 0.009][d][console] script-opts/console.conf not found.
[ 0.009][d][console] lua-settings/console.conf not found.
[ 0.009][d][cplayer] Run command: define-section, flags=64, args=[name="input_stats", contents="", flags="default"]
[ 0.009][d][cplayer] Run command: enable-section, flags=64, args=[name="input_stats", flags="allow-hide-cursor+allow-vo-dragging"]
[ 0.009][d][cplayer] Run command: define-section, flags=64, args=[name="input_forced_stats", contents="", flags="force"]
[ 0.009][d][cplayer] Run command: enable-section, flags=64, args=[name="input_forced_stats", flags="allow-hide-cursor+allow-vo-dragging"]
[ 0.010][d][cplayer] Run command: define-section, flags=64, args=[name="input_console", contents="", flags="default"]
[ 0.010][d][cplayer] Run command: enable-section, flags=64, args=[name="input_console", flags="allow-hide-cursor+allow-vo-dragging"]
[ 0.010][d][cplayer] Run command: define-section, flags=64, args=[name="input_forced_console", contents="", flags="force"]
[ 0.010][d][cplayer] Run command: enable-section, flags=64, args=[name="input_forced_console", flags="allow-hide-cursor+allow-vo-dragging"]
[ 0.011][d][cplayer] Run command: define-section, flags=64, args=[name="showhide", contents="mouse_move script-binding osc/__keybinding1\nmouse_leave script-binding osc/__keybinding2\n", flags="force"]
[ 0.011][d][cplayer] Run command: define-section, flags=64, args=[name="showhide_wc", contents="mouse_move script-binding osc/__keybinding3\nmouse_leave script-binding osc/__keybinding4\n", flags="force"]
[ 0.011][d][cplayer] Run command: enable-section, flags=64, args=[name="showhide", flags="allow-hide-cursor+allow-vo-dragging"]
[ 0.011][d][cplayer] Run command: enable-section, flags=64, args=[name="showhide_wc", flags="allow-hide-cursor+allow-vo-dragging"]
[ 0.011][d][cplayer] Run command: define-section, flags=64, args=[name="input", contents="mbtn_left script-binding osc/__keybinding5\nshift+mbtn_left script-binding osc/__keybinding6\nmbtn_right script-binding osc/__keybinding7\nmbtn_mid script-binding osc/__keybinding8\nwheel_up script-binding osc/__keybinding9\nwheel_down script-binding osc/__keybinding10\nmbtn_left_dbl ignore\nshift+mbtn_left_dbl ignore\nmbtn_right_dbl ignore\n", flags="force"]
[ 0.011][d][cplayer] Run command: enable-section, flags=64, args=[name="input", flags=""]
[ 0.011][d][cplayer] Run command: define-section, flags=64, args=[name="window-controls", contents="mbtn_left script-binding osc/__keybinding11\n", flags="force"]
[ 0.011][d][cplayer] Run command: enable-section, flags=64, args=[name="window-controls", flags=""]
[ 0.011][d][osc] reading options for osc
[ 0.011][d][osc] script-opts/osc.conf not found.
[ 0.011][d][osc] lua-settings/osc.conf not found.
[ 0.012][v][cplayer] Set property: user-data/osc/visibility="auto" -> 1
[ 0.012][d][cplayer] Run command: disable-section, flags=64, args=[name="input"]
[ 0.012][d][cplayer] Run command: disable-section, flags=64, args=[name="window-controls"]
[ 0.012][v][cplayer] Set property: user-data/osc/margins={"b":0,"l":0,"t":0,"r":0} -> 1
[ 0.012][v][cplayer] Done loading scripts.
[ 0.012][d][global] state path: 'watch_later' -> '-'
[ 0.012][v][cplayer] Running hook: auto_profiles/on_before_start_file
[ 0.012][d][global] state path: 'watch_later' -> '-'
[ 0.012][v][cplayer] Running hook: ytdl_hook/on_load
[ 0.013][v][cplayer] Set property: user-data/osc/margins={"b":0,"l":0,"t":0,"r":0} -> 1
[ 0.013][v][cplayer] Running hook: ytdl_hook/on_load
[ 0.013][v][ytdl_hook] playlist hook
[ 0.013][v][cplayer] Running hook: auto_profiles/on_load
[ 0.013][d][osc] osc_init
[ 0.013][v][ifo_dvdnav] Opening /mnt/zpool3/opt/multimedia/music/prokofiev/symphonies/Symphony #2/
[ 0.013][v][bdmv/bluray] Opening /mnt/zpool3/opt/multimedia/music/prokofiev/symphonies/Symphony #2/
[ 0.013][v][file] Opening /mnt/zpool3/opt/multimedia/music/prokofiev/symphonies/Symphony #2/
[ 0.013][d][file] resize stream to 131072 bytes, drop 0 bytes
[ 0.013][d][file] Stream opened successfully.
[ 0.013][v][demux] Trying demuxers for level=normal.
[ 0.013][d][demux] Trying demuxer: directory (force-level: normal)
[ 0.013][v][cplayer] Set property: user-data/osc/margins={"b":0,"l":0,"t":0,"r":0} -> 1
[ 0.014][d][osd/libass] ASS library version: 0x1701000 (runtime 0x1701000)
[ 0.014][v][osd/libass] libass API version: 0x1701000
[ 0.014][v][osd/libass] libass source: tarball: 0.17.1
[ 0.014][v][osd/libass] Shaper: FriBidi 1.0.10 (SIMPLE) HarfBuzz-ng 2.7.4 (COMPLEX)
[ 0.014][v][osd/libass] Setting up fonts...
[ 0.014][d][demux] Trying demuxer: disc (force-level: normal)
[ 0.014][d][demux] Trying demuxer: edl (force-level: normal)
[ 0.014][d][demux] Trying demuxer: cue (force-level: normal)
[ 0.014][d][demux] Trying demuxer: rawaudio (force-level: normal)
[ 0.014][d][demux] Trying demuxer: rawvideo (force-level: normal)
[ 0.014][d][demux] Trying demuxer: mkv (force-level: normal)
[ 0.014][d][demux] Trying demuxer: libarchive (force-level: normal)
[ 0.014][d][demux] Trying demuxer: lavf (force-level: normal)
[ 0.023][v][lavf] No format found, try lowering probescore or forcing the format.
[ 0.023][d][demux] Trying demuxer: mf (force-level: normal)
[ 0.023][d][demux] Trying demuxer: playlist (force-level: normal)
[ 0.023][d][demux] Trying demuxer: null (force-level: normal)
[ 0.023][v][demux] Trying demuxers for level=unsafe.
[ 0.023][d][demux] Trying demuxer: directory (force-level: unsafe)
[ 0.025][d][demux] Trying demuxer: disc (force-level: unsafe)
[ 0.025][d][demux] Trying demuxer: edl (force-level: unsafe)
[ 0.025][d][demux] Trying demuxer: cue (force-level: unsafe)
[ 0.025][d][demux] Trying demuxer: rawaudio (force-level: unsafe)
[ 0.025][d][demux] Trying demuxer: rawvideo (force-level: unsafe)
[ 0.025][d][demux] Trying demuxer: mkv (force-level: unsafe)
[ 0.025][d][demux] Trying demuxer: libarchive (force-level: unsafe)
[ 0.025][d][file] resize stream to 262144 bytes, drop 0 bytes
[ 0.025][d][demux] Trying demuxer: lavf (force-level: unsafe)
[ 0.033][d][file] resize stream to 131072 bytes, drop 0 bytes
[ 0.033][v][lavf] No format found, try lowering probescore or forcing the format.
[ 0.033][d][demux] Trying demuxer: mf (force-level: unsafe)
[ 0.033][d][demux] Trying demuxer: playlist (force-level: unsafe)
[ 0.033][d][demux] Trying demuxer: null (force-level: unsafe)
[ 0.033][v][cplayer] Opening failed or was aborted: /mnt/zpool3/opt/multimedia/music/prokofiev/symphonies/Symphony #2/
[ 0.033][v][osd/libass] Using font provider fontconfig
[ 0.033][v][osd/libass] Done.
[ 0.034][v][cplayer] Running hook: ytdl_hook/on_load_fail
[ 0.034][v][cplayer] finished playback, unrecognized file format (reason 4)
[ 0.034][e][cplayer] Failed to recognize file format.
[ 0.034][v][cplayer] Running hook: ytdl_hook/on_after_end_file
[ 0.035][d][cplayer] Run command: del, flags=64, args=[name="user-data/mpv/ytdl/json-subprocess-result"]
[ 0.035][d][osc] osc_init
[ 0.035][i][cplayer] Exiting... (Errors when loading file)
[ 0.036][d][ytdl_hook] Exiting...
[ 0.036][d][auto_profiles] Exiting...
[ 0.036][d][console] Exiting...
[ 0.036][d][select] Exiting...
[ 0.036][d][stats] Exiting...
[ 0.036][v][cplayer] Set property: user-data/osc/margins={"b":0,"l":0,"t":0,"r":0} -> 1
[ 0.036][d][cplayer] Run command: define-section, flags=64, args=[name="input_osc", contents="", flags="default"]
[ 0.036][d][cplayer] Run command: enable-section, flags=64, args=[name="input_osc", flags="allow-hide-cursor+allow-vo-dragging"]
[ 0.037][d][cplayer] Run command: define-section, flags=64, args=[name="input_forced_osc", contents="", flags="force"]
[ 0.037][d][cplayer] Run command: enable-section, flags=64, args=[name="input_forced_osc", flags="allow-hide-cursor+allow-vo-dragging"]
[ 0.037][d][cplayer] Run command: del, flags=64, args=[name="user-data/osc"]
[ 0.037][d][osc] Exiting...

Sample Files

No response

I carefully read all instruction and confirm that I did the following:

  • I tested with the latest mpv version to validate that the issue is not already fixed.
  • I provided all required information including system and mpv version.
  • I produced the log file with the exact same set of files, parameters, and conditions used in "Reproduction Steps", with the addition of --log-file=output.txt.
  • I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
  • I attached the full, untruncated log file.
  • I attached the backtrace in the case of a crash.
@guidocella
Copy link
Contributor

--directory-filter-types-clr

@shachter
Copy link
Author

Indeed you are right. Apparently the behavior of mpv was changed, and the former behavior can now be obtained only by specifying this undocumented (it does not appear either in mpv.1 or in mpv.html) option. I created ~/.config/mpv/mpv.conf and populated it with the single line "directory-filter-types-clr" and now I am getting the desired behavior. Thank you for the information.

How did you know about this undocumented option?

@llyyr
Copy link
Contributor

llyyr commented Oct 16, 2024

How did you know about this undocumented option?

It is not undocumented.

--directory-filter-types specifies types of files to load when a folder is opened, which by default is audio, video and images. https://mpv.io/manual/master/#options-directory-filter-types

directory-filter-types-clr just clears the value of this option, and mpv behaves as documented in the option text. If the list is empty, all files are added to the playlist.

(-clr is documented here https://mpv.io/manual/master/#list-options, directory-filter-type is a string list)

@jediafr
Copy link

jediafr commented Nov 10, 2024

Indeed you are right. Apparently the behavior of mpv was changed, and the former behavior can now be obtained only by specifying this undocumented (it does not appear either in mpv.1 or in mpv.html) option

I strongly agree , i am puzzled that this option changed the default behaviour of MPV.
I used a script to point mpv to a directory full of nice nice internet radios pls,m3u and with 0.39 version suddenly the script was failing with a cryptic file type error (nothing pointing to the new behaviour).

@guidocella
Copy link
Contributor

The new behavior is documented in https://github.com/mpv-player/mpv/blob/master/DOCS/interface-changes.rst

"By default, opening a directory will create a playlist with only the media types "video, audio, image". To restore the previous behavior, use --directory-filter-types-clr."

I don't know why this wasn't copied in the release notes themselves though.

@shachter
Copy link
Author

As stated earlier, none of the installed documentation contains the word "--directory-filter-types-clr"; in fact, in the entire source directory, that word only appears once, in DOCS/interface-changes.rst. The word "--directory-filter-types" does appear in build/mpv.html, and it appears in the installed mpv.1 manual page. The author of the manual page apparently believes -- or he did not give the matter any thought -- that from the existence of a "--directory-filter-types=" option, every reader of the manual page will easily be able to figure out the existence of a "--directory-filter-types-clr" option. I am not complaining, because it is ungracious to complain about something that is free; and a proper response to someone who says "the mpv documentation should say X" is "then go write mpv documentation that says X". So I am not complaining, and I thank the members of this discussion who have informed the rest of us how to invoke the new mpv so as to obtain the default behavior of the old mpv. (Unrelated to the above, the authors of the manual page might want to know that it seems to work only with GNU tbl, GNU nroff, and GNU manual macros. I don't know whether anyone cares about that or not, but I will wait a while before closing this topic, in case someone wants to post something about that.)

@guidocella
Copy link
Contributor

The manual tells you to See List Options for details where clr is documented.

@shachter
Copy link
Author

Yes, that is true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants