Opened 19 months ago

Closed 2 weeks ago

#10353 closed defect (fixed)

HLS Handling Error from Commit 6b1f68ccb04d791f0250e05687c346a99ff47ea1

Reported by: QFox Owned by: Michael Niedermayer
Priority: normal Component: avformat
Version: git-master Keywords: hls
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by QFox)

Summary of the bug:

After Commit 6b1f68ccb04d791f0250e05687c346a99ff47ea1 - avformat/hls: fail on probing non hls/m3u8 file extensions, ffmpeg could not handle m3u8 correctly like following url

just reverted this commit and the problem would be gone.

To reproduce, download mpv here:
https://github.com/shinchiro/mpv-winbuild-cmake/releases/tag/20230505 (working)
https://github.com/shinchiro/mpv-winbuild-cmake/releases/tag/20230506 (not working)

Find a live stream here:
https://www.cbc.ca/player/news/live
using following cmd line to play it

mpv_0505 https://www.cbc.ca/player/play/2205049411630 --msg-level=ffmpeg=v --script-opts=ytdl_hook-ytdl_path=D:\Tools\yt-dlp\yt-dlp > working.txt
mpv_0506 https://www.cbc.ca/player/play/2205049411630 --msg-level=ffmpeg=v --script-opts=ytdl_hook-ytdl_path=D:\Tools\yt-dlp\yt-dlp > not-working.txt

Here is the working log

You can see that ffmpeg re-read .m3u8 file multiple times

[ffmpeg] Opening https://www.cbc.ca/player/play/2205049411630
[ffmpeg] Mime-type: 'text/html; charset=utf-8'
[ffmpeg] Opening https://cbcrclive-tor.akamaized.net/hls/live/2040348/geo_allow_global/ES_NEWS_11/master_3000.m3u8
[ffmpeg] Mime-type: 'application/x-mpegURL'
[ffmpeg/demuxer] hls: Skip ('#EXT-X-VERSION:3')
[ffmpeg/demuxer] hls: Skip ('#EXT-X-PROGRAM-DATE-TIME:2023-05-12T17:52:24.533Z')
[ffmpeg/demuxer] hls: Skip ('#EXT-X-PROGRAM-DATE-TIME:2023-05-12T17:52:32.533Z')
[ffmpeg/demuxer] hls: Skip ('#EXT-X-PROGRAM-DATE-TIME:2023-05-12T17:52:40.533Z')
[ffmpeg/demuxer] hls: Skip ('#EXT-X-PROGRAM-DATE-TIME:2023-05-12T17:52:48.533Z')
[ffmpeg/demuxer] hls: Opening 'https://cbcrclive-tor.akamaized.net/hls/live/2040348/geo_allow_global/ES_NEWS_11/20230512T115030/master_3000/00000/master_3000_00916.ts' for reading
[ffmpeg/demuxer] hls: Opening 'https://cbcrclive-tor.akamaized.net/hls/live/2040348/geo_allow_global/ES_NEWS_11/20230512T115030/master_3000/00000/master_3000_00917.ts' for reading
 (+) Video --vid=1 (h264 1280x720 30.000fps)
 (+) Audio --aid=1 (aac 2ch 48000Hz)
AO: [wasapi] 48000Hz stereo 2ch float
VO: [gpu] 1280x720 yuv420p
[ffmpeg] https: Opening 'https://cbcrclive-tor.akamaized.net/hls/live/2040348/geo_allow_global/ES_NEWS_11/20230512T115030/master_3000/00000/master_3000_00918.ts' for reading
[ffmpeg/demuxer] hls: Skip ('#EXT-X-VERSION:3')
[ffmpeg/demuxer] hls: Skip ('#EXT-X-PROGRAM-DATE-TIME:2023-05-12T17:52:32.533Z')
[ffmpeg/demuxer] hls: Skip ('#EXT-X-PROGRAM-DATE-TIME:2023-05-12T17:52:40.533Z')
[ffmpeg/demuxer] hls: Skip ('#EXT-X-PROGRAM-DATE-TIME:2023-05-12T17:52:48.533Z')
[ffmpeg/demuxer] hls: Skip ('#EXT-X-PROGRAM-DATE-TIME:2023-05-12T17:52:56.533Z')
[ffmpeg] https: Opening 'https://cbcrclive-tor.akamaized.net/hls/live/2040348/geo_allow_global/ES_NEWS_11/20230512T115030/master_3000/00000/master_3000_00919.ts' for reading
[ffmpeg] https: Opening 'https://cbcrclive-tor.akamaized.net/hls/live/2040348/geo_allow_global/ES_NEWS_11/master_3000.m3u8' for reading
[ffmpeg/demuxer] hls: Skip ('#EXT-X-VERSION:3')
[ffmpeg/demuxer] hls: Skip ('#EXT-X-PROGRAM-DATE-TIME:2023-05-12T17:52:40.533Z')
[ffmpeg/demuxer] hls: Skip ('#EXT-X-PROGRAM-DATE-TIME:2023-05-12T17:52:48.533Z')
[ffmpeg/demuxer] hls: Skip ('#EXT-X-PROGRAM-DATE-TIME:2023-05-12T17:52:56.533Z')
[ffmpeg/demuxer] hls: Skip ('#EXT-X-PROGRAM-DATE-TIME:2023-05-12T17:53:04.533Z')
[ffmpeg] https: Opening 'https://cbcrclive-tor.akamaized.net/hls/live/2040348/geo_allow_global/ES_NEWS_11/20230512T115030/master_3000/00000/master_3000_00920.ts' for reading
[ffmpeg] https: Opening 'https://cbcrclive-tor.akamaized.net/hls/live/2040348/geo_allow_global/ES_NEWS_11/master_3000.m3u8' for reading
[ffmpeg/demuxer] hls: Skip ('#EXT-X-VERSION:3')
[ffmpeg/demuxer] hls: Skip ('#EXT-X-PROGRAM-DATE-TIME:2023-05-12T17:52:48.533Z')
[ffmpeg/demuxer] hls: Skip ('#EXT-X-PROGRAM-DATE-TIME:2023-05-12T17:52:56.533Z')
[ffmpeg/demuxer] hls: Skip ('#EXT-X-PROGRAM-DATE-TIME:2023-05-12T17:53:04.533Z')
[ffmpeg/demuxer] hls: Skip ('#EXT-X-PROGRAM-DATE-TIME:2023-05-12T17:53:12.533Z')
[ffmpeg] https: Opening 'https://cbcrclive-tor.akamaized.net/hls/live/2040348/geo_allow_global/ES_NEWS_11/20230512T115030/master_3000/00000/master_3000_00921.ts' for reading
[ffmpeg] https: Opening 'https://cbcrclive-tor.akamaized.net/hls/live/2040348/geo_allow_global/ES_NEWS_11/master_3000.m3u8' for reading
[ffmpeg/demuxer] hls: Skip ('#EXT-X-VERSION:3')
[ffmpeg/demuxer] hls: Skip ('#EXT-X-PROGRAM-DATE-TIME:2023-05-12T17:52:56.533Z')
[ffmpeg/demuxer] hls: Skip ('#EXT-X-PROGRAM-DATE-TIME:2023-05-12T17:53:04.533Z')
[ffmpeg/demuxer] hls: Skip ('#EXT-X-PROGRAM-DATE-TIME:2023-05-12T17:53:12.533Z')
[ffmpeg/demuxer] hls: Skip ('#EXT-X-PROGRAM-DATE-TIME:2023-05-12T17:53:20.533Z')
[ffmpeg] https: Opening 'https://cbcrclive-tor.akamaized.net/hls/live/2040348/geo_allow_global/ES_NEWS_11/20230512T115030/master_3000/00000/master_3000_00922.ts' for reading
[ffmpeg] https: Opening 'https://cbcrclive-tor.akamaized.net/hls/live/2040348/geo_allow_global/ES_NEWS_11/master_3000.m3u8' for reading
[ffmpeg/demuxer] hls: Skip ('#EXT-X-VERSION:3')
[ffmpeg/demuxer] hls: Skip ('#EXT-X-PROGRAM-DATE-TIME:2023-05-12T17:53:04.533Z')
[ffmpeg/demuxer] hls: Skip ('#EXT-X-PROGRAM-DATE-TIME:2023-05-12T17:53:12.533Z')
[ffmpeg/demuxer] hls: Skip ('#EXT-X-PROGRAM-DATE-TIME:2023-05-12T17:53:20.533Z')
[ffmpeg/demuxer] hls: Skip ('#EXT-X-PROGRAM-DATE-TIME:2023-05-12T17:53:28.533Z')
[ffmpeg] https: Opening 'https://cbcrclive-tor.akamaized.net/hls/live/2040348/geo_allow_global/ES_NEWS_11/20230512T115030/master_3000/00000/master_3000_00923.ts' for reading
[ffmpeg] https: Opening 'https://cbcrclive-tor.akamaized.net/hls/live/2040348/geo_allow_global/ES_NEWS_11/master_3000.m3u8' for reading
[ffmpeg/demuxer] hls: Skip ('#EXT-X-VERSION:3')
[ffmpeg/demuxer] hls: Skip ('#EXT-X-PROGRAM-DATE-TIME:2023-05-12T17:53:12.533Z')
[ffmpeg/demuxer] hls: Skip ('#EXT-X-PROGRAM-DATE-TIME:2023-05-12T17:53:20.533Z')
[ffmpeg/demuxer] hls: Skip ('#EXT-X-PROGRAM-DATE-TIME:2023-05-12T17:53:28.533Z')
[ffmpeg/demuxer] hls: Skip ('#EXT-X-PROGRAM-DATE-TIME:2023-05-12T17:53:36.533Z')
[ffmpeg] https: Opening 'https://cbcrclive-tor.akamaized.net/hls/live/2040348/geo_allow_global/ES_NEWS_11/20230512T115030/master_3000/00000/master_3000_00924.ts' for reading
[ffmpeg] https: Opening 'https://cbcrclive-tor.akamaized.net/hls/live/2040348/geo_allow_global/ES_NEWS_11/master_3000.m3u8' for reading
[ffmpeg/demuxer] hls: Skip ('#EXT-X-VERSION:3')
[ffmpeg/demuxer] hls: Skip ('#EXT-X-PROGRAM-DATE-TIME:2023-05-12T17:53:20.533Z')
[ffmpeg/demuxer] hls: Skip ('#EXT-X-PROGRAM-DATE-TIME:2023-05-12T17:53:28.533Z')
[ffmpeg/demuxer] hls: Skip ('#EXT-X-PROGRAM-DATE-TIME:2023-05-12T17:53:36.533Z')
[ffmpeg/demuxer] hls: Skip ('#EXT-X-PROGRAM-DATE-TIME:2023-05-12T17:53:44.533Z')
[ffmpeg] https: Opening 'https://cbcrclive-tor.akamaized.net/hls/live/2040348/geo_allow_global/ES_NEWS_11/20230512T115030/master_3000/00000/master_3000_00925.ts' for reading

