diff options
Diffstat (limited to '.config/nushell/dv.nu')
| -rw-r--r-- | .config/nushell/dv.nu | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/.config/nushell/dv.nu b/.config/nushell/dv.nu new file mode 100644 index 0000000..e5e382a --- /dev/null +++ b/.config/nushell/dv.nu @@ -0,0 +1,25 @@ +export def record [name: string] { + let location: path = $env.MISCPATH | path join / rawdv $name + mkdir $location + cd $location + dvgrab -a +} + +export def collect-to-mp4 [dvdirectory: string, name: string] { + let location: path = $env.MISCPATH | path join / rawdv $dvdirectory + let output_location: path = $env.MISCPATH | path join output + cd $location + let file_list = "tmp_file_list.txt" + ls **/*.dv + | get name + | each { |path| $"file '($path)'"} + | save $file_list + ffmpeg -f concat -safe 0 -i $file_list -c:v libx264 -crf 23 -preset medium $"($name).mp4" + mv $"($name).mp4" $output_location + rm $file_list +} + +export def record-and-save [name: string] { + record $name + collect-to-mp4 $name $name +} |
