File: developers.rst

package info (click to toggle)
openshot-qt 2.6.1%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 130,080 kB
  • sloc: python: 450,926; javascript: 34,734; xml: 3,168; makefile: 219; sh: 150
file content (196 lines) | stat: -rw-r--r-- 8,738 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
.. Copyright (c) 2008-2016 OpenShot Studios, LLC
 (http://www.openshotstudios.com). This file is part of
 OpenShot Video Editor (http://www.openshot.org), an open-source project
 dedicated to delivering high quality video editing and animation solutions
 to the world.

.. OpenShot Video Editor is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.

.. OpenShot Video Editor is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

.. You should have received a copy of the GNU General Public License
 along with OpenShot Library.  If not, see <http://www.gnu.org/licenses/>.

Developers
==========

If you are a programmer (or want to become a programmer), and are interested in
developing new features, fixing bugs, or improving the user interface for OpenShot,
the following sections will explain how to get started and get involved!

The Big Picture
---------------
OpenShot Video Editor has 3 main components, a Python & PyQt user interface
(:openshot-github:`openshot-qt`), a C++ audio library
(:openshot-github:`libopenshot-audio`) and a C++ video library
(:openshot-github:`libopenshot`). If you are not familiar with Python,
PyQt, or C++, those would be great topics to research and learn more about at this point.

However, many bugs can be fixed and new features added with only Python knowledge, since the C++
components are not involved in the user interface at all. Python is an amazing language, and
is super fun to learn, and is the only prerequisite skill needed to become an OpenShot
developer!

.. warning::

    The instructions that follow are for Ubuntu Linux,
    which is the easiest environment to configure for OpenShot development.
    If you are using another OS,
    I suggest running a virtual machine with Ubuntu LTS before continuing any further.

    If you must use a Windows or Mac system for development,
    start by referring to the build notes in the ``libopenshot`` wiki.
    Building the library with all of its dependencies is the most challenging part of the process.
    
    * :libopenshot-wiki:`Windows Build Instructions <Windows-Build-Instructions>`
    * :libopenshot-wiki:`Mac Build Instructions <Mac-Build-Instructions>`

Getting the Latest Source Code
------------------------------
Before we can fix any bugs or add any features, we need to get the source code onto your
computer.

Use git to clone our 3 repositories:

.. code-block:: bash

   git clone https://github.com/OpenShot/libopenshot-audio.git
   git clone https://github.com/OpenShot/libopenshot.git
   git clone https://github.com/OpenShot/openshot-qt.git

Configuring your Development Environment
-----------------------------------------
In order to actually compile or run OpenShot, we need to install some dependencies on your system. The
easiest way to accomplish this is with our `Daily PPA <https://www.openshot.org/ppa/>`_. A PPA is an
unofficial Ubuntu repository, which has our software packages available to download and install.

.. code-block:: bash

   sudo add-apt-repository ppa:openshot.developers/libopenshot-daily
   sudo apt-get update
   sudo apt-get install openshot-qt \
                        cmake \
                        libx11-dev \
                        libasound2-dev \
                        libavcodec-dev \
                        libavdevice-dev \
                        libavfilter-dev \
                        libavformat-dev \
                        libavresample-dev \
                        libavutil-dev \
                        libfdk-aac-dev \
                        libfreetype6-dev \
                        libjsoncpp-dev \
                        libmagick++-dev \
                        libopenshot-audio-dev \
                        libswscale-dev \
                        libunittest++-dev \
                        libxcursor-dev \
                        libxinerama-dev \
                        libxrandr-dev \
                        libzmq3-dev \
                        pkg-config \
                        python3-dev \
                        qtbase5-dev \
                        qtmultimedia5-dev \
                        swig

At this point, you should have all 3 OpenShot components source code cloned into local folders, the OpenShot
daily PPA installed, and all of the required development and runtime dependencies installed. This is a
great start, and we are now ready to start compiling some code!

libopenshot-audio (Build Instructions)
--------------------------------------
This library is required for audio playback and audio effects.
It is based on the JUCE audio framework.
Here are the commands to build it:

.. code-block:: bash

   cd libopenshot-audio
   mkdir build
   cd build
   cmake -DCMAKE_INSTALL_PREFIX=dist ..
   make
   make install

Essentially, we are switching to the ``libopenshot-audio/build`` folder,
then running ``cmake ..`` on the parent folder.
This finds dependencies and creates all the needed Makefiles used to compile this library.
Then ``make`` uses those Makefiles to compile this library,
and ``make install`` installs them in the location we specified.
If ``CMAKE_INSTALL_PREFIX`` isn't set, the files will install to ``/usr/local/`` (by default) and ``make install`` will require administrative privileges to run.

libopenshot (Build Instructions)
--------------------------------
This library is required for video decoding, encoding, animation, and just about everything else.
It does all the heavy lifting of video editing and video playback.
Here are the commands to build it:

.. code-block:: bash

   cd libopenshot
   mkdir build
   cd build
   cmake -DLIBOPENSHOT_AUDIO_DIR=../../libopenshot-audio/build/dist ..
   make

Essentially, we are switching to the ``libopenshot/build`` folder,
then running ``cmake ..`` on the parent folder.
This finds dependencies and creates all the needed Makefiles used to compile this library.
Then ``make`` uses those Makefiles to compile this library.
Because we provided the location of our compiled ``libopenshot-audio`` installation,
that version of the library will be used instead of the system version (if any).

We don't install our ``libopenshot`` after building, because we don't need to.
For testing purposes, we can tell OpenShot to use ``libopenshot`` right from our ``build`` directory.

openshot-qt (Launch Instructions)
---------------------------------
This is our main PyQt Python application.
Because it is written in Python, it does not require any compiling to run.
To launch OpenShot from the source code with our newly-built
``libopenshot-audio`` and ``libopenshot`` libraries, use the following commands:

.. code-block:: bash

   cd openshot-qt
   PYTHONPATH=../libopenshot/build/src/bindings/python
   python3 src/launch.py

This should launch the OpenShot user interface.
Any changes you have made to the source code files
(``*.py`` Python files, ``*.ui`` PyQt UI files, etc...) will be included.
This requires the ``libopenshot-audio`` and ``libopenshot`` libraries,
and if anything went wrong with the steps above, OpenShot will likely not launch.

If OpenShot launches at this point, congratulations!
You now have a working local version of OpenShot, which is running off your local source code.
Try making some changes to the source code and re-launch OpenShot...
you should now see your changes!

GitHub Issues
-------------
Now that you have successfully compiled and launched OpenShot Video Editor,
be sure to check out our list of bug reports on GitHub: `OpenShot Issues`_.
Also, feel free to send me an email:
`jonathan@openshot.org <mailto:jonathan@openshot.org>`_ and introduce yourself!
I'm always here to help if you have any questions.

Share your Changes
------------------
Once you have fixed a bug or added an amazing new feature, be sure to share it with the OpenShot team.
Ideally, we can merge this into our main source code branch.
The easiest way to share your changes is by creating a fork of our repo,
pushing your changes back to GitHub, and creating a `Pull Request`_.
A Pull Request lets the OpenShot team know you have changes ready to be merged.
Then we can review things, give feedback, and hopefully merge your changes into the main branch.

.. _Pull Request: https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/proposing-changes-to-your-work-with-pull-requests
.. _OpenShot Issues: https://github.com/OpenShot/openshot-qt/issues/