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

Generate Audio Derivatives from WAV Files #2035

Merged
merged 3 commits into from Oct 30, 2018
Merged

Conversation

tpendragon
Copy link
Contributor

No description provided.

Copy link
Member

@hackartisan hackartisan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking about the the audio files we're bringing in via bags, which have vendor-created mp3s. They have files with the pcdm use codes for preservation master and intermediate. This derivative service is running on original file. So are we just relying on this convention to keep from creating derivatives on those objects? It seems not well documented at the least.

I'm not entirely sure we didn't define original_file to return preservation_master, actually. So that's something to check. @jrgriffiniii ?


def create_derivatives
progress = ActiveEncode::Base.create(file_object.disk_path, outputs: ffmpeg_outputs)
sleep(1 / 1000 * 50) until progress.reload.completed? || progress.failed?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason to poll at a sub-millisecond frequency?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is 50ms. Sleep is in seconds.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I was assuming the * had precedence over / — could this be 50 / 1000 for readability?

@tpendragon
Copy link
Contributor Author

@HackMasterA original_file doesn't return preservation_master. What do you think we should do? Document that it won't trigger on MediaResources? Add a validation check to the service so it only runs on FileSets which have a SR parent?

@hackartisan
Copy link
Member

I guess for now we should document? It seemed like the plan was to bring those resources over to scanned resources. I'm not sure what our long-term plan should be. It seems like something that should be more explicit than it is / will be. I'll try to think about it more.

@tpendragon
Copy link
Contributor Author

@HackMasterA Alright, added a few comments at the top.

@hackartisan
Copy link
Member

nice warnings! 😄

let(:storage_adapter) { Valkyrie.config.storage_adapter }
let(:persister) { adapter.persister }
let(:query_service) { adapter.query_service }
let(:file) { fixture_file_upload("files/audio_file.wav", "audio/x-wav") }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tpendragon how did you get this mime type to work without using run_real_characterization: true?

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

Successfully merging this pull request may close these issues.

None yet

3 participants