From patchwork Mon Mar 11 16:14:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Sabatini X-Patchwork-Id: 46959 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:dc95:b0:1a1:738b:6bc0 with SMTP id ky21csp1323263pzb; Mon, 11 Mar 2024 09:15:11 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXPmELz7UA/+QqLkqYQx51sfXDlyoAgmVkItkpf7y4YhgdvSccFA/5w/waDsO+BkSezbQzy8b6ztnL92NI+3Tda8NwfuVOWwfuueg== X-Google-Smtp-Source: AGHT+IEpIr5+BaqKV7j33jFZsEmWK5mnDwgT/+mCV3yvEB6FFL+x3MimBTpwaqA8n4c3mh5G20pe X-Received: by 2002:a17:907:7644:b0:a43:eb29:a293 with SMTP id kj4-20020a170907764400b00a43eb29a293mr3851027ejc.5.1710173711718; Mon, 11 Mar 2024 09:15:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710173711; cv=none; d=google.com; s=arc-20160816; b=qgo4EzlND1+hO+ukLNFd8HFiEAnvOfo+hOFgvym6cML8CScMLtbkSBMuIzyrwo64Ye mxR2N4upvhgZzve90id+LcF4huQq/KELmO50LAW7WvF6P+KqlrM9ewrGLdsgMZZ075G0 cQoB5/XJ/aAHn7jI7qFVc4fUMDy6sQbkyj6cjs/fK+UHDKvl0s/HP+qTcI3JQwWflrJF 6ILDQ+1eaqeY3FulF2MCxF/NIrV4HC//XW2dIb3mpcisSaV5/UooqUx+3ihY1jxi1g1v 8PyXj3mlCvxJiQrcOVOTrpAHghr4BvCq9WAy0cIqjZ2WlzWkpFCKg+k8zX1dO3YDvVtR MKnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=MRc4RrNjBJF3WL/CVShmBrXK/U1Vm3Rgzc0u38qDcqo=; fh=QdWxt2OToL83TTnLQn0lGhLakV7i1QyAJdC8te7qN0E=; b=QMod73ZnbQs7SpU5qdS6Dxfhm9q9MV5RckWyFO/h+w1ZyDpbs5QGeQ16rkD3kyB/2t d1BjSy0P2oXtt0fbWiYS13Jtee2TqjfjszOlplSdjwPV01OwW6eFBqVdm/DeGY0/xNru mSUDpZx2Qi6TsDKq6iwUl5pz3sN1QBa4vzaYVkuEHa48Jqy4ItEgTtqcghdciXT3zNm/ aOmVOioYbhdNx2Z3dWC5cPAHTORy1p+jL36+EZbTTVA79Mohd9Q/P49okpkzgh63i3yA btUo0Vg5BbbVvz1cXxKwbPxFAc23/Vw87Td1tQz/9IP2xUF/Kas1AyI24JOyx1EH3Fxg qu5g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=EBOsfrGq; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id l13-20020a170906230d00b00a461f917062si1486090eja.212.2024.03.11.09.15.11; Mon, 11 Mar 2024 09:15:11 -0700 (PDT) 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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=EBOsfrGq; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5CF6D68D0BD; Mon, 11 Mar 2024 18:14:51 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 71B9F68D0AA for ; Mon, 11 Mar 2024 18:14:45 +0200 (EET) Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-a461d0c90c1so174240366b.2 for ; Mon, 11 Mar 2024 09:14:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710173684; x=1710778484; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=YGLXl5QvwDnmDk/t7l48wcwEyASnh69qXm5SvAclGko=; b=EBOsfrGquiYr+fD5CPRHrI6sJ3VK7pXPORL124iQm153MRbUSG8k6IHA8gpBLdUazY 2zQLgdAPXf06Moux2pU+SIyzQYEL7B1JzOTMdWnkuPeOp17qJ9LS1i0qLMe4xCjieWoW gGIR56rpx8Atf9O0BkUlG3vmRqmpthkekuim8Ewvo+KNHiYBz17eh8BNDjlP1KesL0zg AOVOQaNy0tEpAbwVa0Dfbf6XBTA4L1r+ZontPbYM6cEgW/oQ0+AC/vIaUgpLwqVv7FjS ymeCJ/MDWU8CDG3STqngTkrLc/nrCdRkFZrtDiYr6wPpQKP4QB7dOIFoosj+ZDy060Fv 9OgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710173684; x=1710778484; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=YGLXl5QvwDnmDk/t7l48wcwEyASnh69qXm5SvAclGko=; b=fLXaUF9QMQz+BpTs1CNs2KcHgJAo1vFORUN4xVs7R7lvAJOf69O9wb247iD34KE5bg nOtp63fKhP0+3usRF7JH646Y2dyy171mwXDoHwWTKEVyUln7SOurrpG4ulNB0wztnDPd uoSmxIqglILLbFKtAHEszalM1hrpFe2r/JDE77mgEK+F6yhs2zf7424AjSKVdtWg6oBq 5EJN7vr0gwzw/Hbl1UJ7cSpTGiAN617MtBO4IySUVLwnqec97c1fYbcJ2DKzZDqtHb5P KU8j1ZF+J8iZcFXOtPWguzQp1hyyw8N7KbcLyNrQYsVb7YV/HSJ3VnAgw3nuLvxQBrVi 9EIQ== X-Gm-Message-State: AOJu0YxgHEF8mJWRJu94GFBWVALgOME4iJPPLZoBF810V4HzOuWZi8wX LcgIKHkeUjTViAXRz85CmL4gRiTfCPqKiQyYcn1EV9ctp/V1+eTbrsMPPQ3Z X-Received: by 2002:a17:906:bfe7:b0:a45:f89b:a915 with SMTP id vr7-20020a170906bfe700b00a45f89ba915mr4047456ejb.45.1710173684184; Mon, 11 Mar 2024 09:14:44 -0700 (PDT) Received: from mariano ([188.210.239.79]) by smtp.gmail.com with ESMTPSA id h19-20020a170906591300b00a449756f727sm3036595ejq.147.2024.03.11.09.14.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 09:14:43 -0700 (PDT) Received: by mariano (Postfix, from userid 1000) id 1AE3ABFCDC; Mon, 11 Mar 2024 17:14:43 +0100 (CET) From: Stefano Sabatini To: FFmpeg development discussions and patches Date: Mon, 11 Mar 2024 17:14:41 +0100 Message-Id: <20240311161443.323282-1-stefasab@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/3] lavf/fifo: sort options by name 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 Cc: Stefano Sabatini Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 1iXA6d8yee5W --- libavformat/fifo.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/libavformat/fifo.c b/libavformat/fifo.c index 074a46485c..a3d41ba0d3 100644 --- a/libavformat/fifo.c +++ b/libavformat/fifo.c @@ -663,36 +663,36 @@ static void fifo_deinit(AVFormatContext *avf) #define OFFSET(x) offsetof(FifoContext, x) static const AVOption options[] = { - {"fifo_format", "Target muxer", OFFSET(format), - AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, AV_OPT_FLAG_ENCODING_PARAM}, - - {"queue_size", "Size of fifo queue", OFFSET(queue_size), - AV_OPT_TYPE_INT, {.i64 = FIFO_DEFAULT_QUEUE_SIZE}, 1, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM}, - - {"format_opts", "Options to be passed to underlying muxer", OFFSET(format_options), - AV_OPT_TYPE_DICT, {.str = NULL}, 0, 0, AV_OPT_FLAG_ENCODING_PARAM}, + {"attempt_recovery", "Attempt recovery in case of failure", OFFSET(attempt_recovery), + AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM}, {"drop_pkts_on_overflow", "Drop packets on fifo queue overflow not to block encoder", OFFSET(drop_pkts_on_overflow), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM}, - {"restart_with_keyframe", "Wait for keyframe when restarting output", OFFSET(restart_with_keyframe), - AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM}, + {"fifo_format", "Target muxer", OFFSET(format), + AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, AV_OPT_FLAG_ENCODING_PARAM}, - {"attempt_recovery", "Attempt recovery in case of failure", OFFSET(attempt_recovery), - AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM}, + {"format_opts", "Options to be passed to underlying muxer", OFFSET(format_options), + AV_OPT_TYPE_DICT, {.str = NULL}, 0, 0, AV_OPT_FLAG_ENCODING_PARAM}, {"max_recovery_attempts", "Maximal number of recovery attempts", OFFSET(max_recovery_attempts), AV_OPT_TYPE_INT, {.i64 = FIFO_DEFAULT_MAX_RECOVERY_ATTEMPTS}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM}, - {"recovery_wait_time", "Waiting time between recovery attempts", OFFSET(recovery_wait_time), - AV_OPT_TYPE_DURATION, {.i64 = FIFO_DEFAULT_RECOVERY_WAIT_TIME_USEC}, 0, INT64_MAX, AV_OPT_FLAG_ENCODING_PARAM}, + {"queue_size", "Size of fifo queue", OFFSET(queue_size), + AV_OPT_TYPE_INT, {.i64 = FIFO_DEFAULT_QUEUE_SIZE}, 1, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM}, {"recovery_wait_streamtime", "Use stream time instead of real time while waiting for recovery", OFFSET(recovery_wait_streamtime), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM}, + {"recovery_wait_time", "Waiting time between recovery attempts", OFFSET(recovery_wait_time), + AV_OPT_TYPE_DURATION, {.i64 = FIFO_DEFAULT_RECOVERY_WAIT_TIME_USEC}, 0, INT64_MAX, AV_OPT_FLAG_ENCODING_PARAM}, + {"recover_any_error", "Attempt recovery regardless of type of the error", OFFSET(recover_any_error), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM}, + {"restart_with_keyframe", "Wait for keyframe when restarting output", OFFSET(restart_with_keyframe), + AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM}, + {"timeshift", "Delay fifo output", OFFSET(timeshift), AV_OPT_TYPE_DURATION, {.i64 = 0}, 0, INT64_MAX, AV_OPT_FLAG_ENCODING_PARAM}, From patchwork Mon Mar 11 16:14:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Sabatini X-Patchwork-Id: 46960 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:dc95:b0:1a1:738b:6bc0 with SMTP id ky21csp1323386pzb; Mon, 11 Mar 2024 09:15:21 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVy4cEc3rqBXWa3IvIncnKtgu485UIGPdBPz7AXWzatzoWndI0CDxa9D9SKNvk4fu6UsUi33QTmQ5Rp5nybYuNbx7Po0UkPr6ORoA== X-Google-Smtp-Source: AGHT+IEwljzz8u+fnnNEc5usCUfUIk5DZs+/wJGr7wRrdZJuZJlSpPjRx5qMTmReQKNcbVr3Gd5C X-Received: by 2002:a17:907:a803:b0:a46:29b:d7d8 with SMTP id vo3-20020a170907a80300b00a46029bd7d8mr4151351ejc.73.1710173721494; Mon, 11 Mar 2024 09:15:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710173721; cv=none; d=google.com; s=arc-20160816; b=xITU8lhJdZ4rfnbnqcMQ6ljbAuzmX4vxCM4hipT0eDtxdhIwxjeJ9tBc6gZUhdD2vC niEHK/N7w1dQNIz+/TfzD/1fsxzgKvCW+u2OGc+LXZX34ksDjrad2zoa0ddLhOs4K0dC 2NbPCOTgv1OUFd4kFMHFnkbtcNIZStHTr1Z5Xgoq2hJBmIcbhQFGWRSUVgXIdUPUDeEj 1Vz8pUOpXxP6OMb2q6BvyOTjb2Xnx8r67qw2SElHzROUUt1gCHAFdfYrYT33fOkXc9yG 7L1vcN5kL+VjRkT4GFW0OtWlvt/m2wCku9JVId4YSIQNWo1CuBXmC9zBNul+eY1xjaW+ 619A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=S6ylnHvRfTUtSEx2R+4o5tF0EQ10GscZUMjYTAW1MHI=; fh=QdWxt2OToL83TTnLQn0lGhLakV7i1QyAJdC8te7qN0E=; b=rYFF0PGk+t6gZb/dXB7rRTsS1mPTHHD/+pOz4yKMQWCtGUKUBZkN1PBMvnuMQxnoRo 0DNGoFCURaz1YG6rwlF0hGsETNe0jIkVxmrkVaREwlkbPgXo8uZ/ch+XkJma78AOsG38 WuoENaC7pQ+CoIZSQ4vJnB+wYxqGlyMQKoU3AD7PFj5uK26f0SS1iHtaUZen5tUlgBm0 N2QHiFDWJbgm6AnQHjLPRLXVnZ6qk2ckqWH3nCxOQkcdwoHC/GMNgoWMES0LpWgFKaFi n3dRwzYzp4aVGdLfTTwqYsg2jpUVSXaamgg8NUH0wbHfvBijsybXOk2RqRzGPAIDMyb9 PAXA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=YI28vgjF; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id by24-20020a170906a2d800b00a4625740820si1170674ejb.285.2024.03.11.09.15.21; Mon, 11 Mar 2024 09:15:21 -0700 (PDT) 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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=YI28vgjF; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8AF5668D0AA; Mon, 11 Mar 2024 18:14:54 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4E43E68D0BA for ; Mon, 11 Mar 2024 18:14:46 +0200 (EET) Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-a461d0c90c1so174242966b.2 for ; Mon, 11 Mar 2024 09:14:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710173685; x=1710778485; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9AaJFJoDMrkX27R5EVQf0N9oSqCw3Pc6EU40C4Gshvk=; b=YI28vgjFIIzQbjELqPm8P/9hLadZbyAQFYP8aPjyBM7yasyfgxcp491FkxDLRf/gQ5 4P9WFb6BmrycldqS6ltM9gu4DWVn96rJo+z6klHnnqHl5TmXCFPSx+TpVQ6aIXXegzVy i0wgjUHRKriWUdw/92mcA3uH+2XFIC7SjYUa2twiIPGAkwidbcgNteqS4dfdV6Bkfb8h ue1OScWrYRXL43smePBrnkrxdtvKXawQJ5IXo4GPAm+PjPmUyTvbKRfm3Y+AEb1kUAb9 GTuk203U/P165oGpJVxRNahtWlLjKSBETi3GvFsxYUsaeM+D3jpCb7oQ7ftrvqoqNVyB HOJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710173685; x=1710778485; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9AaJFJoDMrkX27R5EVQf0N9oSqCw3Pc6EU40C4Gshvk=; b=X1J9sAiu68wyCWsHwL406qaKJJNZqyUlJaVopSqWNaU6riVzwwlOfOncSpoYZy8Mqs 1t5mhHxEzHsAr9d5KonR+yNlb4+jJNWOMAP6lHDbiDGhmm1Seopqf8idWZ7oLIWrF+Tf Ns+NhUrfJE5D0TSmjvz7WQ3fsHGcdBo1wXoiqzhfj52M608x7CXkR6vvk7u+qsmsYeOS OyZ10eTZ17zUvcCOO8bWHsdkJ9ua7dEQvWIRdKtfS4IUeP5CjaxMGtp537/z2TR328H3 wV2Xur4bY+Wj06knYUpbwVc2O3TeBQs4cjwwei8WzBptP6bw1o1yeN0u2gBQR4TSskHO FB1w== X-Gm-Message-State: AOJu0YySeMzgBftqaQxJ8Y9hIwH1ZCnE+rq6OYm34VOjCd6cH7IiAPlE dSAS6luj5lR5DDqv+wRLbij1mkZUy8Om5T8MBgnrbcXiOtKRbm1cKCEynwRL X-Received: by 2002:a17:907:d049:b0:a46:1fb:1df with SMTP id vb9-20020a170907d04900b00a4601fb01dfmr5549399ejc.42.1710173684662; Mon, 11 Mar 2024 09:14:44 -0700 (PDT) Received: from mariano ([188.210.239.79]) by smtp.gmail.com with ESMTPSA id jw18-20020a170906e95200b00a462520d561sm1284713ejb.54.2024.03.11.09.14.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 09:14:44 -0700 (PDT) Received: by mariano (Postfix, from userid 1000) id 20075BFCE0; Mon, 11 Mar 2024 17:14:43 +0100 (CET) From: Stefano Sabatini To: FFmpeg development discussions and patches Date: Mon, 11 Mar 2024 17:14:42 +0100 Message-Id: <20240311161443.323282-2-stefasab@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240311161443.323282-1-stefasab@gmail.com> References: <20240311161443.323282-1-stefasab@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/3] lavf/fifo: fix check on last_recovery_ts 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 Cc: Stefano Sabatini Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: uyc7fjroLgae Correct check on PTS nullness. --- libavformat/fifo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/fifo.c b/libavformat/fifo.c index a3d41ba0d3..fcd80f217a 100644 --- a/libavformat/fifo.c +++ b/libavformat/fifo.c @@ -345,7 +345,7 @@ static int fifo_thread_attempt_recovery(FifoThreadContext *ctx, FifoMessage *msg AV_NOPTS_VALUE : 0; } else { if (fifo->recovery_wait_streamtime) { - if (ctx->last_recovery_ts == AV_NOPTS_VALUE) { + if (ctx->last_recovery_ts != AV_NOPTS_VALUE) { AVRational tb = avf->streams[pkt->stream_index]->time_base; time_since_recovery = av_rescale_q(pkt->pts - ctx->last_recovery_ts, tb, AV_TIME_BASE_Q); From patchwork Mon Mar 11 16:14:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Sabatini X-Patchwork-Id: 46961 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:dc95:b0:1a1:738b:6bc0 with SMTP id ky21csp1323485pzb; Mon, 11 Mar 2024 09:15:31 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVre1dDUJKhtz8MXkK8lYetcvOgY9YjQGJFvkEN3WmSBosbBCqxPqTKm1n+O8Zxk952pVsjkwiOa09IppgvL9swM3wNyBBh7ONOWQ== X-Google-Smtp-Source: AGHT+IEHobVOZLP77Yygyz8fup8SuFb35yVJh+3XriAtmCJGBZUh+AFsmu6dVb4RVEjtSVlZLqpx X-Received: by 2002:a17:906:2849:b0:a40:18ad:3fcc with SMTP id s9-20020a170906284900b00a4018ad3fccmr4206523ejc.36.1710173731194; Mon, 11 Mar 2024 09:15:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710173731; cv=none; d=google.com; s=arc-20160816; b=d4GuYmiJ69/KhCShiW4KsrRHvoB2dVoJtcgtLveubfwU2kcujCONsFzP8FDH9vBWRN AKtldvpi9htMEfywPD6ZTPxJbReIXjNEkSV3ReuGCyRLgH3OaGObOp5fhT1WS+o4lnEL e5uHQuvcDHSAJMiezyr0AmchP0VyS6s1AHyDG0NV4bpb9SXa6Uzb4gba2PW77t6/96DP RVmGNNt9SXwoiavQY7kDKoYHA0ZQ07wPhaS8pCD1A6Hy1X9uS2zEekas06taDMV+iIDv uoXAZbQUj7Le7Dq/X79it/YTFVodluMZnvTb+gOUhczP1I5zP8Ll1dbcpe/XKxzbq9V6 f9wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=gjDck5GPbOpReyl1EG/qWvUcDR3LnY6zy8UlBQfvd0Q=; fh=QdWxt2OToL83TTnLQn0lGhLakV7i1QyAJdC8te7qN0E=; b=E4/VBgjFKvwjmVRFKtsXNK6eaxR5tgM/mADYR5ajKk8VlJ/vxJN845KfROLLUNKQty dgrYfqWWBuxxjhS4d4yiKDRT3Vqjh7ossQCfymH8Kb5fJrmKe+R3ufO9g1YOu5xt5g2F jEg+NCEY5gu+VuennjAbaJSfo6kzmCqWPB7mSvCGzxRg9W8olLeVcz8/ws+X1SGv8a+E 1vSxnivBd3vvTq0twA1WItQTKBWk7IvnNwdPdtgcLu3ngvy+M1vEdhJ+9wjlcavQ2t6E QNbRASPSFRipvDh6y3BLcR/Rq/25B8kDByheyCKNsBHtlK/aaIx8E3irgjyHOQsuiM/x d1YQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b="lo2/h1On"; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id a22-20020a170906245600b00a45e1603259si2605383ejb.1003.2024.03.11.09.15.30; Mon, 11 Mar 2024 09:15:31 -0700 (PDT) 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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b="lo2/h1On"; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A3DBC68C1D5; Mon, 11 Mar 2024 18:14:55 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7BF1568D0BA for ; Mon, 11 Mar 2024 18:14:46 +0200 (EET) Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-a462b068416so136229166b.0 for ; Mon, 11 Mar 2024 09:14:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710173685; x=1710778485; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=S0VpZ/ATYuNmzZkkpsnol6uUHM7b1WIDqbeY39DtRrI=; b=lo2/h1Onyd1RqpSviF+3pY448S+jTNUMGSNrAYZzPlwGlizHW1w1g2QjuIipnsQ0TH Ke62pmHrJ3gQGnXichkWe0bwEaVXuT4xpuNK8MHNFXh+UWR7aktIXpghD+powo3+LHil o+xGQLDfXA/gSwZHHbU5/rVTD4Yl1CApTy5Q3P2zFRsvvKXvyEP2OC4Y6KetLEvkxTDl SN72XBCAiw9g8mnqj99yjGxrmLoL8ojOjBeo3JkO3xzbIxCdyLM+UVvbqyDe8BzmbEoi vhlnDuXF5w5D4YkiuLZqXA08I8JO7/ZfY8Krpnb4a7hlGN0KsuicOV26oBqnvvnlWXDt 4T5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710173685; x=1710778485; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=S0VpZ/ATYuNmzZkkpsnol6uUHM7b1WIDqbeY39DtRrI=; b=m5caJyFCjA2jUtEJhphPuPUKjezKNSwX5cwUxDjbjzlQTgkgfRRVBOnL5hEAykMrFD fpGBL5duQljIf9qJSMRQhKqiq6DVPDGx6dXyRIMJb7iRTFIw2kPWxQ6grv4mpoHiPLGw oVhzTAaFphpfCw+atYMpRXk2o4MCN0vgUtelPt3+S0PVdWGRFF06t7tjVPeosHbNLItW 9n8JwLzPrRFyH+EKn8WpT5mV+ROkOup5utTRowVs6JpS0m2RjjyhUdK0P2B9ozpRa6PU NGpUr0QSj1GDDPSHDaA+k0gOGGK3+AigBSsD8ZsgE64RSe1J3V42jr+1EQDl2J9YPikU 5NmQ== X-Gm-Message-State: AOJu0Yy5upm9XR2c0AU+JmayChQQ7eX0rOvCPsrH+tyNnd9Lz18hRUox qkm4nfb8vu+JP2Dxr7Xn43jfNdEPtz++Mb1OkK/aPS9qVe7qEZUyZnabm+uB X-Received: by 2002:a17:907:d382:b0:a46:499:4386 with SMTP id vh2-20020a170907d38200b00a4604994386mr5560426ejc.4.1710173684487; Mon, 11 Mar 2024 09:14:44 -0700 (PDT) Received: from mariano ([188.210.239.79]) by smtp.gmail.com with ESMTPSA id pw27-20020a17090720bb00b00a44e65447f9sm2975480ejb.7.2024.03.11.09.14.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 09:14:44 -0700 (PDT) Received: by mariano (Postfix, from userid 1000) id 26093BFCE2; Mon, 11 Mar 2024 17:14:43 +0100 (CET) From: Stefano Sabatini To: FFmpeg development discussions and patches Date: Mon, 11 Mar 2024 17:14:43 +0100 Message-Id: <20240311161443.323282-3-stefasab@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240311161443.323282-1-stefasab@gmail.com> References: <20240311161443.323282-1-stefasab@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/3] doc/muxers/fifo: review documentation 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 Cc: Stefano Sabatini Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: q9BNlM8I5e1T --- doc/muxers.texi | 138 ++++++++++++++++++++++++++---------------------- 1 file changed, 74 insertions(+), 64 deletions(-) diff --git a/doc/muxers.texi b/doc/muxers.texi index 2104cc4a95..34de187f5e 100644 --- a/doc/muxers.texi +++ b/doc/muxers.texi @@ -1421,104 +1421,114 @@ ffmpeg -i INPUT -s:v 720x480 -pix_fmt yuv411p -r 29.97 -ac 2 -ar 48000 -y out.dv @anchor{fifo} @section fifo +FIFO (First-In First-Out) muxer. -The fifo pseudo-muxer allows the separation of encoding and muxing by using -first-in-first-out queue and running the actual muxer in a separate thread. This -is especially useful in combination with the @ref{tee} muxer and can be used to -send data to several destinations with different reliability/writing speed/latency. +The @samp{fifo} pseudo-muxer allows the separation of encoding and +muxing by using a first-in-first-out queue and running the actual muxer +in a separate thread. -API users should be aware that callback functions (interrupt_callback, -io_open and io_close) used within its AVFormatContext must be thread-safe. +This is especially useful in combination with +the @ref{tee} muxer and can be used to send data to several +destinations with different reliability/writing speed/latency. -The behavior of the fifo muxer if the queue fills up or if the output fails is -selectable, +The target muxer is either selected from the output name or specified +through the @option{fifo_format} option. +The behavior of the @samp{fifo} muxer if the queue fills up or if the +output fails (e.g. if a packet cannot be written to the output) is +selectable: @itemize @bullet - @item -output can be transparently restarted with configurable delay between retries -based on real time or time of the processed stream. +Output can be transparently restarted with configurable delay between +retries based on real time or time of the processed stream. @item -encoding can be blocked during temporary failure, or continue transparently -dropping packets in case fifo queue fills up. - +Encoding can be blocked during temporary failure, or continue transparently +dropping packets in case the FIFO queue fills up. @end itemize +API users should be aware that callback functions +(@code{interrupt_callback}, @code{io_open} and @code{io_close}) used +within its @code{AVFormatContext} must be thread-safe. + +@subsection Options @table @option -@item fifo_format +@item attempt_recovery @var{bool} +If failure occurs, attempt to recover the output. This is especially +useful when used with network output, since it makes it possible to +restart streaming transparently. By default this option is set to +@code{false}. + +@item drop_pkts_on_overflow @var{bool} +If set to @code{true}, in case the fifo queue fills up, packets will +be dropped rather than blocking the encoder. This makes it possible to +continue streaming without delaying the input, at the cost of omitting +part of the stream. By default this option is set to @code{false}, so in +such cases the encoder will be blocked until the muxer processes some +of the packets and none of them is lost. + +@item fifo_format @var{format_name} Specify the format name. Useful if it cannot be guessed from the output name suffix. -@item queue_size -Specify size of the queue (number of packets). Default value is 60. +@item format_opts @var{options} +Specify format options for the underlying muxer. Muxer options can be +specified as a list of @var{key}=@var{value} pairs separated by ':'. -@item format_opts -Specify format options for the underlying muxer. Muxer options can be specified -as a list of @var{key}=@var{value} pairs separated by ':'. +@item max_recovery_attempts @var{count} +Set maximum number of successive unsuccessful recovery attempts after +which the output fails permanently. By default this option is set to +@code{0} (unlimited). -@item drop_pkts_on_overflow @var{bool} -If set to 1 (true), in case the fifo queue fills up, packets will be dropped -rather than blocking the encoder. This makes it possible to continue streaming without -delaying the input, at the cost of omitting part of the stream. By default -this option is set to 0 (false), so in such cases the encoder will be blocked -until the muxer processes some of the packets and none of them is lost. +@item queue_size @var{size} +Specify size of the queue as a number of packets. Default value is +@code{60}. -@item attempt_recovery @var{bool} -If failure occurs, attempt to recover the output. This is especially useful -when used with network output, since it makes it possible to restart streaming transparently. -By default this option is set to 0 (false). +@item recover_any_error @var{bool} +If set to @code{true}, recovery will be attempted regardless of type +of the error causing the failure. By default this option is set to +@code{false} and in case of certain (usually permanent) errors the +recovery is not attempted even when the @option{attempt_recovery} +option is set to @code{true}. -@item max_recovery_attempts -Sets maximum number of successive unsuccessful recovery attempts after which -the output fails permanently. By default this option is set to 0 (unlimited). +@item recovery_wait_streamtime @var{bool} +If set to @code{false}, the real time is used when waiting for the +recovery attempt (i.e. the recovery will be attempted after the time +specified by the @option{recovery_wait_time} option). -@item recovery_wait_time @var{duration} -Waiting time before the next recovery attempt after previous unsuccessful -recovery attempt. Default value is 5 seconds. +If set to @code{true}, the time of the processed stream is taken into +account instead (i.e. the recovery will be attempted after discarding +the packets corresponding to the @option{recovery_wait_time} option). -@item recovery_wait_streamtime @var{bool} -If set to 0 (false), the real time is used when waiting for the recovery -attempt (i.e. the recovery will be attempted after at least -recovery_wait_time seconds). -If set to 1 (true), the time of the processed stream is taken into account -instead (i.e. the recovery will be attempted after at least @var{recovery_wait_time} -seconds of the stream is omitted). -By default, this option is set to 0 (false). +By default this option is set to @code{false}. -@item recover_any_error @var{bool} -If set to 1 (true), recovery will be attempted regardless of type of the error -causing the failure. By default this option is set to 0 (false) and in case of -certain (usually permanent) errors the recovery is not attempted even when -@var{attempt_recovery} is set to 1. +@item recovery_wait_time @var{duration} +Specify waiting time in seconds before the next recovery attempt after +previous unsuccessful recovery attempt. Default value is @code{5}. @item restart_with_keyframe @var{bool} Specify whether to wait for the keyframe after recovering from -queue overflow or failure. This option is set to 0 (false) by default. +queue overflow or failure. This option is set to @code{false} by default. @item timeshift @var{duration} -Buffer the specified amount of packets and delay writing the output. Note that -@var{queue_size} must be big enough to store the packets for timeshift. At the -end of the input the fifo buffer is flushed at realtime speed. - +Buffer the specified amount of packets and delay writing the +output. Note that the value of the @option{queue_size} option must be +big enough to store the packets for timeshift. At the end of the input +the fifo buffer is flushed at realtime speed. @end table -@subsection Examples - -@itemize +@subsection Example -@item -Stream something to rtmp server, continue processing the stream at real-time -rate even in case of temporary failure (network outage) and attempt to recover -streaming every second indefinitely. +Use @command{ffmpeg} to stream to an RTMP server, continue processing +the stream at real-time rate even in case of temporary failure +(network outage) and attempt to recover streaming every second +indefinitely: @example -ffmpeg -re -i ... -c:v libx264 -c:a aac -f fifo -fifo_format flv -map 0:v -map 0:a +ffmpeg -re -i ... -c:v libx264 -c:a aac -f fifo -fifo_format flv -map 0:v -map 0:a \ -drop_pkts_on_overflow 1 -attempt_recovery 1 -recovery_wait_time 1 rtmp://example.com/live/stream_name @end example -@end itemize - @section flv Adobe Flash Video Format muxer.