Sunday 7 January 2018

ffmpeg - How to use output for another action in one command line?


I have for example this command:


ffmpeg -loop 1 -i image.jpg -i input.mp3 -ss 00:08:02.00 -t 137 -vf scale=nhd -r 1 -c:v libx264 -c:a aac -shortest output.mp4

which suppose to take an mp3 file and a picture and combine it to one video file mp4. Now how can i add a watermark using this command for example:


ffmpeg -i input.mp4 -i watermark.jpg -filter_complex overlay=main_w-overlay_w-5:main_h-overlay_h-5 output.mp4

But doing all of this in one time command and not re encoding twice or to wait for one command to finish and then do another one.


Thanks!



Answer



Use


ffmpeg -loop 1 -i image.jpg -i watermark.jpg -ss 00:08:02.00 -t 137 -i input.mp3 -filter_complex [0]scale=nhd,setsar=1[v];[v][1]overlay=W-w-5:H-h-5 -r 1 -c:v libx264 -c:a aac -shortest -fflags +shortest output.mp4

No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...