Program created with the purpose of analysing a video and creating 40 second long snippets based on the status of a lightbulb. More specifically, when the lightbulb is first found to be on, the code createws a .WMV file of the preceeding 20 seconds and the 20 seconds following the activation of said lightbulb. The program works its magic on every single wmv file in its directory creating an OUTPUT folder in which files with the format output_<filename>-<clip#>.wmv
are saved. As you can see, the program creates a clip for every single lightbulb activation within a file, no matter how many, as long as they do not occur within 20 seconds of the previous lightbulb activation (as this would be part of the previous truncated clip.
For a proper reading, it is necessary for the lightbulb to be within the region shown below. Moreover, if possible, place lightbulb in such a way as to eliminate extraneous light in its immediate vicinity whether it be caused by other lights or the lightbulb's own reflection Spaces in filenames are allowed!
Tip: An electrical tape square under the light solves both of these problems.
For future reference: the framing of mouse 61's recall test under the effects of Citalopram was spot on! ;)
Administrator Privileges Required
-
Download and install all of the following files in the order in which they appear:
-
Visual Studio 2019 : https://aka.ms/vs/16/release/vc_redist.x64.exe
-
Python 3.7.3 : https://www.python.org/ftp/python/3.7.3/python-3.7.3-amd64.exe
Custom->Next->Add Python to environment variables
-
NumPy : Open CMD and type
pip install numpy
-
ffmpy : Open CMD and type
pip install ffmpy
-
OpenCV : Open CMD and type
pip install opencv-python
-
ffmpeg : https://ffmpeg.zeranoe.com/builds/win64/static/ffmpeg-20190620-86f04b9-win64-static.zip
- Follow instructions found here : https://www.wikihow.com/Install-FFmpeg-on-Windows
-
-
Download firefly.py and position it in a folder with all of the .wmv files you want examined
-
Open firefly.py in IDLE (Python 3.7 64-bit)
File->Open...
-
Run firefly.py
Run->Run Module
-
Wait for completion, should take about 20 seconds per 10-minute video
DO NOT MANIPULATE THE FILE STRUCTURE UNTIL THE PROGRAM FINISHES
Administrator Privileges Required
-
Download and install all of the following files in the order in which they appear:
- Pip :
sudo apt-get install python-pip
- ffmpeg :
sudo apt-get install ffmpeg
- ffmpy :
pip install ffmpy
- NumPy :
pip install numpy
- OpenCV :
pip install opencv-python
- Pip :
-
Download firefly.py and position it in a folder with all of the .WMV files you want examined
-
Open a Terminal window and navigate to the directory which you have selected
cd /...
-
Run firefly.py
python firefly.py
-
Wait for completion, should take about 20 seconds per 10-minute video
DO NOT MANIPULATE THE FILE STRUCTURE OR THE TERMINAL WINDOW UNTIL THE PROGRAM FINISHES
IF YOU WISH TO PLAY THE .WMV FILES THEN YOU WILL NEED TO INSTALL UBUNTU RESTRICTED EXTRAS