Giter Site home page Giter Site logo

breakthrough / pyscenedetect Goto Github PK

View Code? Open in Web Editor NEW
2.8K 2.8K 361.0 153.42 MB

:movie_camera: Python and OpenCV-based scene cut/transition detection program & library.

Home Page: http://scenedetect.com

License: Other

Python 99.84% HTML 0.08% CSS 0.08%
analysis image-processing opencv python python-opencv scene-detection scene-recognition video video-processing

pyscenedetect's People

Contributors

breakthrough avatar bubalazi avatar colelawrence avatar dadus33 avatar dependabot[bot] avatar dlu avatar e271828- avatar elcombato avatar filips-alpe avatar ivan23kor avatar jffaria avatar kianmeng avatar leingang avatar lgtm-com[bot] avatar lvdingqin avatar markusbauer avatar mtillmann avatar nathanielcwm avatar obroomhall avatar petrpulc avatar piercus avatar scarwire avatar soumitraagarwal avatar spanglelabs avatar stlalpha avatar talkain avatar tonycpsu avatar wjs018 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyscenedetect's Issues

Issue with stats_file: -s

scenedetect -i 01.mp4 -s FILE -d content

Getting the same issue: in detect_scenes ['Frame Number'] + ['Timecode'] + stats_file_keys) TypeError: can only concatenate list (not "dict_keys") to list

Could someone let me know how you solved this problem.

In Issue: 34
#34

it's suggested to use -co but I am agree with comment from @msbrown: I am not looking for -co as that outputs scenes. What I want is a file with the column that denotes the average intensity of the pixel so I can determine the threshold.

Precise Splitting

Is there any interest in a PR for using ffmpeg to do precise splitting of files? I know the current splitting only works on key-frames.

error in python example: detect_scenes_file() takes exaclty 2 arguments (3 given)

Hello! This is an excellent project and thanks for your contribution!
I just try your demo in python:

import scenedetect

scene_list = []        # Scenes will be added to this list in detect_scenes().
path = 'my_video.mp4'  # Path to video file.

# Usually use one detector, but multiple can be used.
detector_list = [
    scenedetect.detectors.ThresholdDetector(threshold = 16, min_percent = 0.9)
]

video_framerate, frames_read = scenedetect.detect_scenes_file(
    path, scene_list, detector_list)

# scene_list now contains the frame numbers of scene boundaries.
print scene_list

# create new list with scene boundaries in milliseconds instead of frame #.
scene_list_msec = [(1000.0 * x) / float(video_fps) for x in scene_list]

# create new list with scene boundaries in timecode strings ("HH:MM:SS.nnn").
scene_list_tc = [scenedetect.timecodes.get_string(x) for x in scene_list_msec]

When I run the simple python example, I encountered following problems:

TypeError: detect_scenes_file() takes exactly 2 arguments (3 given)

And I find no other people have the same problem with me, can anybody help me with this issue? Thanks a lot!

Installation Error

Hello,

I'm running a Mac OSX 10.10.5 with all dependencies installed but I am running into an error when trying to install PySceneDetect.

I download and extract the files, place them on my desktop, but when I run the command
python setup.py install with the correct file path I keep receiving the same error message: IOError: [Errno 2] No such file or directory: 'package-info.rst'

The .rst file is in same folder, so I am not sure why it isn't being detected. Any help appreciated!

Support for Live Video Stream (Non-Terminating) Processing Mode

PySceneDetect should have a mode that allows for an OpenCV VideoCapture object that doesn't terminate (e.g. a webcam, or live internet stream) and continually provides updates for when a new scene is detected. This should work fine with both of the currently implemented scene detectors (ThresholdDetector and ContentDetector), although the main detection loop function scenedetect.detect_scenes() will need to be changed.

Using the set format, a timecode should be printed, followed by a newline, at the discovery of each new scene. This should allow other programs monitoring the process output a notification that a new scene was found. Additionally, for integration with other Python programs, an incremental version of detect_scenes() should be created that allows the user to pass one frame per call, with the function returning the current frame number if a scene change was detected, or None otherwise.

Quiet mode coded to not work

Thank you for this useful tool. It's really useful in the work I'm doing right now.

In manager.py, the SceneManager object takes quiet_mode as a Boolean keyword argument, but line 64 always initializes it to False.

Error in simple example, PySceneDetect Python Interface

In the documentation for PySceneDetect here , the sample program returns the error NameError: name 'video_fps' is not defined . I believe that the correction would be changing it to video_framerate. Is there a better place to raise such an issue? ๐Ÿ˜จ

Find 10 scenes while only generate 7 chips...

Hello!
This scenedetectpr works effeciently, but while I'm using it, I came across a problem.
The output tells me that
Processing complete, found 10 scenes in video.
However ,the number of generated chips is only 7
Is there anything to do with the Muxing took 0 seconds?
Many thanks!

Inconsistent video splitting

I'm having some troubles trying to save the splits of a video.
If I run the following command
scenedetect -i myvideo.mp4 -d content -t 30
I get the following output

...
[PySceneDetect] Processing complete, found 76 scenes in video.
...

If I try to save the output as .mkv scenedetect -i myvideo.mp4 -d content -t 30 -o myvideo-scene.mkv I only get 25 scenes.
If I try to save only the .csv file scenedetect -i myvideo.mp4 -d content -t 30 -o scenes.csv it looks like the program is trying to write the actual video splits in a csv files because in the end I get again 25 csv files

runtime error with TypeError

Hello,

I'm trying to test pySceneDetect with Python 2.7.12, numpy 1.11.1, scipy 0.17.1 and openCV 2.4.13 on Windows 10 64bit.
All seemed good but I got error when trying to run PySceneDetect on command line, that was:

C:\Works>scenedetect -i goldeneye.mp4
[PySceneDetect] Detecting scenes (threshold mode)...
[PySceneDetect] FATAL ERROR - could not open video goldeneye.mp4.
Traceback (most recent call last):
File "C:\2ndPrograms\Python27\Scripts\scenedetect-script.py", line 9, in
load_entry_point('PySceneDetect==0.3.4', 'console_scripts', 'scenedetect')()
File "c:\2ndprograms\python27\lib\site-packages\scenedetect__init__.py", line 346, in main
timecode_list = timecode_list
TypeError: 'int' object is not iterable

What is my fault? I think your code worked correctly but someone said TypeError needed to be fixed like in using List according to googling.
Sorry for writing this asking in Issue raising page.
Thank you.

Long File name error

O:\PySceneDetect-0.4-win64-portable>scenedetect -i O:\ffmpeg\I\Plugable USB-C to
HDMI Adapter Review.webm -st 00:00:02 -et 00:01:34 -d content -df 4 -o O:\ffmpe
g\bin\Ann\antm.mkv
usage: scenedetect [-h] [-v] -i VIDEO_FILE [-o OUTFILE.mkv] [-co OUTPUT.csv]
[-t value] [-m num_frames] [-p percent] [-b rows]
[-fb percent] [-s STATS_FILE] [-d detection_method] [-l]
[-q] [-st time] [-dt time] [-et time] [-df factor]
[-fs num_frames] [-si]
scenedetect: error: argument -i/--input: can't open 'O:\ffmpeg\I\Plugable': [Err
no 2] No such file or directory: 'O:\ffmpeg\I\Plugable'

If I change only short name like Plugable or A.webm then it works, kindly fix this name issue problem!

TypeError: can only concatenate list (not "dict_keys") to list

Hello, I've met this issue when typing command: scenedetect -i 01.mp4 -s FILE -d content
And got this info back:
[PySceneDetect] Detecting scenes (content mode)... [PySceneDetect] Parsing video 01.flv... [PySceneDetect] Video Resolution / Framerate: 512 x 288 / 15.167 FPS Verify that the above parameters are correct (especially framerate, use --force-fps Traceback (most recent call last): File "scenedetect\__main__.py", line 40, in <module> File "scenedetect\__init__.py", line 302, in main File "scenedetect\__init__.py", line 144, in detect_scenes_file File "scenedetect\__init__.py", line 228, in detect_scenes TypeError: can only concatenate list (not "dict_keys") to list Failed to execute script __main__
I was tending to get the statistic data to tweak the threshold.
The program run under windows7(x64) command line. The version is 0.4.
Any solution? Thx...

problem while using multi-threading in python

File "C:\Users\Lynn.thonny\BundledPython36\lib\site-packages\scenedetect\detectors.py", line 262, in process_frame
if self.last_frame is not None:
AttributeError: 'ContentDetector' object has no attribute 'last_frame'

the error above happened when I used muti-thread in python

Feature request: HTML export

I'd love a feature, similar to the existing CSV export, that saved each detected scene into a formatted HTML document that included the thumbnail frames that get saved out on scene detection change.

The HTML doc would contain a table with the same headers as the CSV currently has. However, there'd be a "Frame Image" column that includes one or more of the JPG frame grabs. Each scene would be represented by a row.

For folks who want to do further analysis (in Excel, for instance), it'd much easier to import an HTML table into Excel than it is to add images to a table without them - although that's also possible with an Excel macro.

You can construct the HTML file in the same section of code that currently builds the CSV, either using an HTML builder (I'm sure Python supports one?) or even just by hand by writing out the table markup.

Anyhow, super awesome piece of code you've got. Totally made my day yesterday!

Reference of paper for the methods used.

Hi Brandon,

Thanks this is a great work! Could you please list the paper(if there is any) that inspired the detection algorithms? It would be nice if I can see the the paper and decide whether this is the right algorithm or how to change it to meet my own application.

Thanks.

Improvements to common video use-cases, using @albanie's shot-detection-benchmarks

This issue is for the discussion of PySceneDetect's performance with respect to the shot-detection-benchmarks repo by @albanie, which includes a variety of shot detection benchmarks with real-world footage (e.g. movies, sports, TV shows).

The discussion here should focus on (but is certainly not limited to) determining the optimal parameters for current and any future detection methods, for each of the test cases in the shot-detection-benchmarks repo. The parameters listed will include those that both improve the accuracy of PySceneDetect for a particular test case, as well as the run-time performance where possible.

Furthermore, any other algorithm-specific changes or issues specifically pertaining to issues with the test footage will be added to this post for tracking and future reference. In the resources branch, I will eventually include a downloaded .MP4 version of the test cases and incorporate them as unit tests for PySceneDetect. The test cases may be expanded in the future should additional benchmarks be included in @albanie's shot-detection-benchmarks repo.

Video Analysis

I'm trying to generate stats_file to try to determine the best threshold (-t).
I was able to generate it using -s FILE_NAME and also generated the splits using -co, but I'm not able to plot the graph like the one in (https://raw.githubusercontent.com/Breakthrough/PySceneDetect/resources/images/threshold-param-example.png).

the stats file contains the following columns and 1979 rows (frames) for the sample video provided in the docs.
Frame Number Timecode delta_hue delta_lum delta_hsv_avg delta_sat
my question is how can I get a nice graph that helps me determine the right threshold?

Proper Implementation of OpenCV 2/3 Compatibility Fix

Currently, compatibility is maintained between different OpenCV versions by reassigning the VideoCapture object properties in older versions to be compatible with the new interface in OpenCV 3.0. These changes included moving everything in cv2.cv to the cv2 module directly, and removing the CV_ prefix on the capture properties.

This is currently implemented in PySceneDetect by checking the cv2.__version__ property as follows:

# Compatibility fix for OpenCV < 3.0
if (cv2.__version__[0] == '2') or (not cv2.__version__[0] == '3'):
    cv2.CAP_PROP_FRAME_WIDTH = cv2.cv.CV_CAP_PROP_FRAME_WIDTH
    cv2.CAP_PROP_FRAME_HEIGHT = cv2.cv.CV_CAP_PROP_FRAME_HEIGHT
    cv2.CAP_PROP_FPS = cv2.cv.CV_CAP_PROP_FPS
    [...]

As per the above code, currently, the first character of the version string is checked to see if it is either a 2 or not a 3. I am unsure if this approach is correct, as some cv2 Python modules pre-OpenCV 3.0 report a version string in the format rev.1234 as opposed to 2.4.3 or 3.0.0.

A better method of implementing this compatibility should be found, especially one that avoids checking the version string, and adds the new properties to the cv2 module programmatically.

found 0 scenes in video

scenedetect -i Video/218.mp4 -o Videos/218result.mkv
PySceneDetect] Detecting scenes (threshold mode)...
[PySceneDetect] Parsing video 218.MP4...
[PySceneDetect] Video Resolution / Framerate: 480 x 320 / 25.000 FPS
Verify that the above parameters are correct (especially framerate, use --force-fps to correct if required). [PySceneDetect] Processing complete, found 0 scenes in video.
[PySceneDetect] Processed 500 /500 frames in 0.3 secs (avg. 1688.9 FPS).

I am wondeing why found 0 scenes...
From my perspective, I have seen at least 3 scenes.
Is there anything wrong the way I use it?
ubuntu16.04 , Python 3.5.2
Thanks!

Progress regarding refactor

I couldnt notice there was done anything refactoring lately, it that still underway? Or has it stopped? I have some ideas on how we can make this more modular. Atm it seems like the library is written to support the cli.

Unable to run scenedetect on bluemix cf app

I am running a python flask app on bluemix. The code runs perfectly well on local machine( macbook pro) but for some reason I am unable to run it on bluemix. Error is shown below:

TypeError: 'int' object is not iterable

The reason I am getting this error is because opencv-python which is being installed (via pip) does not support ffmpeg and thus it is unable to run this line of code.

cap = cv2.VideoCapture(video_file_path)
cap.isOpened()

returns false

Any solution for this?

Not processing the whole video

Is there any limit to the size of video to be processed? I'm using the scenedetect scenedetect --input GOPR1631.MP4 -d content -df 4 command and it seems like it is processing only 26 frames.
[PySceneDetect] Detecting scenes (content mode)... [PySceneDetect] Parsing video GOPR1631.MP4... [PySceneDetect] Video Resolution / Framerate: 1280 x 720 / 29.970 FPS [PySceneDetect] Subsampling Enabled (4x, Resolution = 320 x 180) Verify that the above parameters are correct (especially framerate, use --force-fps to correct if required). [PySceneDetect] Processing complete, found 0 scenes in video. [PySceneDetect] Processed 26 frames in 38.6 secs (avg. 0.7 FPS).

The video I'm using is of size 4GB and am pretty sure it quite a large number frames. It is working fine with videos of relatively small sizes (few MBs) whereas when used for big videos it is processing only 26 frames. Currently I have no clue why is it so, am I missing some parameter? Thanks!

Color histogram method

I noticed that you have a stub for a HistogramDetector. I have completed a proof-of-concept using this method in this notebook.

Do you think this is a sound approach? I don't have a lot of experience with this kind of problem so I am curious to hear your thoughts. I would love to integrate this into pyscenedetect.

Splitting Clips

Hey @Breakthrough, thanks for this great project. I've been processing some clips and the scene detection seems right on. My project is detecting the scenes in an AVI file and splitting them into separate clips. The docs seem to hint that the detection CSV can be passed to ffmpeg or something, but I can't for the life of me figure out how to do that.

Is this easy to do or should I write a little Python wrapper that calls ffmpeg in a subprocess?

Specifically, I'm looking at this part of the docs that is empty.

Thanks!

Need to save Images to desired folder or disable

scenedetect -i "O:\B.mkv" -d content -si -df 4 -o O:\ffmpeg\bin\O\3.mkv
I need two option

  1. Save all extracted images to desired folder rather than spread out PySceneDetect-0.4-win64-portable folder, it will be cozy to manage!
    Or
  2. Disable all image when I choose only video files.

Errors while running the file

I took the example from python interface with pyscendetect which was given in the official website of pyscenedetect. I am trying to detect the changed scenes in the video to implement it for video forgery project. The example is giving me this error. I have installed the pyscenedetect package still it is showing some files are not imported. What do you think is going wrong and do you think pyscenedetect will be good module for making video forgery detection in realtime. Please help....

(rijuta) rijuta@rijuta-HP-Notebook:~/Video_analytics/PySceneDetect-0.4/python-scene-detection-tutorial-master/examples$ python scenedetect_example.py testvideo.mp4
Parsing video testvideo.mp4...
Video Resolution: 1280 x 720
Traceback (most recent call last):
File "scenedetect_example.py", line 58, in
main()
File "scenedetect_example.py", line 37, in main
path, scene_list)
File "build/bdist.linux-x86_64/egg/scenedetect/init.py", line 96, in detect_scenes_file
AttributeError: 'list' object has no attribute 'timecode_list'

PySceneDetect outputs 0x0 video resoultion and 0 fps, then freezes

this is what I got from command
$ ./scenedetect.py --input ../testvideo.mp4 --output ../test.csv --detector content --threshold 30 -fs 2 -df 2 -l
[PySceneDetect] Detecting scenes (content mode)...
[PySceneDetect] Parsing video ../testvideo.mp4...
[PySceneDetect] Video Resolution / Framerate: 0 x 0 / 0.000 FPS
[PySceneDetect] Subsampling Enabled (2x, Resolution = 0 x 0)
Verify that the above parameters are correct (especially framerate, use --force-fps to correct if required).

running on CentOs 7.0 , Python 2.7.5
please help
Thanks

Raised unknown C++ exception!

Hello,

I have tried to install this software but have no luck to run it with my video yet.
Mac OS 10.12.5, Python 2.7.11, OpenCV 3.2, PySceneDetect v0.4, Numpy 1.13.0

scenedetect -i ~/Downloads/1.avi -d content -t 30
[PySceneDetect] Detecting scenes (content mode)...
VIDEOIO(cvCreateFileCapture_AVFoundation (filename)): raised unknown C++ exception!
[PySceneDetect] FATAL ERROR - could not open video /Users/Paul/Downloads/1.avi.
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/bin/scenedetect", line 9, in <module>
load_entry_point('PySceneDetect==0.3.6', 'console_scripts', 'scenedetect')()
File "build/bdist.macosx-10.6-intel/egg/scenedetect/__init__.py", line 302, in main
ValueError: need more than 2 values to unpack

