NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public NextPVR Support Docker amd64 v
« Previous 1 … 4 5 6 7 8 9 Next »
Thoughts on Building a Custom NPVR Docker Image

 
  • 0 Vote(s) - 0 Average
Thoughts on Building a Custom NPVR Docker Image
pkscout
Offline

Senior Member

USA
Posts: 464
Threads: 50
Joined: May 2014
#1
2019-11-16, 06:39 AM
I should start by saying that everything I know about Docker I've learned in the last day and might actually be included in this post.  Wink

I'm planning (not in the near future) to purchase a Synology 918+ NAS and would like to run NPVR 5 on it and retire my Windows DVR.  I currently have a Python script that runs as a post process for some Kodi library integration that I'd like to keep using, so I'm pretty sure I'm going to need to extend a Docker image to add the Python modules I need for the script to run.  It looks like the NPVR 5 Docker image is based on Ubuntu (based on a forum post I saw).  I think that means I have two choices:

  1. Extend the NPVR image and install Python (assuming it isn't there already) and then the Python modules I need.
  2. Extend an Ubuntu image (or I guess Debian if I wanted to), install the Python modules, then install NPVR using the deb file.
I think I'd rather do #1 because the extended image should inherit the CMD and all the needed EXPOSE commands for the network stuff.  Another question is whether the HDPVR support I've seen talked about in other posts will be coming to the Docker image (the install post doesn't specifically list the HDPVR as supported, which is why I'm asking).  I found a way to map a USB port on the Synology to a Docker image, so, in theory anyway, I should be able to get it working.

So I guess the question is whether I'm headed down the right path here or if I should just plan on keeping my Windows machine to run NPVR 5 on when the time comes to upgrade.
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 53,090
Threads: 957
Joined: May 2006
#2
2019-11-16, 02:44 PM
Much like you I started my v5 upgrade to my NAS which was running OpenMediaVault and allows Docker. I was using a Vista solution for v4 before and needed to do something and hoped I could leave Windows for the backend. I never used Docker and is was very successful for my HDHR devices and streaming IPTV from my v4 server.

When sub added extras support and I was able to move to production with my HDPVR and analog devices and that is where my Docker limitations came. Comskip was too slow, and there was no V4L subsystem for my HDPVR device, and the configuration of LIRC was going to be quite difficult so I moved to linux. I decide to buy a cheap lenovo system unders $200 from Walmart online. I have it dual boot Windows and Debian but I think have booted Window just 3 or 4 times since July. I only had a 1TB drive but that my exisiting NAS was good enough. I am now in the process of setting up Samba sharing from it too.

I found linux is more flexible and easier to install and upgrade v5 and too configure then with Docker. While I did both system from the command line, editing things outside the NextPVR GUI requires SSH one way or the other.

For your solution on consideration would be the need for the USB hub. Even if sub installs v4l for the HDPVR I could never get the IR from my HDPVR running the way I liked. So if you figure out how to get your iguana blaster working you will use both USB ports.

Martin
Ranbato
Offline

Member

Utah
Posts: 79
Threads: 8
Joined: Nov 2018
#3
2019-11-16, 05:10 PM (This post was last modified: 2019-11-16, 05:11 PM by Ranbato.)
That is exactly what I have done.
I am building a custom image (a little bit of a mess right now because of the dependencies issues) that has hardware accelerated transcoding for ffmpeg and ccextractor to save out subtitles and close-captions.

I ended up basing my image off of the ffmpeg image because it was easier to add NPVR to it than build ffmpeg.

Below I attached some of the files (as 7-zip since it doesn't seem to allow text).


Attached Files
.7z   Dockerfile.7z (Size: 1.21 KB / Downloads: 12)
.7z   PostProcessing.7z (Size: 679 bytes / Downloads: 24)
.7z   marktestupdate.7z (Size: 367 bytes / Downloads: 10)
pkscout
Offline

Senior Member

USA
Posts: 464
Threads: 50
Joined: May 2014
#4
2019-11-16, 05:52 PM
(2019-11-16, 02:44 PM)mvallevand Wrote: When sub added extras support and I was able to move to production with my HDPVR and analog devices  and that is where my Docker limitations came.  Comskip was too slow, and there was no V4L subsystem for my HDPVR device, and the configuration of LIRC was going to be quite difficult so I moved to linux.  I decide to buy a cheap lenovo system unders $200 from Walmart online.  I have it dual boot Windows and Debian but I think have booted Window just 3 or 4 times since July.  I  only had a 1TB drive but that my exisiting NAS was good enough.  I am now in the process of setting up Samba sharing from it too.

I found linux is more flexible and easier to install and upgrade v5 and too configure then with Docker.  While I did both system from the command line, editing things outside the NextPVR GUI requires SSH one way or the other.

For your solution on consideration would be the need for the USB hub.  Even if sub installs v4l for the HDPVR I could never get the IR from my HDPVR running the way I liked.  So if you figure out how to get your iguana blaster working you will use both USB ports.

Thanks for those thoughts.  I did get a Docker image created today that uses the nextpvr image as a base and then adds python3 and the modules I need.  I was able to run that and add my HDHR prime to the devices, so I didn't break any of the NPVR stuff on the image at least.  Wink  Here's the Dockerfile:

Code:
FROM nextpvr/nextpvr_amd64:latest

RUN apt update
RUN apt-get install -y python3
RUN apt-get install -y python3-pip
RUN pip3 install requests
RUN pip3 install xmltodict
RUN pip3 install websocket-client
RUN pip3 install opencv-python


I ended up using pip because if I used apt-get one of the packages (opencv) didn't seem to install the python module right, but pip3 does.  I haven't actually tried any scripts (that is going to be a "much later" kind of thing), and I haven't even looked at the Iquana blaster part yet (although there is an Iquana blaster command line tool for Linux so I'm hoping to be able to just drop that in).

Can you talk more about the V4L issue in the Docker container?  Now that I'm building my own image, I might be able to add what is needed.  Or maybe a different question.  Is there documentation yet on getting the HDPVR running in Linux so I can translate and give it a try in Docker?  I figure I'll install Docker on my Windows machine that runs NPVR 4 so I can figure out the USB mapping stuff (and not have to move all the hardware around).

At the end of this if I have to have an actual machine for NPVR 5 I'll probably just keep my Windows machine.  There are some other things on it I will need to keep, and I was planning to move that machine from a "server" to a desktop (that is, move it to my study) if I can get NPVR 5 working on the NAS.  For now this is just an exercise to see if it's possible.

Thanks.
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 53,090
Threads: 957
Joined: May 2006
#5
2019-11-16, 08:36 PM
Because of the utter lack of interest in documenting v5 from this community as a whole, I won't be doing a lot of documenting myself but once you see your device in linux and get your blaster working I will help you get an extras device going.

I'm not sure if sub's docker image even has the v4l or or the pvr-usb2 kernel the HDPVR requires. Best bet is to plug it in and see what dmesg tells you.

Martin
pkscout
Offline

Senior Member

USA
Posts: 464
Threads: 50
Joined: May 2014
#6
2019-11-18, 03:50 AM
Just thought I'd share what I've found over the weekend. I was able to build a new image file using sub's as a base that includes Python as well as the modules I need (as shown a couple posts up). The HDPVR is a no-go though. I've learned a lot more about Docker and how it virtualizes the application, and I'm pretty sure that unless your host (i.e. the NAS) has the needed V4L2 (Video4Linux) support so you can pass the HDPVR as a video device to the container that it won't work. I definitely couldn't get it working using Docker on my Mac (which is my development machine), and since the video driver stuff is at the kernel level (and a Docker container doesn't have it's own kernel) it only has any chance of working if you were using a Linux machine as your host. In which case you could just run NPVR as a Linux process natively.

So I went one for two on tests but learned a bunch. So that's a net positive for me. Special thanks to Martin for giving me some pointers on how the HDPVR works in Linux so I at least knew what I was trying to replicate in Docker.
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 53,090
Threads: 957
Joined: May 2006
#7
2019-11-18, 10:59 PM
Right the issue isn't docker as much as it is the OS that the docker is running on. I suspect if docker was on an OS designed for digital video like Librelec or Corelec you would find much better support for video devices. For people who like to virtualize on linux they will also be ok although it is much easier to install NextPVR on bare metal linux.

Docker for a NAS should indeed provide very good support of HDHR and also IPTV devices especially if it is a basic system without comskip or advanced post processing.

Martin
ctrlbrk
Offline

Junior Member

US
Posts: 30
Threads: 9
Joined: Jun 2020
#8
2020-06-06, 08:16 PM
hey guys, I would like to help contribute to the docker cause, getting comskip to work correctly among other things.

Before I start from scratch, could you ping me and let me know how far you've got? Maybe share your docker pull link?
Ranbato
Offline

Member

Utah
Posts: 79
Threads: 8
Joined: Nov 2018
#9
2020-06-06, 09:17 PM
I have a custom build with custom ffmpeg, handbrakecli, ccextractor, and comskip
https://registry.hub.docker.com/r/markla...extractor/

I can share the Dockerfile, but am moving this week so may not be able to respond immediately.
ctrlbrk
Offline

Junior Member

US
Posts: 30
Threads: 9
Joined: Jun 2020
#10
2020-06-06, 11:22 PM
(2020-06-06, 09:17 PM)Ranbato Wrote: I have a custom build with custom ffmpeg, handbrakecli, ccextractor, and comskip
https://registry.hub.docker.com/r/markla...extractor/

I can share the Dockerfile, but am moving this week so may not be able to respond immediately.

My man!  Awesome.  Let me take a look... 

What do you use handbrake for in this setup?  I've had it for years on my Windows box, but not sure the use here?

Good luck with the move!
« 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
  Migrating from Windows to Docker? boringgit 2 186 2025-06-09, 07:58 PM
Last Post: boringgit
  Comskip segfaults with comskip embedded in amd64 docker SickBoy 6 630 2025-02-24, 11:18 PM
Last Post: SickBoy
Information Custom NPVR image with ffmpeg, ccextractor, handbrake, comskip, etc. Ranbato 66 15,764 2025-01-16, 04:26 AM
Last Post: mvallevand
  Issues with Session Handling Behind Caddy Reverse Proxy in Docker: invalid session user001 5 612 2025-01-10, 08:23 PM
Last Post: sub
  Docker container becomes unresponsive overnight wapkaplet 6 824 2025-01-10, 04:47 PM
Last Post: wapkaplet
  Docker image upgrade ceejayemm 9 1,119 2025-01-07, 11:27 PM
Last Post: pkscout
  Current guide for NextPVR docker on Unraid? wapkaplet 1 929 2024-12-20, 02:40 AM
Last Post: wapkaplet
  Modification to the NextPVR Image DockerFile thelanofvilles 5 683 2024-12-15, 07:30 PM
Last Post: thelanofvilles
  NextPVR with Docker and Fritzbox icompas 9 819 2024-12-12, 02:50 PM
Last Post: icompas
  Docker postprocessing script aTF6i 12 1,231 2024-11-17, 01:17 AM
Last Post: aTF6i

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

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

Linear Mode
Threaded Mode