Your Digital Media Has Never Looked So Good

 
ioan
Topic Author
Posts: 279
Joined: Mon Jan 10, 2011 2:02 pm

Roku channel for NPVR with Search & Schedule

Tue Feb 22, 2011 2:21 pm

(If you don't know what GB-PVR or NPVR is, please go to http://www.gbpvr.com first. NPVR software is required for this channel)

I developed a Roku channel for NPVR that allows you to watch, search and schedule recordings directly from your Roku. You won't need your NPVR machine next to your TV anymore.

Use this software at your own risk. Read readfirst.txt in the zip file

The source code is included. The source code for the Roku channel is available on request.

To install it, first download on your NPVR machine the server application:
https://sites.google.com/site/ioanghip/roku-npvr-server.zip

Unzip it somewhere on your disk, and then edit the roku.ini file:

[locals]
local_ip=Auto
server_port=8000
npvr_dir=C:\Users\Public\NPVR\
password=__secret__


1. Replace Auto with NPVR's machine IP, example:
local_ip=192.168.1.55 

... or leave it Auto and the application will try to get the IP automatically.

2. Replace 8000 with the port number you would want your server to listen to, or leave it 8000.

3. Replace C:\Users\Public\NPVR\ with the folder where your npvr.db3 file resides.

4. Replace __secret__ with the password you use to get on NPVR's web interface.

5. Save the roku.ini file and start the Roku.exe

6. Edit your PostProcessing.bat file from NPVR's Scripts folder and add this line:
call "_path_\ConvertVideo.bat" %1

(replace _path_ with the path where you unziped the files)

7. Restart "NPVR Recording Service"

8. Install NPVR Roku channel on your Roku box by following this link:
https://owner.roku.com/add/NextPVR

NextPVR Roku channel will ask you for the server's IP, enter the IP of the machine where you have Roku.exe running and the port you have in roku.ini file, for example:

192.168.1.55:8000


I will make a video today or tomorrow and I will link it here with instructions.
Let me know if you have any problems.
Enjoy!
Last edited by ioan on Mon Feb 28, 2011 1:32 pm, edited 1 time in total.
https://github.com/e1ioan/
http://rokucam.com
 
ioan
Topic Author
Posts: 279
Joined: Mon Jan 10, 2011 2:02 pm

Re: Roku channel for NPVR with Search & Schedule

Tue Feb 22, 2011 10:08 pm

Here is a demo video on how the Roku channel works: http://www.youtube.com/watch?v=F900SfynJCw
https://github.com/e1ioan/
http://rokucam.com
 
msassman
Posts: 2
Joined: Wed Feb 23, 2011 8:56 pm

Re: Roku channel for NPVR with Search & Schedule

Wed Feb 23, 2011 8:59 pm

Is there any way to change channel? Looking for a way to stream tv remotely and have a bility to change channels.
 
ioan
Topic Author
Posts: 279
Joined: Mon Jan 10, 2011 2:02 pm

Re: Roku channel for NPVR with Search & Schedule

Thu Feb 24, 2011 10:49 am

msassman wrote:
Is there any way to change channel? Looking for a way to stream tv remotely and have a bility to change channels.


You can't watch live tv with this channel (at least not yet, I didn't look into that yet). This channel can only play/schedule/delete recordings that are recorded by NPVR (www.gbpbr.com)
https://github.com/e1ioan/
http://rokucam.com
 
candita
Posts: 313
Joined: Sun May 23, 2010 7:19 am

Re: Roku channel for NPVR with Search & Schedule

Thu Feb 24, 2011 4:07 pm

