Using Python to call Mencoder with some arguments
- by Manu
Hello, I'll start by saying that I am very, very new to Python.
I used to have a Windows/Dos batch file in order to launch Mencoder with the right set of parameters, without having to type them each time.
Things got messy when I tried to improve my script, and I decided that it would be a good opportunity to try coding something in python.
I've come up with that :
#!/usr/bin/python
import sys, os
#Path to mencoder
mencoder = "C:\Program Files\MPlayer-1.0rc2\mencoder.exe"
infile = "holidays.avi"
outfile = "holidays (part1).avi"
startTime = "00:48:00"
length = "00:00:15"
commande = "%s %s -ovc copy -oac copy -ss %s -endpos %s -o %s"
os.system(commande % (mencoder, infile, startTime, length, outfile))
#Pause
raw_input()
But that doesn't work, windows complains that "C:\Program" is not recognized command.
I've trying putting some "\"" here and there, but that didn't help.