From a05dc46d611abb0ff231294c2bd66d40acb99512 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Wed, 10 May 2017 13:19:51 +0200 Subject: Support use of container. --- bin/livedump | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/bin/livedump b/bin/livedump index 1485621..77daac3 100755 --- a/bin/livedump +++ b/bin/livedump @@ -6,8 +6,10 @@ # # Examples: livedump # livedump dv ./dump /%Y%m%d/%H%M%S /%H%M%S +# livedump dv-avi # -# (examples are effectively identical, the latter showing defaults) +# First two examples effectively identical, using defaults. +# Third example using AVI container instead # # Description: Save live source to file and append if interupted. # By default captures IEC61883 DVCPRO stream from IEEE1394 (Firewire) @@ -26,14 +28,27 @@ SESSIONPATTERN=${3:-/%Y%m%d/%H%M%S} SEGMENTPATTERN=${4:-/%H%M%S} case $FORMAT in + dv|dv-*) + INPUTFORMAT=dv + SUFFIX=${FORMAT#dv-} + OUTPUTFORMAT=${FORMAT#dv-} + ;; +esac + +case $SUFFIX in + mkv) OUTPUTFORMAT=matroska;; +esac + +case $INPUTFORMAT in dv) set -- \ -f iec61883 -i auto \ - -f dv -timecode "$(date +%H:%M:%S.00)" -codec copy - SUFFIX=dv + -f ${OUTPUTFORMAT#dv-} \ + -timecode "$(date +%H:%M:%S.00)" -codec copy ;; esac + LINKPATH="$BASESTEM.$SUFFIX" SESSIONSTEM=$(date +"$SESSIONPATTERN") SESSIONPATH="$BASESTEM$SESSIONSTEM.$SUFFIX" -- cgit v1.2.3