RDPUser
Posts: 140
Joined: Tue Jan 30, 2018 12:18 pm

Re: RPi Cam Web Interface

Thu Jul 05, 2018 9:14 pm

Thanks for clarifying, I'll try.

I found the option "raw layer" what exactly does it? In the documention https://elinux.org/RPi-Cam-Web-Interface I only find

Code: Select all

rl 	0/1 	0/1 disable / enable raw layer 

btidey
Posts: 1622
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Thu Jul 05, 2018 9:44 pm

RDPUser wrote:
Thu Jul 05, 2018 9:14 pm
Thanks for clarifying, I'll try.

I found the option "raw layer" what exactly does it? In the documention https://elinux.org/RPi-Cam-Web-Interface I only find

Code: Select all

rl 	0/1 	0/1 disable / enable raw layer 
This setting is a MMAL parameterMMAL_PARAMETER_ENABLE_RAW_CAPTURE.

This is primarily of interest in image capture. You still get a normal jpeg but the file is much bigger as the raw pixel data is appended on the end. This allows advanced processing of the raw pixel data

See viewtopic.php?t=44918

RDPUser
Posts: 140
Joined: Tue Jan 30, 2018 12:18 pm

Re: RPi Cam Web Interface

Fri Jul 06, 2018 8:38 am

Thank you very much btidey for your great and fast support.

I've noticed if you setup "Video Split" after e.g. 10 seconds, video recording stops and does not continue, except there is "ca 1" in "Period Start" in sheduler. Is this a bug or wanted setting? For me its confusing. When I click record video start and the option is called split video after XX seconds then I would expect that video capture continues after manual start.

btidey
Posts: 1622
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Fri Jul 06, 2018 9:38 am

RDPUser wrote:
Fri Jul 06, 2018 8:38 am
Thank you very much btidey for your great and fast support.

I've noticed if you setup "Video Split" after e.g. 10 seconds, video recording stops and does not continue, except there is "ca 1" in "Period Start" in sheduler. Is this a bug or wanted setting? For me its confusing. When I click record video start and the option is called split video after XX seconds then I would expect that video capture continues after manual start.
I just tried this with no period start commands in scheduler. When I manually start recording I get multiple recordings of 'split duration' until I manually stop video.

Code: Select all

{2018/07/06 10:34:25} Capturing with split of 10 seconds
{2018/07/06 10:34:25} Capturing started
{2018/07/06 10:34:35} Stopping video from timer
{2018/07/06 10:34:35} Capturing stopped
{2018/07/06 10:34:35} Add /var/www/media/vi_0016_20180706_103425.mp4 to Box Queue at pos 8
{2018/07/06 10:34:35} DEBUG 3
{2018/07/06 10:34:35} Restarting next split of 10 seconds
{2018/07/06 10:34:35} Capturing started
{2018/07/06 10:34:36} Start boxing /var/www/media/vi_0016_20180706_103425.h264 to /var/www/media/vi_0016_20180706_103425.mp4 Queue pos 8
{2018/07/06 10:34:37} Finished boxing /var/www/media/vi_0016_20180706_103425.mp4 from Box Queue at pos 8
{2018/07/06 10:34:37} Removed item from Box Queue
{2018/07/06 10:34:45} Stopping video from timer
{2018/07/06 10:34:45} Capturing stopped
{2018/07/06 10:34:45} Add /var/www/media/vi_0017_20180706_103435.mp4 to Box Queue at pos 9
{2018/07/06 10:34:45} DEBUG 3
{2018/07/06 10:34:45} Restarting next split of 10 seconds
{2018/07/06 10:34:45} Capturing started
{2018/07/06 10:34:46} Start boxing /var/www/media/vi_0017_20180706_103435.h264 to /var/www/media/vi_0017_20180706_103435.mp4 Queue pos 9
{2018/07/06 10:34:47} Finished boxing /var/www/media/vi_0017_20180706_103435.mp4 from Box Queue at pos 9
{2018/07/06 10:34:47} Removed item from Box Queue
{2018/07/06 10:34:55} Stopping video from timer
{2018/07/06 10:34:55} Capturing stopped
{2018/07/06 10:34:55} Add /var/www/media/vi_0018_20180706_103445.mp4 to Box Queue at pos 10
{2018/07/06 10:34:55} DEBUG 3
{2018/07/06 10:34:55} Restarting next split of 10 seconds
There must be something different with your set up. If you can't resolve it then zip up schedule.json and post it for checking.

