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 … 81 82 83 84 85 … 101 Next »
Batch script - introducing a Python script call...

 
  • 0 Vote(s) - 0 Average
Batch script - introducing a Python script call...
gdogg371
Offline

Member

Posts: 149
Threads: 23
Joined: May 2018
#1
2020-06-07, 02:12 PM (This post was last modified: 2020-06-07, 02:13 PM by gdogg371.)
Previously I had a batch script like this:

Code:
"G:\Visual Studio 2017\C++ Projects\SkyQChannelChanger\Release\SkyQChannelChanger.exe" %1

taskkill /f /im vlc.exe /t

"G:\VLC\vlc" --ffmpeg-hw --avcodec-hw=any dshow:// :dshow-vdev="Video (00 Pro Capture HDMI 4K+)" :dshow-adev="Audio (2- 00 Pro Capture HDMI 4K+)" :dshow-threads=8 :dshow-aspect-ratio=16\:9 :dshow-size="3840x2160" :dshow-pixel_format=yuv444p16le :dshow-tune=film :dshow-preset=lossless :dshow-profile=main10 show-vcodec=x265 :dshow-fps=50 :dshow-crf=0 :dshow-acodec=mp4a :dshow-stereo-mode=5 :dshow-force-surround-sound=0 :dshow-ab=128 :dshow-samplerate=44100 :no-dshow-config :live-caching=300 --sout "#transcode{venc=ffmpeg,vcodec=mp2v,threads=8,aspect=16:9,width=3840,height=2160,fps=50,acodec=a52,ab=1500,channels=2,samplerate=48000,soverlay}:standard{access=file,dst=-,mux=ts}"

This piped the encoded video from my 4K capture card into NPVR as part of my extras device. This all works great now after a lot of work. However, I need to introduce some conditionality depending on whether I am calling a channel from my SKy Q STB, or my Enigma STB. Therefore, I have amended my batch script to enable a call to a Python script, in which I will introduce some if statements. My batch script now looks like this:

Code:
@echo off

"G:\Visual Studio 2017\C++ Projects\SkyQChannelChanger\Release\SkyQChannelChanger.exe" %1

taskkill /f /im vlc.exe /t

"G:\HTPC Scripts\NPVR Command Line\Command Line.py"

My Python script so far looks like this:


Code:
import os
import sys
import subprocess

os.chdir('G:\\VLC\\')

startupinfo = None
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW

process = subprocess.Popen([
'vlc',
'--ffmpeg-hw',
'--avcodec-hw=any',
'dshow:// :dshow-vdev="Video (00 Pro Capture HDMI 4K+)" :dshow-adev="Audio (2- 00 Pro Capture HDMI 4K+)"',
':dshow-threads=8',
':dshow-aspect-ratio=16\:9',
':dshow-size="3840x2160"',
':dshow-pixel_format=yuv444p16le',
':dshow-tune=film',
':dshow-preset=lossless',
':dshow-profile=main10',
'show-vcodec=x265',
':dshow-fps=50',
':dshow-crf=0',
':dshow-acodec=mp4a',
':dshow-stereo-mode=5',
':dshow-force-surround-sound=0',
':dshow-ab=128',
':dshow-samplerate=44100',
':no-dshow-config',
':live-caching=300',
'--sout',
'"#transcode{venc=ffmpeg,vcodec=mp2v,threads=8,aspect=16:9,width=3840,height=2160,fps=50,acodec=a52,ab=1500,channels=2,samplerate=48000,soverlay}:standard{access=file,dst=-,mux=ts}"',
], stdout=subprocess.PIPE, startupinfo=startupinfo)

What appears to be happening is the script still opens VLC correctly with the encoded stream, however I don't really know where it is now being piped to. This is getting a bit out of my area of expertise. Thus I am not really sure what to Google to try and resolve.

I could as a last resort set up two extras devices, but this would require considerable work to remodel my XMLTV builder. If I can resolve the issue of where the encoded stream is going, I will then add in the additional logic for the Enigma2 box. This is just for the Sky Q STB so far...

Any ideas?

