NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public NextPVR Support Windows v
« Previous 1 … 10 11 12 13 14 … 102 Next »
Little Help on setting up Extras device - template

 
  • 0 Vote(s) - 0 Average
Little Help on setting up Extras device - template
bigstusexy
Offline

Member

Posts: 126
Threads: 28
Joined: Nov 2005
#1
2024-10-02, 09:16 PM
Okay I'm pretty sure I did something wrong, 

I'm trying to setup an Extras Device, using the template method.  I started with a green setup (also anyway to remove old devices?) but used an already working xmltv.  I have added the device and channels. The setup kicks off the batch file that changes channels and seems to start ffmpeg, but the temp file never grows and I get an error that the transcoder exited when I try to test live TV. 

Extras:
Code:
<extras>
    <channel name="{channel-name}">
      <command>cmd</command>
      <args>/c c:\users\public\NPVR-data\streamy.bat {channel_d1}-{channel_d2}-{channel_d3}-{channel_d4}</args>
    </channel>
  </extras>

streamy.bat
Code:
@echo 2nd-blast %1 >temp.blst
putty.exe -ssh "[redacted]"@192.168.1.108 -pw [removed my password too] -m .\temp.blst
"\Program Files\NextPVR\Other\ffmpeg.exe" -rtsp_transport tcp -i rtsp://192.168.1.114:8554/main/av -vcodec copy -acodec copy -f mpegts
rem del temp.blst

I know it's not deleting the temp blast file, it doesn't need to, I just thought of doing that while testing.  The command for ffmpeg works just fine on its own, if I append a file destination it'll create a file of the stream.  I've ran the batch (augmented too) I have also changed the nextpvr service to run as a network service. I noticed the extras instructions had an extra " - " at the end of the command but none of the examples I've seen have it.


Attached Files
.zip   logs-20241002-1555.zip (Size: 625.81 KB / Downloads: 1)
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 53,100
Threads: 957
Joined: May 2006
#2
2024-10-02, 09:28 PM
You need the - at the end to send to output to stdout which will be read by NextPVR.

No point in trying an extra until

stream.bat your parameters > filename.ts

generates a clean ts file with no other output to the screen.

Martin
bigstusexy
Offline

Member

Posts: 126
Threads: 28
Joined: Nov 2005
#3
2024-10-03, 07:19 PM (This post was last modified: 2024-10-03, 07:29 PM by bigstusexy.)
I made that change, did a commandline test and it write a file.  Just for people to note, this file windows makes a thumb of but VLC didn't present anything when it played.  However ffplay likes it just fine. 

Tested it by triggering live TV and it worked!
I noticed the channel didn't change and I figured that maybe I need full paths everywhere so I edited the batch, after that nothing worked in NextPVR, works by commandline test. 

I think I've narrowed it down to how things are being interpreted in the bath, but I'm not sure why. FOUND IT!


Testing by doing the full command that NPVR is going to run caused me to see why VLC didn't like the file (ffplay is more fault tolerant) and almost why transcoding wasn't working.  Transcoding was failing because the system was just being weird. 

I found that the live stuff would make files, and the map file would show up at 8k and the live file would be zero until shortly before everything dies, then the live.ts would finally write 150 bytes just before it's killed.  I copied it to take a look and... it's my command just before the ffmpeg line!

So, stdout, right.  Pretty much the screen depending on how you're working.  The batch must be quiet! everything* gets written to file. 