However, testvideo works fine:

scenedetect -i ~/Downloads/testvideo.mp4 -d content -t 30
[PySceneDetect] Detecting scenes (content mode)...
[PySceneDetect] Parsing video testvideo.mp4...
[PySceneDetect] Video Resolution / Framerate: 1280 x 720 / 29.970 FPS
Verify that the above parameters are correct (especially framerate, use --force-fps to correct if required).
[PySceneDetect] Processing complete, found 3 scenes in video.
[PySceneDetect] Processed 720 / 720 frames read in 36.2 secs (avg 19.9 FPS).
[PySceneDetect] Comma-separated timecode output:
00:00:01.001,00:00:06.006,00:00:13.146
>>> import cv2
>>> c = cv2.VideoCapture('~/Downloads/1.avi')
VIDEOIO(cvCreateFileCapture_AVFoundation (filename)): raised unknown C++ exception!

>>> c = cv2.VideoCapture('~/Downloads/1.avi', cv2.CAP_FFMPEG)
>>> c.isOpened()
False

>>> c = cv2.VideoCapture('~/Downloads/testvideo.mp4')
VIDEOIO(cvCreateFileCapture_AVFoundation (filename)): raised unknown C++ exception!

Please advise.

Update README with comparison vs. other scene detect tools

Hi, this looks like a neat project, and a few quick tests with some videos showed promising results. Unfortunately, it's much slower than other scene detection tools I've experimented with, so unless it gets faster or the detection capability is much better, I'm not sure it will meet my needs.

The other tools I've used for content scene detection are ffprobe:

ffprobe -show_frames -of compact=p=0 -f lavfi "movie=${FILE},select=gt(scene\,${THRESHOLD})

