Standalone Java app for dedicated live view with Instant Replay

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,666
Reaction score
14,006
Location
USA
Is there an error log? It is BlueIrisViewer_Errors.txt in whatever directory you ran the jar file from.
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,666
Reaction score
14,006
Location
USA
There are 3 reasons there might not be an error log.

1. You may have disabled it in the About window.

2. There was no attempt to log an error and therefore we have little chance of figuring this out.

3. The application does not have permission to write an error log in its current location, in which case there would also be no configuration file.
 

Ian

n3wb
Joined
May 22, 2015
Messages
16
Reaction score
4
Clearly you are a superstar.

I had copied it to Program files and run it from there.
If I run it from Downloads it runs, so it must be a permissions thing -which I'll get sorted.

Thank you very much
 

dysasha

n3wb
Joined
Jun 6, 2015
Messages
2
Reaction score
0
I have nine 5mp cameras recording at full resolution direct to disk, my cpu on my blue iris machine runs about 88% full time. playback or anything really, pegs the cpu at 100% and may crash or hang. I was thinking i could use this app to run a viewer on another pc, and save that machine some work from having to both record, and view live video. you state in the directions this app is cpu intensive, is it cpu intensive on the blue iris machine, or the client machine?
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,666
Reaction score
14,006
Location
USA
Unfortunately, this app is probably the most CPU-intensive method of remote viewing for both machines involved, but mostly for the Blue Iris machine. Blue Iris must encode frames as jpeg for every camera simultaneously when using this app. The client machine must decode them. There are a lot of performance options to affect the CPU usage of the client app, but the only one that really affects Blue Iris' CPU usage is the delay between image refreshes. Fewer refreshes is less load for blueiris.exe.

I'm assuming your 5MP cameras are all running at 10fps. That is typically the max resolution for chinese 5MP cameras, but some of the more expensive brands can offer higher.

For your situation, I recommend you go into Blue Iris Options > Cameras tab, and limit live preview rate to something low. It is possible that limiting it to 10 fps will help, but you might have to go lower to see any CPU usage improvement. In my experience, the main Blue Iris interface is the most efficient viewing method since it does not require recompressing the video. However high frame rates can still be taxing.

Since I only access my Blue Iris machine remotely, I do not need a high frame rate on its live view so I have this limited to 1fps. At this setting it uses almost no extra CPU at all to have the Blue Iris interface open. I also have Blue Iris run as a Windows service which you can configure in the Startup tab, as this allows Blue Iris to run in the background without having its interface open. Therefore it uses slightly less CPU time.

Now chances are this will not result in enough of a CPU usage drop to be comfortable. The next step would be to lower the frame rate of at least some of the cameras. You must lower it in the camera's web interface to get the full CPU savings effect. Then, also lower the frame rate of the camera in Blue Iris to match, unless you have Blue Iris set to auto adjust frame rate. This should have a very significant effect on CPU usage. Chances are your 5MP cameras max out at 10 FPS, but if any of them run higher, I encourage you to reduce those frame rates first. I have 3x 5MP cameras that I run at 5 FPS.
 

gth

Young grasshopper
Joined
Dec 11, 2014
Messages
47
Reaction score
3
Love your work, bp - thanks a bunch.

Quick question: would it be possible to bind a keyboard shortcut to the function that restarts the imaging engine? I only ask because the 'link' to the server is understandably lost when my PC goes into standby. I've read up on Java detecting standby/wake and it looks like a pain through JNI etc. so I figured a quick reload keyboard-shortcut would be an easier solution.
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,666
Reaction score
14,006
Location
USA
Hmm. Yes, that would be possible. I am kind of surprised that the PC going into standby causes it to stop working though. That isn't supposed to happen.
 

gth

Young grasshopper
Joined
Dec 11, 2014
Messages
47
Reaction score
3
Thinking about 'it shouldn't happen' then --
The same symptom takes place when returning from standby, as it does when BI crashes on my server: i.e. the last successfully obtained images are shown, but they remain "stale" and do not update.

I just went to look at the error log, but Notepad didn't like the 3.5GB text file. :) Deleted the huge log / updated to BIV2.5.2 / Will see if there's anything useful next time it happens.

(PS: BI3 crashing is more my fault than Ken's, given my messy, overloaded server state; dodgy memory on eBay isn't helping my slow migration to a proper 64bit o/s and BI4).
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,666
Reaction score
14,006
Location
USA
This morning I tested the behavior of BIV 2.5.2 while shutting down and restarting Blue Iris. No abnormalities. Image refreshing continued on its own.

I also tried running it on my windows tablet. Putting the device to sleep did not break anything, nor did hibernating the device. When hibernating, the images began refreshing normally again the moment WiFi reconnected.

If you continue to have trouble, your log information may be useful. If you need to send the log file, try compressing it first as log files of this type tend to compress extremely well.
 

gth

Young grasshopper
Joined
Dec 11, 2014
Messages
47
Reaction score
3
I just woke my PC up from standby this (Monday) morning at nearly 8am, and BIV is displaying static images date-stamped as just after 2pm on Saturday. Windows 7 64bit with GB Ethernet back to server running BI3. Checked Log Errors to disk and the following error was shown for each of my cameras, endlessly -

Code:
2015/06/15 07:46:51 An exception has occurred in class org.brian.blueirisviewer.util.Utilities:
Server returned HTTP response code: 403 for URL: http://removed:8181/mjpg/removed/video.mjpg
Additional Info:
URL: http://removed:8181/mjpg/removed/video.mjpg
java.io.IOException: Server returned HTTP response code: 403 for URL: http://removed:8181/mjpg/removed/video.mjpg
    at sun.net.[URL="http://www.protocol.http.HttpURLConnection.getInputStream0(Unknown"]www.protocol.http.HttpURLConnection.getInputStream0(Unknown[/URL] Source)
    at sun.net.[URL="http://www.protocol.http.HttpURLConnection.getInputStream(Unknown"]www.protocol.http.HttpURLConnection.getInputStream(Unknown[/URL] Source)
    at org.brian.blueirisviewer.util.HttpHelper.GET(HttpHelper.java:98)
    at org.brian.blueirisviewer.images.Images$1$1.HandleThrottledMjpegStreaming(Images.java:395)
    at org.brian.blueirisviewer.images.Images$1$1.run(Images.java:345)
    at java.lang.Thread.run(Unknown Source)


2015/06/15 07:46:51 An exception has occurred in class org.brian.blueirisviewer.images.Images$1$1:
Exception message was null
java.lang.NullPointerException
I went into Instant Replay options, clicked Restart Imaging Engine and everything back to normal and no more errors in the logfile. I'll leave logging on tonight and check tomorrow for any errors that might be more helpful than the 403 above. Here's my config, if it helps -

Code:
<org.brian.blueirisviewer.BIVSettings>  <serverURL>http://removed:8181/</serverURL>
  <loadStartPositionAndSizeUponAppStart>true</loadStartPositionAndSizeUponAppStart>
  <disableWindowDragging>false</disableWindowDragging>
  <overrideGridLayoutX>0</overrideGridLayoutX>
  <overrideGridLayoutY>0</overrideGridLayoutY>
  <startPositionX>-1049</startPositionX>
  <startPositionY>-478</startPositionY>
  <startSizeW>1042</startSizeW>
  <startSizeH>787</startSizeH>
  <borderless>true</borderless>
  <restartBorderlessToggle>false</restartBorderlessToggle>
  <imageRefreshDelayMS>500</imageRefreshDelayMS>
  <bOverrideGridLayout>false</bOverrideGridLayout>
  <imageFillMode>0</imageFillMode>
  <modalUI>true</modalUI>
  <username>removed</username>
  <password>removed</password>
  <imageResolutionMode>2</imageResolutionMode>
  <overrideJpegQuality>true</overrideJpegQuality>
  <jpegQuality>100</jpegQuality>
  <instantReplayEnabled>false</instantReplayEnabled>
  <instantReplayHistoryLengthMinutes>5</instantReplayHistoryLengthMinutes>
  <hiddenCams/>
  <logErrorsToDisk>true</logErrorsToDisk>
  <windowTitle>BlueIrisViewer</windowTitle>
  <useLibjpegTurbo>true</useLibjpegTurbo>
  <useMjpegStream>true</useMjpegStream>
</org.brian.blueirisviewer.BIVSettings>

