mirror of
https://github.com/tonydamage/nux-env.git
synced 2025-12-11 13:24:28 +01:00
tdm-media: Converted to nuxr-runner
Signed-off-by: Tony Tkacik <tonydamage@gmail.com>
This commit is contained in:
parent
163a2b820b
commit
851914ff75
1 changed files with 57 additions and 55 deletions
|
|
@ -1,9 +1,13 @@
|
||||||
#!/usr/bin/env nux-runner
|
#!/usr/bin/env nuxr-nuxsh
|
||||||
|
|
||||||
type ffmpeg > /dev/null 2>&1 && FFMPEG_OR_LIBAV=ffmpeg
|
type ffmpeg > /dev/null 2>&1 && FFMPEG_OR_LIBAV=ffmpeg
|
||||||
type avconv > /dev/null 2>&1 && FFMPEG_OR_LIBAV=avconv
|
type avconv > /dev/null 2>&1 && FFMPEG_OR_LIBAV=avconv
|
||||||
|
|
||||||
function task.video.change.container {
|
QUALITY=${QUALITY:=90}
|
||||||
|
|
||||||
|
@namespace task. {
|
||||||
|
|
||||||
|
function :video.change.container {
|
||||||
CONTAINER=$1;
|
CONTAINER=$1;
|
||||||
shift;
|
shift;
|
||||||
echo "Using $FFMPEG_OR_LIBAV for conversion."
|
echo "Using $FFMPEG_OR_LIBAV for conversion."
|
||||||
|
|
@ -14,13 +18,11 @@ function task.video.change.container {
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
function task.nikon-mp4 {
|
function :nikon-mp4 {
|
||||||
task.video.change.container mp4 "$@"
|
task.video.change.container mp4 "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
function task.downscale {
|
function :downscale TARGET SIZE {
|
||||||
local TARGET=$1; shift;
|
|
||||||
local SIZE=$1; shift
|
|
||||||
local i=0;
|
local i=0;
|
||||||
local count="$#";
|
local count="$#";
|
||||||
mkdir -p $TARGET;
|
mkdir -p $TARGET;
|
||||||
|
|
@ -47,9 +49,7 @@ function task.downscale {
|
||||||
##
|
##
|
||||||
## Convert image to
|
## Convert image to
|
||||||
##
|
##
|
||||||
function task.to {
|
function :to target {
|
||||||
target=$1;
|
|
||||||
shift;
|
|
||||||
if ! nux.check.function "media.to.$target" ; then
|
if ! nux.check.function "media.to.$target" ; then
|
||||||
echo Target type "$target" is not supported.
|
echo Target type "$target" is not supported.
|
||||||
return -1
|
return -1
|
||||||
|
|
@ -63,6 +63,8 @@ function task.to {
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
function media.to.jpg {
|
}
|
||||||
convert "$1" -quality 90 -auto-orient "$2"
|
|
||||||
|
function media.to.jpg {
|
||||||
|
convert "$1" -quality $QUALITY -auto-orient "$2"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue