From patchwork Mon Sep 12 23:49:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chema Gonzalez X-Patchwork-Id: 37881 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp382123pzh; Mon, 12 Sep 2022 16:50:12 -0700 (PDT) X-Google-Smtp-Source: AA6agR56S905RdTTpP0Mx15ae8b8tIcZCpgD35lQMOJhRWZJnCqAkq1S1EsPC+AOwA+MOAgqZ6aL X-Received: by 2002:a17:906:8a79:b0:76f:55ff:5ced with SMTP id hy25-20020a1709068a7900b0076f55ff5cedmr19979283ejc.765.1663026612498; Mon, 12 Sep 2022 16:50:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663026612; cv=none; d=google.com; s=arc-20160816; b=q4iijTcSbD6klfLZzHyTY7TK+kIyIsDbi5xPeV1TpT2JSobQ1JM+G3eLGfjUSZOjX2 LsjF4pMF/8y9QoTEeoAEVVx0Xc+nEyIHk3/fts/YA+ydwmPoezvg8OkoDTAVgwb+O+xH zkfzbjhANSeOUuiHR7VCrZ9PE/uLEazAoPv5L1k+YxuIWwgHnXbNtwHVek5uoKMojTRo APDbTTIbps+4RRBva0mU2WV4tGxle443Pyw4hk0cA8twlnRhzGbc1bkDzb+qJa6ANdvw Drwerlxa3dOAta42xsfuArgdcrQZGycsP2wOBRsEymXFRTSUzq2gylpw3K+w8MIT8YXy CLmg== 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=q6DIDJKUlY38zGcfz6lP62Xx8KPlSMinTONOsKRytqU=; b=ow74Xce1prbV68hGFeADzM/yD7Z/dg2gvoHnjBbcEFLV3fWxURBAhXnuRYgy1mJyso TjRgqs2uhOmV13qZgoLUU7ty5PbqHTxBgso+1nY+b+EnRnHkCAMtkob+xA0gHCYkFvFd ROWbbeW0vlx+3EoaBP6xgkCPeStNlabKBQfMWy6rj1AzBDL/HcJkxhM4QGrdIwJBmql6 oSDXpFYpEf8+cJYuOSwM3ylGMnTpO8vHsuczsow+WNwRFPR4KfPjlP85yyYr4iOl6134 pJx7Sx1mtLuq7122k+nWJdCLdm1RK85K/lxG81eIC5VVlR0FIjamj4eeqvvagrCf9ra0 0EeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=YUnK79nC; 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 s24-20020aa7d798000000b00443dbda68c1si6398839edq.176.2022.09.12.16.50.12; Mon, 12 Sep 2022 16:50:12 -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=20210112 header.b=YUnK79nC; 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 1FD0968BB03; Tue, 13 Sep 2022 02:50:10 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F16D468B440 for ; Tue, 13 Sep 2022 02:50:02 +0300 (EEST) Received: by mail-pl1-f174.google.com with SMTP id iw17so10124631plb.0 for ; Mon, 12 Sep 2022 16:50:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=N1VjGaauDIRA90G/40GpiBYn/sDu/tQIlMGneH7G0+o=; b=YUnK79nCMEIQ9uMnA5IVhcx44LHYzZe2ePhPg6xRx7PP1ouhdxUuTI86FHpsCf0ZAa uc+zdwsFinOiQy9zb2hgvIaXr0ZFyfOm/IMyfpBjLSxL6KURAbGbgBlLxEwmeaFwfnt2 0kLWMBY1ckrIKYIDU9kJqeqWBeLNrQaXO5FlfDQUbUKl9I2luwl/WhrATW/w//4TYYEb kUormH6o1aFfcjq242NZBop002/Gia5r2QlHnL05lYoLIFTgfUIpEX/p6P5dgH9e/QsK 0Y2EIdDQGg/Avr4IRW7vOu8oI5dGvki9sqnlI5/95CLv0bK8MGnpnJ68ta0Zw2k3cmQn KHKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=N1VjGaauDIRA90G/40GpiBYn/sDu/tQIlMGneH7G0+o=; b=0eaQUkqDCVxh/TVPnPgnUOO397VBdWnC5mwgGlxr0SPtokTC7p8aWxJ0ZiVsQXPJU3 L/d+OVWWQZKfZfeWZxOxpso03+huBacFL3lzohz98cHERrKHrzx6Nwhxhf505XQo5cuz V7KuaK358uER2orH4vc+T/Vkue7lN/4t18hygqPQZpCPeyqSDnIROV1D7WMP/pZ6Wei2 N+W63lWIora5vNj778RPUU8d0um3nUdi55s6+A3j2WriypMbHEh/iasOLWp4K4M8CBld AdC4tuSGb8vxx/i0WI3PH846uylTlgq960fF9ty1p0J1D0j+6Xjwo2tvYz4cuK8wIOnX Hugw== X-Gm-Message-State: ACgBeo2RJsPArvFMOxnnWS07CIJp03UZceIok7XQF6a3fwFnB+YWs6Id jHMnssQsvynOPEjzjq4dsxtUIfWi1rI= X-Received: by 2002:a17:90a:1f49:b0:202:7a55:558f with SMTP id y9-20020a17090a1f4900b002027a55558fmr917533pjy.108.1663026600507; Mon, 12 Sep 2022 16:50:00 -0700 (PDT) Received: from wilferico.thefacebook.com ([2620:10d:c090:400::5:62d5]) by smtp.gmail.com with ESMTPSA id s8-20020a17090a880800b0020036e008bcsm5895518pjn.4.2022.09.12.16.49.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Sep 2022 16:49:59 -0700 (PDT) From: Chema Gonzalez To: ffmpeg-devel@ffmpeg.org, u@pkh.me, rsbultje@gmail.com Date: Mon, 12 Sep 2022 16:49:56 -0700 Message-Id: <20220912234956.2879286-1-chemag@gmail.com> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] doc/examples/extract_mvs: add motion information 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: Chema Gonzalez Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: IdSRsKDrepGu Note that the motion information includes subpel motion information This was likely forgotten in 56bdf61baa04c4fd8d165f34499115ce0aa97c43. Tested: ``` $ make examples -j ... $ doc/examples/extract_mvs in.264 | head -40 | \ csvcut -C framenum,source,flags |csvlook | blockw | blockh | srcx | srcy | dstx | dsty | motion_x | motion_y | motion_scale | | ------ | ------ | ----- | ---- | ----- | ---- | -------- | -------- | ------------ | | 16 | 16 | 20 | 26 | 8 | 8 | 49 | 72 | 4 | | 16 | 16 | 152 | 15 | 136 | 8 | 65 | 28 | 4 | | 16 | 8 | 360 | 3 | 360 | 4 | 1 | -6 | 4 | | 16 | 8 | 360 | 13 | 360 | 12 | -1 | 4 | 4 | | 16 | 16 | 440 | 10 | 440 | 8 | 3 | 10 | 4 | | 8 | 16 | 829 | 7 | 836 | 8 | -31 | -6 | 4 | | 8 | 16 | 844 | 7 | 844 | 8 | -1 | -4 | 4 | | 16 | 16 | 1,004 | 14 | 1,048 | 8 | -177 | 24 | 4 | | 16 | 16 | 1,096 | 8 | 1,096 | 8 | -1 | 0 | 4 | | 16 | 8 | 1,417 | 24 | 1,416 | 4 | 7 | 82 | 4 | | 16 | 8 | 1,416 | 13 | 1,416 | 12 | 0 | 6 | 4 | | 16 | 8 | 87 | 20 | 88 | 20 | -7 | 0 | 4 | | 16 | 8 | 99 | 44 | 88 | 28 | 45 | 66 | 4 | ... ``` Also: ``` $ make fate -j ... ``` --- doc/examples/extract_mvs.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/examples/extract_mvs.c b/doc/examples/extract_mvs.c index cc1311da91..b80ba26bb7 100644 --- a/doc/examples/extract_mvs.c +++ b/doc/examples/extract_mvs.c @@ -61,10 +61,11 @@ static int decode_packet(const AVPacket *pkt) const AVMotionVector *mvs = (const AVMotionVector *)sd->data; for (i = 0; i < sd->size / sizeof(*mvs); i++) { const AVMotionVector *mv = &mvs[i]; - printf("%d,%2d,%2d,%2d,%4d,%4d,%4d,%4d,0x%"PRIx64"\n", + printf("%d,%2d,%2d,%2d,%4d,%4d,%4d,%4d,0x%"PRIx64",%4d,%4d,%4d\n", video_frame_count, mv->source, mv->w, mv->h, mv->src_x, mv->src_y, - mv->dst_x, mv->dst_y, mv->flags); + mv->dst_x, mv->dst_y, mv->flags, + mv->motion_x, mv->motion_y, mv->motion_scale); } } av_frame_unref(frame); @@ -166,7 +167,7 @@ int main(int argc, char **argv) goto end; } - printf("framenum,source,blockw,blockh,srcx,srcy,dstx,dsty,flags\n"); + printf("framenum,source,blockw,blockh,srcx,srcy,dstx,dsty,flags,motion_x,motion_y,motion_scale\n"); /* read frames from the file */ while (av_read_frame(fmt_ctx, pkt) >= 0) {