Closed Larosen closed 2 years ago
Your camera resolution AND fps don't match and that's because you didn't specify it My Camera rtsp output is 1024 x 768 with 20fps So that's what is specified in the config file
Example of my config:
ffmpeg:
input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -stimeout 5000000 -use_wallclock_as_timestamps 1
output_args:
record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -codec:a aac
hwaccel_args:
- -hwaccel
- vaapi
- -hwaccel_device
- /dev/dri/renderD128
- -hwaccel_output_format
- yuv420p
inputs:
- path: rtsp://xxx:xxx@192.168.0.92:554/Streaming/Channels/103
roles:
- detect
- rtmp
detect:
width: 1280
height: 720
fps: 20
ffprobe isn't telling the FPS so i think you've set the fps to variable in the cam. I had that problem too! I had to switch to a the 3rd substream of the my camera to get it working and get rid of the error and green screens
I changed the FPS to static and checked that the resolution now matches. Unfortunately, the same error still comes through.
Some of these errors are because you are telling ffmpeg to use hwaccel for h264, but your camera stream is set to mjpeg. Either switch to h264 or remove the hwaccel args. You can't have both.
Some of these errors are because you are telling ffmpeg to use hwaccel for h264, but your camera stream is set to mjpeg. Either switch to h264 or remove the hwaccel args. You can't have both.
Thanks for the reply. This was the issue for the Annke Camera! But the other "camera_1" with H.264 was still not working. Therefore I was trying to move from global settings to settings per camera. Somehow I broke it with the message "Config Validation Errors 'inputs'" Is one of the inputs arguments in the wrong line or what is wrong here?
cameras:
camera_1: # <------ Name the camera
ffmpeg:
input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -stimeout 5000000 -use_wallclock_as_timestamps 1
output_args:
record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -codec:a aac
hwaccel_args:
- -hwaccel
- vaapi
- -hwaccel_device
- /dev/dri/renderD128
- -hwaccel_output_format
- yuv420p
inputs:
- path: rtsp://*****:*****@10.20.60.27:554 # <----- Update for your camera
roles:
- detect
- rtmp
detect:
width: 1920
height: 1080
fps: 10
mqtt:
enabled: True
timestamp: True
bounding_box: True
crop: True
height: 270
quality: 70
Annke_C800:
ffmpeg:
input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -stimeout 5000000 -use_wallclock_as_timestamps 1
output_args:
record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -codec:a aac
rtmp:
enabled: False
inputs:
- path: rtsp://******:******@10.20.60.87:554/Streaming/Channels/102
roles:
- detect
- rtmp
detect:
width: 640
height: 480
fps: 4
objects:
track:
- person
- cat
- dog
- bicycle
- mouse
- cell phone
mqtt:
enabled: True
timestamp: True
bounding_box: True
crop: True
height: 270
quality: 70
record: # <----- Enable recording
enabled: True
snapshots: # <----- Enable snapshots
enabled: True
record:
enabled: True
retain_days: 0
events:
retain:
default: 30
What does ffprobe for that camera say? Ffmpeg says it is getting invalid data.
What does ffprobe for that camera say? Ffmpeg says it is getting invalid data.
ffprobe version 2021-11-03-git-08a501946f-essentials_build-www.gyan.dev Copyright (c) 2007-2021 the FFmpeg developers
built with gcc 11.2.0 (Rev1, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
libavutil 57. 7.100 / 57. 7.100
libavcodec 59. 12.100 / 59. 12.100
libavformat 59. 8.100 / 59. 8.100
libavdevice 59. 0.101 / 59. 0.101
libavfilter 8. 16.101 / 8. 16.101
libswscale 6. 1.100 / 6. 1.100
libswresample 4. 0.100 / 4. 0.100
libpostproc 56. 0.100 / 56. 0.100
rtsp://***:****@10.20.60.27:554: Invalid data found when processing input
Does this mean that this noname camera from China is not compatible? When I open the Rtsp link in VLC, I see a livestream and also hear the audio.
When you open in VLC, what do you see under "Tools > Codec Information"?
When you open in VLC, what do you see under "Tools > Codec Information"?
yesterday at noon the camera had 10 FPS and today it's 20, so it must have a dynamic setting that can't be changed because the camera doesn't offer any adjustment options.
Does it work without hwaccel args?
Does it work without hwaccel args?
Unfortunately not. Without all hwaccel args still came the message that "ffmpeg sent a broken frame." So I tried to add hwaccel only on one camera. Thereby I have to say that with the current configuration nothing works at all. It comes only the message " Config Validation Errors 'inputs'".
I think there are one or two spaces too many somewhere or?
cameras:
camera_1: # <------ Name the camera
ffmpeg:
input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -stimeout 5000000 -use_wallclock_as_timestamps 1
output_args:
record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -codec:a aac
hwaccel_args:
- -hwaccel
- vaapi
- -hwaccel_device
- /dev/dri/renderD128
- -hwaccel_output_format
- yuv420p
inputs:
- path: rtsp://*****:*****@10.20.60.27:554 # <----- Update for your camera
roles:
- detect
- rtmp
detect:
width: 1920
height: 1080
fps: 10
mqtt:
enabled: True
timestamp: True
bounding_box: True
crop: True
height: 270
quality: 70
Annke_C800:
ffmpeg:
input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -stimeout 5000000 -use_wallclock_as_timestamps 1
output_args:
record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -codec:a aac
rtmp:
enabled: False
inputs:
- path: rtsp://******:******@10.20.60.87:554/Streaming/Channels/102
roles:
- detect
- rtmp
detect:
width: 640
height: 480
fps: 4
objects:
track:
- person
- cat
- dog
- bicycle
- mouse
- cell phone
mqtt:
enabled: True
timestamp: True
bounding_box: True
crop: True
height: 270
quality: 70
record: # <----- Enable recording
enabled: True
snapshots: # <----- Enable snapshots
enabled: True
record:
enabled: True
retain_days: 0
events:
retain:
default: 30
What is the error message for an invalid config?
What is the error message for an invalid config?
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[2021-11-06 17:35:24] frigate.app INFO : Starting Frigate (0.9.4-26ae608)
*************************************************************
*************************************************************
*** Your config file is not valid! ***
*** Please check the docs at ***
*** https://docs.frigate.video/configuration/index ***
*************************************************************
*************************************************************
*** Config Validation Errors ***
*************************************************************
'inputs'
*************************************************************
*** End Config Validation Errors ***
*************************************************************
[cmd] python3 exited 1
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
For the C800 camera, you have inputs nested under rtmp instead of ffmpeg.
For the C800 camera, you have inputs nested under rtmp instead of ffmpeg.
Ah, thank you very much! I didn't know that RTMP must not be subordinate to ffmpeg. Now the add-on works again and I have played around with the configuration.
In the configuration posted above with RTMP fixed, it pulls up with as an error:
[2021-11-07 11:52:50] frigate.app INFO : Camera processor started for camera_1: 219
[2021-11-07 11:52:50] ws4py INFO : Using epoll
[2021-11-07 11:52:50] detector.coral INFO : Starting detection process: 216
[2021-11-07 11:52:50] frigate.app INFO : Capture process started for camera_1: 223
[2021-11-07 11:52:50] ws4py INFO : Using epoll
[2021-11-07 11:52:52] frigate.video INFO : camera_1: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-07 11:52:52] frigate.video INFO : camera_1: ffmpeg process is not running. exiting capture thread...
[2021-11-07 11:53:10] watchdog.camera_1 ERROR : FFMPEG process crashed unexpectedly for camera_1.
[2021-11-07 11:53:10] watchdog.camera_1 ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
[2021-11-07 11:53:10] watchdog.camera_1 ERROR : You may have invalid args defined for this camera.
[2021-11-07 11:53:10] ffmpeg.camera_1.detect ERROR : rtsp://****:****@10.20.60.27:554: Invalid data found when processing input
I then tested 2 other variants, but they delivered the same error 1:1:
camera_1:
#Removed in second pass -> rtmp:
#Removed in second pass -> enabled: False
ffmpeg:
input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -stimeout 5000000 -use_wallclock_as_timestamps 1
output_args:
record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -codec:a aac
inputs:
- path: rtsp://*****:****@10.20.60.27:554 # <----- Update for your camera
roles:
- detect
- rtmp
detect:
width: 1920
height: 1080
fps: 5
mqtt:
enabled: True
timestamp: True
bounding_box: True
crop: True
height: 270
quality: 70
[2021-11-07 12:04:45] ws4py INFO : Using epoll
[2021-11-07 12:04:45] frigate.video INFO : camera_1: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-07 12:04:45] frigate.video INFO : camera_1: ffmpeg process is not running. exiting capture thread...
Is there anything else I need to remove so that camera_1 might work?
I would leave rtmp disabled until you get it working. The error message says ffmpeg got invalid data from your camera.
I have same problem. Tried all possible combinations with no luck. I am using https://github.com/jdillenkofer/camera_proxy for reolink cameras.
@pepsinio This is a common error message. Your issue is likely different. Please open your own issue.
@blakeblackshear i looked into it and i have same stream characteristics (mjpeg with h.264) . it can be different, but overall sounds very simmilar
I would leave rtmp disabled until you get it working. The error message says ffmpeg got invalid data from your camera.
Thanks, that's what I did now. I will just replace this camera (hopefully after Black Friday). I am quite impressed how well the detection works during day. I am just a bit surprised, that I am not able to capture the newspaper guy at around 4-5 am in the morning. He seems to be invisible. Even cats get detected during night but not this guy. :D
If you can provide a video clip, I can do some testing. Upcoming beta will have better motion detection at night.
Were you able to get this working? My Frigate is broke now that I updated and I cant get it working again for the life of me.
rtsp://admin:NotMyPassword@172.30.16.249:554/cam/realmonitor?channel=1&subtype=1&unicast=true&proto=Onvif
I'm using this I can see my camera clearly in VLC at a loss here regret updating...
``
If you can provide a video clip, I can do some testing. Upcoming beta will have better motion detection at night.
@freitagbilly you should open your own issue
Were you able to get this working? My Frigate is broke now that I updated and I cant get it working again for the life of me.
rtsp://admin:NotMyPassword@172.30.16.249:554/cam/realmonitor?channel=1&subtype=1&unicast=true&proto=Onvif
I'm using this I can see my camera clearly in VLC at a loss here regret updating...
``
No, this camera is simply not compatible. I tried a few other configurations and then just excluded this camera and only used the 8MP H.265 camera.
Describe the problem you are having
This is a new Frigate installation. I have already read a lot in old problems in the last few weeks and know that the Annke camera can only do H.265. Therefore I have to use:
Nevertheless, I have an error in there somewhere that all streams, no matter if H264 or H265 have the error "ffmpeg sent a broken frame". Apparently I have "invalid args defined for this camera." somewhere, but unfortunately I can't find it. If someone could help me, I would be very grateful.
Version
2.3 as Home Assistant Add On in VMM on DSM 7.0.1
Frigate config file
Relevant log output
FFprobe output from your camera
Frigate stats
Operating system
HassOS
Install method
HassOS Addon
Coral version
USB
Network connection
Wired
Camera make and model
Annke C800, IPC360
Any other information that may be helpful
Host: Synology 920+ DSM 7.0.1