I am currently developing a module for the audio module to enable RTMP streaming and FFMPEG encoding.
I am wondering what the best approach is to run the scp command (like flash video) when an audio node is added (to add the file to an RTMP server)? Can I use hook_form_alter to run this command? I am looking through the Drupal API at the moment. I also want to run an ffmpeg command as well when the node is added to encode the media for storage on the rtmp server.
Any help or suggestions would be much appreciated.
Cheers,
scarer
Why not just use a trigger?
On Thu, Aug 26, 2010 at 7:32 PM, Sarah Vardy s.vardy1@uq.edu.au wrote:
I am currently developing a module for the audio module to enable RTMP streaming and FFMPEG encoding.
I am wondering what the best approach is to run the scp command (like flash video) when an audio node is added (to add the file to an RTMP server)? Can I use hook_form_alter to run this command? I am looking through the Drupal API at the moment. I also want to run an ffmpeg command as well when the node is added to encode the media for storage on the rtmp server.
Any help or suggestions would be much appreciated.
Cheers,
scarer
[ Drupal support list | http://lists.drupal.org/ ]
I've done something similar and used exec() to call a shell script:
http://php.net/manual/en/function.exec.php
The other option is using the PHP ssh2 module, which support SCP transfers:
http://php.net/manual/en/book.ssh2.php
Jamie Holly http://www.intoxination.net http://www.hollyit.net
On 8/26/2010 7:32 PM, Sarah Vardy wrote:
I am currently developing a module for the audio module to enable RTMP streaming and FFMPEG encoding.
I am wondering what the best approach is to run the scp command (like flash video) when an audio node is added (to add the file to an RTMP server)? Can I use hook_form_alter to run this command? I am looking through the Drupal API at the moment. I also want to run an ffmpeg command as well when the node is added to encode the media for storage on the rtmp server.
Any help or suggestions would be much appreciated.
Cheers,
scarer
Hi,
the best approach is to use hook_nodeapi() http://api.drupalecommerce.org/api/function/hook_nodeapi/6 to trigger the update, and the you can exec() the script or even use the ssh2 extension to communicate directly with the other server. Or you could write a script that will monitor a directory and do something like the cdn module to move transfer the file.
Gordon.
On 27/08/2010, at 9:32 AM, Sarah Vardy wrote:
I am currently developing a module for the audio module to enable RTMP streaming and FFMPEG encoding.
I am wondering what the best approach is to run the scp command (like flash video) when an audio node is added (to add the file to an RTMP server)? Can I use hook_form_alter to run this command? I am looking through the Drupal API at the moment. I also want to run an ffmpeg command as well when the node is added to encode the media for storage on the rtmp server.
Any help or suggestions would be much appreciated.
Cheers,
scarer
[ Drupal support list | http://lists.drupal.org/ ]