and x264 (transcoding the video with ffmpeg first to make it faster:

ffmpeg -i ${FILE} -vf scale=320:-1 -sws_flags neighbor -an -pix_fmt yuv420p -f yuv4mpegpipe - 2>/dev/null | x264 - --demuxer y4m --bframes 0 --min-keyint 10 --scenecut ${THRESHOLD} --preset superfast --crf 30 --threads 1 -v --output /dev/null 2>&1 | grep scene | cut -d ' ' -f 6

(ffmpeg also has a blackframe filter, but I haven't used it much and am more interested in detection when there aren't black frames to make things easy.)

I'm sure you're familiar with these approaches, and I'm wondering if you've spent any time comparing them to your tool for quality / speed. I see you have an open issue to reduce the file size to make things faster, but even with a ~2m long 320x180 file, I'm seeing 17 seconds for your tool vs. 8 seconds for x264 vs. less than a second for ffprobe. I've subjectively found x264 to do a better job than ffprobe, so I think parity with it would be compelling enough reason to switch.

So, my actual questions:

  1. Do you think that's an achievable performance target for your tool?
  2. If not, do you think the slowness is coming from OpenCV or Python?
  3. Would you consider adding some text to the README documenting what's better about your tool over these others?

I know you have plans to add some other detection methods,, which sounds great, but right now, I don't see a compelling reason to switch given the speed difference.

Nonetheless, this is a really cool project, and I'll be interested to see how it develops in the future.

Add Man-Page for Unix-Like Systems

As per title, add a man-page synopsis so users can call man scenedetect for detailed usage help.

In PySceneDetect v0.5-beta-1, help text / a complete CLI reference can be obtained via scenedetect help all or from this page.

Perhaps use Pandoc to convert a designated Markdown file during package creation:
http://www.pandoc.org/demos.html

Or calling PySceneDetect itself to generate the manpage file via the help all command piped to a text file?

Not sure what the best solution is, but ideally, it would re-use as much information/resources already available as possible, and be automated to make continuous integration and future releases much smoother.

Error generating stats_file

Hello,
I'm trying to use the PySceneDetect via CLI and the application generates an error when adding the -s / --statsfile option.
I'm using version v0.4
I even used the same video file available in the PySceneDetect/docs/examples/usage-example.md

but still same error.
here is the command I executed
scenedetect -i goldeneye.mp4 -o scenes_list.mp4 -d content -si -df 4 -s stats.csv
and here is the result

[PySceneDetect] Detecting scenes (content mode)...
[PySceneDetect] Parsing video goldeneye.mp4...
[PySceneDetect] Video Resolution / Framerate: 1280 x 544 / 23.976 FPS
[PySceneDetect] Subsampling Enabled (4x, Resolution = 320 x 136)
Verify that the above parameters are correct (especially framerate, use --force-fps to correct if required).
Traceback (most recent call last):
File "scenedetect_main_.py", line 40, in
File "scenedetect_init_.py", line 302, in main
File "scenedetect_init_.py", line 144, in detect_scenes_file
File "scenedetect_init_.py", line 228, in detect_scenes
TypeError: can only concatenate list (not "dict_keys") to list
Failed to execute script main

Although I don't have much experience with python but I will look into it and try to fix it.

but I though it is something need to be addressed.

Python interface broken in v0.4

Hi,
since the methods detect_scenes() and detect_scenes_files() expect a SceneManager, the example from the docs for the Python interface is not working anymore by passing lists of scenes and detectos:

video_framerate, frames_read = scenedetect.detect_scenes_file(path, scene_list, detector_list)

PySceneDetect -o option writes zero byte file

When using the -o option to write the SCENE_LIST to a file, I just get a zero byte file. This works fine using the 0.2-alpha version, but none of the .3-beta versions write anything. Here's the output:

$ PySceneDetect-0.3.2-beta/scenedetect.py -i testinput/Test.mkv -o test-beta.csv
[PySceneDetect] Detecting scenes (threshold mode)...
[PySceneDetect] Parsing video Test.mkv...
[PySceneDetect] Video Resolution / Framerate: 720 x 400 / 29.970 FPS
Verify that the above parameters are correct (especially framerate, use --force-fps to correct if required).
[PySceneDetect] Processing complete, found 26 scenes in video.
[PySceneDetect] Processed 89716 frames in 243.9 secs (avg. 367.9 FPS).
[PySceneDetect] List of detected scenes:
[PySceneDetect] Comma-separated timecode output:
00:12:50.669,00:13:20.699,00:13:35.714,00:13:50.696,00:15:21.153,00:15:26.825,00:15:42.107,00:16:12.171,00:16:32.191,00:17:40.793,00:17:55.908,00:43:05.149,00:44:20.757,00:44:35.873,00:45:05.869,00:45:21.318,00:45:27.090,00:45:42.005,00:46:26.917,00:46:40.530,00:47:40.624,00:47:55.639,00:48:10.687,00:48:25.736,00:48:40.784,00:49:39.342

If I use -l, I do get a list, but it doesn't affect whats written to the file.

python-opencv 2.4.8
python 2.7.6
This is on Ubuntu 14.04

Thanks

Add MotionDetector / detect-motion Command

Hey @Breakthrough, I noticed that you have started the implementation of a Motion Detector algorithm but it hasn't been finished. I was wondering if you could provide me some insights or any reference in how the algorithm works. Thanks for your work!

ValueError: need more than 2 values to unpack

Hey,

trying to run scenedetect on an EC2 intsance. I got python 3.4 running and numpy + opencv + mkvmerge installed, any idea why it can't open the file?

Finished processing dependencies for PySceneDetect==0.3.6
(scenedetect)ubuntu@ip-172-31-12-98:/tmp/scenedetect/PySceneDetect-0.4$ scenedetect -i /dev/input.mp4 -d content -t 30 -l -o /dev/output_scene.mkv
[PySceneDetect] Detecting scenes (content mode)...
[PySceneDetect] FATAL ERROR - could not open video /dev/input.mp4.
Traceback (most recent call last):
  File "/home/ubuntu/.virtualenvs/scenedetect/bin/scenedetect", line 9, in <module>
    load_entry_point('PySceneDetect==0.3.6', 'console_scripts', 'scenedetect')()
  File "/home/ubuntu/.virtualenvs/scenedetect/lib/python3.4/site-packages/PySceneDetect-0.3.6-py3.4.egg/scenedetect/__init__.py", line 302, in main
ValueError: need more than 2 values to unpack

version on Pypi (0.3.4) throws an exception, no matter what arguments I give it.

Here is my console output. On OSX, python 3.5 installed as part of anaconda. OpenCV 3.1.0 installed via conda. I'm going to dig in and if I can find a fix tonight, I'll send a PR

$ scenedetect --help
Traceback (most recent call last):
  File "bin/scenedetect", line 11, in <module>
    sys.exit(main())
  File "lib/python3.5/site-packages/scenedetect/__init__.py", line 309, in main
    scene_detectors.keys(), timecode_formats.keys()).parse_args()
  File "lib/python3.5/site-packages/scenedetect/cli.py", line 236, in get_cli_parser
    required = True, type = file,
