(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.
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…
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
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.
I had some video captures with intermittent blank frames recently, and this really helped:
Remove blank (black) frames from videos
for I in *.mp4; do
ffmpeg -i "$I" -vf blackframe=1,metadata=select:key=lavfi.blackframe.pblack:value=0:function=less -vsync cfr -c:a copy "$I-noblanks.mp4"
done
Hello there, I’m new to ffmpeg, and I’m trying to crop videos into grids of any size (2x2, 3x3 etc). This code works well for 2x2 grids but not for any number of grids greater than 2. Could you please tell me what I’m doing wrong?
for filename in os.listdir(path):
if filename.endswith(".mp4"):
video_w = 1280
video_h = 720
count = 0
w_count = 2
h_count = 2
cw=video_w/w_count
ch=video_h/h_count
for y in range(h_count):
y = video_w * y
for x in range(w_count):
x = video_w * x
command = "ffmpeg -i " + os.path.join(path,filename) + f" -vcodec h264_nvenc -vf crop={cw}:{ch}:{x}:{y} " + os.path.join(path, f"crop-{count}.mp4")
os.system(command)
count += 1```
Anyone here know how I might write to and read from a single video buffer in realtime (while respecting the actual bitstream) using ffmpeg? I’ve been trying to hack my way into this using the concat demuxer but it’s not preserving the bitstream as I would hope.