[FFmpeg-user] Key request failing when passing cookies

Chovy chovy at protonmail.ch
Fri May 13 04:58:21 CEST 2016


Can someone take a look and see if I'm passing cookies incorrectly?

If I load the manifest file ffmpeg will auto-select a stream and it plays fine. The manifest request sets cookies. I am trying to play an individual stream file from the manifest file and passing the cookies along with it.

It starts to play for a few seconds then gets an HTTP 403 error on the key request.


Here is the output (the stream is behind credentials that I can't post here for obvious reasons).


$ ffmpeg -cookies 'unique_id=1463107910_611761421; path=/hls/live/203451/msios_ch08/; domain=165735-i.akamaihd.net;' -cookies 'hdntl=exp=1463194310~acl=%2f*%2f203451*~data=hdntl~hmac=e581422b336e97b43d8f8c6e8a51ae14c4d6c828489d06861e88dec4ae97f122; path=/; domain=165735-i.akamaihd.net; ;' -cookies '_alid_=7ur/2n1iG0P4AU8VNYm0kg==; path=/hls/live/203451/msios_ch08/; domain=165735-i.akamaihd.net;' -i 'http://165735-i.akamaihd.net/hls/live/203451/msios_ch08/index_Layer4.m3u8?reportingKey=eventId-1129989_partnerId-3784&hdnea=st=1463107880~exp=1463107940~acl=/*/203451*~hmac=4396fade63fc4273051249d139454a873c5d99d267b32ac8c68477daae642856' -loglevel debug -c copy test.m3u8
ffmpeg version 3.0.2 Copyright (c) 2000-2016 the FFmpeg developers
built with Apple LLVM version 7.3.0 (clang-703.0.29)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.0.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --enable-vda
libavutil 55. 17.103 / 55. 17.103
libavcodec 57. 24.102 / 57. 24.102
libavformat 57. 25.100 / 57. 25.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 31.100 / 6. 31.100
libavresample 3. 0. 0 / 3. 0. 0
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
Splitting the commandline.
Reading option '-cookies' ... matched as AVOption 'cookies' with argument 'unique_id=1463107910_611761421; path=/hls/live/203451/msios_ch08/; domain=165735-i.akamaihd.net;'.
Reading option '-cookies' ... matched as AVOption 'cookies' with argument 'hdntl=exp=1463194310~acl=%2f*%2f203451*~data=hdntl~hmac=e581422b336e97b43d8f8c6e8a51ae14c4d6c828489d06861e88dec4ae97f122; path=/; domain=165735-i.akamaihd.net; ;'.
Reading option '-cookies' ... matched as AVOption 'cookies' with argument '_alid_=7ur/2n1iG0P4AU8VNYm0kg==; path=/hls/live/203451/msios_ch08/; domain=165735-i.akamaihd.net;'.
Reading option '-i' ... matched as input file with argument 'http://165735-i.akamaihd.net/hls/live/203451/msios_ch08/index_Layer4.m3u8?reportingKey=eventId-1129989_partnerId-3784&hdnea=st=1463107880~exp=1463107940~acl=/*/203451*~hmac=4396fade63fc4273051249d139454a873c5d99d267b32ac8c68477daae642856'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-c' ... matched as option 'c' (codec name) with argument 'copy'.
Reading option 'test.m3u8' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input file http://165735-i.akamaihd.net/hls/live/203451/msios_ch08/index_Layer4.m3u8?reportingKey=eventId-1129989_partnerId-3784&hdnea=st=1463107880~exp=1463107940~acl=/*/203451*~hmac=4396fade63fc4273051249d139454a873c5d99d267b32ac8c68477daae642856.
Successfully parsed a group of options.
Opening an input file: http://165735-i.akamaihd.net/hls/live/203451/msios_ch08/index_Layer4.m3u8?reportingKey=eventId-1129989_partnerId-3784&hdnea=st=1463107880~exp=1463107940~acl=/*/203451*~hmac=4396fade63fc4273051249d139454a873c5d99d267b32ac8c68477daae642856.
[http @ 0x7f85bbc002a0] Setting default whitelist 'http,https,tls,rtp,tcp,udp,crypto,httpproxy'
[http @ 0x7f85bbc002a0] request: GET /hls/live/203451/msios_ch08/index_Layer4.m3u8?reportingKey=eventId-1129989_partnerId-3784&hdnea=st=1463107880~exp=1463107940~acl=/*/203451*~hmac=4396fade63fc4273051249d139454a873c5d99d267b32ac8c68477daae642856 HTTP/1.1
User-Agent: Lavf/57.25.100
Accept: */*
Range: bytes=0-
Connection: close
Host: 165735-i.akamaihd.net
Cookie: _alid_=7ur/2n1iG0P4AU8VNYm0kg==
Icy-MetaData: 1


[hls,applehttp @ 0x7f85bc800000] Format hls,applehttp probed with size=2048 and score=100
[hls,applehttp @ 0x7f85bc800000] HLS request for url 'http://165735-i.akamaihd.net/hls/live/203451/msios_ch08/index_Layer4/8408_Period1/segment802.ts', offset 0, playlist 0
[http @ 0x7f85bbc01cc0] request: GET /hls/live/203451/msios_ch08/index_Layer4/8408_Period1/segment802.ts HTTP/1.1
User-Agent: Lavf/57.25.100
Accept: */*
Connection: close
Host: 165735-i.akamaihd.net
Cookie: _alid_=7ur/2n1iG0P4AU8VNYm0kg==; unique_id=1463107936_92450278; hdntl=exp=1463194336~acl=%2f*%2f203451*~data=hdntl~hmac=31a8c6a328dc29d92a9c91d2656505b7f895872001b3e13513c294f8204f44e9
Icy-MetaData: 1


Format mpegts probed with size=2048 and score=100
[mpegts @ 0x7f85bc804200] stream=0 stream_type=1b pid=21 prog_reg_desc=
[mpegts @ 0x7f85bc804200] stream=1 stream_type=f pid=24 prog_reg_desc=
[mpegts @ 0x7f85bc804200] Before avformat_find_stream_info() pos: 0 bytes read:9178 seeks:0
[h264 @ 0x7f85bc012600] Current profile doesn't provide more RBSP data in PPS, skipping
[mpegts @ 0x7f85bc804200] All info found
[mpegts @ 0x7f85bc804200] After avformat_find_stream_info() pos: 19928 bytes read:20762 seeks:0 frames:39
[hls,applehttp @ 0x7f85bc800000] Before avformat_find_stream_info() pos: 747 bytes read:747 seeks:0
[hls,applehttp @ 0x7f85bc800000] All info found
[hls,applehttp @ 0x7f85bc800000] After avformat_find_stream_info() pos: 747 bytes read:747 seeks:0 frames:39
Input #0, hls,applehttp, from 'http://165735-i.akamaihd.net/hls/live/203451/msios_ch08/index_Layer4.m3u8?reportingKey=eventId-1129989_partnerId-3784&hdnea=st=1463107880~exp=1463107940~acl=/*/203451*~hmac=4396fade63fc4273051249d139454a873c5d99d267b32ac8c68477daae642856':
Duration: N/A, start: 8020.750000, bitrate: N/A
Program 0
Metadata:
variant_bitrate : 0
Stream #0:0, 21, 1/90000: Video: h264 (Constrained Baseline), 1 reference frame ([27][0][0][0] / 0x001B), yuv420p(tv, left), 384x216 (384x224), 1/50, 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:1, 18, 1/90000: Audio: aac (HE-AAC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp, 48 kb/s
Successfully opened the file.
Parsing a group of options: output file test.m3u8.
Applying option c (codec name) with argument copy.
Successfully parsed a group of options.
Opening an output file: test.m3u8.
Successfully opened the file.
[file @ 0x7f85bbd1f360] Setting default whitelist 'file,crypto'
[mpegts @ 0x7f85bc02f800] muxrate VBR, pcr every 2 pkts, sdt every 2147483647, pat/pmt every 2147483647 pkts
Output #0, hls, to 'test.m3u8':
Metadata:
encoder : Lavf57.25.100
Stream #0:0, 0, 1/90000: Video: h264, 1 reference frame ([27][0][0][0] / 0x001B), yuv420p(left), 384x216 (0x0), 1/25, q=2-31, 25 fps, 25 tbr, 90k tbn, 25 tbc
Stream #0:1, 0, 1/90000: Audio: aac (HE-AAC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, 48 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
Last message repeated 3 times
[NULL @ 0x7f85bc012600] Current profile doesn't provide more RBSP data in PPS, skipping
[AVIOContext @ 0x7f85bbd18cc0] Statistics: 0 seeks, 55 writeouts
[file @ 0x7f85bbc06880] Setting default whitelist 'file,crypto'
[file @ 0x7f85bbc073e0] Setting default whitelist 'file,crypto'
[hls @ 0x7f85bc020400] EXT-X-MEDIA-SEQUENCE:0
[AVIOContext @ 0x7f85bbc07440] Statistics: 0 seeks, 1 writeouts
[NULL @ 0x7f85bc012600] Current profile doesn't provide more RBSP data in PPS, skipping
[AVIOContext @ 0x7f85bbc07300] Statistics: 0 seeks, 55 writeouts
[file @ 0x7f85bbc07180] Setting default whitelist 'file,crypto'
[file @ 0x7f85bbd20100] Setting default whitelist 'file,crypto'
[hls @ 0x7f85bc020400] EXT-X-MEDIA-SEQUENCE:0
[AVIOContext @ 0x7f85bbc071e0] Statistics: 0 seeks, 1 writeouts
[NULL @ 0x7f85bc012600] Current profile doesn't provide more RBSP data in PPS, skipping
[AVIOContext @ 0x7f85bbd20020] Statistics: 0 seeks, 55 writeouts
[file @ 0x7f85bbd20100] Setting default whitelist 'file,crypto'
[file @ 0x7f85bbd21e80] Setting default whitelist 'file,crypto'
[hls @ 0x7f85bc020400] EXT-X-MEDIA-SEQUENCE:0
[AVIOContext @ 0x7f85bbc01220] Statistics: 0 seeks, 1 writeouts
[NULL @ 0x7f85bc012600] Current profile doesn't provide more RBSP data in PPS, skipping
[AVIOContext @ 0x7f85bbd18c00] Statistics: 0 seeks, 55 writeouts
[file @ 0x7f85bbc06920] Setting default whitelist 'file,crypto'
[file @ 0x7f85bbd200e0] Setting default whitelist 'file,crypto'
[hls @ 0x7f85bc020400] EXT-X-MEDIA-SEQUENCE:0
[AVIOContext @ 0x7f85bbc07280] Statistics: 0 seeks, 1 writeouts
[hls,applehttp @ 0x7f85bc800000] HLS request for url 'http://165735-i.akamaihd.net/hls/live/203451/msios_ch08/index_Layer4/8408_Period1/segment803.ts', offset 0, playlist 0
[http @ 0x7f85bbd22380] request: GET /hls/live/203451/msios_ch08/index_Layer4/8408_Period1/segment803.ts HTTP/1.1
User-Agent: Lavf/57.25.100
Accept: */*
Connection: close
Host: 165735-i.akamaihd.net
Cookie: _alid_=7ur/2n1iG0P4AU8VNYm0kg==; unique_id=1463107936_92450278; hdntl=exp=1463194336~acl=%2f*%2f203451*~data=hdntl~hmac=31a8c6a328dc29d92a9c91d2656505b7f895872001b3e13513c294f8204f44e9
Icy-MetaData: 1


[mpegts @ 0x7f85bc804200] Continuity check failed for pid 0 expected 1 got 0
[mpegts @ 0x7f85bc804200] Continuity check failed for pid 32 expected 1 got 0
[NULL @ 0x7f85bc012600] Current profile doesn't provide more RBSP data in PPS, skipping
[AVIOContext @ 0x7f85bbd1f660] Statistics: 0 seeks, 55 writeouts
[file @ 0x7f85bbc070c0] Setting default whitelist 'file,crypto'
[file @ 0x7f85bbc06900] Setting default whitelist 'file,crypto'
[hls @ 0x7f85bc020400] EXT-X-MEDIA-SEQUENCE:0
[AVIOContext @ 0x7f85bbd17340] Statistics: 0 seeks, 1 writeouts
[NULL @ 0x7f85bc012600] Current profile doesn't provide more RBSP data in PPS, skipping
[AVIOContext @ 0x7f85bbc07300] Statistics: 0 seeks, 55 writeouts
[file @ 0x7f85bbc012a0] Setting default whitelist 'file,crypto'
[file @ 0x7f85bbd172a0] Setting default whitelist 'file,crypto'
[hls @ 0x7f85bc020400] EXT-X-MEDIA-SEQUENCE:1
[AVIOContext @ 0x7f85bbd1f660] Statistics: 0 seeks, 1 writeouts
[NULL @ 0x7f85bc012600] Current profile doesn't provide more RBSP data in PPS, skipping
[AVIOContext @ 0x7f85bbd17340] Statistics: 0 seeks, 55 writeouts
[file @ 0x7f85bbc01220] Setting default whitelist 'file,crypto'
[file @ 0x7f85bbc01280] Setting default whitelist 'file,crypto'
[hls @ 0x7f85bc020400] EXT-X-MEDIA-SEQUENCE:2
[AVIOContext @ 0x7f85bbd17340] Statistics: 0 seeks, 1 writeouts
[NULL @ 0x7f85bc012600] Current profile doesn't provide more RBSP data in PPS, skipping
[AVIOContext @ 0x7f85bbc026a0] Statistics: 0 seeks, 55 writeouts
[file @ 0x7f85bbd17280] Setting default whitelist 'file,crypto'
[file @ 0x7f85bbc02680] Setting default whitelist 'file,crypto'
[hls @ 0x7f85bc020400] EXT-X-MEDIA-SEQUENCE:3
[AVIOContext @ 0x7f85bbd1ff00] Statistics: 0 seeks, 1 writeouts
[NULL @ 0x7f85bc012600] Current profile doesn't provide more RBSP data in PPS, skipping
[AVIOContext @ 0x7f85bbc01220] Statistics: 0 seeks, 55 writeouts
[file @ 0x7f85bbd1f660] Setting default whitelist 'file,crypto'
[file @ 0x7f85bbc02680] Setting default whitelist 'file,crypto'
[hls @ 0x7f85bc020400] EXT-X-MEDIA-SEQUENCE:4
[AVIOContext @ 0x7f85bbd1ff00] Statistics: 0 seeks, 1 writeouts
[hls,applehttp @ 0x7f85bc800000] HLS request for url 'http://165735-i.akamaihd.net/hls/live/203451/msios_ch08/index_Layer4/8408_Period1/segment804.ts', offset 0, playlist 0
[http @ 0x7f85bbc01c20] request: GET /hls/live/203451/msios_ch08/index_Layer4/8408_Period1/segment804.ts HTTP/1.1
User-Agent: Lavf/57.25.100
Accept: */*
Connection: close
Host: 165735-i.akamaihd.net
Cookie: _alid_=7ur/2n1iG0P4AU8VNYm0kg==; unique_id=1463107936_92450278; hdntl=exp=1463194336~acl=%2f*%2f203451*~data=hdntl~hmac=31a8c6a328dc29d92a9c91d2656505b7f895872001b3e13513c294f8204f44e9
Icy-MetaData: 1


[mpegts @ 0x7f85bc804200] Continuity check failed for pid 0 expected 1 got 0
[mpegts @ 0x7f85bc804200] Continuity check failed for pid 32 expected 1 got 0
[NULL @ 0x7f85bc012600] Current profile doesn't provide more RBSP data in PPS, skipping
[AVIOContext @ 0x7f85bbc01220] Statistics: 0 seeks, 55 writeouts
[file @ 0x7f85bbd22ce0] Setting default whitelist 'file,crypto'
[file @ 0x7f85bbd17260] Setting default whitelist 'file,crypto'
[hls @ 0x7f85bc020400] EXT-X-MEDIA-SEQUENCE:5
[AVIOContext @ 0x7f85bbd1f660] Statistics: 0 seeks, 1 writeouts
[NULL @ 0x7f85bc012600] Current profile doesn't provide more RBSP data in PPS, skipping
[AVIOContext @ 0x7f85bbd17340] Statistics: 0 seeks, 55 writeouts
[file @ 0x7f85bbc026c0] Setting default whitelist 'file,crypto'
[file @ 0x7f85bbc012e0] Setting default whitelist 'file,crypto'
[hls @ 0x7f85bc020400] EXT-X-MEDIA-SEQUENCE:6
[AVIOContext @ 0x7f85bbc06f40] Statistics: 0 seeks, 1 writeouts
[NULL @ 0x7f85bc012600] Current profile doesn't provide more RBSP data in PPS, skipping
[AVIOContext @ 0x7f85bbc067e0] Statistics: 0 seeks, 55 writeouts
[file @ 0x7f85bbc067e0] Setting default whitelist 'file,crypto'
[file @ 0x7f85bbc06840] Setting default whitelist 'file,crypto'
[hls @ 0x7f85bc020400] EXT-X-MEDIA-SEQUENCE:7
[AVIOContext @ 0x7f85bbd17b80] Statistics: 0 seeks, 1 writeouts
[NULL @ 0x7f85bc012600] Current profile doesn't provide more RBSP data in PPS, skipping
[AVIOContext @ 0x7f85bbd17340] Statistics: 0 seeks, 55 writeouts
[file @ 0x7f85bbc070c0] Setting default whitelist 'file,crypto'
[file @ 0x7f85bbd22ce0] Setting default whitelist 'file,crypto'
[hls @ 0x7f85bc020400] EXT-X-MEDIA-SEQUENCE:8
[AVIOContext @ 0x7f85bbd18c00] Statistics: 0 seeks, 1 writeouts
[NULL @ 0x7f85bc012600] Current profile doesn't provide more RBSP data in PPS, skipping
[AVIOContext @ 0x7f85bbd17340] Statistics: 0 seeks, 55 writeouts
[file @ 0x7f85bbc078c0] Setting default whitelist 'file,crypto'
[file @ 0x7f85bbd22ce0] Setting default whitelist 'file,crypto'
[hls @ 0x7f85bc020400] EXT-X-MEDIA-SEQUENCE:9
[AVIOContext @ 0x7f85bbc070c0] Statistics: 0 seeks, 1 writeouts
[http @ 0x7f85bbd1f660] request: GET /hls/live/203451/msios_ch08/index_Layer4.m3u8?reportingKey=eventId-1129989_partnerId-3784&hdnea=st=1463107880~exp=1463107940~acl=/*/203451*~hmac=4396fade63fc4273051249d139454a873c5d99d267b32ac8c68477daae642856 HTTP/1.1
User-Agent: Lavf/57.25.100
Accept: */*
Connection: close
Host: 165735-i.akamaihd.net
Cookie: _alid_=7ur/2n1iG0P4AU8VNYm0kg==; unique_id=1463107936_92450278; hdntl=exp=1463194336~acl=%2f*%2f203451*~data=hdntl~hmac=31a8c6a328dc29d92a9c91d2656505b7f895872001b3e13513c294f8204f44e9
Icy-MetaData: 1


[http @ 0x7f85bbd1f660] HTTP error 403 Forbidden
[hls,applehttp @ 0x7f85bc800000] Failed to reload playlist 0
[http @ 0x7f85bbc01c20] request: GET /hls/live/203451/msios_ch08/index_Layer4.m3u8?reportingKey=eventId-1129989_partnerId-3784&hdnea=st=1463107880~exp=1463107940~acl=/*/203451*~hmac=4396fade63fc4273051249d139454a873c5d99d267b32ac8c68477daae642856 HTTP/1.1
User-Agent: Lavf/57.25.100
Accept: */*
Connection: close
Host: 165735-i.akamaihd.net
Cookie: _alid_=7ur/2n1iG0P4AU8VNYm0kg==; unique_id=1463107936_92450278; hdntl=exp=1463194336~acl=%2f*%2f203451*~data=hdntl~hmac=31a8c6a328dc29d92a9c91d2656505b7f895872001b3e13513c294f8204f44e9
Icy-MetaData: 1


[http @ 0x7f85bbc01c20] HTTP error 403 Forbidden
[hls,applehttp @ 0x7f85bc800000] Failed to reload playlist 0
No more output streams to write to, finishing.
[AVIOContext @ 0x7f85bbd17340] Statistics: 0 seeks, 55 writeouts
[file @ 0x7f85bbc02680] Setting default whitelist 'file,crypto'
[hls @ 0x7f85bc020400] EXT-X-MEDIA-SEQUENCE:10
[AVIOContext @ 0x7f85bbd17340] Statistics: 0 seeks, 1 writeouts
frame= 750 fps= 77 q=-1.0 Lsize=N/A time=00:00:30.07 bitrate=N/A speed=3.07x
video:295kB audio:176kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Input file #0 (http://165735-i.akamaihd.net/hls/live/203451/msios_ch08/index_Layer4.m3u8?reportingKey=eventId-1129989_partnerId-3784&hdnea=st=1463107880~exp=1463107940~acl=/*/203451*~hmac=4396fade63fc4273051249d139454a873c5d99d267b32ac8c68477daae642856):
Input stream #0:0 (video): 750 packets read (302400 bytes);
Input stream #0:1 (audio): 646 packets read (180001 bytes);
Total: 1396 packets (482401 bytes) demuxed
Output file #0 (test.m3u8):
Output stream #0:0 (video): 750 packets muxed (302400 bytes);
Output stream #0:1 (audio): 646 packets muxed (180001 bytes);
Total: 1396 packets (482401 bytes) muxed
0 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0x7f85bbc00e60] Statistics: 747 bytes read, 0 seeks





-- chovy


More information about the ffmpeg-user mailing list