NB: IPs, camera names and credentials removed from Code content
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,666
Reaction score
14,006
Location
USA
Well a 403 response is the "Forbidden" response, typically meaning you have to log in to access whatever you're trying to access.

So I am guessing BIV is trying to use an expired session when your system wakes up, and is stupidly trying over and over again to download images and not trying to reauthenticate. I'll try to get this fixed. In the meantime you might get it to work properly if you disable authentication for LAN clients in BI's web server settings.
 

nutt318

Young grasshopper
Joined
Jul 28, 2015
Messages
51
Reaction score
18
Not sure if anyone has tried this but I'm attempting to get this to run on a Raspberry Pi but running into an error, I've got java 1.8 installed and run the command 'sudo java -jar BlueIrisViewer.jar' but get the following error, any ideas?

Client is not authorized to connect to ServerException in thread "main" java.awt.AWTError: Can't connect to X11 window server using ':1.0' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.access$200(X11GraphicsEnvironment.java:65)
at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:115)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:74)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:259)
at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:102)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:81)
at org.brian.blueirisviewer.Main.main(Main.java:53)
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,666
Reaction score
14,006
Location
USA
I get a different error when I try to load it on my pi 2. I do not intend to put in the time to fix this, so I recommend you use the BI web interface instead from a raspberry pi.
 

nutt318

Young grasshopper
Joined
Jul 28, 2015
Messages
51
Reaction score
18
Thanks bp2008, I attempted to use the browser on the pi but I never can get it to display any video. My CPU is at 100% and it keeps refreshing the page over and over and sorta locks up the browser, running a R Pi 1 model B and the latest raspbian image.
 

nutt318

Young grasshopper
Joined
Jul 28, 2015
Messages
51
Reaction score
18
Thanks good to know, looks like I'll pick up a newer one.
 

gth

Young grasshopper
Joined
Dec 11, 2014
Messages
47
Reaction score
3
In the meantime you might get it to work properly if you disable authentication for LAN clients in BI's web server settings.
I see you're aware "Non-LAN only" authentication isn't functioning; I'll keep an eye out for improvements in BI for this.


A new issue I've just started getting is no response at all when launching the jar file - just instant crash without any GUI. I launched via a console and saw the error below -

Code:
[FONT=courier new]>java -jar "C:\Program Files\Blue Iris Viewer\BlueIrisViewer.jar"

[/FONT]
[FONT=courier new]AL lib: (EE) DoReset: Failed to get mix format: 0x8889000f[/FONT]
[FONT=courier new]Exception in thread "main" org.lwjgl.openal.OpenALException: Invalid Device[/FONT]
[FONT=courier new]        at org.lwjgl.openal.Util.checkALCError(Util.java:55)[/FONT]
[FONT=courier new]        at org.lwjgl.openal.ALC10.alcCreateContext(ALC10.java:251)[/FONT]
[FONT=courier new]        at org.lwjgl.openal.AL.init(AL.java:168)[/FONT]
[FONT=courier new]        at org.lwjgl.openal.AL.create(AL.java:138)[/FONT]
[FONT=courier new]        at org.lwjgl.openal.AL.create(AL.java:102)[/FONT]
[FONT=courier new]        at org.lwjgl.openal.AL.create(AL.java:201)[/FONT]
[FONT=courier new]        at com.badlogic.gdx.backends.lwjgl.audio.OpenALAudio.<init>(OpenALAudio.java:72)[/FONT]
[FONT=courier new]        at com.badlogic.gdx.backends.lwjgl.LwjglApplication.<init>(LwjglApplication.java:82)[/FONT]
[FONT=courier new]        at com.badlogic.gdx.backends.lwjgl.LwjglApplication.<init>(LwjglApplication.java:64)[/FONT]
[FONT=courier new]        at org.brian.blueirisviewer.Main.main(Main.java:84)[/FONT]
[FONT=courier new]AL lib: (EE) alc_cleanup: 1 device not closed[/FONT]
Two changes in (relatively) recent times are upgrading java to 8.51 and upgrading my video driver. I thought I'd used the viewer after those changes, but I can't be sure. I deleted my BIV config file and error file, but neither were recreated when launching. Launching in a new folder does successfully unpack the libturbojpeg.dll file though.
 
Top