5

this my code . after running php code

FFmpeg version 0.5, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration: --prefix=/usr --libdir=/usr/lib --shlibdir=/usr/lib --mandir=/usr/share/man --incdir=/usr/include --enable-libamr-nb --enable-libamr-wb --enable-libdirac --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-x11grab
  libavutil     49.15. 0 / 49.15. 0
  libavcodec    52.20. 0 / 52.20. 0
  libavformat   52.31. 0 / 52.31. 0
  libavdevice   52. 1. 0 / 52. 1. 0
  libswscale     0. 7. 1 /  0. 7. 1
  libpostproc   51. 2. 0 / 51. 2. 0
  built on Nov  6 2009 19:05:03, gcc: 4.1.2 20080704 (Red Hat 4.1.2-46)

Seems stream 0 codec frame rate differs from container frame rate: 50.00 (50/1) -> 25.00 (25/1)
Input #0, flv, from 'demo.flv':
  Duration: 00:00:30.83, start: 0.000000, bitrate: 546 kb/s
    Stream #0.0: Video: h264, yuv420p, 640x360 [PAR 1:1 DAR 16:9], 546 kb/s, 25 tbr, 1k tbn, 50 tbc
    Stream #0.1: Audio: aac, 44100 Hz, stereo, s16
Output #0, image2, to 'demo.jpg':
    Stream #0.0: Video: mjpeg, yuvj420p, 640x360 [PAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 90k tbn, 1 tbc
Stream mapping:
  Stream #0.0 -> #0.0
Press [q] to stop encoding
av_interleaved_write_frame(): I/O error occurred
Usually that means that input file is truncated and/or corrupted.
2
  • it is working fine when i am execute console
    – rajaneesh
    Commented May 7, 2010 at 9:42
  • # ffmpeg -i 'demo.flv' -an -ss 00:00:05 -r 1 -vframes 1 -y 'demo.jpg'
    – rajaneesh
    Commented May 7, 2010 at 9:43

6 Answers 6

17

I've come to the same error message and have found my (silly) mistake.

As silly as I was trying FFMPEG to create a new directory. Got the error message. Read here. Created the folder myself. Re-run the command prompt and voilà, no more error messages.

The silliest mistake on earth. Just in case someone gets the same error.

1
  • As pointed out by @Pekka, when you run PHP code it's the PHP user's permissions that don't have enough rights to create the needed file or folder, while, when you execute the same commands in the console, it's a different user, probably admin, whose permissions allow him to create the needed file or folder. That's why you get an error when executing the command via PHP and not when in console.
    – Giuseppe
    Commented Oct 5, 2020 at 21:41
4

I got this error when I accidentally did this

ffmpeg -i vid.mp4 '%05.jpg'

instead of the following

ffmpeg -i vid.mp4 '%05d.jpg'

which is the correct format for sequential filenames (note the added d).

2
av_interleaved_write_frame(): I/O error occurred
Usually that means that input file is truncated and/or corrupted.

Isn't that a clear enough error message? Have you tried with a different input file?

Update: It could be that your PHP script doesn't have the necessary rights to read the file. Try setting the file's permissions to 777 to see whether that's the reason.

1
  • Solve my problem Thank you
    – Khalid
    Commented May 27, 2018 at 7:08
1

You have to first make a directory to store the files extracted by ffpmeg, since ffmpeg does not have the right to make directories.

0

This can occur when there is insufficient disk space to write the file.

0

In my case, this error occurred due to the file name being too long.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.