Skip to content

db0htc/PyMotionExtraction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This script only works on .mp4 files

usage:

(* are mandatory)

   py ME10.py [path_to_file.mp4]* [-i --interval n #seconds] [-t --threshold n #0-255] [--compare-first] [--compare-last] [--output-video]

default flags if only the filename is provided are:

   -i 1 -t 50 --compare-last

default output is a .png file for every frame sample

All parameters

  -i --interval n      This parameter decides the sampling rate of frames from the input video

  -t --threshold n      Threshold for changes between frames, low is more sensitive, high is less sensitive, range is 0-255

  --compare-first      compare all subsequent frames to the first frame in the video. This argument will take precedence over --compare-last, which will be ignored if this is passed

  --compare-last      compare every frame to the frame that preceded it.

  --output-video      If this argument is passed, all output frames generated by the program will be used to create output_video.mp4 The program will not clean up the files afterward. Either 'Del frames*' in cmd.exe or 'rem frames*' in bash will work

Best practices:

Put the phone or offending recording device in some sort of clamp, rest, or mount where it will not move or get easily jostled.

This motion extraction trick relies on each frame being identical, except for anything that has changed between them.

Features to be added:

Choosing a rolling sample period, possibly with a fading effect

Adding altered frames to a copy of the original mp4 file, for smoothness and audio

Streaming file support. Choose a rolling sample period and apply it to an mp4 stream. I can't see this working well on anything but a decently modern desktop computer.

About

Python motion extraction script

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages