Ruud14 / SecurityCamera

A Raspberry Pi camera system with a live video feed, motion detection system, H.264 mp4 recording capabilities and a storage management system with support for remote storage. The recorder supports pre-motion frame recording and no internet environments (e.g. Wildlife cameras).
MIT License
71 stars 10 forks source link

Live streaming cannot be viewed on an iOS mobile browser #12

Open sayidhe opened 1 year ago

sayidhe commented 1 year ago

Try the address http://<local_pi_ip>:8000/index.html on iOS mobile browser both Chrome and Safari, only the play button on it, can not fetch the live streaming. But the link works fine on desktop browser.

mohan51 commented 1 year ago

hi @sayidhe , is the detector functionality is working?

mohan51 commented 1 year ago

@sayidhe because whenever i am executing the main.py it is not detecting anything

sayidhe commented 1 year ago

Hi @mohan51 , it works fine on my machine:

mohan51 commented 1 year ago

@sayidhe we are also working on the same board but we are unable to detect ? have you done any changes in main.py or detector code?

mohan51 commented 1 year ago

and also in django frame work which path are you giving at the time of camera addition? is it http://:8000/index.html or http://:8000/stream.mpeg?

mohan51 commented 1 year ago

and i am using arducam and raspberrypi 4 and raspbian os

sayidhe commented 1 year ago

@mohan51 Which ffmpeg path are you use?

When I use sudo apt install ffmpeg, the ffmpeg_path setting in config.json line is:

If you follow the step to install and make the ffmpeg as Install ffmpeg with h.264 support, then just keep the same in config.json as:

mohan51 commented 1 year ago

@sayidhe I used sudo apt install ffmpeg only and set the path to "ffmpeg_path": "/usr/bin/ffmpeg", in config.json and also in recorder.py

mohan51 commented 1 year ago

and also in django frame work which path are you giving at the time of camera addition? is it http://:8000/index.html or http://:8000/stream.mpeg?

@sayidhe

sayidhe commented 1 year ago

In django frame work, I use http://<pi_address>:8000/index.html in the camera url

mohan51 commented 1 year ago

what type of detections it is detecting? and also is it also sending recordings???

@sayidhe

sayidhe commented 1 year ago

Can you see the live streaming, but can't detect anything? @mohan51

mohan51 commented 1 year ago

Can you see the live streaming, but can't detect anything? @mohan51

yes.and also the recordings i am not able to get.

@sayidhe

sayidhe commented 1 year ago

One thing, I use latest version of python and remove the packages version number in requirements.txt, like below

chardet
numpy
picamera
python-apt
requests
six
ssh-import-id
tornado
urllib3

Others just keep the same.

mohan51 commented 1 year ago

ok will try and get back to you

sayidhe commented 1 year ago

Can you view the live streaming on the mobile browser? @mohan51

mohan51 commented 1 year ago

Can you view the live streaming on the mobile browser? @mohan51

yes.. when i connected to same network

mohan51 commented 1 year ago

what actually it detects? it will detects everything?i am every movement?

mohan51 commented 1 year ago

@sayidhe for python-apt installation i am getting error?

sayidhe commented 1 year ago

There are some lines in the config.json which controls the detector

 "detector_motion_threshold": 20,
 "record_seconds_before_motion": 5,
 "record_seconds_after_motion": 12,
 "max_recording_seconds": 600,
mohan51 commented 1 year ago

There are some lines in the config.json which controls the detector

 "detector_motion_threshold": 20,
 "record_seconds_before_motion": 5,
 "record_seconds_after_motion": 12,
 "max_recording_seconds": 600,
  • detector_motion_threshold: Threshold for detecting motion. The higher this number, the less motion is detected.
  • record_seconds_before_motion: The amount of seconds that will be recorded before motion is detected.
  • record_seconds_after_motion: The amount of seconds that will be recorded after motion.
  • max_recording_seconds: The maximum duration of a recording in seconds.

yeah i saw the lines and adjusted to my requirement but still unable to record or detect the motion

sayidhe commented 1 year ago

Do you have read, write and execute permission of the folder?

mohan51 commented 1 year ago

i cloned in to my pc and working on the changes ..but for testing i used the same config file MicrosoftTeams-image

mohan51 commented 1 year ago

it started streaming but unable to detect the movements

@sayidhe

sayidhe commented 1 year ago

@mohan51 Below is my output

Motion detector started successfully!
Streamer started on http://192.168.*.*:8000
Started recording /home/pi/SecurityCamera/./temp_recordings/16-54-29
ffmpeg version git-2023-08-08-9583a2c Copyright (c) 2000-2023 the FFmpeg developers
...
...
...
mohan51 commented 1 year ago

ffmpeg version git-2023-08-08-9583a2c Copyright (c) 2000-2023 the FFmpeg developers

i am not getting this line...do you have any idea?

@sayidhe

mohan51 commented 1 year ago

I downloaded ffmpeg using this steps https://phoenixnap.com/kb/install-ffmpeg-ubuntu

sayidhe commented 1 year ago

I followed this one Install ffmpeg with h.264 support and keep ffmpeg_path like:

mohan51 commented 1 year ago

what actually it detects? it will detects everything?i am every movement?

detects every movement? with default config settings

mohan51 commented 1 year ago

i am done with installation.then how can i know the path of ffmpeg?how to known whether it is working or not? when i execute "which ffmpeg". it is not showing anything

@sayidhe

sayidhe commented 1 year ago

Normally it is in "/usr/local/bin/ffmpeg", when you make and install. You can check with

whereis ffmpeg

mohan51 commented 1 year ago

Started recording /home/pi/SecurityCamera/./temp_recordings/16-54-29 ffmpeg version git-2023-08-08-9583a2c Copyright (c) 2000-2023 the FFmpeg developers

these two lines are not coming for me.i tried the way you installed ffmpeg.and it installed successfully but the above two lines are not coming

sayidhe commented 1 year ago

Do you have read, write and execute permission of the folder?

@mohan51 Not sure if the above issue, you can try to changing the ownership of a folder to pi user, and run the script again.

sudo chown pi:pi -R /home/pi/SecurityCamera

Otherwise, try to re-install the OS, then follow the installation-guide

Ruud14 commented 1 year ago

Hi @sayidhe, Thanks for reporting.

I tried viewing the stream on safari iOS and I indeed cannot see the camera stream.

I'll mark this as a bug and look more into it.