How do you convert a png file to a 6 second long mp4

I need a step in my automation which converts a png to an mp4 file of 6 seconds duration.

Any help really appreciated.

This is a strange requirement, it will just be a video of the same thing for 6 seconds. Why do you need the image as a video?

FFMPEG.exe is a common tool for this and is bundled with UiPath often now due to the job recording functionality.

Ha, yes, it is a little strange and somewhat wasteful.

The AI tool I’m using required a video for the background behind its activity rather than an image.

The its a 6 second video as that is the length of the time the AI tool is running over the top… I should probably round up to 7 seconds to avoid risk of a black screen.

The question is how would this be achieved using FFMPEG then? I have used that elsewhere in the past so it is installed on my device already.

is it a one-time conversion or do you need it within an automation?

Indeed, very relevant.

I’d love it if you would also be willing to share more about this AI tool and video thing. I cannot imagine the use case right now so am intrigued on what it could be.

I have done so in the past and found that via command line was the only method. There are not API’s exposed to use in .NET from what I could figure out.

Via command line Chat GPT can help alot actually.
I’d recommend asking it how to do it with FFMPEG and then testing it works if you do it directly.
Once that works, try to integrate the command line into Studio (assuming it isnt a one time thing).

@mellis Hope it will work for you

FFmpeg is a powerful command-line tool for video processing. While not directly coded in C#, you can leverage it from your application. Here’s the idea:

  • Install FFmpeg (available for most platforms).
  • In your C# code custom activity / UiPath , use the System.Diagnostics.Process Name space

ffmpeg -loop 1 -i image.png -c:v libx264 -t 5 output.mp4

This ffmpeg was used for other case but it will help you for your refrace

I have directed you, more than once, to the forum guidelines that state, when using an LLM you should indicate you used one.

Please start following forum guidelines along with everyone else and cite your usage.
I already directed the poster that ChatGPT can help here.