I have no Scripts folder :-(
 
ioan
Topic Author
Posts: 279
Joined: Mon Jan 10, 2011 2:02 pm

Re: Roku channel for NPVR with Search & Schedule

Thu Feb 24, 2011 5:50 pm

candita wrote:
I have no Scripts folder :-(


Do you have NPVR (www.gbpvr.com) installed? The scripts folder should be in one of the flowing directories:
"C:\Users\Public\NPVR" on Windows 6 variants (Vista, 7, 2008)
"C:\Documents and Settings\All Users\Application Data\NPVR" on Windows 5.x variants (XP, 2003).
https://github.com/e1ioan/
http://rokucam.com
 
candita
Posts: 313
Joined: Sun May 23, 2010 7:19 am

Re: Roku channel for NPVR with Search & Schedule

Thu Feb 24, 2011 6:08 pm

ok TY! I was looking in the wrong place..lol
 
msassman
Posts: 2
Joined: Wed Feb 23, 2011 8:56 pm

Re: Roku channel for NPVR with Search & Schedule

Thu Feb 24, 2011 7:59 pm

OK, if you can only watch recordings, can you watch while they are recording like dvr (slightly delayed) or do you have to wait for the show to finish recording before playing.
 
ioan
Topic Author
Posts: 279
Joined: Mon Jan 10, 2011 2:02 pm

Re: Roku channel for NPVR with Search & Schedule

Fri Feb 25, 2011 11:36 am

msassman wrote:
OK, if you can only watch recordings, can you watch while they are recording like dvr (slightly delayed) or do you have to wait for the show to finish recording before playing.


You will have to wait for the recording to finish. After the recording ended, NPVR will call a PostProcessing.bat that will convert the video to mp4, make the thumbnails, create the bif files... and only then the video is available from the Roku channel.
NPVR software will play, pause, rewind... etc live tv. The Roku channel that I built won't.

BTW, if anyone downloaded the zip file, there is a bug in the ConvertVideo.bat, please replace the content of that file with this (replace the D:\roku-npvr-server with your own path):

set roku_dir=D:\roku-npvr-server

rem ---------------------------------------------------------
rem Convert the video to mp4
rem----------------------------------------------------------

rem - Convert the video and keep aspect ratio
rem "%roku_dir%\Third Party\HandBrakeCLI\HandBrakeCLI.exe" -i %1 -o "%~dpn1.mp4" -b 1500 -B 128 -R 48 -w 854 -l 480 -O -r 29.97

rem - Convert the video and stretch it to fit widescreen 16:9 aspect ratio
"%roku_dir%\Third Party\HandBrakeCLI\HandBrakeCLI.exe" -i %1 -o "%~dpn1.mp4" -b 1500 -B 128 -R 48 -w 720 -l 400 -O -r 29.97 --custom-anamorphic --crop 0:0:0:0 --display-width 720

rem - delete the old video (.ts file)
del /Q /A:R /A:S /A:H /A:A %1


rem ---------------------------------------------------------
rem Create the video thumnail png
rem----------------------------------------------------------

"%roku_dir%\Third Party\ffmpeg\ffmpeg.exe" -i "%~dpn1.mp4" -vframes 1 -ss 400 -s 224x158 -f image2 "%~dpn1_sd.png"
"%roku_dir%\Third Party\ffmpeg\ffmpeg.exe" -i "%~dpn1.mp4" -vframes 1 -ss 400 -s 304x238 -f image2 "%~dpn1_hd.png"


rem ---------------------------------------------------------
rem Create the bif files
rem----------------------------------------------------------

mkdir "%~dpn1_sd"
mkdir "%~dpn1_hd

"%roku_dir%\Third Party\ffmpeg\ffmpeg.exe" -i "%~dpn1.mp4" -r .1 -s 240x180 "%~dpn1_sd\%%08d.jpg"
"%roku_dir%\reindex.exe" "%~dpn1_sd" > "%roku_dir%\logs\sdlog.txt"
"%roku_dir%\Third Party\ffmpeg\ffmpeg.exe" -i "%~dpn1.mp4" -r .1 -s 320x240 "%~dpn1_hd\%%08d.jpg"
"%roku_dir%\reindex.exe" "%~dpn1_hd" > "%roku_dir%\logs\hdlog.txt"

pushd "%~dp1"

"%roku_dir%\Third Party\Roku\biftool.exe" -t 10000 "%~dpn1_sd"
"%roku_dir%\Third Party\Roku\biftool.exe" -t 10000 "%~dpn1_hd"

popd

rmdir /s /q "%~dpn1_sd"
rmdir /s /q "%~dpn1_hd"
https://github.com/e1ioan/
http://rokucam.com
 
Gilgamesh
Posts: 4907
Joined: Mon Apr 20, 2009 7:29 am
Location: Dayton TN

Re: Roku channel for NPVR with Search & Schedule

Sat Feb 26, 2011 12:51 am

I have installed this and it is working quite well however I seem to have one issue.

I cannot get the recordings that were recorded in 4:3 aspect to display that way. It seems that either if the two lines in your bat file

rem - Convert the video and keep aspect ratio
"%roku_dir%\Third Party\HandBrakeCLI\HandBrakeCLI.exe" -i %1 -o "%~dpn1.mp4" -b 1500 -B 128 -R 48 -w 854 -l 480 -O -r 29.97

rem - Convert the video and stretch it to fit widescreen 16:9 aspect ratio
rem "%roku_dir%\Third Party\HandBrakeCLI\HandBrakeCLI.exe" -i %1 -o "%~dpn1.mp4" -b 1500 -B 128 -R 48 -w 720 -l 400 -O -r 29.97 --custom-anamorphic --crop 0:0:0:0 --display-width 720



produce the same effect (stretching to fill a 16x9 screen) when the original source is pillar boxed 4:3.

I am not too familiar with Handbrake's command line interface but I will look into seeing if there is something I am doing wrong.

BTW: When I use the Handbreak GUI I do not have this problem. I choose anamorphic=none and keep aspect ratio and the final file is in correct aspect.

OK. I appear to have fixed the problem by changing the keep aspect line to this:
rem - new Convert the video and keep aspect ratio
"%roku_dir%\Third Party\HandBrakeCLI\HandBrakeCLI.exe" -i %1 -o "%~dpn1.mp4" -b 1500 -B 128 -R 48 --custom-anamorphic --keep-display-aspect  -O -r 29.97


This seems to keep the aspect exactly the way NPVR recorded it W/O any side effects. But it probably needs more testing to be sure.
 
Gilgamesh
Posts: 4907
Joined: Mon Apr 20, 2009 7:29 am
Location: Dayton TN

Re: Roku channel for NPVR with Search & Schedule

Sat Feb 26, 2011 12:53 pm

I have been experimenting with this for the last several hours and I have a couple of questions.

1. How does the ch determine what it should see as a file available to play? I have several shows that were recorded by NPVR and I have already converted to mp4 that I would like to play through this ch.

2. Can m4v file support be included so a better codec can be easily used with Handbrake?
 
Gilgamesh
Posts: 4907
Joined: Mon Apr 20, 2009 7:29 am
Location: Dayton TN

Re: Roku channel for NPVR with Search & Schedule

Mon Feb 28, 2011 9:26 am

While I have had this working fine for the last two days I find that I cannot get the quality out of the Handbrake CLI that I get easily with the GUI. Any settings that I use that gets close to the quality I want takes almost twice as long as the GUI and produces a file about twice the size. Because of this I am having to disable the batch part of the process until I can get the CLI working.

I do this because I can convert the files manually and watch them using Chaneru at the quality I want. But the automatic nature of this ch and the ability to directly delete the show after watching would make this a superior product IF I can figure how to solve the quality and speed problem.

I am going to go to the Handbrake support pages to see if I can find a solution there. What would solve my problem would be to call Handbrake with the proper parameters to force it to use the preset I use for the GUI. If anyone here has any idea how to do this it is easier to find it here as the Handbrake support seems quite fragmented and hard to search. But I am fairly good at that so off I go deeper into the world of geek speak. If I am not heard from in a couple off days PLEASE send out searchers. Hopefully I will not be taken over by the dark forces that are embedded in the domain of the geeks. There are dark denizens that lurk there.
 
ioan
Topic Author
Posts: 279
Joined: Mon Jan 10, 2011 2:02 pm

Re: Roku channel for NPVR with Search & Schedule

Mon Feb 28, 2011 12:51 pm

Gilgamesh wrote:
I have installed this and it is working quite well however I seem to have one issue.

I cannot get the recordings that were recorded in 4:3 aspect to display that way. It seems that either if the two lines in your bat file

rem - Convert the video and keep aspect ratio
"%roku_dir%\Third Party\HandBrakeCLI\HandBrakeCLI.exe" -i %1 -o "%~dpn1.mp4" -b 1500 -B 128 -R 48 -w 854 -l 480 -O -r 29.97

rem - Convert the video and stretch it to fit widescreen 16:9 aspect ratio
rem "%roku_dir%\Third Party\HandBrakeCLI\HandBrakeCLI.exe" -i %1 -o "%~dpn1.mp4" -b 1500 -B 128 -R 48 -w 720 -l 400 -O -r 29.97 --custom-anamorphic --crop 0:0:0:0 --display-width 720



produce the same effect (stretching to fill a 16x9 screen) when the original source is pillar boxed 4:3.

I am not too familiar with Handbrake's command line interface but I will look into seeing if there is something I am doing wrong.

BTW: When I use the Handbreak GUI I do not have this problem. I choose anamorphic=none and keep aspect ratio and the final file is in correct aspect.

OK. I appear to have fixed the problem by changing the keep aspect line to this:
rem - new Convert the video and keep aspect ratio
"%roku_dir%\Third Party\HandBrakeCLI\HandBrakeCLI.exe" -i %1 -o "%~dpn1.mp4" -b 1500 -B 128 -R 48 --custom-anamorphic --keep-display-aspect  -O -r 29.97


This seems to keep the aspect exactly the way NPVR recorded it W/O any side effects. But it probably needs more testing to be sure.


I really didn't play much with keeping the aspect, I like the videos to fill the screen, even if this makes some actors look fat :-)
If you are happy with the new command you figured out, let me know and I will replace it in the original zip file.
https://github.com/e1ioan/
http://rokucam.com
 
ioan
Topic Author
Posts: 279
Joined: Mon Jan 10, 2011 2:02 pm

Re: Roku channel for NPVR with Search & Schedule

Mon Feb 28, 2011 12:53 pm

Gilgamesh wrote:
I have been experimenting with this for the last several hours and I have a couple of questions.

1. How does the ch determine what it should see as a file available to play? I have several shows that were recorded by NPVR and I have already converted to mp4 that I would like to play through this ch.

2. Can m4v file support be included so a better codec can be easily used with Handbrake?


Right now the application looks in the npvr database for a recording that is available and then checks the directory for a mp4 file. I can recompile the application to look for both, mp4 and m4v if you want.
https://github.com/e1ioan/
http://rokucam.com
 
ioan
Topic Author
Posts: 279
Joined: Mon Jan 10, 2011 2:02 pm

Re: Roku channel for NPVR with Search & Schedule

Mon Feb 28, 2011 12:56 pm

Gilgamesh wrote:
While I have had this working fine for the last two days I find that I cannot get the quality out of the Handbrake CLI that I get easily with the GUI. Any settings that I use that gets close to the quality I want takes almost twice as long as the GUI and produces a file about twice the size. Because of this I am having to disable the batch part of the process until I can get the CLI working.

I do this because I can convert the files manually and watch them using Chaneru at the quality I want. But the automatic nature of this ch and the ability to directly delete the show after watching would make this a superior product IF I can figure how to solve the quality and speed problem.

I am going to go to the Handbrake support pages to see if I can find a solution there. What would solve my problem would be to call Handbrake with the proper parameters to force it to use the preset I use for the GUI. If anyone here has any idea how to do this it is easier to find it here as the Handbrake support seems quite fragmented and hard to search. But I am fairly good at that so off I go deeper into the world of geek speak. If I am not heard from in a couple off days PLEASE send out searchers. Hopefully I will not be taken over by the dark forces that are embedded in the domain of the geeks. There are dark denizens that lurk there.


If you find a way to convert the videos to mp4 from the command line using another app, you could just replace the line that converts the video in ConvertVideo.bat using the Handbrake CLI and everything should work just the same.
Last edited by ioan on Mon Feb 28, 2011 1:11 pm, edited 1 time in total.
https://github.com/e1ioan/
http://rokucam.com

Who is online

Users browsing this forum: No registered users and 47 guests