FFMPEG: Outputting multiple videos with watermark

0

Thank you for checking out my post, I'm new to ffmpeg but I'm interested in seeing what I can do with it but I'm facing the following problem:

ffmpeg -f gdigrab -s 1360x768 -i desktop 
       -f dshow -i audio="audio-input-device" 
       -i watermark.png 
       -filter_complex "overlay=main_w-overlay_w-10/2:main_h-overlay_h-10/2;[0:v]yadif,split=2[out0][out1]" 
       -map "[out0]" -c:a aac -c:v libx264 -b:v 2M  -preset ultrafast -s 1280x720 -f mp4 output0.mp4 
       -map "[out1]" -c:a aac -c:v libx264 -b:v 2M -preset ultrafast -s 1280x720 -f mp4 output1.flv

Expected output: Two videos with watermark on the bottom right with audio.

Actual output: Two videos, one of them doesn't have watermark and the other does and both don't have an audio.

Sano

Posted 2018-12-09T14:40:44.157

Reputation: 31

1

Hi Sano, that sounds like an interesting question. However, your code has plenty of options that would take quite some time to get through. Could you create a Minimal, Complete and Verifieble example? That would greatly help us isolate the problem and possible provide a solution.

– Saaru Lindestøkke – 2018-12-09T14:47:40.493

Answers

0

You're deinterlacing and splitting the original video, not the overlaid one.

It should be,

-filter_complex "overlay=main_w-overlay_w-10/2:main_h-overlay_h-10/2,yadif,split=2[out0][out1]" 

Also, it is recommended to deinterlace beforehand, so

-filter_complex "yadif[v];[v][2]overlay=main_w-overlay_w-10/2:main_h-overlay_h-10/2,split=2[out0][out1]" 

Gyan

Posted 2018-12-09T14:40:44.157

Reputation: 21 016

Thank you so much, It worked but if I may ask, how can I add audio to both of them? – Sano – 2018-12-10T10:17:02.103

Add -map 1:a to each of the output options. – Gyan – 2018-12-10T10:41:52.187