Skip to content

Is different resolution for streaming and recording possible? #1478

Answered by shogo4405
kafejo asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, it is possible.

// 1. Use the camera capture size for local recording as specified above. However, the device needs to be supported.
stream.sessionPreset = .hd1920x1080

// 2. Use the screen size for local recording as specified above.
stream.screen.size = .init(width: 1920, height: 1080)

// 3. Specify the local recording as follows.
recorder = IOStreamRecorder()
recorder.outputSettings = [
  .audio: [
    AVFormatIDKey: Int(kAudioFormatMPEG4AAC),
    AVSampleRateKey: 0,
    AVNumberOfChannelsKey: 0
  ],
  .video: [
    AVVideoCodecKey: AVVideoCodecType.h264,
    AVVideoHeightKey: 1920,
    AVVideoWidthKey: 1080
   ]
]
stream.addObserver(recorder)

// 4. Specify the streaming settin…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@kafejo
Comment options

Answer selected by kafejo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants