[FFmpeg-user] issue with [PATCH] avformat/hlsenc: actual segment file size and duration in segment filenames

Steven Liu lingjiujianke at gmail.com
Tue Jan 10 23:09:13 EET 2017


2017-01-11 5:01 GMT+08:00 Steven Liu <lingjiujianke at gmail.com>:

>
>
> 2017-01-11 2:42 GMT+08:00 Christian Johannesen <chrisjohannesen at gmail.com>
> :
>
>> I tested new functionality that was recently added to FFMPEG to include
>> the
>> segment size in bytes and segment duration in the filename. I tried
>> re-multiplexing a MP4 with H.264 video and AAC audio into HLS with this
>> feature, but only the last HLS segment has this data, all other ts
>> segments
>> contained zero data.
>>
>> >ffmpeg.exe -i D:\media\mix_of_clip_960x540_2128.mp4 -codec copy -f hls
>> -hls_time 6 -hls_list_size 5 -hls_flags
>> second_level_segment_index+second_level_segment_size+second_
>> level_segment_duration
>> -use_localtime 1 -use_localtime_mkdir 1 -hls_segment_filename
>> "D:\media\mix_of_clip_960x540_2128\segment_%%04d_%%08s_%%013t.ts"
>> D:\media\mix_of_clip_960x540_2128\index.m3u8
>> ffmpeg version N-83034-gf48b6b8 Copyright (c) 2000-2017 the FFmpeg
>> developers
>>   built with gcc 5.4.0 (GCC)
>>   configuration: --enable-gpl --enable-version3 --enable-dxva2
>> --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib
>> --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv
>> --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca
>> --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc
>> --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb
>> --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg
>> --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr
>> --enable-libspeex --enable-libtheora --enable-libtwolame
>> --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis
>> --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264
>> --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg
>> --enable-lzma --enable-decklink --enable-zlib
>>   libavutil      55. 43.100 / 55. 43.100
>>   libavcodec     57. 71.100 / 57. 71.100
>>   libavformat    57. 62.100 / 57. 62.100
>>   libavdevice    57.  2.100 / 57.  2.100
>>   libavfilter     6. 68.100 /  6. 68.100
>>   libswscale      4.  3.101 /  4.  3.101
>>   libswresample   2.  4.100 /  2.  4.100
>>   libpostproc    54.  2.100 / 54.  2.100
>> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
>> 'D:\media\mix_of_clip_960x540_2128.mp4':
>>   Metadata:
>>     major_brand     : isom
>>     minor_version   : 512
>>     compatible_brands: isomiso2avc1mp41
>>     encoder         : Lavf57.11.100
>>   Duration: 00:12:00.68, start: 0.000000, bitrate: 1248 kb/s
>>     Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv,
>> bt709), 960x540 [SAR 1:1 DAR 16:9], 1115 kb/s, 23.98 fps, 23.98 tbr, 24k
>> tbn, 47.95 tbc (default)
>>     Metadata:
>>       handler_name    : VideoHandler
>>     Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
>> stereo, fltp, 128 kb/s (default)
>>     Metadata:
>>       handler_name    : SoundHandler
>> Output #0, hls, to 'D:\media\mix_of_clip_960x540_2128\index.m3u8':
>>   Metadata:
>>     major_brand     : isom
>>     minor_version   : 512
>>     compatible_brands: isomiso2avc1mp41
>>     encoder         : Lavf57.62.100
>>     Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv,
>> bt709), 960x540 [SAR 1:1 DAR 16:9], q=2-31, 1115 kb/s, 23.98 fps, 23.98
>> tbr, 90k tbn, 23.98 tbc (default)
>>     Metadata:
>>       handler_name    : VideoHandler
>>     Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
>> stereo, fltp, 128 kb/s (default)
>>     Metadata:
>>       handler_name    : SoundHandler
>> Stream mapping:
>>   Stream #0:0 -> #0:0 (copy)
>>   Stream #0:1 -> #0:1 (copy)
>> Press [q] to stop, [?] for help
>> frame=17278 fps=16424 q=-1.0 Lsize=N/A time=00:12:00.61 bitrate=N/A speed=
>> 685x
>> video:98101kB audio:11261kB subtitle:0kB other streams:0kB global
>> headers:0kB muxing overhead: unknown
>>
>> First segment name: segment_0000_00000000_0000000000000.ts
>>
>> Second to last: segment_0118_00000000_0000000000000.ts
>>
>> Last segment name: segment_0119_00514368_0000005880878.ts
>>
>> Thanks,
>> Chris
>> _______________________________________________
>> ffmpeg-user mailing list
>> ffmpeg-user at ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>
>> To unsubscribe, visit link above, or email
>> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
>
>
>
> add -re , try it like this:
>
> ffmpeg.exe -re -i D:\media\mix_of_clip_960x540_2128.mp4 -codec copy -f hls
> -hls_time 6 -hls_list_size 5 -hls_flags
> second_level_segment_index+second_level_segment_size+second_
> level_segment_duration
> -use_localtime 1 -use_localtime_mkdir 1 -hls_segment_filename
> "D:\media\mix_of_clip_960x540_2128\segment_%%04d_%%08s_%%013t.ts"
> D:\media\mix_of_clip_960x540_2128\index.m3u8
>



