NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums General General Discussion v
« Previous 1 … 4 5 6 7 8 … 159 Next »
Using dshow or ffmpeg as an input to NPVR?

 
  • 0 Vote(s) - 0 Average
Using dshow or ffmpeg as an input to NPVR?
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#11
2019-07-08, 01:43 AM
Not that he could use it right now, but the IPTV source does actually support a blaster. Currently the UI doesn't provide options to configure it. (you can make it happen by tweaking the tuning strings in the database)
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,770
Threads: 954
Joined: May 2006
#12
2019-07-22, 02:01 PM
sub Wrote:You could possibly have ffmpeg or vlc do this encoding, like you're doing above, to produce a transport stream, sending it to udp, and configure NextPVR to use IPTV to access the channel via udp.

I just tried this with an analog v4l2 device in linux and it appears to work (I have no cable signal in this room). Unfortunately from what I can tell NextPVR doesn't have a script file to run at the end of live tv to turn off the server.

Also the HDPVR v4l2 driver doesn't work as input to ffmpeg udp stream so it needs to wait for v4l2 support in NextPVR

Martin
gdogg371
Offline

Member

Posts: 149
Threads: 23
Joined: May 2018
#13
2020-01-30, 04:09 PM (This post was last modified: 2020-01-30, 04:10 PM by gdogg371.)
Hi...sorry, I completely forgot about this thread. I've been ill for a while unfortunately. Anyway, so far I have tried the following:

http stream:

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=hevc_nvenc :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=3000 --sout "#transcode{venc=ffmpeg,vcodec=mp2v,threads=8,aspect=16:9,width=3840,height=2160,fps=50,acodec=a52,ab=1500,channels=6,samplerate=48000,soverlay}Confusedtandard{access=http,dst=192.168.1.15:8554,mux=ogg}"

rtp stream:

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=hevc_nvenc :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=3000 --sout "#transcode{venc=ffmpeg,vcodec=mpgv,threads=8,aspect=16:9,width=3840,height=2160,fps=50,acodec=a52,ab=1500,channels=6,samplerate=48000,soverlay}:rtp{dst=239.255.0.1,port=5004,mux=ts}"

I've confirmed both these streams play correctly by playing them in another VLC session. For the http stream I have also got it working on other computers on my home network. For the rtp stream I am still having some issues with the router traffic for this stream type on other machines.

In Next PVR I have tried the following:

- For http I have imported an m3u playlist, as well as manually creating channel http://192.168.1.15:8554 in the IPTV device set up. This created as type 'Internet source-IPTV'.
- For rtp I have manually created a channel rtp://239.255.0.1:5004 (I also tried as a multicast stream - rtp://@239.255.0.1:5004). This was created as type 'MPEG2 TS'.

For both stream types a channel is successfully created, but when I double click on the test channel in Live TV and select 'Watch', all I get is a black screen. No video or audio.

Other possibly useful information:

- I am using the ffdshow codec for MPEG2 TS.
- Machine is pretty powerful: Intel 5960x, 64GB of RAM, GTX750ti graphics card (the weak link of the system).
- Running Windows 10 Professional Edition.

With regards to blaster, using an old 1080 Hauppauge card I successfully set up a C++ executable with command line arguments in NPVR to control my STB. As I can see options to select an executable and arguments for pre tuning I am hoping this can also be used for IPTV.

As I say, I've been crook for a while and then come back to this task a long time after I originally started. I've learned a lot, but I've been stuck at this final hurdle of getting the transport stream from my capture card to run through NPVR.

I've never been to the southern hemisphere. If you help me to get this to work, I'll come down and buy you a pint haha...

Thanks
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,770
Threads: 954
Joined: May 2006
#14
2020-01-30, 04:19 PM (This post was last modified: 2020-01-30, 04:20 PM by mvallevand.)
Does

ffmpeg -list_options true -f dshow -i video="Video (00 Pro Capture HDMI 4K+)"

and

ffmpeg -list_options true -f dshow -i audio="Audioo (00 Pro Capture HDMI 4K+)"

give you output?

Martin
gdogg371
Offline

Member

Posts: 149
Threads: 23
Joined: May 2018
#15
2020-01-30, 05:00 PM
(2020-01-30, 04:19 PM)mvallevand Wrote: Does

ffmpeg -list_options true -f dshow -i video="Video (00 Pro Capture HDMI 4K+)"

and

ffmpeg -list_options true -f dshow -i audio="Audioo (00 Pro Capture HDMI 4K+)"

give you output?

Martin
Yes it does.

Video:


https://pastebin.com/ZFwD7Prx



Audio:


ffmpeg version git-2020-01-06-1e3f4b5 Copyright © 2000-2020 the FFmpeg developers
  built with gcc 9.2.1 (GCC) 20191125
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 38.100 / 56. 38.100
  libavcodec    58. 65.102 / 58. 65.102
  libavformat    58. 35.101 / 58. 35.101
  libavdevice    58.  9.103 / 58.  9.103
  libavfilter    7. 70.101 /  7. 70.101
  libswscale      5.  6.100 /  5.  6.100
  libswresample  3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
[dshow @ 0000019ac4c193c0] DirectShow audio only device options (from audio devices)
[dshow @ 0000019ac4c193c0]  Pin "Capture" (alternative pin name "Capture")
[dshow @ 0000019ac4c193c0]  min ch=1 bits=8 rate= 11025 max ch=2 bits=16 rate= 44100
    Last message repeated 22 times
audio=Audio (2- 00 Pro Capture HDMI 4K+): Immediate exit requested
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,770
Threads: 954
Joined: May 2006
#16
2020-01-30, 06:53 PM
That certainly looks promising, let's try simple playback

Code:
ffmpeg -f dshow -i video="Video (00 Pro Capture HDMI 4K+)":audio="Audio (00 Pro Capture HDMI 4K+)" -vcodec h264  -acodec aac  -s 1920x1080 -framerate 50 -f mpegts - | ffplay -i pipe:

Martin
gdogg371
Offline

Member

Posts: 149
Threads: 23
Joined: May 2018
#17
2020-01-30, 07:23 PM
(2020-01-30, 06:53 PM)mvallevand Wrote: That certainly looks promising, let's try simple playback

Code:
ffmpeg -f dshow -i video="Video (00 Pro Capture HDMI 4K+)":audio="Audio (00 Pro Capture HDMI 4K+)" -vcodec h264  -acodec aac  -s 1920x1080 -framerate 50 -f mpegts - | ffplay -i pipe:

Martin

Hi - thanks for taking the time to help me. Findings/interesting observations re your code example and previous attempts by myself using ffmpeg directly.

1) I have tried using ffmpeg directly before, when streaming to a proxy server. This was not successful because of massive resource hogging.

2) To get your example to work I needed to increase the rtbufsize (unfortunately this is pegged at 2147M). I also had to switch to hevc encoding as this is more efficient than h.264 pound for pound. I get errors printed to console about being at roughly 90% usage of the buffer, which is causing some frame dropping. Jumping up to 4k will completely blow up the buffer.

3) I've only got a fairly basic Nvidia GTX 750 Ti graphics card as I'm not much of a gamer, but I'd be willing to spend the money to upgrade to one of their top end RTX streaming cards if needed as the hevc_nvenc encoding is meant to be a lot more efficient. I do also have a 1050 Ti here, which apparently supports hevc_nvenc encoding. I'll try that first to see if it helps before shelling out big money.

4) Using ffmpeg directly vs via a proxy stream and VLC produces wildly different results system usage wise. Using ffmpeg directly seems to take up a lot more cpu, but spreads it well across all the cores. VLC on the other hand supports streaming and watching a 4k picture, seems to use the CPU much less and the GPU much more.

I don't know if you have any input to those points or not, but seen as we have a successful result so far, what next steps are needed to run this into NPVR?

Thanks
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,770
Threads: 954
Joined: May 2006
#18
2020-01-30, 07:35 PM
I'd sell the card to someone who needs the power and use the money and get an HDMI encoder more appropriate.

You can certainly try to enable hw encoding options like

-hwaccel dxva2 -c:v h264_nvenc -vf scale_npp=1920:1080

Martin
gdogg371
Offline

Member

Posts: 149
Threads: 23
Joined: May 2018
#19
2020-01-30, 07:45 PM
(2020-01-30, 07:35 PM)mvallevand Wrote: I'd sell the card to someone who needs the power and use the money and get an HDMI encoder more appropriate.

You can certainly try to enable hw encoding options like

-hwaccel dxva2 -c:v h264_nvenc    -vf scale_npp=1920:1080

Martin


What do you mean by a more appropriate HDMI encoder? Also, what are the next steps needed to get this running in NPVR? Thanks.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#20
2020-01-30, 07:57 PM
(2020-01-30, 07:45 PM)gdogg371 Wrote: What do you mean by a more appropriate HDMI encoder?
He means like a hardware HDMI encoder device, like network encoders like this:
https://www.tbsdtv.com/products/tbs2603-...coder.html
(or numerous others from aliexpress)

Or a Hauppauge HDPVR2 / Colossus 2.

Quote:Also, what are the next steps needed to get this running in NPVR? Thanks.
Martin will be able to give you more info, but in NextPVR v5 you can probably get it working with an "extras" xml file, and a batch file. The batch file basically needs to output transport stream to standard output.

What exactly the xml file will look like will depend on how you want your channels to work...like, do you just want a single channel, or is it connected to a set top box and you want to it to appear as a set of channels.
« Next Oldest | Next Newest »

Users browsing this thread: 2 Guest(s)

Pages (9): « Previous 1 2 3 4 5 … 9 Next »
Jump to page 


Possibly Related Threads…
Thread Author Replies Views Last Post
  Merging video with web radio (ffmpeg) NumberFive 1 1,081 2021-05-04, 01:01 PM
Last Post: mvallevand
  NPVR 5 Logs gdogg371 2 2,008 2020-06-02, 08:54 PM
Last Post: gdogg371
  Fun with ffmpeg mvallevand 5 2,469 2020-05-15, 03:01 PM
Last Post: mvallevand
  NPVR Channel Numbers in Kodi... gdogg371 5 3,203 2020-02-24, 02:22 AM
Last Post: mvallevand
  remote NPVR setup suggestions p37307 3 2,339 2020-02-17, 11:54 AM
Last Post: Graham
  Playstation Vue with NPVR Ex Bee MC 14 8,337 2019-03-26, 09:55 AM
Last Post: 2leftfeet
  Thanks NPVR! alannerd614 7 4,430 2018-03-24, 04:14 AM
Last Post: joeijm
  What does NPVR remove when naming recordings p37307 0 1,670 2016-12-24, 10:55 AM
Last Post: p37307
  Little NPVR praise p37307 2 2,420 2016-10-25, 08:07 PM
Last Post: p37307
  Windows 10 Anniversary NPVR fullscreen flicker and freeze fix p37307 1 3,147 2016-08-11, 02:59 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