Problem with transcoding (Bash script) from a PHP script

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
gruzlor
New Cone
New Cone
Posts: 7
Joined: 26 Oct 2006 23:46

Problem with transcoding (Bash script) from a PHP script

Postby gruzlor » 01 Nov 2006 00:11

Hi

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)
So I copied the '.vlc' directory to /var/www/, but there is still a problem with the access_output_file (Permission...).

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 />"; ?>
And my bash script (I tried to launch vlc without and with sudo) :

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
I don't know what's wrong. Any idea?

Thanks.

Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 58 guests