Hi,
there is no builtin video encoding API in OS's. Camera internal code is self contained and not accessible by external logic.
Apps that generate videos use one of the following:
- Server side encoding
- Embed a library like ffmpeg
- Encode using a very simple format, there are some very simple codec formats you can use.