• LiuQi's avatar
    avformat/hlsenc: add a use_localtime option to expand the segment filename with localtime · a4055d3e
    LiuQi authored
    test examples:
    
    ./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@localhost ffmpeg]$ cat aaa.m3u8;ll test-*.ts
    test-1441052221.ts
    test-1441052231.ts
    test-1441052235.ts
    test-1441052243.ts
    test-1441052249.ts
    -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@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@localhost ffmpeg]$ cat aaa.m3u8;ll aaa-*.ts
    aaa-1441052417.ts
    aaa-1441052427.ts
    aaa-1441052437.ts
    aaa-1441052440.ts
    aaa-1441052449.ts
    -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@localhost ffmpeg]$
    Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
    a4055d3e
hlsenc.c 29 KB