Home > archlinux, bash, post, script, video > AVI -> mpeg 2

AVI -> mpeg 2

 

#!/bin/bash
#
#
mkdir -p "$1/mpeg"
comandols=$(ls $1 | cut -d" " -f1)
dato=$(echo $comandols | cut -d" " -f1)
i=2
while [ "$dato" != "" ]
do
	# http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-vcd-dvd.html
	# dvd:
	mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:tsaf -vf scale=720:576,harddup -srate 48000 
       -af lavcresample=48000 -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:
       keyint=15:vstrict=0:acodec=ac3:abitrate=192:aspect=16/9 -ofps 25 $1/$dato -o $1/mpeg/$dato.mpg
	dato=$(echo $comandols | cut -d" " -f$i)
	let "i+=1"
done

 
Un piccolissimo script che avevo scritto tempo fa che uso per convertirmi i filmati da videocamera in formato AVI (con nessuna compressione, AVI “puro” per intenderci) in mpeg2 usando mencoder.

Per lanciarlo dovete fare una cosa di questo tipo:
./script percorso_assoluto_directory_file_avi
dove all’interno di quel percorso vi metterà una cartella mpeg dove troverete i file convertiti.
Naturalmente gli originali non verranno modificati.

About these ads
Categories: archlinux, bash, post, script, video Tags: , ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

%d bloggers like this: