summaryrefslogtreecommitdiff
path: root/localvideodump
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2014-06-23 17:34:04 +0200
committerJonas Smedegaard <dr@jones.dk>2014-06-23 17:37:56 +0200
commit510109168cd94b6d73f0486e0904268ef9c667e2 (patch)
tree72d3119c82abdbf5087cb9f21486e24976b446fd /localvideodump
parentac76cd57fa16705f280874a0f909cea0591dfb2d (diff)
Separate post-processing script.
Diffstat (limited to 'localvideodump')
-rwxr-xr-xlocalvideodump20
1 files changed, 7 insertions, 13 deletions
diff --git a/localvideodump b/localvideodump
index 49546fa..6a2e33c 100755
--- a/localvideodump
+++ b/localvideodump
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright © 2012, 2013 Jonas Smedegaard <dr@jones.dk>
+# Copyright © 2012-2014 Jonas Smedegaard <dr@jones.dk>
# Description: record most possible video data using least CPU
#
# This program is free software; you can redistribute it and/or modify
@@ -28,9 +28,7 @@
set -e
-#melt cam_Microsoft_LifeCam_Studio.mlt -consumer avformat:x.avi vcodec=ffv1 an=1
-
-output="${1:-dump.mkv}"
+output="${1:-dump.nut}"
# resolve audio inputs: default PCM of all ALSA cards with input devices
ainputs="$(arecord -l | perl -anE '/^card/ and say $F[2]')"
@@ -50,17 +48,13 @@ inrate=20
#inrate=10
outrate=$inrate # seems this ensures fixed rate when input is flaky
+vcodec=copy # uncompressed
#vcodec=huffyuv # more common
-vcodec=ffvhuff # more compact, supports YV12 colorspace
+#vcodec=ffvhuff # more compact, supports YV12 colorspace
#vcodec=ffv1 # most compact, supports RGBA colorspace, too CPU-hungry
-acodec=pcm_s16le
-
-vf="${vf:+$vf }-vf setpts=(RTCTIME-RTCSTART)/(TB*1000000)" # current time
-vf="${vf:+$vf }-vf hqdn3d" # high-quality denoise (good for webcams)
-font='/usr/share/fonts/truetype/droid/DroidSans.ttf'
-#vf="${vf:+$vf }-vf "drawtext=fontfile=$font: timecode='09\:57\:00\:00': r=25: x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: boxcolor=0x00000000@1"}"
-#vf="${vf:+$vf }-vf "drawtext=fontfile=DroidSans.ttf:'timecode=09\:57\:00\:00':r=25:x=\(w-tw\)/2:y=h-\(2*lh\):fontcolor=white:box=1:boxcolor=0x00000000@1"}"
+acodec=copy
+#acodec=pcm_s16le
parse_v4l2_formats() {
v4l2-ctl --list-formats-ext -d "$1" | perl -n \
@@ -112,7 +106,7 @@ FORMATS
vmaps="${vmaps:+$vmaps }-map $i:v:0"
i=$(expr $i + 1)
done
-voutargs=${vinputs:+-c:v $vcodec $vf ${outrate:+-r $outrate}}
+voutargs=${vinputs:+-c:v $vcodec ${outrate:+-r $outrate}}
aoutargs=${ainputs:+-c:a $acodec}
echo avconv $ainargs $vinargs $vmaps $amaps $voutargs $aoutargs -y "$output"