Skip to content

This is QtAv from Wang, configured for building for windows(MSVC2017) and android

Notifications You must be signed in to change notification settings

Fransferdy/QtAvSetupForAndroid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

THIS IS A FORK FROM wang/QTAV FOR BUILDING QT AV for ANDROID

The reason for this fork is that the main repository fails to build for android, because of issues with dependencies. QtAv requires FFMPEG 3.4 to work on android, it is very hard to find this version of ffmpeg prebuilt to work with newer versions of android (platform 22 to 29) because building it with the newer NDK (21... at the time of this writing) fails with compiler - code issues and also because people simply moved on to ffmpeg 4.2.(but qtav crashes with 4.2 in android)

I have added to this repository a prebuilt version of ffmpeg 3.4.7 for android armeabi-7va, arm64-8va, x86 and x86_64 and modified build scripts to use these dependencies. You can look here if you want to build ffmpeg 3.4.7 yourself (you will need an ubuntu machine most likely) Javernaut/ffmpeg-android-maker#26

With this repository you can build QTAV for android platform 22-29 with ffmpeg compiled with the newest ndk to date (5/15/2020).

Extra Features Implemented Here

I added two functions to Qt Av QML Player player.installAudioFilter('filter=value filter2=value2') and player.installVideoFilter('filter1=value filter2=value2');

You can look at FFMPEG documentation to find available filters for audio and video.

Known Issues with filters

Any filter that modifies the audio or video length will break QT AV, I actually built this functionality to be able to change video speed without creating artifacts with sound (using ffmpeg filters for that) , but that fails with QTAV, however other fields that don't mess with video/audio speed and length works, filters such as echo, or others affecting video appearance and all.

Build instructions

Cross compile does not work. You will have to open qt creator and build each separated version by itself. At Project/qmake/details select arm64-v8a, deselect the rest and build, do the same for all archictectures.

I advise to build x86_64 FIRST, there is an issue with X86_64 build, the build for x86_64 will output files with name x86, instead of x86_64, you should rename those files to ...x86.so to ...x86_64.so before building for X86.

The libraries will be COMPILED SUCCESFULY but the BUILD WILL FAIL. This happens because there are issues in building the examples.

After finishing the build process, you will have to go the build directory and run sdk_install.bat using powershell. (shift click in the folder and "Open Powershell Here"), this will copy qt_av files to your QT installation folder.

Additionaly, all of these libs are dinamically linked, therefore they will need to be present in your qt project (including ffmpeg3.4.7/lib libs), at android/libs/arm64-v8a
at android/libs/armeabi-7va
at android/libs/x86
at android/libs/x86_64
and you will need the following line in your qt project .pro file:
QT += av
android {
QT += androidextras
ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
}
Finally you also have to add openSSL dependencies There's a folder openssl-1.1.1android/libs in the repository, just copy its contents to project_dir/android/libs

In Qt Creator in project->qmake->details->Build Android APK->details->Additional Libraries-> Add the following entries: path_to_your_project/android/libs/arm64-v8a/libcrypto_1_1.so
path_to_your_project/android/libs/arm64-v8a/libssl_1_1.so
path_to_your_project/android/libs/armeabi-7va/libcrypto_1_1.so
path_to_your_project/android/libs/armeabi-7va/libssl_1_1.so
path_to_your_project/android/libs/x86/libcrypto_1_1.so
path_to_your_project/android/libs/x86/libssl_1_1.so
path_to_your_project/android/libs/x86_64/libcrypto_1_1.so
path_to_your_project/android/libs/x86_64/libssl_1_1.so

For more info look at: wang-bin/QtAV#1262

Good luck, it took me a few days to get everything working, this repository is 90% of the work, the other 10% is on you.

##Running your project

Remember to always select in QT Creator, all ABIs for building before launching your app, otherwise, most likely the software will crash in the emulator/different phones. project->qmake->details->ABIs

Demo

This is a sample of working video qml screen:

import QtQuick 2.12
import QtQuick.Controls 2.5
import QtAV 1.6

Page{
VideoOutput2 {
        anchors.right: parent.right
        anchors.rightMargin: 13
        anchors.bottom: parent.bottom
        anchors.left: parent.left
        anchors.top: parent.top
        anchors.bottomMargin: 15
        anchors.leftMargin: 14
        anchors.topMargin: 60
        source: player
    }

    AVPlayer {
        id: player
        source: "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"
    }
}

