How to add the logo for the first 30 seconds in a video with ffmpeg

ffmpeg

I'm trying to add my logo for the first 30 seconds in a video with ffmpeg. I have a video called d1.mp4 and a logo called logo.png.

When the video starts, the watermark should be at the top left or top right corner of the video and disappear after 30 seconds.

ffmpeg -i in.mp4 -framerate 30000/1001 -loop 1 -i logo.png -filter_complex

This assumes that the logo is a single still image with an alpha channel and you want to overlay it over a video with a frame rate of 30000/1001 (NTSC rate). Change the -framerate to match your input video if it is different. If your logo is a video then omit -framerate 30000/1001 -loop 1. If the logo does not have an alpha channel, add one by inserting e.g. format=yuva420p, immediately before fade.