473,487 Members | 2,448 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Starting an external, independent process from a script

Hi there!

I'm trying to create a video uploading service (just to learn). The
system is mostly based on Django, but the question I'm looking an
answer for is more related to Python.

So, the user gets to upload a video file. This can either be a mpg,
avi or mp4-file. When the file is saved to its location, I want to
convert it to FLA (Flash Video). I'm currently using Mplayers
Mencoder, and this works great. The Mencoder is retrieved through
running os.system("mencoder variables here")

The problem with this is that the user has to wait until the movie is
done encoding until he can go around with his business. I don't look
upon this as ideal.

So - I want to spawn a new system process. I need some good pointers
on how to do this right.

Any input? :-)

Thanks a lot in advance!

Mar 12 '07 #1
4 3113
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Henrik Lied wrote:
Hi there!
So - I want to spawn a new system process. I need some good
pointers on how to do this right.

Any input? :-)

Thanks a lot in advance!
You can try os.spawnl().
The url is http://docs.python.org/lib/os-process.html
- --
Thinker Li - th*****@branda.to th********@gmail.com
http://heaven.branda.to/~thinker/GinGin_CGI.py
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF9jFe1LDUVnWfY8gRArO/AKDaJaHfrAluc0euEqPn/NN2J2tXsgCgye/D
ujNCylOGx3P/yC0UZc5oXHc=
=yRuY
-----END PGP SIGNATURE-----

Mar 13 '07 #2
I've tried os.spawnv and os.spawn, but these give no error and no
result.
Henrik Lied skreiv:
Hi there!

I'm trying to create a video uploading service (just to learn). The
system is mostly based on Django, but the question I'm looking an
answer for is more related to Python.

So, the user gets to upload a video file. This can either be a mpg,
avi or mp4-file. When the file is saved to its location, I want to
convert it to FLA (Flash Video). I'm currently using Mplayers
Mencoder, and this works great. The Mencoder is retrieved through
running os.system("mencoder variables here")

The problem with this is that the user has to wait until the movie is
done encoding until he can go around with his business. I don't look
upon this as ideal.

So - I want to spawn a new system process. I need some good pointers
on how to do this right.

Any input? :-)

Thanks a lot in advance!
Mar 13 '07 #3
On 12 Mar 2007 16:13:51 -0700, Henrik Lied <he********@gmail.comwrote:
>I'm trying to create a video uploading service (just to learn). The
system is mostly based on Django, but the question I'm looking an
answer for is more related to Python.
En Tue, 13 Mar 2007 06:57:33 -0300, rishi pathak
<ma*************@gmail.comescribió:
You can do something like this:
pid = os.fork()
I don't think it's a good idea, the running process is Django, not a
script.

To the OP: I think the question *is* a Django question. You could launch
the external process, finish the current request and redirect to another
location; in that page you set a refresh to itself, and show the current
status "somehow" depending on how your external process can report its
progress. The details on how to do that, or even if that way is a good
approach at all, depend on Django.

--
Gabriel Genellina

Mar 13 '07 #4
I use ffmpeg instead of mencoder, calling it using os.popen(). You can
also use the "commands" module, but I prefer the first one.

Bye,
Massimo

Mar 14 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
2862
by: serge calderara | last post by:
Dear all, I have an application which is suppose to start another executable process. As soon as that process is running, I need to retrive its handle. The problem of the particular process I am...
3
2538
by: Jørn A. | last post by:
I'm working on a web based user interface for a job scheduling system (running scripts). The system is using a non-windows scheduler software, but it's installed and running as a windows...
0
1001
by: calderara serge | last post by:
Dear All, I am building an application with VB.Net that is starting an external process from my application code by using the process object. The problem I get is that the application that I...
4
20105
by: My SQL | last post by:
Hi Can I trigger an external program to run when a new record is added to the mysql table? The external program is in C and instead of scanning the table continuously for new insertions, it...
1
9581
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
1
2200
by: mikelujan | last post by:
Hi, Our application starts an external application using System.Diagnostics.Process class and the Start() method, as per code snippet below. This application run as a Windows service, and must...
10
2369
by: Stefan Weber | last post by:
Hi, I'm trying to access the JavaScript code contained in a <scripttag via its "text" attribute. This works well, if the code is embedded in the HTML page. However, when the code is in an...
7
1866
by: tim | last post by:
Hi all, I want to execute a VB application from a ASP page (not .Net). Want I want to do is that I write some parameters to a database and then start the external application that will pickup...
3
4014
by: tundal45 | last post by:
Hey Guys, I am trying to automate the process of loading data in our oracle server. As a part of that process, I am working on a perl script that loads external tables from data files. What I am...
0
7108
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
6967
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7181
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
5445
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4875
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...
0
3078
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3071
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1383
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
618
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.