Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions nextflow/configs/profiles/sumner2.config
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,15 @@ process {
errorStrategy = { task.attempt <= 3 ? 'retry' : 'ignore' }
maxRetries = 3
}
withLabel: "r_compression" {
// Note: These resources are enough for 1-hour 800x800 videos.
// TODO: These values should scale to duration and size of video.
cpus = 2
memory = 2.GB
time = 2.hours
array = 200
errorStrategy = 'ignore'
}
}

executor {
Expand Down
14 changes: 11 additions & 3 deletions nextflow/modules/compression.nf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
* @return file Path to compressed video
*/
process COMPRESS_VIDEO_CRF {
label "compression"
label "cpu"
// Any environment with ffmpeg installed should work here.
label "tracking"
label "r_compression"

input:
tuple path(video_file), val(crf), val(keyframe_interval)
Expand All @@ -19,7 +22,7 @@ process COMPRESS_VIDEO_CRF {

script:
"""
ffmpeg -i ${video_file} -c:v libx264 -pix_fmt yuv420p -preset slow -crf ${crf} -g ${keyframe_interval} -f mp4 ${video_file.baseName}_g${keyframe_interval}_crf${crf}.mp4
ffmpeg -i ${video_file} -c:v libx264 -pix_fmt yuv420p -preset veryfast -crf ${crf} -g ${keyframe_interval} -f mp4 ${video_file.baseName}_g${keyframe_interval}_crf${crf}.mp4
"""
}

Expand All @@ -38,7 +41,10 @@ process COMPRESS_VIDEO_CRF {
* @note COMPRESS_VIDEO_CRF will typically produce better videos with a low signal-to-noise ratio.
*/
process COMPRESS_VIDEO_BR {
label "compression"
label "cpu"
// Any environment with ffmpeg installed should work here.
label "tracking"
label "r_compression"

input:
tuple path(video_file), val(bitrate), val(keyframe_interval)
Expand Down Expand Up @@ -66,6 +72,8 @@ process COMPRESS_VIDEO_BR {
* @note Difference videos are useful in comparing changes due to compression.
*/
process COMPUTE_VIDEO_DIFFERENCE {
label "cpu"
// Any environment with ffmpeg installed should work here.
label "tracking"

input:
Expand Down