LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Blogs > peonuser
User Name
Password

Notices

Rate this Entry

pwm and saving file space.

Posted 07-14-2011 at 09:45 AM by peonuser

Wrote a little freebasic program that did not require any extra hardware to experiment with pwm.

Code:
01	cls
02	for x = 1 to 50
03	for y =1 to x
04	locate 1,1
05	?"1";
06	for z = 1 to 500000 step 5
07	next z
08	next y
09	for a = 1 to 50 -x
10	locate 1,1
11	?" ";
12	for z = 1 to 500000 step 5
13	next z
14	next a
15	next x

Automated my avi to ogv conversion. I know it could have been done better.

Doing a single file:

Code:
	echo Squeezing video of $1.avi
	echo --------------------------------------------------
	echo Going from avi to mpeg.
	ffmpeg -i $1.avi -b 100000k -ab 128k -ar 44100 $1.mpeg
	 
	echo Avi to mpeg done.
	echo Going from mpeg to ogv
	ffmpeg2theora $1.mpeg
	 
	echo Removing unneeded mpeg file to free space.
	rm $1.mpeg
	 
	echo Done
        echo ----------------------------------------------------
	echo List ogv file
	ls -al $1.ogv
	echo ====================================================
Multiple files in a directory.

Code:
	for f in *.avi
	do
	clear
	echo "Processing $f file..."
	# take action on each file. $f store current file name
	echo
	echo Squeezing video of $f
	echo --------------------------------------------------
	echo Going from avi to mpeg.
	filename=${f%\.*}
        echo ${filename}
	ffmpeg -i $f -b 100000k -ab 128k -ar 44100 ${filename}.mpeg
	 
	echo Avi to mpeg done.
	echo
	echo Going from mpeg to ogv
	ffmpeg2theora ${filename}.mpeg
	 
	echo Removing unneeded mpeg and avi file to free space.
	rm ${filename}.mpeg
	# uncomment the following only if the avi files are duplicates..
	# rm $f
	 
	echo Done
	echo ----------------------------------------------------
	echo List ogv file
	ls -al ${filename}.ogv
	 
	echo appending filename to list of files converted
	echo ${filename} >> filesdone
	echo ====================================================
	done
Posted in Uncategorized
Views 330 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 06:32 AM.

Main Menu
Advertisement

Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration