[FFmpeg-devel] [PATCH v2] not display motionless vectors in examples/extract_mvs.c

numberwolf porschegt23 at foxmail.com
Mon Mar 16 19:21:15 EET 2020


Here, dont need show motionless vectors,because they're useless.
(Sorry about I forget to remove the 'printf' on previous version.)

Signed-off-by: numberwolf <porschegt23 at foxmail.com>
---
 doc/examples/extract_mvs.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/doc/examples/extract_mvs.c b/doc/examples/extract_mvs.c
index de31ccd..eaf7816 100644
--- a/doc/examples/extract_mvs.c
+++ b/doc/examples/extract_mvs.c
@@ -60,6 +60,14 @@ 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];
+
+                    // dont need show motionless vectors
+                    // because they're useless
+                    if (mv->src_x == mv->dst_x && mv->src_y == mv->dst_y) {
+                        printf("extract_mvs skip\n");
+                        continue;
+                    }
+
                     printf("%d,%2d,%2d,%2d,%4d,%4d,%4d,%4d,0x%"PRIx64"\n",
                         video_frame_count, mv->source,
                         mv->w, mv->h, mv->src_x, mv->src_y,
-- 
2.17.2 (Apple Git-113)

Thanks


More information about the ffmpeg-devel mailing list