User Tools

Site Tools


tutorial:batch_processing

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
tutorial:batch_processing [2011/01/15 16:00]
agent_007 fix error
tutorial:batch_processing [2011/04/17 13:16]
agent_007 [Command-line only batch processing]
Line 28: Line 28:
 <code bash> <code bash>
 #!/bin/bash #!/bin/bash
-VAR="​batchfiles.txt"​ 
 VIDEOCODEC="​Xvid"​ VIDEOCODEC="​Xvid"​
 AUDIOCODEC="​MP3"​ AUDIOCODEC="​MP3"​
-ls *.mp4 | sort > $VAR # Collect the files in the current directory +for FIL in `ls *mp4 | sort; do 
-cat $VAR | while read line; do  # Loop read the filenames from the file +  avidemux2 --video-codec $VIDEOCODEC --audio-codec $AUDIOCODEC --force-alt-h264 --load "$FIL" --save ${FIL%.*}.avi ​--quit
-  INPUT=$(echo ${line}) # Grab the next new filename +
-  OUTPUT=${INPUT%.*4} # Remove shortest match of characters between the '. ' and the '​4'​ at end of string +
-  OUTPUT+="​.avi"​ # Append new extension +
-  avidemux2 --video-codec $VIDEOCODEC --audio-codec $AUDIOCODEC --force-alt-h264 --load "$INPUT" --save ​"$OUTPUT" ​--quit ​+
 done done
-rm $VAR # Remove the text file with the file names 
 </​code> ​ </​code> ​
 (this will create **something.avi** from **something.mp4**) (this will create **something.avi** from **something.mp4**)
Line 61: Line 55:
 VIDEOBITRATE="​cbr=512"​ VIDEOBITRATE="​cbr=512"​
 AUDIOBITRATE="​64"​ AUDIOBITRATE="​64"​
-ls *.mp4 | sort > $VAR # Collect the files in the current directory +for FIL in `ls *mp4 | sort; do 
-cat $VAR | while read line; do  # Loop read the filenames from the file +  avidemux2 --video-codec $VIDEOCODEC --video-conf $VIDEOBITRATE --audio-codec $AUDIOCODEC --audio-bitrate $AUDIOBITRATE --force-alt-h264 --load "$FIL" --save ${FIL%.*}.avi ​--quit
-  INPUT=$(echo ${line}) # Grab the next new filename +
-  OUTPUT=${INPUT%.*4} # Remove shortest match of characters between the '. ' and the '​4'​ at end of string +
-  OUTPUT+="​.avi"​ # Append new extension +
-  avidemux2 --video-codec $VIDEOCODEC --video-conf $VIDEOBITRATE --audio-codec $AUDIOCODEC --audio-bitrate $AUDIOBITRATE --force-alt-h264 --load "$INPUT" --save ​"$OUTPUT" ​--quit ​+
 done done
-rm $VAR # Remove the text file with the file names 
 </​code> ​ </​code> ​
 (this will create **something.avi** from **something.mp4**) (this will create **something.avi** from **something.mp4**)
tutorial/batch_processing.txt · Last modified: 2012/11/11 08:51 (external edit)