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 … 30 31 32 33 34 Next »
Script Files

 
  • 0 Vote(s) - 0 Average
Script Files
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,839
Threads: 954
Joined: May 2006
#11
2019-07-29, 10:33 PM
Ok going back to your question your docker volume statement is probably something like

--volume /mnt/appdata/NextPVR/Config:/config \

but the file is the same and you need to configure it as if it is running in docker, unaware of the host environment.

Martin
vintdiesel
Offline

Member

Posts: 114
Threads: 23
Joined: Jan 2012
#12
2019-07-30, 10:31 AM
Continued on a new post https://forums.nextpvr.com/showthread.ph...post537962
Win Server: ASRock P67 Pro3 B3, i5 2500K 4.0Ghz, 16GB, Nvidia GT430 HDMI, Win 10 Pro 64bit, Win-TV Quad HD, Win-TV Nova-T USB.
UnRaid NAS Server: Gigabyte i7 2600 3.4Ghz, 16GB, S3 Trio VGA PCI Video, DVB LibreElec for DVB-T tuner drivers, Hauppage Win-TV 2210 Dual DVB-T.
Win Client: Intel NUC i3 Broadwell, 4GB Ram, 128GB SSD, Win 10 Pro 64bit.
Linux Client: Raspberry Pi 3+, OSMC + Kodi
CDinger
Offline

Member

Posts: 151
Threads: 30
Joined: Aug 2016
#13
2019-09-17, 12:46 AM
I have installed NextPVR on Ubuntu 18.04 using the deb installer. I set up my devices and epg and have recorded a couple programs. I am still learning and I am having trouble understanding where to put the script files. Also, are the variables the same as in Windows environment eg %1 is filename - the full path and file name of the recording file. I am trying to do a PostProcessing.sh file to run comskip when a recording ends.

I have /var/opt/nextpvr/scripts/ or /opt/nextpvr/system/data/scripts as possible locations for PostProcessing.sh.

I could not find the referenced location below
"It'll look for a .NPVR-data/scripts/PostProcessing.sh file on Linux. You can add similar login in there. "

Thanks,

Craig
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,839
Threads: 954
Joined: May 2006
#14
2019-09-17, 04:49 AM (This post was last modified: 2019-09-17, 06:48 AM by mvallevand.)
It is /var/opt/nextpvr/scripts and variables are the same but you have to compile and install comskip. The script needs chmod +x too.

Martin
vintdiesel
Offline

Member

Posts: 114
Threads: 23
Joined: Jan 2012
#15
2019-09-17, 07:06 AM
The variables are the same as Martin said, but it is quite a learning experience if you are converting from Windows batch file to Linux shell format. In batch, the variables begin with %, in shell they begin with $.
Here's an exerpt from one I have written for transcoding a file to a compressed format.

Quote:#!/bin/bash
# --------------------------
# PostProcessing.sh
# D.Little
# Version 12c - use acc instead of libvo_aacenc for newer version of ffmpeg
# Version 100 - 1st Linux shell translation from Windows batch file script
# dated 17/08/2019
# --------------------------

# Log the program being processed by this script
echo $(date "+%d/%m/%Y %T") - $3 - PostProcessing.bat invoked on $1 recorded channel $2 on tuner $4 >>/config/logs/processing.log

workdir=$(dirname "$1")
source_name=$(basename "$1")
file_name=${source_name%%.ts}
short_name=${file_name:2:4}
filesize=$(wc -c <"$1")
newfile="$workdir/$file_name"

echo $(date "+%d/%m/%Y %T") - $3 - creating "$newfile" >>/config/logs/processing.log
/usr/bin/ffmpeg -y -i "$1" -b:v 2000k -deinterlace -map 0:0 -map 0:1 -c:a aac -ar 48000 -async 48000 "$newfile"

newsize=$(wc -c <"$newfile")

# --------- Test outputs - Temporary coding ---------
echo $1 - full file and path >>/config/logs/processing.log
echo $workdir - workdir >>/config/logs/processing.log
echo $source_name - source_name >>/config/logs/processing.log
echo $file_name - file_name >>/config/logs/processing.log
echo $short_name - short_name >>/config/logs/processing.log
echo "$workdir/$file_name" - dir and file_name >>/config/logs/processing.log
echo $filesize - source bytes >>/config/logs/processing.log
# -------- END of Debug --------------

Note that:
- Linux is case sensitive with paths and file names whereas Windows is not.
- Putting the variables inside double quotes, e.g. file_name_and_path="$1" ensures any spaces contained in the path and filenames are handled correctly.
- If you edit scripts from a Windows PC, use Notepad++ and set it to Linux linefeed mode so that the end of each line does not get an unwanted carriage return and causes execution errors.
- As Martin stated, a newly created .sh file has to be made executable with the chmod +x command to change the file permission.
Win Server: ASRock P67 Pro3 B3, i5 2500K 4.0Ghz, 16GB, Nvidia GT430 HDMI, Win 10 Pro 64bit, Win-TV Quad HD, Win-TV Nova-T USB.
UnRaid NAS Server: Gigabyte i7 2600 3.4Ghz, 16GB, S3 Trio VGA PCI Video, DVB LibreElec for DVB-T tuner drivers, Hauppage Win-TV 2210 Dual DVB-T.
Win Client: Intel NUC i3 Broadwell, 4GB Ram, 128GB SSD, Win 10 Pro 64bit.
Linux Client: Raspberry Pi 3+, OSMC + Kodi
CDinger
Offline

Member

Posts: 151
Threads: 30
Joined: Aug 2016
#16
2019-09-22, 12:49 AM
mvallevand Wrote:It is /var/opt/nextpvr/scripts and variables are the same but you have to compile and install comskip. The script needs chmod +x too.

Martin

Thanks Martin,

I have compiled and installed comskip previously. However, I had non chmod +x the PostProcessing.sh file. PostProcessing.sh is now working running comskip for commercial detection and creating logs.

Thanks for all your help,

Craig
CDinger
Offline

Member

Posts: 151
Threads: 30
Joined: Aug 2016
#17
2019-09-22, 12:50 AM
Thanks Vintdiesel,

I learned about %1 becoming $1 while setting up TVheadend previously but I appreciate the help.

Craig
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): « Previous 1 2


Possibly Related Threads…
Thread Author Replies Views Last Post
  Remote NextPVR backup script for Linux snagglewest 2 603 2024-02-06, 05:44 PM
Last Post: snagglewest
  NextPVR Server VOD Downloads Incomplete TS Video Files nonuoha 22 3,176 2023-03-26, 09:09 PM
Last Post: mvallevand
  Post Processing and moving files ballfam 16 2,495 2022-12-30, 06:59 PM
Last Post: ballfam
  Think all the script files must've disappeared mlp78758 13 1,583 2022-11-25, 05:34 PM
Last Post: mvallevand
  TV Show recording broken into multiple files markosjal 2 928 2022-07-09, 04:53 AM
Last Post: markosjal
  Empty files when writing to samba share aimaim 3 870 2022-07-05, 10:31 PM
Last Post: mvallevand
  Linux upgrade shell script.. NextPVR-consumer 3 1,201 2021-12-05, 03:17 PM
Last Post: mvallevand
  Orphaned livetv buffer files snagglewest 6 1,486 2021-08-09, 04:23 PM
Last Post: mvallevand
  bulk comskip processing script baj1 7 3,413 2020-11-21, 08:44 PM
Last Post: baj1
  Script locations and parameters ? ceejayemm 2 1,253 2020-10-14, 12:02 PM
Last Post: ceejayemm

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

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

Linear Mode
Threaded Mode