Calling ffmpeg doesn't work on apache server

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Calling ffmpeg doesn't work on apache server

Chad Vernon
I'm trying to use ffmpeg to generate a thumbnail for a video.  It works just fine when I call it from a python shell and when I test it in "python manage.py shell".  However when I try to run from the apache server running locally, I get an error:

# normally I call subprocess.call, but for debug here I'm calling check_call
response = subprocess.check_call(['ffmpeg', '-i', self.file.path], stderr=fh)

# actual path taken out for brevity
Command '['ffmpeg', '-i', u'...']' returned non-zero exit status -6

I've verified that the video path is correct.

Any suggestions?

Thanks!
Chad

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Calling ffmpeg doesn't work on apache server

Chad Vernon
Looks like it has something to do with calling subprocess from the server because this gives the same error:

response = subprocess.check_output(['which', 'ls'])

Anyone have any suggestions?

On Wednesday, June 19, 2013 4:01:30 PM UTC-7, Chad Vernon wrote:
I'm trying to use ffmpeg to generate a thumbnail for a video.  It works just fine when I call it from a python shell and when I test it in "python manage.py shell".  However when I try to run from the apache server running locally, I get an error:

# normally I call subprocess.call, but for debug here I'm calling check_call
response = subprocess.check_call(['ffmpeg', '-i', self.file.path], stderr=fh)

# actual path taken out for brevity
Command '['ffmpeg', '-i', u'...']' returned non-zero exit status -6

I've verified that the video path is correct.

Any suggestions?

Thanks!
Chad

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Calling ffmpeg doesn't work on apache server

Chad Vernon
One last observation:

I think it has something to do with the apache user permissions.  I'm running the mod_wsgi daemon process with myself as the user and I need to specify the full path to ffmpeg (/usr/local/bin/ffmpeg).  Even when I do that the function runs every other time.  So I'm totally confused now.  I'm an apache/django beginner so bear with me please!



On Wednesday, June 19, 2013 4:12:02 PM UTC-7, Chad Vernon wrote:
Looks like it has something to do with calling subprocess from the server because this gives the same error:

response = subprocess.check_output(['which', 'ls'])

Anyone have any suggestions?

On Wednesday, June 19, 2013 4:01:30 PM UTC-7, Chad Vernon wrote:
I'm trying to use ffmpeg to generate a thumbnail for a video.  It works just fine when I call it from a python shell and when I test it in "python manage.py shell".  However when I try to run from the apache server running locally, I get an error:

# normally I call subprocess.call, but for debug here I'm calling check_call
response = subprocess.check_call(['ffmpeg', '-i', self.file.path], stderr=fh)

# actual path taken out for brevity
Command '['ffmpeg', '-i', u'...']' returned non-zero exit status -6

I've verified that the video path is correct.

Any suggestions?

Thanks!
Chad

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Calling ffmpeg doesn't work on apache server

John
Chad,

