motioneye-project / motioneyeos

A Video Surveillance OS For Single-board Computers
Other
7.87k stars 900 forks source link

Request for Wiki Page on "Movie Passthrough" for Standard Raspberry Pi's #2739

Closed BigGremlin closed 2 years ago

BigGremlin commented 3 years ago

Preliminary Docs

I confirm that I have read the CONTRIBUTING guide before opening this issue.

I confirm that I have read the FAQ before opening this issue.

motionEyeOS Version

I am running motionEyeOS version: 20200606

Board Model

I am using the Raspberry PI 3B+

Camera

I am using the following type of camera: Raspberry Pi Camera Module V2 setup as a MMAL Camera.

Network Connection

My motionEyeOS unit is connected to the network via: WiFi.

Peripherals

I am not using any peripherals that I consider relevant to this issue:

Log Files

I consider the following log files relevant to this issue:

None


Hi,

I've been tearing my hair out trying to get movie_passthrough going on my standard Raspberry Pi setup.

This is such a powerful feature that makes simple Raspberry Pi's (hopefully including the zero) super powerful security cameras.

I have been using a Raspberry Pi 3 for a year now as a security camera and only getting 1 frame per second. (full resolution). (With motion detection).

I am recording to the individual Pi and want to continue doing that.

Unless movie_passthrough can't be done on a standard Raspberry Pi as above, then can we say so in setup guide? :-)

I'd be happy to update the documents once this issue has received good responses.

Thanks in advance for comments!!!

Greg

starbasessd commented 3 years ago

2 things: 1) what would you add/change from the tool tip blurb (if you point your mouse to the ? to the right of the option) 2) in motionEyeOS, there is a setting for "Fast Network Camera" in Expert Settings for the CSI camera which gives you the best frame rates on any of the SBCs by disabling or offloading most of the extra features. Most of the SBCs (especially the lower CPU ones) struggle with all they are doing, especially in higher resolutions. On my setups, I get the best results with 800x600 or 1280x720 at about 15 - 20 FPS per camera. If I switch my camera to "FNC" I can offload the motion detection and processing to my production PC (i5 M73 TFF), but I regularly build fresh machines on Pi2, Pi3b, Pi3b+, and various Pi4s (2GB, 4GB, 8GB). I never get 'great' frame rates, but I'm not paying $500-$1500 or more for commercial setups.

BigGremlin commented 3 years ago

Thanks @starbasessd . I do want to record to the Pi, not sending the stream over the network, and I also want Motion Detection. A while back I read it was possible, sorry I'm no CCTV expert. Do we need a 2nd stream running to do the Motion Detection on? I think that stream was worse than default for motion detection, but still doable?

starbasessd commented 3 years ago

"Do we need a 2nd stream running to do the Motion Detection on?" No. In fact that will slow down the system tremendously. You can turn off video streaming by sliding the toggle off on the Section Title Bar, which will reduce the load slightly. Yes, motion detection is one of the reasons motionEye/motionEyeOS exists. If you are trying to do motion detection on a 1280x720 image, it is a lot more capable than 1920x1080 image, on any Pi. If you want to do recording by motion detection, on the CSI / MMAL camera, I'd start at 1280x720 and increase in stages. Do not use Movie Pass through, especially if you want/need timestamps. Select MP4 or H264 or MP4/OMX or H264/OMX, whichever gives you best results. If you don't need Still Images, turn them off. Use a USB Thumb Drive or external USB SSD. If you want to try it, dev20201026 supports boot to USB on Pi3b, Pi3B+, and Pi4s 1GB-4GB and gives a good performance increase. I do so when testing Pi4s with a USB3 thumb drive. You should 'play' with the parameters to give your self a feel for what affects you most.

BigGremlin commented 3 years ago

Thanks again @starbasessd

OK, good, no 2nd stream needed. OK motion detection better on 1280 x 720, fine.

I have video streaming off, I don't want to send over the network.

I do really, really want movie_passthrough. I've never had that working! I'm happy to not have timestamps or other overlaid information. I want the full resolution and frame rate through the Pi's hardware encoding. Am I missing something or can movie_passthrough not be done on this system?

Thanks!

Greg

starbasessd commented 3 years ago

IIRC movie passthrough takes an inbound stream from a network camera and doesn't do any conversion, just records it and motion detects. @jasaw might need to correct me...

BigGremlin commented 3 years ago

I've been investigating/testing myself. I now have just Motion on a Pi Zero. (Standard Raspberry Camera V2). This is is the setup I ideally want.

It seems video_passthrough does want to work.

The v4l2_palette 21 (H264) doesn't seem to work but pallet 8 (MJPEG) does.

The problem looks to be when ffmpeg tries to write the header, it gets an invalide argument??

[1:ml1] [ERR] [ENC] ffmpeg_set_outputfile: Could not write ffmpeg header Invalid argument

I have attached the output from motion to this comment.

So now just need to work out what's going wrong there.

netcam plus vl2 pal 8.txt

I do use the parameter netcam_url v4l2:///dev/video0

starbasessd commented 3 years ago

Issues with motion need to brought up with motion-project: https://github.com/Motion-Project/motion/issues

BigGremlin commented 3 years ago

I was waiting for someone to say that. They'll say MotionEyeOs; Raspberry Pi Zero issues need to be brought up with MotionEyeOs-project.

https://github.com/ccrisan/motioneyeos

I am trying to get this (movie_passthrough) working with MotionEyeOs and the most standard of hardware (Raspberry Pi [Zero])

starbasessd commented 3 years ago

MotionEyeOS Wiki page: https://github.com/ccrisan/motioneyeos/wiki Right hand, down near the bottom: Report An Issue: Report Motion Issue: https://github.com/ccrisan/motioneyeos/wiki/Report-Motion-Issue You can also do the RaspberryPiOS Lite, and just install motion. (be sure to use the same version as what's being used in your motionEyeOS). See install instructions on: https://github.com/ccrisan/motioneyeos/wiki/Report-Motion-Issue You can also confirm the same issues on other hardware and OSs. Not 'finger pointing', just trying to get to the root of the issue, and YOU are saying its an issue when you program motion itself, directly.

starbasessd commented 3 years ago

Are you leaving this open until Motion-Project responds?

BigGremlin commented 3 years ago

I'd like a bit more feedback. I'm sure the Pis can be setup as questioned. If it does need some more work down at the motion level, it will still need sorting at the motioneyeos level. I've started investigating at the motion level and might be able to find something there. Articles like this just scream "it can be done" https://www.reddit.com/r/raspberry_pi/comments/5677qw/hardware_accelerated_x264_encoding_with_ffmpeg/

BigGremlin commented 3 years ago

Just came across this excellent project: RPi-Cam-Web-Interface. I might be able to pull out what's needed from that.

RPiCamArchitecture

starbasessd commented 2 years ago

No response in more than 60 days. If you are still having issues, please open a new issue.