Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: Mencoding Mass

  1. #1
    Join Date
    Mar 2005
    Beans
    62

    Lightbulb Mencoding Mass

    Hey guys,

    Lately I've been dumping a lot of my home videos from tape to digital formats using a capture card. After editing I get a .avi file format, and then use mencoder to convert to dvd format for burning.

    However lately I've gotten a lot of files ready for conversion, but its getting tedious. I'd like to automate the encode process.

    Here's the command I run.

    Code:
    mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd -vf scale=720:480,harddup \
    -srate 48000 -af lavcresample=48000 \
    -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=18:aspect=16/9:\
    acodec=ac3:abitrate=192:threads=4 -ofps 30000/1001 -o your_video.mpg your_video.avi
    I'd like to run this command on every file in my directory, put the output of the command into its own directory for easy management.

  2. #2
    Join Date
    Apr 2008
    Beans
    175

    Re: Mencoding Mass

    Quote Originally Posted by Ryan450 View Post
    Hey guys,

    Lately I've been dumping a lot of my home videos from tape to digital formats using a capture card. After editing I get a .avi file format, and then use mencoder to convert to dvd format for burning.

    However lately I've gotten a lot of files ready for conversion, but its getting tedious. I'd like to automate the encode process.

    Here's the command I run.

    Code:
    mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd -vf scale=720:480,harddup \
    -srate 48000 -af lavcresample=48000 \
    -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=18:aspect=16/9:\
    acodec=ac3:abitrate=192:threads=4 -ofps 30000/1001 -o your_video.mpg your_video.avi
    I'd like to run this command on every file in my directory, put the output of the command into its own directory for easy management.
    I'll write you up something in C if I can figure it.

    Is there a command line argument to have it exit when done with one video?
    "Freedom is the freedom to say that two plus two equals four, if that is granted, then all else follows" - 1984

    Programming is part memorization, part implementation, and part imagination.

  3. #3
    Join Date
    Jun 2007
    Location
    /usr/src
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Mencoding Mass

    I would suggest using a bash script. I myself would probably use python (I did a python script like this recently to fix a subversion problem.) if you want to do python, the class you want to look at is os.walk()

  4. #4
    Join Date
    Mar 2005
    Beans
    62

    Re: Mencoding Mass

    Quote Originally Posted by meanburrito920 View Post
    I would suggest using a bash script. I myself would probably use python (I did a python script like this recently to fix a subversion problem.) if you want to do python, the class you want to look at is os.walk()
    Yes a bash script would suit perfectly, and is what I've been trying to do for the last little bit but I just cant remember bash scripting, been having a hard time finding a decent resource to do this.

    Only thing that ever comes up in google is these stupid little snippits that have nothing to do with what I'm actually looking for.

  5. #5
    Join Date
    Apr 2008
    Beans
    175

    Re: Mencoding Mass

    Quote Originally Posted by Ryan450 View Post
    Yes a bash script would suit perfectly, and is what I've been trying to do for the last little bit but I just cant remember bash scripting, been having a hard time finding a decent resource to do this.

    Only thing that ever comes up in google is these stupid little snippits that have nothing to do with what I'm actually looking for.
    WinFF could also be suitable for your needs, that is, if I understand you correctly.
    "Freedom is the freedom to say that two plus two equals four, if that is granted, then all else follows" - 1984

    Programming is part memorization, part implementation, and part imagination.

  6. #6
    Join Date
    Mar 2005
    Beans
    62

    Re: Mencoding Mass

    Quote Originally Posted by loganwm View Post
    WinFF could also be suitable for your needs, that is, if I understand you correctly.
    Why use something different if what I'm currently using good enough already? I also dont know what settings that gui is using.

    For instance the command above I figured out by reading mencoders documentation to figure out the options I wanted and to get it to use all 4 of my processor cores for maximum speed.

    I'd much rather use a script in the terminal rather then a gui any day as I can further customize it in the future.

  7. #7
    Join Date
    Jul 2005
    Beans
    1,535
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Mencoding Mass

    Not sure what you want. This one liner will run your mencoder command on every file with a .mpg extension. Note, this is untested and might break if files have spaces.
    Code:
    for i in `ls *.mpg`; do
    mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd -vf scale=720:480,harddup \
    -srate 48000 -af lavcresample=48000 \
    -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=18:aspect=16/9:\
    acodec=ac3:abitrate=192:threads=4 -ofps 30000/1001 -o ${i} ${i%.mpg}.avi;
    done
    When I invented the Web, I didn't have to ask anyone's permission.
    ~Tim Berners-Lee on Net Neutrality
    -------------------------------------
    Visit the Ubuntu Programming IRC-channel at #ubuntu-programming (chat.freenode.net).

  8. #8
    Join Date
    Apr 2008
    Beans
    175

    Re: Mencoding Mass

    Quote Originally Posted by Ryan450 View Post
    Why use something different if what I'm currently using good enough already? I also dont know what settings that gui is using.

    For instance the command above I figured out by reading mencoders documentation to figure out the options I wanted and to get it to use all 4 of my processor cores for maximum speed.

    I'd much rather use a script in the terminal rather then a gui any day as I can further customize it in the future.
    It's alright man, I didn't realize that you wanted it in a specific method.

    Just giving suggestions.
    "Freedom is the freedom to say that two plus two equals four, if that is granted, then all else follows" - 1984

    Programming is part memorization, part implementation, and part imagination.

  9. #9
    Join Date
    Jun 2007
    Location
    /usr/src
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Mencoding Mass

    If you're looking to learn some bash, look here. tldp.org has some great stuff.

    http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html

  10. #10
    Join Date
    Mar 2005
    Beans
    62

    Re: Mencoding Mass

    ok What I have is a ton of .avi files in a directory.

    I want to run the command I supplied in my first post in this thread on every .avi file in the directory.

    The output of the command is a .mpg which I want in its own directory called output.

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •