- Qt Documentation
- Changing the video output of QMediaPlayer does not work properly on Linux/Gstreamer
- Subscribe to RSS
- Video Output
Qt DocumentationThe VideoPlayer widget is used to perform playback of video. With VideoPlayer you can get results quickly and easily. You can do the standard playback tasks like playpauseand stopbut also set a playback volume and seek - if the media and backend supports seeking. VideoPlayer is provided for convenience and removes the need to create a media graph with a MediaObjectAudioOutputand VideoWidget. If you need functionality not supported by the player, you can build this graph yourself. Keep in mind that when the VideoPlayer instance is deleted the playback will stop. Note also that most of the functions in this class are asynchronous. For instance, a media source may not play immediately after you call the play function. See also Phonon Module and MediaObject. Constructs a new VideoPlayer instance with the specified parent. Constructs a new video widget with a parent using Phonon::VideoCategory as its category. On destruction the playback is stopped, also the audio output is removed so that the desktop mixer will not show the application anymore. Returns true if it is currently paused; otherwise returns false if it is currently playing or stopped. Returns true if it is currently playing; otherwise returns false if it is currently stopped or paused. Starts pre-loading the media data from the specified source and filling audio buffers in the backend. When there's already a media playing or paused it will be stopped the finished signal will not be emitted. See also MediaObject::setCurrentSource. The media object can be accessed directly instead of using the VideoPlayer s convenience functions, e. It is also possible to give the object to other Phonon widgets, e. Plays the media from the given source. Starts playback as fast as possible. This can take a considerable time depending on the URL and the backend. If you need low latency between calling play and the sound actually starting to play on your output device you need to use MediaObject and be able to set the URL before calling play. Note that. See also MediaObject::play and play. Seeks to the requested time. Note that the backend is free to ignore the seek request if the media source isn't seekable; you can check this by asking the media object of the VideoPlayer. The call is asynchronous, so currentTime can still be the old value right after this method was called. If all you need is a slider that shows the current position and allows the user to seek, use the class SeekSlider. Documentation contributions included herein are the copyrights of their respective owners. Qt and respective logos are trademarks of The Qt Company Ltd. All other trademarks are property of their respective owners. Detailed Description The VideoPlayer widget is used to perform playback of video. See also MediaObject::pause.
Changing the video output of QMediaPlayer does not work properly on Linux/Gstreamer
The VideoOutput item supports untransformed, stretched, and uniformly scaled video presentation. For a description of stretched uniformly scaled presentation, see the fillMode property description. If the backend only supports QVideoWindowControlthe 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. See also MediaPlayer and Camera. This property allows you to enable and disable auto orientation of the video stream, so that its orientation always matches the orientation of the screen. If autoOrientation is enabled, the orientation property is overwritten. This 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. This property holds the list of video filters that are run on the video frames. The order of the filters in the list matches the order in which they will be invoked on the video frames. The objects in the list must be instances of a subclass of QAbstractVideoFilter. Set this property to define what VideoOutput should show when playback is finished or stopped. 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. See also autoOrientation. This property holds the source item providing the video frames like MediaPlayer or Camera. This property holds the area of the source video content that is considered for rendering. The values are in source pixel coordinates, adjusted for the source's pixel aspect ratio. 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. Only when the video source has a viewport set, these values will differ. Given normalized coordinates point that is, each component in the range of 0 to 1. This mapping is affected by the orientation. Given a rectangle rectangle in normalized coordinates that is, each component in the range of 0 to 1. Given a point point in source coordinates, return the corresponding point in item coordinates. Given a point point in item coordinates, return the corresponding point in source coordinates. 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. No clamping is performed. Given a rectangle rectangle in source coordinates, return the corresponding rectangle in item coordinates. Given a rectangle rectangle in item coordinates, return the corresponding rectangle in source coordinates. Given a rectangle rectangle in item coordinates, return the corresponding rectangle in normalized source coordinates. Documentation contributions included herein are the copyrights of their respective owners.
Subscribe to RSS
The QMediaPlayer class is a high level media playback class. It can be used to playback such content as songs, movies and internet radio. The content to playback is specified as a QMediaContent object, which can be thought of as a main or canonical URL with additional information attached. When provided with a QMediaContent playback may be able to commence. It stores an OR combination of Flag values. As the life time of QMediaPlayer can be longer than the playback of one QMediaContentthis property may change over time, the audioAvailableChanged signal can be used to monitor it's status. It can be set to specify the type of audio being played, allowing the system to make appropriate decisions when it comes to volume, routing or post-processing. This property holds the percentage of the temporary buffer filled before playback begins or resumes, from 0 empty to full. When the player object is buffering; this property holds the percentage of the temporary buffer that is filled. If the value is anything lower thanmediaStatus will return StalledMedia. This property holds the current active media content being played by the player object. This value could be different from QMediaPlayer::media property if a playlist is used. In this case currentMedia indicates the current media content being processed by the player, while QMediaPlayer::media property contains the original playlist. See also QMediaContent and media. It can be set to specify the type of audio being played when the backend supports audio roles unknown to Qt. Specifying a role allows the system to make appropriate decisions when it comes to volume, routing or post-processing. See also supportedCustomAudioRoles. The value is the total playback time in milliseconds of the current media. The value may change across the life time of the QMediaPlayer object and may not be available when initial playback begins, connect to the durationChanged signal to receive status notifications. The player object will use the QMediaContent for selection of the content to be played. See also QMediaContent and currentMedia. This value is a multiplier applied to the media's standard play rate. By default this value is 1. Values higher than 1. Values less than zero can be set and indicate the media will rewind at the multiplier of the standard pace. Not all playback services support change of the playback rate. It is framework defined as to the status and quality of audio and video while fast forwarding or rewinding. If the media playlist is used as a source, QMediaPlayer::currentMedia is updated with a current playlist item. The value is the current playback position, expressed in milliseconds since the beginning of the media. Periodically changes in the position will be indicated with the signal positionChangedthe interval between updates can be set with QMediaObject 's method setNotifyInterval. If seeking is supported this property will be true; false otherwise. The status of this property may change across the life time of the QMediaPlayer object, use the seekableChanged signal to monitor changes. See also mediaStatusplaypauseand stop. If available, the QVideoWidget class can be used to view the video. As the life time of QMediaPlayer can be longer than the playback of one QMediaContentthis property may change over time, the videoAvailableChanged signal can be used to monitor it's status.