Displaying 360 Video from an iOS App to an AirPlay Device - ios

A client's app displays two versions of a video in the app, one regular, one 360 view. The regular video is handled by AVPlayer. The 360 video is rendered by the open source package Swifty360Player (which works very well, btw). The app would like to be able to display either video on a big screen using AirPlay.
For the normal video, this is no problem. The 360 Video, however, is produced by a SceneKit view, so it's technically more akin to a 3D game than a video. I know that we can display game scenes on an AirPlay device if/when the user manually mirrors his iPhone/iPad to the AirPlay screen.
But I wonder, is there any way to generate a live video stream from the SceneKit view, and then transmit that video stream to the AirPlay device in real time? My wish is that the user could then use an AVRoutePickerView to select an AirPlay device from within the app.
ReplayKit does this for streaming services like Twitch but this app isn't looking to broadcast, just to share video with a single screen in the same room.
Is there anyway to accomplish this?

Related

How to make a screen-record guiding video for iOS device

I'm creating an iOS app on recording screen by using ReplayKit.
I want to make a user operation video to guide user on how to use my app to record screen.
So I need to record a video on how to record screen and this approach is a bit awkward.
I tried several ways: Screen Mirroring such as AirPlayer and QuickTime, but the recording button on control-center is disabled whilst using Screen Mirroring.
The effect I want is as follows:
https://support.apple.com/library/content/dam/edam/applecare/images/en_US/iOS/ios13-iphone-xs-control-center-screen-record-animation.gif
How was this video made?
I think you could recreate that video by recording your screen showing every action you want, save the video and edit it on top of an iPhone image asset.

How to pause screen recording of a specific screen when user is using the screen recording tool from the control centre in iPhone

I want to automatically pause video screen recording when user navigates to a specific screen and resume when it pops-out but I don’t want to hinder user experience by hiding or blacking-out the current screen.
I know that iOS provides the required functionality for streaming apps only eg. Netflix, Prime etc. as they are using FairPlay Streaming. For the Apps that uses FairPlay Streaming (FPS), their video content will automatically not be captured by the screen recording feature.
Is there any way to avoid video capturing for a normal screen same as FairPlay Streaming does on video content ?

I want to design a screen which will show different number of videos on same screen based on certain condition

This is an iOS problem.
I want to design a screen which will show a video on full screen. After some time based on some backend condition if another video is available I have to show that by splitting the screen into two vertical halves. After some time if one more video is available I have to again split the screen and show the third video horizontally on the bottom of the screen.
I am new to iOS and I am not able to manage the screen split on runtime based on backend condition. please help me in this regard.
Using AVPlayer it possible to play multiple videos in a view. You can use Apple's AVPlayer.
An AVPlayer is a controller object used to manage the playback and
timing of a media asset. You can use an AVPlayer to play local and
remote file-based media, such as QuickTime movies and MP3 audio files,
as well as audiovisual media served using HTTP Live Streaming.

Output UIView as video stream

Is it possible to stream content/context of a UIView as a direct video stream in Swift? I am not really looking for a “view screenshotting” functionality and than assembling video, this solution is possible but the framerate is far from ideal.
Update: maybe using OpenGL view?
1. View screenshots: What's your current solution of timing function ?
I believe if you use CADisplayLink, you can get better frame rate. As in my project, I can get ~15-20fps live streaming on full screen video view on iPhone 7Plus.
2. Using ReplayKit: I think I don't need to rewrite the introduction in another way because the Apple's docs were so clear.
Record or stream video from the screen, and audio from the app and
microphone.
Using the ReplayKit framework, users can record video from the screen,
and audio from the app and microphone. They can then share their
recordings with other users through email, messages, and social media.
You can build app extensions for live broadcasting your content to
sharing services. ReplayKit is incompatible with AVPlayer content.
The frame rate is quite higher than draw screenshot of views but currently it only supports capturing the whole screen.
So if you want to achieve capturing just a view, may be think about this way: Crop the buffer array of the output CMSampleBufferRef frame.
edit: If it's about mirroring a view to an external screen then we could have other solutions than ReplayKit or view screenshots.

How to implement screen recording with audio in iOS programmatically?

I have a requirement where I have screen recording with audio as well. I have done some Google and got to know about how can we implement screen recording but I am wondering how to save audio while screen recording.
Is there any possibility that we can merge the video and audio and then save the final data on disk?
But I am not sure that will it be feasible because there will be difference in syncing with audio and video frames.
For screen recording I got a link of ScreenCaptureView which actually lets you save the screen recording.
On iOS9 there is ReplayKit it's a framework that can be used to make screen recording on video games. It seems that you can use also for common screen capture.
For lower platforms it's a kind of big deal, video screen capturing exists but is a private framework ( I guess IOSurface). There are some work arounds as in this project , basically it starts to grab sigle screenshot and append them into a movie file, without audio

Resources