Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm developing on a windows machine and was successfully using the following code for checking videos:

ffmpeg -v error -i $file_path -f null - 2>&1

After deploying it to linux, I'm getting the bellow error for which I couldn't find anything on the mighty Google

Expected number for v but found: error

Any words of wisdom???

share|improve this question
    
Which Linux distro is this? I don't know if it would be causing this issue, but the 'ffmpeg' in the Debian/Ubuntu repositories is actually avconv; this might be a case of divergent syntaxes. –  evilsoup May 17 '13 at 21:59
    
CentOS release 6.4. I only have access to the server's webroot directory and am running these commands through PHP's exec() function. –  Kate May 18 '13 at 0:03

3 Answers 3

up vote 0 down vote accepted

-v takes a number for the verbosity level, so you'd need to write -v 0 for only errors (as per original), or -v 1 for more info.

share|improve this answer
    
Thanks, towo. I've changed it to -v 0, the result however is outputting more then just errors. –  Kate May 16 '13 at 23:51
    
It's weird, as 0 should only be error/fatal plus potential banners: ffmpeg-users.933282.n4.nabble.com/Verbosity-td934587.html –  towo May 17 '13 at 0:09
    
I know, strange and annoying! Is it possible that the -v option is disabled? –  Kate May 17 '13 at 0:18
    
In fact, -v does not take 0 as a number anymore. You're citing a thread from 2008, so this has changed a lot in between. See my answer for the correct numbers. –  slhck May 18 '13 at 19:24

Perhaps what you want is the -err_detect flag?

-err_detect        <flags>      .D.VA. set error detection flags
   crccheck                     .D.VA. verify embedded CRCs
   bitstream                    .D.VA. detect bitstream specification deviations
   buffer                       .D.VA. detect improper bitstream length
   explode                      .D.VA. abort decoding on minor error detection    
   careful                      .D.VA. consider things that violate the spec and have not been seen in the wild as errors
   compliant                    .D.VA. consider all spec non compliancies as errors
   aggressive                   .D.VA. consider things that a sane encoder should not do as an error
share|improve this answer
    
That's a good option, but it also doesn't affect the output in my case :(... I ended up just reading the result status to identify if there was an error. –  Kate May 17 '13 at 4:28

You're probably using an old version of ffmpeg, most likely something ancient that shipped with CentOS. Depending on your kernel you can download a static build, or build it yourself to get the latest version.

Then, the -v option (or -loglevel, which is the same), accepts the following parameters:

  • ‘quiet’ – Show nothing at all; be silent.
  • ‘panic’ – Only show fatal errors which could lead the process to crash, such as and assert failure. This is not currently used for anything.
  • ‘fatal’ – Only show fatal errors. These are errors after which the process absolutely cannot continue after.
  • ‘error’ – Show all errors, including ones which can be recovered from.
  • ‘warning’ – Show all warnings and errors. Any message related to possibly incorrect or unexpected events will be shown.
  • ‘info’ – Show informative messages during processing. This is in addition to warnings and errors. This is the default value.
  • ‘verbose’ – Same as info, except more verbose.
  • ‘debug’ – Show everything, including debugging information.

It does accept numbers, but those are hardcoded values in the log.h file:

AV_LOG_QUIET    -8
AV_LOG_PANIC     0
AV_LOG_FATAL     8
AV_LOG_ERROR    16
AV_LOG_WARNING  24
AV_LOG_INFO     32
AV_LOG_VERBOSE  40
AV_LOG_DEBUG    48

So, you can use those numbers if you want, but it'll of course be easier to just use the string representations.

share|improve this answer
    
The ffmpeg version is an older one: FFmpeg version 0.6.5, Copyright (c) 2000-2010 the FFmpeg developers" [1]=> string(73) " built on Jan 29 2012 17:52:15 with gcc 4.4.5 20110214 (Red Hat 4.4.5-6) and, unfortunately, I don't have the privileges to upgrade it. As you suggested I tried using the hardcoded numbers, but ffmpeg doesn't seem to like that and comes back with The value for v was 16 which is not within -10.000000 - 10.000000 –  Kate May 19 '13 at 2:55
    
The log numbers are the same for 0.6.5, but maybe they've changed the way they're parsed. If you can't change the version yourself, consider asking your provider if they can supply you with a newer version though – you wouldn't believe how many bugs have been closed and improvements were made since 0.6.5. –  slhck May 19 '13 at 8:10
    
I'll cross my fingers and hope they'll take mercy and upgrade. Thank you very much for your input!!! –  Kate May 20 '13 at 0:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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