1

I have a VPS running Debian 9 GNU/Linux that transcodes mp4 files, because it's a cheap single-core server it might take several hours. I want to send an email to myself when it completes with the output from ffmpeg.

I have tried

(ffmpeg -i input.mp4 -acodec copy -vcodec copy -y output.mp4 >> ffmpeg.log; cat ffmpeg.log) | mail -s "FFMPEG COMPLETE" email@me.net

But that left me with the email sending immediatly without body.

(my SMTP client is Unix Sendmail)

1 Answers1

0

Is the ffmpeg.log empty - or not?

if your ffmpeg.log is empty try this (it also adds the stderr to the log file): ffmpeg -i input.mp4 -acodec copy -vcodec copy -y output.mp4 &>> ffmpeg.log; cat ffmpeg.log | mail -s "FFMPEG COMPLETE" email@me.net

if the ffmpeg.log is working try this:

ffmpeg -i input.mp4 -acodec copy -vcodec copy -y output.mp4 >> ffmpeg.log; cat ffmpeg.log | mail -s "FFMPEG COMPLETE" email@me.net

maybe the problem is the sendmail. if you install postfix with the internet configuration it should work - but since you don't use a smarthost your mail might be marked as spam

  • ffmpeg.log was empty indeed. The first command does work. Thank you very much! –  Dec 13 '17 at 09:47
  • 2
    That's a [useless use of `cat`](https://stackoverflow.com/questions/11710552/useless-use-of-cat/47746942#47746942) and `&>>` is not portable to all shells, so maybe prefer the standard construct `>>ffmpeg.log 2>&1` – tripleee Dec 13 '17 at 10:00