NameError: name 'file' is not defined

Add Ability to Down-sample (Resize/Down-scale) Videos for Faster Processing

Given a high enough resolution, in certain cases, we can avoid processing all the pixels in the image by down-sampling (e.g. processing every other pixel, effectively down-scaling and resizing the image using nearest-neighbor filtering). This would allow a proportional performance gain based on the down-sample factor (e.g. allow an integer factor between 2x-8x representing the reduction in pixels in both the x- and y- directions), given appropriate memory layout and array slicing/indexing would allow for it.

Add CLI Argument for Analysis Pass

Add a parameter to expand the output .CSV file to include frame-by-frame metrics of the video (e.g. average intensity, percent of pixels below threshold). Should require -o flag, and add table below scene list.

Add INSTALLING.md file to source distribution.

As per title, need to include a plain-text INSTALLING.md file with installation instructions, in addition to both links to the online documentation as well as instructions on building the included documentation.

Feel free to reference/include parts of the current installation instructions on the Download page, as well as suggest changes to those as well if it makes sense.

You may also reference, use or rewrite entirely my Installing OpenCV 3.0 Guide here if it makes sense, although note that the INSTALLING file should obviously reference the most recent version of OpenCV available at the time. Note that this document is public domain and requires no attribution.

Add support for minimum threshold

In content mode at the moment it cuts when a certain threshold is exceeded.
So it's a maximum threshold for a scene.

I need exactly the opposite.
So it's supposed to cut when the change over several frames is pretty low.
=> Minimum threshold for a scene (for a section with a lot of movement).

Use cases:
E.g. a stationary camera in a car race.
Every round when the cars drive trough the section is a scene.

What do you think?

How to specify force-fps

I want to use scenedetect to find scenes in my video and when I run the command
scenedetect -i video1.mp4 -o scenes_list.csv -d content -si -t 5

This is the output I get
[PySceneDetect] Detecting scenes (content mode)...
[PySceneDetect] Parsing video dromebox-2016_09_15-00-00-00.mp4...
[PySceneDetect] Video Resolution / Framerate: 1280 x 720 / 1.325 FPS
Verify that the above parameters are correct (especially framerate, use --force-fps to correct if required).
[PySceneDetect] Processing complete, found 0 scenes in video.
[PySceneDetect] Processed 0 frames in 0.5 secs (avg. 0.0 FPS).

Actual FPS is 30. It's taking the wrong value. How do I correct this ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.