Reputation: 1
Here is what I'm trying to achieve:
I strugguling to make this fade in / fade out. Here is what I have:
ffmpeg -r 1 -loop 1 -i image.jpg -i audio.mp3 -acodec copy -r 60 -shortest -vf fade=in:0:01 -pix_fmt yuv420p output.mp4
My fadein is static, so black image and then my video, not smooth. How do I get a smooth 60FPS fade?
I also have another request, let's say I have an overlay video that I want to concatenate to my video. If I concatenate a video to the existing video, the overlay will also be on top of the fades which is not right, how can I achieve this? Thank you so much.
Upvotes: -1
Views: 280
Reputation: 5543
You're setting nb_frame=1
with your filter options in:0:01
. If you wish to fade duration, you need to specify the option name: in:duration=1
(start_time=0
option is unnecessary as 0 is the default).
For fadeout, you need to specify the start_time
option so run ffprobe
first to get the duration of the mp3 file.
As for the overlay, you must do it before fading. Your filterchain should look like [0:v][1:v]overlay,fade:in,fade:out
[addendum] Fading effect requires frames to realize it, increase the framerate before the filter fade
: [0:v][1:v]overlay,fps=60,fade:in,fade:out
. And remove -r 60
from the output option (or leave it in as it shouldn't do anything anyway).
Upvotes: 0