I'd like to save my entire avconv command with options so that I can reuse it without typing it in every time. I would still need to specify the input and output filenames. How do I do this? I'm on Ubuntu.
Make a script:
#!/bin/bash
avconv <your options here> $1 $2
$1
and $2
are arguments that will be passed to avconv
. The idea is to replace input file by $1
and output file by $2
. Then you'll run your script with ./script.sh input.mp4 output.mkv
for example.
Example:
#!/bin/bash
avconv -f alsa -i pulse -f video4linux2 -channel 1 -s 768x576 -i /dev/video0 -deinterlace -c:v mpeg2video -b:v 4000k -b:a 192k $1
And I run it like:
./record.sh video.mpg
video.mpg
is passed through $1
to avconv
.
-
Do I need to place the $1 and $2 in the place they would appear in the command? like 'avconv -i $1 <options> $2' – MikeJerome Jun 19 '14 at 20:49
-
1