Debugging Macroblocks and Motion Vectors
You can use ffmpeg
or ffplay
to analyze motion vectors in a video file.
Previous versions of ffmpeg (pre-October 2017) allowed you to analyze macroblocks too, but this option was removed.
The `codecview` filter can be used to show motion vectors as small arrows for each macroblock. It takes one option called mv
, which specifies the type of motion vector to be drawn:
pf
– forward predicted motion vectors of P picturesbf
– forward predicted motion vectors of B picturesbb
– backward predicted motion vectors of B pictures
For example, you can use:
ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv=pf+bf+bb ffmpeg -flags2 +export_mvs -i input.mp4 -vf codecview=mv=pf+bf+bb output.mp4
Example:
Caveats:
- Earlier versions of ffmpeg do not have this filter, but support the now deprecated
-vismv
option. - This option does not work for codecs which do not export motion vectors (most non-MPEG based codecs)
Last modified
4 years ago
Last modified on May 7, 2021, 7:16:13 AM
Attachments (12)
- patch1.png (1.1 KB ) - added by 11 years ago.
- patch2.png (1.1 KB ) - added by 11 years ago.
- patch3.png (1.1 KB ) - added by 11 years ago.
- patch4.png (1.1 KB ) - added by 11 years ago.
- patch5.png (1.1 KB ) - added by 11 years ago.
- patch6.png (1.1 KB ) - added by 11 years ago.
- patch7.png (1.1 KB ) - added by 11 years ago.
- patch8.png (1.1 KB ) - added by 11 years ago.
- patch9.png (1.1 KB ) - added by 11 years ago.
- vismv_pf.png (187.1 KB ) - added by 11 years ago.
- visqp.png (143.1 KB ) - added by 10 years ago.
- vis_mb_type.png (199.5 KB ) - added by 10 years ago.
Download all attachments as: .zip
Note:
See TracWiki
for help on using the wiki.