The ffmpeg thread

incredible! this is great.

by the way @respiratori i’m not sure how to turn this into a wiki on here. any ideas?

i just changed it to the wiki category. i think anyone can edit now :slight_smile:

1 Like

This is timely! I just wrote myself a small ffmpeg CLI wrapper because I got sick of remembering things: Sarah Groff Hennigh-Palermo / ffmfriend · GitLab

Please feel free to use / add to if you’d like.

7 Likes

This looks great!! Thanks

1 Like

I tried to edit the original post but wasn’t able to. Is there a trick? The pen/pencil tool just shows me the changes.

whoops - @lettuce can u edit it now ?

2 Likes

it wasn’t showing up for me before but is now. thank you!

yep, thanks! edited to make it more wiki-like!

I’ve been using ffmpeg to do some motion interpolation glitchy effects, which works best if you try and slow down a very short video (two frames in my case) to be verrrrry long.

Here’s a breakdown of the settings https://www.hellocatfood.com/motion-interpolation-for-glitch-aesthetics-using-ffmpeg-part-0/

ffmpeg -i input -filter:v "setpts=62.5*PTS,minterpolate='fps=25:mb_size=16:search_param=400:vsbmc=0:scd=none:mc_mode=aobmc:me_mode=bilat:me=umh'" output.mp4

Not the function’s intended use but may be useful for someone!

7 Likes

That’s a cool effect, hadn’t seen that use case before. Nice

haven’t tried this but looks wow

3 Likes

Thanks for putting this together @lettuce! :grinning:

3 Likes

wooo displacement maps! found via Crash-Stop: RED plus FFmpeg displacement.
example (the main source abstract.mkv and the output displaced.mkv are shown below):

ffmpeg -i abstract.mkv -i people.mkv -lavfi ‘[1]split[y],[0][y]displace’ displaced.mkv

2021-05-08-01-16-23-1.mkv-50fps-mint.mkv.mp4 displacement.mkv

in a live setting, one could set capture cards as inputs and route the ffmpeg output to ffplay…

ffmpeg -i /dev/video0 -i /dev/video2 -lavfi ‘[1]split[y],[0][y]displace’ -f rawvideo -pix_fmt yuv420p - | ffplay -f rawvideo -pix_fmt yuv420p -s 720x576 -

7 Likes

Hey, this is a cool introduction and script collection for creative effects with ffmpeg.

6 Likes

A (n internet) friend of mine is doing an online ffmpeg class: Video Art with FFMPEG starting Saturday May 22nd | BustBright - Machine Learning Art

He usually teaches ML classes, so this is not his first rodeo. There is a cheaper audit option open as well.

1 Like

(admin note: this post and the 2 following ones have been moved here from this thread)

We now have an ffmpeg thread which works on Mac, Linux and probably PC (at least on Windows Subsystem for Linux but possibly also in the Cmd prompt?).

To make a short clip, you can trim a video from a given start time mm:ss to an end time mm2:ss2. You can also convert between formats simply by changing the output file extension.

ffmpeg -ss {{mm:ss}} -to {{mm2:ss2}} -i {{input-video.mp4}} -codec copy {{output.mp4}}
2 Likes

Yea, this works on Windows as well. To trim a video down, I use ffmpeg -i INPUT -c:v copy -ss 00:00:10 -to 00:01:00 OUTPUT for example. If you want to trim a duration instead of to a specific time, use -t instead of -to. Replace 00:00:00 with duration of seconds. It would look like this… ffmpeg -i INPUT -c:v copy -ss 00:00:10 -t 50 OUTPUT. Those each accomplish the same task.

Also, for looping clips together, I create a text file with the video file listed however many times I want it repeated like this…

file ‘video1.mp4’
file ‘video1.mp4’
file ‘video1.mp4’

I usually save it as list.txt or something similar, then run… ffmpeg -f concat -i list.txt -c copy output.mp4

Hopefully that helps.

2 Likes

For quite some years I have been using this script to extract short clips (usually 1 second) out of a video. A script to perform a random cut on a video · GitHub

It takes an input video and chooses a random start point and makes a video of between 0.999 seconds to a user defined maximum duration. (I originally made it to make this series of videos

Hope it helps!

7 Likes

For interactive use (the holy grail, for some) I believe Serato (not sure if that’s software or hardware - maybe both) allows for video looping, effecting and scratching like a DJ. But I don’t know nothing anything more about it than that. @decipher__ on twitch usually has a video scratch section of his streams, but he doesn’t save his videos or broadcast to a schedule so you need to get lucky and catch him live.

1 Like