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 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;
|
||||
shift;
|
||||
echo "Using $FFMPEG_OR_LIBAV for conversion."
|
||||
|
|
@ -14,13 +18,11 @@ function task.video.change.container {
|
|||
done
|
||||
}
|
||||
|
||||
function task.nikon-mp4 {
|
||||
function :nikon-mp4 {
|
||||
task.video.change.container mp4 "$@"
|
||||
}
|
||||
|
||||
function task.downscale {
|
||||
local TARGET=$1; shift;
|
||||
local SIZE=$1; shift
|
||||
function :downscale TARGET SIZE {
|
||||
local i=0;
|
||||
local count="$#";
|
||||
mkdir -p $TARGET;
|
||||
|
|
@ -47,9 +49,7 @@ function task.downscale {
|
|||
##
|
||||
## Convert image to
|
||||
##
|
||||
function task.to {
|
||||
target=$1;
|
||||
shift;
|
||||
function :to target {
|
||||
if ! nux.check.function "media.to.$target" ; then
|
||||
echo Target type "$target" is not supported.
|
||||
return -1
|
||||
|
|
@ -63,6 +63,8 @@ function task.to {
|
|||
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