Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multi-cpu support? #48

Closed
aardvark82 opened this issue Mar 5, 2021 · 8 comments
Closed

multi-cpu support? #48

aardvark82 opened this issue Mar 5, 2021 · 8 comments
Labels
Milestone

Comments

@aardvark82
Copy link

I'm curious if drv-scan can be run to utilize all CPU's available or if it already does?

@Breakthrough
Copy link
Owner

Breakthrough commented Mar 6, 2021 via email

@aardvark82
Copy link
Author

Thanks for the (quick!) update, Brandon.

  • Splitting original file in chunks might be a good way.
  • Although I think for many use cases we have a large collection of small (e.g. 1-min) files to process.

Just curious - there's another thread about processing files in subfolders - would there be a good way to specify a number of parallel tasks and launch them using a for

Example in this example - how could we launch 24 file conversions concurrently?

for inputfile in /my_videos/**/*.mp4 ;
do echo $input_file & dvr-scan -t 0.65 --min-event-length 48 -i "$inputfile" -o "$inputfile"_motion.avi
done

Curious if a quick win would be to add folder support to the tool and parallelize internally by launching NUM_PROCESSORS*2 threads.

@Breakthrough
Copy link
Owner

Breakthrough commented May 14, 2021

That's certainly possible - I've added a note on the Wiki to consider doing that. At this point I think the biggest performance gain would be moving to allow GPU support, and getting rid of doing the video encoding in the same thread as the processing is done.

Knowing now that there are other algorithms as drop-in replacements, I might be able to allow selecting different ones via command line to improve performance in the meantime. Will look into this, thank you!

Edit: Did a quick test, and indeed there is a new detector which runs in parallel and is faster. The results are slightly different, but for most use cases it should be acceptable given the right event window sizes. Moving this up to the next release!

@Breakthrough
Copy link
Owner

With DVR-Scan v1.3, you can specify -b CNT and it will use the new parallelized background subtractor.

@aardvark82
Copy link
Author

Brandon this is great! I'll make sure to give it a try next time I have videos to process.

@myscho15
Copy link

Hay, the new CNT Command is cool. Than you verry much.

@ocram
Copy link

ocram commented Dec 10, 2021

Just to give some feedback here, CNT works fine, is indeed a little faster than MOG (~1.4× for SD to ~2.1× for Full HD), has more problems with brightness changes and lens flares, and for the closest results to MOG, seems to require a doubling of the kernel size (kernelSize = kernelSize * 2 + 1).

@Breakthrough
Copy link
Owner

Thanks for the feedback - I'll look into doubling the default kernel size when switching to CNT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants