close command of FFMPEG-PHP for a movie file

Discussion in 'PHP' started by dracula51, Jun 12, 2009.

  1. #1
    Here's my php file's code

    
    <?
    
    extension_loaded('ffmpeg') or die('Error in loading ffmpeg');
    $ffmpegMov = new ffmpeg_movie('path/to/video.mpg');
    
    $bitrate = $ffmpegMov->getBitRate();
    
    unlink('path/to/video.mpg');
    
    /* 
    Here's the all other codes & I'll use $bitrate later...
    */
    
    ?>
    
    PHP:
    now the problem is video.mpg cannot be deleted with this command: unlink('path/to/video.mpg'); as it is opened by FFMPEG-PHP extension >> new ffmpeg_movie('path/to/video.mpg');

    now what is the close command of ffmpeg-php...so i can add that before unlink..so the file will be unlinked.
     
    dracula51, Jun 12, 2009 IP
  2. Social.Network

    Social.Network Member

    Messages:
    517
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    35
    #2
    I read the ffmpeg API documentation http://ffmpeg-php.sourceforge.net/doc/api/ffmpeg_movie.php.

    There are no "close" methods, just methods to get the properties of the video and/or audio file.

    Exception is thrown, because you are trying to delete when ffmpeg still has a handle to the file.

    I have not worked with ffmpeg, but will take a look at it if you send me the project source code.
     
    Social.Network, Jun 13, 2009 IP