NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public NextPVR Support Linux v
« Previous 1 … 17 18 19 20 21 … 34 Next »
PostProcessing help

 
  • 0 Vote(s) - 0 Average
PostProcessing help
VCR58
Offline

Posting Freak

Marion Iowa, USA
Posts: 1,845
Threads: 177
Joined: Aug 2016
#1
2021-08-30, 02:32 PM
I was attempting to add a condition to PostProcessing.sh to prevent comskip from running on recordings from a certain channel.

My PostProcessing script is
Code:
ffmpeg -i "$1" -vcodec copy -acodec copy -f matroska -| ffmpeg -i pipe: -codec copy -movflags faststart -y "${1%.*}.mp4" > /dev/null
if ["$2" -ne "32.*"]
then
nice -n 19 comskip --ini=/home/rex/Comskip/comskip.ini "$1" > /dev/null
fi
The mux part works fine but when it gets to the if statement this output from the log is what I get
Code:
> /var/opt/nextpvr/scripts/PostProcessing.sh: line 2: [7.3: command not found
I am missing something but I don't know what it could be.

Any help is much appreciated.
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 52,953
Threads: 956
Joined: May 2006
#2
2021-08-30, 03:03 PM (This post was last modified: 2021-08-30, 03:09 PM by mvallevand.)
I thought -ne was for integers and it looks like you are missing a semicolon, maybe try

if [["$2" != "32."*]] ; then

When sub added linux support I told him I was worried about extra support time, which seems to be the case these days. I really suggest you look for helpful linux forums since I personally am going to simply ignore posts like this in the future. Maybe someone else here will help too.

Martin
ElihuRozen
Offline

Senior Member

Massachusetts, USA
Posts: 514
Threads: 51
Joined: Apr 2006
#3
2021-08-30, 10:40 PM
Generally, in bash, you'd want spaces around the brackets.  So, maybe something like
Code:
if [[ "$2" != "32."* ]] ; then

You might need to use a regular expression

Code:
if [[ ! $2 =~ 32\.[0-9]* ]]; then
Remember that in a regular expression (regex), a period matches any character if it is not escaped with the backslash.  Also, "[0-9]" matches any digit and "[0-9]*" matches any number of digits.

I highly recommend testing your logic from a command line or short script executed from a command line.  Something like "if [ something ]; then echo 'yes'; else echo 'no'; fi".  Play around with "something" until you get yes and no in every expected situation.
Tuners: SD HDHR Prime (HDHR3-CC). SD HDHR Connect Quatro Tuner (HDHR5-4US) - only QAM.  EXVIST H.265 Encoder - capturing cable box.
Client: Odroid-N2 running knewc on KODI - connected via MoCA.
EPG: SchedulesDirect
Provider: Verizon Fios
Server: Dell XPS 8700 with Windows 10
VCR58
Offline

Posting Freak

Marion Iowa, USA
Posts: 1,845
Threads: 177
Joined: Aug 2016
#4
2021-08-31, 12:41 PM
Thanks for the help!

This is working for me. 
Code:
if [[ "$2" != "32."* ]]; then nice -n 19 comskip --ini=/home/rex/Comskip/comskip.ini "$1" > /dev/null; fi
pkscout
Offline

Senior Member

USA
Posts: 464
Threads: 50
Joined: May 2014
#5
2021-08-31, 04:36 PM
Just as an FYI with anyone trying to get the right RegEx for their need, I use this site, which let's you put in a blob of text and the create a RegEx. It shows results real time, so you know if you're making it better or worse.

https://regexr.com
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Folder location PostProcessing.sh with LibreElec retrofan 10 1,290 2024-08-14, 04:44 PM
Last Post: retrofan
  Fixed? - PostProcessing - NScriptHelper.dll rename failed following 5.2.1 upgrade lostboy 9 2,166 2021-10-26, 05:42 PM
Last Post: sub
  PostProcessing.sh and a ' in Show Name tjzi422xlk 16 7,232 2019-10-09, 01:41 AM
Last Post: mvallevand
  PostProcessing and Comskip flyingsubs 12 5,261 2019-10-07, 07:39 PM
Last Post: flyingsubs
  Linux File Location and PostProcessing flyingsubs 3 2,121 2019-09-23, 07:01 PM
Last Post: mvallevand

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode