-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures #941
Comments
Width and height in your config don't match your camera resolution. |
Changed settings to match camera resolution as mentioned in Picamera documentation . mqtt:
host: test.mosquitto.org
cameras:
back:
ffmpeg:
inputs:
- path: rtsp://viewer:{FRIGATE_RTSP_PASSWORD}@10.0.10.10:554/cam/realmonitor?channel=1&subtype=2
roles:
- detect
- rtmp
width: 3280
height: 2464
fps: 15
detectors:
cpu1:
type: cpu
cpu2:
type: cpu
ffmpeg:
hwaccel_args:
- -c:v
- h264_mmal
logger:
default: debug
logs:
frigate.video: debug
I am still getting the same error . |
Remove your hwaccel args. If that works, then you don't have enough gpu_mem set for the Pi. You will need to increase it in config.txt, but it can only go so high. It may not go high enough for that high of a resolution. |
Update the config to remove hwaccel args as shown below. mqtt:
host: test.mosquitto.org
cameras:
back:
ffmpeg:
inputs:
- path: rtsp://viewer:{FRIGATE_RTSP_PASSWORD}@10.0.10.10:554/cam/realmonitor?channel=1&subtype=2
roles:
- detect
- rtmp
width: 3280
height: 2464
fps: 15
detectors:
cpu1:
type: cpu
cpu2:
type: cpu
logger:
default: debug
I still get the same error. I also tried minimum resolution of 640x480 at 60fps as shown in below config - mqtt:
host: test.mosquitto.org
cameras:
back:
ffmpeg:
inputs:
- path: rtsp://viewer:{FRIGATE_RTSP_PASSWORD}@10.0.10.10:554/cam/realmonitor?channel=1&subtype=2
roles:
- detect
- rtmp
width: 640
height: 480
fps: 60
detectors:
cpu1:
type: cpu
cpu2:
type: cpu
logger:
default: debug Still the problem persists. |
Is the rtsp url in the error message actually the right url for your camera? It seems like it's the default from the example config. It's trying to connect to your camera and failing. |
I am using my RPI Camera(ip 192.168.0.23) both as a source and sink for network stream. In 1st terminal , I start streaming out via raspivid - pi@raspberrypi:~ $ raspivid -o - -t 0 -rot 180 -w 1920 -h 1080 -fps 30 | cvlc -vvv stream:///dev/stdin --sout '#rtp{sdp=rtsp://:8554/cam/realmonitor}' :demux=h264 In 2nd terminal I start frigate via docker command - pi@raspberrypi:~ $ docker run --mount type=tmpfs,target=/tmp/cache,tmpfs-size=1000000000 --device /dev/bus/usb:/dev/bus/usb -v /home/pi/fri/media:/media/frigate -v /home/pi/fri/config.yml:/config/config.yml:ro -v /etc/localtime:/etc/localtime:ro -e FRIGATE_RTSP_PASSWORD='password' -p 5000:5000 -p 1935:1935 blakeblackshear/frigate:stable-armv7 Thanks for pointing it out for letting me check my rtsp url in my config file. mqtt:
host: test.mosquitto.org
cameras:
back:
ffmpeg:
inputs:
- path: rtsp://192.168.0.23:8554/cam/realmonitor
roles:
- detect
- rtmp
width: 1920
height: 1080
fps: 30
detectors:
cpu1:
type: cpu
cpu2:
type: cpu
logger:
default: debug However ffmpeg somehow still complains of broken frame.
However I test with a test rtsp stream available online as shown below, mqtt:
host: test.mosquitto.org
cameras:
back:
ffmpeg:
inputs:
- path: rtsp://freja.hiof.no:1935/rtplive/definst/hessdalen03.stream
roles:
- detect
- rtmp
width: 1920
height: 1080
fps: 30
detectors:
cpu1:
type: cpu
cpu2:
type: cpu
logger:
default: debug I don´t get the error - pi@raspberrypi:~ $ docker run --security-opt seccomp:unconfined --mount type=tmpfs,target=/tmp/cache,tmpfs-size=1000000000 --device /dev/bus/usb:/dev/bus/usb -v /home/pi/fri/media:/media/frigate -v /home/pi/fri/config.yml:/config/config.yml -v /etc/localtime:/etc/localtime:ro -e FRIGATE_RTSP_PASSWORD='password' -p 5000:5000 -p 1935:1935 blakeblackshear/frigate:stable-armv7
* Starting nginx nginx
...done.
Starting migrations
peewee_migrate INFO : Starting migrations
peewee DEBUG : ('CREATE TABLE IF NOT EXISTS "migratehistory" ("id" INTEGER NOT NULL PRIMARY KEY, "name" VARCHAR(255) NOT NULL, "migrated_at" DATETIME NOT NULL)', [])
peewee DEBUG : ('SELECT "t1"."id", "t1"."name", "t1"."migrated_at" FROM "migratehistory" AS "t1" ORDER BY "t1"."id"', [])
There is nothing to migrate
peewee_migrate INFO : There is nothing to migrate
frigate.mqtt INFO : MQTT connected
detector.cpu1 INFO : Starting detection process: 33
detector.cpu2 INFO : Starting detection process: 35
frigate.app INFO : Camera processor started for back: 38
frigate.app INFO : Capture process started for back: 39
frigate.http DEBUG : Received mqtt message on frigate/stats.
frigate.http DEBUG : Received mqtt message on frigate/stats.
frigate.http DEBUG : Received mqtt message on frigate/stats.
frigate.http DEBUG : Received mqtt message on frigate/stats.
frigate.http DEBUG : Received mqtt message on frigate/stats.
peewee DEBUG : ('SELECT DISTINCT "t1"."label" FROM "event" AS "t1" WHERE ("t1"."camera" NOT IN (?))', ['back'])
peewee DEBUG : ('SELECT DISTINCT "t1"."label" FROM "event" AS "t1" WHERE ("t1"."camera" = ?)', ['back'])
peewee DEBUG : ('SELECT DISTINCT "t1"."label" FROM "event" AS "t1" WHERE ("t1"."camera" NOT IN (?))', ['back'])
peewee DEBUG : ('SELECT DISTINCT "t1"."label" FROM "event" AS "t1" WHERE ("t1"."camera" = ?)', ['back'])
peewee.sqliteq DEBUG : received query with grouped_events as (
select id,
label,
camera,
has_snapshot,
has_clip,
row_number() over (
partition by label, camera, round(start_time/5,0)*5
order by end_time-start_time desc
) as copy_number
from event
)
select distinct id, camera, has_snapshot, has_clip from grouped_events
where copy_number > 1;
peewee DEBUG : ('with grouped_events as (\n select id,\n label, \n camera, \n \thas_snapshot,\n \thas_clip,\n \trow_number() over (\n partition by label, camera, round(start_time/5,0)*5\n order by end_time-start_time desc\n ) as copy_number\n from event\n )\n\n select distinct id, camera, has_snapshot, has_clip from grouped_events \n where copy_number > 1;', [])
peewee.sqliteq DEBUG : received query DELETE FROM "event" WHERE (0 = 1)
peewee DEBUG : ('DELETE FROM "event" WHERE (0 = 1)', [])
peewee.sqliteq DEBUG : received query DELETE FROM "event" WHERE (("event"."has_clip" = ?) AND ("event"."has_snapshot" = ?))
peewee DEBUG : ('DELETE FROM "event" WHERE (("event"."has_clip" = ?) AND ("event"."has_snapshot" = ?))', [False, False])
frigate.http DEBUG : Received mqtt message on frigate/stats.
frigate.http DEBUG : Received mqtt message on frigate/stats.
frigate.http DEBUG : Received mqtt message on frigate/stats. Stats also do not report anything wrong - {
"back": {
"camera_fps": 13.2,
"capture_pid": 39,
"detection_fps": 1.0,
"pid": 38,
"process_fps": 0.3,
"skipped_fps": 0.0
},
"detection_fps": 1.0,
"detectors": {
"cpu1": {
"detection_start": 0.0,
"inference_speed": 838.38,
"pid": 33
},
"cpu2": {
"detection_start": 0.0,
"inference_speed": 851.16,
"pid": 35
}
},
"service": {
"storage": {
"/dev/shm": {
"free": 54.1,
"mount_type": "tmpfs",
"total": 67.1,
"used": 13.0
},
"/media/frigate/clips": {
"free": 24133.3,
"mount_type": "ext4",
"total": 31083.6,
"used": 5651.8
},
"/media/frigate/recordings": {
"free": 24133.3,
"mount_type": "ext4",
"total": 31083.6,
"used": 5651.8
},
"/tmp/cache": {
"free": 1000.0,
"mount_type": "tmpfs",
"total": 1000.0,
"used": 0.0
}
},
"uptime": 502,
"version": "0.8.4-5043040"
}
} Maybe there is something wrong with my Raspi Cam V2 in the way I using it as a RTSP server. |
raspivid and vlc won't work. I tried it numerous times and never got it to see an image. I'm still trying to find something that will run on a raspberry pi and stream something that frigate will recognize |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I tried using rpi camera with v4l2rtspserver and it seems to work fine. I am using frigate on jetson nano with PCI coral card. |
Can you show me the settings you used to run? |
On RPI 3
on jetson nano where frigate is running:
|
Thank you!!! I finally got this working! |
@jdesai61 do you have hwaccell on? would you mind posting your config, I am struggling with my jetson nano. |
Here is my frigate config (I did not do anything explicit to turn hardware config on). What are the issues you are having?:
|
Ah ok, I am trying to get h264_nvmpi to work and though you were using it. |
I am using Coral TPU (non-USB M.2 E) on the Nano Details here: https://community.home-assistant.io/t/local-realtime-person-detection-for-rtsp-cameras/103107/4347 |
Ok so you are in the same situation as I am as it doesn't appear you have setup hwaccel. |
Coral won't help with encoding or decoding. But you should not need encoding. |
I'm a total noob when it comes to this so I said both. Yeah need to get hw encoding going, I created an issue we shall see how it goes. |
Try using the Home Assistant Add-on: Frigate NVR (Full Access) supervisor addon if you want to use hardware acceleration. |
@jdesai61 Do you happen to have an amazon link to the TPU you bought for the Nano that worked? I have the 4 gig and i thought its slot was already filled with the GPU daughter card. |
I did not order from Amazon. I ordered three items from seeedstudio.com. The one I used with Nano is first one (SKU 102110449) Coral M.2 Accelerator with Dual Edge TPU - SKU: 102110449 |
https://github.com/jdesai61
So your use all 3 of those devices? Can I ask your usage scenario? Personally I have Frigate doing basic person detection which sends the capture through MQTT to DeepStack and Double Take. But I’m using it for person and facial recognition DeepStack is running on the Nano, Double Take running as a Home Assistant add on with an i5 laptop, and Frigate running on an ESXi 7 server With 12 cores and 32 gigs of ram.
On Dec 29, 2021, at 1:16 PM, Jatin Desai ***@***.***> wrote:
I tried using rpi camera with v4l2rtspserver and it seems to work fine. I am using frigate on jetson nano with PCI coral card.
@jdesai61<https://github.com/jdesai61> Do you happen to have an amazon link to the TPU you bought for the Nano that worked? I have the 4 gig and i thought its slot was already filled with the GPU daughter card.
I did not order from Amazon. I ordered three items from seeedstudio.com. The one I used with Nano is first one (SKU 102110449)
Coral M.2 Accelerator with Dual Edge TPU - SKU: 102110449
Coral M.2 Accelerator A+E key - SKU: 114992123
Coral USB Accelerator - SKU: 114991790
—
Reply to this email directly, view it on GitHub<#941 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACGXNJEERPDFKL5VR2BVHPTUTNNANANCNFSM4Z47UCLA>.
You are receiving this because you commented.Message ID: ***@***.***>
|
I only use one Coral device (m2 dual edge) with frigate and six IP cameras. Other two coral devices are for experimental purposes. |
I was wondering where those extra TPUs were. I just got my hands on one the other day and put it on a RPi4 8gig. Only issue I currently have is that I’m getting an error if i try and install aarch64 or even the beta of the aarch64. So I’m basically running it under an arm7 kernel inside a 64 but docker container. I’m hoping that @blakeblackshear will eventually be able to put out a stable precompiled version. I’ve read some how to’s on ways you can compile your own version but I really don’t want to have to fork off and maintain my own copy.
Either way it’s working tons better now. So more cameras are going in. Currently have 5 streams recording full time to a NAS and then sends. The Frigate on the Pi4 with the TPU does the initial object recognition and then passes the info along to MQTT to DeepStack in the Nano and Hone Assistant on a different box. All in all it works very well seeing as 4 of the streams are wireless. I already have another doorbell camera and a few new ReoLink PoE cameras ready to install. All in all it was probably more expensive than buying a prebuilt Security Camera system. But this taught me a lot more and I’m not vendor locked nor paying subscription fees. Expect to Home Assistant just because I want to support them.
Blake also said that it’s possible to use multiple detectors, they just can’t be of the same type yet. But I could see a kubernets Pi cluster each with a TPU being pretty dam powerful for about the same price as a single server with less cores and ram.
On Jan 4, 2022, at 3:11 PM, Jatin Desai ***@***.***> wrote:
I only use one Coral device (m2 dual edge) with frigate and six IP cameras. Other two coral devices are for experimental purposes.
—
Reply to this email directly, view it on GitHub<#941 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACGXNJACQ5GNFEHEB74QU63UUNPBFANCNFSM4Z47UCLA>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Describe the bug
Unable to capture camera frames via ffmpeg on RPI 3B . On the webserver green color appears instead of actual camera frame
Version of frigate
0.8.4-5043040
Config file
Include your full config file wrapped in triple back ticks.
Frigate container logs
Frigate stats
FFprobe from your camera
Run the following command and paste output below
Screenshots
If applicable, add screenshots to help explain your problem.
Computer Hardware
Camera Info:
The text was updated successfully, but these errors were encountered: