[FFmpeg-devel] [PATCH] add use_localtime option with hlsenc for expand segment filename with localtime

Michael Niedermayer michaelni at gmx.at
Wed Sep 2 04:33:17 CEST 2015


On Tue, Sep 01, 2015 at 04:26:01AM +0800, Steven Liu wrote:
> When use %s parameter for the segment filename, it will get error message
> with Invalid
> segment filename template, so add the use_localtime option fix it, the
> default value is
> 14xxxxxxxx for the segment filename.
> 
> the test example:
> 
> ./ffmpeg -re -i ~/Movies/objectC/facebook.mp4 -v verbose -c copy -f hls
> -hls_segment_filename test-%s.ts -use_localtime 1 -bsf:v h264_mp4toannexb
> aaa.m3u8
> 
> [StevenLiu at localhost ffmpeg]$ cat aaa.m3u8;ll test-*.ts
> #EXTM3U
> #EXT-X-VERSION:3
> #EXT-X-TARGETDURATION:10
> #EXT-X-MEDIA-SEQUENCE:1
> #EXTINF:10.000000,
> test-1441052221.ts
> #EXTINF:3.240000,
> test-1441052231.ts
> #EXTINF:8.400000,
> test-1441052235.ts
> #EXTINF:5.480000,
> test-1441052243.ts
> #EXTINF:3.960000,
> test-1441052249.ts
> #EXT-X-ENDLIST
> -rw-r--r--  1 StevenLiu  staff  1310736  9  1 04:15 test-1441052131.ts
> -rw-r--r--  1 StevenLiu  staff   495192  9  1 04:15 test-1441052141.ts
> -rw-r--r--  1 StevenLiu  staff  1310736  9  1 04:17 test-1441052212.ts
> -rw-r--r--  1 StevenLiu  staff  1067840  9  1 04:17 test-1441052221.ts
> -rw-r--r--  1 StevenLiu  staff   235564  9  1 04:17 test-1441052231.ts
> -rw-r--r--  1 StevenLiu  staff  1187220  9  1 04:17 test-1441052235.ts
> -rw-r--r--  1 StevenLiu  staff   694848  9  1 04:17 test-1441052243.ts
> -rw-r--r--  1 StevenLiu  staff   526588  9  1 04:17 test-1441052249.ts
> [StevenLiu at localhost ffmpeg]$
> 
> ./ffmpeg -re -i ~/Movies/objectC/facebook.mp4 -v verbose -c copy -f hls
> -hls_segment_filename test-%s.ts -use_localtime 1 -bsf:v h264_mp4toannexb
> aaa.m3u8
> 
> [StevenLiu at localhost ffmpeg]$ cat aaa.m3u8;ll aaa-*.ts
> #EXTM3U
> #EXT-X-VERSION:3
> #EXT-X-TARGETDURATION:10
> #EXT-X-MEDIA-SEQUENCE:0
> #EXTINF:10.000000,
> aaa-1441052417.ts
> #EXTINF:10.000000,
> aaa-1441052427.ts
> #EXTINF:3.240000,
> aaa-1441052437.ts
> #EXTINF:8.400000,
> aaa-1441052440.ts
> #EXTINF:2.360000,
> aaa-1441052449.ts
> #EXT-X-ENDLIST
> -rw-r--r--  1 StevenLiu  staff  1310736  9  1 04:19 aaa-1441052382.ts
> -rw-r--r--  1 StevenLiu  staff   277300  9  1 04:19 aaa-1441052392.ts
> -rw-r--r--  1 StevenLiu  staff  1310736  9  1 04:20 aaa-1441052417.ts
> -rw-r--r--  1 StevenLiu  staff  1067840  9  1 04:20 aaa-1441052427.ts
> -rw-r--r--  1 StevenLiu  staff   235564  9  1 04:20 aaa-1441052437.ts
> -rw-r--r--  1 StevenLiu  staff  1187220  9  1 04:20 aaa-1441052440.ts
> -rw-r--r--  1 StevenLiu  staff   338776  9  1 04:20 aaa-1441052449.ts
> [StevenLiu at localhost ffmpeg]$
> 
> 
> Signed-off-by: LiuQi <liuqi at gosun.com>
> ---
>  libavformat/hlsenc.c | 28 ++++++++++++++++++++++++----
>  1 file changed, 24 insertions(+), 4 deletions(-)

applied

thanks

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Old school: Use the lowest level language in which you can solve the problem
            conveniently.
New school: Use the highest level language in which the latest supercomputer
            can solve the problem without the user falling asleep waiting.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150902/d5d1d24a/attachment.sig>


More information about the ffmpeg-devel mailing list