QMediaCaptureSession Class
QMediaCaptureSession 클래스를 사용하면 오디오 및 비디오 콘텐츠를 캡처할 수 있습니다. 더 보기...
| 헤더: | #include <QMediaCaptureSession> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Multimedia) target_link_libraries(mytarget PRIVATE Qt6::Multimedia) |
| qmake: | QT += multimedia |
| QML에서: | CaptureSession |
| 상속: | QObject |
속성
|
|
공개 함수
| QMediaCaptureSession(QObject *parent = nullptr) | |
| virtual | ~QMediaCaptureSession() override |
| QAudioBufferInput * | audioBufferInput() const |
| QAudioInput * | audioInput() const |
| QAudioOutput * | audioOutput() const |
| QCamera * | camera() const |
| QImageCapture * | imageCapture() |
| QObject * | nativeVideoSource() const |
| QMediaRecorder * | recorder() |
| QScreenCapture * | screenCapture() |
| void | setAudioBufferInput(QAudioBufferInput *input) |
| void | setAudioInput(QAudioInput *input) |
| void | setAudioOutput(QAudioOutput *output) |
| void | setCamera(QCamera *camera) |
| void | setImageCapture(QImageCapture *imageCapture) |
| void | setNativeVideoSource(QObject *videoSource) |
| void | setRecorder(QMediaRecorder *recorder) |
| void | setScreenCapture(QScreenCapture *screenCapture) |
| void | setVideoFrameInput(QVideoFrameInput *input) |
| void | setVideoOutput(QObject *output) |
| void | setVideoSink(QVideoSink *sink) |
| void | setWindowCapture(QWindowCapture *windowCapture) |
| QVideoFrameInput * | videoFrameInput() const |
| QObject * | videoOutput() const |
| QVideoSink * | videoSink() const |
| QWindowCapture * | windowCapture() |
신호
| void | audioBufferInputChanged() |
| void | audioInputChanged() |
| void | audioOutputChanged() |
| void | cameraChanged() |
| void | imageCaptureChanged() |
| void | nativeVideoSourceChanged() |
| void | recorderChanged() |
| void | screenCaptureChanged() |
| void | videoFrameInputChanged() |
| void | videoOutputChanged() |
| void | windowCaptureChanged() |
상세 설명
QMediaCaptureSession은 로컬 장치에서 미디어 캡처를 관리하는 핵심 클래스입니다.
setCamera(), setScreenCapture(), setWindowCapture() 또는 setVideoFrameInput()을 사용하여 QMediaCaptureSession에 비디오 입력을 연결할 수 있습니다. setVideoOutput()을 사용하여 QVideoWidget 또는 QGraphicsVideoItem 을 설정하면 캡처된 미디어의 미리보기를 볼 수 있습니다.
setAudioInput()을 사용하여 QMediaCaptureSession에 마이크를 연결하거나, setAudioBufferInput()을 사용하여 사용자 정의 오디오 입력을 설정할 수 있습니다. setAudioOutput()을 사용하여 오디오를 출력 장치로 라우팅하면 캡처된 소리를 들을 수 있습니다.
캡처 세션에 QImageCapture 객체를 설정하여 카메라에서 정지 이미지를 캡처할 수 있으며, QMediaRecorder 을 사용하여 오디오/비디오를 녹화할 수 있습니다.
QCamera, QAudioDevice, QMediaRecorder, QImageCapture, QScreenCapture, QWindowCapture, QVideoFrameInput, QGStreamerVideoSource 및 QGraphicsVideoItem도 참조하십시오 .
속성 문서
[since 6.8] audioBufferInput : QAudioBufferInput*
이 속성은 QMediaRecorder 로 사용자 정의 오디오 버퍼를 전송하는 데 사용되는 객체를 보관합니다.
이 열거형은 Qt 6.8에서 도입되었습니다.
액세스 함수:
| QAudioBufferInput * | audioBufferInput() const |
| void | setAudioBufferInput(QAudioBufferInput *input) |
Notifier 신호:
| void | audioBufferInputChanged() |
audioInput : QAudioInput*
오디오를 캡처하는 데 사용 중인 장치를 반환합니다.
액세스 함수:
| QAudioInput * | audioInput() const |
| void | setAudioInput(QAudioInput *input) |
알림 신호:
| void | audioInputChanged() |
audioOutput : QAudioOutput*
세션의 오디오 출력을 반환합니다.
액세스 함수:
| QAudioOutput * | audioOutput() const |
| void | setAudioOutput(QAudioOutput *output) |
알림 신호:
| void | audioOutputChanged() |
camera : QCamera*
이 속성은 동영상 캡처에 사용되는 카메라를 나타냅니다.
이 속성을 사용하여 캡처 세션에 카메라를 추가함으로써 동영상을 녹화하거나 이미지를 촬영할 수 있습니다.
접근 함수:
| QCamera * | camera() const |
| void | setCamera(QCamera *camera) |
알림 신호:
| void | cameraChanged() |
imageCapture : QImageCapture*
이 속성은 정지 이미지를 캡처하는 데 사용되는 객체를 포함합니다.
QImageCapture 객체를 캡처 세션에 추가하면 카메라에서 정지 이미지를 캡처할 수 있습니다.
접근 함수:
| QImageCapture * | imageCapture() |
| void | setImageCapture(QImageCapture *imageCapture) |
알림 신호:
| void | imageCaptureChanged() |
[since 6.12] nativeVideoSource : QObject*
이 속성은 동영상 캡처에 사용되는 기본 동영상 소스를 저장합니다.
현재로서는 네이티브 비디오 소스로 QGStreamerVideoSource 만 설정할 수 있습니다. 캡처 세션에서는 한 번에 QCamera 또는 QGStreamerVideoSource 중 하나만 설정할 수 있습니다.
이 열거형은 Qt 6.12에서 도입되었습니다.
액세스 함수:
| QObject * | nativeVideoSource() const |
| void | setNativeVideoSource(QObject *videoSource) |
알림 신호:
| void | nativeVideoSourceChanged() |
QGStreamerVideoSource 및 QCamera도 참조하십시오 .
recorder : QMediaRecorder*
이 속성은 오디오/비디오 캡처에 사용되는 레코더 객체를 포함합니다.
캡처 세션에 ` QMediaRecorder ` 객체를 추가하면 해당 캡처 세션에서 오디오 및/또는 비디오를 녹화할 수 있습니다.
액세스 함수:
| QMediaRecorder * | recorder() |
| void | setRecorder(QMediaRecorder *recorder) |
알림 신호:
| void | recorderChanged() |
[since 6.5] screenCapture : QScreenCapture*
이 속성은 화면 캡처를 수행하는 데 사용되는 객체를 포함합니다.
이 속성을 사용하여 캡처 세션에 화면 캡처 객체를 추가함으로써 화면을 캡처할 수 있습니다.
이 열거형은 Qt 6.5에서 도입되었습니다.
액세스 함수:
| QScreenCapture * | screenCapture() |
| void | setScreenCapture(QScreenCapture *screenCapture) |
Notifier 신호:
| void | screenCaptureChanged() |
[since 6.8] videoFrameInput : QVideoFrameInput*
이 속성은 사용자 정의 비디오 프레임을 QMediaRecorder 또는 비디오 출력 장치로 전송하는 데 사용되는 객체를 포함합니다.
이 열거형은 Qt 6.8에서 도입되었습니다.
액세스 함수:
| QVideoFrameInput * | videoFrameInput() const |
| void | setVideoFrameInput(QVideoFrameInput *input) |
Notifier 신호:
| void | videoFrameInputChanged() |
videoOutput : QObject*
세션의 비디오 출력을 반환합니다.
액세스 함수:
| QObject * | videoOutput() const |
| void | setVideoOutput(QObject *output) |
알림 신호:
| void | videoOutputChanged() |
[since 6.6] windowCapture : QWindowCapture*
이 속성은 창을 캡처하는 데 사용되는 객체를 저장합니다.
이 속성을 사용하여 캡처 세션에 창 캡처 객체를 추가함으로써 창을 캡처할 수 있습니다.
이 열거형은 Qt 6.6에서 도입되었습니다.
액세스 함수:
| QWindowCapture * | windowCapture() |
| void | setWindowCapture(QWindowCapture *windowCapture) |
Notifier 신호:
| void | windowCaptureChanged() |
멤버 함수 문서
[explicit] QMediaCaptureSession::QMediaCaptureSession(QObject *parent = nullptr)
parent 객체를 통해 미디어 캡처를 위한 세션을 생성합니다.
[override virtual noexcept] QMediaCaptureSession::~QMediaCaptureSession()
세션을 종료합니다.
void QMediaCaptureSession::setAudioInput(QAudioInput *input)
오디오 입력 장치를 ` input`로 설정합니다. 빈 문자열 ` QAudioDevice `로 설정할 경우, 캡처 세션은 운영 체제에서 정의한 기본 입력을 사용합니다.
참고: audioInput 속성의설정 함수입니다.
audioInput()도 참조하십시오 .
void QMediaCaptureSession::setAudioOutput(QAudioOutput *output)
오디오 출력 장치를 output 로 설정합니다.
오디오 출력 장치를 설정하면 오디오 입력 장치에서 오디오 라우팅이 가능해집니다.
참고: audioOutput 속성에 대한설정 함수입니다.
audioOutput()도 참조하십시오 .
void QMediaCaptureSession::setVideoOutput(QObject *output)
QObject(output)를 캡처 세션의 비디오 미리보기로 설정합니다.
QObject 기반 미리보기에는 QVideoSink 를 반환하는 호출 가능한 videoSink() 메서드가 있어야 합니다.
이전에 설정된 미리 보기는 분리됩니다.
참고: videoOutput 속성에 대한세터 함수입니다.
videoOutput()도 참조하십시오 .
void QMediaCaptureSession::setVideoSink(QVideoSink *sink)
QVideoSink(sink)를 캡처 세션의 비디오 미리보기로 설정합니다.
QObject 기반 미리보기에는 QVideoSink 를 반환하는 호출 가능한 videoSink() 메서드가 있어야 합니다.
이전에 설정된 미리보기가 분리됩니다.
videoSink()도 참조하십시오 .
QVideoSink *QMediaCaptureSession::videoSink() const
해당 세션의 QVideoSink 를 반환합니다.
setVideoSink()도 참조하십시오 .
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.