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 684E74586D for ; Sun, 26 Mar 2023 19:22:56 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A1DFB68C57F; Sun, 26 Mar 2023 22:22:53 +0300 (EEST) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 62A7268C56C for ; Sun, 26 Mar 2023 22:22:47 +0300 (EEST) Received: by mail-wm1-f45.google.com with SMTP id v20-20020a05600c471400b003ed8826253aso4220032wmo.0 for ; Sun, 26 Mar 2023 12:22:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679858566; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=j6ubmxarHceQjJ0/zsFm3cj04Y2fOZg2D4XbSr6ABYA=; b=kXoc2/EE8HqJyJrg1bYNh3vLJncw/6pYL0/EbuO047XFumN5vdicaW4ZWCv2dUK0l3 iHsulsBFjnkCi0v3xkgAOoLwx0Mr8x4CNnn7mVpOXfwjZu7leXcRQbmIZygfmcAwzmse VdgP8kX4NUagbaMVGrfAkDxhLCD8XBvyuORs1/uSFS0nv0sZf14VUg/QiNMvXeWuLVle PIkM75SGjygWRwLj5uyMkPgNs7pjuR1be5cQxZmzCsBQe3aSH5k5UYgYVPWfPUQkhYPu TvyByb2A3+U55ZHkfNpZ40CbfOEfeVCtJJdvkngK0X1McqmkKM4mvi844F934xhrPcJD f5nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679858566; 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=j6ubmxarHceQjJ0/zsFm3cj04Y2fOZg2D4XbSr6ABYA=; b=mOBTebLX0ehGz3ZfGf0/p42h9gXQCGHpvffLrwm7NubBUpjTNcLaaA9akhma7JulQ8 9Ur8+ltBRm2MJK6eyasl47Ya3JcddjXXR9N0iu8wJdI/gLyOSmh/mFq9SuYysyhBMPAQ tdvN4QpQvoQqNudFeo2zSzjLdTRrxYx3JOkiB1WxSZFW6URi1r1lUAKRd8v64WlfrKXl GLlaiGtaXsMRrUHYB92OSpjAJmkRNqXlZtyuA+j5n/9SCEDkJGzehySiXltE70naWstY 917sOxvDzCxzWKBjV/+rdSXKihyG92lDjnVRoApRImy4wKANWo6ND2ce9RBnDCFJoocT W9mw== X-Gm-Message-State: AO0yUKXq7XvaGPBqS52nG68gXo7A74dY0IqCVG1Pu+mIvoOjyamzLh8p 6TQ3OteslgDwAf56I7WLfuJcCs1mTik= X-Google-Smtp-Source: AK7set+KdNR5xR9N3NoqDvTVZTnn3rI8cctSGS1RKxDN3DLfLQVkVZcz1mXnV28U5DOMvDhPXY84Rg== X-Received: by 2002:a05:600c:286:b0:3ee:7f0b:387b with SMTP id 6-20020a05600c028600b003ee7f0b387bmr6444879wmk.17.1679858566187; Sun, 26 Mar 2023 12:22:46 -0700 (PDT) Received: from mariano (dynamic-adsl-62-10-98-143.clienti.tiscali.it. [62.10.98.143]) by smtp.gmail.com with ESMTPSA id i11-20020a05600c290b00b003ee20b4b2dasm11257104wmd.46.2023.03.26.12.22.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Mar 2023 12:22:45 -0700 (PDT) Received: by mariano (Postfix, from userid 1000) id 69C7FBFB73; Sun, 26 Mar 2023 21:22:44 +0200 (CEST) From: Stefano Sabatini To: FFmpeg development discussions and patches Date: Sun, 26 Mar 2023 21:22:44 +0200 Message-Id: <20230326192244.65852-1-stefasab@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] doc/filters/find_rect: extend 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Document metadata entries set by the filter, extend and clarify options, add additional example showing how to extract the generated data. Fix issue: http://trac.ffmpeg.org/ticket/8766 --- doc/filters.texi | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/doc/filters.texi b/doc/filters.texi index 1980fa6888..11406cb076 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -13768,7 +13768,29 @@ value. @section find_rect -Find a rectangular object +Find a rectangular object in the input video. + +The object to search for must be specified as a gray8 image specified with the +@option{object} option. + +If the input video contains multiple instances of the object, the filter will +find only one of them. + +When an object is found, the following metadata entries are set in the matching +frame: +@table @option +@item lavfi.rect.w +width of object + +@item lavfi.rect.h +height of object + +@item lavfi.rect.x +x position of object + +@item lavfi.rect.y +y position of object +@end table It accepts the following options: @@ -13777,7 +13799,12 @@ It accepts the following options: Filepath of the object image, needs to be in gray8. @item threshold -Detection threshold, default is 0.5. +Detection threshold, expressed as a decimal number in the range 0-1. + +A threshold value of 0.01 means only exact matches, a threshold of 0.99 means +almost everything matches. + +Default value is 0.5. @item mipmaps Number of mipmaps, default is 3. @@ -13797,6 +13824,16 @@ Cover a rectangular object by the supplied image of a given video using @command @example ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv @end example + +@item +Find the position of an object in each frame using @command{ffprobe} and write +it to a log file: +@example +ffprobe -f lavfi movie=test.mp4,find_rect=object=object.pgm:threshold=0.3 \ + -show_entries frame=pkt_pts_time:frame_tags=lavfi.rect.x,lavfi.rect.y \ + -of csv -o find_rect.csv +@end example + @end itemize @section floodfill -- 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".