VideoOutputThe VideoOutput type allows you to render video or camera viewfinder. More... Inherits Item Properties
Methods
Detailed DescriptionVideoOutput is part of the QtMultimedia 5.0 module. import QtQuick 2.0 import QtMultimedia 5.0 Rectangle { width: 800 height: 600 color: "black" MediaPlayer { id: player source: "file://video.webm" autoPlay: true } VideoOutput { id: videoOutput source: player anchors.fill: parent } } The VideoOutput item supports untransformed, stretched, and uniformly scaled video presentation. For a description of stretched uniformly scaled presentation, see the fillMode property description. The VideoOutput item works with backends that support either QVideoRendererControl or QVideoWindowControl. If the backend only supports QVideoWindowControl, the video is rendered onto an overlay window that is layered on top of the QtQuick window. Due to the nature of the video overlays, certain features are not available for these kind of backends:
Most backends however do support QVideoRendererControl and therefore don't have the limitations listed above. Screen SaverIf it is likely that an application will be playing video for an extended period of time without user interaction it may be necessary to disable the platform's screen saver. The ScreenSaver (from QtSystemInfo) may be used to disable the screensaver in this fashion: import QtSystemInfo 5.0 ScreenSaver { screenSaverEnabled: false } See also MediaPlayer and Camera. Property DocumentationThis property holds the item coordinates of the area that would contain video to render. With certain fill modes, this rectangle will be larger than the visible area of the VideoOutput. This property is useful when other coordinates are specified in terms of the source dimensions - this applied for relative (normalized) frame coordinates in the range of 0 to 1.0. Areas outside this will be transparent. See also mapRectToItem() and mapPointToItem(). Set this property to define how the video is scaled to fit the target area.
The default fill mode is PreserveAspectFit. In some cases the source video stream requires a certain orientation to be correct. This includes sources like a camera viewfinder, where the displayed viewfinder should match reality, no matter what rotation the rest of the user interface has. This property allows you to apply a rotation (in steps of 90 degrees) to compensate for any user interface rotation, with positive values in the anti-clockwise direction. The orientation change will also affect the mapping of coordinates from source to viewport. This property holds the source item providing the video frames like MediaPlayer or Camera. If you are extending your own C++ classes to interoperate with VideoOutput, you can either provide a QObject based class with a mediaObject property that exposes a QMediaObject derived class that has a QVideoRendererControl available, or you can provide a QObject based class with a writable videoSurface property that can accept a QAbstractVideoSurface based class and can follow the correct protocol to deliver QVideoFrames to it. This property holds the area of the source video content that is considered for rendering. The values are in source pixel coordinates. Note that typically the top left corner of this rectangle will be 0,0 while the width and height will be the width and height of the input content. The orientation setting does not affect this rectangle. Method DocumentationGiven normalized coordinates point (that is, each component in the range of 0 to 1.0), return the mapped point that it corresponds to (in item coordinates). This mapping is affected by the orientation. Depending on the fill mode, this point may lie outside the rendered rectangle. Given a point point in item coordinates, return the corresponding point in source coordinates. This mapping is affected by the orientation. If the supplied point lies outside the rendered area, the returned point will be outside the source rectangle. Given a point point in item coordinates, return the corresponding point in normalized source coordinates. This mapping is affected by the orientation. If the supplied point lies outside the rendered area, the returned point will be outside the source rectangle. No clamping is performed. Given a rectangle rectangle in normalized coordinates (that is, each component in the range of 0 to 1.0), return the mapped rectangle that it corresponds to (in item coordinates). This mapping is affected by the orientation. Depending on the fill mode, this rectangle may extend outside the rendered rectangle. Given a rectangle rectangle in source coordinates, return the corresponding rectangle in item coordinates. This mapping is affected by the orientation. Depending on the fill mode, this rectangle may extend outside the rendered rectangle. Given a rectangle rectangle in item coordinates, return the corresponding rectangle in source coordinates. This mapping is affected by the orientation. This mapping is affected by the orientation. If the supplied point lies outside the rendered area, the returned point will be outside the source rectangle. Given a rectangle rectangle in item coordinates, return the corresponding rectangle in normalized source coordinates. This mapping is affected by the orientation. This mapping is affected by the orientation. If the supplied point lies outside the rendered area, the returned point will be outside the source rectangle. No clamping is performed. |