Initial commit
This commit is contained in:
commit
e3b486f8b7
3 changed files with 79 additions and 0 deletions
24
LICENSE
Normal file
24
LICENSE
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
This is free and unencumbered software released into the public domain.
|
||||||
|
|
||||||
|
Anyone is free to copy, modify, publish, use, compile, sell, or
|
||||||
|
distribute this software, either in source code form or as a compiled
|
||||||
|
binary, for any purpose, commercial or non-commercial, and by any
|
||||||
|
means.
|
||||||
|
|
||||||
|
In jurisdictions that recognize copyright laws, the author or authors
|
||||||
|
of this software dedicate any and all copyright interest in the
|
||||||
|
software to the public domain. We make this dedication for the benefit
|
||||||
|
of the public at large and to the detriment of our heirs and
|
||||||
|
successors. We intend this dedication to be an overt act of
|
||||||
|
relinquishment in perpetuity of all present and future rights to this
|
||||||
|
software under copyright law.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||||
|
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||||
|
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||||
|
OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
For more information, please refer to <http://unlicense.org/>
|
9
README.md
Normal file
9
README.md
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
# Camrec to AVI
|
||||||
|
Converts a .camrec file to a .avi file.
|
||||||
|
AVI sucks so I recommend converting it afterwards to something less bad.
|
||||||
|
|
||||||
|
### Requirements
|
||||||
|
Requires `bash`, `p7zip` and `ffmpeg`
|
||||||
|
|
||||||
|
# Usage
|
||||||
|
`camrectoavi.sh input [-o outputfile]`
|
46
camrectoavi.sh
Executable file
46
camrectoavi.sh
Executable file
|
@ -0,0 +1,46 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Arg parser
|
||||||
|
while [ ! $# == 0 ]; do
|
||||||
|
case "$1" in
|
||||||
|
-o | --output) OUTPUT=$2;;
|
||||||
|
*)
|
||||||
|
if [[ -f $1 ]]; then
|
||||||
|
INPUT=$1
|
||||||
|
else
|
||||||
|
echo "Invalid argument \"$1\""
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
# If no input is specified, exit
|
||||||
|
[[ ! -f $INPUT ]] && echo "No input file specified!" && exit 1
|
||||||
|
|
||||||
|
# If no output is specified, plop it into the same folder as the source and rename to *.avi
|
||||||
|
[[ ! $OUTPUT ]] && OUTPUT=$(echo "$INPUT" | sed 's/\(.*\)\..*/\1/').avi
|
||||||
|
|
||||||
|
#################
|
||||||
|
|
||||||
|
# Make tempdir
|
||||||
|
TMPDIR="/tmp/$(echo "$INPUT" | sed 's/\(.*\)\..*/\1/')-$RANDOM"
|
||||||
|
mkdir "$TMPDIR"
|
||||||
|
|
||||||
|
# Extract camrec file
|
||||||
|
7z e "$INPUT" -o"$TMPDIR"
|
||||||
|
|
||||||
|
# Ready up ffmpeg jank for merging audio (I hope to god there is only one video stream)
|
||||||
|
AUDIO=
|
||||||
|
NUM=0
|
||||||
|
for i in "$TMPDIR/*.wav"; do
|
||||||
|
AUDIO+="-i $i -map $NUM "
|
||||||
|
NUM=$(( $NUM + 1 )) # Fuck you Bash
|
||||||
|
done
|
||||||
|
|
||||||
|
# Convert contents to AVI
|
||||||
|
ffmpeg -i "$TMPDIR/Screen_Stream.avi" $AUDIO -map $NUM -c:v copy -c:a copy $OUTPUT
|
||||||
|
|
||||||
|
rm -r "$TMPDIR"
|
Loading…
Reference in a new issue