We release mpegflow for easy extraction of MPEG-flow (motion vectors) from video files along with a visualization tool vis, both under the MIT license. We provide Makefiles for Linux / Windows and distribute binary releases.
Please submit bugs on GitHub directly. For any other question, please contact Vadim Kantorov at [email protected] or [email protected].
If you use this code, please cite our work:
@inproceedings{kantorov2014,
author = {Kantorov, V. and Laptev, I.},
title = {Efficient feature extraction, encoding and classification for action recognition},
booktitle = {Proc. Computer Vision and Pattern Recognition (CVPR), IEEE, 2014},
year = {2014}
}
The tool accepts a video file path as command-line argument and writes MPEG-flow (motion vectors) to standard output. By default, the tool outputs the motion vectors arranged in two matrices - dx and dy.
Option | Description |
---|---|
--help or -h | will output the usage info |
--raw | will prevent motion vectors from being arranged in matrices |
--forcegrid8 | will force fine 8x8 grid |
--forcegrid16 | will force coarse 16x16 grid |
--occupancy | will append occupancy matrix after motion vector matrices |
--quiet | will suppress debug output |
The tool accepts a video file path as command-line argument, output of mpegflow on standard input and displays (or dumps) visualization of motion vectors overlayed on video frames.
Option | Description |
---|---|
--help or -h | will output the usage info |
--dump dumpDir | will skip showing visualization on screen and will save the images to dumpDir instead |
--occupancy | will expect occupancy information from mpegflow and will visualize it as well |
mpegflow depends only on a recent FFmpeg, vis depends on FFmpeg, OpenCV and libpng. The tools are known to work with FFmpeg 2.7.2 and OpenCV 2.4.11. We strongly recommend using dependencies/install_ffmpeg_here_linux.sh
and dependencies/install_opencv_here_linux.sh
, even if you already have the dependencies installed elsewhere. Once the dependencies are visible to g++, run make
to build mpegflow and make vis
to build vis.
To build tools on Windows:
- Follow
dependencies/install_dependencies_here_windows.txt
- Fix OPENCV_DIR, FFMPEG_DIR, VC_VERSION, OPENCV_ARCH in Makefile.nmake if needed
- Run from Visual Studio Developer Command Prompt (VS2013 x64 Native Tools Command Prompt from VS2013 Community Edition worked for us):
$ nmake -f Makefile.nmake