I am looking for an open source tool / code or some kind of guide for extracting motion vectors (MV) of an encoded H.264 bit sequence. I already know that motion vectors can be visualized using ffmpeg with the following command:
ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv=pf+bf+bb
However, I want to create a log file in which frames with frames from P and B are listed. I checked the MVs structure from libavutil / motion_vector.h, but I could not find an example that shows how they are extracted and stacked on top of the original sequence using ffplay. I thought that if I could figure this out, I could reinstall the code to extract the MVs into a text file.
I also tried the code provided in this answer , but it does not work with newer versions of ffmpeg:
I would appreciate any examples of codes or hints.
source share