Join the chat at https://gitter.im/QtAV/Lobby

QtAV is a multimedia playback library based on Qt and FFmpeg. It can help you to write a player with less effort than ever before.

QtAV has been added to FFmpeg projects page http://ffmpeg.org/projects.html

QtAV is free software licensed under the term of LGPL v2.1. The player example is licensed under GPL v3. If you use QtAV or its constituent libraries, you must adhere to the terms of the license in question.

Features

QtAV can meet your most demands

  • Hardware decoding suppprt: DXVA2, VAAPI, VDA/VideoToolbox, CedarX, CUDA(the 1st player support CUDA on linux?)
  • OpenGL and ES2 support for almost all formats including Hi10P videos (The 1st player/library support 10bit in ES2? VLC, XBMC, mplayer does not support now)
  • Real time preview
  • Video capture in rgb and yuv format
  • OSD and custom filters
  • Filters in libavfilter, for example stero3d, blur
  • Subtitle track select. Dynamic change FFmpeg and libass engine
  • Play frame by frame
  • Playback speed control
  • Variant streams: locale file, http, rtsp etc. and your custom streams
  • Audio channel, tracks and external audio tracks
  • Dynamically change render engine when playing.
  • Dynamically change video decoder
  • Multiple video outputs for 1 player
  • Video eq(software and OpenGL): brightness, contrast, saturation, hue
  • QML support. Most playback APIs are compatible with QtMultimedia module
  • Compatibility: QtAV can be built with both Qt4 and Qt5, FFmpeg(>=1.0) and Libav (>=9.0). Latest FFmpeg release is recommended.

Extensible Framework

Some components in QtAV are designed to be extensible. For example, you can write your decoder, audio output for particular platform. Here is a very good example to add cedar hardware accelerated decoder for A13-OLinuXino

For Developers

Requirements

Qt FFmpeg Libav OpenAL

The required development files to build QtAV can be found in sourceforge page: depends

Build

See the wiki Build QtAV and QtAV Build Configurations

How To Write a Player

Write a media player using QtAV is quite easy.

GLWidgetRenderer2 renderer;
renderer.show();
AVPlayer player;
player.setRenderer(&renderer);
player.play("test.avi");

For more detail to using QtAV, see the wiki Use QtAV In Your Project or examples.

QtAV can also be used in Qml

import QtQuick 2.0
import QtAV 1.6
Item {
    Video {
        id: video
        source: "test.mp4"
    }
    MouseArea {
        anchors.fill: parent
        onClicked: video.play()
    }
}

How To Contribute

  • Fork QtAV project on github and make a branch. Commit in that branch, and push, then create a pull request to be reviewed and merged.
  • Create an issue if you have any problem when using QtAV or you find a bug, etc.
  • What you can do: translation, write document, wiki, find or fix bugs, give your idea for this project etc.

Contributors

  • Wang Bin(Lucas Wang): creator, maintainer
  • Gianluigi Tiesi(sherpya): avdevice input support
  • Stefan Ladage: QIODevice support. Wiki about build QtAV for iOS. Let OpenAL work on OSX and iOS
  • Miroslav Bendik: Cedarv support. Better qmlvideofx appearance
  • theoribeiro: initial QML support
  • Vito Covito: interrupt callback
  • Alexander, Marius Wachtler, Petar Koretić, Sandro Cavazzoni(skaman), Dimitri E. Prado, karlox ...

For End Users

Player Commandline Options

Run player -h

Default Shortcuts

  • Double click: fullscreen switch
  • Ctrl+O: open a file
  • Space: pause/continue
  • F: fullscreen on/off
  • T: stays on top on/off
  • N/B: show the next/previous frame. Continue the playing by pressing "Space"
  • O: OSD
  • P: replay
  • Q/ESC: quit
  • S: stop
  • A: switch aspect ratio
  • R: rotate 90
  • M: mute on/off
  • Up / Down: volume + / -
  • Ctrl+Up/Down: speed + / -
  • -> / <-: seek forward / backward
  • Crtl+Wheel: zoom in/out
  • Drag and drop a media file to player

Screenshots

Use QtAV in QML with OpenGL shaders(example is from qtmultimedia. But qtmultimedia is replaced by QtAV)

Alt text

Alt text

QMLPlayer

Alt text


Copyright © Wang Bin [email protected]

2013-01-21

About

This is QtAv from Wang, configured for building for windows(MSVC2017) and android

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published