4

I am trying to watermark a video using FFMPEG. I tried following code

NReco.VideoConverter.FFMpegConverter wrap = new FFMpegConverter();
wrap.Invoke("-i D:\\input.mp4 -i D:\\inputImage.png -filter_complex \"overlay=10:10\" D:\\Output.mp4");

but it gives error

ffmpeg: Invalid argument (exit code: 1)

I tried searching if i could use such kind of method(invoke) in AForge, splicer or in other library.

I came across many another questions on stackoverflow like which uses ffmpeg exe. I don't know where i can find it.

I also found this link from official ffmpeg website for windows but can not find any such thing

I have just started working on video processing in c# so i am very confused about the concepts kindly help me to get a start.

Community
  • 1
  • 1
Charlie
  • 4,827
  • 2
  • 31
  • 55
  • NReco.VideoConverter.FFMpegConverter will extract the ffmpeg.exe executable if it does not exist. Can your title be missleading? ffmpeg: Invalid argument (exit code: 1) means the executable is there and starts and complains about the arguments.. – Oguz Ozgul Nov 30 '15 at 07:34
  • @OguzOzgul yes i found the actual problem. there is something wrong in my arguments. Space in path is creating a problem – Charlie Nov 30 '15 at 07:39
  • Ok, glad to hear that. – Oguz Ozgul Nov 30 '15 at 07:41

1 Answers1

0

Not a programming question (imho). Windows builds: here. I am not using complex filters. I am using $path_to_ffmpeg$\bin>ffmpeg.exe -i in.mp4 -vf "movie=watermark.png [w]; [in][w] overlay=10:10 [out]" -acodec copy out.mp4 instead. No need for NReco.VideoConverter. Just run as a process. Control the output redirection, escape quotes, watch for spaces in paths, etc...

andrei.ciprian
  • 2,895
  • 1
  • 19
  • 29