Opened 8 years ago

Closed 4 years ago

#5578 closed defect (fixed)

Disabling Icy-Metadata header not working

Reported by: gorilla.maguila Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: http hls
Cc: epirat07@gmail.com Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Trying to use -icy 0 does not disable Icy-Metadata header:

ffplay -icy 0 -loglevel debug http://cdn.rasset.ie/hls-live/_definst_/rte2/rte2-720.m3u8
ffplay version N-80038-g7494b49 Copyright (c) 2003-2016 the FFmpeg developers
  built with gcc 6.1.1 (GCC) 20160501
  configuration: --prefix=/usr --disable-debug --disable-static --enable-avisynth --enable-avresample --enable-fontconfig --enable-gnutls --enable-gpl --enable-ladspa --enable-libass --enable-libbluray --enable-libfdk-aac --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-nonfree --enable-shared --enable-version3 --enable-x11grab
  libavutil      55. 24.100 / 55. 24.100
  libavcodec     57. 42.100 / 57. 42.100
  libavformat    57. 36.100 / 57. 36.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 46.100 /  6. 46.100
  libavresample   3.  0.  0 /  3.  0.  0
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
[http @ 0x7fb7b8007980] Setting default whitelist 'http,https,tls,rtp,tcp,udp,crypto,httpproxy'
[http @ 0x7fb7b8007980] request: GET /hls-live/_definst_/rte2/rte2-720.m3u8 HTTP/1.1                                                                                                                                                         
User-Agent: Lavf/57.36.100                                                                                                                                                                                                                   
Accept: */*                                                                                                                                                                                                                                  
Range: bytes=0-                                                                                                                                                                                                                              
Connection: close                                                                                                                                                                                                                            
Host: cdn.rasset.ie                                                                                                                                                                                                                          


[hls,applehttp @ 0x7fb7b8009240] Format hls,applehttp probed with size=2048 and score=100                                                                                                                                                    
[hls,applehttp @ 0x7fb7b8009240] HLS request for url 'http://cdn.rasset.ie/hls-live/streams/events/_definst_/rte2/rte2-720Num2370.ts', offset 0, playlist 0                                                                                  
[https @ 0x7fb7b800fd00] request: GET /hls-key/rte2.bin HTTP/1.10   
User-Agent: Lavf/57.36.100                                                                                                                                                                                                                   
Accept: */*                                                                                                                                                                                                                                  
Connection: close                                                                                                                                                                                                                            
Host: www.rte.ie                                                                                                                                                                                                                             
Icy-MetaData: 1                                                                                                                                                                                                                              


[AVIOContext @ 0x7fb7b8587580] Statistics: 16 bytes read, 0 seeks                                                                                                                                                                            
[http @ 0x7fb7b839d740] request: GET /hls-live/streams/events/_definst_/rte2/rte2-720Num2370.ts HTTP/1.1                                                                                                                                     
User-Agent: Lavf/57.36.100                                                                                                                                                                                                                   
Accept: */*                                                                                                                                                                                                                                  
Connection: close                                                                                                                                                                                                                            
Host: cdn.rasset.ie                                                                                                                                                                                                                          
Icy-MetaData: 1                                                     

Change History (7)

comment:1 by gorilla.maguila, 8 years ago

Component: undeterminedavformat
Keywords: http added
Version: unspecifiedgit-master

comment:2 by Nabi, 6 years ago

I have this problem.
Send first request without Icy-MetaData: 1 header, but in continue and other request again add this header.

comment:3 by Nabi, 6 years ago

I commented this lines and recompile it and solved my problem temporary:

    if (!has_header(s->headers, "\r\nIcy-MetaData: ") && s->icy)
        len += av_strlcatf(headers + len, sizeof(headers) - len,
                           "Icy-MetaData: %d\r\n", 1);

https://github.com/FFmpeg/FFmpeg/blob/2477bfe22121f04eff9e4ba2475f1f999c17ea36/libavformat/http.c#L1246,L1247,L1248

comment:4 by Magnus Sjöberg, 5 years ago

I can confirm that "-icy 0" only works for the initial http request made by ffmpeg.
For all subsequent (internal) requests, to get the index files and segments, the "Icy-MetaData: 1" header is added again.

I didn't manage to follow the source code but it seems like the problem is that 's->icy' in the code block in the comment from @NabiKAZ isn't copied/propagated from the command line option to subsequent requests. Since the 'icy' parameter defaults to 1, each request made from within ffmpeg most likely will be constructed with 's->icy = 1'

I do apologize for the non-technical comment but unfortunately I don't have the knowledge or experience to be able to point out the exact error, or come up with a solution.

Last edited 5 years ago by Magnus Sjöberg (previous) (diff)

comment:5 by Carl Eugen Hoyos, 4 years ago

Keywords: hls added

comment:6 by ePirat, 4 years ago

Cc: epirat07@gmail.com added

comment:7 by Carl Eugen Hoyos, 4 years ago

Resolution: fixed
Status: newclosed

Fixed by Marvin Scholz in c3bb6efef285adb8ca06278df15473f3c4d5aec5

Note: See TracTickets for help on using tickets.