Opened 3 years ago

Closed 3 years ago

#5248 closed defect (fixed)

FFMpeg can't open protected HLS-streams

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

Description

While the manifest-playlist opens just fine:

ffmpeg-20160127-git-9079e99.exe -hide_banner -i "https://kalturahd-vh.akamaihd.net/i/content/r71v1/entry/data/412/112/1_yjrbfoc0_0_,e1d20ia2,r7mao8mk,ybgd4av0,439hamb1,3lu536fi,8ojsff0g,_2.mp4.csmil/master.m3u8"
Input #0, hls,applehttp, from 'https://kalturahd-vh.akamaihd.net/i/content/r71v1/entry/data/412/112/1_yjrbfoc0_0_,e1d20ia2,r7mao8mk,ybgd4av0,439hamb1,3lu536fi,8ojsff0g,_2.mp4.csmil/master.m3u8':
  Duration: 00:21:35.00, start: 0.100511, bitrate: 0 kb/s
  Program 0
    Metadata:
      variant_bitrate : 463000
    Stream #0:0: Video: h264 (Constrained Baseline) ([27][0][0][0] / 0x001B), yuv420p, 480x272 [SAR 1:1 DAR 30:17], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Metadata:
      variant_bitrate : 463000
    Stream #0:1: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp, 70 kb/s
    Metadata:
      variant_bitrate : 463000
    Stream #0:2: Data: timed_id3 (ID3  / 0x20334449)
    Metadata:
      variant_bitrate : 463000
  Program 1
    Metadata:
      variant_bitrate : 663000
    Stream #0:3: Video: h264 (Constrained Baseline) ([27][0][0][0] / 0x001B), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Metadata:
      variant_bitrate : 663000
    Stream #0:4: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp, 70 kb/s
    Metadata:
      variant_bitrate : 663000
    Stream #0:5: Data: timed_id3 (ID3  / 0x20334449)
    Metadata:
      variant_bitrate : 663000
  Program 2
    Metadata:
      variant_bitrate : 960000
    Stream #0:6: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Metadata:
      variant_bitrate : 960000
    Stream #0:7: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp, 70 kb/s
    Metadata:
      variant_bitrate : 960000
    Stream #0:8: Data: timed_id3 (ID3  / 0x20334449)
    Metadata:
      variant_bitrate : 960000
  Program 3
    Metadata:
      variant_bitrate : 1599000
    Stream #0:9: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p, 1024x576 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Metadata:
      variant_bitrate : 1599000
    Stream #0:10: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp, 128 kb/s
    Metadata:
      variant_bitrate : 1599000
    Stream #0:11: Data: timed_id3 (ID3  / 0x20334449)
    Metadata:
      variant_bitrate : 1599000
  Program 4
    Metadata:
      variant_bitrate : 2620000
    Stream #0:12: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Metadata:
      variant_bitrate : 2620000
    Stream #0:13: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp, 128 kb/s
    Metadata:
      variant_bitrate : 2620000
    Stream #0:14: Data: timed_id3 (ID3  / 0x20334449)
    Metadata:
      variant_bitrate : 2620000
  Program 5
    Metadata:
      variant_bitrate : 3711000
    Stream #0:15: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Metadata:
      variant_bitrate : 3711000
    Stream #0:16: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp, 128 kb/s
    Metadata:
      variant_bitrate : 3711000
    Stream #0:17: Data: timed_id3 (ID3  / 0x20334449)
    Metadata:
      variant_bitrate : 3711000

...the individual streams, that have a base64 encoded parameter at the end, FFMpeg can't seem to open:

ffmpeg-20160216-git-2e8ad2d.exe -hide_banner -i "https://kalturahd-vh.akamaihd.net/i/content/r71v1/entry/data/412/112/1_yjrbfoc0_0_,e1d20ia2,r7mao8mk,ybgd4av0,439hamb1,3lu536fi,8ojsff0g,_2.mp4.csmil/index_4_av.m3u8?null=&id=AgBQZTEFUl7qXkvWxFbyQnt7tU93pObXDt8XWfeC0oQFH66pw6UnxTa/Wf1HGgbfcgtlc6SFqcsapg=="
[hls,applehttp @ 035de700] Failed to open segment of playlist 0 
    Last message repeated 129 times
