throws Exception {
MediaPipeline mp = contentSession.getMediaPipelineFactory().create();
contentSession.releaseOnTerminate(mp);
// By default recording in WEBM format
MediaProfileSpecType mediaProfileSpecType = MediaProfileSpecType.WEBM;
final String contentId = contentSession.getContentId();
if (contentId != null && contentId.equalsIgnoreCase("mp4")) {
mediaProfileSpecType = MediaProfileSpecType.MP4;
}
recorderEndPoint = mp.newRecorderEndpoint(TARGET)