Skip to content
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

[Support]: AMD64, Coral M.2 , Docker, updated to stable 11 and getting "Unable to read frames from ffmpeg process." #3909

Closed
Vendo232 opened this issue Sep 23, 2022 · 22 comments

Comments

@Vendo232
Copy link

Vendo232 commented Sep 23, 2022

Describe the problem you are having

After an update from 10.1 stable to 11 stable getting green screen and log is showing this comment.
my path looks OK
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/btbn-ffmpeg/bin
added the LIBVA_DRIVER_NAME=i965 into the environemnt, no help

[2022-09-23 08:53:11] frigate.video ERROR : driveway: Unable to read frames from ffmpeg process.
[2022-09-23 08:53:11] frigate.video ERROR : driveway: ffmpeg process is not running. exiting capture thread...
[2022-09-23 08:53:31] ffmpeg.driveway.detect ERROR : Error splitting the argument list: Option not found

Version

0.11.0-3846A13

Frigate config file

detectors:
  coral_pci:
    type: edgetpu
    device: pci

mqtt:
  host: 192.168.1.128
  port: 1883
  topic_prefix: frigate
  user: 
  password: 

ffmpeg:
  hwaccel_args:
    - -hwaccel
    - qsv
    - -qsv_device
    - /dev/dri/renderD128
  global_args: -hide_banner -loglevel fatal
  input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -stimeout 5000000 -use_wallclock_as_timestamps 1
  output_args:
    detect: -f rawvideo -pix_fmt yuv420p
    record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an
    rtmp: -c copy -f flv

cameras:
  Front_Door_Wyze:
    ffmpeg:
      input_args: -avoid_negative_ts make_zero
      inputs:
        - path: rtsp://*:*@192.168.1.174:8554/video2_unicast
          roles:
            - detect
            - rtmp
        - path: rtsp://*:*@192.168.1.174:8554/video1_unicast
          roles:
            - record
    detect:
      width: 640
      height: 360
      fps: 5
    record:
      enabled: True
      retain:
        days: 0
        mode: active_objects
      events:
        retain:
          default: 10
          mode: active_objects
          objects:
            person: 15
    objects:
      track:
        - person
    snapshots:
      enabled: True
      timestamp: True
      bounding_box: False
      crop: False
      retain:
        default: 10
        objects:
          person: 15

  driveway:
    ffmpeg:
      inputs:
        - path: rtsp://*:*@192.168.1.11:554/cam/realmonitor?channel=1&subtype=1
          roles:
            - detect
            - rtmp
        - path: rtsp://*:*@192.168.1.11:554/cam/realmonitor?channel=1&subtype=0
          roles:
            - record
    detect:
      width: 704
      height: 480
      fps: 5
    record:
      enabled: True
      retain:
        days: 0
        mode: active_objects
      events:
        retain:
          default: 10
          mode: active_objects
          objects:
            person: 15
    objects:
      track:
        - person
        - car
      filters:
        person:
          mask: 1703,315,1662,368
    snapshots:
      enabled: True
      timestamp: True
      bounding_box: False
      crop: False
      retain:
        default: 10
        objects:
          person: 15

  Garage:
    ffmpeg:
      input_args: -avoid_negative_ts make_zero
      inputs:
        - path: rtsp://*:*@192.168.1.3:8554/video2_unicast
          roles:
            - detect
            - rtmp
        - path: rtsp://*:*@192.168.1.3:8554/video1_unicast
          roles:
            - record

Relevant log output

2022-09-23 08:53:10] frigate.app                    INFO    : Output process started: 217
[2022-09-23 08:53:10] ws4py                          INFO    : Using epoll
[2022-09-23 08:53:11] frigate.app                    INFO    : Camera processor started for Front_Door_Wyze: 225
[2022-09-23 08:53:11] frigate.app                    INFO    : Camera processor started for driveway: 228
[2022-09-23 08:53:10] frigate.edgetpu                INFO    : Attempting to load TPU as pci
[2022-09-23 08:53:11] frigate.app                    INFO    : Camera processor started for Garage: 240
[2022-09-23 08:53:11] frigate.edgetpu                INFO    : TPU found
[2022-09-23 08:53:11] frigate.app                    INFO    : Camera processor started for Backyard_V3: 242
[2022-09-23 08:53:11] frigate.app                    INFO    : Camera processor started for front_door_bell: 243
[2022-09-23 08:53:11] frigate.app                    INFO    : Capture process started for Front_Door_Wyze: 245
[2022-09-23 08:53:11] frigate.app                    INFO    : Capture process started for driveway: 247
[2022-09-23 08:53:11] frigate.app                    INFO    : Capture process started for Garage: 258
[2022-09-23 08:53:11] frigate.app                    INFO    : Capture process started for Backyard_V3: 261
[2022-09-23 08:53:11] frigate.app                    INFO    : Capture process started for front_door_bell: 266
[2022-09-23 08:53:11] frigate.video                  ERROR   : driveway: Unable to read frames from ffmpeg process.
[2022-09-23 08:53:11] frigate.video                  ERROR   : driveway: ffmpeg process is not running. exiting capture thread...
[2022-09-23 08:53:11] frigate.video                  ERROR   : Front_Door_Wyze: Unable to read frames from ffmpeg process.
[2022-09-23 08:53:11] frigate.video                  ERROR   : Front_Door_Wyze: ffmpeg process is not running. exiting capture thread...
[2022-09-23 08:53:11] frigate.video                  ERROR   : front_door_bell: Unable to read frames from ffmpeg process.
[2022-09-23 08:53:11] frigate.video                  ERROR   : front_door_bell: ffmpeg process is not running. exiting capture thread...
[2022-09-23 08:53:11] frigate.video                  ERROR   : Garage: Unable to read frames from ffmpeg process.
[2022-09-23 08:53:11] frigate.video                  ERROR   : Garage: ffmpeg process is not running. exiting capture thread...
[2022-09-23 08:53:11] frigate.video                  ERROR   : Backyard_V3: Unable to read frames from ffmpeg process.
[2022-09-23 08:53:11] frigate.video                  ERROR   : Backyard_V3: ffmpeg process is not running. exiting capture thread...
[2022-09-23 08:53:11] ws4py                          INFO    : Using epoll
[2022-09-23 08:53:31] watchdog.front_door_bell       ERROR   : Ffmpeg process crashed unexpectedly for front_door_bell.
[2022-09-23 08:53:31] watchdog.driveway              ERROR   : Ffmpeg process crashed unexpectedly for driveway.
[2022-09-23 08:53:31] watchdog.front_door_bell       ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-09-23 08:53:31] watchdog.driveway              ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-09-23 08:53:31] ffmpeg.driveway.detect         ERROR   : Error splitting the argument list: Option not found
[2022-09-23 08:53:31] ffmpeg.front_door_bell.detect  ERROR   : Error splitting the argument list: Option not found

FFprobe output from your camera

ffprobe version n5.1-2-g915ef932a3-20220731 Copyright (c) 2007-2022 the FFmpeg developers
  built with gcc 12.1.0 (crosstool-NG 1.25.0.55_3defb7b)
  configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-ffbuild-linux-gnu- --arch=x86_64 --target-os=linux --enable-gpl --enable-version3 --disable-debug --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --enable-libpulse --enable-libvmaf --enable-libxcb --enable-xlib --enable-amf --enable-libaom --enable-libaribb24 --enable-avisynth --enable-libdav1d --enable-libdavs2 --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libass --enable-libbluray --enable-libjxl --enable-libmp3lame --enable-libopus --enable-mbedtls --enable-librist --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --disable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --enable-libdrm --enable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags=-pie --extra-libs='-ldl -lgomp' --extra-version=20220731
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
Input #0, rtsp, from 'rtsp://*:*@192.168.1.3:8554/video2_unicast':
  Metadata:
    title           : LIVE555 Streaming Media v2022.04.26
    comment         : LIVE555 Streaming Media v2022.04.26
  Duration: N/A, start: 0.000000, bitrate: N/A
  Stream #0:0: Video: h264 (Main), yuv420p(tv, bt709, progressive), 640x360, 20 fps, 14.99 tbr, 90k tbn

Frigate stats

No response

Operating system

Debian

Install method

Docker Compose

Coral version

M.2

Network connection

Wired

Camera make and model

Amcrast 5MP, Amcrast doorbell, Wyze V3

Any other information that may be helpful

docker compose file

sudo docker create
--name frigate
--restart=unless-stopped
--device /dev/apex_0:/dev/apex_0
--mount type=tmpfs,target=/tmp/cache,tmpfs-size=1000000000
--shm-size=500m
-v /media/500/frigate:/media/frigate
-v /home/server/frigate/:/config/
-v /etc/localtime:/etc/localtime:ro
-e LIBVA_DRIVER_NAME=i965
-p 5000:5000
-p 1935:1935
blakeblackshear/frigate:stable

here is environmental path from v11 ( not working ) ( frigate:stable )
image
and here is environmental path from v10 ( working ) ( frigate:stable-amd64, 0.10.1-83481AF )
image

the working v10 does not have ffmpeg listed in the PATH and it is working instance.

my path looks OK

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/btbn-ffmpeg/bin

added the LIBVA_DRIVER_NAME=i965, no help

image

@NickM-27
Copy link
Collaborator

A few things:

  1. How is frigate installed? What is your host OS and is frigate running in docker on the host or some kind of hypervisor
  2. Please see the updated hwaccel args, the QSV args have changed: https://docs.frigate.video/configuration/hardware_acceleration#intel-based-cpus-10th-generation-via-quicksync-1
  3. What CPU do you have?

@Vendo232
Copy link
Author

A few things:

  1. How is frigate installed? What is your host OS and is frigate running in docker on the host or some kind of hypervisor
  2. Please see the updated hwaccel args, the QSV args have changed: https://docs.frigate.video/configuration/hardware_acceleration#intel-based-cpus-10th-generation-via-quicksync-1
  3. What CPU do you have?

here is the answer for 1. and 3. the hypervisor is DOCKER in plain linux Debian, using Portainer to manage Dockers but updates for Frigate are done via command line using config above

image

@Vendo232
Copy link
Author

Vendo232 commented Sep 23, 2022

Changed the hwaccel_args for my <10th gen i5-6600T CPU and no change, the same symptom remains

@NickM-27
Copy link
Collaborator

for my <10th gen i5-6600T CPU

Then you should be running VAAPI not QSV: hwaccel_args: -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format yuv420p

Also please try running vainfo inside of the container and paste the output here.

@blakeblackshear
Copy link
Owner

Your input args still include stimeout you need to update to timeout as described in the release notes.

@NickM-27
Copy link
Collaborator

Oh shoot didn't catch that, that would definitely be the first source of errors ^

@Vendo232
Copy link
Author

root@af69acbfa9e7:/opt/frigate# vainfo
bash: vainfo: command not found

@Vendo232
Copy link
Author

Vendo232 commented Sep 23, 2022

Changed stimeout to timeout - no change
removed timeout - no change.

here are the arguments I`m using, probably there is something esle wrong

ffmpeg:
hwaccel_args: -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format yuv420p
global_args: -hide_banner -loglevel fatal
input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -use_wallclock_as_timestamps 1
output_args:
detect: -f rawvideo -pix_fmt yuv420p
record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an
rtmp: -c copy -f flv

@NickM-27
Copy link
Collaborator

Changed stimeout to timeout - no change

There must be a change or else there is something wrong with another argument you have since

Error splitting the argument list: Option not found was in your logs.

Please use the input args correctly with timeout and let frigate run for a bit and post the new logs

@Vendo232
Copy link
Author

Vendo232 commented Sep 23, 2022

after commenting out the hwaccel_args the Frigate now works

image

@NickM-27
Copy link
Collaborator

Okay cool. Can you please run inside the container apt-get update && apt-get install vainfo -y && vainfo and paste the output here

@Vendo232
Copy link
Author

root@af69acbfa9e7:/opt/frigate# vainfo
error: XDG_RUNTIME_DIR not set in the environment.
error: can't connect to X server!
error: failed to initialize display

@NickM-27
Copy link
Collaborator

NickM-27 commented Sep 23, 2022

It seems portainer and frigate does not have access to your iGPU.

In previous frigate versions if hwaccel wasn't working it would silently fail (ffmpeg would ignore it) even if you thought it was working where as now it will fail and throw errors.

If you pass the iGPU in to portainer then run vainfo again it will show what hwaccel profiles are available

@Vendo232
Copy link
Author

If you pass the iGPU in to portainer

thank you Sir, if you could point me where to start

@NickM-27
Copy link
Collaborator

Depends how you are running / starting portainer but you will need to include the /dev/dri/renderD128 to be passed in

@Vendo232
Copy link
Author

thank you, I did not have that in the docker compose

vainfo: VA-API version: 1.10 (libva 2.10.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Skylake - 2.4.1
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Simple : VAEntrypointEncSlice
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
VAProfileH264ConstrainedBaseline: VAEntrypointFEI
VAProfileH264ConstrainedBaseline: VAEntrypointStats
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointEncSliceLP
VAProfileH264Main : VAEntrypointFEI
VAProfileH264Main : VAEntrypointStats
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointEncSliceLP
VAProfileH264High : VAEntrypointFEI
VAProfileH264High : VAEntrypointStats
VAProfileH264MultiviewHigh : VAEntrypointVLD
VAProfileH264StereoHigh : VAEntrypointVLD
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileJPEGBaseline : VAEntrypointEncPicture
VAProfileVP8Version0_3 : VAEntrypointVLD
VAProfileHEVCMain : VAEntrypointVLD

@NickM-27
Copy link
Collaborator

Perfect, now try VAAPI hwaccel args and if that works great otherwise try QSV hwaccel args

@Vendo232
Copy link
Author

works! with QSV. thank you for your time appretiate it. All I had to do was to add this into the docker-compose

--device /dev/dri/renderD128 \

and change stimeout per release notes.

please apology

@NickM-27
Copy link
Collaborator

Glad it is working. I am going to go ahead and close this. Feel free to create a new issue if something else comes up.

@Vendo232
Copy link
Author

Vendo232 commented Sep 23, 2022

@NickM-27 Nicolas one question:

I have intel gen6 HP PC with Coral M.2 , the image processing is routed via Coral so do I need hwaccel argument?

Noticed that even with working hwaccel on or off the CPU utilization is the same.

Maybe the hwaccel is only needed for those without Coral?

@NickM-27
Copy link
Collaborator

@Vendo232 please see #3860

Maybe the hwaccel is only needed for those without Coral?

The short answer is no, that is entirely false. Hardware acceleration uses a GPU to more efficiently decode the video stream and turn it in to frames. This is helpful regardless of if you're using a coral or not.

If you haven't already (since having a working setup) try the LIBVA_DRIVER_NAME: i965 and see if hwaccel helps then.

You can also install and run intel_gpu_top to see if the GPU is being utilized.

@Vendo232
Copy link
Author

Thank you for your patience Nicolas, you are awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants