2017-06-07, 07:04
In the script is a reference for MKV only I think and not both MKV or TS
(2017-06-07, 06:02)Shermer321 Wrote: For example
CMD: /var/packages/tvheadend-testing/target/Recordings/commercials/commercials.sh ""/var/packages/tvheadend-testing/target/Recordings/American Pickers/S01E05.ts""
RESPONSE: /var/packages/tvheadend-testing/target/Recordings/American: Can not open file
With the above command in single quotes i get a reply of
RESPONSE: /var/packages/tvheadend-testing/target/Recordings/commercials/commercials.sh "/var/packages/tvheadend-testing/target/Recordings/American Housewife/S01E05.ts"
/usr/bin/basename: extra operand ‘.mkv’
Try '/usr/bin/basename --help' for more information.
Comskip 0.81.089, made using ffmpeg
Donator build
No such file or directory - could not create file Housewife/S01E05.ts/American.txt
So it is the BASENAME that is screwing it up.
BASENAME=$(/usr/bin/basename "${INPUTVIDEO}" ".ts")
(2017-06-07, 15:29)rpcameron Wrote: Then put the argument to basename in double quotes, and change its extension to match your recording setup. Also, if you are going to put full path references for your binaries, doublecheck that the path is correct.
Code:BASENAME=$(/usr/bin/basename "${INPUTVIDEO}" ".ts")
Scripts and examples posted online should be considered references, not cut-and-paste solutions. Given how quickly software changes, you are more likely to either error-out or (worst case) damage your system rather than getting perfect results the first time.
#!/bin/sh
INPUTVIDEO="$1" # Full path to recording, i.e. /home/user/Videos/News.ts
COMSKIPPATH="/volume2/@appstore/tvheadend-testing/bin/comskip"
COMSKIPINI="/volume2/@appstore/tvheadend-testing/Recordings/commercials/comskip.ini"
FlagCommercials(){
$COMSKIPPATH --ini=$COMSKIPINI "$INPUTVIDEO"
}
FlagCommercials
#!/bin/sh
VAR="data"
VAR2=$(/bin/command "${VAR}")
(2017-06-07, 15:43)Shermer321 Wrote:(2017-06-07, 15:29)rpcameron Wrote: Then put the argument to basename in double quotes, and change its extension to match your recording setup. Also, if you are going to put full path references for your binaries, doublecheck that the path is correct.
Code:BASENAME=$(/usr/bin/basename "${INPUTVIDEO}" ".ts")
Scripts and examples posted online should be considered references, not cut-and-paste solutions. Given how quickly software changes, you are more likely to either error-out or (worst case) damage your system rather than getting perfect results the first time.
I basically stripped it down and got everything to work. Seems not having quotes on the command to comskip is what really held me up once I removed all the log files.
Code:#!/bin/sh
INPUTVIDEO="$1" # Full path to recording, i.e. /home/user/Videos/News.ts
COMSKIPPATH="/volume2/@appstore/tvheadend-testing/bin/comskip"
COMSKIPINI="/volume2/@appstore/tvheadend-testing/Recordings/commercials/comskip.ini"
FlagCommercials(){
$COMSKIPPATH --ini=$COMSKIPINI "$INPUTVIDEO"
}
FlagCommercials