agarciadom / ipwebcam-gst

Simple shell script for using IP Webcam as a V4L2 webcam / sound source
http://xmleye.wordpress.com
616 stars 154 forks source link

Stopping the script when camera is turned on breaks subsequents runs of the script #108

Closed N8n5h closed 1 year ago

N8n5h commented 3 years ago

Hi, this script works pretty nice the first time but after ending the stream (by hitting the return key) and trying to run it again (tested with and without any flag) then the webcam "works" but just outputs a frozen frame of the previous stream (presumably the last one) until I reboot to make it work again.

Tested on Ubuntu 20.04.2 / Firefox + Discord / Chromium + Google Meet

By going to the https://ip:port I can see it's working and updating correctly, so I assume it may have to do with gst-launch ?

Update: I've noticed that if I turn off the camera on Discord before stopping the script, now it works when I launch it again. So the issue occurs when the script is stopped when the camera is active only atm.

vit-zikmund commented 1 year ago

This could be the cause of the v4l2loopback device still being opened for reading, see the detail I provided at the bottom of https://github.com/agarciadom/ipwebcam-gst/issues/114#issuecomment-1412683287.

agarciadom commented 1 year ago

This should be handled now, after @vit-zikmund 's PR #123 got merged. (Thanks again for your contribution!)