Recode Video in TRVMediaServer

RVMedia support and discussion (components for displaying and controlling IP cameras, webcams, video conferencing, video chats, recording audio and video files)
Post Reply
thomasvoelker
Posts: 4
Joined: Sat Mar 28, 2020 10:49 am

Recode Video in TRVMediaServer

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

Re: Recode Video in TRVMediaServer

Post 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).
thomasvoelker
Posts: 4
Joined: Sat Mar 28, 2020 10:49 am

Re: Recode Video in TRVMediaServer

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

Re: Recode Video in TRVMediaServer

Post 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.
thomasvoelker
Posts: 4
Joined: Sat Mar 28, 2020 10:49 am

Re: Recode Video in TRVMediaServer

Post by thomasvoelker »

Cool, thanks, I'll try this!
Post Reply