LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 03-09-2004, 12:26 PM   #1
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Rep: Reputation: 58
Mencoder: encode so that the result will just fit on a CD?


I just began to play around mencoder, which I find a great tool.

It appeared to me that I might back up some movies with it.
As with everything, I want to do it automatically, with the less user interaction, and in the the best quality that fits on a CD.

I wonder if mencoder can do this "out of the box", or if I could write a wrapper script that would e.g. continuously monitor the encoding process (file size and percentage), and kill and restart mencoder with new settings if it sees that the resulting file would be too big.

The encoding process is supposed to run for hours, while I think that the size of the resulting file could be reliably judged after the first 5 minutes, so the time of killing and restarting mencoder could be ignored compared to the time of the whole project, while it could save me much handwork.

Do you have an idea how to monitor the mencoder output with a bash script?
 
Old 03-09-2004, 12:42 PM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
mencoder does have some options that you could use to do what you ask, you might want to write a little script to automate it.

-endpos <[[hh:]mm:]ss[.ms]|size[b|kb|mb]> (see -ss and -sb option too)
Stop encoding at given time or byte position. Can be specified in many ways:

-ss <time> (see -sb option too)
Seek to given time position.

-sb <byte position> (see -ss option too)
Seek to byte position. Useful for playback from CDROM images / .VOB files with junk at the beginning.

See man mencoder for a more complete description and some examples.

Hope this helps.
 
Old 03-09-2004, 12:45 PM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
that's a pretty ugly way to approach it imho... you could be there for ages. you have options:

1) http://acidrip.sf.net (next version i release will support file input)
2) use 3pass encoding to provide you with bitrates from mencoder specifially for cd sized files (see docs)
3) work it out yourself....

assuming you're gonna use a fixed bitrate audio stream, e.g. 128kbit joint stereo, video bitrate for a given film is...

Vbitrate = ( size in kbits / Length in seconds ) - audio bitrate in kbps

e.g a 90 minute film on a 700mb cd with 128 audio:

Vbitrate = ( ( 700 * 1024 * 8 ) / ( 90 * 60 ) ) - 128

Vbitrate = ( 5734400 / 5400 ) - 128

Vbitrate = 1062 - 128 = 934kbps

how easy is that? Personally i use average bitrate, not constant bitrate, which means that you'll save a couple of megs on the audio, meaning that it'll probably end up being 697Mb rather than 700, which gives a generally nicer margin for error
 
  


Reply



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
how to encode Ñ in linux lafarga Linux - Newbie 3 01-13-2005 03:11 PM
Mencoder: shrinking a file so it will fit on a cd? sk545 Linux - Software 1 06-04-2004 03:40 PM
encode XVID with 23.* or 29.* shanenin Linux - Software 0 05-29-2004 12:41 AM
mencoder: re-scale and fit on a CD? J_Szucs Linux - Software 0 03-18-2004 01:36 AM
mencoder wont encode the sound bignester Linux - Software 4 01-15-2004 09:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:20 AM.

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