frigate
frigate copied to clipboard
[Support]: FFMPEG not working after upgrade from 11.0.0-rc1 to 11.0.0-rc2
Describe the problem you are having
After updating to rc2 version the stream stoped working with the log "Cannot assign requested address". Downgrading to rc1 all works fine. Same problem with and without hwaccel_args.
Version
0.11.0-rc2
Frigate config file
cameras:
portao:
ffmpeg:
inputs:
- path: rtsp://user:[email protected]:554/stream2
roles:
- detect
- record
motion:
mask:
- 65,56,240,28,252,0,0,0,0,360,120,360,168,310
- 640,360,640,0,543,0,459,337,480,360
zones:
rua:
coordinates: 495,209,550,51,345,28,347,193
record:
retain:
days: 2
events:
retain:
default: 15
Relevant log output
2022-09-12 13:32:33] ffmpeg.portao.detect ERROR : [rtsp @ 0xc6e060] Unable to open RTSP for listening
[2022-09-12 13:32:33] ffmpeg.portao.detect ERROR : rtsp://user:[email protected]:554/stream2: Cannot assign requested address
FFprobe output from your camera
configuration: --prefix=/usr --extra-version=0+deb11u1 --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --arch=arm --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
[udp @ 0x2498330] attempted to set receive buffer to size 393216 but it only ended up set as 360448
[udp @ 0x24a86c0] attempted to set receive buffer to size 393216 but it only ended up set as 360448
[udp @ 0x24b93f0] attempted to set receive buffer to size 393216 but it only ended up set as 360448
[udp @ 0x24c9740] attempted to set receive buffer to size 393216 but it only ended up set as 360448
Input #0, rtsp, from 'rtsp://user:[email protected]:554/stream2':
Metadata:
title : Session streamed by "TP-LINK RTSP Server"
comment : stream2
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: h264 (High), yuvj420p(pc, bt709, progressive), 640x360, 15 fps, 28.58 tbr, 90k tbn, 30 tbc
Stream #0:1: Audio: pcm_alaw, 8000 Hz, 1 channels, s16, 64 kb/s
Frigate stats
No response
Operating system
Other Linux
Install method
Docker Compose
Coral version
CPU (no coral)
Network connection
Wired
Camera make and model
TPLINK Tapo
Any other information that may be helpful
No response
It looks like your cameras password may have a special character in it which is advised against as it can fail: https://docs.frigate.video/guides/getting_started#step-3-add-a-minimal-camera-configuration
Try making the password simple and see if that solves the issue.
Same issue with a simple password.
Where did you run ffprobe from, inside the container?
Can you prove a more complete log run instead of those 2 lines?
Yes, from the container.
[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.
[2022-09-12 19:42:29] frigate.app INFO : Starting Frigate (0.11.0-c461c9e)
[2022-09-12 19:42:30] frigate.app INFO : Creating directory: /tmp/cache
Starting migrations
[2022-09-12 19:42:30] peewee_migrate INFO : Starting migrations
There is nothing to migrate
[2022-09-12 19:42:30] peewee_migrate INFO : There is nothing to migrate
[2022-09-12 19:42:31] frigate.mqtt INFO : Turning on snapshots for portao via mqtt
[2022-09-12 19:42:31] frigate.mqtt INFO : Turning on snapshots for externa via mqtt
[2022-09-12 19:42:31] frigate.mqtt INFO : Turning on snapshots for varanda via mqtt
[2022-09-12 19:42:31] frigate.app INFO : Output process started: 211
[2022-09-12 19:42:31] detector.cpu1 INFO : Starting detection process: 210
[2022-09-12 19:42:31] frigate.edgetpu WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.
[2022-09-12 19:42:31] frigate.app INFO : Camera processor started for portao: 214
[2022-09-12 19:42:31] frigate.app INFO : Camera processor started for varanda: 217
[2022-09-12 19:42:31] ws4py INFO : Using epoll
[2022-09-12 19:42:31] frigate.app INFO : Camera processor started for externa: 219
[2022-09-12 19:42:31] frigate.app INFO : Capture process started for portao: 220
[2022-09-12 19:42:31] frigate.app INFO : Capture process started for varanda: 224
[2022-09-12 19:42:31] frigate.app INFO : Capture process started for externa: 229
[2022-09-12 19:42:32] ws4py INFO : Using epoll
[2022-09-12 19:42:32] frigate.video ERROR : portao: Unable to read frames from ffmpeg process.
[2022-09-12 19:42:32] frigate.video ERROR : portao: ffmpeg process is not running. exiting capture thread...
[2022-09-12 19:42:32] frigate.video ERROR : externa: Unable to read frames from ffmpeg process.
[2022-09-12 19:42:32] frigate.video ERROR : externa: ffmpeg process is not running. exiting capture thread...
[2022-09-12 19:42:32] frigate.video ERROR : varanda: Unable to read frames from ffmpeg process.
[2022-09-12 19:42:32] frigate.video ERROR : varanda: ffmpeg process is not running. exiting capture thread...
[2022-09-12 19:42:33] ws4py INFO : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:37898]
[2022-09-12 19:42:51] watchdog.portao ERROR : Ffmpeg process crashed unexpectedly for portao.
[2022-09-12 19:42:51] watchdog.portao ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-09-12 19:42:51] ffmpeg.portao.detect ERROR : [rtsp @ 0x224c060] Unable to open RTSP for listening
[2022-09-12 19:42:51] ffmpeg.portao.detect ERROR : rtsp://user:[email protected]:554/stream2: Cannot assign requested address
[2022-09-12 19:42:51] watchdog.varanda ERROR : Ffmpeg process crashed unexpectedly for varanda.
[2022-09-12 19:42:51] watchdog.varanda ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-09-12 19:42:51] ffmpeg.varanda.detect ERROR : [rtsp @ 0x15d8060] Unable to open RTSP for listening
[2022-09-12 19:42:51] ffmpeg.varanda.detect ERROR : rtsp://user:[email protected]:554/stream2: Cannot assign requested address
[2022-09-12 19:42:52] watchdog.externa ERROR : Ffmpeg process crashed unexpectedly for externa.
[2022-09-12 19:42:52] watchdog.externa ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-09-12 19:42:52] ffmpeg.externa.detect ERROR : [rtsp @ 0x971e70] Unable to open RTSP for listening
[2022-09-12 19:42:52] ffmpeg.externa.detect ERROR : rtsp://user:[email protected]:554/stream2: Cannot assign requested address
[2022-09-12 19:42:52] ffmpeg.externa.record_rtmp ERROR : [rtsp @ 0x18b7f80] Unable to open RTSP for listening
[2022-09-12 19:42:52] ffmpeg.externa.record_rtmp ERROR : rtsp://user:[email protected]:554/stream1: Cannot assign requested address
[2022-09-12 19:42:52] watchdog.externa INFO : Terminating the existing ffmpeg process...
[2022-09-12 19:42:52] watchdog.externa INFO : Waiting for ffmpeg to exit gracefully...
[2022-09-12 19:42:52] frigate.video ERROR : portao: Unable to read frames from ffmpeg process.
[2022-09-12 19:42:52] frigate.video ERROR : portao: ffmpeg process is not running. exiting capture thread...
[2022-09-12 19:42:52] frigate.video ERROR : varanda: Unable to read frames from ffmpeg process.
[2022-09-12 19:42:52] frigate.video ERROR : varanda: ffmpeg process is not running. exiting capture thread...
[2022-09-12 19:42:52] frigate.video ERROR : externa: Unable to read frames from ffmpeg process.
Thanks, can you please re-run your ffprobe with -rtsp_transport tcp
since that is what frigate uses by default.
Sure:
root@0e12d35a8bfe:/opt/frigate# ffprobe -rtsp_transport tcp rtsp://user:[email protected]:554/stream2
ffprobe version 4.3.4-0+deb11u1 Copyright (c) 2007-2021 the FFmpeg developers
built with gcc 10 (Debian 10.2.1-6)
configuration: --prefix=/usr --extra-version=0+deb11u1 --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --arch=arm --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
Input #0, rtsp, from 'rtsp://user:[email protected]:554/stream2':
Metadata:
title : Session streamed by "TP-LINK RTSP Server"
comment : stream2
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: h264 (High), yuvj420p(pc, bt709, progressive), 640x360, 15 fps, 29.92 tbr, 90k tbn, 30 tbc
Stream #0:1: Audio: pcm_alaw, 8000 Hz, 1 channels, s16, 64 kb/s
That's really weird, can you get the full ffmpeg command for that camera from the debug section of the frontend?
Really weird indeed. changed the log level to debug
root@0e12d35a8bfe:/opt/frigate# ffmpeg -hide_banner -loglevel debug -c:v h264_v4l2m2m -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://user:[email protected]:554/stream2 -r 2 -s 640x360 -f rawvideo -pix_fmt yuv420p pipe:
Splitting the commandline.
Reading option '-hide_banner' ... matched as option 'hide_banner' (do not show program banner) with argument '1'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'h264_v4l2m2m'.
Reading option '-avoid_negative_ts' ... matched as AVOption 'avoid_negative_ts' with argument 'make_zero'.
Reading option '-fflags' ... matched as AVOption 'fflags' with argument '+genpts+discardcorrupt'.
Reading option '-rtsp_transport' ... matched as AVOption 'rtsp_transport' with argument 'tcp'.
Reading option '-timeout' ... matched as AVOption 'timeout' with argument '5000000'.
Reading option '-use_wallclock_as_timestamps' ... matched as AVOption 'use_wallclock_as_timestamps' with argument '1'.
Reading option '-i' ... matched as input url with argument 'rtsp://user:[email protected]:554/stream2'.
Reading option '-r' ... matched as option 'r' (set frame rate (Hz value, fraction or abbreviation)) with argument '2'.
Reading option '-s' ... matched as option 's' (set frame size (WxH or abbreviation)) with argument '640x360'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'rawvideo'.
Reading option '-pix_fmt' ... matched as option 'pix_fmt' (set pixel format) with argument 'yuv420p'.
Reading option 'pipe:' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option hide_banner (do not show program banner) with argument 1.
Applying option loglevel (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input url rtsp://user:[email protected]:554/stream2.
Applying option c:v (codec name) with argument h264_v4l2m2m.
Successfully parsed a group of options.
Opening an input file: rtsp://user:[email protected]:554/stream2.
[tcp @ 0x1bfc020] No default whitelist set
[rtsp @ 0x1bf9e70] Unable to open RTSP for listening
rtsp://user:[email protected]:554/stream2: Cannot assign requested address
Okay, sorry for all the run around. Can you please try with the debug:
- Trying using UDP instead: https://docs.frigate.video/configuration/camera_specific#udp-only-cameras
- Try the debug without hwaccel
NP, thanks for the help
root@0e12d35a8bfe:/opt/frigate# ffmpeg -hide_banner -loglevel debug -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport udp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://user:[email protected]:554/stream2 -r 2 -s 640x360 -f rawvideo -pix_fmt yuv420p pipe:
Splitting the commandline.
Reading option '-hide_banner' ... matched as option 'hide_banner' (do not show program banner) with argument '1'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-avoid_negative_ts' ... matched as AVOption 'avoid_negative_ts' with argument 'make_zero'.
Reading option '-fflags' ... matched as AVOption 'fflags' with argument '+genpts+discardcorrupt'.
Reading option '-rtsp_transport' ... matched as AVOption 'rtsp_transport' with argument 'udp'.
Reading option '-timeout' ... matched as AVOption 'timeout' with argument '5000000'.
Reading option '-use_wallclock_as_timestamps' ... matched as AVOption 'use_wallclock_as_timestamps' with argument '1'.
Reading option '-i' ... matched as input url with argument 'rtsp://user:[email protected]:554/stream2'.
Reading option '-r' ... matched as option 'r' (set frame rate (Hz value, fraction or abbreviation)) with argument '2'.
Reading option '-s' ... matched as option 's' (set frame size (WxH or abbreviation)) with argument '640x360'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'rawvideo'.
Reading option '-pix_fmt' ... matched as option 'pix_fmt' (set pixel format) with argument 'yuv420p'.
Reading option 'pipe:' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option hide_banner (do not show program banner) with argument 1.
Applying option loglevel (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input url rtsp://user:[email protected]:554/stream2.
Successfully parsed a group of options.
Opening an input file: rtsp://user:[email protected]:554/stream2.
So based on that it seems that should be working in Frigate? (with UDP and no hwaccel), can you try it and post the logs?
I also just noticed [tcp @ 0x1bfc020] No default whitelist set
in your last one so I'll look into that.
sorry, I did not copy the last two lines of the log ..
root@0e12d35a8bfe:/opt/frigate# ffmpeg -hide_banner -loglevel debug -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport udp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://user:[email protected]:554/stream2 -r 2 -s 640x360 -f rawvideo -pix_fmt yuv420p pipe:
Splitting the commandline.
Reading option '-hide_banner' ... matched as option 'hide_banner' (do not show program banner) with argument '1'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-avoid_negative_ts' ... matched as AVOption 'avoid_negative_ts' with argument 'make_zero'.
Reading option '-fflags' ... matched as AVOption 'fflags' with argument '+genpts+discardcorrupt'.
Reading option '-rtsp_transport' ... matched as AVOption 'rtsp_transport' with argument 'udp'.
Reading option '-timeout' ... matched as AVOption 'timeout' with argument '5000000'.
Reading option '-use_wallclock_as_timestamps' ... matched as AVOption 'use_wallclock_as_timestamps' with argument '1'.
Reading option '-i' ... matched as input url with argument 'rtsp://user:[email protected]:554/stream2'.
Reading option '-r' ... matched as option 'r' (set frame rate (Hz value, fraction or abbreviation)) with argument '2'.
Reading option '-s' ... matched as option 's' (set frame size (WxH or abbreviation)) with argument '640x360'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'rawvideo'.
Reading option '-pix_fmt' ... matched as option 'pix_fmt' (set pixel format) with argument 'yuv420p'.
Reading option 'pipe:' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option hide_banner (do not show program banner) with argument 1.
Applying option loglevel (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input url rtsp://user:[email protected]:554/stream2.
Successfully parsed a group of options.
Opening an input file: rtsp://user:[email protected]:554/stream2.
[tcp @ 0x23faf60] No default whitelist set
[rtsp @ 0x23f8e70] Unable to open RTSP for listening
rtsp://user:[email protected]:554/stream2: Cannot assign requested address
Okay, with that being the case it seems there is something about your cameras RTSP server that this version of ffmpeg is not playing nice with. I think the best option would be using a different ffmpeg build / version from your host. See https://github.com/blakeblackshear/frigate/pull/3771
I tried to use the binaries from the last rc version but I got different erros ... Is there any problem with jellyfin ffmpeg build for arm? (it was working great for me). It seems that now its using the apt version.
It's not using apt, in the latest build we are using BtBn build as the jellyfin build had an issue that made it incompatible with rtsp-simple-server which is very common among frigate users.
Post the logs & docker config file when you tried jellyfin, also might be easier to try getting the apt version on your host and map that to Frigate.
You could also try docker pull crzynik/frigate:ffmpeg-update
(update your docker compose to use that image) it is the RC2 except it uses a newer BtBn build
Same issue, I think it is not using the btbn build:
root@3991d475bf09:/opt/frigate# whereis ffmpeg
ffmpeg: /usr/bin/ffmpeg /usr/share/ffmpeg
Runing the rc1 image:
root@6f85063c91ec:/opt/frigate# whereis ffmpeg
ffmpeg: /usr/lib/jellyfin-ffmpeg/ffmpeg
Wait hold on, are you using 32 bit arm?
Yes
I see, that makes sense then, I didn't realize that. There is no arm32 btbn build.
In that case can you provide the docker file and logs of trying to map jellyfin?
I think jellyfin builds tries to find the libs ont thpath/usr/lib/jellyfin-ffmpeg
. So it does not work just mount the executable on the /usr/lib/btbn-ffmpeg/bin
./ffmpeg: error while loading shared libraries: libzimg.so.2: cannot open shared object file: No such file or directory
Anyway, since ffmpeg is installed using apt-get it appears first on the path. I think the only way would be to make a change on the Dockerfile.
Right that's a fair point, the workaround won't work for arm32 which doesn't use btbn.
You'd still be able to do it, just need to overwrite whatever the apt path is with a docker volume.
You are right. Does it makes sense to use jellyfin just for arm32? Or maybe use the same binnaries as version 0.10?
You are right. Does it makes sense to use jellyfin just for arm32? Or maybe use the same binnaries as version 0.10?
I'm not sure if it does, the jellyfin requires a specific path and also has different behavior which might be difficult to support along with the btbn behavior. The previous 0.10 also used apt so it is likely just updated, and it'll have to be 5.0+ to match the other architectures.
Just curious, is there any reason you're running 32 bit? 64bit has been performing much better in my usage, and hwaccel and ffmpeg in general is better supported for it with the 0.11 RC2
I think I had some issues running raspian 64 bits and docker when I started using the rpi4. Maybe is time to update. Thanks for the help @NickM-27. I think will try to use the 64 bit next week.
one thing : I had the same issue because of the parameter timeout in input_args I did this (just remove timeout from the default input_args and it worked
input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -use_wallclock_as_timestamps 1
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.