Opened 3 years ago

Last modified 2 weeks ago

#5578 new defect

Disabling Icy-Metadata header not working

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


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

ffplay -icy 0 -loglevel debug
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                                                                                                                                                                                                                            

[hls,applehttp @ 0x7fb7b8009240] Format hls,applehttp probed with size=2048 and score=100                                                                                                                                                    
[hls,applehttp @ 0x7fb7b8009240] HLS request for url '', offset 0, playlist 0                                                                                  
[https @ 0x7fb7b800fd00] request: GET /hls-key/rte2.bin HTTP/1.10   
User-Agent: Lavf/57.36.100                                                                                                                                                                                                                   
Accept: */*                                                                                                                                                                                                                                  
Connection: close                                                                                                                                                                                                                            
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                                                                                                                                                                                                                            
Icy-MetaData: 1                                                     

Change History (4)

comment:1 Changed 3 years ago by gorilla.maguila

  • Component changed from undetermined to avformat
  • Keywords http added
  • Version changed from unspecified to git-master

comment:2 Changed 15 months ago by NabiKAZ

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

comment:3 Changed 15 months ago by NabiKAZ

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);,L1247,L1248

comment:4 Changed 2 weeks ago by magnuslsjoberg

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 2 weeks ago by magnuslsjoberg (previous) (diff)
Note: See TracTickets for help on using tickets.