Video recording

225 views
Skip to first unread message

tommy

unread,
Dec 19, 2021, 6:00:54 PM12/19/21
to rtpengine
Audio recording works well in wav.

Is possible video recording in VP8/VP9 codec in webm container (+Opus) or separated audio and video in proc mode?

Anyone has example/tutorial how to do? How I can work with ffmpeg and rtpengine proc mode?


Richard Fuchs

unread,
Dec 20, 2021, 9:17:10 AM12/20/21
to rtpe...@googlegroups.com
There isn't any support for video codecs in rtpengine currently. Pull
requests welcome.

Cheers

tommy

unread,
Dec 20, 2021, 9:28:23 AM12/20/21
to rtpengine
Ok, but I need any start point how to :)

Richard Fuchs

unread,
Dec 20, 2021, 9:43:32 AM12/20/21
to rtpe...@googlegroups.com
Start by adding codec definitions into `__codec_defs`: https://github.com/sipwise/rtpengine/blob/master/lib/codeclib.c#L153

You will probably need a new set or `codec_type_t` methods akin to `codec_type_avcodec` for video codecs. `codec_type_avcodec` is generic for codecs supported by ffmpeg, but there's some audio-specific code in there (e.g. checking the sample formats, sample rate, channels etc). It may also be possible to adapt the existing methods to distinguish between audio and video.

The built-in support for resampling probably also needs to be bypassed (e.g. https://github.com/sipwise/rtpengine/blob/master/lib/codeclib.c#L895) - or better yet generalised to include a image/frame resizer.

The video codec definitions also need some code to parse out `a=fmtp` strings as they include frame sizes and other attributes important to video codecs. As an example https://github.com/sipwise/rtpengine/blob/master/lib/codeclib.c#L1948

For a packetizer `packetizer_passthrough` may or may not work - video might need special treatment, in particular splitting up large frames into multiple RTP packets. (This may not be necessary strictly for recording purposes, but would be necessary for proper transcoding support)

There's probably lots of other pitfalls that I can't think of right now. It's certainly not a trivial task, which is why it hasn't been done yet.

Cheers
--
You received this message because you are subscribed to the Google Groups "rtpengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtpengine+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rtpengine/645b62cd-1d72-4119-84a7-e4d3555ba634n%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages