File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed
Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -540,6 +540,15 @@ process {
540540 errorStrategy = { task.attempt <= 3 ? 'retry' : 'ignore' }
541541 maxRetries = 3
542542 }
543+ withLabel: "r_compression" {
544+ // Note: These resources are enough for 1-hour 800x800 videos.
545+ // TODO: These values should scale to duration and size of video.
546+ cpus = 2
547+ memory = 2.GB
548+ time = 2.hours
549+ array = 200
550+ errorStrategy = 'ignore'
551+ }
543552}
544553
545554executor {
Original file line number Diff line number Diff line change 99 * @return file Path to compressed video
1010 */
1111process COMPRESS_VIDEO_CRF {
12- label " compression"
12+ label " cpu"
13+ // Any environment with ffmpeg installed should work here.
14+ label " tracking"
15+ label " r_compression"
1316
1417 input:
1518 tuple path(video_file), val(crf), val(keyframe_interval)
@@ -19,7 +22,7 @@ process COMPRESS_VIDEO_CRF {
1922
2023 script:
2124 """
22- 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
25+ 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
2326 """
2427}
2528
@@ -38,7 +41,10 @@ process COMPRESS_VIDEO_CRF {
3841 * @note COMPRESS_VIDEO_CRF will typically produce better videos with a low signal-to-noise ratio.
3942 */
4043process COMPRESS_VIDEO_BR {
41- label " compression"
44+ label " cpu"
45+ // Any environment with ffmpeg installed should work here.
46+ label " tracking"
47+ label " r_compression"
4248
4349 input:
4450 tuple path(video_file), val(bitrate), val(keyframe_interval)
@@ -66,6 +72,8 @@ process COMPRESS_VIDEO_BR {
6672 * @note Difference videos are useful in comparing changes due to compression.
6773 */
6874process COMPUTE_VIDEO_DIFFERENCE {
75+ label " cpu"
76+ // Any environment with ffmpeg installed should work here.
6977 label " tracking"
7078
7179 input:
You can’t perform that action at this time.
0 commit comments