Opened 19 months ago

#9913 new defect

HLS m3u8 segments are not URL encoded

Reported by: dbenesj Owned by:
Priority: normal Component: ffmpeg
Version: git-master Keywords: HLS hls m3u8
Cc: dbenesj Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

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:

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

Attachments (3)

list%20of%5Brec%5Dobjects.m3u8 (184 bytes ) - added by dbenesj 19 months ago.
list%20of%5Brec%5Dobjects_encoded.m3u8 (196 bytes ) - added by dbenesj 19 months ago.
list%20of%5Brec%5Dobjects.mp4 (953.7 KB ) - added by dbenesj 19 months ago.

Download all attachments as: .zip

Change History (3)

by dbenesj, 19 months ago

by dbenesj, 19 months ago

Note: See TracTickets for help on using tickets.