[FFmpeg-trac] #9913(ffmpeg:new): HLS m3u8 segments are not URL encoded

FFmpeg trac at avcodec.org
Thu Sep 8 13:50:11 EEST 2022


#9913: HLS m3u8 segments are not URL encoded
-------------------------------------+-------------------------------------
             Reporter:  dbenesj      |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:  ffmpeg       |                  Version:  git-
             Keywords:  HLS hls      |  master
  m3u8                               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 When HLS m3u8 playlist is generated with file name that contains % in it's
 name, segments in resulting m3u8 file are not URL encoded.
 As I understood the specification of m3u8 file, it needs to be URI  and
 that means it needs to be URL encoded:
 * https://datatracker.ietf.org/doc/html/rfc8216#section-3 first paragraph
 * https://datatracker.ietf.org/doc/html/draft-pantos-hls-
 rfc8216bis#section-3 first paragraph
 When trying to use generated m3u8 file (without URL encoded segment URIs)
 it can't be played at least in VLC and video.js.
 When content of the m3u8 file is manualy changed to URL encode percent
 sign, it can be played by both mentioned players.

 The segment line as it is generated by the ffmpeg:
 {{{
 list%20of%5Brec%5Dobjects0.ts
 }}}
 The segmeng line how it work in players (manual modification):
 {{{
 list%2520of%255Brec%255Dobjects0.ts
 }}}

 How to reproduce:
 {{{
 % ffmpeg -i "list%20of%5Brec%5Dobjects.mp4" -f hls -codec:v copy
 "list%20of%5Brec%5Dobjects.m3u8"
 ffmpeg version 5.1.1-essentials_build-www.gyan.dev Copyright (c) 2000-2022
 the FFmpeg developers
   built with gcc 12.1.0 (Rev2, Built by MSYS2 project)
 }}}
 {{{
 % ffmpeg -i "list%20of%5Brec%5Dobjects.mp4" -f hls -codec:v copy
 "list%20of%5Brec%5Dobjects.m3u8"
 ffmpeg version 2022-09-05-git-2ed5925e26-essentials_build-www.gyan.dev
 Copyright (c) 2000-2022 the FFmpeg developers
   built with gcc 12.1.0 (Rev2, Built by MSYS2 project)
 }}}
 {{{
 % ffmpeg -i "list%20of%5Brec%5Dobjects.mp4" -f hls -codec:v copy
 "list%20of%5Brec%5Dobjects.m3u8"
 ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
   built with gcc 10.2.1 (GCC) 20200726
 }}}

 It behaves the same with version 5.1.1, build from current (2022-09-05)
 master and 4.3.1
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/9913>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list