RDPUser
Posts: 140
Joined: Tue Jan 30, 2018 12:18 pm

Re: RPi Cam Web Interface

Fri Jul 06, 2018 10:44 am

Thanks, found the problem. It was in uconfig

Code: Select all

motion_external 2
Removed this line and now it works. Don't know how it got there.

CharlyDelta
Posts: 122
Joined: Thu Jul 18, 2013 4:04 am
Location: Montreal

Re: RPi Cam Web Interface

Fri Jul 06, 2018 7:06 pm

Hello...


This is not a problem but rather a feasibility opinion:

Is it possible to take a reading of an RFID and transfer the information into the image annotation field?

Tnx

btidey
Posts: 1622
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Sat Jul 07, 2018 7:40 am

CharlyDelta wrote:
Fri Jul 06, 2018 7:06 pm
Hello...


This is not a problem but rather a feasibility opinion:

Is it possible to take a reading of an RFID and transfer the information into the image annotation field?

Tnx
You can achieve the annotation part by using the user annotation scheme. See wiki under naming scheme.

Basically if you include a %a in the annotation template then the contents of the file /dev/shm/mjpeg/user_annotate.txt are substituted for the %a

So add %a to the annotation and then use a RFID reading program (e.g. python) to update that file. Note the content should just be a string of text, don't have a line terminator.

CharlyDelta
Posts: 122
Joined: Thu Jul 18, 2013 4:04 am
Location: Montreal

Re: RPi Cam Web Interface

Sun Jul 08, 2018 12:24 am

btidey wrote:
Tue Jul 03, 2018 9:42 pm
I have made the image, timelapse, motion detection and video buttons change colour when active.

This is in latest 6.4.23

Thanks a lot, it's awsome !!


Image

CharlyDelta
Posts: 122
Joined: Thu Jul 18, 2013 4:04 am
Location: Montreal

Re: RPi Cam Web Interface

Sun Jul 08, 2018 12:26 am

btidey wrote:
Sat Jul 07, 2018 7:40 am
CharlyDelta wrote:
Fri Jul 06, 2018 7:06 pm
Hello...


This is not a problem but rather a feasibility opinion:

Is it possible to take a reading of an RFID and transfer the information into the image annotation field?

Tnx
You can achieve the annotation part by using the user annotation scheme. See wiki under naming scheme.

Basically if you include a %a in the annotation template then the contents of the file /dev/shm/mjpeg/user_annotate.txt are substituted for the %a

So add %a to the annotation and then use a RFID reading program (e.g. python) to update that file. Note the content should just be a string of text, don't have a line terminator.

Thanks, I'll see what I can do with this. It's gonna be very practically in my project

CharlyDelta
Posts: 122
Joined: Thu Jul 18, 2013 4:04 am
Location: Montreal

Re: RPi Cam Web Interface

Sun Jul 08, 2018 4:51 pm

CharlyDelta wrote:
Sun Jul 08, 2018 12:26 am
btidey wrote:
Sat Jul 07, 2018 7:40 am
CharlyDelta wrote:
Fri Jul 06, 2018 7:06 pm
Hello...


This is not a problem but rather a feasibility opinion:

Is it possible to take a reading of an RFID and transfer the information into the image annotation field?

Tnx
You can achieve the annotation part by using the user annotation scheme. See wiki under naming scheme.

Basically if you include a %a in the annotation template then the contents of the file /dev/shm/mjpeg/user_annotate.txt are substituted for the %a

So add %a to the annotation and then use a RFID reading program (e.g. python) to update that file. Note the content should just be a string of text, don't have a line terminator.
Thanks, it works for annotation from the user_annotate.txt file.
Now, that seems beyond my knowledge about python. I don't see how to take the information from tag reading and update user_annotate.txt file.
Here's the program I'm using. It will be easy for me to adapt it to my needs but for the update, I have no idea.

Maybe I'd better find out about the PYTHON segment of the forum? I'm taking a chance here...

Code: Select all

import binascii
import socket
import time

import Adafruit_PN532 as PN532
import mcpi.minecraft as minecraft

import mcpi_data


# PN532 configuration for a Raspberry Pi:
CS   = 18
MOSI = 23
MISO = 24
SCLK = 25

# Configure the key to use for writing to the MiFare card.  You probably don't
# need to change this from the default below unless you know your card has a
# different key associated with it.
CARD_KEY = [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF]

# Number of seconds to delay after building a block.  Good for slowing down the
# update rate to prevent flooding new blocks into the world.
MAX_UPDATE_SEC = 0.5
def create_block(mc, block_id, subtype=None):
    """Build a block with the specified id and subtype under the player in the
    Minecraft world.  Subtype is optional and can be specified as None to use
    the default subtype for the block.
    """
    # Get player tile position and real position.
    ptx, pty, ptz = mc.player.getTilePos()
    px, py, pz = mc.player.getPos()
    # Create block at current player tile location.
    if subtype is None:
        mc.setBlock(ptx, pty, ptz, block_id)
    else:
        mc.setBlock(ptx, pty, ptz, block_id, subtype)
    # Move the player's real positon up one block.
    mc.player.setPos(px, py+1, pz)


# Start with no connection to the Minecraft world, instead it will be created
# as soon as a block is swiped.
mc = None

# Create and initialize an instance of the PN532 class.
pn532 = PN532.PN532(cs=CS, sclk=SCLK, mosi=MOSI, miso=MISO)
pn532.begin()
pn532.SAM_configuration()

print('Minecraft Block NFC Listener')
print('')
print('Waiting for MiFare card...')
while True:
    # Wait for a card to be available.
    uid = pn532.read_passive_target()
    # Try again if no card found.
    if uid is None:
        continue
    # Found a card, now try to read block 4 to detect the block type.
    print('Found card with UID 0x{0}'.format(binascii.hexlify(uid)))
    # Authenticate and read block 4.
    if not pn532.mifare_classic_authenticate_block(uid, 4, PN532.MIFARE_CMD_AUTH_B,
                                                   CARD_KEY):
        print('Failed to authenticate with card!')
        continue
    data = pn532.mifare_classic_read_block(4)
    if data is None:
        print('Failed to read data from card!')
        continue
    # Check if card has Minecraft block data by looking for header 'MCPI'

   if data[0:4] != b'MCPI':
        print('Card is not written with Minecraft block data!')
        continue
    # Parse out the block type and subtype.
    block_id = data[4]
    has_subtype = data[5]
    subtype_id = data[6]
    # Find the block name (it's ugly to search for it, but there are less than 100).
    for block in mcpi_data.BLOCKS:
        if block[1] == block_id:
            block_name = block[0]
            break
    print('Found block!')
    print('Type: {0}'.format(block_name))
    if has_subtype:
        subtype_name = mcpi_data.SUBTYPES[block_name][subtype_id]
        print('Subtype: {0}'.format(subtype_name))
    # Try to create the block in Minecraft.
    # First check if connected to Minecraft world.
    try:
        if mc is None:
            mc = minecraft.Minecraft.create()
        create_block(mc, block_id, subtype_id if has_subtype else None)
        time.sleep(MAX_UPDATE_SEC)
   except socket.error:
        # Socket error, Minecraft probably isn't running.
        print('Could not connect to Minecraft, is the game running in a world?')
        continue



Call-151
Posts: 5
Joined: Sun Jun 24, 2018 1:12 pm

Re: RPi Cam Web Interface

Sun Jul 08, 2018 8:11 pm

btidey wrote:
Mon Jun 25, 2018 8:27 am
You can alternatively edit the /etc/raspimjpeg config file so that it has motion_detection true instead of motion_detection false
I would like to automate the toggling of Motion detection.
Another raspberry pi would send a command to the one with the camera to change it's state.
Would the modifying of this file (/etc/raspimjpeg) would be enough, or should I force a re-read of the file.
Thank you

btidey
Posts: 1622
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Sun Jul 08, 2018 8:26 pm

Call-151 wrote:
Sun Jul 08, 2018 8:11 pm
btidey wrote:
Mon Jun 25, 2018 8:27 am
You can alternatively edit the /etc/raspimjpeg config file so that it has motion_detection true instead of motion_detection false
I would like to automate the toggling of Motion detection.
Another raspberry pi would send a command to the one with the camera to change it's state.
Would the modifying of this file (/etc/raspimjpeg) would be enough, or should I force a re-read of the file.
Thank you
The /etc/raspimjpeg config file is read when the softare starts up or when the camera is started (after a stop) so this is not the right mechanism for controlling turning motion detection on and off.

First the built in scheduler can control the periods when motion detection is turned on and off according to either fixed time periods or daylight based times.

If you need something different then the way to do it is to issue md 1 (on) and md 0 (off commands into the cmd ipe (e.g /var/www/html/FIFO)

This can be done remotely by issuing the html command that the web interface would.

So for example accessing http://cameraip/html/cmd_pipe.php?cmd=md%201 would turn the motion detection on (The %20 is the URL for a space character.

wget or curl can be used to issue these commands.

btidey
Posts: 1622
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Sun Jul 08, 2018 8:34 pm

CharlyDelta wrote:
Sun Jul 08, 2018 4:51 pm

Thanks, it works for annotation from the user_annotate.txt file.
Now, that seems beyond my knowledge about python. I don't see how to take the information from tag reading and update user_annotate.txt file.
Here's the program I'm using. It will be easy for me to adapt it to my needs but for the update, I have no idea.

Maybe I'd better find out about the PYTHON segment of the forum? I'm taking a chance here...
Maybe try starting from a basic RFID library like https://github.com/mxgxw/MFRC522-python

The read.py example uses the library to print out tag data. So look for the bit where it prints the tag (# Print UID). You now need to write the output to the user_annotate.txt file.

A basic python segment goes something like

Code: Select all

annotate = open("/dev/shm/mjpeg/user_annotate.txt", 'w')
annotate.write(rfid)
annotate.close()

CharlyDelta
Posts: 122
Joined: Thu Jul 18, 2013 4:04 am
Location: Montreal

Re: RPi Cam Web Interface

Mon Jul 09, 2018 12:50 am

btidey wrote:
Sun Jul 08, 2018 8:34 pm
CharlyDelta wrote:
Sun Jul 08, 2018 4:51 pm

Thanks, it works for annotation from the user_annotate.txt file.
Now, that seems beyond my knowledge about python. I don't see how to take the information from tag reading and update user_annotate.txt file.
Here's the program I'm using. It will be easy for me to adapt it to my needs but for the update, I have no idea.

Maybe I'd better find out about the PYTHON segment of the forum? I'm taking a chance here...
Maybe try starting from a basic RFID library like https://github.com/mxgxw/MFRC522-python

The read.py example uses the library to print out tag data. So look for the bit where it prints the tag (# Print UID). You now need to write the output to the user_annotate.txt file.

A basic python segment goes something like

Code: Select all

annotate = open("/dev/shm/mjpeg/user_annotate.txt", 'w')
annotate.write(rfid)
annotate.close()

I have not yet received the RC522 module. I'm running tests with PN532. I have on the other hand ''simplified'' or at least lightened it all while removing text that is useless to me. Now I only have the required information displayed on the screen. But I always get an error if I enter the code you offer me.

File "mcpi_listentest1.py", line 96
try:
^
IndentationError: unexpected indent

Maybe put it in the wrong place:

Code: Select all

# Find the block name (it's ugly to search for it, but there are less than 100).
    for block in mcpi_data.BLOCKS:
        if block[1] == block_id:
            block_name = block[0]
            break
    print('')
    print(' {0}'.format(block_name))
    if has_subtype:
        subtype_name = mcpi_data.SUBTYPES[block_name][subtype_id]
        print('Subtype: {0}'.format(subtype_name))
annotate = open("/dev/shm/mjpeg/user_annotate.txt", 'w')
annotate.write(rfid)
annotate.close()
    # Try to create the block in Minecraft.
    # First check if connected to Minecraft world.
    try:
        if mc is None:
            mc = minecraft.Minecraft.create()
        create_block(mc, block_id, subtype_id if has_subtype else None)
        time.sleep(MAX_UPDATE_SEC)
    except socket.error:
        # Socket error, Minecraft probably isn't running.
        print('')
        time.sleep(5)
        continue
coding python is still difficult for me

Tnx for your help btidey

btidey
Posts: 1622
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Mon Jul 09, 2018 6:37 am

CharlyDelta wrote:
Mon Jul 09, 2018 12:50 am

I have not yet received the RC522 module. I'm running tests with PN532. I have on the other hand ''simplified'' or at least lightened it all while removing text that is useless to me. Now I only have the required information displayed on the screen. But I always get an error if I enter the code you offer me.

File "mcpi_listentest1.py", line 96
try:
^
IndentationError: unexpected indent

Maybe put it in the wrong place:

Code: Select all

# Find the block name (it's ugly to search for it, but there are less than 100).
    for block in mcpi_data.BLOCKS:
        if block[1] == block_id:
            block_name = block[0]
            break
    print('')
    print(' {0}'.format(block_name))
    if has_subtype:
        subtype_name = mcpi_data.SUBTYPES[block_name][subtype_id]
        print('Subtype: {0}'.format(subtype_name))
annotate = open("/dev/shm/mjpeg/user_annotate.txt", 'w')
annotate.write(rfid)
annotate.close()
    # Try to create the block in Minecraft.
    # First check if connected to Minecraft world.
    try:
        if mc is None:
            mc = minecraft.Minecraft.create()
        create_block(mc, block_id, subtype_id if has_subtype else None)
        time.sleep(MAX_UPDATE_SEC)
    except socket.error:
        # Socket error, Minecraft probably isn't running.
        print('')
        time.sleep(5)
        continue
coding python is still difficult for me

Tnx for your help btidey
In python the indentation of the code is important as it is part of the structure.

So you need to put the piece of code that writes the file in line with where it belongs. Also the rfid needs to be substituted with what is needed. I put in subtype_name here. I don't know if that is what you want.

Code: Select all

# Find the block name (it's ugly to search for it, but there are less than 100).
    for block in mcpi_data.BLOCKS:
        if block[1] == block_id:
            block_name = block[0]
            break
    print('')
    print(' {0}'.format(block_name))
    if has_subtype:
        subtype_name = mcpi_data.SUBTYPES[block_name][subtype_id]
        print('Subtype: {0}'.format(subtype_name))
        annotate = open("/dev/shm/mjpeg/user_annotate.txt", 'w')
        annotate.write(subtype_name)
        annotate.close()
    # Try to create the block in Minecraft.
    # First check if connected to Minecraft world.
    try:
        if mc is None:
            mc = minecraft.Minecraft.create()
        create_block(mc, block_id, subtype_id if has_subtype else None)
        time.sleep(MAX_UPDATE_SEC)
    except socket.error:
        # Socket error, Minecraft probably isn't running.
        print('')
        time.sleep(5)
        continue

budman1758
Posts: 9
Joined: Mon Dec 19, 2016 8:44 pm

Re: RPi Cam Web Interface

Mon Jul 09, 2018 7:47 pm

Second try. No response to first try.......

I search for a while and found no answer to this. Its not a big deal but I am curious.....
I currently have 3 camera setups running and all installs were done at different times. Each has a different version number I assume coincides with when I installed them. My question is after updating all of them several times over the last few months and again just a few minutes ago the displayed version number in the web page does not change.

v6.3.3
v6.2.31
v6.4.21
All of these were just updated at the same time. Why does the version number remain the same?

btidey
Posts: 1622
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Mon Jul 09, 2018 8:14 pm

budman1758 wrote:
Mon Jul 09, 2018 7:47 pm
Second try. No response to first try.......

I search for a while and found no answer to this. Its not a big deal but I am curious.....
I currently have 3 camera setups running and all installs were done at different times. Each has a different version number I assume coincides with when I installed them. My question is after updating all of them several times over the last few months and again just a few minutes ago the displayed version number in the web page does not change.

v6.3.3
v6.2.31
v6.4.21
All of these were just updated at the same time. Why does the version number remain the same?
The version number as displayed in the web page is contained within the config.php file. This is updated with new versions and therefore the displayed number should change.

How are you updating? Check the config.php file in your run time folder (e.g. /var/www/html). It has a line like
define('APP_VERSION', 'v6.4.23');
very near the top

budman1758
Posts: 9
Joined: Mon Dec 19, 2016 8:44 pm

Re: RPi Cam Web Interface

Mon Jul 09, 2018 9:25 pm

The version number as displayed in the web page is contained within the config.php file. This is updated with new versions and therefore the displayed number should change.

How are you updating? Check the config.php file in your run time folder (e.g. /var/www/html). It has a line like
define('APP_VERSION', 'v6.4.23');
very near the top
I update by using the update script in the RI-Cam folder. Just looked at the config.php file before and after an update a few minutes ago and the version define in the file did not change. The config.php file date and time updated though.

define ('APP_VERSION', 'v6.3.3') did not change.

HaMaSch
Posts: 4
Joined: Fri Jun 15, 2018 11:36 pm

Re: RPi Cam Web Interface

Mon Jul 09, 2018 10:05 pm

Hello,
I'm running RPi Cam Web Interface on a Pi Zero W with Raspbian Stretch Lite and it works great for me!
Now I attached a small TFT monitor and want to have the preview displayed on that monitor. How can I do that?
I tried "omxplayer http://localhost/html/cam_pic_new.php", but the display seems to work half as fast as reality. This means, in 1 min I get 27 sec latency!
Using a browser requires a GUI and increases the CPU load of my little Pi Zero to much.
Is there an other way to display the preview on an local attached monitor in real-time?
Any help is greatly appreciated.
Thanks in advance!

CharlyDelta
Posts: 122
Joined: Thu Jul 18, 2013 4:04 am
Location: Montreal

Re: RPi Cam Web Interface

Tue Jul 10, 2018 3:12 am

btidey wrote:
Mon Jul 09, 2018 6:37 am
CharlyDelta wrote:
Mon Jul 09, 2018 12:50 am

I have not yet received the RC522 module. I'm running tests with PN532. I have on the other hand ''simplified'' or at least lightened it all while removing text that is useless to me. Now I only have the required information displayed on the screen. But I always get an error if I enter the code you offer me.

File "mcpi_listentest1.py", line 96
try:
^
IndentationError: unexpected indent

Maybe put it in the wrong place:

Code: Select all

# Find the block name (it's ugly to search for it, but there are less than 100).
    for block in mcpi_data.BLOCKS:
        if block[1] == block_id:
            block_name = block[0]
            break
    print('')
    print(' {0}'.format(block_name))
    if has_subtype:
        subtype_name = mcpi_data.SUBTYPES[block_name][subtype_id]
        print('Subtype: {0}'.format(subtype_name))
annotate = open("/dev/shm/mjpeg/user_annotate.txt", 'w')
annotate.write(rfid)
annotate.close()
    # Try to create the block in Minecraft.
    # First check if connected to Minecraft world.
    try:
        if mc is None:
            mc = minecraft.Minecraft.create()
        create_block(mc, block_id, subtype_id if has_subtype else None)
        time.sleep(MAX_UPDATE_SEC)
    except socket.error:
        # Socket error, Minecraft probably isn't running.
        print('')
        time.sleep(5)
        continue
coding python is still difficult for me

Tnx for your help btidey
In python the indentation of the code is important as it is part of the structure.

So you need to put the piece of code that writes the file in line with where it belongs. Also the rfid needs to be substituted with what is needed. I put in subtype_name here. I don't know if that is what you want.

Not exactly, but I was able to write the code lines where I wanted. Now, this part works very well and I thank you for it.

btidey
Posts: 1622
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Tue Jul 10, 2018 7:57 am

HaMaSch wrote:
Mon Jul 09, 2018 10:05 pm
Hello,
I'm running RPi Cam Web Interface on a Pi Zero W with Raspbian Stretch Lite and it works great for me!
Now I attached a small TFT monitor and want to have the preview displayed on that monitor. How can I do that?
I tried "omxplayer http://localhost/html/cam_pic_new.php", but the display seems to work half as fast as reality. This means, in 1 min I get 27 sec latency!
Using a browser requires a GUI and increases the CPU load of my little Pi Zero to much.
Is there an other way to display the preview on an local attached monitor in real-time?
Any help is greatly appreciated.
Thanks in advance!
2 Thoughts

1) Continue to use browser but lower the preview rate to say 12.5 fps. This will still be fairly smooth but will lower the work the browser has to do. use cam_pic_new.php?pDelay=80000 The pDelay is the interval between frames in microseconds. You could try even lower frame rates by increasing the pDelay value.

2) Use a separate application like vlc. This can open the mjpeg stream from a url and may have lower overhead than the browser.

btidey
Posts: 1622
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Tue Jul 10, 2018 8:05 am

budman1758 wrote:
Mon Jul 09, 2018 9:25 pm
The version number as displayed in the web page is contained within the config.php file. This is updated with new versions and therefore the displayed number should change.

How are you updating? Check the config.php file in your run time folder (e.g. /var/www/html). It has a line like
define('APP_VERSION', 'v6.4.23');
very near the top
I update by using the update script in the RI-Cam folder. Just looked at the config.php file before and after an update a few minutes ago and the version define in the file did not change. The config.php file date and time updated though.

define ('APP_VERSION', 'v6.3.3') did not change.
That does sound strange.

The update process first fetches the new files to the RPi_Cam_Web_Interface folder in your home (/home/pi) and then runs the install from there which copies the files into their run time location.

So check the version number of the config.php in the RPi_Cam_Web_Interface folder. If that hasn't changed then it indicates that it is not syncing with git for some reason. This could happen with some earlier versions.

If this is the case then just delete the whole RPi_Cam_Web_Interface folder and do

Code: Select all

git clone https://github.com/silvanmelchior/RPi_Cam_Web_Interface.git
cd RPi_Cam_Web_Interface
./install.sh
This is pretty much what the update process tries to do.

CharlyDelta
Posts: 122
Joined: Thu Jul 18, 2013 4:04 am
Location: Montreal

Re: RPi Cam Web Interface

Wed Jul 11, 2018 3:39 pm

Hello...

Is it possible, with this program, which finally records on the image the identity of the TAG (annotate), at the same time, to start a video recording for 10 seconds ?

''run'' is my interpretation of the code... I don't know anything about. I studied Cobol programming, PL1, Assembler and Fortran, 47 years ago..and never worked in this business.

I've been looking for hours to figure out how to do it, without success.

Now, this program automatically starts at the Raspberry startup.

# Find the block name (it's ugly to search for it, but there are less than 100).
for block in mcpi_data.BLOCKS:
if block[1] == block_id:
block_name = block[0]
break
print('')
print('{0}'.format(block_name))
run (the path to the file who start the video record and give a timeit) ???
annotate = open("/dev/shm/mjpeg/user_annotate.txt", 'w')
annotate.write(block_name)
annotate.close()
# if has_sub


I am this close to finalizing this project and I am very grateful for the help you are giving me, Btidey.

btidey
Posts: 1622
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Wed Jul 11, 2018 5:40 pm

CharlyDelta wrote:
Wed Jul 11, 2018 3:39 pm
Hello...

Is it possible, with this program, which finally records on the image the identity of the TAG (annotate), at the same time, to start a video recording for 10 seconds ?

''run'' is my interpretation of the code... I don't know anything about. I studied Cobol programming, PL1, Assembler and Fortran, 47 years ago..and never worked in this business.

I've been looking for hours to figure out how to do it, without success.

Now, this program automatically starts at the Raspberry startup.

# Find the block name (it's ugly to search for it, but there are less than 100).
for block in mcpi_data.BLOCKS:
if block[1] == block_id:
block_name = block[0]
break
print('')
print('{0}'.format(block_name))
run (the path to the file who start the video record and give a timeit) ???
annotate = open("/dev/shm/mjpeg/user_annotate.txt", 'w')
annotate.write(block_name)
annotate.close()
# if has_sub


I am this close to finalizing this project and I am very grateful for the help you are giving me, Btidey.
The camera software is controlled by sending commands into the command pipe (e.g. /var/www/html/FIFO). These can come from anywhere. The command to start a video recording is normally ca 1 and the command to stop it is ca 0. However, one can also do ca 1 x where x is the number of seconds to record for and it will automatically stop. So ca 1 10 would do a 10 second video recording.

To send a command into the pipe from python is like writing to a file.

Code: Select all

    cmdpipe = open("/var/www/html/FIFO", 'w')
    cmdpipe.write('ca 1 10')
    cmdpipe.close()
The html would need to be changed if you have installed in a different folder.

Note also if that there is lots of commands going in from different programs then they could conflict with each other. This is not normally a problem but it is possible to add separate FIFOs which each program to use exclusively.

HaMaSch
Posts: 4
Joined: Fri Jun 15, 2018 11:36 pm

Re: RPi Cam Web Interface

Wed Jul 11, 2018 11:23 pm

btidey wrote:
Tue Jul 10, 2018 7:57 am
HaMaSch wrote:
Mon Jul 09, 2018 10:05 pm
Hello,
I'm running RPi Cam Web Interface on a Pi Zero W with Raspbian Stretch Lite and it works great for me!
Now I attached a small TFT monitor and want to have the preview displayed on that monitor. How can I do that?
I tried "omxplayer http://localhost/html/cam_pic_new.php", but the display seems to work half as fast as reality. This means, in 1 min I get 27 sec latency!
Using a browser requires a GUI and increases the CPU load of my little Pi Zero to much.
Is there an other way to display the preview on an local attached monitor in real-time?
Any help is greatly appreciated.
Thanks in advance!
2 Thoughts

1) Continue to use browser but lower the preview rate to say 12.5 fps. This will still be fairly smooth but will lower the work the browser has to do. use cam_pic_new.php?pDelay=80000 The pDelay is the interval between frames in microseconds. You could try even lower frame rates by increasing the pDelay value.

2) Use a separate application like vlc. This can open the mjpeg stream from a url and may have lower overhead than the browser.
Hi btidey,
thanks for your thoughts, especially for the hint to lower the framerate. This helps me lowering the cpu load when connecting from my pc. I was not aware that there are parameters possible. :o
Unfortunately it doesn't help me with my local Display. Calling cam_pic_new.php in the browser always pushes my cpu-load to 100%. Same with vlc :(
Only calling min.php with browser increases cpu-load only to 70-80%.
In all cases the image did not fit to the display, but I think I can adjust this when I've found the best way for the display.
Every browser and even vlc need an xserver for display and that costs performance. That's why I'd like to avoid an xserver.
Raspivid and omxplayer use the GPU of the RasPi directly and therefore need no xserver, but omxplayer sucks with this latency-issue and raspivid cannot open the camera device, because it's used by raspimjpeg.
I'd like to read more of your thoughts. :)

Return to “Camera board”