View streaming from Flash Media Server with Qt


Qt is a cross-platform application and UI framework for developers using C++ or QML, a CSS & JavaScript like language. Qt Creator is the supporting Qt IDE.
Normally using a Flash/AIR client to view a streaming from Adobe Media Server/Flash Media Server, but if we need a client in Qt/C++ to view a streaming?

What is QtAV?

A media playback framework based on Qt and FFmpeg. It helps you to write a player easily. https://github.com/wang-bin/QtAV

See an example with QtAV and Flash Media Server/Adobe Media Server

  1. #include <QApplication>
  2. #include <QtAV/AVPlayer.h>
  3. #include <QtAV/WidgetRenderer.h>
  4.  
  5. int main(int argc, char *argv[])
  6. {
  7.     QApplication a(argc, argv);
  8.     QtAV::WidgetRenderer renderer;
  9.     renderer.show();
  10.     QtAV::AVPlayer player;
  11.     player.setRenderer(&renderer);
  12.     player.play("rtmp://localhost/live/streamName");
  13.     return a.exec();
  14. }

Very easy =D

Reference
https://github.com/wang-bin/QtAV

Was this article helpful? feel free to make a donation and help keep the blog in the air
Adobe, Flash Media Server, Qt , , ,

Leave a Reply