Closed Ahmed-10 closed 9 months ago
@Ahmed-10 what type of source you are trying to play?
also, are you trying to run it from Snap package or you've built it from sources yourself?
I was building from source in docker container after adding the h264 streams from RTSP cameras in my network to the restreamer.conf
FROM ubuntu:22.04
ENV TZ=Africa
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
WORKDIR /app
RUN apt update
RUN apt install -y build-essential cmake git
RUN apt-get install -y libspdlog-dev libconfig-dev libssl-dev libgstreamer1.0-0 libgstreamer1.0-dev \
libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly \
gstreamer1.0-nice libnice-dev
# gstreamer cli
RUN apt install gstreamer1.0-tools
RUN git clone https://github.com/warmcat/libwebsockets.git --branch v4.2-stable --depth 1
RUN cmake -B build -S libwebsockets -DLWS_WITH_GLIB=ON
RUN cmake --build ./build
RUN cmake --install ./build
RUN rm -rf libwebsockets
RUN rm -rf build
RUN apt update
RUN apt install -y gsoap libgsoap-dev libmicrohttpd-dev
COPY . .
RUN cmake -B build
RUN cmake --build ./build
RUN mv ./restreamer.conf.sample /etc/xdg/restreamer.conf
RUN ldconfig
CMD ["./build/ReStreamer"]
I had 2 web clients running. both repeated switching streams quickly and that it works for a couple of clicks then it crashes
@Ahmed-10 can you please try the same rtsp source with snap package from edge channel? I want be sure issue is not related to your GStreamer version.
installed using snap on ubuntu 22.04 after a couple of clicks and switching between streams. a message repeatedly printed to the console
WebRTSP.mjs:65 Failed to handle message:
TEARDOWN Konsk%C3%BD%20Gr%C3%BA%C5%88 WEBRTSP/0.2
CSeq: 1
Session: 1
Disconnecting...
and at the end I got a disconnected
message
It's known minor issue in browser client. The main question is if ReStreamer itself crashing or not. Please try viewing logs with 'sudo snap logs rtsp-to-webrtsp -f'
here are the logs from sudo snap logs rtsp-to-webrtsp -f
restreamer-snap-bug.txt
2023-11-30T17:25:33+02:00 -[783861]: file ../src/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c: line 6759 (gst_webrtc_bin_set_local_description): should not be reached
2023-11-30T17:25:33+02:00 systemd[1]: snap.rtsp-to-webrtsp.ReStreamer.service: Main process exited, code=killed, status=11/SEGV
2023-11-30T17:25:33+02:00 systemd[1]: snap.rtsp-to-webrtsp.ReStreamer.service: Failed with result 'signal'.
2023-11-30T17:25:34+02:00 systemd[1]: snap.rtsp-to-webrtsp.ReStreamer.service: Scheduled restart job, restart counter is at 2.
2023-11-30T17:25:34+02:00 systemd[1]: Stopped Service for snap application rtsp-to-webrtsp.ReStreamer.
2023-11-30T17:25:34+02:00 systemd[1]: Started Service for snap application rtsp-to-webrtsp.ReStreamer.
the same error happened in the docker file you can find it in the logs file lines 295
and 1692
it was harder to catch as the snap restarts the process very quickly
Thanks! it's good starting point. Did you use predefined demo sources or your own sources?
I used my resources. h264 streams from RTSP cameras in my local network
Are you able to reproduce issue with demo sources?
I failed to reproduce the error with the demo sources. however, I use RTSP streams from commercial cameras: Bosch DINION IP starlight 6000i IR, Hikvision DS-2CD4165F-IZ, Hikvision DS-2CD2623G0-IZS, AXIS P1427-E, AXIS P1377-LE, AXIS Q1700-LE, AVIGILON 1.0MP Day/Night H.264 HD.
Ok, I'll try tor reproduce issue myself with cams I have... thanks!
@Ahmed-10 I think I've fixed crash but I'm still not sure I've fixed your initial issue. Please try.
the crash causing the application to terminate is fixed. However, the problem with the switching between streams is still on but now it's different. the websocket connection is closed from the websocket server. and the client is unable to connect again. the last printed logs from the terminal
@Ahmed-10 does it work if don't do quick switch between sources?
yes, but when multiple clients connect to the WebSocket server. it produces the same problem, which is initially the case.
So we can be sure your IP Cams provide compatible video stream... Ok, I'll try to reproduce issue. Thanks!
@Ahmed-10 unfortunately I was not able to reproduce issue with 2 cams attached: first - some cheep Chinese cam, second - AXIS M5014 cam. Both was connected over rtsp.
So I need your assistance:
debug: {
log-level: 5
}
if you don't want to share possible private info from logs - you may send logs directly to my email.
@Ahmed-10 ping
1- number of cams: 8 2- all connections were over RTSP. I didn't use ONVIF. 3- I couldn't reproduce the error with the latest snap package (logs are sent to your email) 4- I increased the log-level to 5 (logs are sent to your email)
@Ahmed-10 the most obvious difference I can see - you are using libwebsockets v4.2, but snap users v4.3. I don't know if it's related to your issue, but I would recommend you switch to v4.3. On my side I'll try to use v4.2 to reproduce issue...
@Ahmed-10 Tried to reproduce with libwebsockets v4.2 - no luck. So it's something different. For example snap is based on GStreamer v1.22... So I would recommend you try build Docker the same way like it was done in Snap build script On my side now I'm going to try build docker image myself and try it...
@Ahmed-10 tried to test your Dockerfile - didn't get any issue... It looks like you do something different comparing to me - and it's required to understand what exactly....
Can you please tell, can you reproduce issue with demo urls and your Dockerfile?
the issue is only produced with RTSP links with the same network. running against the Dockerfile I sent you. I'm trying to build an image with the snap dependency and I will update you with the result
I'm not sure if it's possible to put snap into Docker also I'm not sure it's good idea...
Anyway, please do following with your docker build:
debug: {
log-level: 5
lws-log-level: 5
}
@Ahmed-10 Tried to reproduce with libwebsockets v4.2 - no luck. So it's something different. For example snap is based on GStreamer v1.22... So I would recommend you try build Docker the same way like it was done in Snap build script On my side now I'm going to try build docker image myself and try it...
I didn't mean to install snap into docker. what I meant is to install gstreamer 1.22
from source with the same customization from the snap build script. and it worked well without crashes.
surprisingly when installing gstreamer 1.22
from apt on ubuntu 23.04 the crash occurs. but I'm happy that the build from source solved my issue.
Thank you for your help.
** (ReStreamer:1): CRITICAL **: 15:19:09.320: file ../ext/webrtc/gstwebrtcbin.c: line 6001 (gst_webrtc_bin_set_local_description): should not be reached