Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FFmpeg, when called on a non-video file raises an error #16

Open
jcoyne opened this issue Oct 23, 2013 · 1 comment
Open

FFmpeg, when called on a non-video file raises an error #16

jcoyne opened this issue Oct 23, 2013 · 1 comment

Comments

@jcoyne
Copy link
Member

jcoyne commented Oct 23, 2013

I run this command:

      Hydra::FileCharacterization.characterize(f, [:fits, :ffprobe])

This error is raised:

 RuntimeError:
       Unable to execute command "ffprobe -i "/Users/justin/workspace/bawstun/spec/storage/qj/72/pc/13/m/broadway_or_bust.pbcore.xml" -print_format xml -show_streams -v quiet"

It seems like there should be some conditions for which this characterizer is run.

Interestingly ffmpeg is still returning valid output:

<?xml version="1.0" encoding="UTF-8"?>
<ffprobe>
</ffprobe>

but it does warn that: "Invalid data found when processing input"

Perhaps characterizers need to be able to configure whether exit status must be success:
https://github.com/projecthydra/hydra-file_characterization/blob/c5b298f6cbbeac3a708badb43e355e0db40efe7a/lib/hydra/file_characterization/characterizer.rb#L45

@jcoyne
Copy link
Member Author

jcoyne commented Oct 23, 2013

I'm working around this by doing the following:

def characterize(file)
      out = [] 
      out << Hydra::FileCharacterization.characterize(file, :fits)
      begin
        out << Hydra::FileCharacterization.characterize(file, :ffprobe)
      rescue RuntimeError
        # FFMpeg doesn't exit with success if it's not a format it knows about.
      end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

1 participant