localhost:hlsenc StevenLiu$ ./ffmpeg -i ~/Movies/objectC/facebook.mp4 -c
copy -f hls -hls_time 6 -hls_list_size 0 -hls_flags
second_level_segment_index+second_level_segment_size+second_level_segment_duration
-use_localtime 1 -use_localtime_mkdir 1 -hls_segment_filename
mix_of_clip_960x540_2128/segment_%%04d_%%08s_%%013t.ts
mix_of_clip_960x540_2128/index.m3u8

ffmpeg version N-83037-gdaff04b Copyright (c) 2000-2017 the FFmpeg
developers

  built with Apple LLVM version 8.0.0 (clang-800.0.42.1)

  configuration: --enable-libass --enable-opengl --enable-libx264
--enable-libmp3lame --enable-gpl --enable-nonfree --prefix=/usr/local
--enable-libopencv --enable-libtesseract --enable-libspeex
--enable-libfreetype --enable-libfontconfig --enable-libfdk-aac

  libavutil      55. 43.100 / 55. 43.100

  libavcodec     57. 71.100 / 57. 71.100

  libavformat    57. 62.100 / 57. 62.100

  libavdevice    57.  2.100 / 57.  2.100

  libavfilter     6. 68.100 /  6. 68.100

  libswscale      4.  3.101 /  4.  3.101

  libswresample   2.  4.100 /  2.  4.100

  libpostproc    54.  2.100 / 54.  2.100

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
'/Users/StevenLiu/Movies/objectC/facebook.mp4':

  Metadata:

    major_brand     : isom

    minor_version   : 512

    compatible_brands: isomiso2avc1mp41

    encoder         : Lavf55.22.102

    description     : This File is Created by Easy RealMedia Tools@!

  Duration: 02:00:27.85, start: 0.000000, bitrate: 893 kb/s

    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
640x480, 797 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)

    Metadata:

      handler_name    : VideoHandler

    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz,
stereo, fltp, 87 kb/s (default)

    Metadata:

      handler_name    : SoundHandler

Output #0, hls, to 'mix_of_clip_960x540_2128/index.m3u8':

  Metadata:

    major_brand     : isom

    minor_version   : 512

    compatible_brands: isomiso2avc1mp41

    description     : This File is Created by Easy RealMedia Tools@!

    encoder         : Lavf57.62.100

    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
640x480, q=2-31, 797 kb/s, 25 fps, 25 tbr, 90k tbn, 25 tbc (default)

    Metadata:

      handler_name    : VideoHandler

    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz,
stereo, fltp, 87 kb/s (default)

    Metadata:

      handler_name    : SoundHandler

Stream mapping:

  Stream #0:0 -> #0:0 (copy)

  Stream #0:1 -> #0:1 (copy)

Press [q] to stop, [?] for help

[hls @ 0x7fe872800600] hls->dpp = [0.040000]

frame=180676 fps=12011 q=-1.0 Lsize=N/A time=02:00:27.86 bitrate=N/A speed=
481x

video:703382kB audio:77627kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: unknown

localhost:hlsenc StevenLiu$

localhost:hlsenc StevenLiu$ tail -n 10 mix_of_clip_960x540_2128/index.m3u8

mix_of_clip_960x540_2128/segment_1169_01058628_0000010000000.ts

#EXTINF:10.000000,