First line of this batch is going to need to be @echo off (@ makes the start of a line makes it not show output so we've quietly turned off output)
Next problem, I'm running putty, it's going to open it's own window and run a remote shell to send commands, this messing up things too it doesn't get written to the output though.  Instead we can use plink and the -batch command, everything else can stay the same.
After that, it works!  Well my test browser is blocking playback, but there is playback to block!  VLC likes the file as it's written bit perfect!


new streamy.bat
Code:
@echo off
@echo 2nd-blast %1 >"C:\Users\Public\NPVR-data\temp.blst"
"C:\Users\Public\NPVR-data\plink.exe" -batch -ssh "[user name]"@192.168.1.108 -pw [this is insecure, don't do this] -m C:\Users\Public\NPVR-data\temp.blst >NUL
"c:\Program Files\NextPVR\Other\ffmpeg.exe" -rtsp_transport tcp -i rtsp://192.168.1.114:8554/main/av -vcodec copy -acodec copy -f mpegts -

NUL is null, nothing. I'm directing any output of plink to nothing so it won't show on stdout

I'll talk about the 2nd-blat.bat somewhere else, it's specific to a particular protocol/stb implementation. 

Desription:
line1: turn off all normal line outputs silently
line2: echos the command to change channels into a file that will be endlessly overwritten
line3: calls plink to ssh into a remote server (this is only need if your channel changer is another computer and I'm being weird and testing over my VPN to my recording box at home) output is sent to nothing
line4: calls ffmpeg provided by NextPVR, outputs as asked.  (this will be probably be changed to get it into h264+aac {need to find out if h265 is supported for transcodeless})
bigstusexy
Offline

Member

Posts: 126
Threads: 28
Joined: Nov 2005
#4
2024-10-03, 07:36 PM
DOh! It's producing media, but not changing channels, UGH!
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 53,100
Threads: 957
Joined: May 2006
#5
2024-10-03, 07:43 PM
Make sure streamy.bat can run from any folder on your PC, qualify 2nd-blast with a full path.

Don't forget to add -v panic to ffmpeg to quiet it down, it could spam the logs.

h265 is fine for direct play clients, but h264 is needed if you want to use the web player

Martin
bigstusexy
Offline

Member

Posts: 126
Threads: 28
Joined: Nov 2005
#6
2024-10-03, 08:49 PM
Walked out of work and it hit me about the channel changes. It's the context that I'm running putty/plijnk in.  It's not like telnet.  In short I have to trust the server under the account it's running under or I have to run NextPVR under my user context.  I can do this and I'll write about it later.

Thanks for the help.
bigstusexy
Offline

Member

Posts: 126
Threads: 28
Joined: Nov 2005
#7
2024-10-03, 10:22 PM
Okay, for anyone using this as a guide.

putty tells you about this and so does plink, I just plum forgot. When you run NextPVR, it's going to execute all the things you tell it to, as a service. You need to have putty accept the identity of that server - as whatever is running NextPVR.

There are two ways to do this.
1:
You can open up the services configuration, find next PVR, go to properties and the logon tab.
[I'm going to insert here that it's a good idea to have service accounts that have limited abilities and rights]
You can change this to run as user, input a name and password of a user. You'll need to run putty as that user and connect to the
server and then it'll work fine.

2:
If you just want system to run it like it is, then go to https://www.nirsoft.net/utils/advanced_run.html download a copy and run it.
Program to run, point it to the location of putty
Start Directory, anything, put it at the same directory as putty if you want, no trailing slash and no quotes even for long paths/with spaces in them. Also this is the same for NextPVR No quote marks!
Next make sure Run as is set to SYSTEM user
Window state should be normal
hit Run
accept any messages.

Putty opens, connect to your remote server, accept any messages, after it connect you can close.
plink uses the same store as putty so it'll take those settings. Now it'll run as expected.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Starting Device:please wait JohnMark 14 1,092 2025-01-19, 02:24 PM
Last Post: mvallevand
  Device does not start kevin939 2 574 2024-12-29, 05:52 PM
Last Post: kevin939
  cannot add new device sebjoan 13 1,175 2024-12-20, 09:05 PM
Last Post: sub
  Automate Update Channels on Specific IPTV Device or Group of Devices taylormia 33 3,198 2024-11-15, 02:48 AM
Last Post: taylormia
  Errors setting up Comskip MPG 2 487 2024-03-17, 05:13 PM
Last Post: MPG
  Unable to find available capture device - NextPVR Desktop App -Live TV rmarquar 4 1,071 2023-12-13, 05:42 PM
Last Post: mvallevand
  ffmpeg output to NextPVR device stevepen1974 4 1,222 2023-08-20, 08:44 PM
Last Post: sub
  need help setting up, not able to map SamM 3 655 2023-07-07, 03:30 AM
Last Post: sub
  Upgrading loses LogPowerManagement setting fla 2 576 2023-05-21, 12:50 PM
Last Post: fla
  Adding Device (IPTV xtream codes) FAILS naffhouse 1 2,224 2023-04-09, 05:50 AM
Last Post: sub

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

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

Linear Mode
Threaded Mode