forked from CryFeiFei/QtAV
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
80 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
在你的项目中包含 QtAV 非常容易. 因为 QtAV 的qmake工程是精心设计的. (可以参考: https://github.com/wang-bin/LibProjWizard4QtCreator) | ||
|
||
你可以参考 QtAV 里的例子来了解如何使用 QtAV, 或者也可以使用以下步骤 | ||
|
||
|
||
###1. 新建一个 subdirs 类型的工程myproject及一个直接调用QtAV的player子工程 | ||
|
||
myproject/myproject.pro | ||
|
||
TEMPLATE = subdirs | ||
SUBDIRS += libQtAV myplayer | ||
myplayer.depends += libQtAV | ||
libQtAV.file = QtAV/src/libQtAV.pro | ||
|
||
###2. 把 QtAV 放到myproject | ||
|
||
可以在 myproject/ 目录下使用 `git clone [email protected]:wang-bin/QtAV.git`, 或者复制 QtAV 代码到 myproject/. 建议使用git,这样方便获取最新代码. | ||
|
||
现在的目录变为 | ||
|
||
> myproject/myproject.pro | ||
> myproject/myplayer/myplayer.pro | ||
> myproject/QtAV/src/libQtAV.pro | ||
> myproject/QtAV/src/libQtAV.pri | ||
###3. 在player工程中包含 libQtAV.pri | ||
|
||
在 myproject/myplayer/myplayer.pro, add | ||
|
||
include(../QtAV/src/libQtAV.pri) | ||
|
||
###4. 生成 Makefile | ||
|
||
`qmake -r BUILD_DIR=some_dir` | ||
|
||
必须使用参数 **_-r_** 和 **_BUILD_DIR=some_dir_**, 否则可能会出现依赖问题. | ||
|
||
如果使用 QtCreator 来构建, 你可以点 _Projects_->_Build Steps_->_qmake_->_Additional arguments_, 添加 BUILD_DIR=your/buid/dir | ||
|
||
###5. make | ||
player 会生成在 $$BUILD_DIR/bin. 在windows下, QtAV 的 dll文件也会在那里生成 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,43 +3,38 @@ It's easy to include QtAV in your project. Because it's pro file are well design | |
You can see examples in QtAV to know how to use QtAV, or follow the steps below | ||
|
||
## Steps | ||
1. Create a subdirs type project in directory myproject | ||
myproject/myplayer.pro | ||
` | ||
###1. Create a subdirs type project and a player project | ||
|
||
myproject/myproject.pro | ||
|
||
TEMPLATE = subdirs | ||
` | ||
` | ||
SUBDIRS += libQtAV myplayer | ||
` | ||
` | ||
myplayer.depends += libQtAV | ||
` | ||
` | ||
libQtAV.file = QtAV/src/libQtAV.pro | ||
` | ||
2. Clone/Put QtAV to myproject | ||
|
||
###2. Put QtAV to myproject | ||
|
||
You can use `git clone [email protected]:wang-bin/QtAV.git` in myproject/, or copy QtAV to myproject/. It's recommend to use git so that you can checkout the latest code easily. | ||
|
||
the directory now is | ||
|
||
> myproject/myproject.pro | ||
> myproject/myplayer/myplayer.pro | ||
> myproject/QtAV/src/libQtAV.pro | ||
> myproject/QtAV/src/libQtAV.pri | ||
3. Add libQtAV.pri in you project | ||
in myproject/myplayer.pro, add | ||
` | ||
include(../QtAV/src/libQtAV.pri) | ||
` | ||
4. generate Makefile | ||
###3. Add libQtAV.pri in you player project | ||
in myproject/myplayer/myplayer.pro, add | ||
|
||
qmake | ||
include(../QtAV/src/libQtAV.pri) | ||
|
||
###4. generate Makefile | ||
|
||
>> If you have problem when building with `qmake`, try `qmake -r BUILD_DIR=some_dir` | ||
>> YOU MUST use parameter **_-r_** and **_BUILD_DIR=some_dir_**, or the dependence will be broken when building due to my pro structure. | ||
>> If you are using QtCreator to build the project, you should go to _Projects_->_Build Steps_->_qmake_->_Additional arguments_, add BUILD_DIR=your/buid/dir | ||
`qmake -r BUILD_DIR=some_dir` | ||
|
||
5. make | ||
you player binary will be created in $$BUILD_DIR/bin, BUILD_DIR is your shadow build dir. If you are in windows, the QtAV dll also be there | ||
YOU MUST use parameter **_-r_** and **_BUILD_DIR=some_dir_**, or the dependence will be broken when building due to my pro structure. | ||
|
||
### ISSUES | ||
If you are using QtCreator to build the project, you should go to _Projects_->_Build Steps_->_qmake_->_Additional arguments_, add BUILD_DIR=your/buid/dir | ||
|
||
If you want to build a debug version, you may get some link errors. It's not your problem, my qmake projects have some little problem. Just fix it manually yourself | ||
###5. make | ||
you player binary will be created in $$BUILD_DIR/bin. If you are in windows, the QtAV dll also be there |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FFmpeg supports playing media streams from pipe. Pipe is a protocol in FFmpeg. To use it, you just need to replace the file name with 'pipe:'. for example | ||
|
||
cat hello.avi |player pipe: | ||
|
||
It also supports streams from file number | ||
|
||
pipe:number | ||
|
||
'number' can be 0, 1, 2, .... 0 is stdin, 1 is stdout and 2 is stderr. If 'number' is empty, it means stdin. | ||
|
||
FFmpeg is powerful, do you think so? |