ilia3101 / MLV-App

All in one MLV processing app.
https://mlv.app/
GNU General Public License v3.0
274 stars 30 forks source link

Multithreaded CinemaDNG export #270

Closed BenjaminNavarro closed 1 month ago

BenjaminNavarro commented 1 year ago

I just started using MLV-App and I have an hour long video to export in CinemaDNG which takes forever. So I looked at the CPU usage and saw that only one core was used. The disk usage seems to be around 50MB/s so I'm pretty confident that parallelizing the export would bring a significant speedup, probably around 8x for my hardware. And since it's converting still frames to individual files it should be pretty easy to do.

Is there any reason why the export is single threaded? I haven't looked at the code yet but I'm willing to try to make a PR for this

masc4ii commented 1 year ago

Yes, there is a reason: the lossless de-/compression works just single threaded. If you find another solution, feel free to make a PR. If you use MLVFS, you already have that multithreaded, because this app can handle multiple clips at once, which is not possible in MLVApp.

Jip-Hop commented 3 months ago

Yes, there is a reason: the lossless de-/compression works just single threaded.

On a MacBook Pro 14-inch, nov. 2023 M3 Pro 18 GB I see MLV App is able to utilize all available CPU resources when exporting CinemaDNG (Lossless).

IMG_9290 IMG_9291 IMG_9292

I've used the M04-1815.MLV sample from https://drive.google.com/drive/folders/1rE6AHE-up7u_5mnWnLjW7h8g3dLopiUG for reference.

So I looked at the CPU usage and saw that only one core was used.

Is there an explanation why my test seems to show more than 1 core being used during export?

masc4ii commented 3 months ago

The DNG export itself is still single threaded. But for being able to export, a MLV must be loaded, RAW Corrections have to be done, (etc. etc.). And this is multithreaded.

Jip-Hop commented 3 months ago

The DNG export itself is still single threaded

In my case it appears not to be a bottleneck since the export process can max out the CPU resources of the MacBook regardless...