HN user

Breakthrough

1,146 karma

Hello there! My name is Breakthrough, currently working at General Motors, focused on safety-critical embedded C++ development (B.E.Sc Electrical Engineering). You can check out some of my open source projects on Github at https://www.github.com/Breakthrough, or check out my website at http://www.bcastell.com for more information (or how to contact me). Thanks!

Posts8
Comments133
View on HN

If you're willing, could you try using AdaptiveDetector? It should have better defaults for handling fast camera movements a bit better.

The threshold values themselves can be tuned if you generate a statsfile and plot the result, but that can sometimes be tedious if you have a lot of files (thus the huge interest in methods like TransNetV2). Glad to see the real world applications of those in action. You can always just increase/decrease the threshold by 5-10% depending on if you find it's too sensitive or not sensitive enough as well.

Thanks for the response!

Awesome to see this! I actually wrote PySceneDetect, was great to see it getting some use here. Would you be willing to share what parameters you were using? I'm curious why the accuracy was so low.

PySceneDetect only uses basic heuristic methods right now so it does require some degree of tuning to get things working for certain data sets. Your post inspired me to look into maybe integrating TransNetV2 as a detector in the future!

Thanks for giving PySceneDetect a try. Can you share what you're using as the command line arguments?

For detecting fades-to-black, you want to make sure that you're using the detect-threshold command (not detect-content). For example:

    scenedetect -i somevideo.mp4 detect-threshold -t 12 list-scenes
Where -t specifies the threshold to use (the default being a value of 12). Full documentation for the detect-threshold command:

https://pyscenedetect-manual.readthedocs.io/en/latest/cli/de...

This is still relevant I think :) What you mentioned is very similar to an edit decision list (EDL [1]), of which I only learned recently. I had a feature request [2] to support EDL as an ouptut format, and upon further investigation, it seems like the format is very similar to what you're talking about. The Wikipedia page also indicates that VLC supports xspf files, but I haven't done much research into that yet ("XML Shareable Playlist Format").

[1] https://en.wikipedia.org/wiki/Edit_decision_list

[2] https://github.com/Breakthrough/PySceneDetect/issues/101

Author of PySceneDetect here: Thank you all for the thought-provoking discussions, and the attention you've given my side project. There are some specific cases where PySceneDetect achieves great accuracy (like fast cuts or fades), and some where it's currently not so good at (like sudden flashes or large obstructions). That being said I do want to track these things and come up with solutions to improve the robustness of the content detection algorithm over time.

I'm most open to any feedback or feature requests/ideas/suggestions; feel free to checkout the issue tracker on Github, or create a new entry:

https://github.com/Breakthrough/PySceneDetect/issues

Some ideas being considered/researched for future releases:

- looking at changes to image histograms

- using edge detection to improve robustness

- camera flash / foreground object suppression

- automatic threshold detection using statistical methods (currently is just a heuristic)

Funny you should mention that - initially home videos were what I was doing this with, as I was unable to find any existing programs that could handle them reliably (or had various shortcomings, or weren't hackable/extensible, etc...). Then I realized that what I came up with actually competed pretty well with the existing solutions (benchmarks below [1]), so decided to open source it and share it with the world.

Of course, the project is still very basic in it's current form, but does offer a good platform for testing more advanced scene detection methodologies (and has also been used as a baseline in various research/academic contexts). There's been plenty of suggestions for other detection methods (e.g. using histograms) which I'm very interested in looking into adding for future releases.

Lastly, one thing I do want to address going forwards is the performance, to make the algorithms more suitable for real-time systems (have decided to rewrite the core algorithms in C++ when I have some time, and interface that with the Python library/CLI). That being said, I'm always open to feedback or different ways of approaching things. If you or anyone else has any feedback or suggestions, feel free to create a new issue on the Github issue tracker [2] and I would be happy to discuss the possibility of including it in a future release of PySceneDetect.

[1] https://github.com/albanie/shot-detection-benchmarks

[2] https://github.com/Breakthrough/PySceneDetect/issues

This is indeed correct, I'm just using HSV instead of YUV, but the primary source of information is the luma/brightness component (although currently all 3 of the HSV components are averaged, so perhaps a better weighting may improve precision).

Author of the program here. You are correct, the program detects shots rather than scenes, but I didn't want to give the impression that this project was related to the existing ShotDetect program. I felt that the documentation explained this well enough, but I'm open to considering an alternative project name if anyone has a suggestion.

Hi Hamuko;

Would you be able to share a small sub-set of the episode, in particular the area where you're unable to detect the starting segment? (If not, no worries!)

There's a few issues with PySceneDetect currently that may lead to false or missed detections, but these are things that I would like to solve in the long run:

- threshold is heuristic/fixed right now, but I would like to change it to an adaptive/statistical method which can dynamically change

- single-frame events can trigger false scene changes

Thanks for your feedback, and feel free to share any other suggestions you might have.

Author of PySceneDetect here. The current implementation does exactly what you hint at, except instead of YUV, it considers deltas in the HSV domain (specifically differences in hue and color).

Other techniques being considered for future work include use of optical flow, background subtraction, and analyzing histograms.

This is definitely a good idea, and something that I'm most open to considering for a future release of PySceneDetect. Admittedly the current version does not handle single-frame "upsets" like this, but this does seem like a logical and reasonable approach to a first attempt at filtering them out.

I've seen a proof of concept which combined the output of PySceneDetect with subtitle information and computer vision to allow you to do something like "go to the scene with the big castle" or something similar. I can't remember what it's called off the top of my head, but it seemed like a pretty cool concept.

Disclaimer: I'm the author of PySceneDetect.

Author of the program here. This is definitely something that is worth while considering, although I'm not too sure if a correlation always exists between the audio and picture patterns (e.g. in a music video, scene transitions may not be exactly synchronized with the audio).

I've also seen people combine the cuts detected by PySceneDetect with subtitle (.srt) information to generate a more comprehensive list of scenes, which are sets of shots joined together by some context (to allow for jumping forward to a particular scene by it's description).

