From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 87FBC45D50 for ; Fri, 7 Apr 2023 07:50:19 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2313F68AC10; Fri, 7 Apr 2023 10:50:17 +0300 (EEST) Received: from mail-yb1-f182.google.com (mail-yb1-f182.google.com [209.85.219.182]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EF31968057F for ; Fri, 7 Apr 2023 10:50:10 +0300 (EEST) Received: by mail-yb1-f182.google.com with SMTP id i20so1744829ybg.10 for ; Fri, 07 Apr 2023 00:50:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=davyandbeth-com.20210112.gappssmtp.com; s=20210112; t=1680853809; h=content-transfer-encoding:content-language:to:subject:from :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=hYZ2bmJkpYYtjXYX5jfGvZjlb2CJp1cTpPW5cBaQtCs=; b=s49y5mA3W3T4MFRwpo71QLGDfcCVdVMLJBo8r5xmcBjMTdJAl2LCbJy4P+RKxE2SV0 RiOMLp2aa/IzmOjMpLlc/vqZC2AtwtyLaq+QnzNrWeD9WpPVuvyj4Llhe/pUg2sxbMm5 0rak5LLUI0+mYCGM9REVvLhJA6lPhPEccbetXVOnNq0AB9unWGn4Ihlm9VpBtqVx+9Fe S6FIrOxumPo/qoRkJ5Rb+ICa2RYlpvdmk3lD/oLhapMmdMKCPR4SjZnxsNBzxOlJFYSP bF2VD0S6SPCicKLV+SzA9W1ROHbm9EdMRcMC/ulM/3mWkgg5tdQgAE4N4+/wZZykLX5H Rajg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680853809; h=content-transfer-encoding:content-language:to:subject:from :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=hYZ2bmJkpYYtjXYX5jfGvZjlb2CJp1cTpPW5cBaQtCs=; b=Jg34Qf09c94YUqi/M9KEZBGmg/XBsr7UQRLcs3NLPHY8ivK54WsEntmwTpGdJdOJbZ oeMAaN5GdaqI98+66+GK6S3aEY/mzX3CpYBbNtf1DvySAPtIW/jtHB2dvkstbCzZyPnJ tKfEGUgJEK0ZLwoLjHziRsS9JBXRrgYVD2jHGUiWQP87lDPSZNzcHm/oDki8qv0VSv6N SzlJXa+AgsnJhrjDPZUz0gAqcTx2lA8cJAEdzK99jeJaBZacwSAjatRYThAO2EsiBYZf p4rncI3Q5uMRGCPTTFTkOpNqS98aB+jcMBN0HJc9OpNNuAVp9Pb3rKSp0UNW7c4TLiD1 ZC2A== X-Gm-Message-State: AAQBX9f9ae1n8fgLYdukPIZvqMh2BwPg+y0BmLILcObDbrzNB9EaEDKj o5nA2r9aZRDurprRwCpsv3EGebnz3j6fDSFkvZN2nA== X-Google-Smtp-Source: AKy350Y2J8YBZznRMvt1xmU4mkRuPG2EvY8JhTz7AYXY8k8kZLWHTnoUmNEx4O+4imcYUN2wiCSFSw== X-Received: by 2002:a25:1846:0:b0:b72:9470:2234 with SMTP id 67-20020a251846000000b00b7294702234mr2372547yby.46.1680853809147; Fri, 07 Apr 2023 00:50:09 -0700 (PDT) Received: from [192.168.1.92] ([68.249.219.17]) by smtp.googlemail.com with ESMTPSA id bw26-20020a056902161a00b00b8c08669033sm457870ybb.40.2023.04.07.00.50.08 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 07 Apr 2023 00:50:08 -0700 (PDT) Message-ID: Date: Fri, 7 Apr 2023 02:50:07 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 From: Davy Durham To: ffmpeg-devel@ffmpeg.org Content-Language: en-US Subject: [FFmpeg-devel] [PATCH] fftools/ffmpeg: Added ability to set a input burst time before readrate is enforced X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Implemented is the -irb flag (i.e. "initial read burst") that causes ffmpeg to read the specified number of seconds of input before a given readrate starts to be enforced. All inputs have to reach this point before the readrate is enforced. The reason for this change is, in the scenario of live-streaming by transcoding from an pre-recorded or delayed source to an HLS or DASH webroot, we can more quickly prime the system of the first few seconds before the real-world read rate is imposed. Else, one must wait for an entire segment length before the data can be fetched from the web server. Signed-off-by: Davy Durham --- doc/ffmpeg.texi | 2 ++ fftools/ffmpeg.h | 2 ++ fftools/ffmpeg_opt.c | 3 +++ 3 files changed, 7 insertions(+) diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi index d433d60ce9..a519fea192 100644 --- a/doc/ffmpeg.texi +++ b/doc/ffmpeg.texi @@ -1709,6 +1709,8 @@ it may cause packet loss. It is useful for when flow speed of output packets is important, such as live streaming. @item -re (@emph{input}) Read input at native frame rate. This is equivalent to setting @code{-readrate 1}. +@item -irb @var{seconds} +Set an initial read burst time, in seconds, after which any specified readrate will be enforced. @item -vsync @var{parameter} (@emph{global}) @itemx -fps_mode[:@var{stream_specifier}] @var{parameter} (@emph{output,per-stream}) Set video sync method / framerate mode. vsync is applied to all output video streams diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index 823218e214..e057e6da3a 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -124,6 +124,7 @@ typedef struct OptionsContext { int loop; int rate_emu; float readrate; + double initial_read_burst; int accurate_seek; int thread_queue_size; int input_sync_ref; @@ -475,6 +476,7 @@ typedef struct InputFile { int rate_emu; float readrate; + double initial_read_burst; int accurate_seek; /* when looping the input file, this queue is used by decoders to report diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index 055275d813..6c55b6cb01 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -1443,6 +1443,9 @@ const OptionDef options[] = { { "readrate", HAS_ARG | OPT_FLOAT | OPT_OFFSET | OPT_EXPERT | OPT_INPUT, { .off = OFFSET(readrate) }, "read input at specified rate", "speed" }, + { "irb", HAS_ARG | OPT_DOUBLE | OPT_OFFSET | + OPT_EXPERT | OPT_INPUT, { .off = OFFSET(initial_read_burst) }, + "The initial amount of input to burst read before imposing any readrate", "seconds" }, { "target", HAS_ARG | OPT_PERFILE | OPT_OUTPUT, { .func_arg = opt_target }, "specify target file type (\"vcd\", \"svcd\", \"dvd\", \"dv\" or \"dv50\" " "with optional prefixes \"pal-\", \"ntsc-\" or \"film-\")", "type" }, -- 2.25.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".