mirror of
https://github.com/tonydamage/nux-env.git
synced 2025-12-11 13:24:28 +01:00
Added tdm-media utilities used to manage media.
Signed-off-by: Tony Tkacik <tonydamage@gmail.com>
This commit is contained in:
parent
fda99682e3
commit
bcc3729141
3 changed files with 99 additions and 0 deletions
34
bin/tdm-media
Executable file
34
bin/tdm-media
Executable file
|
|
@ -0,0 +1,34 @@
|
|||
#!/system/bin/sh
|
||||
|
||||
function task.video.change.container {
|
||||
CONTAINER=$1;
|
||||
shift;
|
||||
for video in "$@"; do
|
||||
echo "Starting processing Video: $video";
|
||||
ffmpeg -i "$video" -vcodec copy -acodec copy "${video}.$CONTAINER"
|
||||
echo "Processing done.";
|
||||
done
|
||||
}
|
||||
|
||||
function task.nikon-mp4 {
|
||||
task.video.change.container mp4 "$@"
|
||||
}
|
||||
|
||||
function task.downscale {
|
||||
TARGET=$1
|
||||
shift
|
||||
SIZE=2048
|
||||
for image in "$@"; do
|
||||
target_file=$TARGET/$(basename $image)
|
||||
echo "Downsampling image $image to $target_file"
|
||||
convert $image \
|
||||
-filter Lanczos -sampling-factor 1x1 \
|
||||
-resize "${SIZE}x${SIZE}>" \
|
||||
-quality 90 \
|
||||
$target_file
|
||||
done
|
||||
|
||||
}
|
||||
TASK=$1
|
||||
shift
|
||||
task.$TASK "$@"
|
||||
Loading…
Add table
Add a link
Reference in a new issue