[hls,applehttp @ 035de700] Error when loading first segment 'http://kalturahd-vh.akamaihd.net/i/content/r71v1/entry/data/412/112/1_yjrbfoc0_0_,e1d20ia2,r7mao8mk,ybgd4av0,439hamb1,3lu536fi,8ojsff0g,_2.mp4.csmil/segment1_4_av.ts?null=&id=AgBQZTEFUl7qXkvWxFbyQnt7tU93pObXDt8XWfeC0oQFH66pw6UnxTa/Wf1HGgbfcgtlc6SFqcsapg=='
https://kalturahd-vh.akamaihd.net/i/content/r71v1/entry/data/412/112/1_yjrbfoc0_0_,e1d20ia2,r7mao8mk,ybgd4av0,439hamb1,3lu536fi,8ojsff0g,_2.mp4.csmil/index_4_av.m3u8?null=&id=AgBQZTEFUl7qXkvWxFbyQnt7tU93pObXDt8XWfeC0oQFH66pw6UnxTa/Wf1HGgbfcgtlc6SFqcsapg==: Invalid data found when processing input

Change History (6)

comment:1 Changed 3 years ago by cehoyos

  • Keywords parameter removed

Please provide the command line that allows to reproduce the issue together with the complete, uncut console output without using the option -hide_banner to make this a valid ticket.

comment:2 Changed 3 years ago by CoRoNe

ffmpeg-20160216-git-2e8ad2d.exe -i "https://kalturahd-vh.akamaihd.net/i/content/r71v1/entry/data/412/112/1_yjrbfoc0_0_,e1d20ia2,r7mao8mk,ybgd4av0,439hamb1,3lu536fi,8ojsff0g,_2.mp4.csmil/index_4_av.m3u8?null=&id=AgBQZTEFUl7qXwYQxlYonRBC96wq3FFlXFrQmKEm1+d0/BoHnDbYby+2QLadhfS8LqyMPS55U2kj+A=="
ffmpeg version N-78559-g2e8ad2d Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
  libavutil      55. 17.103 / 55. 17.103
  libavcodec     57. 24.103 / 57. 24.103
  libavformat    57. 25.100 / 57. 25.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 32.100 /  6. 32.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
[hls,applehttp @ 035de6c0] Failed to open segment of playlist 0
    Last message repeated 129 times
[hls,applehttp @ 035de6c0] Error when loading first segment 'http://kalturahd-vh.akamaihd.net/i/content/r71v1/entry/data/412/112/1_yjrbfoc0_0_,e1d20ia2,r7mao8mk,ybgd4av0,439hamb1,3lu536fi,8ojsff0g,_2.mp4.csmil/segment1_4_av.ts?null=&id=AgBQZTEFUl7qXwYQxlYonRBC96wq3FFlXFrQmKEm1+d0/BoHnDbYby+2QLadhfS8LqyMPS55U2kj+A=='
https://kalturahd-vh.akamaihd.net/i/content/r71v1/entry/data/412/112/1_yjrbfoc0_0_,e1d20ia2,r7mao8mk,ybgd4av0,439hamb1,3lu536fi,8ojsff0g,_2.mp4.csmil/index_4_av.m3u8?null=&id=AgBQZTEFUl7qXwYQxlYonRBC96wq3FFlXFrQmKEm1+d0/BoHnDbYby+2QLadhfS8LqyMPS55U2kj+A==: Invalid data found when processing input

Mind you that the base64 encoded 'ID' is only valid for a short amount of time. If you want to generate a fresh one, just open the manifest-playlist, "https://kalturahd-vh.akamaihd.net/i/content/r71v1/entry/data/412/112/1_yjrbfoc0_0_,e1d20ia2,r7mao8mk,ybgd4av0,439hamb1,3lu536fi,8ojsff0g,_2.mp4.csmil/master.m3u8", and copy-paste from there.

comment:3 Changed 3 years ago by tommyv

Example of protected HLS stream not working with 3.0 but working with 2.8.x

FFMpeg 3.0 output:

~/ffmpeg-git-20160224-64bit-static$ ./ffprobe -loglevel debug "http://live1.msf.ticdn.it/Content/HLS/Live/Channel(CH01HA)/Stream(04)/index.m3u8"
ffprobe version N-53133-g10fa50c-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2007-2016 the FFmpeg developers
  built with gcc 5.3.1 (Debian 5.3.1-9) 20160220
  configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --enable-libass --enable-gnutls --enable-libvidstab --enable-libsoxr --enable-frei0r --enable-libfribidi --disable-indev=sndio --disable-outdev=sndio --enable-librtmp --enable-libmfx --cc=gcc
  libavutil      55. 19.100 / 55. 19.100
  libavcodec     57. 24.106 / 57. 24.106
  libavformat    57. 26.100 / 57. 26.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 35.100 /  6. 35.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
[http @ 0x4934fa0] Setting default whitelist 'http,https,tls,rtp,tcp,udp,crypto'
[http @ 0x4934fa0] request: GET /Content/HLS/Live/Channel(CH01HA)/Stream(04)/index.m3u8 HTTP/1.1
User-Agent: Lavf/57.26.100
Accept: */*
Range: bytes=0-
Connection: close
Host: live1.msf.ticdn.it
Icy-MetaData: 1


[http @ 0x4934fa0] request: GET /Content/HLS/Live/Channel(CH01HA)/Stream(04)/index.m3u8 HTTP/1.1
User-Agent: Lavf/57.26.100
Accept: */*
Range: bytes=0-
Connection: close
Host: se-to1-8.se.live1.msf.ticdn.it
Icy-MetaData: 1


[hls,applehttp @ 0x4934820] Format hls,applehttp probed with size=2048 and score=100
[hls,applehttp @ 0x4934820] HLS request for url 'http://se-to1-8.se.live1.msf.ticdn.it/Content/HLS/Live/Channel(CH01HA)/Stream(04)/Segment(14563194100000000)/segment.ts', offset 0, playlist 0
[http @ 0x493fdc0] request: GET /IOS/IOSLicenser?kid=e8451abd-9de1-4f0f-9df4-d1e69e6cc4a1 HTTP/1.1
User-Agent: Lavf/57.26.100
Accept: */*
Connection: close
Host: lic.mediaset.net
Icy-MetaData: 1


[AVIOContext @ 0x4941940] Statistics: 16 bytes read, 0 seeks
[hls,applehttp @ 0x4934820] Failed to open segment of playlist 0
[hls,applehttp @ 0x4934820] HLS request for url 'http://se-to1-8.se.live1.msf.ticdn.it/Content/HLS/Live/Channel(CH01HA)/Stream(04)/Segment(14563194140000000)/segment.ts', offset 0, playlist 0
[hls,applehttp @ 0x4934820] Failed to open segment of playlist 0
[hls,applehttp @ 0x4934820] HLS request for url 'http://se-to1-8.se.live1.msf.ticdn.it/Content/HLS/Live/Channel(CH01HA)/Stream(04)/Segment(14563194180000000)/segment.ts', offset 0, playlist 0
[hls,applehttp @ 0x4934820] Failed to open segment of playlist 0
[http @ 0x49402a0] request: GET /Content/HLS/Live/Channel(CH01HA)/Stream(04)/index.m3u8 HTTP/1.1
User-Agent: Lavf/57.26.100
Accept: */*
Connection: close
Host: se-to1-8.se.live1.msf.ticdn.it
Icy-MetaData: 1


[AVIOContext @ 0x4941940] Statistics: 1776 bytes read, 0 seeks
[hls,applehttp @ 0x4934820] HLS request for url 'http://se-to1-8.se.live1.msf.ticdn.it/Content/HLS/Live/Channel(CH01HA)/Stream(04)/Segment(14563194220000000)/segment.ts', offset 0, playlist 0
[hls,applehttp @ 0x4934820] Failed to open segment of playlist 0
[http @ 0x493d9e0] request: GET /Content/HLS/Live/Channel(CH01HA)/Stream(04)/index.m3u8 HTTP/1.1
User-Agent: Lavf/57.26.100
Accept: */*
Connection: close
Host: se-to1-8.se.live1.msf.ticdn.it
Icy-MetaData: 1


[AVIOContext @ 0x4940080] Statistics: 1776 bytes read, 0 seeks
[hls,applehttp @ 0x4934820] HLS request for url 'http://se-to1-8.se.live1.msf.ticdn.it/Content/HLS/Live/Channel(CH01HA)/Stream(04)/Segment(14563194260000000)/segment.ts', offset 0, playlist 0
[hls,applehttp @ 0x4934820] Failed to open segment of playlist 0

FFMpeg 2.8.6 output

ffprobe -loglevel debug "http://live1.msf.ticdn.it/Content/HLS/Live/Channel(CH01HA)/Stream(04)/index.m3u8"
ffprobe version 2.8.6-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2007-2016 the FFmpeg developers
  built with gcc 5.3.1 (Debian 5.3.1-9) 20160220
  configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --enable-libass --enable-gnutls --enable-libvidstab --enable-libsoxr --enable-frei0r --enable-libfribidi --disable-indev=sndio --disable-outdev=sndio --enable-librtmp --enable-libmfx --cc=gcc
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
[http @ 0x557ff60] request: GET /Content/HLS/Live/Channel(CH01HA)/Stream(04)/index.m3u8 HTTP/1.1
User-Agent: Lavf/56.40.101
Accept: */*
Range: bytes=0-
Connection: close
Host: live1.msf.ticdn.it
Icy-MetaData: 1


[http @ 0x557ff60] request: GET /Content/HLS/Live/Channel(CH01HA)/Stream(04)/index.m3u8 HTTP/1.1
User-Agent: Lavf/56.40.101
Accept: */*
Range: bytes=0-
Connection: close
Host: se-mi1-17.se.live1.msf.ticdn.it
Icy-MetaData: 1


[hls,applehttp @ 0x557f800] Format hls,applehttp probed with size=2048 and score=100
[hls,applehttp @ 0x557f800] HLS request for url 'http://se-mi1-17.se.live1.msf.ticdn.it/Content/HLS/Live/Channel(CH01HA)/Stream(04)/Segment(14563195300000000)/segment.ts', offset 0, playlist 0
[http @ 0x558abc0] No trailing CRLF found in HTTP header.
[http @ 0x558abc0] request: GET /IOS/IOSLicenser?kid=e8451abd-9de1-4f0f-9df4-d1e69e6cc4a1 HTTP/1.1
User-Agent: Lavf/56.40.101
Accept: */*
Connection: close
Host: lic.mediaset.net
Icy-MetaData: 1



[http @ 0x558c600] No trailing CRLF found in HTTP header.
[http @ 0x558c600] request: GET /Content/HLS/Live/Channel(CH01HA)/Stream(04)/Segment(14563195300000000)/segment.ts HTTP/1.1
User-Agent: Lavf/56.40.101
Accept: */*
Connection: close
Host: se-mi1-17.se.live1.msf.ticdn.it
Icy-MetaData: 1



Format mpegts probed with size=2048 and score=100
[mpegts @ 0x5589d20] stream=0 stream_type=1b pid=21 prog_reg_desc=
[mpegts @ 0x5589d20] stream=1 stream_type=f pid=22 prog_reg_desc=
[mpegts @ 0x5589d20] Before avformat_find_stream_info() pos: 0 bytes read:9440 seeks:0
[h264 @ 0x55a13c0] no picture 
[mpegts @ 0x5589d20] All info found
[mpegts @ 0x5589d20] After avformat_find_stream_info() pos: 233872 bytes read:233872 seeks:0 frames:45
[hls,applehttp @ 0x557f800] Before avformat_find_stream_info() pos: 1776 bytes read:1776 seeks:0
[h264 @ 0x55f2080] no picture 
[hls,applehttp @ 0x557f800] All info found
[hls,applehttp @ 0x557f800] After avformat_find_stream_info() pos: 1776 bytes read:1776 seeks:0 frames:45
Input #0, hls,applehttp, from 'http://live1.msf.ticdn.it/Content/HLS/Live/Channel(CH01HA)/Stream(04)/index.m3u8':
  Duration: N/A, start: 93009.941111, bitrate: N/A
  Program 0 
    Metadata:
      variant_bitrate : 0
    Stream #0:0, 21, 1/90000: Video: h264 (High), 4 reference frames ([27][0][0][0] / 0x001B), yuv420p(tv, bt470bg, left), 1024x576 [SAR 1:1 DAR 16:9], 1/50, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1, 24, 1/90000: Audio: aac (LC) ([226][10]cf / 0x66630AE2), 48000 Hz, stereo, fltp, 95 kb/s
detected 4 logical cores
[AVIOContext @ 0x558c920] Statistics: 1776 bytes read, 0 seeks

comment:4 Changed 3 years ago by kyl416

I think it's a result of this merged commit:
http://git.videolan.org/?p=ffmpeg.git;a=commitdiff;h=d0fc5de3a643fe7f974ed14e410c2ac2f4147d7e

Once I revert to a previous commit like a588c7ac13bce3ef327ae2490e0974b65242c01f it works fine

comment:5 Changed 3 years ago by cehoyos

  • Component changed from undetermined to avformat
  • Keywords regression added
  • Priority changed from normal to important
  • Version changed from unspecified to git-master

comment:6 Changed 3 years ago by heleppkes

  • Resolution set to fixed
  • Status changed from new to closed

This should be fixed in eae2d89bf715bc3edff478174b43e1f388e768bf for git master.

Note: See TracTickets for help on using tickets.