Exiting... (Quit)

Here is the not working log

[ffmpeg] Opening https://www.cbc.ca/player/play/2205049411630
[ffmpeg] Mime-type: 'text/html; charset=utf-8'
[ffmpeg] Opening https://cbcrclive-tor.akamaized.net/hls/live/2040348/geo_allow_global/ES_NEWS_11/master_3000.m3u8
[ffmpeg] Mime-type: 'application/x-mpegURL'
[ffmpeg] Not detecting m3u8/hls with non standard extension
[ffmpeg] Not detecting m3u8/hls with non standard extension

Playing: https://cbcrclive-tor.akamaized.net/hls/live/2040348/geo_allow_global/ES_NEWS_11/20230512T115030/master_3000/00000/master_3000_00934.ts
[ffmpeg] Opening https://cbcrclive-tor.akamaized.net/hls/live/2040348/geo_allow_global/ES_NEWS_11/20230512T115030/master_3000/00000/master_3000_00934.ts
[ffmpeg] Mime-type: 'video/MP2T'
[ffmpeg/demuxer] mpegts: start time for stream 2 is not set in estimate_timings_from_pts
[ffmpeg] stream level seek from 474588 to 2991308
[ffmpeg] stream level seek from 3241308 to 0
 (+) Video --vid=1 (h264 1280x720 30.000fps)
 (+) Audio --aid=1 --alang=eng (aac 2ch 48000Hz)
VO: [gpu] 1280x720 yuv420p
AO: [wasapi] 48000Hz stereo 2ch float

Playing: https://cbcrclive-tor.akamaized.net/hls/live/2040348/geo_allow_global/ES_NEWS_11/20230512T115030/master_3000/00000/master_3000_00935.ts
[ffmpeg] Opening https://cbcrclive-tor.akamaized.net/hls/live/2040348/geo_allow_global/ES_NEWS_11/20230512T115030/master_3000/00000/master_3000_00935.ts
[ffmpeg] Mime-type: 'video/MP2T'
[ffmpeg] stream level seek from 454812 to 2963484
[ffmpeg] stream level seek from 3213484 to 0
 (+) Video --vid=1 (h264 1280x720 30.000fps)
 (+) Audio --aid=1 --alang=eng (aac 2ch 48000Hz)

Playing: https://cbcrclive-tor.akamaized.net/hls/live/2040348/geo_allow_global/ES_NEWS_11/20230512T115030/master_3000/00000/master_3000_00936.ts
[ffmpeg] Opening https://cbcrclive-tor.akamaized.net/hls/live/2040348/geo_allow_global/ES_NEWS_11/20230512T115030/master_3000/00000/master_3000_00936.ts
[ffmpeg] Mime-type: 'video/MP2T'
[ffmpeg/demuxer] mpegts: start time for stream 2 is not set in estimate_timings_from_pts
[ffmpeg] stream level seek from 493996 to 2996572
[ffmpeg] stream level seek from 3246572 to 0
 (+) Video --vid=1 (h264 1280x720 30.000fps)
 (+) Audio --aid=1 --alang=eng (aac 2ch 48000Hz)

