Commit 2dde401d authored by Thibault Saunier's avatar Thibault Saunier 🌵

Merging gst-editing-services

parents 37649ab1 eabcaa1a
{
"phabricator.uri" : "https://phabricator.freedesktop.org/",
"repository.callsign" : "GES",
"project": "GStreamer Editing Services",
"default-reviewers": "thiblahute,Mathieu_Du"
}
/build/
/b/
/_build/
*~
core.*
core
log
include: "https://gitlab.freedesktop.org/gstreamer/gst-ci/raw/master/gitlab/ci_template.yml"
Edward Hervey <edward.hervey@collabora.co.uk>
Brandon Lewis <brandon.lewis@collabora.co.uk>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
GStreamer Editing Services
--------------------------
This is a high-level library for facilitating the creation of audio/video
non-linear editors.
License:
--------
This package and its contents are licensend under the GNU Lesser General
Public License (LGPL).
Dependencies:
-------------
* GStreamer core
* gst-plugins-base
This is GStreamer gst-editing-services 1.17.0.1.
The GStreamer team is thrilled to announce a new major feature release in the
stable 1.0 API series of your favourite cross-platform multimedia framework!
As always, this release is again packed with new features, bug fixes and
other improvements.
The 1.16 release series adds new features on top of the 1.14 series and is
part of the API and ABI-stable 1.x release series of the GStreamer multimedia
framework.
Full release notes will one day be found at:
https://gstreamer.freedesktop.org/releases/1.16/
Binaries for Android, iOS, Mac OS X and Windows will usually be provided
shortly after the release.
This module will not be very useful by itself and should be used in conjunction
with other GStreamer modules for a complete multimedia experience.
- gstreamer: provides the core GStreamer libraries and some generic plugins
- gst-plugins-base: a basic set of well-supported plugins and additional
media-specific GStreamer helper libraries for audio,
video, rtsp, rtp, tags, OpenGL, etc.
- gst-plugins-good: a set of well-supported plugins under our preferred
license
- gst-plugins-ugly: a set of well-supported plugins which might pose
problems for distributors
- gst-plugins-bad: a set of plugins of varying quality that have not made
their way into one of core/base/good/ugly yet, for one
reason or another. Many of these are are production quality
elements, but may still be missing documentation or unit
tests; others haven't passed the rigorous quality testing
we expect yet.
- gst-libav: a set of codecs plugins based on the ffmpeg library. This is
where you can find audio and video decoders and encoders
for a wide variety of formats including H.264, AAC, etc.
- gstreamer-vaapi: hardware-accelerated video decoding and encoding using
VA-API on Linux. Primarily for Intel graphics hardware.
- gst-omx: hardware-accelerated video decoding and encoding, primarily for
embedded Linux systems that provide an OpenMax
implementation layer such as the Raspberry Pi.
- gst-rtsp-server: library to serve files or streaming pipelines via RTSP
- gst-editing-services: library an plugins for non-linear editing
==== Download ====
You can find source releases of gstreamer in the download
directory: https://gstreamer.freedesktop.org/src/gstreamer/
The git repository and details how to clone it can be found at
https://cgit.freedesktop.org/gstreamer/gstreamer/
==== Homepage ====
The project's website is https://gstreamer.freedesktop.org/
==== Support and Bugs ====
We have recently moved from GNOME Bugzilla to GitLab on freedesktop.org
for bug reports and feature requests:
https://gitlab.freedesktop.org/gstreamer
Please submit patches via GitLab as well, in form of Merge Requests. See
https://gstreamer.freedesktop.org/documentation/contribute/
for more details.
For help and support, please subscribe to and send questions to the
gstreamer-devel mailing list (see below for details).
There is also a #gstreamer IRC channel on the Freenode IRC network.
==== Developers ====
GStreamer source code repositories can be found on GitLab on freedesktop.org:
https://gitlab.freedesktop.org/gstreamer
and can also be cloned from there and this is also where you can submit
Merge Requests or file issues for bugs or feature requests.
Interested developers of the core library, plugins, and applications should
subscribe to the gstreamer-devel list:
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
# GStreamer
#
# Copyright (C) 2013 Thibault Saunier <tsaunier@gnome.org
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library 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
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the
# Free Software Foundation, Inc., 51 Franklin Street, Suite 500,
# Boston, MA 02110-1335, USA.
import os
from gi.repository import Gst, GES, GLib
class Simple:
def __init__(self, uri):
timeline = GES.Timeline.new_audio_video()
self.project = timeline.get_asset()
self.project.connect("asset-added", self._asset_added_cb)
self.project.connect("error-loading-asset", self._error_loading_asset_cb)
self.project.create_asset(uri, GES.UriClip)
self.layer = timeline.append_layer()
self._create_pipeline(timeline)
self.loop = GLib.MainLoop()
def _create_pipeline(self, timeline):
self.pipeline = GES.Pipeline()
self.pipeline.set_timeline(timeline)
bus = self.pipeline.get_bus()
bus.add_signal_watch()
bus.connect("message", self.bus_message_cb)
def bus_message_cb(self, unused_bus, message):
if message.type == Gst.MessageType.EOS:
print "eos"
self.loop.quit()
elif message.type == Gst.MessageType.ERROR:
error = message.parse_error()
print "error %s" % error[1]
self.loop.quit()
def start(self):
self.loop.run()
def _asset_added_cb(self, project, asset):
self.layer.add_asset(asset, 0, 0, Gst.SECOND * 5, GES.TrackType.UNKNOWN)
self.pipeline.set_state(Gst.State.PLAYING)
def _error_loading_asset_cb(self, project, error, asset_id, type):
print "Could not load asset %s: %s" % (asset_id, error)
self.loop.quit()
if __name__ == "__main__":
if len(os.sys.argv) != 2:
print "You must specify a file URI"
exit(-1)
Gst.init(None)
GES.init()
simple = Simple(os.sys.argv[1])
simple.start()
# -*- Mode: Python; py-indent-offset: 4 -*-
# vim: tabstop=4 shiftwidth=4 expandtab
#
# GES.py
#
# Copyright (C) 2012 Thibault Saunier <thibault.saunier@collabora.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This program 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
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
# This program 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, or (at your option)
# any later version.
import sys
from ..overrides import override
from ..importer import modules
if sys.version_info >= (3, 0):
_basestring = str
_callable = lambda c: hasattr(c, '__call__')
else:
_basestring = basestring
_callable = callable
GES = modules['GES']._introspection_module
__all__ = []
if GES._version == '0.10':
import warnings
warn_msg = "You have imported the GES 0.10 module. Because GES 0.10 \
was not designed for use with introspection some of the \
interfaces and API will fail. As such this is not supported \
by the GStreamer development team and we encourage you to \
port your app to GES 1 or greater. static python bindings is the recomended \
python module to use with GES 0.10"
warnings.warn(warn_msg, RuntimeWarning)
class TimelineElement(GES.TimelineElement):
def __repr__(self):
return "%s [%s (%s) %s]" % (
self.props.name,
Gst.TIME_ARGS(self.props.start),
Gst.TIME_ARGS(self.props.in_point),
Gst.TIME_ARGS(self.props.duration),
)
def set_child_property(self, prop_name, prop_value):
res, child, unused_pspec = GES.TimelineElement.lookup_child(self, prop_name)
if not res:
return res
child.set_property(prop_name, prop_value)
return res
TimelineElement = override(TimelineElement)
__all__.append('TimelineElement')
class TrackElement(GES.TrackElement):
def set_child_property(self, prop_name, prop_value):
return TimelineElement.set_child_property(self, prop_name, prop_value)
TrackElement = override(TrackElement)
__all__.append('TrackElement')
class Container(GES.Container):
def edit(self, layers, new_layer_priority, mode, edge, position):
return GES.TimelineElement.edit(self, layers, new_layer_priority, mode, edge, position)
Container = override(Container)
__all__.append('Container')
class Asset(GES.Asset):
def __repr__(self):
return "%s(%s)" % (super().__repr__(), self.props.id)
Asset = override(Asset)
__all__.append('Asset')
try:
from gi.repository import Gst
Gst
except:
raise RuntimeError("GSt couldn't be imported, make sure you have gst-python installed")
#!/usr/bin/env python
#
# __init__.py
#
# Copyright (C) 2012 Thibault Saunier <thibaul.saunier@collabora.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This program 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
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
# This program 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, or (at your option)
# any later version.
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
install_data(['gi/overrides/GES.py'], install_dir: pygi_override_dir)
\ No newline at end of file
# GStreamer
# Copyright (C) 2015 Mathieu Duponchelle <mathieu.duponchelle@opencreed.com>
#
# bash/zsh completion support for ges-launch
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library 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
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
HELPERDIR="${BASH_SOURCE[0]%/*}/../helpers"
if [[ ! -d "$HELPERDIR" ]]; then
HELPERDIR="$(pkg-config --variable=bashhelpersdir gstreamer-1.0)"
else
HELPERDIR=`cd "$HELPERDIR"; pwd`
fi
# Common definitions
. "$HELPERDIR"/gst
HELPER="$_GST_HELPER"
_list_commands ()
{
ges-launch-1.0 help | grep '^ +' | cut -d' ' -f3
}
_ges___inspect_action_type ()
{
COMPREPLY=( $(compgen -W "$(ges-launch-1.0 --inspect-action-type | grep '^[^ ]' | cut -d':' -f2)" -- $cur) )
}
_ges___track_types ()
{
COMPREPLY=( $(compgen -W "audio video audio+video" -- $cur) )
}
_ges___set_scenario () {
COMPREPLY=( $(compgen -W "*.scenario $(gst-validate-1.0 -l | awk '$0=$2' FS=[ RS=])" -- $cur) )
}
_ges___load () {
COMPREPLY=( $(compgen -W "*.xges" -- $cur) )
}
_ges___outputuri () {
COMPREPLY=( $(compgen -W "file://" -- $cur) )
}
_ges___audiosink () {
COMPREPLY=( $(compgen -W "$($HELPER --klass=Sink --sinkcaps='audio/x-raw')" -- $cur) )
}
_ges___videosink () {
COMPREPLY=( $(compgen -W "$($HELPER --klass=Sink --sinkcaps='video/x-raw')" -- $cur) )
}
_ges_clip () {
if [[ "$prev" == "$command" ]];
then
_gst_mandatory_argument
else
COMPREPLY=( $(compgen -W "duration= inpoint= start= layer= $(_list_commands)" -- $cur) )
fi
}
_ges_test_clip () {
if [[ "$prev" == "$command" ]];
then
_gst_mandatory_argument
else
COMPREPLY=( $(compgen -W "duration= inpoint= start= layer= $(_list_commands)" -- $cur) )
fi
}
_ges_effect () {
if [[ "$prev" == "$command" ]];
then
_gst_mandatory_argument
else
COMPREPLY=( $(compgen -W "duration= start= layer= $(_list_commands)" -- $cur) )
fi
}
_ges_list_options () {
_gst_all_arguments ges-launch-1.0
}
_ges_list_commands () {
COMPREPLY=( $(compgen -W "$(_list_commands)" -- $cur) )
}
_ges_list_properties () {
local props
if [[ "$real_command" == "" ]]
then
_gst_mandatory_argument
elif [[ "$real_command" == "+clip" ]]
then
COMPREPLY=( $(compgen -W "set-alpha set-posx set-posy set-width set-height set-volume set-mute" -- $cur) )
elif [[ "$real_command" == "+test-clip" ]]
then
COMPREPLY=( $(compgen -W "set-alpha set-posx set-posy set-width set-height set-volume set-mute" -- $cur) )
elif [[ "$real_command" == "+effect" ]]
then
COMPREPLY=()
effect_bin_description="${effect_bin_description//\"/ }"
array=(${effect_bin_description//!/ })
for i in "${array[@]}"; do
props=("$($HELPER --element-properties $i)")
for j in $props; do
j="${j//=/ }"
COMPREPLY+=( $(compgen -W "set-$j" -- $cur) )
done
done
else
_gst_mandatory_argument
fi
}
_ges___exclude_ () { _gst_mandatory_argument; }
_ges___encoding_profile () { _gst_mandatory_argument; }
_ges___ges_sample_path () { _gst_mandatory_argument; }
_ges___ges_sample_path_recurse () { _gst_mandatory_argument; }
_ges___thumbnail () { _gst_mandatory_argument; }
_ges___repeat () { _gst_mandatory_argument; }
_ges___save () { _gst_mandatory_argument; }
containsElement () {
local e
for e in "${@:2}";
do
[[ "$e" == "$1" ]] && return 0;
done
return 1
}
__ges_main ()
{
local i=1 c=1 command function_exists completion_func commands real_command effect_bin_description
commands=($(_list_commands))
real_command=""
effect_bin_description=""
if [[ "$cur" == "=" ]]; then
_gst_mandatory_argument
return
fi
while [[ $i -ne $COMP_CWORD ]];
do
local var
var="${COMP_WORDS[i]}"
if [[ "$var" == "--"* ]]
then
command="$var"
elif containsElement "$var" "${commands[@]}";
then
real_command="$var"
command="$var"
if [[ "$var" == "+effect" ]]
then
effect_bin_description="${COMP_WORDS[i+1]}"
fi
fi
i=$[$i+1]
done
if [[ "$command" == "--gst"* ]]; then
completion_func="_${command//-/_}"
else
completion_func="_ges_${command//-/_}"
completion_func="${completion_func//+/}"
fi
declare -f $completion_func >/dev/null 2>&1
function_exists=$?
if [[ "$cur" == "-"* ]]; then
_ges_list_options
elif [[ "$cur" == "+"* ]]; then
_ges_list_commands
elif [[ "$cur" == "="* ]]
then
_gst_mandatory_argument
elif [[ "$cur" == "set-"* ]]
then
_ges_list_properties
elif [ $function_exists -eq 0 ]
then
$completion_func
else
_ges_list_commands
fi
}
__ges_func_wrap ()
{
local cur prev
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
$1
}
# Setup completion for certain functions defined above by setting common
# variables and workarounds.
# This is NOT a public function; use at your own risk.
__ges_complete ()
{
local wrapper="__ges_wrap${2}"
eval "$wrapper () { __ges_func_wrap $2 ; }"
complete -o bashdefault -o default -o nospace -F $wrapper $1 2>/dev/null \
|| complete -o default -o nospace -F $wrapper $1
}
_ges ()
{
__ges_wrap__ges_main
}