mix_of_clip_960x540_2128/segment_1170_00708572_0000010000000.ts

#EXTINF:10.000000,

mix_of_clip_960x540_2128/segment_1171_00373932_0000010000000.ts

#EXTINF:10.000000,

mix_of_clip_960x540_2128/segment_1172_00416044_0000010000000.ts

#EXTINF:2.680000,

mix_of_clip_960x540_2128/segment_1173_00084412_0000002680000.ts

#EXT-X-ENDLIST

localhost:hlsenc StevenLiu$ ll mix_of_clip_960x540_2128/segment_11

segment_1100_00637508_0000007800000.ts
segment_1115_00824944_0000009440000.ts
segment_1130_00180480_0000001800000.ts
segment_1145_01470536_0000010000000.ts
segment_1160_01334236_0000010000000.ts

segment_1101_00180292_0000001800000.ts
segment_1116_00583176_0000006000000.ts
segment_1131_00252672_0000004080000.ts
segment_1146_01209216_0000010000000.ts
segment_1161_01239672_0000010000000.ts

segment_1102_00864612_0000008320000.ts
segment_1117_00526024_0000006760000.ts
segment_1132_00438604_0000004920000.ts
segment_1147_01256404_0000010000000.ts
segment_1162_00945640_0000010000000.ts

segment_1103_00510232_0000006960000.ts
segment_1118_00309636_0000002960000.ts
segment_1133_00437852_0000004440000.ts
segment_1148_01217300_0000010000000.ts
segment_1163_00727936_0000010000000.ts

segment_1104_00712520_0000008560000.ts
segment_1119_01722644_0000010000000.ts
segment_1134_00699548_0000005000000.ts
segment_1149_00801444_0000010000000.ts
segment_1164_02428208_0000010000000.ts

segment_1105_00204544_0000002800000.ts
segment_1120_00231428_0000001080000.ts
segment_1135_00741096_0000004400000.ts
segment_1150_01226888_0000010000000.ts
segment_1165_02623352_0000010000000.ts

segment_1106_00150400_0000001960000.ts
segment_1121_00234436_0000001800000.ts
segment_1136_01119728_0000010000000.ts
segment_1151_01442524_0000010000000.ts
segment_1166_01087580_0000010000000.ts

segment_1107_00863860_0000010000000.ts
segment_1122_00375248_0000003240000.ts
segment_1137_01110328_0000010000000.ts
segment_1152_01612100_0000010000000.ts
segment_1167_01072352_0000010000000.ts

segment_1108_00708384_0000008760000.ts
segment_1123_00371864_0000003600000.ts
segment_1138_00172396_0000001520000.ts
segment_1153_01402856_0000010000000.ts
segment_1168_00932104_0000010000000.ts

segment_1109_00766664_0000010000000.ts
segment_1124_00820620_0000005360000.ts
segment_1139_00995460_0000005360000.ts
segment_1154_01491592_0000010000000.ts
segment_1169_01058628_0000010000000.ts

segment_1110_00153972_0000001600000.ts
segment_1125_00829644_0000010000000.ts
segment_1140_01167856_0000010000000.ts
segment_1155_01200568_0000010000000.ts
segment_1170_00708572_0000010000000.ts

segment_1111_00513052_0000006880000.ts
segment_1126_00208492_0000002000000.ts
segment_1141_01134392_0000010000000.ts
segment_1156_01285356_0000010000000.ts
segment_1171_00373932_0000010000000.ts

segment_1112_00918380_0000010000000.ts
segment_1127_00219020_0000001480000.ts
segment_1142_01278024_0000005600000.ts
segment_1157_01114652_0000010000000.ts
segment_1172_00416044_0000010000000.ts

segment_1113_00828892_0000010000000.ts
segment_1128_00264328_0000002600000.ts
segment_1143_00881908_0000009760000.ts
segment_1158_01406804_0000010000000.ts
segment_1173_00084412_0000002680000.ts

segment_1114_00841488_0000008920000.ts
segment_1129_00656308_0000007560000.ts
segment_1144_00753692_0000010000000.ts
segment_1159_01519792_0000010000000.ts

localhost:hlsenc StevenLiu$ ll mix_of_clip_960x540_2128/segment_11








Can you upload your mp4 file?


More information about the ffmpeg-user mailing list