Jump to content

Strange file access issue


ejay

Recommended Posts

Hello,

I'm having a very strange issue which i'm unable to identify/resolve.

 

I'm extracting an image using ffmpeg using following command

$source = '/home/test1/abc.mov';
$thumb = '/home/test1/thumb.jpg';
system('ffmpeg -i "' . $source . '" -ss 6 -vcodec mjpeg -f image2 -s 180x100 ' . $thumb);

This piece of code works fine and I can see the file, thumb.jpg, in the FTP fine. But if I run a

file_exists($thumb);

right after the above piece of code, PHP can't find the file. The image is created as is a valid jpg file (displays fine if downloaded via FTP)

I'm able to access all other files in '/home/test1/' directory using file_get_contents(); and file_exists() without any issues.

Any help would be appreciated.

thanks

 

Link to comment
Share on other sites

thanks for the quick reply.

here's the code (I'm debugging atm)

 

if (file_exists($thumb))
{
    echo "<pre>thumb exists</pre>";
}
else
{
    echo "<pre>thumb can not be accessed</pre>";
}

 

and I always get "thumb can not be accessed" :(

Link to comment
Share on other sites

Ok I got it resolved. It had nothing to do with ffmpeg.

Originally the "$thumb" and "$source" strings were different than my original post. The string were in following form (notice the quotes)

//original dev's code format
$source = '"/home/test1/abc.mov"';
$thumb = '"/home/test1/thumb.jpg"';

Something on the server got updated (by admins) and the code stopped working :|

 

I hope it helps somebody somehow.

thanks.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.