Changes between Initial Version and Version 1 of Debug/MacroblocksAndMotionVectors


Ignore:
Timestamp:
Dec 29, 2013, 11:39:58 AM (6 years ago)
Author:
slhck
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Debug/MacroblocksAndMotionVectors

    v1 v1  
     1You can use `ffmpeg` or `ffplay` to analyze the macroblocks / coding tree units and motion vectors in a video file.
     2
     3== Analyzing Macroblock Types ==
     4
     5You need to specify the `-debug vis_mb_type` option. For example:
     6{{{
     7ffplay -debug vis_mb_type input.mp4
     8ffmpeg -debug vis_mb_type -i input.mp4 output.mp4
     9}}}
     10
     11The output would look something like this:
     12
     13[[Image(vis_mb_type.png)]]
     14
     15In the output video, each macroblock will be colored according to its type. Additionally, you can see the macroblock partitions as small lines. The following table lists the possible colors and the associated macroblock types. Note that these are parsed in order (from top to bottom).
     16
     17||= Color               =||= Macroblock Type Condition                       =||
     18|| [[Image(patch1.png)]] || `IS_PCM` (`MB_TYPE_INTRA_PCM`)                    ||
     19|| [[Image(patch2.png)]] || `(IS_INTRA && IS_ACPRED) || IS_INTRA16x16`        ||
     20|| [[Image(patch3.png)]] || `IS_INTRA4x4`                                     ||
     21|| [[Image(patch4.png)]] || `IS_DIRECT`                                       ||
     22|| [[Image(patch5.png)]] || `IS_GMC && IS_SKIP`                               ||
     23|| [[Image(patch6.png)]] || `IS_GMC`                                          ||
     24|| [[Image(patch7.png)]] || `!USES_LIST(1)`                         ||
     25|| [[Image(patch8.png)]] || `!USES_LIST(0)`                         ||
     26|| [[Image(patch9.png)]] || `USES_LIST(0) && USES_LIST(1)` ||
     27
     28Note that the decoding of macroblock types is MPEG-specific, so this option will not work for VP8 video, for example.
     29
     30== Analyzing Motion Vectors ==
     31
     32The `-vismv` option can be used to show motion vectors as small arrows for each macroblock. It takes one parameter, which specifies the type of motion vector to be drawn:
     33
     34* `-vismv pf` – forward predicted motion vectors of P pictures
     35* `-vismv bf` – forward predicted motion vectors of B pictures
     36* `-vismv bb` – backward predicted motion vectors of B pictures
     37
     38For example, you can use:
     39{{{
     40ffplay -vismv pf input.mp4
     41ffmpeg -vismv pf -i input.mp4 output.mp4
     42}}}
     43
     44Example:
     45
     46[[Image(vismv_pf.png)]]