IP camera format / Recording format (codec, container)

Hi, I want to implement two functions: 1. external RTSP stream (heard that can be done via IP camera) and also 2. WebRTC recording and later playback. For both functions we need to have proper containers and codecs (H.264 with either AAC or Opus audio, depending if it is WebRTC live connection or MP4 recording playback).

So I have two questions regarding that:

1. RTSP stream (IP camera)

Does the RTSP stream need to be in specific format (container/codec)? - in order to make OpenVidu ingest it as IP camera and distribute it via WebRTC in browsers.

Because from what I know, WebRTC in browsers needs H.264 baseline profile video and Opus audio (that can be transcoded from AAC, but with 48kHz stereo sound). We already do that on our other server, i.e. our other server provides a stream with H.264 baselina and Opus audio, so that is WebRTC-ready.

So if we have it transcoded already, then can we avoid any transcoding on OpenVidu? But then would RTSP transmit Opus audio? If not, then what happens - is it so that other server provides RTSP with H.264 baseline and AAC, and OpenVidu does only audio transcoding to Opus? Or if not then what? And what are actual scenarios?

2. Recording

I understand that naturally composed recording does a lot of processing and enscoding, but regarding individual recording:

a) Again, does OpenVidu have to do any transcoding in individual recording, or can we just save CPU and dump the audio/video/other data of each individual stream as-is, i.e. in the codecs they are transmitted over (= all required processing is only muxing this data to a container). And if we wanted to transcode it, we could do it offline in a queue with a low priority free CPU resources, not consuming CPU for live real-time transcoding.

b) can the individual recording be stored in MP4 file? Because I read that composed recording is saved im MP4 but individual is in webm. Why is it so? We prefer MP4 container. If OpenVidu cannot handle MP4, then if we make scripts that mux from webm to mp4 would there be any incompatibility with MP4?

c) I read that individual recording mode creates a zip file, so each time some automatic script needs to extract the zip and delete the zip file. Can the recording be made to a directory instead of a zip?

Thanks a lot!
Tomasz

Hello @tomasz,

Please take a look to this post for low level information about RTSP and WebRTC in Kurento (the heart of OpenVidu): https://www.kurento.org/blog/kurento-webrtc-gateway-ip-cameras.

Also, take a look to IP Camera doc adaptative bitrate section.

  1. If RSTP has an incompatible format with requested WebRTC it will automatically transcoded by Kurento.

  2. In INDIVIDUAL recording mode, OpenVidu tries to record sources directly (without transcoding). At the moment, .zip file is mandatory.

Regards