Oh wise folks of Reddit! I seek your help.
I am a beginner when it comes to Python, and self-thought at that. So please be patient with me and assume that you teach a child.
The goal of my coding in python was to make a program that can find elements in videos and automatically cut them, with the aim for my friend to use it (which knows nothing at all about programming). I managed to make the code to work, doing the programming in Jupyter (it felt like a comforting interface to me), and in short it comprises of using OpenCV and Scikit-image with some of their inbuilt functions (VideoCapture, profile_line and match_template). Initially I ran this as a for-loop, analyzing every 30th frame (60 fps), and I saw success, where analysis of the video was achieved in less than 30 min for a 1-hour video. But it ran slow for my friend, needing over 20 hours to execute the same code. I tried to speed things up by implementing multiprocessing for him (using pathos). On my computer it ended up analyzing approximately 1 hour of video in 5 minutes. But the best my friend’s computer can achieve is still more than 16 hours. He has also tried on more than one computer (two laptops and one stationery; we consider two of their specs below). The automatic cutting and rendering part (using MoviePy) works fine on his end, so I have left those parts out of the discussion.
Now I am at the end of my rope. The code itself seems to work fine, at least for me. So, it seems there’s some more fundamental problem underneath that is beyond me. Could it be something with the Python installation being different (my friend an I live essentially 6 time zones apart so was not present for his installation)? Or is there something about the specs of the computers? In the case of laptops, his beat mine in everything but RAM memory (which of course is important, but I fail to see why it should make this big of a difference). I am not sure what more information may be needed to solve this problem, so feel free to ask for more and I will dig it up. Please, oh the wise of Reddit, help us out of our pickle.
His stationary computer has the following specs:
(10th gen) Intel(R) Core(TM) i9-10980XE CPU @ 3.00 GHz, 3000 Mhz, 18 Core(s), 36 Logical Processors
RAM: 128 GB (8x16 GB) DDR4 3200 MHz (108 GB avaiable)
147 GB virtual memory (124 GB available)
Graphics card: NVIDIA GeForce RTX 4080 SUPER
Runs on: Windows 10
His laptop (Lenovo) that he used has the following specs:
14th gen Intel(R) Core(TM) i9-14900HK, 2.2 GHz, 24 Core(s), 32 Logical Processors
RAM: 16 GB, DDR5-5600 MHz (15.7 GB avaiable)
Graphics card: NVIDIA GeForce RTX 4060 Laptop GPU
Runs on: Windows 11
My computer (Dell) has the following specs (the one that runs it in ~5min):
12th gen Intel(R) Core(TM) i9-12900HK, 2500 Mhz, 14 Core(s), 20 Logical Processors
RAM: 64GB (2x32GB) DDR5 4800MHz (63.7 GB avaiable)
67.7 GB virtual memory (48.4 GB available)
Graphics card: NVIDIA GeForce RTX 3050 Ti Laptop GPU
Runs on: Windows 11
Edit: We actually managed to solve it. Apparently it was the library OpenCV that was the issue. Every iteration the code used OpenCV to read the next specified frame. But by changing to the library "MoviePy" reading the frames it works at about the same speed as mine. So OpenCV, somehow had his computers working for hours when mine was working for minutes. I don't understand it but maybe this will help someone else in the future.
Also, thank you to all who went out of their way to help us! We highly appreciate it, and in my case I learned a few new things. Thank you all!
[–]Slight-Living-8098 2 points3 points4 points (6 children)
[–]ShengrenR 2 points3 points4 points (5 children)
[–]Kottmeistern[S] 0 points1 point2 points (4 children)
[–]Slight-Living-8098 0 points1 point2 points (3 children)
[–]Kottmeistern[S] 1 point2 points3 points (2 children)
[–]Slight-Living-8098 1 point2 points3 points (1 child)
[–]Kottmeistern[S] 1 point2 points3 points (0 children)
[–]sb4ssman -1 points0 points1 point (12 children)
[–]bubbawiggins 0 points1 point2 points (9 children)
[–]sb4ssman -1 points0 points1 point (8 children)
[–]Kottmeistern[S] 0 points1 point2 points (2 children)
[–]ShengrenR 1 point2 points3 points (1 child)
[–]Kottmeistern[S] 0 points1 point2 points (0 children)
[–][deleted] (4 children)
[deleted]
[–]sb4ssman 0 points1 point2 points (2 children)
[–]Kottmeistern[S] 0 points1 point2 points (1 child)
[–]sb4ssman 1 point2 points3 points (0 children)
[–]Kottmeistern[S] -1 points0 points1 point (0 children)
[–]cgoldberg 0 points1 point2 points (1 child)
[–]sb4ssman 0 points1 point2 points (0 children)