[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:01:09 EET 2017


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


More information about the ffmpeg-user mailing list