Author of the program here. Yes, the program detects shots rather than scenes, but I didn't want to give the impression that this project was related to the existing ShotDetect program. I felt that the documentation explained this well enough, but I'm open to considering an alternative project name if anyone has a suggestion.

Surprisingly, this uses a fairly simple heuristic to accomplish just that (HSV deltas). I'm the author of the program, and it actually works pretty well with Pulp Fiction as a whole.

The one area where PySceneDetect does struggle with currently, however, is dealing with sudden/rapid flashes, or momentary obstructions to the viewing scene.

Hi genp;

Just curious, what didn't you like about the output quality? What version of PySceneDetect were you using?

The latest version (v0.5.x) uses ffmpeg instead of mkvmerge for output by default now, which produces significantly more accurate and higher quality output than before.

That being said, you are correct in that optical flow and keyframe information is currently not being used during the detection phase. There are several proposals to incorporate this into a future release, however, along with several other techniques: - histogram analysis - edge detection - background subtraction - automatic or dynamic threshold detection

Thanks for your feedback!

Author of PySceneDetect here. Sorry about that, this is one thing I never figured out how to fix with the generated documentation yet.

Now that you mention it, I might ask the Readthedocs folks to see if they have any idea why this is happening.

That's an interesting point, although you have to remember airplane mode turns off all radios on the device, not only the Wi-Fi. They probably use it as a "fool-proof" method to prevent any unintentional interference with both current and future wireless devices.

That being said, unofficially I agree, given Wi-Fi is provided on flights now, I'm sure that means you're alright to leave your Wi-Fi radio on. The answer to why shut off all GSM/CDMA, Bluetooth, and GPS radios as well, however, probably predates the high prevalence of all these wireless technologies in a unified device.

It would be cool if you could generalize this for anything (e.g. ls ls -al). That being said, I wonder if there's any actual command-line utilities that actually use a similar syntax to perform something useful.

As the person who wrote the accepted answer to that question, I'm flattered to see it linked here. (I'm also a bit embarrassed at reading some of my older rambling-style writing, but nothing beats experience :)

While my forray into malicious floppy disks didn't end with physical damage, I did manage to make one similar to DBAN. If you booted the computer with the floppy inserted, all drives would be formatted instantly, without any user input.

Fortunately, even in highschool​ I realized they probably imaged the school machines anyways. Probably...

Hello everyone, I just managed to get everything finished and tested this week, and am finally proud to release the first public version of DVR-Scan (version 1.0).

The Windows builds include all dependencies, while the source distributions will work on all platforms that have Python, NumPy, and OpenCV installed. The code should work with all versions of Python/OpenCV; the Windows build comes integrated with Python 3.5/OpenCV 3.1.

This was created after a user of my first real open source project, PySceneDetect, contacted me and wanted to know if it was possible to detect movement within a static scene (rather than detecting scene cuts/changes), making this my second "real" project.

One major feature I'm working on implementing for the next release is the ability to use a transparent image as a mask so you can ignore some parts of the frame. That being said, even without masking I've achieved great results thus far, and there are plenty of other detection parameters you can tweak some other software doesn't usually include.

Any comments, suggestions, or feedback you might have is most welcome.

I initially thought the same thing, but this does address a few things Pygame is lacking for people that are still learning programming/Python. A common question I get is "How would I make a UI with Pygame?" or handle input for different scenes versus the UI, and this seems to abstract it well for those that just want to jump in and get a working game (as opposed to a working game engine...).

Full Metal Jacket had it's moments of blue and orange, but I'd classify most scenes in the film as 'green'. Then again, Kubrick was known to be obsessive in regards to attention to detail, especially when it came to lighting and colour reproduction.