Opened 7 years ago

Closed 6 years ago

#6733 closed defect (fixed)

libavformat/http: no duration and totally wrong offset for hls videostream

Reported by: CoRoNe Owned by:
Priority: important Component: avformat
Version: git-master Keywords: http hls regression
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

ffmpeg-N-86402-g2336c76b_hls-test.exe -i "http://manifest.us.rtl.nl/10/v166/aes/adaptive/components/videorecorder/38/381393/381394/da1f9049-ea60-3cbc-9f61-183791654af7.ssm/da1f9049-ea60-3cbc-9f61-183791654af7.ism/da1f9049-ea60-3cbc-9f61-183791654af7-audio=125437-video=4161000.m3u8"
ffmpeg version N-86402-g2336c76b Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 7.2.0 (GCC)
  configuration: --arch=x86 --target-os=mingw32 --cross-prefix=/cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/bin/i686-w64-mingw32- --pkg-config=pkg-config --pkg-config-flags=--static --enable-gray --enable-version3 --disable-debug --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-schannel --disable-txtpages --disable-w32threads --disable-ffprobe --disable-encoders --disable-hwaccels --disable-muxers --disable-bsfs --disable-filters --enable-gmp --enable-gnutls --extra-libs=-lcrypt32 --enable-gpl --extra-cflags='-march=pentium3' --extra-cflags=-O2 --extra-cflags='-mfpmath=sse' --extra-cflags=-msse --enable-static --disable-shared --prefix=/cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32
  libavutil      55. 63.100 / 55. 63.100
  libavcodec     57. 96.101 / 57. 96.101
  libavformat    57. 72.101 / 57. 72.101
  libavdevice    57.  7.100 / 57.  7.100
  libavfilter     6. 91.100 /  6. 91.100
  libswscale      4.  7.101 /  4.  7.101
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
[hls,applehttp @ 02229360] Opening 'http://tm-aesls.rtl.nl/aes/GetKey/da1f9049-ea60-3cbc-9f61-183791654af7' for reading
[hls,applehttp @ 02229360] Opening 'crypto+http://rtl-hls-aes.akamaized.net/10/v166/aes/adaptive/components/videorecorder/38/381393/381394/da1f9049-ea60-3cbc-9f61-183791654af7.ssm/da1f9049-ea60-3cbc-9f61-183791654af7.ism/da1f9049-ea60-3cbc-9f61-183791654af7-audio=125437-video=4161000-1.ts' for reading
[mpegts @ 0225e8e0] Invalid timestamps stream=1, pts=903600, dts=907200, size=5370
[mpegts @ 0225e8e0] Invalid timestamps stream=1, pts=907200, dts=910800, size=15788
[hls,applehttp @ 02229360] Invalid timestamps stream=1, pts=903600, dts=907200, size=5370
[hls,applehttp @ 02229360] Invalid timestamps stream=1, pts=907200, dts=910800, size=15788
[mpegts @ 0225e8e0] Invalid timestamps stream=1, pts=914400, dts=921600, size=21618
[mpegts @ 0225e8e0] Invalid timestamps stream=1, pts=921600, dts=925200, size=47843
[hls,applehttp @ 02229360] Invalid timestamps stream=1, pts=914400, dts=921600, size=21618
[hls,applehttp @ 02229360] Invalid timestamps stream=1, pts=921600, dts=925200, size=47843
[mpegts @ 0225e8e0] Invalid timestamps stream=1, pts=932400, dts=936000, size=18465
[mpegts @ 0225e8e0] Invalid timestamps stream=1, pts=936000, dts=939600, size=1416
[hls,applehttp @ 02229360] Invalid timestamps stream=1, pts=932400, dts=936000, size=18465
[hls,applehttp @ 02229360] Invalid timestamps stream=1, pts=936000, dts=939600, size=1416
[mpegts @ 0225e8e0] Invalid timestamps stream=1, pts=968400, dts=975600, size=4669
[mpegts @ 0225e8e0] Invalid timestamps stream=1, pts=975600, dts=979200, size=3214
[hls,applehttp @ 02229360] Invalid timestamps stream=1, pts=968400, dts=975600, size=4669
[hls,applehttp @ 02229360] Invalid timestamps stream=1, pts=975600, dts=979200, size=3214
Input #0, hls,applehttp, from 'http://manifest.us.rtl.nl/10/v166/aes/adaptive/components/videorecorder/38/381393/381394/da1f9049-ea60-3cbc-9f61-183791654af7.ssm/da1f9049-ea60-3cbc-9f61-183791654af7.ism/da1f9049-ea60-3cbc-9f61-183791654af7-audio=125437-video=4161000.m3u8':
  Duration: 00:51:18.00, start: 10.000000, bitrate: 0 kb/s
  Program 0
    Metadata:
      variant_bitrate : 0
    Stream #0:0: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
    Metadata:
      variant_bitrate : 0
    Stream #0:1: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 1280x720, 25 tbr, 90k tbn, 50 tbc
    Metadata:
      variant_bitrate : 0

