Page 2 of 4

Re: RVMedia 6 and RTSP - Network problems

Posted: Wed Oct 16, 2019 6:52 am
by mitzi
any progress? I tried latest ffmpeg from today and issue persists.

Re: RVMedia 6 and RTSP - Network problems

Posted: Wed Oct 16, 2019 5:13 pm
by Sergey Tkachenko
Sorry, we were busy preparing TRichView update.
I'll test your sample tomorrow.
(Ilya already tested it and he was not able to reproduce. Tomorrow I'll try myself)

Re: RVMedia 6 and RTSP - Network problems

Posted: Fri Oct 18, 2019 12:01 pm
by Sergey Tkachenko
I made a test project.
Here it is, including exe file and ffmpeg:
https://www.trichview.com/support/files ... chTest.zip

Buttons switch between two video URLs you provided.
I pressed about 50 times. I tried switching between the cameras and restarting the same camera again and again. I found no problems.

I tested in updated version (which will be released as 7.1 soon), but I do not think there is a difference

Re: RVMedia 6 and RTSP - Network problems

Posted: Fri Oct 18, 2019 1:36 pm
by mitzi
Does your project use FFmpeg libraries? Is FFmpeg enabled and FFmpeg libraries beside the exe? Without FFmpeg it works. Problem is with FFmpeg.

Re: RVMedia 6 and RTSP - Network problems

Posted: Fri Oct 18, 2019 5:07 pm
by Sergey Tkachenko
Yes, this project uses FFmpeg 4.2.1.

Re: RVMedia 6 and RTSP - Network problems

Posted: Mon Oct 21, 2019 7:51 am
by mitzi
Well, look at enhanced example.
https://www.mitec.cz/CamSwitch.zip
I added Indy TCPServer and TCPClient. Client connects to the server at startup and after some camera switches client is disconnected with error 10054 - Connection reset by peer.
It is caused by FFmpeg. It destroys any network application which uses RVCamera and FFmpeg. It is really big problem. It seems FFmpeg closes Winsock for all existing connections in app.

Re: RVMedia 6 and RTSP - Network problems

Posted: Wed Oct 23, 2019 9:39 am
by Sergey Tkachenko
Unfortunately, I do not know how to fix it with FFmpeg.
I can only suggest using GStreamer 0.1. FFmpeg can be turned off by assigning RVCamera1.FFMpegProperty.UseFFMpeg = False.

There is only one difficulty, RVMedia requires correct specification of DeviceType and VideoFormat for GStreamer.
For 'http://150.214.222.100/mjpg/video.mjpg' it is rvdtHTTP, rvvfMJPEG (it can also be played by RVMedia natively, without FFmpeg and GStreamer).
For 'rtmp://semerkandglb.mediatriple.net:1935/semerkandliveedge/semerkand2', I am not sure, currently it does not work stable for me.

Also, I recommend to close IdTCPServer and IdTCPClient in FormClose, otherwise application may hang.

Re: RVMedia 6 and RTSP - Network problems

Posted: Tue Nov 05, 2019 9:43 am
by mitzi
I'm not able to make GStreamer working with any RTSP stream :( so it is unusable.
Can you put this issue to FFmpeg bug tracker?
Replaying RTSP is most wanted feature and if it is destroys other application connections then it is serious problem.
Can you focus on this issue, please?

EDIT: I have just tested FFVCL (http://www.delphiffmpeg.com) - components that use FFmpeg libraries for playing rtsp and also http camera streams) and when I modified their Player demo with TCPServer and client, connection is not broken regardless of number of URL changes and replayes. So it seems problem is not inside FFmpeg but your components.

EDIT2: I tried to debug where problem can be and if I replace

Code: Select all

avformat_close_input(pFormat_context);
with

Code: Select all

avformat_free_context(pFormat_context);
in MRVFFMPEGObject.CloseVideoFile, problem disappears.

Can you check it?

Re: RVMedia 6 and RTSP - Network problems

Posted: Thu Nov 07, 2019 7:26 am
by Sergey Tkachenko
I hate to say, but I have no idea how to fix it, since the problem seemingly inside FFmpeg

Re: RVMedia 6 and RTSP - Network problems

Posted: Thu Nov 07, 2019 7:47 am
by mitzi
Did you check suggested solution?

Re: RVMedia 6 and RTSP - Network problems

Posted: Thu Nov 07, 2019 7:53 am
by mitzi
It seems you didn't read my post, so once more:

I have just tested FFVCL (http://www.delphiffmpeg.com) - components that use FFmpeg libraries for playing rtsp and also http camera streams) and when I modified their Player demo with TCPServer and client, connection is not broken regardless of number of URL changes and replayes. So it seems problem is not inside FFmpeg but your components.

Then I tried to debug where problem can be and if I replace

Code: Select all

avformat_close_input(pFormat_context);
with

Code: Select all

avformat_free_context(pFormat_context);
in MRVFFMPEGObject.CloseVideoFile, problem disappears.

Can you check it?

Re: RVMedia 6 and RTSP - Network problems

Posted: Thu Nov 07, 2019 9:59 am
by Sergey Tkachenko
It's possible to make this change in RVMedia code too, but I am not sure that it is a correct change.

Re: RVMedia 6 and RTSP - Network problems

Posted: Thu Nov 07, 2019 12:33 pm
by mitzi
That's why I want you to check it :) Who else can decide if it is correct or not :)

Re: RVMedia 6 and RTSP - Network problems

Posted: Thu Nov 21, 2019 2:06 pm
by mitzi
Any progress?

Re: RVMedia 6 and RTSP - Network problems

Posted: Thu Nov 21, 2019 4:19 pm
by Sergey Tkachenko
Sorry, we were busy solving problems in other threads of this forum.

But here, I do not know what I can do. I do not know FFmpeg internals in details, I can rely only to its documentations.