#5839: [feature request] [hls] hls_flags to limit single_file size -------------------------------------+------------------------------------- Reporter: ARQfBfnD | Type: Status: new | enhancement Component: avformat | Priority: normal Keywords: hls, | Version: single_file, x-byterange | unspecified Blocking: | Blocked By: Analyzed by developer: 0 | Reproduced by developer: 0 -------------------------------------+------------------------------------- The HLS spec[1] allows for a segment to be defined as an offset into a resource. These resources don't have to be a single file.
Currently, the ffmpeg hls format will only write all segments into one single file with -hls_flags single_file `ffmpeg -i in.mp4 -f hls -hls_time 6 -hls_list_size 0 -hls_flags single_file out.m3u8` This results in very large files which may be undesirable. I'm suggesting another hls_flag, "single_file_max_size". When reaching this limit, the output segments would go into a new file. `ffmpeg -i in.mp4 -f hls -hls_time 6 -hls_list_size 0 -hls_flags single_file -hls_flags single_file_max_size 100M out.m3u8` would result in: * 10k out.m3u8 * 100M out0.ts * 100M out1.ts * 50M out2.ts [1] https://tools.ietf.org/html/draft-pantos-http-live- streaming-19#section-4.3.2.2 Tested on ffmpeg version 3.1.3 Copyright (c) 2000-2016 the FFmpeg developers built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.2) 20160609 configuration: --prefix=/usr/local --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib --bindir=/usr/local/bin --disable-doc --extra-libs=-ldl --enable-version3 --enable-libfaac --enable-libfdk_aac --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-gpl --enable-avresample --enable-postproc --enable-nonfree --disable-debug --enable-small --enable-openssl libavutil 55. 28.100 / 55. 28.100 libavcodec 57. 48.101 / 57. 48.101 libavformat 57. 41.100 / 57. 41.100 libavdevice 57. 0.101 / 57. 0.101 libavfilter 6. 47.100 / 6. 47.100 libavresample 3. 0. 0 / 3. 0. 0 libswscale 4. 1.100 / 4. 1.100 libswresample 2. 1.100 / 2. 1.100 libpostproc 54. 0.100 / 54. 0.100 -- Ticket URL: <https://trac.ffmpeg.org/ticket/5839> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker _______________________________________________ FFmpeg-trac mailing list FFmpeg-trac@avcodec.org http://ffmpeg.org/mailman/listinfo/ffmpeg-trac