RVMedia 6 and RTSP - Network problems

RVMedia support and discussion (components for displaying and controlling IP cameras, webcams, video conferencing, video chats, recording audio and video files)
mitzi
Posts: 31
Joined: Thu Oct 10, 2019 12:14 pm

Re: RVMedia 6 and RTSP - Network problems

Post by mitzi »

any progress? I tried latest ffmpeg from today and issue persists.
Sergey Tkachenko
Site Admin
Posts: 17253
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: RVMedia 6 and RTSP - Network problems

Post 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)
Sergey Tkachenko
Site Admin
Posts: 17253
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: RVMedia 6 and RTSP - Network problems

Post 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
mitzi
Posts: 31
Joined: Thu Oct 10, 2019 12:14 pm

Re: RVMedia 6 and RTSP - Network problems

Post 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.
Sergey Tkachenko
Site Admin
Posts: 17253
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: RVMedia 6 and RTSP - Network problems

Post by Sergey Tkachenko »

Yes, this project uses FFmpeg 4.2.1.
mitzi
Posts: 31
Joined: Thu Oct 10, 2019 12:14 pm

Re: RVMedia 6 and RTSP - Network problems

Post 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.
Sergey Tkachenko
Site Admin
Posts: 17253
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: RVMedia 6 and RTSP - Network problems

Post 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.
mitzi
Posts: 31
Joined: Thu Oct 10, 2019 12:14 pm

Re: RVMedia 6 and RTSP - Network problems

Post 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?
Sergey Tkachenko
Site Admin
Posts: 17253
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: RVMedia 6 and RTSP - Network problems

Post by Sergey Tkachenko »

I hate to say, but I have no idea how to fix it, since the problem seemingly inside FFmpeg
mitzi
Posts: 31
Joined: Thu Oct 10, 2019 12:14 pm

Re: RVMedia 6 and RTSP - Network problems

Post by mitzi »

Did you check suggested solution?
mitzi
Posts: 31
Joined: Thu Oct 10, 2019 12:14 pm

Re: RVMedia 6 and RTSP - Network problems

Post 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?
Sergey Tkachenko
Site Admin
Posts: 17253
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: RVMedia 6 and RTSP - Network problems

Post 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.
mitzi
Posts: 31
Joined: Thu Oct 10, 2019 12:14 pm

Re: RVMedia 6 and RTSP - Network problems

Post by mitzi »

That's why I want you to check it :) Who else can decide if it is correct or not :)
mitzi
Posts: 31
Joined: Thu Oct 10, 2019 12:14 pm

Re: RVMedia 6 and RTSP - Network problems

Post by mitzi »

Any progress?
Sergey Tkachenko
Site Admin
Posts: 17253
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: RVMedia 6 and RTSP - Network problems

Post 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.
Post Reply