From 606882760499f20b0cc6726c4a7ccc7fd7d32245 Mon Sep 17 00:00:00 2001 From: Brian Geuther Date: Wed, 17 Sep 2025 11:51:09 -0400 Subject: [PATCH 1/2] Changing preset to veryfast --- nextflow/modules/compression.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nextflow/modules/compression.nf b/nextflow/modules/compression.nf index fed540d0..ddb72343 100644 --- a/nextflow/modules/compression.nf +++ b/nextflow/modules/compression.nf @@ -19,7 +19,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 """ } From ffe680dad9fe79b3e35c6e8893e06a699be53670 Mon Sep 17 00:00:00 2001 From: Brian Geuther Date: Wed, 17 Sep 2025 11:55:29 -0400 Subject: [PATCH 2/2] Organizing resource tags and values for compression appropriately --- nextflow/configs/profiles/sumner2.config | 9 +++++++++ nextflow/modules/compression.nf | 12 ++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/nextflow/configs/profiles/sumner2.config b/nextflow/configs/profiles/sumner2.config index 32482af4..6aeefdeb 100644 --- a/nextflow/configs/profiles/sumner2.config +++ b/nextflow/configs/profiles/sumner2.config @@ -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 { diff --git a/nextflow/modules/compression.nf b/nextflow/modules/compression.nf index ddb72343..f40af959 100644 --- a/nextflow/modules/compression.nf +++ b/nextflow/modules/compression.nf @@ -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) @@ -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) @@ -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: