konverzija video > audio(izdvajanje)

Obrada zvuka i slike, audio i video produkcija i slične teme

Moderator: Urednik

Post Reply

offline

Post Napisano: 07 Jul 2010, 01:29


Evo malko se igram sa bash-om, pa sam "napisao" malu skripticu :D (ovo je moje prvo cedo) nemojte zameriti

Skripta sluzi da konvertuje ulazni video file u audio, koristeci ffmpeg

Code: Select all

#!/bin/bash
## convert .flv video to mp3 audio 
IN_FILE=$1
OUT_FILE=$2

if [ -z $IN_FILE  ]; then
	echo "Usage: "
	echo "./flv2mp3 File.flv File"
	echo "or"
	echo "./flv2mp3 File.flv, produce mp3 audio file File.flv.mp3"
	exit 0
fi

if [ -e $IN_FILE ]; then
	if [ -z $OUT_FILE ]; then 
		ffmpeg -i ./$IN_FILE -vn -ar 44100 -ac 2 -ab 192 -f mp3 $IN_FILE.mp3
	else 
		ffmpeg -i ./$IN_FILE -vn -ar 44100 -ac 2 -ab 192 -f mp3 $OUT_FILE.mp3
	fi
	echo "DONE" 
else 
	echo "File doesn't exist!"
fi

Sigurno nije savrsena ali radi posao ;)
Last edited by branko on 07 Jul 2010, 01:38, edited 1 time in total.


Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests