• PySide 模块
  • PySide.QtMultimedia
  • 内容表

    上一话题

    QAbstractVideoBuffer

    下一话题

    QAudioEngineFactoryInterface

    QVideoSurfaceFormat

    概要

    函数

    详细描述

    PySide.QtMultimedia.QVideoSurfaceFormat class specifies the stream format of a video presentation surface.

    A video surface presents a stream of video frames. The surface's format describes the type of the frames and determines how they should be presented.

    The core properties of a video stream required to setup a video surface are the pixel format given by PySide.QtMultimedia.QVideoSurfaceFormat.pixelFormat() , and the frame dimensions given by PySide.QtMultimedia.QVideoSurfaceFormat.frameSize() .

    If the surface is to present frames using a frame's handle a surface format will also include a handle type which is given by the PySide.QtMultimedia.QVideoSurfaceFormat.handleType() 函数。

    The region of a frame that is actually displayed on a video surface is given by the PySide.QtMultimedia.QVideoSurfaceFormat.viewport() . A stream may have a viewport less than the entire region of a frame to allow for videos smaller than the nearest optimal size of a video frame. For example the width of a frame may be extended so that the start of each scan line is eight byte aligned.

    Other common properties are the PySide.QtMultimedia.QVideoSurfaceFormat.pixelAspectRatio() , PySide.QtMultimedia.QVideoSurfaceFormat.scanLineDirection() ,和 PySide.QtMultimedia.QVideoSurfaceFormat.frameRate() . Additionally a stream may have some additional type specific properties which are listed by the dynamicPropertyNames() function and can be accessed using the PySide.QtMultimedia.QVideoSurfaceFormat.property() ,和 PySide.QtMultimedia.QVideoSurfaceFormat.setProperty() 函数。

    class PySide.QtMultimedia. QVideoSurfaceFormat
    class PySide.QtMultimedia. QVideoSurfaceFormat ( size , pixelFormat [ , handleType=QAbstractVideoBuffer.NoHandle ] )
    class PySide.QtMultimedia. QVideoSurfaceFormat ( format )
    参数:

    Constructs a null video stream format.

    构造副本为 other .

    PySide.QtMultimedia.QVideoSurfaceFormat. YCbCrColorSpace

    枚举视频帧的 Y'CbCr 色彩空间。

    常量 描述
    QVideoSurfaceFormat.YCbCr_Undefined No color space is specified.
    QVideoSurfaceFormat.YCbCr_BT601 A Y'CbCr color space defined by ITU-R recommendation BT.601 with Y value range from 16 to 235, and Cb/Cr range from 16 to 240. Used in standard definition video.
    QVideoSurfaceFormat.YCbCr_BT709 A Y'CbCr color space defined by ITU-R BT.709 with the same values range as YCbCr_BT601 . Used for HDTV.
    QVideoSurfaceFormat.YCbCr_xvYCC601 The BT.601 color space with the value range extended to 0 to 255. It is backward compatibile with BT.601 and uses values outside BT.601 range to represent wider colors range.
    QVideoSurfaceFormat.YCbCr_xvYCC709 The BT.709 color space with the value range extended to 0 to 255.
    QVideoSurfaceFormat.YCbCr_JPEG The full range Y'CbCr color space used in JPEG files.
    PySide.QtMultimedia.QVideoSurfaceFormat. Direction

    枚举视频扫描线的布局方向。

    常量 描述
    QVideoSurfaceFormat.TopToBottom Scan lines are arranged from the top of the frame to the bottom.
    QVideoSurfaceFormat.BottomToTop Scan lines are arranged from the bottom of the frame to the top.
    PySide.QtMultimedia.QVideoSurfaceFormat. frameHeight ( )
    返回类型: PySide.QtCore.int

    Returns the height of frame in a video stream.

    PySide.QtMultimedia.QVideoSurfaceFormat. frameRate ( )
    返回类型: PySide.QtCore.qreal

    Returns the frame rate of a video stream in frames per second.

    PySide.QtMultimedia.QVideoSurfaceFormat. frameSize ( )
    返回类型: PySide.QtCore.QSize

    Returns the size of frames in a video stream.

    PySide.QtMultimedia.QVideoSurfaceFormat. frameWidth ( )
    返回类型: PySide.QtCore.int

    返回视频流中帧的宽度。

    PySide.QtMultimedia.QVideoSurfaceFormat. handleType ( )
    返回类型: PySide.QtMultimedia.QAbstractVideoBuffer.HandleType

    Returns the type of handle the surface uses to present the frame data.

    If the handle type is QAbstractVideoBuffer.NoHandle buffers with any handle type are valid provided they can be mapped 采用 QAbstractVideoBuffer.ReadOnly flag. If the PySide.QtMultimedia.QVideoSurfaceFormat.handleType() 不是 QAbstractVideoBuffer.NoHandle then the handle type of the buffer be the same as that of the surface format.

    PySide.QtMultimedia.QVideoSurfaceFormat. isValid ( )
    返回类型: PySide.QtCore.bool

    Identifies if a video surface format has a valid pixel format and frame size.

    Returns true if the format is valid, and false otherwise.

    PySide.QtMultimedia.QVideoSurfaceFormat. __ne__ ( format )
    参数: format PySide.QtMultimedia.QVideoSurfaceFormat
    返回类型: PySide.QtCore.bool

    返回 true 若 other is different to a video format, and false if they are the same.

    PySide.QtMultimedia.QVideoSurfaceFormat. __eq__ ( format )
    参数: format PySide.QtMultimedia.QVideoSurfaceFormat
    返回类型: PySide.QtCore.bool

    返回 true 若 other is the same as a video format, and false if they are the different.

    PySide.QtMultimedia.QVideoSurfaceFormat. pixelAspectRatio ( )
    返回类型: PySide.QtCore.QSize

    返回视频流的像素宽高比。

    PySide.QtMultimedia.QVideoSurfaceFormat. pixelFormat ( )
    返回类型: PySide.QtMultimedia.QVideoFrame.PixelFormat

    返回视频流中帧的像素格式。

    PySide.QtMultimedia.QVideoSurfaceFormat. 特性 ( name )
    参数: name – str
    返回类型: object

    Returns the value of the video format's name 特性。

    PySide.QtMultimedia.QVideoSurfaceFormat. propertyNames ( )
    返回类型:

    Returns a list of video format dynamic property names.

    PySide.QtMultimedia.QVideoSurfaceFormat. scanLineDirection ( )
    返回类型: PySide.QtMultimedia.QVideoSurfaceFormat.Direction

    Returns the direction of scan lines.

    PySide.QtMultimedia.QVideoSurfaceFormat. setFrameRate ( rate )
    参数: rate PySide.QtCore.qreal

    Sets the frame rate of a video stream in frames per second.

    PySide.QtMultimedia.QVideoSurfaceFormat. setFrameSize ( width , height )
    参数:
    • width PySide.QtCore.int
    • height PySide.QtCore.int

    这是重载函数。

    设置 width and height of frames in a video stream.

    This will reset the PySide.QtMultimedia.QVideoSurfaceFormat.viewport() to fill the entire frame.

    PySide.QtMultimedia.QVideoSurfaceFormat. setFrameSize ( size )
    参数: size PySide.QtCore.QSize

    Sets the size of frames in a video stream to size .

    This will reset the PySide.QtMultimedia.QVideoSurfaceFormat.viewport() to fill the entire frame.

    PySide.QtMultimedia.QVideoSurfaceFormat. setPixelAspectRatio ( ratio )
    参数: ratio PySide.QtCore.QSize

    Sets a video stream's pixel aspect ratio .

    PySide.QtMultimedia.QVideoSurfaceFormat. setPixelAspectRatio ( width , height )
    参数:
    • width PySide.QtCore.int
    • height PySide.QtCore.int

    这是重载函数。

    设置 horizontal and vertical elements of a video stream's pixel aspect ratio.

    PySide.QtMultimedia.QVideoSurfaceFormat. setProperty ( name , value )
    参数:
    • name – str
    • value – object

    Sets the video format's name 特性到 value .

    PySide.QtMultimedia.QVideoSurfaceFormat. setScanLineDirection ( direction )
    参数: direction PySide.QtMultimedia.QVideoSurfaceFormat.Direction

    设置 direction of scan lines.

    PySide.QtMultimedia.QVideoSurfaceFormat. setViewport ( 视口 )
    参数: 视口 PySide.QtCore.QRect

    Sets the viewport of a video stream to 视口 .

    PySide.QtMultimedia.QVideoSurfaceFormat. setYCbCrColorSpace ( colorSpace )
    参数: colorSpace PySide.QtMultimedia.QVideoSurfaceFormat.YCbCrColorSpace

    Sets the Y'CbCr color space of a video stream. It is only used with raw YUV frame types.

    PySide.QtMultimedia.QVideoSurfaceFormat. sizeHint ( )
    返回类型: PySide.QtCore.QSize

    Returns a suggested size in pixels for the video stream.

    This is the size of the viewport scaled according to the pixel aspect ratio.

    PySide.QtMultimedia.QVideoSurfaceFormat. 视口 ( )
    返回类型: PySide.QtCore.QRect

    Returns the viewport of a video stream.

    The viewport is the region of a video frame that is actually displayed.

    By default the viewport covers an entire frame.

    PySide.QtMultimedia.QVideoSurfaceFormat. yCbCrColorSpace ( )
    返回类型: PySide.QtMultimedia.QVideoSurfaceFormat.YCbCrColorSpace

    Returns the Y'CbCr color space of a video stream.