mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.04k stars 2.88k forks source link

Mpv should be able to ignore file-ext and content-type returned by http server. #14552

Closed xxoo closed 1 month ago

xxoo commented 2 months ago

mpv Information

mpv 0.38.0 Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
 built on Jul 15 2024 20:03:22
libplacebo version: v7.349.0
FFmpeg version: 5.1.5-0+deb12u1
FFmpeg library versions:
   libavutil       57.28.100
   libavcodec      59.37.100
   libavformat     59.27.100
   libswscale      6.7.100
   libavfilter     8.44.100
   libswresample   4.7.100

Other Information

Reproduction Steps

Try to open the following url in mpv.

https://m3u8.justchill.workers.dev/?url=https://aj.bigtimedelivery.net/_v13/e94d1b29b512749b59f6f0312234637123c12c69650605622aef61b1d39fb388493e093ba8f6045e98cc47a89e7617251c32c2356027f44c2a4d5a6881c29e6988fea91a2f43789c0b4a0c80fcf7194e0f0345455a02cfb7f3af0b9b9ddb7e8f28b6727bfeae8de91eed278f6d40a0130d9c48a88ecc0c805f3522c365d3d6c1/playlist.m3u8

Expected Behavior

The video should be playing like avPlayer, ExoPlayer or MediaPlayer in windows

Actual Behavior

It will report demuxer errors like this. The reason is the file-exts in this hls do not match the their content. So in order to play, maybe we have to tell Mpv to ignore file-exts and content-types returned by http server. And force it using content sampling to detect file types.

[ffmpeg/demuxer] image2: Custom AVIOContext makes no sense and will be ignored with AVFMT_NOFILE format.
[ffmpeg/demuxer] image2: Custom AVIOContext makes no sense and will be ignored with AVFMT_NOFILE format.
[ffmpeg/demuxer] image2: Custom AVIOContext makes no sense and will be ignored with AVFMT_NOFILE format.
[ffmpeg/demuxer] hls: Could not find codec parameters for stream 0 (Video: mjpeg, none(bt470bg/unknown/unknown)): unspecified size
[ffmpeg/demuxer] Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
[ffmpeg/demuxer] hls: Could not find codec parameters for stream 1 (Video: mjpeg, none(bt470bg/unknown/unknown)): unspecified size
[ffmpeg/demuxer] Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
[ffmpeg/demuxer] hls: Could not find codec parameters for stream 2 (Video: mjpeg, none(bt470bg/unknown/unknown)): unspecified size
[ffmpeg/demuxer] Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
 (+) Video --vid=1 (mjpeg) (4500 kbps)
     Video --vid=2 (mjpeg) (1800 kbps)
     Video --vid=3 (mjpeg) (720 kbps)
[vo/gpu/wayland] GNOME's wayland compositor lacks support for the idle inhibit protocol. This means the screen can blank during playback.
[lavf] error reading packet: Invalid argument.
[lavf] error reading packet: Invalid argument.
[lavf] error reading packet: Invalid argument.
[lavf] error reading packet: Invalid argument.
[lavf] error reading packet: Invalid argument.
[lavf] error reading packet: Invalid argument.
[lavf] error reading packet: Invalid argument.
[lavf] error reading packet: Invalid argument.
[lavf] error reading packet: Invalid argument.
[lavf] error reading packet: Invalid argument.
[lavf] error reading packet: Invalid argument.

Log File

log.txt

Sample Files

No response

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

sfan5 commented 1 month ago

duplicate of #11365