ffmpeg fails with no error message

I am trying to use ffmpeg to extract a single frame from a video.  I am running it from the exec command in php.  I can run simple ffmpeg commands, like ffmpeg -version, but when I try to extract the frame it fails with an exit status code of 1, but no error message.  How can I determine what the problem is?  Is there anything wrong with the parameters?  My ffmpeg command is:

ffmpeg -v 2 -y -i shambala.mp4 -ss 00:00:03 -vframes 1 -an -s 320x240 shambala_preview.jpg
Who is Participating?
Xyptilon2Connect With a Mentor Commented:
Try executing this command, add STDOUT and STDERR redirection (if on linux)

ffmpeg -v 2 -y -i shambala.mp4 -ss 00:00:03 -vframes 1 -an -s 320x240 shambala_preview.jpg 1>/tmp/stdout 2>/tmp/stderr

change the paths to c:\temp if on windows....and after executing, look at the contents of the files, specifically the STDERR output to give you an idea of what the problem is.
geomouchetAuthor Commented:
Thanks!  Now I'm getting somewhere.  The stderr output is:
FFmpeg version SVN-r14473, Copyright (c) 2000-2008 Fabrice Bellard, et al.
  configuration: --prefix=/usr/local/cpffmpeg --enable-shared --enable-nonfree --enable-gpl --enable-pthreads --enable-liba52 --enable-libamr-nb --enable-libamr-wb --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --extra-cflags=-I/usr/local/cpffmpeg/include/ --extra-ldflags=-L/usr/local/cpffmpeg/lib --enable-cross-compile
  libavutil version: 49.7.0
  libavcodec version: 51.62.0
  libavformat version: 52.18.0
  libavdevice version: 52.0.0
  built on Feb  2 2009 16:48:14, gcc: 3.4.6 20060404 (Red Hat 3.4.6-10)
shambala.mp4: Unknown format

Why would mp4 be an unknown format?  When I do ffmpeg -formats, one of the lines listed is:

D  mov,mp4,m4a,3gp,3g2,mj2 QuickTime/MPEG-4/Motion JPEG 2000 format
geomouchetAuthor Commented:
And my corrected command line is:
ffmpeg -y -i shambala.mp4 -ss 00:00:03 -vframes 1 shambala_preview.jpg 1>stdout.txt 2>stderr.txt

I was originally missing the -i
geomouchetAuthor Commented:
Thanks!  That was exactly what I needed to caption the error message.  My second problem turned out to be a corrupted file.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.