[Live-devel] Need help to implement a subclass of FramedSource for rtsp stream video loop
AIMEZ Camille
camille.aimez at idemia.com
Tue Aug 20 01:22:34 PDT 2019
Hello again Ross,
Thank you so much for the pointer, I was able to get it running very easily right away thanks to your help.
What I did is the following.
In the ByteStreamFileSource.cpp file, I found the if that checks for the EOF. This if also checked for a file error, so I detached both checks in two separate if statements.
Then I simply call the rewind function on the stream if the EOF is reached, and it simply restarts at the beginning.
So instead of this in the code:
if (feof(fFid) || ferror(fFid) || (fLimitNumBytesToStream && fNumBytesToStream == 0)) {
handleClosure();
return;
}
I have the following:
if (feof(fFid)) {
rewind(fFid);
}
else if (ferror(fFid) || (fLimitNumBytesToStream && fNumBytesToStream == 0)) {
handleClosure();
return;
}
Thank you so much for your help, it is really greatly appreciated!
Camille AIMEZ
IDEMIA
-----Original Message-----
From: AIMEZ Camille
Sent: Monday, August 19, 2019 6:29 PM
To: LIVE555 Streaming Media - development & use <live-devel at us.live555.com>
Subject: RE: [Live-devel] Need help to implement a subclass of FramedSource for rtsp stream video loop
Hello Ross,
Thanks for the information, I will see to try and implement that tomorrow (I am in France and it is the end of the day for me).
Thanks again so much for the help.
Camille AIMEZ
IDEMIA
-----Original Message-----
From: live-devel <live-devel-bounces at us.live555.com> On Behalf Of Ross Finlayson
Sent: Monday, August 19, 2019 5:52 PM
To: LIVE555 Streaming Media - development & use <live-devel at us.live555.com>
Subject: Re: [Live-devel] Need help to implement a subclass of FramedSource for rtsp stream video loop
> On Aug 19, 2019, at 5:35 PM, AIMEZ Camille <camille.aimez at idemia.com> wrote:
>
> Hello,
>
> I am currently trying to set up a camera simulation hub in order to test different VMSs and analytic softwares.
>
> I am trying to set up a set of simulated cameras using the test program of live555: testOnDemandRTSPServer.
>
> One functionality that I absolutely need in order to simulate a real
> camera, is to loop on the input video forever
You would basically need to implement a class - similar to the existing class “ByteStreamFileSource” - that handles EOF of the input file differently. Instead of calling "handleClosure()” (which would tell the downstream reader that the data source has ended), your subclass would instead:
- clear the EOF, and
- seek back to the beginning of the file to allow file read handling to continue as before.
Ross Finlayson
Live Networks, Inc.
https://urldefense.com/v3/__http://www.live555.com/__;!U11cABxz5NU!gcjAmwbgVow1JIccMQskZwdCQSgcghSGx8FVmEwO-Z9LrEROVT8LHVu2uknMRHnos4M$
_______________________________________________
live-devel mailing list
live-devel at lists.live555.com
https://urldefense.com/v3/__http://lists.live555.com/mailman/listinfo/live-devel__;!U11cABxz5NU!gcjAmwbgVow1JIccMQskZwdCQSgcghSGx8FVmEwO-Z9LrEROVT8LHVu2uknMMWnCdRo$
More information about the live-devel
mailing list