summaryrefslogtreecommitdiff
path: root/.config/nushell/dv.nu
diff options
context:
space:
mode:
authorWriterV2 <primary-v2@protonmail.com>2026-04-03 22:46:48 +0200
committerWriterV2 <primary-v2@protonmail.com>2026-04-03 22:46:48 +0200
commita1ec4771740d321df4480e8a7224fa10b59f0569 (patch)
tree5e97e8ced79b4fea057fab6e76f80849c053e401 /.config/nushell/dv.nu
Update repo with git init directly in home dir
Diffstat (limited to '.config/nushell/dv.nu')
-rw-r--r--.config/nushell/dv.nu25
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
+}