Are you restarting apache after each change? It sounds like you have the default 2 workers and you are getting two different 'versions' alternately. Apache needs to be restarted if you change something (or there's some magic touch you can do with wsgi that I forget).

Otherwise it does look like permissions, or running in the wrong directory, or such like.

John

On 20/06/13 00:48, Chad Vernon wrote:
One last observation:

I think it has something to do with the apache user permissions.  I'm running the mod_wsgi daemon process with myself as the user and I need to specify the full path to ffmpeg (/usr/local/bin/ffmpeg).  Even when I do that the function runs every other time.  So I'm totally confused now.  I'm an apache/django beginner so bear with me please!



On Wednesday, June 19, 2013 4:12:02 PM UTC-7, Chad Vernon wrote:
Looks like it has something to do with calling subprocess from the server because this gives the same error:

response = subprocess.check_output(['which', 'ls'])

Anyone have any suggestions?

On Wednesday, June 19, 2013 4:01:30 PM UTC-7, Chad Vernon wrote:
I'm trying to use ffmpeg to generate a thumbnail for a video.  It works just fine when I call it from a python shell and when I test it in "python manage.py shell".  However when I try to run from the apache server running locally, I get an error:

# normally I call subprocess.call, but for debug here I'm calling check_call
response = subprocess.check_call(['ffmpeg', '-i', self.file.path], stderr=fh)

# actual path taken out for brevity
Command '['ffmpeg', '-i', u'...']' returned non-zero exit status -6

I've verified that the video path is correct.

Any suggestions?

Thanks!
Chad
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Calling ffmpeg doesn't work on apache server

Chad Vernon
Hi John,

Yes I am restarting apache after all changes I do.  How do I check what workers I have running?

Thanks,
Chad

On Wednesday, June 19, 2013 4:57:00 PM UTC-7, John wrote:
Chad,

Are you restarting apache after each change? It sounds like you have the default 2 workers and you are getting two different 'versions' alternately. Apache needs to be restarted if you change something (or there's some magic touch you can do with wsgi that I forget).

Otherwise it does look like permissions, or running in the wrong directory, or such like.

John

On 20/06/13 00:48, Chad Vernon wrote:
One last observation:

I think it has something to do with the apache user permissions.  I'm running the mod_wsgi daemon process with myself as the user and I need to specify the full path to ffmpeg (/usr/local/bin/ffmpeg).  Even when I do that the function runs every other time.  So I'm totally confused now.  I'm an apache/django beginner so bear with me please!



On Wednesday, June 19, 2013 4:12:02 PM UTC-7, Chad Vernon wrote:
Looks like it has something to do with calling subprocess from the server because this gives the same error:

response = subprocess.check_output(['which', 'ls'])

Anyone have any suggestions?

On Wednesday, June 19, 2013 4:01:30 PM UTC-7, Chad Vernon wrote:
I'm trying to use ffmpeg to generate a thumbnail for a video.  It works just fine when I call it from a python shell and when I test it in "python manage.py shell".  However when I try to run from the apache server running locally, I get an error:

# normally I call subprocess.call, but for debug here I'm calling check_call
response = subprocess.check_call(['ffmpeg', '-i', self.file.path], stderr=fh)

# actual path taken out for brevity
Command '['ffmpeg', '-i', u'...']' returned non-zero exit status -6

I've verified that the video path is correct.

Any suggestions?

Thanks!
Chad
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="UL11UaGrITAJ">django-users...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="UL11UaGrITAJ">django...@....
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Calling ffmpeg doesn't work on apache server

ovnicraft
In reply to this post by Chad Vernon



On Wed, Jun 19, 2013 at 6:01 PM, Chad Vernon <[hidden email]> wrote:
I'm trying to use ffmpeg to generate a thumbnail for a video.  It works just fine when I call it from a python shell and when I test it in "python manage.py shell".  However when I try to run from the apache server running locally, I get an error:

# normally I call subprocess.call, but for debug here I'm calling check_call
response = subprocess.check_call(['ffmpeg', '-i', self.file.path], stderr=fh)

# actual path taken out for brevity
Command '['ffmpeg', '-i', u'...']' returned non-zero exit status -6


Can you pastebin de output, when use ffmpeg as subprocess (i did it) you can get in output what happens, check_output can help you if you want output in response var.

Regards,
 
I've verified that the video path is correct.

Any suggestions?

Thanks!
Chad

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Cristian Salamea
@ovnicraft

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Calling ffmpeg doesn't work on apache server

Chad Vernon
The issue turns on to be a bug in Python regarding sub-interpreters:

http://stackoverflow.com/questions/8309465/popen-does-not-work-anymore-with-apache-wsgi-and-python-2-7-2

Adding this to my http conf fixed it:
WSGIApplicationGroup %{GLOBAL}

On Thursday, June 20, 2013 4:51:10 PM UTC-7, ovnicraft wrote:



On Wed, Jun 19, 2013 at 6:01 PM, Chad Vernon <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="ZX84Qkl-KfcJ">chadv...@...> wrote:
I'm trying to use ffmpeg to generate a thumbnail for a video.  It works just fine when I call it from a python shell and when I test it in "python manage.py shell".  However when I try to run from the apache server running locally, I get an error:

# normally I call subprocess.call, but for debug here I'm calling check_call
response = subprocess.check_call(['ffmpeg', '-i', self.file.path], stderr=fh)

# actual path taken out for brevity
Command '['ffmpeg', '-i', u'...']' returned non-zero exit status -6


Can you pastebin de output, when use ffmpeg as subprocess (i did it) you can get in output what happens, check_output can help you if you want output in response var.

Regards,
 
I've verified that the video path is correct.

Any suggestions?

Thanks!
Chad

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="ZX84Qkl-KfcJ">django-users...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="ZX84Qkl-KfcJ">django...@....
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Cristian Salamea
@ovnicraft

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.