Opened 11 years ago

Closed 10 years ago

#2273 closed enhancement (fixed)

allow to set file name prefix for the segment names inside the generated m3u8 file

Reported by: mpapp Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: hls segment m3u8
Cc: daniele@orlandi.com Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: yes

Description (last modified by Stefano Sabatini)

Summary of the bug:

This is relevant when using segment option in ffmpeg
I cannot see such option
For vlc, there is an option
,index-url=http://37.188.125.31/demo/medium-########.ts}
which specifies in what format the filenames are saved inside the m3u8.

I am sorry if I missed it.

Change History (6)

in reply to:  description comment:1 by Stefano Sabatini, 11 years ago

Analyzed by developer: set
Component: FFmpegavformat
Keywords: segment m3u8 added
Reproduced by developer: set
Status: newopen
Type: defectenhancement
Version: unspecifiedgit-master

Replying to mpapp:

Summary of the bug:
How to reproduce:

This is relevant when using segment option in ffmpeg
I cannot see such option
For vlc, there is an option
,index-url=http://37.188.125.31/demo/medium-########.ts}
which specifies in what format the filenames are saved inside the m3u8.

Your request is not clear. I suppose you want an option like:

ffmpeg -i INPUT -f segment ... -segment_list out.m3u8 -segment_list_prefix "http://37.188.125.31/demo/" medium-%03d.ts 

Correct?

Or do you want the name in the M3U8 to be *different* from the segment filename (not only the prefix)?

Can you elaborate what this would be useful for?

I am sorry if I missed it.
}}}

comment:2 by mpapp, 11 years ago

yes, a -segment_list_prefix "http://37.188.125.31/demo/"
if that means this.e.g.

#EXTM3U
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:1
#EXTINF:10,
http://37.188.125.31/demo/demo-high-medium-00000001.ts
#EXTINF:10,
http://37.188.125.31/demo/demo-high-medium-00000002.ts
#EXTINF:10,
http://37.188.125.31/demo/demo-high-medium-00000003.ts
#EXTINF:10,
http://37.188.125.31/demo/demo-high-medium-00000004.ts
#EXTINF:10,
http://37.188.125.31/demo/demo-high-medium-00000005.ts
#EXTINF:10,
http://37.188.125.31/demo/demo-high-medium-00000006.ts
#EXTINF:10,
http://37.188.125.31/demo/demo-high-medium-00000007.ts
#EXT-X-ENDLIST

which would replace any directory prefix deduced from medium-%03d.ts

There is a practical reason , of course.
OK, supposed you want to generate m3u8 for web use.
Then the filenames inside in m3u8 should be referenced someone differently using http... way.
Some video players like it this way. (E.g. IPhone) So if you want to serve the net, you need this.

It would be useful not only for http requests but I want to use different way of referencing files.
E.g. if I use use full path e.g. /root/video/medium-%03d.ts, then the files will also contain /root/video... prefix as it is implemented right now.
-segment_list_prefix "" would remove those prefixes...

Last edited 11 years ago by mpapp (previous) (diff)

comment:3 by Carl Eugen Hoyos, 11 years ago

Priority: normalwish

comment:4 by Daniele Orlandi, 11 years ago

Cc: daniele@orlandi.com added

comment:5 by Carl Eugen Hoyos, 10 years ago

Keywords: hls added

comment:6 by Stefano Sabatini, 10 years ago

Description: modified (diff)
Priority: wishnormal
Resolution: fixed
Status: openclosed
Summary: no option to set file name format inside the generated m3u8 fileallow to set file name prefix for the segment names inside the generated m3u8 file

I believe this should be fixed in:

commit 5e278c19c752d65fdc1da1ceb599b091f71a4b4b
Author: Stefano Sabatini <stefasab@gmail.com>
Date:   Fri Nov 22 12:49:05 2013 +0100

    lavf/segment: add segment_list_entry_prefix option
    
    This option allows to add a prefix to the segment list entry filenames.
    
    Also set by default the list entry filenames to the corresponding
    segment basename, consistent with the HLS muxer.
    
    Based on an idea by Steven Liu <lingjiujianke@gmail.com>.

The new option allows to set the prefix to use for the playlist file.

Note: See TracTickets for help on using tickets.