From patchwork Tue Jan 3 08:38:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bodecs Bela X-Patchwork-Id: 2032 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp4273695vsb; Tue, 3 Jan 2017 00:38:33 -0800 (PST) X-Received: by 10.194.201.103 with SMTP id jz7mr47448215wjc.53.1483432713136; Tue, 03 Jan 2017 00:38:33 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id f81si72605071wmd.138.2017.01.03.00.38.32; Tue, 03 Jan 2017 00:38:33 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 21DF4680872; Tue, 3 Jan 2017 10:38:25 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail.vivacom.hu (mail.vivacom.hu [217.173.41.231]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5351868045B for ; Tue, 3 Jan 2017 10:38:18 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by mail.vivacom.hu (Postfix) with ESMTP id B310F875EF for ; Tue, 3 Jan 2017 09:38:22 +0100 (CET) X-Virus-Scanned: amavisd-new at example.com Received: from mail.vivacom.hu ([127.0.0.1]) by localhost (mail.vivacom.intra [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ShfTsnIgIC_g for ; Tue, 3 Jan 2017 09:38:20 +0100 (CET) Received: from [192.168.100.137] (mail.officeline.hu [217.173.32.91]) by mail.vivacom.hu (Postfix) with ESMTPA id E048282FDD for ; Tue, 3 Jan 2017 09:38:18 +0100 (CET) References: <211d6df8-d1d0-35a7-d493-648c65ec39b1@vivanet.hu> To: FFmpeg development discussions and patches From: Bodecs Bela Message-ID: <122f7c46-0416-2c98-0277-76fff89e98d5@vivanet.hu> Date: Tue, 3 Jan 2017 09:38:18 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: actual segment file size and duration in segment filenames X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" 2017.01.03. 1:22 keltezéssel, Steven Liu írta: > 2017-01-03 2:58 GMT+08:00 Bodecs Bela : > >> Dear All, >> >> this patch makes it possible to put actual segment file size (measured >> in bytes) and/or duration (calculated in microseconds) into segment >> filenames. This feature is useful when post-processing live streaming >> access log files. New behaviour works only when -use_localtime option >> is set and second_level_segment_size or/and >> second_level_segment_duration new hls_flags are specified. %%s is the >> placeholder for size and %%t for duration in hls_segment_filename >> option. Fix sized trailing zeropadding also works eg. %%09s or %%023t. >> >> A command to test new features: >> ./ffmpeg -loglevel info -y -f lavfi -i color=c=red:size=640x480:r=25 -f >> lavfi -i sine=f=440:b=4:r=44100 -c:v mpeg2video -g 25 -acodec aac >> -cutoff 20000 -ac 2 -ar 44100 -ab 192k -f hls -hls_time 3 -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 >> "segment_%Y%m%d%H%M%S_%%04d_%%08s_%%013t.ts" stream.m3u8 >> >> this will produce segments like this: >> segment_20170102194334_0003_00122200_0000003000000.ts >> segment_20170102194334_0004_00120072_0000003000000.ts >> etc. >> >> >> thank you in advance, >> >> Bela Bodecs >> >> _______________________________________________ >> ffmpeg-devel mailing list >> ffmpeg-devel@ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel >> >> > you should add document for the new option. I have enclosed it. > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel From 83346eaedb3d4be2ec0494ffd6f49244bf44c920 Mon Sep 17 00:00:00 2001 From: Bela Bodecs Date: Tue, 3 Jan 2017 09:34:38 +0100 Subject: [PATCH] doc/muxers: hls second_level_segment_duration, second_level_segment_size Documentation of new feature of hlsenc to include segment size and duration in their name. Signed-off-by: Bela Bodecs --- doc/muxers.texi | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/doc/muxers.texi b/doc/muxers.texi index 018f289..b97e9f9 100644 --- a/doc/muxers.texi +++ b/doc/muxers.texi @@ -584,7 +584,24 @@ seeking. This flag should be used with the @code{hls_time} option. Generate @code{EXT-X-PROGRAM-DATE-TIME} tags. @item second_level_segment_index -Makes it possible to use segment indexes as %%d besides date/time values when use_localtime is on. +Makes it possible to use segment indexes as %%d in hls_segment_filename expression besides date/time values when use_localtime is on. To get fixed width numbers with trailing zeroes, %%0xd format is available where x is the required width. + +@item second_level_segment_size +Makes it possible to use segment sizes (counted in bytes) as %%s in hls_segment_filename expression besides date/time values when use_localtime is on. To get fixed width numbers with trailing zeroes, %%0xs format is available where x is the required width. + +@item second_level_segment_duration +Makes it possible to use segment duration (calculated in microseconds) as %%t in hls_segment_filename expression besides date/time values when use_localtime is on. To get fixed width numbers with trailing zeroes, %%0xt format is available where x is the required width. + +@example +./ffmpeg -loglevel info -y -f lavfi -i color=c=red:size=640x480:r=25 \ + -f lavfi -i sine=f=440:b=4:r=44100 -c:v mpeg2video -g 25 -acodec aac -cutoff 20000 -ac 2 -ar 44100 -ab 192k \ + -f hls -hls_time 3 -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 "segment_%Y%m%d%H%M%S_%%04d_%%08s_%%013t.ts" stream.m3u8 +@end example +This will produce segments like this: +@file{segment_20170102194334_0003_00122200_0000003000000.ts}, @file{segment_20170102194334_0004_00120072_0000003000000.ts} etc. + @end table -- 2.5.3.windows.1