From patchwork Mon Sep 25 11:58:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Riedl X-Patchwork-Id: 43894 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:2a18:b0:15d:8365:d4b8 with SMTP id e24csp1168898pzh; Mon, 25 Sep 2023 04:58:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFQisUQFMWx9ssKd5WpPbQltk1ovWOb9J6cJELXOyRdOuagWRM5Z4Me4i/rUEcw2ovEEvzM X-Received: by 2002:a17:906:25d:b0:9ae:587a:e5ce with SMTP id 29-20020a170906025d00b009ae587ae5cemr6525698ejl.27.1695643115093; Mon, 25 Sep 2023 04:58:35 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id e6-20020a170906080600b0098653c15e94si3922248ejd.117.2023.09.25.04.58.34; Mon, 25 Sep 2023 04:58:35 -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=@nativewaves.onmicrosoft.com header.s=selector2-nativewaves-onmicrosoft-com header.b=mGb7EtLQ; arc=fail (body hash mismatch); 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 1E74268C97E; Mon, 25 Sep 2023 14:58:31 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2083.outbound.protection.outlook.com [40.107.241.83]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C12EF68C879 for ; Mon, 25 Sep 2023 14:58:23 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GGhxkE/ZrHGQZm1rEga0vzwd/KhgsLUi29ZxnEctn4i8YdghTFlbbdZuc93X+ERdh8DHC494zPq6y1sbk+d+0LNOHjNx2gkj7+sve7ZWwu+HZF3ouS6LxEDVLziLMtJyrsy30YKd2/umEdP1+MPlJmzPfaBn749Cv86u2Gon+hZrxlXrrpGaIEurxn6859wbSd2TfcBaPpqsTMxmkfGHVsSvXVvBxQSTqIepmLwJXSCAU/BxHgvvN8qQq0VLk7IzPySNxZxRiVne/X3vgtsOw4dayj/9VI1mO0xekFEQfKFt4yUrs8Ds0IvtYcUaDhf+SADUn0R+/feMqGKXLTgA8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zY0rAJD6HOdulL6BSBWOIRF1EzViQhFA+W+7gjotPWo=; b=S66x1Vy5g1kU3aEeWomMhIsV+51MRD6UKJ2MMBsLASZfbmFIMxDjn0pP0CmJ2qfcy1MWK9ntC0RUxyNBC3p8k/nLZztrLpX3R/xpZsp3oM4SZcLV85J3Qi8wutCqTcoe7kud5APww1s2kF4tooYMd/wSf/qDdjyKHxfGNDvzT1Stl3Kn6/dKMUB1wzwMTwt5sHen46vig4QmR2zlxYeJ1+dIqteOCfizT/eQdO7bALs40wY7JUMGCsZK1pVNpf1iHoOhdSEcxvPP5lySbUoB2uDk0Tl6jW0qQ+OkPbOo3dxZW43Pnu6xJy894OxeDHhKq0lK/HYZYHiT0iaoTkHbAg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nativewaves.com; dmarc=pass action=none header.from=nativewaves.com; dkim=pass header.d=nativewaves.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nativewaves.onmicrosoft.com; s=selector2-nativewaves-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zY0rAJD6HOdulL6BSBWOIRF1EzViQhFA+W+7gjotPWo=; b=mGb7EtLQpVbXwQUwQ4ZuXKZq4xvKe9uaRK0wncJROGBMqLgsKHTBGVG2/rVe8vGPdu1gMbiEek9Nu/IT7a0zveyYFx7ZKT1JUs5oix6aDxtDoUsVK63fkpbbyoYdB7y3+I4gfC0IJcsWAJ5rxvh/DZyus6j/uJ5Q/eQoRYMA6J4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nativewaves.com; Received: from PA4PR03MB7167.eurprd03.prod.outlook.com (2603:10a6:102:10a::8) by GV2PR03MB8875.eurprd03.prod.outlook.com (2603:10a6:150:bb::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.20; Mon, 25 Sep 2023 11:58:18 +0000 Received: from PA4PR03MB7167.eurprd03.prod.outlook.com ([fe80::d525:3ec1:f93a:9876]) by PA4PR03MB7167.eurprd03.prod.outlook.com ([fe80::d525:3ec1:f93a:9876%3]) with mapi id 15.20.6813.027; Mon, 25 Sep 2023 11:58:18 +0000 Message-ID: <2685f0cc-78f7-4ef7-833a-a56223fa6236@nativewaves.com> Date: Mon, 25 Sep 2023 13:58:16 +0200 User-Agent: Mozilla Thunderbird From: Michael Riedl To: ffmpeg-devel@ffmpeg.org Content-Language: en-US X-ClientProxiedBy: FR2P281CA0162.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:99::12) To PA4PR03MB7167.eurprd03.prod.outlook.com (2603:10a6:102:10a::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PA4PR03MB7167:EE_|GV2PR03MB8875:EE_ X-MS-Office365-Filtering-Correlation-Id: 05d95dae-67e9-4140-6cf8-08dbbdbeb4d5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5whus7UyJ+RsZwCAfh08iQY1zDdYV56fwAIV75YGcd/apgAdyjM0gQE8dYeP90ObnmcslJsv9zimDH/jtg1DjY9+Lin2BNDOkoCbwH8jhG8RFWLx7w92Fv+51uj0AFrDLtGU0b2oP5oqQ9tj1dUQb8s7a4AXIoXc8gFZ3X2TutP3v6pP5GokY/HRX4SR60CsX/08oe1mEFMBYdLOZqHKHAU7136U2A8Xkyew85cDr62p7XQdAFLzqJZJTtS0oZLplpnLOF9Oe4HEPZPY9+29/JbKAKsvhHPO6P06AIMcHHu+VHhAbzL9Vc7fRxEFByXWoymduCeTgb946R0hnrrlRHMVU6mU0HMlYD/OXHHydjpvycq0eQYgoUYkp/U7iq/OGqq9TcQp7gIjPoO0WjasCwPhLYEE7vmCyglz0ofkM6gV6Qy79cGd91igvtxqjczHXTWliN/FKfVkQV4HwB5tSAuN3Nna3AGv44ZJPCZc6OjEVyhG/N8VQmrnnLuvS+Pab5DI8hJHcDOfvePYTSXxliBbwUC+qnHO/uXKUE305lH/78A5WwjOZ3dXOYnRHhIANwot+MuHQWp3yjfoXEiGRIN1SUinTNNhYkuO6X1hIm59lM+ZBtWoQIB/IO4YwEJ/2fFWDHJWGn0Dpja8ImFyKGUwPpSNf2aqTCkjoNlRqUgsa577VgVquWFCS3ibAz0J X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PA4PR03MB7167.eurprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366004)(39830400003)(396003)(346002)(136003)(376002)(230922051799003)(451199024)(186009)(1800799009)(83380400001)(31686004)(6486002)(36756003)(6506007)(6512007)(31696002)(41300700001)(38100700002)(86362001)(6916009)(8936002)(5660300002)(2616005)(478600001)(8676002)(66476007)(66946007)(2906002)(316002)(66556008)(26005)(44832011)(131093003)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?AqDh1PcdTFZlETyR+f1EXCUL90yj?= =?utf-8?q?lm1BMIshc5gy//OZM6/n+wUI8pPyf8X4Qe3nR0XNiLtJ4MnuEd+W/nOL27VZurujY?= =?utf-8?q?0YYj+W7OV7dsOjp4sY8OQtOrZoviTu9KTi84pEXctyt6Dcb6nnccdgwWZObRbX+aB?= =?utf-8?q?1EfHy+ukHIDeo86J/abbTSpwn3h9/BgqSVJ5nHoqakILPALvGALxyVTPkj1YYe3sT?= =?utf-8?q?HxviuNp1B8DY4VYuTNPQOATX3PEf2vSv7xVcHZlo4hgWpZWiglW14oci6bS09MBMx?= =?utf-8?q?YCmbFEL+niRF1sy/qX3II2MX6ts4j3c58ljpzamWqcCWkxCOriRLgD6/dPQs5oshC?= =?utf-8?q?f6TpeINe7UmN1Km7t4dmUGwEKIwGoUCcmwdq3sliTs3gRLgcKW+4dVUlzh2dqudu9?= =?utf-8?q?8/Q9h9CpXvQrVYK7jEqTgQaBNxYx2KPbK6h5WJwXpmdF1j9tDcvNL/xVYLlUtjYjt?= =?utf-8?q?S2WN04wUtuo3XMGBA6+jSX4E/MLWxPcbQcXp2JWlXykAg9vDXQhcxQ/dK5Yl/3zXQ?= =?utf-8?q?L01f6ZQ7aqK5EjI4RsGfnPqehEqrHdDz0gxSDdR1Nw2euIn2vJCWY3eFzgy+8Bawk?= =?utf-8?q?XDfo/EElGtFFYSyNWUhZ/xLkYi+fm5EM0BEmlTq+TU8Lv01BqVnciJMhcoOePheSN?= =?utf-8?q?WK4gC+PChVWXGYGFFR53j+cwKYfn4tAmzKqwQdJZfnY2OkfmR9guQcxMclAnAUxZH?= =?utf-8?q?zgTnGphUGVvr/Dr3e63loenWT4n97UHuEqFVRAOJWdFFACQygL9m/aMk8fZqJkQeO?= =?utf-8?q?sTzCG7WU5oPbRbmd3J6vudd9kEil4KlIjj7vAJJDy/raCjoL5AV2GdJX+q86kTlQ4?= =?utf-8?q?wT54uJ2ZPrWhKpjvhOPt6WmP1xC0fRJUYBcWLlOzQGq8+m+MI//WDDh2DTOWDfNJF?= =?utf-8?q?PYycyPuPPjSg8Lf4PQQ8pBIDpYXRJCXpIxxuuFk7FW3AuHz//6ue7dBtuX6uHOM6Q?= =?utf-8?q?11wc5Wm7fZtxGKt0CjE6a07G11ZXmThCfu4cPbQzKbnFEWXNwEk1kjG0Jkffi56uV?= =?utf-8?q?ORS67R8xiN0NHhAbHk+mVxgVS1zTnxpB3Bj2HqmC1hm7yGszzD5YsNAkH4VnjLoCL?= =?utf-8?q?awTyCzFLi+yrg/cTMLUAPwKinzQhw8vMAY6KLZFJY6W69MPh3vcjR0JPv5JNHE2oE?= =?utf-8?q?FfC2uiUiLRPnBr6O0kXTmcbUlH/1J9uZvkqj42aC7HRoHLBCrvJTk9ZY16PjRqAmM?= =?utf-8?q?0070KZFlWGiEG8Zk4q/s1J8NiSflrLhZwHlLFX1wliP6QIf1LAa8+EC80mpAd2Jh6?= =?utf-8?q?Rl8CORnK4TYRW3lM1OsX5ek5sB5OJoB67kseBAVlra4yhY7JxYC2f+1Df1IxYKLVT?= =?utf-8?q?1np8+dNnd5aD4xUnWg9uiD45ywi3Yx+gMcXFB4fSCCqkEqkdW3S2laA2I8Fb0yw7i?= =?utf-8?q?UTcJDEaZB6uTMT1OTW68j9ZMjFxQHS0MyCYpgyJZTKmDEhlF6YQylXim5pMHFhUnF?= =?utf-8?q?g3I9FG4vuGywY9O4mg97dMlNHjb1fL8FUcd767g5nAaxIrg9GlCqaeKKwkmPpOrBx?= =?utf-8?q?5y4wSF5+SA9VGnkVgDcbp9/1nZbujFuz3qj34rc8ESnP9bputWFefKs=3D?= X-OriginatorOrg: nativewaves.com X-MS-Exchange-CrossTenant-Network-Message-Id: 05d95dae-67e9-4140-6cf8-08dbbdbeb4d5 X-MS-Exchange-CrossTenant-AuthSource: PA4PR03MB7167.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2023 11:58:18.0815 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e4239718-b000-4513-8314-02ef46bd0276 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: WubfuvhkPyRKm7zKDFbDwVf9CYqtRlxyKgz2mhbL7MXIwYFttg5FcUUyOenv+gilm21WITADCPl1LTwFiwpPsxYaIG4w5d/Oew5YrvrumLI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR03MB8875 Subject: [FFmpeg-devel] [PATCH] libavdevice/decklink: extend available actions on signal loss 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: aP0OGmG+sGOW Deprecate the option 'draw_bars' in favor of the new option 'signal_loss_action', which controls the behavior when the input signal is not available (including the behavior previously available through draw_bars). The default behavior remains unchanged to be backwards compatible. The new option is more flexible for extending now and in the future. The new value 'repeat' repeats the last video frame. This is useful for very short dropouts and was not available before. Signed-off-by: Michael Riedl --- doc/indevs.texi | 16 ++++++++++++++++ libavdevice/decklink_common.h | 1 + libavdevice/decklink_common_c.h | 7 +++++++ libavdevice/decklink_dec.cpp | 23 ++++++++++++++++++++++- libavdevice/decklink_dec_c.c | 6 +++++- 5 files changed, 51 insertions(+), 2 deletions(-) diff --git a/doc/indevs.texi b/doc/indevs.texi index 863536a34d5..a985d58ce7f 100644 --- a/doc/indevs.texi +++ b/doc/indevs.texi @@ -395,6 +395,22 @@ Defaults to @samp{audio}. @item draw_bars If set to @samp{true}, color bars are drawn in the event of a signal loss. Defaults to @samp{true}. +This option is deprecated, please use the @code{signal_loss_action} option. + +@item signal_loss_action +Sets the action to take in the event of a signal loss. Accepts one of the +following values: + +@table @option +@item 1, none +Do nothing on signal loss. This usually results in black frames. +@item 2, bars +Draw color bars on signal loss. Only supported for 8-bit input signals. +@item 3, repeat +Repeat the last video frame on signal loss. +@end table + +Defaults to @samp{bars}. @item queue_size Sets maximum input buffer size in bytes. If the buffering reaches this value, diff --git a/libavdevice/decklink_common.h b/libavdevice/decklink_common.h index 34ab1b96700..be666212e6c 100644 --- a/libavdevice/decklink_common.h +++ b/libavdevice/decklink_common.h @@ -146,6 +146,7 @@ struct decklink_ctx { DecklinkPtsSource video_pts_source; int draw_bars; BMDPixelFormat raw_format; + DecklinkSignalLossAction signal_loss_action; int frames_preroll; int frames_buffer; diff --git a/libavdevice/decklink_common_c.h b/libavdevice/decklink_common_c.h index 9c55d891494..53d2c583e7e 100644 --- a/libavdevice/decklink_common_c.h +++ b/libavdevice/decklink_common_c.h @@ -37,6 +37,12 @@ typedef enum DecklinkPtsSource { PTS_SRC_NB } DecklinkPtsSource; +typedef enum DecklinkSignalLossAction { + SIGNAL_LOSS_NONE = 1, + SIGNAL_LOSS_REPEAT = 2, + SIGNAL_LOSS_BARS = 3 +} DecklinkSignalLossAction; + struct decklink_cctx { const AVClass *cclass; @@ -68,6 +74,7 @@ struct decklink_cctx { int64_t timestamp_align; int timing_offset; int wait_for_tc; + DecklinkSignalLossAction signal_loss_action; }; #endif /* AVDEVICE_DECKLINK_COMMON_C_H */ diff --git a/libavdevice/decklink_dec.cpp b/libavdevice/decklink_dec.cpp index 11640f72caa..f6095c72359 100644 --- a/libavdevice/decklink_dec.cpp +++ b/libavdevice/decklink_dec.cpp @@ -593,6 +593,7 @@ private: int no_video; int64_t initial_video_pts; int64_t initial_audio_pts; + IDeckLinkVideoInputFrame* last_video_frame; }; decklink_input_callback::decklink_input_callback(AVFormatContext *_avctx) : _refs(1) @@ -602,10 +603,13 @@ decklink_input_callback::decklink_input_callback(AVFormatContext *_avctx) : _ref ctx = (struct decklink_ctx *)cctx->ctx; no_video = 0; initial_audio_pts = initial_video_pts = AV_NOPTS_VALUE; + last_video_frame = nullptr; } decklink_input_callback::~decklink_input_callback() { + if (last_video_frame) + last_video_frame->Release(); } ULONG decklink_input_callback::AddRef(void) @@ -773,7 +777,7 @@ HRESULT decklink_input_callback::VideoInputFrameArrived( ctx->video_st->time_base.den); if (videoFrame->GetFlags() & bmdFrameHasNoInputSource) { - if (ctx->draw_bars && videoFrame->GetPixelFormat() == bmdFormat8BitYUV) { + if (ctx->signal_loss_action == SIGNAL_LOSS_BARS && videoFrame->GetPixelFormat() == bmdFormat8BitYUV) { unsigned bars[8] = { 0xEA80EA80, 0xD292D210, 0xA910A9A5, 0x90229035, 0x6ADD6ACA, 0x51EF515A, 0x286D28EF, 0x10801080 }; @@ -785,6 +789,8 @@ HRESULT decklink_input_callback::VideoInputFrameArrived( for (int x = 0; x < width; x += 2) *p++ = bars[(x * 8) / width]; } + } else if (ctx->signal_loss_action == SIGNAL_LOSS_REPEAT) { + last_video_frame->GetBytes(&frameBytes); } if (!no_video) { @@ -793,6 +799,12 @@ HRESULT decklink_input_callback::VideoInputFrameArrived( } no_video = 1; } else { + if (ctx->signal_loss_action == SIGNAL_LOSS_REPEAT) { + if (last_video_frame) + last_video_frame->Release(); + last_video_frame = videoFrame; + last_video_frame->AddRef(); + } if (no_video) { av_log(avctx, AV_LOG_WARNING, "Frame received (#%lu) - Input returned " "- Frames dropped %u\n", ctx->frameCount, ++ctx->dropped); @@ -1074,6 +1086,15 @@ av_cold int ff_decklink_read_header(AVFormatContext *avctx) ctx->audio_pts_source = cctx->audio_pts_source; ctx->video_pts_source = cctx->video_pts_source; ctx->draw_bars = cctx->draw_bars; + ctx->signal_loss_action = cctx->signal_loss_action; + if (!ctx->draw_bars && ctx->signal_loss_action == SIGNAL_LOSS_BARS) { + ctx->signal_loss_action = SIGNAL_LOSS_NONE; + av_log(avctx, AV_LOG_WARNING, "Setting signal_loss_action to none because draw_bars is false\n"); + } + if (!ctx->draw_bars && ctx->signal_loss_action != SIGNAL_LOSS_NONE) { + av_log(avctx, AV_LOG_ERROR, "options draw_bars and signal_loss_action are mutually exclusive\n"); + return AVERROR(EINVAL); + } ctx->audio_depth = cctx->audio_depth; if (cctx->raw_format > 0 && (unsigned int)cctx->raw_format < FF_ARRAY_ELEMS(decklink_raw_format_map)) ctx->raw_format = decklink_raw_format_map[cctx->raw_format]; diff --git a/libavdevice/decklink_dec_c.c b/libavdevice/decklink_dec_c.c index 2159702c96b..7c0ef4f8c23 100644 --- a/libavdevice/decklink_dec_c.c +++ b/libavdevice/decklink_dec_c.c @@ -94,12 +94,16 @@ static const AVOption options[] = { { "reference", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PTS_SRC_REFERENCE}, 0, 0, DEC, "pts_source"}, { "wallclock", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PTS_SRC_WALLCLOCK}, 0, 0, DEC, "pts_source"}, { "abs_wallclock", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PTS_SRC_ABS_WALLCLOCK}, 0, 0, DEC, "pts_source"}, - { "draw_bars", "draw bars on signal loss" , OFFSET(draw_bars), AV_OPT_TYPE_BOOL, { .i64 = 1}, 0, 1, DEC }, + { "draw_bars", "use option signal_loss_action instead" , OFFSET(draw_bars), AV_OPT_TYPE_BOOL, { .i64 = 1}, 0, 1, DEC | AV_OPT_FLAG_DEPRECATED }, { "queue_size", "input queue buffer size", OFFSET(queue_size), AV_OPT_TYPE_INT64, { .i64 = (1024 * 1024 * 1024)}, 0, INT64_MAX, DEC }, { "audio_depth", "audio bitdepth (16 or 32)", OFFSET(audio_depth), AV_OPT_TYPE_INT, { .i64 = 16}, 16, 32, DEC }, { "decklink_copyts", "copy timestamps, do not remove the initial offset", OFFSET(copyts), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, DEC }, { "timestamp_align", "capture start time alignment (in seconds)", OFFSET(timestamp_align), AV_OPT_TYPE_DURATION, { .i64 = 0 }, 0, INT_MAX, DEC }, { "wait_for_tc", "drop frames till a frame with timecode is received. TC format must be set", OFFSET(wait_for_tc), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, DEC }, + { "signal_loss_action", "action on signal loss", OFFSET(signal_loss_action), AV_OPT_TYPE_INT, { .i64 = SIGNAL_LOSS_BARS }, SIGNAL_LOSS_NONE, SIGNAL_LOSS_BARS, DEC, "signal_loss_action" }, + { "none", "do not do anything (usually leads to black frames)", 0, AV_OPT_TYPE_CONST, { .i64 = SIGNAL_LOSS_NONE }, 0, 0, DEC, "signal_loss_action"}, + { "bars", "draw color bars (only supported for 8-bit signals)", 0, AV_OPT_TYPE_CONST, { .i64 = SIGNAL_LOSS_BARS }, 0, 0, DEC, "signal_loss_action"}, + { "repeat", "repeat the last video frame", 0, AV_OPT_TYPE_CONST, { .i64 = SIGNAL_LOSS_REPEAT }, 0, 0, DEC, "signal_loss_action"}, { NULL }, };