•   
  • 1
  • 19
  • 20
  • 21
  • 22
  • 23(current)
Comskip for Linux released
In the script is a reference for MKV only I think and not both MKV or TS
Reply
(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.

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.
Reply
(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
Reply
Because of globbing and expansion, I would recommend always double-quoting your variables, as well as enclosing them in braces; also, for best compatibility, use only POSIX expressions, rather than a shell's built-in aliases or functions, avoiding "bashisms", especially if your script's shebang is "#!/bin/sh":
Code:
#!/bin/sh
VAR="data"
VAR2=$(/bin/command "${VAR}")
This will help portability, as well as make debugging easier when trying to find out why something isn't quite working right.
Reply
Is there anything special to get Kodi to use the edl's comskip is generating? I've got tvheadend post processing video's with comskip, however when I go to the recordings and play, it uses the .ts and not the edl apparently.

I've verified the edl does show cuts, and comskip's logs does show commercial detection. File's look to be in the appropriate place. So I suspect it's got something to do with how tvheadend is sending info to kodi. Running tvheadend 4.3-295~ga9dffb7 and latest LibreElec.
Reply
(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


Hoping to find a script to use on Synology NAS (DSM6) via Scheduled Tasks in Control Panel...

Have tried running comskip command via SSH and it worked perfect - Kodi 16.3 then skipped the commercials.

Forums refer to also installing tvheadend for this but I don't need to transcode the video only add txt files for commercial skipping. Anyone know of a script I could copy/customise to process all files within a folder and create a txt file for each recording unless a txt file has already been created ?

thanks in advance.

EDIT:

tried this script via Scheduled Tasks / User-defined scripts in Control Panel on the Synology DSM6 and it worked but still unable to modify the script to process all files within a folder which do not have a *.edl or *.txt file created for them....

---------------------------------------------------------------------------------------

#!/bin/sh

INPUTVIDEO="/volume1/video/test/test.ts"
COMSKIPPATH="/volume1/@appstore/comskip/bin/comskip"
COMSKIPINI="/volume1/video/test/comskip.ini"

FlagCommercials(){
$COMSKIPPATH --ini=$COMSKIPINI "$INPUTVIDEO"
}

FlagCommercials

---------------------------------------------------------------------------------------
Reply
  •   
  • 1
  • 19
  • 20
  • 21
  • 22
  • 23(current)



Logout Mark Read Team Forum Stats Members Help
Comskip for Linux released6
This forum uses Lukasz Tkacz MyBB addons.