Thanks
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 52,830
Threads: 954
Joined: May 2006
#2
2020-06-07, 02:34 PM
Posting this question in a NextPVR V5 forum for the Windows server software makes zero sense to me.

Martin
gdogg371
Offline

Member

Posts: 149
Threads: 23
Joined: May 2018
#3
2020-06-07, 02:39 PM
where would you rather I posted it? can it be moved by admin if required?
gdogg371
Offline

Member

Posts: 149
Threads: 23
Joined: May 2018
#4
2020-06-07, 02:52 PM
anyway...switching the .py file for a sub .bat file seems to be the way to go, however I still don't understand where Python sent the encoded video...
Graham
Offline

Posting Freak

UK
Posts: 4,058
Threads: 102
Joined: Dec 2005
#5
2020-06-07, 02:56 PM
(2020-06-07, 02:34 PM)mvallevand Wrote: Posting this question in a  NextPVR V5 forum for the Windows server software makes zero sense to me.

(2020-06-07, 02:39 PM)gdogg371 Wrote: where would you rather I posted it? can it be moved by admin if required?

And good morning to you too, Martin ... Wink  

There is a "Developers" sub-forum although it is labelled "For those wanting to develop plugins and skins ..." which is not what you are doing and NextPVR V5 does not support plugins (yet).
gdogg371
Offline

Member

Posts: 149
Threads: 23
Joined: May 2018
#6
2020-06-07, 03:10 PM
Hi - I am basically side loading my own plugins into NPVR via the extras device. So far I have a working prototype, but I am now looking at expanding the functionality.
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 52,830
Threads: 954
Joined: May 2006
#7
2020-06-07, 04:03 PM
My point is why are you expecting python help on the subprocess function here? I also wondered who your audience was?


I've already posted that I wasn't going to help with vlc. A hint though, if you have a working command that outputs to stdout all you need to do in python is

import subprocess

subprocess.call(command)

That's as far as I will take this.

Martin
gdogg371
Offline

Member

Posts: 149
Threads: 23
Joined: May 2018
#8
2020-06-08, 12:34 AM
sorry if i have offended you. i now have bigger issues in that since i have upgraded to the most recent version of NPVR my extras device and batch script is no longer working at all...even using my old method. i will start a separate thread for this now...
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 52,830
Threads: 954
Joined: May 2006
#9
2020-06-08, 12:40 AM
I wasn't offended in the least I was just trying to steer you to try another forum where you might actually be able to get an answer to your question.

Martin
gdogg371
Offline

Member

Posts: 149
Threads: 23
Joined: May 2018
#10
2020-06-08, 12:47 AM
(2020-06-08, 12:40 AM)mvallevand Wrote: I wasn't offended in the least I was just trying to steer you to try another forum where you might actually be able to get an answer to your question.

Martin

Anyway - I have just posted a new thread in the Windows sub thread, as my extras device is no longer calling the VLC command line arguments since I upgraded. It worked ok at first, but now seems to have stopped. I don't know what I am looking for in the logs, but something has gone wrong. I have removed the Python completely for now and just reverted to what previously worked...
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): 1 2 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  EPG Script Error? RedDevilJoe 4 327 2025-02-01, 01:16 AM
Last Post: RedDevilJoe
  Script to Run "Update Channels"? AWR2375 4 590 2024-09-23, 01:21 PM
Last Post: AWR2375
  Batch file for live TV fla 20 2,381 2023-04-30, 03:25 AM
Last Post: fla
  script MaxOne72 1 605 2021-10-07, 02:49 AM
Last Post: sub
  Postprocessing Script folder and VideoredoTVsuite4 not working Spotspot 4 2,002 2020-06-24, 11:16 AM
Last Post: MCEabused
  Server hangs on script markn62 8 2,400 2020-06-13, 10:58 PM
Last Post: markn62
  Script to delay NPVRtray running hansol123 5 1,933 2020-06-10, 02:27 PM
Last Post: hansol123
  Windows Service Hangs in "Starting" status after using InstallService.batch BrettB 13 4,806 2019-10-10, 04:59 AM
Last Post: VCR58

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

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

Linear Mode
Threaded Mode