Hi!
I had exactly the same problem. I solved it by having Django write the
Video file to a directory. In the background, a process checks every
couple of seconds if there is a new FLV to convert. This process is
completely independent of Django. You might want to start it with an
init.d script or something.
This process could be something simple like this bash script:
#!/bin/bash
while true
do
for i in *.avi
do
MAGIC_MENCODER_COMMAND_GOES_HERE $i $i.flv
rm $i # remove the original file, or move it
done
sleep 5 # wait a few seconds
done
(I have not tested this, just to give you an idea)
Your code could of course be way more sophisticated, like spawning a new
process upon a signal or whatever.
I hope you find this useful.
Regards,
Daniel
Am Mittwoch, den 14.03.2007, 19:08 +0000 schrieb Henrik Lied:
> Hi there!
>
> I have a model which allows people to upload videos.
> In the save-method I run os.system("mencoder *variables"), which
> converts the uploaded video to a flash file.
>
> I don't want the user to have to wait until the conversion is done
> before he can go on with his business. I've tried the Thread-module,
> but the current job still waits for the background process to finish..
>
> Does anyone have a good idea (with a full example) on how I should go
> on? :-)
>
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---