Running a bash script from an HTML link or button

Posted by Andrew on Super User See other posts from Super User or by Andrew
Published on 2013-11-07T02:46:13Z Indexed on 2013/11/07 4:00 UTC
Read the original article Hit count: 295

Filed under:
|

I have a webserver that's hosting lots of images. I want the client to be able to press a button or a link, which will run a bash script, which will create a video based on all these pictures. The script I'm trying to run is this:

#!/bin/bash
# cd to the directory
cd /var/www/gallery

# use ffmpeg to make video
ffmpeg -pattern_type glob -i 'img-*jpg' -r 1 video.mp4

# Take the first file in the directory and name it video.mp4.jpg (for thumbnail)
cp `ls | sort -n | head -1` video.mp4.jpg

The script is located on the server. So when the client clicks the link or button, the script will run, and the video is created. I've tried both solutions listed here but I can't seem to get it to work. I have php installed on my server.

© Super User or respective owner

Related posts about bash

Related posts about html