Skip to content

Commit

Permalink
Move slicing to output options
Browse files Browse the repository at this point in the history
  • Loading branch information
cavis committed Feb 8, 2024
1 parent 7b56e67 commit 6a7257f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions app/models/tasks/copy_media_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,9 @@ def porter_copy_task
end

def porter_slice_task
input_opts = []
input_opts << "-ss #{media_resource.slice_start}" if media_resource.slice_start.present?
input_opts << "-to #{media_resource.slice_end}" if media_resource.slice_end.present?
output_opts = ["-map_metadata 0"]
output_opts << "-ss #{media_resource.slice_start}" if media_resource.slice_start.present?
output_opts << "-to #{media_resource.slice_end}" if media_resource.slice_end.present?

{
Type: "Transcode",
Expand All @@ -101,7 +100,6 @@ def porter_slice_task
ObjectKey: porter_escape(media_resource.path)
},
FFmpeg: {
InputFileOptions: input_opts.join(" "),
OutputFileOptions: output_opts.join(" ")
}
}
Expand Down

0 comments on commit 6a7257f

Please sign in to comment.