Code to cut video / audio not working in Linux Mint

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Locked
Message
Author
achim
Posts: 48
Joined: Thu 13 Apr 2017, 19:36
Location: Germany

Code to cut video / audio not working in Linux Mint

#1 Post by achim »

Hello,

I have a code here to cut video or audio files. Unfortunately he is not running correctly. Can someone help me with this?

My system is Linux Mint 18.3 Cinnamon - 64 bit

Thanks in advance.

achim

Code: Select all

#!/bin/bash 
INPUT=$(yad --width=600 --height=400 --file-selection --file-filter='*.mp3 *.mp4 *.avi') eval $(yad --width=400 --form --field=start --field=end --field=output:SFL "00:00:00" "00:00:00" "${INPUT/%.*}-out.${INPUT##*.}" | awk -F'|' '{printf "START=%s\nEND=%s\nOUTPUT=\"%s\"\n", $1, $2, $3}') [[ -z $START || -z $END || -z $OUTPUT ]] && exit 1 DIFF=$(($(date +%s --date="$END")-$(date +%s --date="$START"))) OFFSET=""$(($DIFF / 3600)):$(($DIFF / 60 % 60)):$(($DIFF % 60)) ffmpeg -ss "$START" -t "$OFFSET" -i "$INPUT" "$OUTPUT" 

achim
Posts: 48
Joined: Thu 13 Apr 2017, 19:36
Location: Germany

Re: to cut video / audio

#2 Post by achim »

achim wrote:Hello,

I have a code here to cut video or audio files. Unfortunately he is not running correctly. Can someone help me with this?

My system is Linux Mint 18.3 Cinnamon - 64 bit

Thanks in advance.

achim

Code: Select all

#!/bin/bash 
INPUT=$(yad --width=600 --height=400 --file-selection --file-filter='*.mp3 *.mp4 *.avi') eval $(yad --width=400 --form --field=start --field=end --field=output:SFL "00:00:00" "00:00:00" "${INPUT/%.*}-out.${INPUT##*.}" | awk -F'|' '{printf "START=%s\nEND=%s\nOUTPUT="%s"\n", $1, $2, $3}') [[ -z $START || -z $END || -z $OUTPUT ]] && exit 1 DIFF=$(($(date +%s --date="$END")-$(date +%s --date="$START"))) OFFSET=""$(($DIFF / 3600)):$(($DIFF / 60 % 60)):$(($DIFF % 60)) ffmpeg -ss "$START" -t "$OFFSET" -i "$INPUT" "$OUTPUT" 
Hello presenters,

Unfortunately, I have positioned this post incorrectly. Please move it to: Programming - YAD - Tips.

Many Thanks.

achim

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#3 Post by fredx181 »

Hi achim, replied in the YAD - Tips thread : http://murga-linux.com/puppy/viewtopic. ... 71#1024471

Fred

Locked