So far so good. Duration is correct. Don't know why it says "start: 10.000000", because the hls videostream starts from the beginning.

The next commit however causes the following:

ffmpeg-N-86403-g9f20cc5_hls-test.exe -i "http://manifest.us.rtl.nl/10/v166/aes/adaptive/components/videorecorder/38/381393/381394/da1f9049-ea60-3cbc-9f61-183791654af7.ssm/da1f9049-ea60-3cbc-9f61-183791654af7.ism/da1f9049-ea60-3cbc-9f61-183791654af7-audio=125437-video=4161000.m3u8"
ffmpeg version N-86403-g9f20cc5 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 7.2.0 (GCC)
  configuration: --arch=x86 --target-os=mingw32 --cross-prefix=/cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/bin/i686-w64-mingw32- --pkg-config=pkg-config --pkg-config-flags=--static --enable-gray --enable-version3 --disable-debug --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-schannel --disable-txtpages --disable-w32threads --disable-ffprobe --disable-encoders --disable-hwaccels --disable-muxers --disable-bsfs --disable-filters --enable-gmp --enable-gnutls --extra-libs=-lcrypt32 --enable-gpl --extra-cflags='-march=pentium3' --extra-cflags=-O2 --extra-cflags='-mfpmath=sse' --extra-cflags=-msse --enable-static --disable-shared --prefix=/cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32
  libavutil      55. 63.100 / 55. 63.100
  libavcodec     57. 96.101 / 57. 96.101
  libavformat    57. 72.101 / 57. 72.101
  libavdevice    57.  7.100 / 57.  7.100
  libavfilter     6. 91.100 /  6. 91.100
  libswscale      4.  7.101 /  4.  7.101
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
[hls,applehttp @ 02229360] Opening 'http://tm-aesls.rtl.nl/aes/GetKey/da1f9049-ea60-3cbc-9f61-183791654af7' for reading
[hls,applehttp @ 02229360] Opening 'crypto+http://rtl-hls-aes.akamaized.net/10/v166/aes/adaptive/components/videorecorder/38/381393/381394/da1f9049-ea60-3cbc-9f61-183791654af7.ssm/da1f9049-ea60-3cbc-9f61-183791654af7.ism/da1f9049-ea60-3cbc-9f61-183791654af7-audio=125437-video=4161000-294.ts' for reading
[mpegts @ 0225d020] Invalid timestamps stream=1, pts=264603600, dts=264610800, size=10256
[mpegts @ 0225d020] Invalid timestamps stream=1, pts=264610800, dts=264614400, size=10914
[hls,applehttp @ 02229360] Invalid timestamps stream=1, pts=264603600, dts=264610800, size=10256
[hls,applehttp @ 02229360] Invalid timestamps stream=1, pts=264610800, dts=264614400, size=10914
[mpegts @ 0225d020] Invalid timestamps stream=1, pts=264618000, dts=264625200, size=9594
[mpegts @ 0225d020] Invalid timestamps stream=1, pts=264625200, dts=264628800, size=12235
[hls,applehttp @ 02229360] Invalid timestamps stream=1, pts=264618000, dts=264625200, size=9594
[hls,applehttp @ 02229360] Invalid timestamps stream=1, pts=264625200, dts=264628800, size=12235
[mpegts @ 0225d020] Invalid timestamps stream=1, pts=264632400, dts=264639600, size=11399
[mpegts @ 0225d020] Invalid timestamps stream=1, pts=264639600, dts=264643200, size=16343
[hls,applehttp @ 02229360] Invalid timestamps stream=1, pts=264632400, dts=264639600, size=11399
[hls,applehttp @ 02229360] Invalid timestamps stream=1, pts=264639600, dts=264643200, size=16343
[mpegts @ 0225d020] Invalid timestamps stream=1, pts=264646800, dts=264654000, size=10617
[mpegts @ 0225d020] Invalid timestamps stream=1, pts=264654000, dts=264657600, size=17796
[hls,applehttp @ 02229360] Invalid timestamps stream=1, pts=264646800, dts=264654000, size=10617
[hls,applehttp @ 02229360] Invalid timestamps stream=1, pts=264654000, dts=264657600, size=17796
[mpegts @ 0225d020] Invalid timestamps stream=1, pts=264661200, dts=264668400, size=12993
[mpegts @ 0225d020] Invalid timestamps stream=1, pts=264668400, dts=264672000, size=20091
[hls,applehttp @ 02229360] Invalid timestamps stream=1, pts=264661200, dts=264668400, size=12993
[hls,applehttp @ 02229360] Invalid timestamps stream=1, pts=264668400, dts=264672000, size=20091
Input #0, hls,applehttp, from 'http://manifest.us.rtl.nl/10/v166/aes/adaptive/components/videorecorder/38/381393/381394/da1f9049-ea60-3cbc-9f61-183791654af7.ssm/da1f9049-ea60-3cbc-9f61-183791654af7.ism/da1f9049-ea60-3cbc-9f61-183791654af7-audio=125437-video=4161000.m3u8':
  Duration: N/A, start: 2940.000000, bitrate: N/A
  Program 0
    Metadata:
      variant_bitrate : 0
    Stream #0:0: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
    Metadata:
      variant_bitrate : 0
    Stream #0:1: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 1280x720, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Metadata:
      variant_bitrate : 0

Now the hls videostream has no detected duration, but above all starts at 49:00.00 and thus only has a 02:18.00 duration!

Note: this hls videostream could be geoblocked for foreigners.

Change History (8)

comment:1 by Carl Eugen Hoyos, 7 years ago

Keywords: http hls regression added

comment:2 by CoRoNe, 7 years ago

Locally reverting mentioned commit solves the issue. But I don't know the importance of this commit, because this change was obviously committed for a reason.

comment:5 by CoRoNe, 7 years ago

That's probably because:

Note: this hls videostream could be geoblocked for foreigners.

Working fine over here.

comment:6 by Aman, 7 years ago

It appears like this server does not react well to Range requests, returning conflicting sizes as part of the 206 response:

< Content-Length: 11069
< Content-Range: bytes 0-10588/10589

The size of the data returned is 11069, even though the range says otherwise.

The hls demuxer sets seekable=0 on outgoing requests already to avoid problems like this. However, this option does not get set on the initial m3u8 url which is opened before the hls demuxer is invoked.

A workaround is to pass "-seekable 1" or "-seekable 0" yourself, which will endure the entire playlist is downloaded and it doesn't get mistaken for a live playlist (which is missing an ENDLIST tag).

comment:7 by CoRoNe, 7 years ago

"tmm1" and I have already had a private e-mail conversation about this and -seekable 0 was (and is) indeed a fix/workaround in this case. Thanks again.
Sorry for the late reply. This ticket can be closed.

Version 0, edited 7 years ago by CoRoNe (next)

comment:8 by Aman, 6 years ago

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