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

Ghost ffmpeg-Process #1390

Open
cavernerg opened this issue Oct 10, 2024 · 4 comments
Open

Ghost ffmpeg-Process #1390

cavernerg opened this issue Oct 10, 2024 · 4 comments
Assignees
Labels
question Further information is requested

Comments

@cavernerg
Copy link

cavernerg commented Oct 10, 2024

I have a weird issue with my USB-Cam-Setup.

This is my config:

streams:
  MK4SESP: http://192.168.2.29:81/cam.mjpeg
  MK4SASeite: ffmpeg:device?video=/dev/video2&input_format=mjpeg&video_size=1600x896
  MK4SHinten: ffmpeg:device?video=/dev/video0&input_format=mjpeg&video_size=1280x720
  MK3SESP: http://192.168.2.80:81/cam.mjpeg
  #esp32cam2: ffmpeg:http://192.168.2.29:81/stream#video=h264#rotate=180
  Einfahrt: 
    - ffmpeg:[email protected]:554/livestream/11
    - ffmpeg:[email protected]:554/livestream/12
    - ffmpeg:[email protected]:554/livestream/13
  Einfahrt_mjpeg: 
    - http://[email protected]/livestream/12?action=play&media=mjpeg
  Einfahrt_mjpeg_all: 
    - ffmpeg:http://[email protected]/livestream/11?action=play&media=mjpeg
    - ffmpeg:http://[email protected]/livestream/12?action=play&media=mjpeg
    - ffmpeg:http://[email protected]/livestream/13?action=play&media=mjpeg

#log:
#  level: info
#  api: info
#  exec: info
#  ngrok: info
#  rtsp: info
#  streams: info
#  webrtc: info

USB-Cam Config ist copy&paste from the "Add"-Page.
When I start the server, everything is fine. BUT after some time, a ffmpeg process (Output from ps auxww: "ffmpeg -hide_banner -v error -f v4l2 -video_size 1600x896 -input_format mjpeg -i /dev/video2 -c copy -f mjpeg -") starts and uses 100 % CPU.

I installed go2rtc 2 times. One just through tteck proxmox lxc and the other on my own. Both have the same issue. After a restart, I can use the stream from the cam perfectly fine.
As soon as this process is there, go2rtc has no access to the device.
When the ghost-process is running and I stop the go2rtc-Service, the process goes down.
The Ghost-process starts without any interaction after some time. Even if I don't use any of the streams.
go2rtc-Log has no enlightening infos.

any hints for me?

@AlexxIT AlexxIT added the question Further information is requested label Oct 10, 2024
@AlexxIT
Copy link
Owner

AlexxIT commented Oct 10, 2024

Looks like some problems with FFmpeg and your camera. You can increase log level for exec module to trace and check raw ffmpeg log output.

@cavernerg
Copy link
Author

cavernerg commented Oct 12, 2024

I could trace it down to octoprint. Maybe it is DDOSing go2rtc or something. The integration seems buggy.

At some time this appears in the Log:

21:14:17,429	debug	[exec] run pipe args=ffmpeg,-hide_banner,-v,error,-f,v4l2,-input_format,mjpeg,-video_size,1600x896,-i,/dev/video2,-c,copy,-f,mjpeg,-
21:14:14,416	trace	[exec] kill with signal=9

and then CPU goes on full load. This doesn't happen with octoprint being down.

I have Octoprint configured with webcam-support activated using the multicam-plugin.
Shutting octoprint down does not stop the CPU load. Once the process is there, there is no coming back. It even comes back, when the I kill the PID.

//edit: Restarting go2rtc-service ends the process

@AlexxIT
Copy link
Owner

AlexxIT commented Oct 13, 2024

Interesting. kill with signal=9 should close ffmpeg process. But looks like it not closing and starts consuming 100% CPU.

@cavernerg
Copy link
Author

My guess is, that octoprint is spamming requests and go2rtc loses the connection to its own processes somehow. But I'm just wildly guessing ;-)

@AlexxIT AlexxIT self-assigned this Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants