ffmpeg-php permission denied on localhost

Posted by user572271 on Stack Overflow See other posts from Stack Overflow or by user572271
Published on 2011-01-12T06:40:16Z Indexed on 2011/01/12 6:53 UTC
Read the original article Hit count: 345

Hello, I am very new to php. I recently setup php on my mac and I am trying to setup ffmpeg-php to convert various videos to flv or other formats as desired. I used this tutorial FFmpeg Mac Installation and I got ffmpeg to work using the terminal, however, when I try to encode a movie using php I get an error. In my apache error_log file it says permission denied next to the flv file (shown below).

FFmpeg version 0.6, Copyright (c) 2000-2010 the FFmpeg developers
built on Dec 30 2010 08:36:24 with gcc 4.2.1 (Apple Inc. build 5646) (dot 1) configuration: --prefix=/usr/local --enable-shared --disable-mmx --enable-libmp3lame --enable-gpl --enable-libfaad --enable-zlib --enable-libvorbis --enable-libfaac --enable-nonfree

libavutil 50.15. 1 / 50.15. 1
libavcodec 52.72. 2 / 52.72. 2
libavformat 52.64. 2 / 52.64. 2
libavdevice 52. 2. 0 / 52. 2. 0
libswscale 0.11. 0 / 0.11. 0
Seems stream 1 codec frame rate differs from container frame rate: 1200.00 (1200/1) -> 30.00 (30/1)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/myApple/Sites/AdHere/test.mov':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
Duration: 00:00:02.04, start: 0.000000, bitrate: 1109 kb/s
Stream #0.0(eng): Audio: aac, 44100 Hz, stereo, s16, 97 kb/s
Stream #0.1(eng): Video: h264, yuv420p, 640x480, 1027 kb/s, 30.15 fps, 30 tbr, 600 tbn, 1200 tbc
/Users/myApple/Sites/AdHere/movteststuff.flv: Permission denied

I have no idea what the problem is. I am using the following php code:

<?php 
extension_loaded('ffmpeg') or die('Error in loading ffmpeg');

$ffmpegInstance = new ffmpeg_movie('test.AVI');
echo "getDuration: " . $ffmpegInstance->getDuration() .
"<br>getFrameCount: " . $ffmpegInstance->getFrameCount() .
"<br>getFrameRate: " . $ffmpegInstance->getFrameRate() .
"<br>getFilename: " . $ffmpegInstance->getFilename() .
"<br>getComment: " . $ffmpegInstance->getComment() .
"<br>getTitle: " . $ffmpegInstance->getTitle() .
"<br>getAuthor: " . $ffmpegInstance->getAuthor() .
"<br>getCopyright: " . $ffmpegInstance->getCopyright() .
"<br>getArtist: " . $ffmpegInstance->getArtist() .
"<br>getGenre: " . $ffmpegInstance->getGenre() .
"<br>getTrackNumber: " . $ffmpegInstance->getTrackNumber() .
"<br>getYear: " . $ffmpegInstance->getYear() .
"<br>getFrameHeight: " . $ffmpegInstance->getFrameHeight() .
"<br>getFrameWidth: " . $ffmpegInstance->getFrameWidth() .
"<br>getPixelFormat: " . $ffmpegInstance->getPixelFormat() .
"<br>getBitRate: " . $ffmpegInstance->getBitRate() .
"<br>getVideoBitRate: " . $ffmpegInstance->getVideoBitRate() .
"<br>getAudioBitRate: " . $ffmpegInstance->getAudioBitRate() .
"<br>getAudioSampleRate: " . $ffmpegInstance->getAudioSampleRate() .
"<br>getVideoCodec: " . $ffmpegInstance->getVideoCodec() .
"<br>getAudioCodec: " . $ffmpegInstance->getAudioCodec() .
"<br>getAudioChannels: " . $ffmpegInstance->getAudioChannels() .
"<br>hasAudio: " . $ffmpegInstance->hasAudio();

exec('ffmpeg -i /Users/myApple/Sites/AdHere/test.mov /Users/myApple/Sites/AdHere/movteststuff.flv');



?>

I am able to see various parameters like filename, frameheight, framewidth, which leads me to believe that ffmpeg-php is kind of working, but maybe I am just doing something wrong in the exec() command. Anyone have any ideas. I have been struggling with setting up ffmpeg for quite some time now.

Thanks!

-Jon

© Stack Overflow or respective owner

Related posts about php

Related posts about ffmpeg

  • how to install ffmpeg in cpanel

    as seen on Super User - Search for 'Super User'
    i'm using dedicated server(linux) so i need to install ffmpeg in cpanel so here ffmpeg i found in Main Software Install a Perl Module but i writing script in php so how can i install ffmpeg phpperl when i'am trying to install ffmpeg in perl module i get this response Checking C compiler… >>> More

  • FFMpeg-PHP Installation Error

    as seen on Server Fault - Search for 'Server Fault'
    While installing FFmpeg-PHP, I got this interesting error: /usr/downloads/ffmpeg-php-0.6.0/ffmpeg_movie.c: In function 'zim_ffmpeg_movie_getAudioStreamId': /usr/downloads/ffmpeg-php-0.6.0/ffmpeg_movie.c:1051: error: 'CODEC_TYPE_AUDIO' undeclared (first use in this function) /usr/downloads/ffmpeg-php-0… >>> More

  • git problems installing stuff [closed]

    as seen on Super User - Search for 'Super User'
    root@Frenzen:~# cd root@Frenzen:~# git clone --depth 1 git://source.ffmpeg.org/ffmpeg Initialized empty Git repository in /root/ffmpeg/.git/ root@Frenzen:~# cd root@Frenzen:~# git clone --depth 1 git://source.ffmpeg.org/ffmpeg Initialized empty Git repository in /root/ffmpeg/.git/ root@Frenzen:~#… >>> More

  • Unable to install ffmpeg-php

    as seen on Server Fault - Search for 'Server Fault'
    I followed the instructions on http://www.mysql-apache-php.com/ffmpeg-install.htm but ffmpeg-php does not show up in my phpinfo() The commands I ran (in order) #yum install ffmpeg ffmpeg-devel ... Public key for faac-1.26-1.el5.rf.x86_64.rpm is not installed #rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0… >>> More

  • Unable to install ffmpeg-php

    as seen on Server Fault - Search for 'Server Fault'
    Hi, I followed the instructions on http://www.mysql-apache-php.com/ffmpeg-install.htm but ffmpeg-php does not show up in my phpinfo() The commands I ran (in order) #yum install ffmpeg ffmpeg-devel ... Public key for faac-1.26-1.el5.rf.x86_64.rpm is not installed #rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0… >>> More