Page 1 of 1

Recode Video in TRVMediaServer

Posted: Sat Mar 28, 2020 10:55 am
by thomasvoelker
Cheers,

what would be the best option to create a new video stream from a given one? The new video stream should have different resolution and framerate.

Any suggestions welcome!

Re: Recode Video in TRVMediaServer

Posted: Sat Mar 28, 2020 12:09 pm
by Sergey Tkachenko
TRVCamRecorder always records using its own framerate, specified in VideoFramePerSec property.
To specify a resolution, assign VideoAutoSize = False, and specify VideoWidth and VideoHeight properties.

Do you want to record video received by a server (TRVMediaServer)? The server itself does not decode video/audio data, it just receive them from clients and send to other clients. So, to record video, you need a client (a pair of TRVCamSender + TRVCamReceiver). You can add them to your server application (to create a special client embedded in the server).

Re: Recode Video in TRVMediaServer

Posted: Sat Mar 28, 2020 4:15 pm
by thomasvoelker
Hi Sergey,

thank you for your response.

The intention is to recode the stream on the server to, let's say, 160x120px and 5 fps in order to have a low bandwidth stream that can be received by low bandwidth users.

As far as I can see, I may use a RVCamReceiver, pipe it to a RVCamRecorder with the apropriate settings and then? As I see I may adjust the resolution on the RVCamSender, but not the framerate, which I would like to.

Re: Recode Video in TRVMediaServer

Posted: Sat Mar 28, 2020 4:45 pm
by Sergey Tkachenko
So you want not to record, but modify video before sending to other users.
As I said, the TRVMediaServer cannot do it, because it does not decode video and audio data (we try to keep CPU usage on the server as low as possible). It can be done only on some client (which can be implemented in the same application as TRVMediaServer).
One of possible approaches:
- when the client receives a video frame (TRVCamReceiver.OnGetImage event), it resamples it to low resolution and stores it somewhere
- this client sends video using TRVCamera with DeviceType = rvdtUserData. In this mode, TRVCamera sends images provided by you (in TRVCamera.OnNewImage event) with the specified framerate (TRVCamera.FramePerSec property). So this is a way to send frames at new framerate.

Re: Recode Video in TRVMediaServer

Posted: Sat Mar 28, 2020 5:51 pm
by thomasvoelker
Cool, thanks, I'll try this!