#!/usr/bin/env python
# -*- coding: UTF-8 -*-

import os
from optparse import OptionParser

def main():
    parser = OptionParser(usage="usage: %prog -i [video_input.ogv] -o [video_output.avi]")

    parser.add_option(
        "-i", "--input",
        action="store",
        dest="input",
        default=False,
        help="OGV file input"
        )

    parser.add_option(
        "-o", "--output",
        action="store",
        dest="output",
        default=False,
        help="AVI file output name"
        )

    options, args = parser.parse_args()

    if not options.input:
        parser.error("Ogv file not specified")

    if not options.output:
        parser.error("AVI output file name not specified")

    return options

def convert(v_input, v_output):
    command = 'mencoder %s -o %s -oac mp3lame -lameopts fast:preset=standard -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=4000' % (
        v_input,
        v_output)

    os.system(command)
    return

if __name__ == '__main__':
    opts = main()
    convert(opts.input, opts.output)
    raw_input('Press [ENTER] to continue...')


@@ -40,16 +40,1561 @@
 -8 -*-%0A%0A
+%22%22%22%0ACopyright (c) 2012, Eka Putra (ekaputra@balitechy.com)%0AAll rights reserved.%0A%0ARedistribution and use in source and binary forms, with or without%0Amodification, are permitted provided that the following conditions are met:%0A%0A    * Redistributions of source code must retain the above copyright notice,%0A      this list of conditions and the following disclaimer.%0A%0A    * Redistributions in binary form must reproduce the above copyright%0A      notice, this list of conditions and the following disclaimer in the%0A      documentation and/or other materials provided with the distribution.%0A%0A    * Neither the name of the author nor the names of other contributors may%0A      be used to endorse or promote products derived from this software%0A      without specific prior written permission.%0A%0ATHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS %22AS IS%22%0AAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE%0AIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE%0ADISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE%0AFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL%0ADAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR%0ASERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER%0ACAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,%0AOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE%0AOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.%0A%22%22%22%0A%0A
 import o

add license to code