Editing videos with Pitivi and OpenShot

Fabio Pagani, 123RF

Fabio Pagani, 123RF

Fresh Cuts

In today's world, making a video clip using your smartphone or a low-cost digital camera is easy. The video editing programs Pitivi and OpenShot let you put together a film out of individual clips.

Users accustomed to relying entirely on Linux for their operating system are well acquainted with the frequent modifications and improvements that go along with using open source software. This ongoing progress has resulted in image editing, office, and development environments that all function very well. These days, you can perform almost any task using open source software.

However, there's historically been a gap where videos were concerned. Linux users who wanted to edit a video needed the time and patience to learn Blender [1]. Other video editing solutions available under Linux usually didn't do what they were supposed to. The recent release of Pitivi 0.95 and OpenShot 2.0.7 now offer revised and updated capabilities that simplify the video editing process for Linux users. In the lab, these two candidates needed to prove their mettle.

The test computer was Ubuntu 16.04 on an old Intel Core Duo, running at 2 GHz with 2GB of RAM and a conventional 150GB hard disk. It also had a single internal Intel HD Graphics GM965/GL960 card. This is an old machine, without much support from OpenGL for running longer computing tasks. As described, the system offered sufficient performance for testing. Rendering final videos, however, will test your patience if you are working with a similarly underpowered computer.

Although using APT will drag in most dependencies that Pitivi and OpenShot need to work, you may find the programs won't open or work with some video formats because of missing codecs and libraries. Although you may find most of the items already installed, you should ensure you have everything you need by running the commands in Listing 1 to install useful audio and video codecs. At the same time, you should also install Frei0r [2], a video effects library.

Listing 1

Installing Codecs

$ sudo apt install gstreamer1.0-plugins-bad gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly# Use "apt-get" on older versions of Ubuntu.
$ sudo apt install frei0r-plugins
# Use "apt-get" on older versions of Ubuntu.

Both apps allowed us to carry out the same tasks in our lab tests. The assignment was to edit videos and audio tracks, taken from a range of sources and with different resolutions and formats, and create a YouTube-compatible video. This was done by cutting individual videos to the correct length, arranging them in the time line, and adding transition effects between the clips. Still images, audio effects, and sound tracks were supplements to the project, making it into a reasonably presentable product.

Pitivi

Since version 0.91 was released in October 2013, Pitivi with GStreamer Editing Services [3] has been using a new engine. A lot of clean operations and the switch to GTK3 accompanied that changeover. Version 0.95, which was released in November 2015, is now based for the first time completely on GTK3. This makes it possible to also start Pitivi on Mac OS X, albeit with several stumbling blocks along the way that must be resolved [4]. In the long run, the developers want to attract a broader user base to drive development forward more quickly [5].

Pitivi opens an assistant immediately after booting. The assistant helps the user create a new project and define the overall settings for the video. Additionally, the application window appears which, at this time, is still empty. Switching into this window requires that the user populate the media library at the upper left edge of the screen. This is done either by opening the Import dialog or dragging the desired media from a file manager into the left display area. Items such as videos, audio tracks, and images can all be used for this purpose (Figure 1). Because Pitivi is based on the GStreamer framework, the program handles all of the codecs known to GStreamer.

Figure 1: The Pitivi interface is customizable. Each area in the main window can be detached and made into a separate window.

You can start the editing process by moving content from the library into the time line located in the bottom panel. This automatically causes the video clip program to generate a new track. Each element should be placed over an empty area. According to the application logic, the tracks occur as layers, which sit on top of each other. If something like a logo or an image lies on top of the actual video, then the element must be put in a track that lies above the main video.

Pitivi provides a graphic display for audio tracks and for videos with sound, which makes it possible to cut at positions that are dependent on particular sound occurrences. No tools are necessary for adjusting the clips. Instead, all you have to do is hold the mouse curser over the track and set the desired length by dragging the handles to the left and right at each end of the track.

Alongside the Import button are additional buttons that let you delete a video from the library and display details about the characteristics of the clip to arrive at resolution values and repeat rates for the project. A button for adding a highlighted clip to the time line is also available. Pitivi adds the video automatically to the longest track. It does not matter which video was previously highlighted. The program also lets you display the media library in the form of a detailed list and filter clips added to longer projects by name. You can get a better overview of work performed on multiple monitors by using drag and drop to remove the tab of the Pitivi application window and position it in a window of its own.

Precise Clips

Pitivi displays a results preview in the upper right panel of the application window. The media buttons underneath let you play the video, fast forward, and rewind. The button at the far right starts the preview with the first click in the Pitivi application window. Tapping again on the button in this new window switches Pitivi into full-screen mode. A vertical red line designates the current position of the video in the time bar as the video plays. Clicking once on the time line above the track takes you immediately to the desired position. To the left of the time line is another controller – for scaling the display area in the time bar. This feature is especially important for clips that must be precise. Holding the mouse pointer over the controller lets you modify the display area with the mouse wheel.

To edit an audio or a video clip, first select the desired clip by left-clicking in the clip area. Pitivi then hides both the video preview and the graphical representation of the sound track. These are replaced by symbols that appear to the left and the right and are connected by a yellow line. The symbols appear as orange, four-sided figures, and they represent handles. Dragging these handles up or down changes the sound clip volume or the transparency of the video clip above. These values adjust automatically to the selected end points. Tapping on a random location on the straight line generates additional points that can then be adjusted as needed (Figure 2).

Figure 2: Volume behavior and image transparency are controlled via the waveforms of a selected clip. Tapping on the yellow line adds points.

The row of tools found to the right of the tracks make it possible to cut and delete videos and audio tracks. They also let the user group individual elements together, undo groupings, and copy clips for pasting elsewhere. The standard setting for the cutting tool makes it work automatically on all tracks. Thus, it is a good idea to select the desired clip before cutting. Pressing the Ctrl key lets you make multiple selections.

In addition to cutting and film composition capabilities, the program offers an Effect Library . Switching into this library lets you both smoothly dissolve clip sequences with the help of transitions and use effects to enhance individual clips. Just highlight the desired clip and drag one of the effects with the mouse into the center work area between the list of effects and preview (Figure 3). At this point, you should check to see whether Pitivi has separated the audio from the video effects in the list. The corresponding category is selected at the top of the list. You can add multiple effects to a single clip.

Figure 3: Pitivi contains numerous effects letting you perform comprehensive edits of a video. The selection ranges from simple color filters to compute-intensive 3D animation.

Fading and Titles

The option for setting transitions is also located here. Setting a transition requires laying the desired clips on a track and arranging them such that they overlap a little bit. Next, you can highlight the overlapping sections and select the Transition tab. The available cross-fades become activated when they are tapped. Options for modifying the sharpness of the display and the direction are underneath this tab (Figure 4).

Figure 4: To add a cross-fade, you can arrange two clips in a track such that they overlap and then select the overlapping area.

As a final option, Pitivi offers the possibility via the Title tab to superimpose text on an image. This is done by selecting the generate button and then switching into a simple editor for constructing the text. Pitivi will then automatically deposit the title at the end of the time bar in the track that has the longest run time. Just as with a clip, you can drag the title to the desired track and extend it to the desired length. To subsequently modify a piece of text, select the text in the time bar. Pitivi will automatically switch to the correct tab.

After completing all of the work, you can export the video by clicking on Render in the top bar. An assistant then helps select suitable codecs and settings. The time required to finish this process depends on the length of the video and the effects that have been embedded. The results of this process proved unreliable in testing. Pitivi rendered some of the clips successfully but it attached audible artifacts to the end of the video. With other test projects, Pitivi interrupted the export with a message stating that there had been a "general error in the data stream."

OpenShot

Even though OpenShot [6] and Pitivi look similar at first glance, they are actually very different. Unlike Pitivi, OpenShot relies, just as does Kdenlive, on the MLT Multimedia Framework [7] instead of on the GStreamer libraries. Also, version 2.0 of OpenShot, which is currently available in Beta [8], has switched to the Qt interface. (See the "Installing OpenShot" info box.) This change gives OpenShot a flexible layout similar to the one in Pitivi and makes it possible to take operating elements out of a window and transfer them to a second monitor. With respect to operation, the programs work almost identically to one another (Figure 5).

Installing OpenShot

Ubuntu doesn't come with the latest OpenShot software, supplying packages only from the quite ancient 1.4.x branch. Fortunately, OpenShot supplies its own PPA with an up-to-date version of the editor, which will work fine on Ubuntu 14.04 and higher.

To begin, add the PPA to your list of repositories, update the software cache, and install:

sudo add-apt-repository ppa:openshot.developers/ppa
sudo apt update
# Use "apt-get" on older versions of Ubuntu.
sudo apt install openshot-qt
# or "apt-get"
Figure 5: The interface for OpenShot version 2.0 has been switched over to Qt, making it appear more modest than the Pitivi interface. Also, it does not have the same customization features.

OpenShot divides the editor window into three different areas. The time bar and the window for the video preview will be familiar from Pitivi. OpenShot, however, arranges the tools needed for editing above the time line. The third area contains a media library organized with tabs and a large selection of transitions and effects. Like Pitivi, OpenShot uses drag and drop to move clips and audio tracks from the library to the time line.

Unlike Pitivi, OpenShot still displays a bar without audio track but with several thumbnails of the video. This feature complicates the process of cutting a clip in correlation with the sound. Moreover, putting the desired segments together in the time line is not easy. Scissors may actually be required or the user can set the length in the clip properties on the time line. Practically speaking, working with OpenShot proves somewhat less convenient than working with Pitivi.

In OpenShot, you can drag transitions and effects from the corresponding tabs onto the desired clip in the time line (Figure 6). A small cog wheel next to the preview image indicates that the clip includes an effect. As with the length of a clip, you cannot adapt the length of a transition simply by dragging the edges of the bar in the time line. Instead, you must open the context menu for the element, choose Properties , and specify the duration. The context menu is also used to turn off the video image and mute the sound. These actions are not as easy to perform in Pitivi.

Figure 6: You can insert cross-fades between two tracks in OpenShot. In Pitivi, clips with cross-fades must be located in the same track.

Animated Titles

Text and subtitles are inserted into the video via the Title | New Title … and New Animated Title … menu. The first option generates static title graphics in SVG format with the help of prescribed layouts. Tapping in the Title Editor dialog on Use Advanced Editor causes OpenShot to transfer the image to the vector-based drawing program Inkscape [9]. This program gives the user free rein in constructing a title.

OpenShot can also call upon Blender for title animation. Blender is an open source computer graphics program that has been seamlessly connected to OpenShot. OpenShot transfers a prepared project to Blender, which you can simply adjust for the text and settings (Figure 7).

Figure 7: Rendering title animations in combination with the 3D graphics program Blender works again in OpenShot 2.0.

In general, however, you will still find a lot of rough edges in the Beta version of OpenShot 2.0. As a result, we could not put it through the paces of an endurance test in the lab. Moreover, the program consistently crashes when certain actions are performed. Thus, successfully completing a video project with OpenShot 2.0 was impossible. This initial version is nonetheless convincing in its promise for the future. The $45,000 collected via Kickstarter [10] was not spent in vain, although it took more than three years to complete OpenShot 2.0.

Conclusion

The observations about the current and future versions of the two products presented here show somewhat patchy performance with respect to video editing in Linux. The ideal approach would be to combine the stability found in OpenShot 1.4.3 with the Pitivi 0.95 interface and the cross-fades integration capability of OpenShot 2.0 Beta. Then, the outlook for a straightforward Linux application for editing videos would be quite rosy. Currently, Pitivi and OpenShot still need to become more mature. l

Installing Pitivi

Installing Pitivi on Ubuntu 16.04 is surprisingly painless, in that the current version in the Ubuntu Xenial repositories is completely up to date. This means there's no need to mess around with PPAs.

Just run:

sudo apt update
# or apt-get update if you are on something older than 16.04.

and:

sudo apt install pitivi
# or apt-get install

and you're done.

In testing, however, we were unable to find the program in the Ubuntu launcher. If this happens, no biggie: Just type pitivi into a terminal window and the editor will launch from there.