LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 12-12-2005, 06:45 AM   #1
JungMin
Member
 
Registered: Dec 2005
Posts: 40

Rep: Reputation: 15
Batch script for Mencoder???


Been looking around to see if there is a small script available to batch transcode files using mencoder???

I know that there are GUI´s that can do this....but not interested in the GUI, just want to run mencoder in the shell and use a batch process to transcode a whole directory of video files.

Any ideas???
thanks,
jungmin
 
Old 12-12-2005, 06:58 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,373

Rep: Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962
well writing your own script isn't rocket surgery, what is this script supposed to do for you other than a simple loop for a command line that you preumsably already undersatnd?
 
Old 12-12-2005, 07:04 AM   #3
JungMin
Member
 
Registered: Dec 2005
Posts: 40

Original Poster
Rep: Reputation: 15
I dont doubt its easy.....not sure how to do it though. What else is it supposed to do?? Nuthin....just loop until all mencoder has finished with all the files in the directory.
 
Old 12-12-2005, 07:58 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,373

Rep: Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962
well there will not be a script to do that as it's a one line bach command...

for i in /var/media/*.avi; do mencoder -ovc blah blah blah $i -o $i.output; done

for example.
 
Old 12-12-2005, 08:20 AM   #5
JungMin
Member
 
Registered: Dec 2005
Posts: 40

Original Poster
Rep: Reputation: 15
Thanks Chris....
 
Old 12-12-2005, 05:23 PM   #6
JungMin
Member
 
Registered: Dec 2005
Posts: 40

Original Poster
Rep: Reputation: 15
It looks like that loop command will name the output files 1.avi, 2.avi, 3.avi, 4....Is this the case???? Is there any option to put in that command to retain their original file names with an extra character added to the end?? Like homevideo.avi and homevideo1.avi???
 
Old 12-13-2005, 02:06 AM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,373

Rep: Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962
my version will put .output on the end of the same input file name. you need to learn a bit of bash scripting yourself to do it how you want to do it, that example is so so trivial it's unreal...
 
Old 12-13-2005, 11:43 PM   #8
JungMin
Member
 
Registered: Dec 2005
Posts: 40

Original Poster
Rep: Reputation: 15
Yeah, thanks again!!!!!
 
Old 11-20-2011, 06:13 PM   #9
maja_ldm
LQ Newbie
 
Registered: Sep 2008
Posts: 6

Rep: Reputation: 0
I understand even less than JungMin but I'd want to have a batch command encode multiple xvid's with 2pass (which as far as I know require 2 different commands).

how should I do it?
 
Old 11-20-2011, 07:03 PM   #10
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 14,132

Rep: Reputation: 2456Reputation: 2456Reputation: 2456Reputation: 2456Reputation: 2456Reputation: 2456Reputation: 2456Reputation: 2456Reputation: 2456Reputation: 2456Reputation: 2456
Quote:
Originally Posted by maja_ldm View Post
I understand even less than JungMin but I'd want to have a batch command encode multiple xvid's with 2pass (which as far as I know require 2 different commands).

how should I do it?
The first good step would be to not reopen a SIX YEAR OLD thread, and hijack it with your own question, but rather to open your own thread. The second good step would be to identify the commands that you need to run. If you know those commands, then you can easily reference one of the THOUSANDS of bash scripting tutorials, to grab a list of files, and run the command(s) you want on each file, looping through until you're done.

Scripting tutorial is here:
http://tldp.org/LDP/abs/html/
 
Old 11-21-2011, 03:32 AM   #11
maja_ldm
LQ Newbie
 
Registered: Sep 2008
Posts: 6

Rep: Reputation: 0
dear TBOne,

this post is the first result given by google for the search 'mencoder batch linux' and I think my doubt is consistent with the post argument.

anyways I'm looking into your link.
I'm sorry to disturb you but I'm from a different forum where people are helpful.

bye
 
Old 11-21-2011, 03:34 AM   #12
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,373

Rep: Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962
more than likely now, someone WILL reply to this thread trying to help the OP wasting their time, as they would expect any thread they see to be less that ancient. There is no need to be so negative about it, especially as you WERE given help and advice. In order to reply you will have be presented with a screen advising you that the thread is old and you should start your own thread, but you chose to ignore that request.

Last edited by acid_kewpie; 11-21-2011 at 03:38 AM.
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
script batch linux cetoute14 Linux - General 5 09-02-2005 07:37 PM
Change batch script to shell script alan.belizario Programming 5 03-31-2005 12:41 AM
Change batch script to shell script alan.belizario Linux - Software 1 03-30-2005 01:49 AM
Help w/ batch/shell script mikehlinuxquest Linux - General 5 09-13-2004 04:41 PM
Batch mv and tr script ... OrangeWarp Linux - General 1 12-11-2002 05:14 AM


All times are GMT -5. The time now is 01:04 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 Google+: linuxquestions
Open Source Consulting | Domain Registration