A video player based on Qt and FFmpeg



  • my project: https://github.com/wang-bin/QtAV
    It is also can be found on sourceforge. you can download development files when using mingw:
    http://sourceforge.net/projects/qtav

    I am writing a player just using Qt and FFmpeg. I find that it is not very difficult.
    Building in Windows requires FFmpeg and portaudio development files. You can get them from http://sourceforge.net/projects/qtav/files/depends They can used by both MinGW and VC.
    The qmake project is well designed. When running qmake for the first time, it will check whether FFmpeg and portaudio is support. It also does other optional check such as GDI+ and Direct2D. To recheck, you may delete ".qmake.cache" in build dir.

    Features:
    play, pause, seek, play 1 frame, speed control, display quality control, volume control, video capture, eq, audio channel and track select, fullscreen, HW decoding(DXVA2, CUDA) etc.
    Multiple render engine support: QPainter, OPenGL, GDI+(win), Direct2D(win)
    low memory usage when playing large files(less then mplayer)

    QtAV supports QML since 1.2.4
    QtMultiMedia in Qt5 is good, but it relies on the platforms. Usually you can not play many videos unless you install the codecs. With QtAV, any format supported by FFmpeg can be decoded, without installing additional codecs.
    Replacing QtMultiMedia qml code by QtAV is easy. The qmlvideofx example in QtMultiMedia module can be changed to QtAV engine with only several lines change.
    !https://a.fsdn.com/con/app/proj/qtav/screenshots/Player-QtAV+QML.png(player using QML+QtAV)!

    Miroslav Bendik made QtAV with CedarX video hardware acceleration running on A13-OLinuXino "Youtube":http://www.youtube.com/watch?v=u3mvDe3GBPI . Here is a screenshot of his qmlvideofx with QtAV
    !https://a.fsdn.com/con/app/proj/qtav/screenshots/QtAV+qmlvideofx_on_Olinuxino+cedar+hardware+decoding.jpg(qmlvideofx with QtAV on OLinuXino)!

    TODO:
    More and better hardware decoding, more render engines, component framework, effects(filters), subtitle, better gui etc.

    QtAV runs fine on android now!
    !http://wang-bin.github.io/qtav.org/screenshots/QMLPlayer-on-Android.jpg(android)!
    version 1.3.3 2014-04-20

    • CUDA support for windows and linux. (The first player/library support CUDA decoding on linux?)

    • Renderering 16-bit YUV (for example Hi10P) for both OpenGL and OpenGL ES2.

    maybe it's the first player/library supports rendering 10-bit using OpenGL ES2. VLC, XBMC and mplayer can't
    Supported format: 9, 10, 12, 14, 16 bit, planar, little/big endian.

    The performance is good. I tested a 10bit h264 video on HTC butterfly S, cpu usage is about 10% less than vlc.

    • Support Sailfish OS. Works perfectly.

    • Fix mosaics for some videos since QtAV1.3.1

    • Better seeking

    • New VideoOutput class with QObject features support

    • Improve cedarv hardware decoding.

    • Audio channel api for QML

    • FFmpeg build script supports maemo5, meego, sailfish, android, mingw gcc, msvc

    • Fix build error for Qt 5.0

    • player:

    • fix wrong video display size when fullscreen mode changed or toolbar hidden

    version 1.3.2 2014-03-16

    • OpenGL improvement and better performance(works on iOS and Android). Less cpu usage than vlc:
    • enable GLSL if supported
    • use GLSL to render YUV frames
    • GLSL based video equalizer
    • XV bug fix and improvement. Supports NV12. Supports video equalizer.

    • Play from QIODevice support

    • Capture YUV frames support.

    • Fix wrong duration in OSD

    • CUDA decoder working in progress

    • player:

    • no gui blocking while opening a stream
    • add config dialog
    • Regressions:
    • OpenGL can not display H10p

    version 1.3.1 2014-01-29

    • Initial OpenAL support.

    • Fix hardware decoding crashes: seeking, packet loss(e.g. bad network)

    • Allwinner's CedarX hardware decoding support. Thanks Miroslav Bendik.

    • FFmpeg log and error handling. New class: AVError

    • AVDictionary support for decoder and demuxer. API: AVPlayer::setOptionsForXXX()

    • Fix crash on app exit

    • Fix Hi10bits crash

    • Build:

      • fix XXX_EXPORT macro confliction.

      • configurable qmake project etc.

    • QMLPlayer: better UI

    • player:

      • wheel to zoom in/out.

      • apply decoder without restart.

      • exit on main window close.

      • move EventHandler to player.

    • Installer: ubuntu support.

    • Screen saver for OSX, X11. Improve windows
      !http://static.oschina.net/uploads/space/2014/0129/132450_NAON_995645.jpg(QMLPlayer on OSX)!

    version 1.3.0 2013-12-19

    • Selectable audio track
    • Multiple rendering target for 1 video support
    • Hardware decoding support(unstable): DXVA2 for windows, VA-API for x11(bad performance now)
    • Region of Interest(ROI) support, i.e. crop.
    • Filter support(Experimental)
    • Video eq: brightness, contrast, saturation
    • Repeat support
    • Mang api changes
    • QML: compatible with many QtMultiMedia APIs
    • build/install: check arch, fix wrong rpath and launch error on Mac, add installer
    • player: playlist, history, better online tv, etc.

    version 1.2.2 2013-07-03

    • Audio resampler using swresample
    • Play speed control
    • Audio format
    • Play good with audio that noise before(mp3, ...)
    • init and deinit FFmpeg only when needed
    • Component id accessed by symbol
    • mms support

    version 1.2.1 2013-06-19

    • Configurable video quality
    • Correct aspect ratio. Any value is supported
    • Fix some media playing problem
    • Fix crash if no audio
    • Fix d2d crash by setting multi-thread type
    • Fix WidgetRenderer can not update problem
    • Fix mem leak if renderer changed
    • player: volume control, display correct online tv name, correct display time

    version 1.2.0 2013-05-27

    • Better gui for the player example
    • Dynamically change renderer engine
    • Filter framework works. Filters on data and renderer support
    • XV rendering support
    • Fix some qmake project bugs

    !https://sourceforge.net/p/qtav/screenshot/mac.jpg(QtAV 1.3.0 on OSX)!



  • new version released



  • Sometimes video hang and blink continuesly ,so what is the remedey
    these type of issues in videoplayer developed by using Qt with ffmpeg



  • would you please give me the video cause the problems?
    maybe the latest code fix this. i have the same problem some days ago.
    [quote author="Vittal" date="1370414419"]Sometimes video hang and blink continuesly ,so what is the remedey
    these type of issues in videoplayer developed by using Qt with ffmpeg[/quote]



  • Is there tutorial how to build in windows with Qt Creator 3.0?

    I have installed portadui bulds and lates fmpeg builds to Qt5 mingw path but none of the example codes or what so ever will compile, It says unknow reference to some functions....



  • yes. read wiki https://github.com/wang-bin/QtAV/wiki/Build-QtAV

    [quote author="Jeroi" date="1398274659"]Is there tutorial how to build in windows with Qt Creator 3.0?

    I have installed portadui bulds and lates fmpeg builds to Qt5 mingw path but none of the example codes or what so ever will compile, It says unknow reference to some functions....[/quote]



  • bq. "QtAV supports QML since 1.2.4"

    That's a good news , this might interest me :-)



  • Hi
    I try to include player in my project. I downloaded 1.3.4 version and it compile well. I installed QtAV module to Creator via sdk_install.bat. My problem is to see the AVPlayer class as provided in examples. I can't import the necessary files, Creator can't detect it. The .pro file was changed according recommendations.
    mscv2012.
    Qt 5.2.1
    QCreator 3.0.1
    Os win8 ×64



  • @ibingow Nice work! Aany plans for Python bindings?



  • Man, so much work and dedication, thank you very much for sharing this!
    You said that "it is not very difficult" to write this player, but this already saved me a lot of time.
    I want to create a similar framework that plays and edit videos, so you helped a lot and for free!
    Thank a lot, you are an amazing person!
    Have a greatful day, you deserve it!



  • Excellent work ibingow.

    Will take a few days to take a closer look at it.

    Thanks for your hard work.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.