-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add audiofile.has_video() #153
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files
|
Hey, thanks for the update! I think it's a great extension. My only question is how we should handle it if a file does not exist. If we have an non-existing ["wav", "flac", "mp3", "ogg"] file we get an result
whereas it raises an Error for all other datatypes.
I am also not getting the Do you think it makes sense to include an |
Thanks for testing this out. For and added a test for it. Now we get: >>> audiofile.has_video('no_file.wav')
False
>>> audiofile.has_video('no_file.mp4')
...
RuntimeError: 'no_file.mp4' does not exist. Regarding your other comment. When $ sudo mv /usr/bin/mediainfo /usr/bin/mediainfo.bak
$ touch empty.mp4
$ python -c "import audiofile; audiofile.has_video('empty.mp4')"
...
FileNotFoundError: mediainfo cannot be found.
Please make sure it is installed.
For further instructions visit: https://audeering.github.io/audiofile/installation.html |
Thanks for the updates!
Yes, this is fine. I meant, that it is no meaningful error message if the file is missing. Look, good to me. |
Add
audiofile.has_video()
to check if a given media file contains video.In
audbcards
we need to inspect media files if they contain video or not. One approach is to usemediainfo
for this. Asaudiofile
relies already onmediainfo
, I thought it would be a good fit to integrate that function here.