I need to slow down a clip which has been recorded at 30 FPS.
slowmoVideo is very interesting as it uses the optical flow technology for interpolating frames like respeedr does. And it uses FFMpeg.
It can produce super fluid video. It can even be enhanced by a module to use the GPU efficiently.
Unfortunately I have problems and at Github no one is answering to this technical issue (maybe because the people spammed around in the past and the maintainer's priority for this project is low as he says).
Does anyone of you have the possibility to take a look at it?
My debian package installs perfectly and starts without issues. I can open the clip but on render it crashes. Using the command line I get this error:
Have OpenCL: true useOpenCL: true true 1 1 terminate called after throwing an instance of 'cv::Exception' what(): OpenCV(4.6.0) ./modules/video/src/optflowgf.cpp:1120: error: (-215:Assertion failed) _flow0.size() == prev0.size() && _flow0.channels() == 2 && _flow0.depth() == CV_32F in function 'calc'
Parallel I grabbed an old Ubuntu LTS 16.04 and the official appimage (which was built for 16.04). I can run it but I get even worse errors. The UI shows no size for the video clip which is already a problem at an earlier stage. The command line shows problems with size too. I tested various clips like 1. MP4 4K/30 direct out of my Sony, 2. mp4 4K/24 out of cin and 3. 2k/24 out of avidemux.
It would be so good to have this option for super fluid slowmotion I think.
Darktable, Avidemux, cin and FFMPEG work like a charm.
I'm going to do it now with animated images. But a very interesting software to watch.
Georgy gave an answer on the forum which I quote here:
"I used slowmovideo for smoothing not only filmed clips, but also
artificially generated ones (such as animation of a chemical reaction
created by quantum chemical modeling software).
I never tried to kick ffmpeg directly from inside slowmo. Instead, I did
everithing stepwise under manual control:
1) Created the appropriate number of PNG snapshots
2) Loaded the PNGs into slowmoUI
3) Rendered again into PNGs
4) Inspected created PNGs (it is also possible to edit some of them, for
example, remove artifacts)
5) Run ffmpeg on the PNGs manually somehow like:
ffmpeg -f image2 -start_number 0 -i C6H6480x480.%03d.png -r 24 -vcodec libx264 t.mp4
I understand, one would wish to automate everything to get in one step. But
for testing/debugging purposes it could be handy to try it stepwise: is
slowmo unable to generate final MP4, for example, or is it unable to drive
interpolation engine, or even unable to slurp the input?
I also tested various internal ffmpeg filters for slowed motion
interpolation:
Filter 'fps' (same as the option -r 25) is fast, but the resulting video may
become shaking:
ffmpeg -i in.mov -c:v libxvid -filter:v fps=fps=25 -b:v 16000k -b:a 192k -ac 2 -ar 48000 -y out.m4v
Filter 'framerate' is also fast, the resulting video does not become
shaking, but it may become blurred:
ffmpeg -i in.mov -c:v libxvid -filter:v framerate=fps=25 -b:v 16000k -b:a 192k -ac 2 -ar 48000 -y out.m4v
Filter 'minterpolate' is free of artifacts like shaking or blur, produces
the output of much better quality, but it is slow:
ffmpeg -i in.mov -c:v libxvid -filter:v minterpolate=fps=25 -b:v 16000k -b:a 192k -ac 2 -ar 48000 -y out.m4v"
NOTE: In CinGG there is the “Interpolate video” plugin that uses Optical Flow, have you tried it?
Fantastic work. Thank you so much. I 'm going to check that out (both - Export to PNG and the FFMPEG interpolation).
For the moment I'm going with "PhotoFilmStrip". I worked with it in the past several times. For the usage at a homepage it seems to be an even better solution for me. I just haven't thought of it and got the idea today in the morning.
The special HQ thing on slowmoVideo is its optical flow technology which as I know is superior to any other interpolation methods.
But much better to go with FFMPEG interpolation than without anything.
The results are really impressive. No need for me to waste time with the not working slomoVideo stuff for the moment (I already spent >5 hours on that).
It seems I was uninformed and this minterpolate technology IS "Optical Flow"?!
At the moment I need to enter these two commands:
ffmpeg -i <input> -c:v <codec> -filter:v minterpolate=fps=120 -b:v <bitrate> <output> ffmpeg -i <input> -filter:v "setpts=4.0*PTS" -b:v <bitrate> <output>
Is there a possibility to combine these two recompressions to one process?
I think Minterpolate uses classical interpolations (not Optical Flow). See the ffmpeg manual:
https://ffmpeg.org/ffmpeg-filters.html#minterpolate
Minterpolate is also present in CinGG and, I think, is working.
Please look here. MAybe I just don't understand correctly what is meant by "Other options include slowmoVideo and Butterflow."
https://trac.ffmpeg.org/wiki/How%20to%20speed%20up%20/%20slow%20down%20a%20video#Smooth
I am also confused. Minterpolate has many algorithms to choose from, perhaps some are “motion estimation,” some are “optical flow,” and some are simple frame interpolations. Except for the latter, all the other methods use motion vectors, though in different ways. So they could all be called “optical flow,” although technically there are differences. Wikipedia says that optical flow uses motion vectors on every pixel, while motion estimation and motion compensation use motion vectors on certain types of pixel blocks. However, it also says that the terms, in common usage, are interchangeable; hence, I think, the confusion.
https://en.wikipedia.org/wiki/Optical_flow
However I think minterpolate does not use the “real” optical flow, and if one wants to use it one has to use an external product like SlowmoVideo. Instead Butterflow uses motion compensation, which also has minterpolate.
With these new information I will try to track this interpolation technology.
minterpolate is already a really good thing in combination with cin camera and projector to make some pretty nice butter scenes 🙂
If I had known before I would had chosen the high FPS settings instead of the high RES settings. But you just don't know before.