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.

Is there a way to stop ffmpeg from processing if an error was encountered? I'm using ffmpeg to check video integrity by using:

ffmpeg -v error -i file.avi -f null - 2>error.log

However, I'd like to expand on it to stop the process as soon as an error is identified.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

I've already wondered about this myself, and ffmpeg doesn't provide an easy way to do that. Based on the feedback I got on the FFmpeg mailing list, you can use the global option

-err_detect explode

This option doesn't appear to work in all cases though. See ffmpeg -h full for the option list:

-f_err_detect      <flags>      .D.... set error detection flags (deprecated; use err_detect, save via avconv)
   crccheck                     .D.... verify embedded CRCs
   bitstream                    .D.... detect bitstream specification deviations
   buffer                       .D.... detect improper bitstream length
   explode                      .D.... abort decoding on minor error detection
   careful                      .D.... consider things that violate the spec and have not been seen in the wild as errors
   compliant                    .D.... consider all spec non compliancies as errors
   aggressive                   .D.... consider things that a sane encoder shouldnt do as an error
-err_detect        <flags>      .D.... set error detection flags
   crccheck                     .D.... verify embedded CRCs
   bitstream                    .D.... detect bitstream specification deviations
   buffer                       .D.... detect improper bitstream length
   explode                      .D.... abort decoding on minor error detection
   careful                      .D.... consider things that violate the spec and have not been seen in the wild as errors
   compliant                    .D.... consider all spec non compliancies as errors
   aggressive                   .D.... consider things that a sane encoder shouldnt do as an error
share|improve this answer
    
Thanks! I will give that option a go, some error capturing is better then nothing :) –  Kate Apr 30 '13 at 15:24
add comment

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.