Class VideoRecorder

    Definition

    Namespace:
    Tizen.Multimedia
    Assembly:
    Tizen.Multimedia.Recorder.dll

    Provides the ability to control video recording.

    public class VideoRecorder : Recorder, IDisposable
    Inheritance
    object
    Recorder
    VideoRecorder
    Implements
    System.IDisposable

    Constructors

    View Source

    VideoRecorder(Camera, RecorderVideoCodec, RecorderAudioCodec, RecorderFileFormat)

    Initializes a new instance of the VideoRecorder class with the specified camera, video codec, audio codec, and file format.

    Declaration
    public VideoRecorder(Camera camera, RecorderVideoCodec videoCodec, RecorderAudioCodec audioCodec, RecorderFileFormat fileFormat)
    Parameters
    Type Name Description
    Camera camera

    The camera object.

    RecorderVideoCodec videoCodec

    The codec for video encoding.

    RecorderAudioCodec audioCodec

    The codec for audio encoding.

    RecorderFileFormat fileFormat

    The format of result file.

    Remarks

    If the state of Camera is Created, the PreviewPixelFormat will be changed to the recommended format for recording.

    The initial state of the Recorder will be Ready if the state of Camera is Preview or Captured.

    Exceptions
    Type Condition
    System.InvalidOperationException

    An internal error occurred.

    System.NotSupportedException

    A required feature is not supported.
    -or-
    videoCodec is not supported.
    -or-
    audioCodec is not supported.
    -or-
    fileFormat is not supported with the specified video codec.
    -or-
    fileFormat is not supported with the specified audio codec.

    System.ArgumentException

    videoCodec is not valid.
    -or-
    audioCodec is not valid.
    -or-
    fileFormat is not valid.

    System.ObjectDisposedException

    camera has been disposed of.

    System.ArgumentNullException

    camera is null.

    See Also
    GetSupportedAudioCodecs()
    GetSupportedVideoCodecs()
    GetSupportedFileFormats()
    GetSupportedFileFormats(RecorderAudioCodec)
    GetSupportedFileFormats(RecorderVideoCodec)
    SetFormatAndCodec(RecorderVideoCodec, RecorderFileFormat)
    SetFormatAndCodec(RecorderVideoCodec, RecorderAudioCodec, RecorderFileFormat)
    View Source

    VideoRecorder(Camera, RecorderVideoCodec, RecorderFileFormat)

    Initializes a new instance of the VideoRecorder class with the specified camera, video codec, and file format.

    Declaration
    public VideoRecorder(Camera camera, RecorderVideoCodec videoCodec, RecorderFileFormat fileFormat)
    Parameters
    Type Name Description
    Camera camera

    The camera object.

    RecorderVideoCodec videoCodec

    The codec for video encoding.

    RecorderFileFormat fileFormat

    The format of result file.

    Remarks

    If the state of Camera is Created, the PreviewPixelFormat will be changed to the recommended format for recording.

    The initial state of the Recorder will be Ready if the state of Camera is Preview or Captured.

    Exceptions
    Type Condition
    System.InvalidOperationException

    An internal error occurred.

    System.NotSupportedException

    A required feature is not supported.
    -or-
    videoCodec is not supported.
    -or-
    fileFormat is not supported with the specified video codec.

    System.ArgumentException

    videoCodec is not valid.
    -or-
    fileFormat is not valid.
    -or-
    camera is being used by another object.

    System.ObjectDisposedException

    camera has been disposed of.

    System.ArgumentNullException

    camera is null.

    See Also
    GetSupportedVideoCodecs()
    GetSupportedFileFormats()
    GetSupportedFileFormats(RecorderVideoCodec)
    SetFormatAndCodec(RecorderVideoCodec, RecorderFileFormat)
    SetFormatAndCodec(RecorderVideoCodec, RecorderAudioCodec, RecorderFileFormat)

    Properties

    View Source

    VideoBitRate

    Gets or sets the bitrate of the video encoder in bits per second.

    Declaration
    public int VideoBitRate { get; set; }
    Property Value
    Type Description
    int
    Remarks

    To set, the recorder must be in the Idle or Ready state.

    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    value is less than or equal to zero.

    System.InvalidOperationException

    The recorder is not in the valid state.

    System.ObjectDisposedException

    The recorder already has been disposed of.

    View Source

    VideoCodec

    Gets the audio codec for encoding an audio stream.

    Declaration
    public RecorderVideoCodec VideoCodec { get; }
    Property Value
    Type Description
    RecorderVideoCodec
    View Source

    VideoMotionRate

    Gets or sets the video recording motion rate.

    Declaration
    public double VideoMotionRate { get; set; }
    Property Value
    Type Description
    double
    Remarks

    The attribute is valid only in a video recorder.
    If the rate is in range of 0-1, the video is recorded in a slow motion mode.
    If the rate is greater than 1, the video is recorded in a fast motion mode.

    To set, the recorder must be in the Idle or the Ready state.

    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    The value is less than or equal to 0.

    System.InvalidOperationException

    The recorder is not in the valid state.

    System.ObjectDisposedException

    The recorder already has been disposed of.

    View Source

    VideoOrientationTag

    Gets or sets the orientation in the video metadata tag.

    Declaration
    public Rotation VideoOrientationTag { get; set; }
    Property Value
    Type Description
    Rotation

    A Rotation that specifies the type of orientation.

    Exceptions
    Type Condition
    System.ArgumentException

    value is not valid.

    System.ObjectDisposedException

    The recorder already has been disposed of.

    View Source

    VideoResolution

    Gets or sets the resolution of the video recording.

    Declaration
    public Size VideoResolution { get; set; }
    Property Value
    Type Description
    Size
    Remarks

    To set, the recorder must be in the Idle or the Ready state.

    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    Width or height of value is less than or equal to zero.

    System.NotSupportedException

    value is not supported.

    System.InvalidOperationException

    The recorder is not in the valid state.

    System.ObjectDisposedException

    The recorder already has been disposed of.

    See Also
    GetSupportedVideoResolutions(CameraDevice)

    Methods

    View Source

    GetSupportedVideoCodecs()

    Gets the video encoders that the current device supports.

    Declaration
    public static IEnumerable<RecorderVideoCodec> GetSupportedVideoCodecs()
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<T><RecorderVideoCodec>
    Exceptions
    Type Condition
    System.NotSupportedException

    A required feature is not supported.

    View Source

    GetSupportedVideoResolutions(CameraDevice)

    Gets the video resolutions that the current device supports.

    Declaration
    public static IEnumerable<Size> GetSupportedVideoResolutions(CameraDevice device)
    Parameters
    Type Name Description
    CameraDevice device

    The camera device to retrieve the supported resolutions.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<T><Size>
    Exceptions
    Type Condition
    System.NotSupportedException

    A required feature is not supported.

    System.ArgumentException

    device is invalid.

    View Source

    SetFormatAndCodec(RecorderVideoCodec, RecorderAudioCodec, RecorderFileFormat)

    Sets the video codec, audio codec, and the file format for recording.

    Declaration
    public void SetFormatAndCodec(RecorderVideoCodec videoCodec, RecorderAudioCodec audioCodec, RecorderFileFormat fileFormat)
    Parameters
    Type Name Description
    RecorderVideoCodec videoCodec

    The codec for video encoding.

    RecorderAudioCodec audioCodec

    The codec for audio encoding.

    RecorderFileFormat fileFormat

    The format of result file.

    Exceptions
    Type Condition
    System.NotSupportedException

    videoCodec is not supported.
    -or-
    audioCodec is not supported.
    -or-
    fileFormat is not supported with the specified video codec.
    -or-
    fileFormat is not supported with the specified audio codec.

    System.ArgumentException

    videoCodec is not valid.
    -or-
    audioCodec is not valid.
    -or-
    fileFormat is not valid.

    See Also
    GetSupportedAudioCodecs()
    GetSupportedVideoCodecs()
    GetSupportedFileFormats()
    GetSupportedFileFormats(RecorderAudioCodec)
    GetSupportedFileFormats(RecorderVideoCodec)
    SetFormatAndCodec(RecorderVideoCodec, RecorderFileFormat)
    Start(string)
    View Source

    SetFormatAndCodec(RecorderVideoCodec, RecorderFileFormat)

    Sets the video codec and the file format for recording. Audio will not be recorded.

    Declaration
    public void SetFormatAndCodec(RecorderVideoCodec videoCodec, RecorderFileFormat fileFormat)
    Parameters
    Type Name Description
    RecorderVideoCodec videoCodec

    The codec for video encoding.

    RecorderFileFormat fileFormat

    The format of result file.

    Exceptions
    Type Condition
    System.NotSupportedException

    videoCodec is not supported.
    -or-
    fileFormat is not supported with the specified video codec.

    System.ArgumentException

    videoCodec is not valid.
    -or-
    fileFormat is not valid.

    See Also
    GetSupportedVideoCodecs()
    GetSupportedFileFormats()
    GetSupportedFileFormats(RecorderVideoCodec)
    SetFormatAndCodec(RecorderVideoCodec, RecorderAudioCodec, RecorderFileFormat)
    Start(string)

    Implements

    System.IDisposable
    • View Source
    Back to top Copyright © 2016-2024 Samsung
    Generated by DocFX