I work with Ubuntu, and want to launch video transcoding from a PHP script. I use the exec() command but there is something wrong with the rights.
This is the error message I have :
Code: Select all
VLC media player 0.8.5 Janus
[00000281] dummy interface: using the dummy interface module...
[00000286] access_output_file private error: cannot open `/home/gruzlor/fichierEnc.ogg' (Permission denied)
[00000285] stream_out_standard private error: no suitable sout access module for `file/ogg:///home/gruzlor/fichierEnc.ogg'
[00000284] main stream output error: stream chain failed for `std{access=file,mux=ogg,dst="/home/gruzlor/fichierEnc.ogg"}'
[00000282] main input error: cannot start stream output instance, aborting
[00000291] dummy demuxer: command `quit'
[00000277] main playlist: nothing to play
[00000277] main playlist: stopping playback
[00000001] main vlc error: could not create /var/www/.vlc (Permission denied)
[00000001] main vlc error: could not create /var/www/.vlc/cache (No such file or directory)
Here is my php code (very simple) :
Code: Select all
<?php
echo "Beginning of transcoding...<br />";
$cmd= "/home/gruzlor/public_html/transcode.sh";
exec("$cmd 2>&1", $output);
foreach($output as $outputline)
{
echo("$outputline<br />");
}
echo " <br /> End <br />";
?>
Code: Select all
#!/bin/bash
chemin='/home/gruzlor/'
origfile='fichier.mpg'
encfile='fichierEnc'
for conteneur in ogg asf
do
vlc --intf dummy --plugin-path /home/gruzlor/.vlc/cache $chemin$origfile :sout='#std{access=file,mux='$conteneur',dst="'$chemin$encfile'.'$conteneur'"}' vlc:quit
done
exit 0
Thanks.