• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

MakefileH A D13-Apr-20211.9 KiB5838

READMEH A D13-Apr-20213.3 KiB9851

arrow_code.cH A D13-Apr-20214.1 KiB164110

arrow_code.hH A D13-Apr-20211.2 KiB275

factory.cH A D13-Apr-20212.4 KiB4827

filter_autotrack_rectangle.cH A D13-Apr-202112.6 KiB401249

filter_autotrack_rectangle.ymlH A D13-Apr-2021208 1211

filter_crop_detect.cH A D13-Apr-20217.1 KiB248135

filter_motion_est.cH A D13-Apr-202133.3 KiB1,153791

filter_motion_est.hH A D13-Apr-20211.4 KiB4318

filter_motion_est.ymlH A D13-Apr-2021197 1211

filter_vismv.cH A D13-Apr-20214.2 KiB15682

filter_vismv.ymlH A D13-Apr-2021184 1211

gplH A D13-Apr-20210

producer_slowmotion.cH A D13-Apr-202113.1 KiB415263

producer_slowmotion.ymlH A D13-Apr-2021193 1211

sad_sse.hH A D13-Apr-20219.4 KiB430320

README

1INTRO:
2
3This module is designed to provide application agnostic motion estimation.
4I wrote it from scratch because I found the other Open Source code to be
5limited by their difficulty of reuse.
6
7
8COMPILE:
9
10To compile this module, you must supply these options to the root configure script:
11
12--enable-gpl --enable-motion-est
13
14
15EXAMPLES:
16
17Estimate the motion:
18
19	> melt -filter motion_est <movie_file>
20
21To display the motion vectors as pretty arrows:
22
23	> melt -filter motion_est -filter vismv <movie_file>
24
25If your using a movie file that contains a crop, you will get better results with this:
26
27	> melt -filter crop_detect -filter motion_est -filter vismv <movie_file>
28
29If your computer is unable to do the above examples in real time, try this:
30
31	> melt -filter motion_est -filter vismv -consumer melt real_time=0 <movie_file>
32
33If you'd like to see the motion vectors without the median denoising function, do this:
34
35	> melt -filter motion_est denoise=0 -filter vismv <movie_file>
36
37To reconstruct each frame by applying the motion to the previous frame:
38
39	> melt -filter motion_est show_reconstruction=1 <movie_file>
40
41To compare the reconstructed frame and the real frame (while paused):
42
43	> melt -filter motion_est show_reconstruction=1 toggle_when_paused=1 <movie_file>
44
45To show the difference (residual) between the reconstructed frame the real frame:
46
47	> melt -filter motion_est show_residual=1 <movie_file>
48
49To automatically track an object in the frame, try this:
50
51	> melt -filter autotrack_rectangle:X,Y:WxH debug=1 <movie_file>
52
53(Where X,Y is the origin of the rectangle indexed from upper left and WxH is the dimensions of the rectangle.)
54
55To obscure that same object in the frame, try this:
56
57	> melt -filter autotrack_rectangle:X,Y:WxH obscure=1 <movie_file>
58
59There is now a slow motion producer that does interpolation based on the motion vectors:
60
61	> melt slowmotion:<movie_file> _speed=0.1 method=1 debug=1
62
63NOTES (and deficiencies):
64
651.  Ignore shot change detection when your using the autotrack_rectangle filter.
66
672.  Don't assume motion vectors displayed while stepping backwards and forward are that same vectors
68    that would be calculated while playing the footage from start to finish, nonstop. Stepping forward
69    should be fine after a few frames, however.
70
713.  SSE instructions are lazily assumed. MMX, Altivec, and SIMD-less would be good too.
72
734.  Motion estimation is only performed in the luma color space.
74
755.  Motion vectors should have sub-pixel accuracy.
76
776.  Motion vectors are not serializable yet.
78
797.  A diligent test suite is needed. (show_reconstruction & show_residual are a start)
80
818.  Multithreaded code will see HUGE benefits on multi-CPU systems. Donations of a multi-core cpu or a
82    multi-cpu system to the author will encourage development.
83
849.  Macroblock sizes are not dynamic (Though settable at runtime.)
85
8610. Notes (5), (7), and (9) would go a long ways to making this code suitable for a modern video encoder.
87
8811. Shot change works well but arbitrarily chosen thresholds need to be tuned.
89
9012. Given the documentation of other motion estimation code bases, I will GLADLY clarify and
91    document any piece of code upon request.
92
9313. Considerable effort has been put into the speed. I usually experience 10ms or less per frame for PAL on 2.8GHZ p4.
94
95Zachary Drew
96drew0054@tc.umn.edu
97
98