ffmpeg fails with no error message

Posted on 2009-02-23
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
    LVL 13

    Accepted Solution

    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.
    LVL 1

    Author Comment

    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
    LVL 1

    Author Comment

    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
    LVL 1

    Author Closing Comment

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

    Featured Post

    Courses: Start Training Online With Pros, Today

    Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

    Join & Write a Comment

    Suggested Solutions

    Have you ever stumbled upon a software that is so great that you just love? It happened to me. Love at first sight. Filezilla Server.   Ok its not the most advanced ftp server I've came across. But its a fairly simple piece of software to get the …
    Preface There are many applications where some computing systems need have their system clocks running synchronized within a small margin and eventually need to be in sync with the global time. There are different solutions for this, i.e. the W3…
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    754 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

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now