Skip to content

Commit

Permalink
version 1.5.0 2015-02-13
Browse files Browse the repository at this point in the history
Changelog:
- Add QtAVWidgets module contains widget based renderers, video preview
widget
- QtAV module only depends on QtCore and QtGui
- Improve audio output API
- Simplify deployment on OSX. Deploy sdk from release packages without
build.
- Improve seekable detection
- Fix noise audio if volume increased
- Fix noise and wrong playback speed for wmv videos
- Preview is more accurate
- Do not copy AVPacket but use reference count.
- Faster audio track switch
- Reopen audio output only if audio format changed
- VideoFrame: new API for converting to another format or QImage
- OpenGL VAO, VBO support.
- QML
  * Fix some crashes in QQuickItemRenderer
  * Add FBO item renderer and use the same code path as other opengl
renderers
  * timeout property
- player and QMLPlayer example
  * player: real time preview on progress bar
  * Fast seek and display if seek shortcut is pressed and hold
  • Loading branch information
wang-bin committed Feb 13, 2015
1 parent b8a3213 commit 7c49b62
Show file tree
Hide file tree
Showing 20 changed files with 288 additions and 121 deletions.
4 changes: 2 additions & 2 deletions .qmake.conf
Original file line number Diff line number Diff line change
@@ -1,6 1,6 @@
QTAV_MAJOR_VERSION = 1
QTAV_MINOR_VERSION = 4
QTAV_PATCH_VERSION = 2
QTAV_MINOR_VERSION = 5
QTAV_PATCH_VERSION = 0

QTAV_VERSION = $${QTAV_MAJOR_VERSION}.$${QTAV_MINOR_VERSION}.$${QTAV_PATCH_VERSION}
#MODULE_VERSION = $$QTAV_VERSION
27 changes: 26 additions & 1 deletion Changelog
Original file line number Diff line number Diff line change
@@ -1,4 1,29 @@
version 1.4.2 2014-12-27
version 1.5.0 2015-02-13

Changelog:
- Add QtAVWidgets module contains widget based renderers, video preview widget
- QtAV module only depends on QtCore and QtGui
- Improve audio output API
- Simplify deployment on OSX. Deploy sdk from release packages without build.
- Improve seekable detection
- Fix noise audio if volume increased
- Fix noise and wrong playback speed for wmv videos
- Preview is more accurate
- Do not copy AVPacket but use reference count.
- Faster audio track switch
- Reopen audio output only if audio format changed
- VideoFrame: new API for converting to another format or QImage
- OpenGL VAO, VBO support.
- QML
* Fix some crashes in QQuickItemRenderer
* Add FBO item renderer and use the same code path as other opengl renderers
* timeout property
- player and QMLPlayer example
* player: real time preview on progress bar
* Fast seek and display if seek shortcut is pressed and hold


version 1.4.2 2015-02-13

Changelog:
- Async load
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 17,7 @@ QtAV can meet your most demands

- Hardware decoding suppprt: DXVA2, VAAPI, VDA, CedarX, CUDA(the 1st player support CUDA on linux?)
- OpenGL and ES2 support for Hi10P and other 16-bit YUV videos (The 1st player/library support 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
Expand Down Expand Up @@ -77,7 78,7 @@ For more detail to using QtAV, see the wiki [Use QtAV In Your Project](https://g
QtAV can also be used in **Qml**

import QtQuick 2.0
import QtAV 1.4
import QtAV 1.5
Item {
Video {
id: video
Expand Down
2 changes: 1 addition & 1 deletion config.tests/gentest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 27,7 @@ EOF
YEAR=`date %Y`
COPY=../templates/COPYRIGHT.h
cat $COPY | sed "s/%YEAR%/$YEAR/g" > $NAME/main.cpp
cat >>$NAME/main.cpp <<EOF
cat >$NAME/main.cpp <<EOF
#include <${NAME}.h>
int main()
Expand Down
22 changes: 22 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 1,25 @@
qtav (1.5.0) unstable; urgency=low

* Add QtAVWidgets module contains widget based renderers, video preview widget
* QtAV module only depends on QtCore and QtGui
* Improve audio output API
* Simplify deployment on OSX. Deploy sdk from release packages without build.
* Improve seekable detection
* Fix noise audio if volume increased
* Fix noise and wrong playback speed for wmv videos
* Preview is more accurate
* Do not copy AVPacket but use reference count.
* Faster audio track switch
* Reopen audio output only if audio format changed
* VideoFrame: new API for converting to another format or QImage
* OpenGL VAO, VBO support.
* Fix some crashes in QQuickItemRenderer
* Add FBO item renderer and use the same code path as other opengl renderers
* player: real time preview on progress bar
* Fast seek and display if seek shortcut is pressed and hold

-- Wang Bin <[email protected]> Sat, 13 Feb 2015 20:19:00 0800

qtav (1.4.2) unstable; urgency=low

* Async load
Expand Down
206 changes: 121 additions & 85 deletions doc/BuildQtAV-zh_CN.md
Original file line number Diff line number Diff line change
@@ -1,85 1,121 @@
## 1. Setup the environment

QtAV 依赖 FFmpeg, PortAudio,以及一些可选的库如direct2d, xvideo
可以从这里下载windows下FFmpeg和PortAudio开发用的文件 [QtAV sourceforge page](https://sourceforge.net/projects/qtav/files/depends)
windows 下的 FFmpeg 也可以从这里下载 [Zeranoe](http://ffmpeg.zeranoe.com/builds)
Or you can build them your self [Compile FFmpeg and PortAudio](https://github.com/wang-bin/QtAV/wiki/Compile-FFmpeg-and-PortAudio)

首先你 *必须* 让编译器能找到 FFmpeg 的头文件和库文件., 否则在 qmake 时会出错。如果你已经把那些文件放到该放的位置了,可以忽略这步。

vc 编译器会在环境变量 __*INCLUDE*__ 制定的那些目录搜索头文件, __*LIB*__ 制定的目录搜索库文件,因此如果你使用命令行编译的话可以这样设置环境

set INCLUDE=ffmpeg_path\include;portaudio_path\include;%INCLUDE%
set LIB=ffmpeg_path\lib;portaudio_path\lib;%LIB%


GCC 会在环境变量 __*CPATH*__ 搜索头文件, __*LIBRARY_PATH*__ 里搜索库文件。因此你可以设置这些变量来包含 FFmpeg 和 PortAudio 相关的路径。
unix shell环境下的 gcc (也包括环境中有sh.exe的mingw环境):

export CPATH=ffmpeg_path/include:portaudio_path/include:$CPATH
export LIBRARY_PATH=ffmpeg_path/include:portaudio_path/lib:$LIBRARY_PATH

由于包含 libQtAV.pri 的工程不会添加 FFmpeg 等相关的链接参数,所以链接器可能会从 $LD_LIBRARY_PATH 中去找 QtAV 库的依赖库:

export LD_LIBRARY_PATH=ffmpeg_path/lib:portaudio_path/lib:$LD_LIBRARY_PATH

windows 无sh.exe的环境下的 gcc

set CPATH=ffmpeg_path\include;portaudio_path\include;%CPATH%
set LIBRARY_PATH=ffmpeg_path\lib;portaudio_path\lib;%LIBRARY_PATH%

如果使用 QtCreator 进行编译, 打开左边的 '工程' 页面,添加或追加相应的环境变量就行

## 2. qmake

对于大多数系统, 只要

qmake
make

强烈建议不要在源码目录编译,而是使用如下的方法

cd your_build_dir
qmake QtAV_source_dir/QtAV.pro
make

qmake 在第一次运行的时候会检测所依赖的库, 你要保证这些库能被找到。
然后 qmake 会在编译目录生成一个 cache 文件 _.qmake.cache_ . cache 文件包含了检测结果,比如 portaudio 是否支持。 如果你想重新检测, 则可以删除 _**.qmake.cache**_ 再运行 qmake, 也可以直接给 qmake 加个额外参数

qmake QtAV_source_dir/QtAV.pro CONFIG =recheck


_WARNING_: If you are in windows mingw with sh.exe environment, you may need run qmake twice. I have not find out the reason!

## 3. Make

使用 make, jom, nmake 或者 QtCreator 进行编译.



## Windows 下的编译

你必须在qmake前配置好环境,如最开始所说的。

#### Visual Studio

我没有在 QtAV 里放任何 vs 的工程文件,因为这些工程很容易由 qmake 生成

打开命令行

qmake -r -tp vc QtAV.pro

然后 sln 和 vcxproj(vcproj) 文件会创建. 用 Visual Studio 打开 QtAV.sln 进行编译.

另外你也可以使用 Qt vs plugin 来导入qmake 工程(未测试)

#### QtCreator 里使用 MSVC

QtCreator 会检测 VC 编译器,编译过程和 gcc 的差不多,很简单。


#### VC 命令行下编译

我从 VS2012 Update1 中提取了 VC 编译器和 windows sdk. 可以从这里下载 http://qtbuild.googlecode.com/files/vs2012-x86.7z

这个编译环境很精简但是开发C 的功能很完整,至少能用它成功编译 Qt。
## 0. 依赖

FFmpeg (>=1.0) 或 Libav (>=9.0). 强烈建议使用最新的 FFmpeg release版本,我主要用这个. 使用libav可能会导致dxva, vaapi, vda 和 libavfilter 不能使用。

编译好的FFmpeg可以这里下载 [QtAV sourceforge page](https://sourceforge.net/projects/qtav/files/depends/FFmpeg)
或者windows版[Zeranoe](http://ffmpeg.zeranoe.com/builds)
或者自己编译[Build FFmpeg](https://github.com/wang-bin/QtAV/wiki/Build-FFmpeg)

其他依赖

#### Windows

PortAudio 或 OpenAL(建议).

#### OSX, iOS

无. 调用系统 OpenAL

#### Android

OpenAL(OpenSL为后端). 当前 OpenSL 不能正常工作.

#### Ubuntu

OpenAL. 要启用所有功能需要安装 XVideo 和 VAAPI 的开发包.

sudo apt-get install libopenal-dev libva-dev libxv-dev

运行时可能要安装vaapi driver让vaapi工作

sudo apt-get install libva-intel-vaapi-driver


## 1. Setup the environment

首先你 *必须* 让编译器能找到 FFmpeg 的头文件和库文件., 否则在 qmake 时会出错。如果你已经把那些文件放到该放的位置了,可以忽略这步。

#### 把头文件和库放到 Qt 头文件和库的目录

这是让编译器找到 ffmpeg 和其他依赖库最简单的方法

#### 使用环境变量

vc 编译器会在环境变量 __*INCLUDE*__ 制定的那些目录搜索头文件, __*LIB*__ 制定的目录搜索库文件,因此如果你使用命令行编译的话可以这样设置环境

set INCLUDE=ffmpeg_path\include;portaudio_path\include;%INCLUDE%
set LIB=ffmpeg_path\lib;portaudio_path\lib;%LIB%


GCC 会在环境变量 __*CPATH*__ 搜索头文件, __*LIBRARY_PATH*__ 里搜索库文件。因此你可以设置这些变量来包含 FFmpeg 和 PortAudio 相关的路径。
unix shell环境下的 gcc (也包括环境中有sh.exe的mingw环境):

export CPATH=ffmpeg_path/include:portaudio_path/include:$CPATH
export LIBRARY_PATH=ffmpeg_path/include:portaudio_path/lib:$LIBRARY_PATH

由于包含 libQtAV.pri 的工程不会添加 FFmpeg 等相关的链接参数,所以链接器可能会从 $LD_LIBRARY_PATH 中去找 QtAV 库的依赖库:

export LD_LIBRARY_PATH=ffmpeg_path/lib:portaudio_path/lib:$LD_LIBRARY_PATH

windows 无sh.exe的环境下的 gcc

set CPATH=ffmpeg_path\include;portaudio_path\include;%CPATH%
set LIBRARY_PATH=ffmpeg_path\lib;portaudio_path\lib;%LIBRARY_PATH%

如果使用 QtCreator 进行编译, 打开左边的 '工程' 页面,添加或追加相应的环境变量就行

![QtCreator Settings](http://wang-bin.github.io/qtav.org/images/qtc-set.jpg "QtCreator Settings")

## 2. qmake

对于大多数系统, 只要

qmake
make

强烈建议不要在源码目录编译,而是使用如下的方法

cd your_build_dir
qmake QtAV_source_dir/QtAV.pro
make

qmake 在第一次运行的时候会检测所依赖的库, 你要保证这些库能被找到。
然后 qmake 会在编译目录生成一个 cache 文件 _.qmake.cache_ . cache 文件包含了检测结果,比如 portaudio 是否支持。 如果你想重新检测, 则可以删除 _**.qmake.cache**_ 再运行 qmake, 也可以直接给 qmake 加个额外参数

qmake QtAV_source_dir/QtAV.pro CONFIG =recheck


_WARNING_: If you are in windows mingw with sh.exe environment, you may need run qmake twice. I have not find out the reason!

## 3. Make

使用 make, jom, nmake 或者 QtCreator 进行编译.



## Windows 下的编译

你必须在qmake前配置好环境,如最开始所说的。

#### Visual Studio

我没有在 QtAV 里放任何 vs 的工程文件,因为这些工程很容易由 qmake 生成

打开命令行

qmake -r -tp vc QtAV.pro

然后 sln 和 vcxproj(vcproj) 文件会创建. 用 Visual Studio 打开 QtAV.sln 进行编译.

另外你也可以使用 Qt vs plugin 来导入qmake 工程(未测试)

#### QtCreator 里使用 MSVC

QtCreator 会检测 VC 编译器,编译过程和 gcc 的差不多,很简单。


#### VC 命令行下编译

我从 VS2012 Update1 中提取了 VC 编译器和 windows sdk. 可以从这里下载 http://qtbuild.googlecode.com/files/vs2012-x86.7z

这个编译环境很精简但是开发C 的功能很完整,至少能用它成功编译 Qt。
42 changes: 27 additions & 15 deletions doc/BuildQtAV.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 6,7 @@ Get QtAV source code
git submodule update --init


FFmpeg (>=1.0) or Libav (>=9.0) is always required. The latest FFmpeg release is recommended (that's what i use). If you use libav, you vaapi can not work in C apps and libavfilter does not work.
FFmpeg (>=1.0) or Libav (>=9.0) is always required. The latest FFmpeg release is recommended (that's what i use).

You can download precompiled FFmpeg from [QtAV sourceforge page](https://sourceforge.net/projects/qtav/files/depends/FFmpeg), or if you are using Windows you can also download FFmpeg development files from [Zeranoe](http://ffmpeg.zeranoe.com/builds).

Expand All @@ -28,9 28,9 @@ OpenAL with OpenSL backend. Currently OpenSL code doesn't work correctly, but Op

#### Ubuntu

OpenAL. To enable all supported features, you must install XVideo and VA-API dev packages.
OpenAL. To enable all supported features, you must install libass, XVideo and VA-API dev packages.

sudo apt-get install libopenal-dev libva-dev libxv-dev
sudo apt-get install libopenal-dev libva-dev libxv-dev libass-dev

You may have to install VA-API drivers to make VA-API available at runtime. See https://github.com/wang-bin/QtAV/wiki/Enable-Hardware-Decoding

Expand All @@ -47,26 47,22 @@ This is the simplest and best way to let compilers find ffmpeg and other depend

#### Use Environment Vars

On Windows, Visual Studio will search headers in `%INCLUDE%` and search libraries in `%LIB%`, so you can set the environment like below if your compile in command line:
On Windows, VC compiler will search headers in `%INCLUDE%` and search libraries in `%LIB%`, so you can set the environment like below if your compile in command line:

set INCLUDE=ffmpeg_path\include;portaudio_path\include;%INCLUDE%
set LIB=ffmpeg_path\lib;portaudio_path\lib;%LIB%
set INCLUDE=ffmpeg_path\include;openal_path\include;%INCLUDE%
set LIB=ffmpeg_path\lib;openal_path\lib;%LIB%

GCC will search headers in environment variables `$CPATH` and libraries in `$LIBRARY_PATH`. So you can set those vars to include your FFmepg and PortAudio dir.
GCC will search headers in environment variables `$CPATH` and libraries in `$LIBRARY_PATH`. So you can set those vars to include your FFmpeg and OpenAL dir.

gcc in unix shell environment(including mingw with sh.exe):

export CPATH=ffmpeg_path/include:portaudio_path/include:$CPATH
export LIBRARY_PATH=ffmpeg_path/lib:portaudio_path/lib:$LIBRARY_PATH

The project includes libQtAV.pri will not add linking options about FFmpeg etc., so the linker may find the dependent libraries from $LD_LIBRARY_PATH:

export LD_LIBRARY_PATH=ffmpeg_path/lib:portaudio_path/lib:$LD_LIBRARY_PATH
export CPATH=ffmpeg_path/include:openal_path/include:$CPATH
export LIBRARY_PATH=ffmpeg_path/lib:openal_path/lib:$LIBRARY_PATH

GCC on windows cmd.exe environment without UNIX Shell:

set CPATH=ffmpeg_path\include;portaudio_path\include;%CPATH%
set LIBRARY_PATH=ffmpeg_path\lib;portaudio_path\lib;%LIBRARY_PATH%
set CPATH=ffmpeg_path\include;openal_path\include;%CPATH%
set LIBRARY_PATH=ffmpeg_path\lib;openal_path\lib;%LIBRARY_PATH%

If you are building in QtCreator, goto QtCreator's 'Projects' page and add or append those environment.

Expand Down Expand Up @@ -134,3 130,19 @@ run
debuild -us -uc

in QtAV source tree

## Link to Static FFmpeg and OpenAL

QtAV >=1.4.2 supports linking to static ffmpeg and openal libs. It's disabled by default. To enable it, add

CONFIG = static_ffmpeg static_openal

in $QtAV/.qmake.conf for Qt5 or $QtAV_BUILD_DIR/.qmake.cache

## Ubuntu 12.04 Support

If QtAV, FFmpeg and OpenAL are built on newer OS, some symbols will not be found on 12.04. For example, clock_gettime is in both librt and glibc2.17, we must force the linker link against librt because 12.04 glibc does not have that symbol. add

CONFIG = glibc_compat

to .qmake.conf or .qmake.cache
10 changes: 10 additions & 0 deletions doc/QtAVBuildConfigurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 27,16 @@ in *QtAV_SRC/user.conf* to disable it then qmake will be faster. But you then mu

in *user.conf*.

Link Against Static FFmpeg
==========================

It is supported since 1.4.2. You can add `CONFIG = static_ffmpeg` in QTAV_BUILD_DIR/.qmake.cache. Additional link flags will be added. Only ffmpeg build with QtAV/script/build_ffmpeg.sh is tested.

Old GLibc Compatibility
======================

QtAV built from a newer linux system like ubuntu 14.04 may not work on old system like ubuntu 12.04 because of some symbols is missing. For example, `clock_get_time` is in glibc>=2.17 and librt. An convenience option is added since 1.4.2. Just add `CONFIG = glibc_compat` in QTAV_BUILD_DIR/.qmake.cache


TODO
====
Expand Down
Loading

0 comments on commit 7c49b62

Please sign in to comment.