473,396 Members | 1,975 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to launch Handbrake via python?

Hi
I'd like to start by saying that I am very very new to python, and even newer to handbrake.
currently I have a folder of folders of video files that I would like to convert to iphone4 videos, so far my script goes through the folder makes a list of the folders then goes through the folder find the ones with a .avi and (with your help) will launch handbrake and encode the desired video.

Expand|Select|Wrap|Line Numbers
  1. import os
  2.  
  3. path2="C:\\"
  4. os.chdir(path2)
  5. List=list()
  6. path="C:\Users\HoustonWKV\Downloads\Complee!!\TV"
  7. dirList=os.listdir(path)
  8. for fname in dirList:   
  9.     List.append(fname)
  10.  
  11. for folder_name in List:
  12.     path=os.path.abspath('Users\\HoustonWKV\\Downloads\\Complee!!\\TV\\'+folder_name)
  13.     print path
  14.  
  15.     dirlist=os.listdir(path)
  16.     for file_name in dirlist:
  17.  
  18.         file = file_name
  19.         file= os.path.splitext( file )
  20.  
  21.         if file[1]== '.avi':
  22.         path3='C:\\Program Files (x86)\\Handbrake'
  23.         os.chdir(path3)
  24. #copy error
  25. #this is the desired cli 
  26. #"./HandBrakeCLI -i"+ path +"-o C:\  -e x264 -q 20.0 -a 1 -E faac -B 128 -6 dpl2 -R Auto -D 0.0 -f mp4 -X 480 -m -x cabac=0:ref=2:me=umh:bframes=0:weightp=0:subme=6:8x8dct=0:trellis=0"
  27.  
  28.  
any help would be great!
Thank you
Mar 11 '11 #1
0 1165

Sign in to post your reply or Sign up for a free account.

Similar topics

14
by: 2mc | last post by:
Generally speaking, if one had a list (from regular Python) and an array (from Numerical Python) that contained the same number of elements, would a While loop or a For loop process them at the...
32
by: David | last post by:
Hi I'm trying to teach myself python and so far to good, but I'm having a bit of trouble getting a function to work the way I think it should work. Right now I'm taking a simple program I wrote in...
0
by: adsheehan | last post by:
Hi, I am embedding Python into a multi-threaded C++ application runnig on Solaris and need urgent clarification on the embedding architecture and its correct usage (as I am experience weird...
6
by: Learning Python | last post by:
A example in learning Python by Mark Lutz and David Ascher about function scope example like this: >>def outer(x): def inner(i): print i, if i: inner(i-1)
16
by: Kenneth McDonald | last post by:
For unfortunate reasons, I'm considering switching back to Win XP (from OS X) as my "main" system. Windows has so many annoyances that I can only compare it to driving in the Bay Area at rush hour...
0
by: bwaha | last post by:
I've posted this question to comp.graphics.apps.gnuplot too but given that this python group may also comprise a lot of gnuplot users, and is far more active, I've posted this question here too. My...
2
by: Harry | last post by:
Hi All, It is nice to join the python group. Can someone please help me with a python question? I have the following object which is like a list of tuples What command do I use to get the value...
4
by: Hoop | last post by:
Hi, I have been working in getting Boost.Python running on my PC, seems to work now. I have what I believe is somewhat of basic question here. I am starting on an application that will...
1
by: Scheol Service | last post by:
---------- Forwarded message ---------- From: Scheol Service <scheols@gmail.com> Date: Nov 29, 2006 10:57 PM Subject: Python Question About Compiling. To: mailto:python-list@python.org Im...
0
by: Stodge | last post by:
Hi folks, new to Boost Python and struggling to build a prototype at work. I thought I'd start with a conceptual question to help clarify my understanding. I already have a basic prototype working...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.