evanpurkhiser / keyfinder-cli

A CLI wrapper for libkeyfinder. Making DJs lives easier.
GNU General Public License v3.0
118 stars 25 forks source link

Call FFmpeg Register Functions to Fix Ubuntu 18.04 #11

Closed mwegner closed 5 years ago

mwegner commented 6 years ago

I ended up investigating why keyfinder-cli was failing on Ubuntu 18.04. It'd compile, but running it would produce "Invalid data found when processing input" error from avformat_open_input (after passing it through av_make_error_string--was just returning a negative error code).

Turns out these two function calls are needed before opening file. I don't' know enough about ffmpeg to know when these requirements were added, or why it's only seeming to affect Ubuntu 18.04 versus i.e. macOS compilation:

av_register_all(); avcodec_register_all();

This fixes Ubuntu 18.04's default repository installs for sure--didn't test other places.

evanpurkhiser commented 6 years ago

Damn, now I wish I better documented why I removed the av_register_all call.

https://github.com/EvanPurkhiser/keyfinder-cli/commit/b3abbef52313306606d8a3ea1102325752641467#diff-b3849ce144ba6d7db0a1fb453262bf30L86

mwegner commented 6 years ago

Oh huh! I'm completely out of my depth here, unfortunately--I've done a bunch of command line things with ffmpeg, but never dealt with its source/libraries for any reason.

My hack worked for me, but "worked for me" is probably some terribly sandy real estate for a house. I've been running a beets library keyfinder scan for over 24 hours now, so no issues there at least.

evanpurkhiser commented 5 years ago

Ubuntu uses a older ffmpeg :/

Which is why these are needed. Added back in #13.