[FFmpeg-trac] #5295(avformat:new): Unusual bug when file name starts with leading %20

FFmpeg trac at avcodec.org
Sun Mar 6 19:01:05 CET 2016


#5295: Unusual bug when file name starts with leading %20
-------------------------------------+-------------------------------------
             Reporter:  rjmoses      |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:  avformat     |                  Version:  2.7.3
             Keywords:  Leading      |               Blocked By:
  space file name                    |  Reproduced by developer:  0
             Blocking:               |
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 I think I have discovered an unusual bug when trying to download a video
 file that is an m3u8 file and the file name contains a leading space
 encoded as a %20.

 Short form of the problem.

 1) File is
 "http://d3fk8fzsguno39.cloudfront.net/Directory/%20VideoFile.m3u8"

 2) Amazon cloud server returns header frame with resolution info in which
 the segment name is :   #EXT-X-STREAM-INF..."(space)HLS_640).m3u8
 HTTP/1.1"

 3) ffmpeg formats the segment request list as : "GET
 /Directory/(space)HLS_640).m3u8".

 4) Amazon cloud server returns "HTTP/1.1 400 Bad request  (text/html)" and
 closes connection.

 I believe the problem is that the GET request should be "%20" instead of
 (space).

 I have trace other applications (specifically Flash Player) on a windows 7
 system and have found that that is what is being sent.

 I have looked at the ffmpeg code and I think (may be wrong) that problem
 is in the parse_playlist() function and the way it works with the function
 ff_make_absolute_url().  Without more research, I am not sure how to fix
 this particular issue.

 Command line:
 ffmpeg  http://d3fk8fzsguno39.cloudfront.net/Directory/%20FileName.m3u8
 -vcodec copy -acodec copy -absf aac_adtstoasc "OutputFile.mp4"

 For security reasons, I cannot provide the actual file names until I am
 sure that I am on the correct line of thought.  I can then provide actual
 test cases and wireshark traces of both working and failing situations in
 private conversations.

 linux ffmpeg version info (7.3.0+git+trusty):

 ffmpeg version N-78590-g5590ab4 Copyright (c) 2000-2016 the FFmpeg
 developers
   built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.1)
   configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg
 --mandir=/usr/share/man --enable-avresample --disable-debug --enable-
 nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb
 --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb
 --enable-libpulse --enable-libfreetype --enable-gnutls --enable-libx264
 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-
 libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-
 libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-
 libvidstab
   libavutil      55. 18.100 / 55. 18.100
   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
   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

 Note: ffmpeg works satisfactorily if a %20 is embedded in the file name
 (e.g., "File%20Name").

 Thanks

 Ralph

--
Ticket URL: <https://trac.ffmpeg.org/ticket/5295>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list