SecurityCamera icon indicating copy to clipboard operation
SecurityCamera copied to clipboard

Live streaming cannot be viewed on an iOS mobile browser

Open sayidhe opened this issue 2 years ago • 34 comments

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.

sayidhe avatar Aug 10 '23 06:08 sayidhe

hi @sayidhe , is the detector functionality is working?

mohan51 avatar Aug 10 '23 06:08 mohan51

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

mohan51 avatar Aug 10 '23 06:08 mohan51

Hi @mohan51 , it works fine on my machine:

  • Raspberry Pi 4B
  • RS/E14 Camera V2
  • Raspbian OS Lite

sayidhe avatar Aug 10 '23 06:08 sayidhe

@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 avatar Aug 10 '23 06:08 mohan51

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

mohan51 avatar Aug 10 '23 06:08 mohan51

and i am using arducam and raspberrypi 4 and raspbian os

mohan51 avatar Aug 10 '23 06:08 mohan51

@mohan51 Which ffmpeg path are you use?

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

  • "ffmpeg_path": "/usr/bin/ffmpeg",

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:

  • "ffmpeg_path": "/usr/local/bin/ffmpeg"

sayidhe avatar Aug 10 '23 06:08 sayidhe

@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 avatar Aug 10 '23 06:08 mohan51

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

@sayidhe

mohan51 avatar Aug 10 '23 06:08 mohan51

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

sayidhe avatar Aug 10 '23 06:08 sayidhe

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

@sayidhe

mohan51 avatar Aug 10 '23 06:08 mohan51

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

sayidhe avatar Aug 10 '23 06:08 sayidhe

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

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

@sayidhe

mohan51 avatar Aug 10 '23 06:08 mohan51

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.

sayidhe avatar Aug 10 '23 06:08 sayidhe

ok will try and get back to you

mohan51 avatar Aug 10 '23 06:08 mohan51

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

sayidhe avatar Aug 10 '23 06:08 sayidhe

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

yes.. when i connected to same network

mohan51 avatar Aug 10 '23 06:08 mohan51

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

mohan51 avatar Aug 10 '23 06:08 mohan51

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

mohan51 avatar Aug 10 '23 06:08 mohan51

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.

sayidhe avatar Aug 10 '23 06:08 sayidhe

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

mohan51 avatar Aug 10 '23 06:08 mohan51

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

sayidhe avatar Aug 10 '23 07:08 sayidhe

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

mohan51 avatar Aug 10 '23 07:08 mohan51

it started streaming but unable to detect the movements

@sayidhe

mohan51 avatar Aug 10 '23 07:08 mohan51

@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
...
...
...

sayidhe avatar Aug 10 '23 09:08 sayidhe

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 avatar Aug 10 '23 09:08 mohan51

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

mohan51 avatar Aug 10 '23 09:08 mohan51

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

  • "ffmpeg_path": "/usr/local/bin/ffmpeg"

sayidhe avatar Aug 10 '23 09:08 sayidhe

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

detects every movement? with default config settings

mohan51 avatar Aug 10 '23 09:08 mohan51

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

mohan51 avatar Aug 10 '23 10:08 mohan51