Scripting with variables from file
- by Nooster
I have several videos on my PC that I would like to shorten. For instance I have a 30 sec video where I want to have the section from sec 15 to 20 (a 5sec video). To cut this, I use avconv.
avconv -i input.mp4 -ss 15 -acodec copy -vcodec copy -t 5 output.mp4
This command works pretty well. I have many videos I want to cut the same way. This is why I created a textfile containing the information: input-name, start of cut, length of cut, output-name. Those are written into in.txt that looks like this:
input.mp4 15 5 output.mp4
input1.mp4 32 10 output1.mp4
input2.mp4 10 7 output2.mp4
...
My question is: How do I have to modify the avconv-command to cut my videos automatically? What I tried was this, but it didn't work at all:
avconv -i $1 -ss $2 -acodec copy -vcodec copy -t $3 $4 < in.txt
Any idea?