11:10
Basically I am using ffmpeg to extract every Nth frame from a video. But the filenames appear sequentially from 1 to X. I want to use the actual frame numbers so if it's every 30th frame, then the filenames should be 0, 30, 60, etc. Is this possible?
I am doing this in Python using this function:
def extract_and_compress_frames(directory, frame_interval=1, crop_width=192, crop_height=108, offset_x=0, offset_y=0):
for filename in os.listdir(directory):
if filename.endswith(".trec"):
# Construct full file path
trec_path = os.path.join(directory, (...)
09:28
In the working folder, there are
text1.png
text2.png
video.mp4
(all sizes 400x400)
I would like to overlay
text1 and text2
on this video.mp4 while fading them in.
If it was just one image, I could make it with the code below,
so I am currently researching ways to improve the code below.
ffmpeg -i video.mp4 -loop 1 -i text1.png -filter_complex "[1]fade=in:st=2:d=1:alpha=1[i];[0][i]overlay=x=0:y=0:shortest=1;" output.mp4
Below is the code I created based on the manual and information I found on Google.
ffmpeg -i video.mp4 -loop -i text1.png (...)