2

I am trying to overlay a video on an image using the below command.

 -y -loop 1 -i snowflake.png
 -i crack.mp4
 -filter_complex "[0][1]scale2ref[i][m];[m][i]overlay[v]" -map [v] -map 0:a? -ac 2 output.mp4

The above command works but it overlay image on the video instead of video on the image.

I also try with the below command, but when I run that it removes the file path separator '\' from the path which results in the file not found error.

-loop 1 -i C:\Users\Desktop\SAM\Effects\snowflake.png
-vf "movie=C:\Users\Desktop\SAM\Effects\crack.mp4,scale=128:96[inner];[in][inner]overlay=70:70:shortest=1[out]" -y output.mp4

I saw a youtube video for the exact effect I want and copied the command from that but it still gives the same error no suitable output format. This is the command

-loop 1 -i C:\Users\Vivek\Desktop\SAM\Effects\A.jpg -i C:\Users\Vivek\Desktop\SAM\Effects\crack.mp4 -filter_complex "[1:v]colorkey=0x000000:0.5:0.5[ckout];[0:v][ckout]overlay[out]" -map "[out]" -c:a copy -c:v libx264 C:\Users\Vivek\Desktop\SAM\Effects\out.mp4

How to get this command working.

Below is the error screenshot. I can't post the logs here as the error is not appearing in logs.

Error

FYI: I am using ffmpeg in Unity using FFMPEG bind asset.

1 Answers1

2

You are encountering invisible characters, zero width non-joiner (U+200C) and zero width space (U+200B), that are likely added by your text editor. You can see them if you paste into vim:

String[]sepCmd=new String[]{"-i",overlayUri,"-i",uri,"-filter_complex","[1:v][0<200c><200b>:v]scale2ref[ua][b<200c><200b>];<200c><200b>[ua]setsar=1,format=<200c><200b>yuva444p,colorchanne<200c><200b>lmixer=aa=0.5[u];[b]<200c><200b>[u]overlay"<200c><200b>,outputPa<200c><200b>th}

Associated errors that you may encounter with this infestation:

  • Invalid stream specifier:
  • No such filter: '‌​'
  • Error initializing filter
  • Unable to find a suitable output format

Remove these characters and use a better text editor: not Notepad or MS Word.

llogan
  • 63,280