-
Notifications
You must be signed in to change notification settings - Fork 4
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
Change Audio to use HLS #2512
Change Audio to use HLS #2512
Conversation
* Generates HLS instead of MP3s * Speeds up clicking around viewer significantly. * Regenerating derivatives will delete old MP3 derivatives. * Passes auth tokens through the HLS manifest.
@@ -13,6 +13,7 @@ def show | |||
end | |||
|
|||
def send_content | |||
return send_hls if file_desc.mime_type.first.to_s == "application/x-mpegURL" && params[:auth_token].present? |
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.
We're only serving HLS if there's an auth token? Are we not using it for the viewer when the user is logged into Figgy?
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.
We're only re-formatting the HLS if there's an auth token. Otherwise it just falls through to nginx and sends the file that's on disk, unmodified.
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.
👍 OK, that makes sense — send_hls
below is rewriting the existing HLS file with auth_token links.
change_set_persister.buffer_into_index do |buffered_persister| | ||
buffered_persister.save(change_set: change_set) | ||
end | ||
end | ||
|
||
def generate_hls_derivatives(dir) | ||
_stdout, _stderr, status = | ||
Open3.capture3("ffmpeg", "-y", "-i", file_object.disk_path.to_s, "-hls_list_size", "0", "-hls_time", "10", "-f", "hls", "-codec:a", "libmp3lame", dir.join("hls.m3u8").to_s) |
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.
Do we want to move any of these settings to the config file like we do for kakadu?
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.
I don't think that would improve readability, personally. Seems easier to have the command here.
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.
I'm fine with that, and I don't remember the thinking behind putting the jp2 recipes in the config file instead of in code like this.
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.
It was just because that's how Hydra::Derivatives did it.
@@ -42,6 +42,10 @@ def derivative? | |||
use.include?(Valkyrie::Vocab::PCDMUse.ServiceFile) | |||
end | |||
|
|||
def derivative_partial? | |||
use.include?(Valkyrie::Vocab::PCDMUse.ServiceFilePartial) |
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.
Does this exist in valkyrie? I don't see it in https://github.com/samvera-labs/valkyrie/blob/master/lib/valkyrie/vocab/pcdm_use.rb
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.
And definitely not in the http://pcdm.org/use ontology.
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.
No, it's totally made up, because nothing else fit. Works because that vocab's not a strict one.
Closes #2149