[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


ffmpeg fails with no error message

Posted on 2009-02-23
Medium Priority
Last Modified: 2012-05-06
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
Question by:geomouchet
  • 3
LVL 13

Accepted Solution

Xyptilon2 earned 720 total points
ID: 23721047
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.

Author Comment

ID: 23724723
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

Author Comment

ID: 23724737
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

Author Closing Comment

ID: 31550835
Thanks!  That was exactly what I needed to caption the error message.  My second problem turned out to be a corrupted file.

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Suggested Courses
Course of the Month19 days, 12 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question