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

Re: RVMedia 6 and RTSP - Network problems

Post by mitzi » Wed Oct 16, 2019 6:52 am

any progress? I tried latest ffmpeg from today and issue persists.

Sergey Tkachenko
Site Admin
Posts: 14720
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: RVMedia 6 and RTSP - Network problems

Post by Sergey Tkachenko » Wed Oct 16, 2019 5:13 pm

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: 14720
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: RVMedia 6 and RTSP - Network problems

Post by Sergey Tkachenko » Fri Oct 18, 2019 12:01 pm

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

Re: RVMedia 6 and RTSP - Network problems

Post by mitzi » Fri Oct 18, 2019 1:36 pm

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: 14720
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: RVMedia 6 and RTSP - Network problems

Post by Sergey Tkachenko » Fri Oct 18, 2019 5:07 pm

Yes, this project uses FFmpeg 4.2.1.

mitzi
Posts: 10
Joined: Thu Oct 10, 2019 12:14 pm

Re: RVMedia 6 and RTSP - Network problems

Post by mitzi » Mon Oct 21, 2019 7:51 am

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: 14720
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: RVMedia 6 and RTSP - Network problems

Post by Sergey Tkachenko » Wed Oct 23, 2019 9:39 am

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

Re: RVMedia 6 and RTSP - Network problems

Post by mitzi » Tue Nov 05, 2019 9:43 am

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: 14720
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: RVMedia 6 and RTSP - Network problems

Post by Sergey Tkachenko » Thu Nov 07, 2019 7:26 am

I hate to say, but I have no idea how to fix it, since the problem seemingly inside FFmpeg

mitzi
Posts: 10
Joined: Thu Oct 10, 2019 12:14 pm

Re: RVMedia 6 and RTSP - Network problems

Post by mitzi » Thu Nov 07, 2019 7:47 am

Did you check suggested solution?

mitzi
Posts: 10
Joined: Thu Oct 10, 2019 12:14 pm

Re: RVMedia 6 and RTSP - Network problems

Post by mitzi » Thu Nov 07, 2019 7:53 am

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: 14720
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: RVMedia 6 and RTSP - Network problems

Post by Sergey Tkachenko » Thu Nov 07, 2019 9:59 am

It's possible to make this change in RVMedia code too, but I am not sure that it is a correct change.

mitzi
Posts: 10
Joined: Thu Oct 10, 2019 12:14 pm

Re: RVMedia 6 and RTSP - Network problems

Post by mitzi » Thu Nov 07, 2019 12:33 pm

That's why I want you to check it :) Who else can decide if it is correct or not :)

Post Reply