LinuxQuestions.org
Support LQ: Use code LQCO20 and save 20% on CrossOver Office
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 01-01-2007, 02:37 PM   #1
joney_bravo
Member
 
Registered: Jul 2004
Distribution: Blag
Posts: 35

Rep: Reputation: 15
Help making a simple script for mencoder.


I would like to make a simple script for mencoder. I use it to resize movies to put on my Creative Zen Vision: M.

Here is the command I use:

Code:
mencoder file1.avi -o test1.avi -vf scale=320:240 -oac mp3lame -ovc xvid -xvidencopts 
bitrate=800
I would like to somhow simplify it so that I can just run the script and type in the filename as I will be converting them to the same format every time.

Any assistance would be greatly appreciated.

Thanks
 
Old 01-01-2007, 03:37 PM   #2
zefo
Member
 
Registered: Mar 2003
Posts: 71

Rep: Reputation: 15
you could do it like this for instance:

#!/bin/bash
mencoder "$1" -o "$1".avi -vf scale=320:240 -oac mp3lame -ovc xvid -xvidencopts bitrate=800
 
Old 01-01-2007, 04:43 PM   #3
joney_bravo
Member
 
Registered: Jul 2004
Distribution: Blag
Posts: 35

Original Poster
Rep: Reputation: 15
I'm sorry, I'm not an avid programmer. Would i put that in a file and name it "convert.sh", for example, or no? I would like to be able to run the script from the folder that I have all of my movies in and then after running the script, input the name of the file that I wish to conver and possibly the name of the output file.

Thanks
 
Old 01-01-2007, 06:28 PM   #4
PatrickMay16
Member
 
Registered: Apr 2005
Location: London, England.
Distribution: Ubuntu 7.04 "Feisty Fawn"
Posts: 55

Rep: Reputation: 16
Quote:
Originally Posted by joney_bravo
I'm sorry, I'm not an avid programmer. Would i put that in a file and name it "convert.sh", for example, or no? I would like to be able to run the script from the folder that I have all of my movies in and then after running the script, input the name of the file that I wish to conver and possibly the name of the output file.

Thanks
The .sh on the end is not required, it's up to you if you put it in the filename or not. However, it is required that you set the script file with the executable permission. Ya know... just so you know.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Batch script for Mencoder??? JungMin Linux - Software 11 11-21-2011 03:34 AM
Iptables (with masq) troubleshooting, very simple script attached script and logs. xinu Linux - Networking 13 11-01-2007 04:19 AM
Making simple linux based OS? lazeeboy Linux - Newbie 3 09-10-2006 04:02 AM
simple mencoder questions exodist Linux - Software 0 08-20-2003 11:23 AM
Simple C Shell script is not so simple elconde Programming 2 09-16-2001 11:53 PM


All times are GMT -5. The time now is 04:57 AM.

Main Menu
 
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
Open Source Consulting | Domain Registration