Skip to content
Advertisement

FFmpeg “Could not open file” error message when processing with PHP

I am using ffmpeg to get the image from several video files. I got my ffmpeg codes ready but I got the following error when I exec my codes.

JavaScript

I only show the error messages that have color highlighted. My code:

JavaScript

It seems my Linux wants to me to switch to avconv. I am not sure how to fix these errors. Can someone give me a hint about it?

Advertisement

Answer

You should always show the full output and not cut out parts. In your example, the error would have been more apparent if you showed the actual ffmpeg command line that was executed instead of the whole PHP code around it.

In your case, your problem is that the command looks like:

JavaScript

However, /test/project is a folder, and not a valid output image path. You can use /text/project/image%04d.jpg if you want images being created from image0001.jpg onwards.

If you real goal is to just export one thumbnail, use the vframes option:

JavaScript

In newer ffmpeg, you can use -frames:v as well.


You can use the ffmpeg in Ubuntu, but it’s an old version. You can either use avconv from Libav or the original ffmpeg from FFmpeg — I would recommend compiling it from source.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement