Thursday, 15 April 2010

c++ - Playing video on fullscreen mode in QT -


I use QMediaPlayer (multiple, not shared) video file (MP3) HDMI I have created a video playback on a monitor, output video ring on multiple monitors on a single computer connected to a DVI cable, but I need to run this video as one on multiple monitors I need a CrossPlatform (Linux / Windows) solution and I Sector must provide configuration monitor to run video applications. Is it possible to organize the tools of QT 5.4 or extended C ++ libraries? If so, please tell me the best way to do this. Sorry for the bad english and thanks in advance for help!

Hello! I need to run video overlay images. I'm using QT Components QMediaPlayer and QGraphicsVideoItem to organize it. But I could not stretch the video to fill the screen (fullscreen mode). It looks like: Output video Please help me Thank you.

  #include "mainwindow.h" #include "ui_mainwindow.h" #include & lt; QWebView & gt; # Include & lt; QVBoxLayout & gt; # Include & lt; QFile & gt; # Include & lt; QMediaPlayer & gt; # Include & lt; QtMultimedia & gt; # Include & lt; QGraphicsVideoItem & gt; Main Window :: Main Window (QWidget * Guardian): QMainWindow (Parent), UI (New UI :: Menundu) {UI- & gt; SetupUi (this); QVBoxLayout * Layout = New QVBoxLayout; Layout-> Set Contents Margin (0, 0, 0, 0); This- & gt; CentralWidget () - & gt; SetLayout (layout); Layout & gt; AddWidget (UI-> GraphicsView); UI-> Graphicsview-> Set stylesheets ("background: transparent"); This- & gt; ShowMaximized (); QMediaPlayer * Player = New QMediaPlayer (); QGraphicsVideoItem * items = new QGraphicsVideoItem; QGraphicsScene * View = New QGraphicsScene; Items, & gt; SetSize (QSize (UI-> GraphicsView-> Width (), UI-> GraphicsView-> Height ()); UI- & gt; GraphicsView-> SetScene (view); Player & gt; SetVideoOutput (item); QDebug () & lt; & Lt; item; UI- & gt; GraphicsView-> View () - & gt; AddItem (item); QPixmap pix1 ("/home/ibragim/examples/ntv.png"); Player & gt; SetMedia (QUrl :: fromLocalFile ("/ home / IbraGimim / Example / sm.mp4")); Player & gt; Play (); UI- & gt; GraphicsView-> Show (); UI- & gt; GraphicsView-> View () - & gt; AddPixmap (pix1.scaledToHeight (100)) - & gt; SetPos (160,30); } Main Window :: ~ MAIN WANDO () {DELETE UI; }  

It's possible that you want ...

< Pre> Zero QGraphicsView :: fitInView (const QGraphicsItem * item, Qt :: AspectRatioMode aspectRatioMode = Qt :: IgnoreAspectRatio) This is an overloaded function. Ensures that the item fits tightly inside the scene, aspect is scaling the view according to RITIO mode.

No comments:

Post a Comment