I'm using mplayer -vo png -frames 1 tv:// to make MPlayer take a single shot from my webcam.

Currently, it saves it to the desktop. What command can I use to make it save the file to /var/www/html instead?

I know that it uses your working directory by default. So you can do

cd /var/www/html
mplayer -vo png -frames 1 tv://

That will save the photo to the right folder, but it's not a clean solution.

Is there an argument to change the save location without using cd though?


It should work this way:

mplayer -vo png:outdir=/var/www/html -frames 1 tv://

but it does not work for me. I do not know why.

But this works:

mplayer -vo jpeg:outdir=/var/www/html -frames 1 tv://
  • sudo mplayer -vo png:outdir=/var/www/html -frames 1 tv:// works for me. Were you getting a permission error? Try it with sudo – Pikamander2 Oct 21 '15 at 18:48
  • I use another directory that does not require sudo. It is good that it works for you. I get a could not parse output=... error. it depends on a package version. – Pilot6 Oct 21 '15 at 18:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.