www.webdeveloper.com
Results 1 to 3 of 3

Thread: exec() Command Not Working - FFMPEG

  1. #1
    Join Date
    Apr 2005
    Posts
    92

    exec() Command Not Working - FFMPEG

    I am having a problem with exec() not working properly and I can't figure out why.

    If I enter the output directly in the terminal it works fine. However, when I try and execute the command via PHP exec() it does not work.

    Can anyone tell me why this is not working?

    PHP Code:
    $config['ffmpeg'] = '/usr/bin/ffmpeg';
    $watermark '/home/mydomain/public_html/watermark.png';
    $src '/home/mydomain/public_html/input.flv';
    $dst '/home/mydomain/public_html/output.flv';
    $cmd    $config['ffmpeg']. ' -i ' .$src' -vf "movie=' .$watermark' [wm]; [in][wm] overlay=main_w-overlay_w-10:10 [out]"' .$dst;
    exec($cmd); 

  2. #2
    Join Date
    Apr 2005
    Posts
    92
    Looks like this has to do with a permissions issue. It shows a 'Permission Denied' error for the input file. The file is set to 0775 and I have also tried to chown the file and it's directory without any luck.

    Any idea how to fix this permission problem?

    Code:
    Array ( [0] => ffmpeg version N-50471-g7992bdb Copyright (c) 2000-2013 the FFmpeg developers [1] => built on Mar 4 2013 19:03:13 with gcc 4.1.2 (GCC) 20080704 (Red Hat 4.1.2-54) [2] => configuration: --enable-gpl --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 [3] => libavutil 52. 17.103 / 52. 17.103 [4] => libavcodec 54. 92.100 / 54. 92.100 [5] => libavformat 54. 63.102 / 54. 63.102 [6] => libavdevice 54. 3.103 / 54. 3.103 [7] => libavfilter 3. 41.100 / 3. 41.100 [8] => libswscale 2. 2.100 / 2. 2.100 [9] => libswresample 0. 17.102 / 0. 17.102 [10] => libpostproc 52. 2.100 / 52. 2.100 [11] => /home/mydomain/public_html/input.flv: Permission denied ) /usr/bin/ffmpeg -i /home/mydomain/public_html/input.flv -vf "movie=/home/mydomain/public_html/watermark.png [wm]; [in][wm] overlay=main_w-overlay_w-10:10 [out]" /home/mydomain/public_html/output.flv -y 2>&1

  3. #3
    Join Date
    Apr 2005
    Posts
    92
    I got this to work by setting both the file and the directory to 0777

    I also had to add 2>&1 to the end of the command

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles