-
Notifications
You must be signed in to change notification settings - Fork 111
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
Audio analysis: mediorum changes #8536
Audio analysis: mediorum changes #8536
Conversation
…actual analysis cmd
|
RUN go build | ||
RUN go build -o mediorum-cmd cmd/main.go | ||
|
||
FROM alpine:3.17 AS final | ||
|
||
RUN apk add curl ffmpeg | ||
RUN apk add curl ffmpeg libsndfile python3-dev py3-pip build-base |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool to see basically all the same deps as https://github.com/swesterfeld/audiowmark which @stereosteve and I have been messing with
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SO sick! Gonna have to defer to @stereosteve for the go stuff because I don't have much/any experience with it. But generally this looks good to me
} | ||
|
||
func (ss *MediorumServer) analyzeKey(filename string) (string, error) { | ||
cmd := exec.Command("/bin/analyze-key", filename) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
neat
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not confident enough to approve without someone like steve reviewing, but this is looking dope
} | ||
} | ||
|
||
func (ss *MediorumServer) findMissedAnalysisJobs(work chan *Upload, myHost string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will leave this function for steve :)
|
||
// poll periodically for uploads that slipped thru the cracks. | ||
// mark uploads with timed out analyses as done | ||
for { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing a lot of context, what is the main thing this solves?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this handles cases where the 1st mirror misses the job for whatever reason (most likely, the node went down). in such instances the next mirrors pick up the job. after 1 min, if the job is still not finished, it times out and gets marked as done so the client can proceed with the upload
the transcoder has similar logic
audius-protocol/mediorum/server/transcode.go
Line 123 in ab6657a
func (ss *MediorumServer) findMissedJobs(work chan *Upload, myHost string, retranscode bool) { |
This looks pretty great! My one thought is... we're adding a new background polling thing and a I'm not super familiar with the client upload flow, but if it is polling for I think this is okay if it's decently fast. Since it uses the crudr hook I think it should actually kick the job off right away without waiting for polling interval. Have you tested end to end with client? How long does the analysis take on a 3 minute song and a 1 hour song? I see here it Anyway one option might be... instead of introducing a new processing state, we query for |
so the idea is, when a node gets a new upload, it crudr broadcasts a new upload with have not tested e2e yet, only locally via a POST to the mediorum node, but analysis typically takes a few seconds on songs that are a few minutes long. i wanted to use the essentia python library which was very performant (1-2s) for even v long songs, but it was not playing nice with docker, so im using libkeyfinder for the key and aubio for bpm. aubio takes about 1-2 seconds even on long tracks (i tested a 45min track) but libkeyfinder was slower on a long track. still < 1 minute. in any case it wont block the upload for more than 1 minute, and the plan is for discovery to run a job that retries failed analyses regularly with a longer timeout interval. are those numbers decently fast in your opinion? my plan for this PR is, as long as everyone is ok with adding up to a minute to the upload time to allow for audio analysis, to merge without any discovery or client changes so that mediorum analyzes but nothing gets saved in discovery yet. that way i can see what the analyses look like with real data with these key/bpm libraries. if its way too slow or inaccurate i can swap out for some different libraries (but keep this mediorum processing state flow).
do you mean discovery runs something like this query and kicks off audio analysis this way? or mediorum queries this regularly, and discovery periodically checks for newly completed audio analyses? i decided to add it as a blocking part of the upload flow so that the client can poll all the audio artifacts as usual (and the key/bpm data shows up immediately after the upload succeeds) and to avoid adding a discovery / content node dependency. |
…ed at timestamp for timeout check
[7343561] [PAY-2842][PAY-2780][PAY-3069] Fix authorized endpoints not supporting manager mode (#8646) Randy Schott [ddaa1b3]⚠️ Third Party Wallet Support [PAY-2949][PAY-2948][PAY-2950] (#8611) Marcus Pasell [c15f20d] Fix prod mediorum dockerfile to have keyfinder dependency (#8666) Michelle Brier [7fe9451] Fix solana-relay logging, fix eslint config (#8663) Marcus Pasell [a495f42] [C-4453] Fix notification email image and layout (#8647) Isaac Solo [2ceae28] Audio analysis: mediorum changes (#8536) Michelle Brier [15a34b3] [C-4353] Add recent searches to search v2 (#8615) Sebastian Klingler [0050b29] Fix sdk typecheck (#8656) Sebastian Klingler
Description
How Has This Been Tested?