Playing: https://cbcrclive-tor.akamaized.net/hls/live/2040348/geo_allow_global/ES_NEWS_11/20230512T115030/master_3000/00000/master_3000_00937.ts
[ffmpeg] Opening https://cbcrclive-tor.akamaized.net/hls/live/2040348/geo_allow_global/ES_NEWS_11/20230512T115030/master_3000/00000/master_3000_00937.ts
[ffmpeg] Mime-type: 'video/MP2T'
[ffmpeg/demuxer] mpegts: start time for stream 2 is not set in estimate_timings_from_pts
[ffmpeg] stream level seek from 474872 to 3003904
[ffmpeg] stream level seek from 3253904 to 0
 (+) Video --vid=1 (h264 1280x720 30.000fps)
 (+) Audio --aid=1 --alang=eng (aac 2ch 48000Hz)

Exiting... (End of file)

Change History (39)

comment:1 by QFox, 19 months ago

Summary: HLS handling Error from Commit 6b1f68ccb04d791f0250e05687c346a99ff47ea1HLS Handling Error from Commit 6b1f68ccb04d791f0250e05687c346a99ff47ea1

comment:2 by Steven Liu, 19 months ago

(base) adeMacBook-Pro-2:ffmpeg liuqi$ ffmpeg -v debug -i "https://edge20-ash.live.mmcdn.com/live-hls/amlst:hugetittiesgerda-sd-c8f042efe9196845bd96f2febf8745323c9cf7f733b41b19e20ad9ae5726fa38_trns_h264/chunklist_w1103181056_b1668000_t64RlBTOjIxLjA=.m3u8"
ffmpeg(49950,0x7ff85d71e8c0) malloc: nano zone abandoned due to inability to preallocate reserved vm space.
ffmpeg version N-110187-gb44d503f04 Copyright (c) 2000-2023 the FFmpeg developers
  built with Apple clang version 14.0.3 (clang-1403.0.22.14.1)
  configuration: --prefix=/usr/local/ --libdir=/usr/local/lib/ --cc=clang --enable-htmlpages --enable-libx264 --enable-gpl --extra-ldflags='-I/usr/local/include/GraphicsMagick/ -I/usr/local/opt/openssl/include/ -O0 -g3 -fsanitize=address -Wno-error -fPIC -I/usr/local/include' --extra-ldflags='-O0 -g3 -fsanitize=address -Wno-error -fPIC -L/usr/local/lib -L/usr/local/opt/openssl/lib -lpng' --enable-libfreetype --enable-fontconfig --enable-libspeex --enable-libopus --enable-libzmq --enable-libx265 --enable-libass --enable-videotoolbox --disable-optimizations --enable-audiotoolbox --enable-opengl --disable-stripping --samples=../../fate-suite/ --enable-encoder=hevc_videotoolbox --enable-hwaccel=hevc_videotoolbox --enable-hwaccel=h264_videotoolbox --enable-openssl --enable-nonfree --disable-shared --enable-libfdk_aac --enable-libxml2 --enable-libmp3lame --enable-libaom --enable-lcms2
  libavutil      58.  6.100 / 58.  6.100
  libavcodec     60.  9.100 / 60.  9.100
  libavformat    60.  4.101 / 60.  4.101
  libavdevice    60.  2.100 / 60.  2.100
  libavfilter     9.  5.100 /  9.  5.100
  libswscale      7.  2.100 /  7.  2.100
  libswresample   4. 11.100 /  4. 11.100
  libpostproc    57.  2.100 / 57.  2.100
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with argument 'debug'.
Reading option '-i' ... matched as input url with argument 'https://edge20-ash.live.mmcdn.com/live-hls/amlst:hugetittiesgerda-sd-c8f042efe9196845bd96f2febf8745323c9cf7f733b41b19e20ad9ae5726fa38_trns_h264/chunklist_w1103181056_b1668000_t64RlBTOjIxLjA=.m3u8'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input url https://edge20-ash.live.mmcdn.com/live-hls/amlst:hugetittiesgerda-sd-c8f042efe9196845bd96f2febf8745323c9cf7f733b41b19e20ad9ae5726fa38_trns_h264/chunklist_w1103181056_b1668000_t64RlBTOjIxLjA=.m3u8.
Successfully parsed a group of options.
Opening an input file: https://edge20-ash.live.mmcdn.com/live-hls/amlst:hugetittiesgerda-sd-c8f042efe9196845bd96f2febf8745323c9cf7f733b41b19e20ad9ae5726fa38_trns_h264/chunklist_w1103181056_b1668000_t64RlBTOjIxLjA=.m3u8.
[AVFormatContext @ 0x617000000080] Opening 'https://edge20-ash.live.mmcdn.com/live-hls/amlst:hugetittiesgerda-sd-c8f042efe9196845bd96f2febf8745323c9cf7f733b41b19e20ad9ae5726fa38_trns_h264/chunklist_w1103181056_b1668000_t64RlBTOjIxLjA=.m3u8' for reading
[https @ 0x613000000580] Setting default whitelist 'http,https,tls,rtp,tcp,udp,crypto,httpproxy'
[tcp @ 0x611000002700] Original list of addresses:
[tcp @ 0x611000002700] Address 131.153.81.81 port 443
[tcp @ 0x611000002700] Interleaved list of addresses:
[tcp @ 0x611000002700] Address 131.153.81.81 port 443
[tcp @ 0x611000002700] Starting connection attempt to 131.153.81.81 port 443
[tcp @ 0x611000002700] Successfully connected to 131.153.81.81 port 443
[https @ 0x613000000580] request: GET /live-hls/amlst:hugetittiesgerda-sd-c8f042efe9196845bd96f2febf8745323c9cf7f733b41b19e20ad9ae5726fa38_trns_h264/chunklist_w1103181056_b1668000_t64RlBTOjIxLjA=.m3u8 HTTP/1.1
User-Agent: Lavf/60.4.101
Accept: */*
Range: bytes=0-
Connection: close
Host: edge20-ash.live.mmcdn.com
Icy-MetaData: 1


[https @ 0x613000000580] HTTP error 403 Forbidden
https://edge20-ash.live.mmcdn.com/live-hls/amlst:hugetittiesgerda-sd-c8f042efe9196845bd96f2febf8745323c9cf7f733b41b19e20ad9ae5726fa38_trns_h264/chunklist_w1103181056_b1668000_t64RlBTOjIxLjA=.m3u8: Server returned 403 Forbidden (access denied)

comment:3 by QFox, 19 months ago

Any video on chaturbate.com

comment:4 by Balling, 19 months ago

But the commit is about "Its unexpected that a .avi or other "standard" file turns into a playlist" and this link goes to .m3u8. Why would it be affected? Unless it redirects to .avi and that file is actually .m3u8 then...

chaturbate.com

It is banned in many places. Sigh. Use USA ip VPN on a phone and chrome://inspect/#devices after

.\AndroidSDK\platform-tools\adb.exe devices
Last edited 19 months ago by Balling (previous) (diff)

comment:6 by QFox, 19 months ago

From mpv log
[cplayer] Set property: stream-open-filename="https://edge20-ash.live.mmcdn.com/live-hls/amlst:hugetittiesgerda-sd-c8f042efe9196845bd96f2febf8745323c9cf7f733b41b19e20ad9ae5726fa38_trns_h264/chunklist_w1103181056_b1668000_t64RlBTOjIxLjA=.m3u8" -> 1
[cplayer] Set property: file-local-options/force-media-title="hugetittiesgerda 2023-05-09 11:28" -> 1
[cplayer] Set property: file-local-options/stream-lavf-o={} -> 1
[ffmpeg] Opening https://edge20-ash.live.mmcdn.com/live-hls/amlst:hugetittiesgerda-sd-c8f042efe9196845bd96f2febf8745323c9cf7f733b41b19e20ad9ae5726fa38_trns_h264/chunklist_w1103181056_b1668000_t64RlBTOjIxLjA=.m3u8
[ffmpeg] Mime-type: 'application/vnd.apple.mpegurl'
[demux] Trying demuxers for level=normal.
[ffmpeg] Not detecting m3u8/hls with non standard extension
[ffmpeg] Not detecting m3u8/hls with non standard extension

If the m3u8 file has 3 trunks, for example, 5667, 5668, 5669,

After the 5669 was played, the ffmpeg didn't refresh the .m3u8 and looped again starting from 5667.

comment:7 by Balling, 19 months ago

If the m3u8 file has 3 trunks, for example, 5667, 5668, 5669,

Then only highest quality hevc and if no hevc, avc will be selected. 60 fps is also selected first. That is correct.

comment:8 by Balling, 19 months ago

From mpv log

Ha? This is not mpv. Again, with ffplay there is no problem. 5b300b69a6c55e79286007a751d1bc197442b253 commit testing.

Last edited 19 months ago by Balling (previous) (diff)

comment:9 by Balling, 19 months ago

Yes, it does happen with mpv, but it still opens, but then has some problems playing segments. So that should be a bug in mpv.

Last edited 19 months ago by Balling (previous) (diff)

comment:10 by Balling, 19 months ago

Resolution: invalid
Status: newclosed

comment:11 by Balling, 19 months ago

Same happens with https://d2nvs31859zcd8.cloudfront.net/84a78156146c00e58213_hasanabi_42170717963_1683572491/chunked/index-dvr.m3u8

no redirects in m3u8 or .ts files inside. Also, --no-config --demuxer=lavf fixes the issue in mpv (warnings are still there, but it does not just play one segment).

comment:12 by QFox, 19 months ago

mpv compiled with this commit, looped on above m3u8 URL for live stream.
mpv compiled with just this commit reversed, played without any problem.

The following code could caused problem.

+ if (!av_match_ext(p->filename, "m3u8,hls,m3u")) {
+ av_log(NULL, AV_LOG_ERROR, "Not detecting m3u8/hls with non standard extension\n");
+ return 0;
+ }

comment:13 by Balling, 19 months ago

Keywords: hls added

mpv compiled with just this commit reversed, played without any problem.

And so what? There is no problem for ffplay itself, mpv is just using ffmpeg's API wrong. Which is not surpising since ffplay cannot seek in mp4 HLS, so of course mpv has to hack around it!! #7359

As well as even in mkv it has to make it CFR, because ffmpeg has no hack to make VFR (that mkv always is) CFR...
https://patchwork.ffmpeg.org/project/ffmpeg/patch/20210113174623.1397914-1-tfoucu@gmail.com/

Last edited 19 months ago by Balling (previous) (diff)

comment:14 by QFox, 19 months ago

mpv called the API provided by ffmpeg to play live stream

flipping one commit within ffmpeg will get different result and you still think that commit has no problem?

Do you know that the m3u8 file of a live stream is not static? it keeps changing?

With the help of yt-dlp and ffmpeg, mpv can simply play something like

mpv https://www.youtube.com/watch?v=TPXWtozVNzM

Can you let me know if the same thing can be simply done by ffplay?

Last edited 19 months ago by QFox (previous) (diff)

comment:15 by Balling, 19 months ago

flipping one commit within ffmpeg will get different result and you still think that commit has no problem

What API do you think ffplay is using? Twitter API?? But I agree it is a good idea to revert it until mpv and other users like chrome (not that I checked Chrome yet) fix it.

Do you know that the m3u8 file of a live stream is not static? it keeps changing?

No, it does not, just chunks expire if it is true low latency stream that cannot wind back. But again, playing playlist.m3u8 will in that site allow to get to last segment, it even prints that segments expired.

Last edited 19 months ago by Balling (previous) (diff)

in reply to:  10 comment:16 by QFox, 19 months ago

Replying to Balling:

Bug in mpv https://github.com/mpv-player/mpv/issues/11674

Where did you get the idea this is mpv issue? the commit hash is a ffmpeg commit, not a mpv one.

We've identified the issue as 6b1f68ccb04d791f0250e05687c346a99ff47ea1 but it's unclear atm whether this is something that needs to be fixed upstream or downstream.

Can you show me that you can play a chaturbate live stream with ffplay without any problem?

Last edited 19 months ago by QFox (previous) (diff)

comment:17 by QFox, 19 months ago

Resolution: invalid
Status: closedreopened

comment:18 by Balling, 19 months ago

the commit hash is a ffmpeg commit, not a mpv one.

You can even click on it, I am sure we both know that.

Can you show me that you can play a chaturbate live stream with ffplay without any problem?

What problem? It does not print any warnings, that is for sure.

Last edited 19 months ago by Balling (previous) (diff)

comment:19 by QFox, 19 months ago

Description: modified (diff)

comment:21 by Balling, 19 months ago

"Each Playlist file MUST be identifiable either by the path component of its URI or by HTTP
Content-Type."

In https://d2nvs31859zcd8.cloudfront.net/84a78156146c00e58213_hasanabi_42170717963_1683572491/chunked/index-dvr.m3u8 indeed we have Content-Type to be application/x-mpegURL, which is legacy, so I agree it should be checked, if it is (It is NOT) not it should be fixed.

https://github.com/mpv-player/mpv/pull/11683 Cool hack, file name should be passed.

Last edited 2 weeks ago by Balling (previous) (diff)

comment:22 by kasper93, 19 months ago

And then you have Azure, which uses URLs without extensions by default.

https://learn.microsoft.com/en-us/azure/media-services/latest/encode-dynamic-packaging-concept

Example that does not work now

ffmpeg -i http://amssamples.streaming.mediaservices.windows.net/634cd01c-6822-4630-8444-8dd6279f94c6/CaminandesLlamaDrama4K.ism/manifest(format=m3u8-aapl)

comment:23 by Balling, 19 months ago

And then you have Azure, which uses URLs without extensions by default.

That has application/vnd.apple.mpegurl, so RFC8216 says everything is good.

comment:24 by kasper93, 19 months ago

That has application/vnd.apple.mpegurl, so RFC8216 says everything is good.

Exactly, but current FFmpeg HEAD reject those. And this is the whole issue.

comment:25 by Balling, 19 months ago

Owner: set to Michael Niedermayer
Status: reopenedopen

And this is the whole issue.

The issue discussed here was a bug in MPV already fixed, see: https://github.com/mpv-player/mpv/commit/acababec208ec4f26c1462228a9ec1d4aac2c815

But yeah. Assigning to author.

comment:26 by Balling, 19 months ago

Resolution: fixed
Status: openclosed

Fixed in 954d16fa3f09a04c7917a1c69a5c3e283554cb1d that adds parsing Content-Type.

Last edited 19 months ago by Balling (previous) (diff)

comment:27 by Balling, 19 months ago

MPV fully fixed in https://github.com/mpv-player/mpv/pull/11691 after the Content-Type is plugged in. Very nice.

comment:28 by duckweed, 17 months ago

This commit broke a use case where I have an script that downloads a m3u8 file, removes the ad segments in the m3u8 file before passing it as a data uri to mpv.

> ffprobe "data:application/x-mpegurl;base64,I0VYVE0zVQojRVhULVgtVkVSU0lPTjozCiNFWFQtWC1UQVJHRVREVVJBVElPTjozMAojRVhUSU5GOjMwLApodHRwczovL2Rvd25sb2FkLnNhbXBsZWxpYi5jb20vbXA0L3NhbXBsZS0zMHMubXA0"

ffprobe version N-109961-gad17e29224 Copyright (c) 2007-2023 the FFmpeg developers
  built with gcc 12.2.0 (Rev10, Built by MSYS2 project)
  configuration: --logfile=../ffmpeg.log --prefix=/opt/HOME/build/local --pkg-config=/ucrt64/bin/pkgconf --enable-d3d11va --enable-dxva2 --enable-fontconfig --enable-gmp --enable-gpl --enable-openssl --enable-nonfree --enable-openal --enable-pic --enable-postproc --enable-runtime-cpudetect --enable-shared --enable-swresample --enable-version3 --enable-zlib --disable-debug --disable-static --disable-doc --enable-libaom --enable-libass --enable-libbluray --enable-libcaca --enable-libcelt --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libspeex --enable-libsrt --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libx265 --enable-libxvid --enable-libvpx --enable-libwebp --enable-libxml2 --enable-libfribidi --enable-librsvg --enable-librubberband --enable-libsoxr --enable-libzimg
  libavutil      58.  3.100 / 58.  3.100
  libavcodec     60.  6.100 / 60.  6.100
  libavformat    60.  4.100 / 60.  4.100
  libavdevice    60.  2.100 / 60.  2.100
  libavfilter     9.  4.100 /  9.  4.100
  libswscale      7.  2.100 /  7.  2.100
  libswresample   4. 11.100 /  4. 11.100
  libpostproc    57.  2.100 / 57.  2.100
[hls @ 00000185a83ff680] Skip ('#EXT-X-VERSION:3')
[hls @ 00000185a83ff680] Opening 'https://download.samplelib.com/mp4/sample-30s.mp4' for reading
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000185a84265c0] stream 0, offset 0x30: partial file
[hls @ 00000185a83ff680] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none, 1920x1080, 5569 kb/s): unspecified pixel format
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Input #0, hls, from 'data:application/x-mpegurl;base64,I0VYVE0zVQojRVhULVgtVkVSU0lPTjozCiNFWFQtWC1UQVJHRVREVVJBVElPTjozMAojRVhUSU5GOjMwLApodHRwczovL2Rvd25sb2FkLnNhbXBsZWxpYi5jb20vbXA0L3NhbXBsZS0zMHMubXA0':
  Duration: N/A, bitrate: 5696 kb/s
  Program 0
    Metadata:
      variant_bitrate : 0
  Stream #0:0: Video: h264 (avc1 / 0x31637661), none, 1920x1080, 5569 kb/s, 7680 tbr, 15360 tbn (default)
    Metadata:
      variant_bitrate : 0
      major_brand     : isom
      minor_version   : 512
      compatible_brands: isomiso2avc1mp41
      encoder         : Lavf58.44.100
  Stream #0:1: Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 126 kb/s (default)
    Metadata:
      variant_bitrate : 0
> ffprobe "data:application/x-mpegurl;base64,I0VYVE0zVQojRVhULVgtVkVSU0lPTjozCiNFWFQtWC1UQVJHRVREVVJBVElPTjozMAojRVhUSU5GOjMwLApodHRwczovL2Rvd25sb2FkLnNhbXBsZWxpYi5jb20vbXA0L3NhbXBsZS0zMHMubXA0"

ffprobe version N-111282-g6ff95758e6 Copyright (c) 2007-2023 the FFmpeg developers
  built with clang version 16.0.5
  configuration: --logfile=../ffmpeg.log --prefix=/opt/HOME/build/local --cc=/ucrt64/bin/clang --pkg-config= --windres=/usr/bin/windres --enable-d3d11va --enable-dxva2 --enable-fontconfig --enable-gmp --enable-gpl --enable-openssl --enable-nonfree --enable-openal --enable-pic --enable-postproc --enable-runtime-cpudetect --enable-shared --enable-swresample --enable-version3 --enable-zlib --disable-debug --disable-static --disable-doc --enable-libaom --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libspeex --enable-libsrt --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libx265 --enable-libxvid --enable-libvpx --enable-libwebp --enable-libxml2 --enable-libfribidi --enable-librsvg --enable-librubberband --enable-libsoxr --enable-libzimg
  libavutil      58. 13.101 / 58. 13.101
  libavcodec     60. 21.100 / 60. 21.100
  libavformat    60.  9.100 / 60.  9.100
  libavdevice    60.  2.100 / 60.  2.100
  libavfilter     9.  8.102 /  9.  8.102
  libswscale      7.  3.100 /  7.  3.100
  libswresample   4. 11.100 /  4. 11.100
  libpostproc    57.  2.100 / 57.  2.100
Not detecting m3u8/hls with non standard extension and non standard mime type
    Last message repeated 9 times
data:application/x-mpegurl;base64,I0VYVE0zVQojRVhULVgtVkVSU0lPTjozCiNFWFQtWC1UQVJHRVREVVJBVElPTjozMAojRVhUSU5GOjMwLApodHRwczovL2Rvd25sb2FkLnNhbXBsZWxpYi5jb20vbXA0L3NhbXBsZS0zMHMubXA0: Invalid data found when processing input
Last edited 17 months ago by duckweed (previous) (diff)

comment:29 by duckweed, 17 months ago

Resolution: fixed
Status: closedreopened

comment:30 by Balling, 17 months ago

There was an additional fix today: 0cd2e7dcfbc835f4519f1b2b7da6bd902dbb0190

comment:31 by duckweed, 17 months ago

It doesn't help my case.

Is there any serious incentive at all for web resource providers to use the correct extension and mime type given most of them host their own video players ? If not, can we make the additional checks optional ?

Last edited 17 months ago by duckweed (previous) (diff)

comment:32 by Balling, 17 months ago

correct extension and mime type

OR, not AND

them host their own video players ?

Do you know any such stream?

the additional checks optional ?

Not per the RFC.

comment:33 by duckweed, 17 months ago

Doesn't matter. The RFC is for resource providers not for resource consumers. Consumers should try to be as lenient as possible. FFmpeg wouldn't have so much hacks and workarounds if it only ever support media that are 100% spec compliant.

I think FFmpeg needs a real security model.

Last edited 17 months ago by duckweed (previous) (diff)

comment:34 by Balling, 17 months ago

The RFC is for resource providers not for resource consumers

First of all, ffmpeg is also a provider, most use us to send HLS and whatever else. Of course there is also gpac... Second of all, RFC talks about consumers.

I think FFmpeg needs a real security model.

That is not releated to security.

Last edited 17 months ago by Balling (previous) (diff)

comment:35 by duckweed, 17 months ago

6b1f68ccb04d791f0250e05687c346a99ff47ea1 is a security opinionated commit. I am not sure why you keep posting in this thread when you don't get the issue. Anyway, I am not going to waste my time replying to you any more.

https://patchwork.ffmpeg.org/project/ffmpeg/patch/20230503123038.13030-1-michael@niedermayer.cc/

Last edited 17 months ago by duckweed (previous) (diff)

comment:36 by Balling, 17 months ago

Anyway, I am not going to waste my time replying to you any more.

Triggered! This is not going to be fixed.

comment:37 by Balling, 9 months ago

See also #10869

comment:38 by Balling, 2 weeks ago

To the previous commenter, please use m3u8 extension, not data:application/x-mpegurl;base64 file declaration.

comment:39 by Balling, 2 weeks ago

Resolution: fixed
Status: reopenedclosed
Note: See TracTickets for help on using tickets.