Commit 2dde39ce authored by Thibault Saunier's avatar Thibault Saunier Committed by Alexandru Băluț

Use proper default project and rendering settings

Default to vp8+vorbis in webm 1080p@30fps and 48kz.

Fixes #2322
parent bed3ffa4
......@@ -88,6 +88,8 @@ for i in range(2, GLib.MAXINT):
# Properties of encoders that should be ignored when saving/loading
# a project.
IGNORED_PROPS = ["name", "parent"]
DEFAULT_VIDEO_SETTINGS = "video/x-raw,width=1920,height=1080,framerate=(GstFraction)30/1"
DEFAULT_AUDIO_SETTINGS = "audio/x-raw,channels=2,rate=48000"
SCALED_THUMB_WIDTH = 96
SCALED_THUMB_HEIGHT = 54
......@@ -710,12 +712,15 @@ class Project(Loggable, GES.Project):
self.container_profile = \
GstPbutils.EncodingContainerProfile.new("pitivi-profile",
_("Pitivi encoding profile"),
Gst.Caps("application/ogg"),
Gst.Caps("video/webm"),
None)
has_default_settings = not bool(uri) and not bool(scenario)
vsettings = DEFAULT_VIDEO_SETTINGS if has_default_settings else "video/x-raw"
self.video_profile = GstPbutils.EncodingVideoProfile.new(
Gst.Caps("video/x-theora"), None, Gst.Caps("video/x-raw"), 0)
Gst.Caps("video/x-vp8"), None, Gst.Caps(vsettings), 0)
asettings = DEFAULT_AUDIO_SETTINGS if has_default_settings else "audio/x-raw"
self.audio_profile = GstPbutils.EncodingAudioProfile.new(
Gst.Caps("audio/x-vorbis"), None, Gst.Caps("audio/x-raw"), 0)
Gst.Caps("audio/x-vorbis"), None, Gst.Caps(asettings), 0)
self.container_profile.add_profile(self.video_profile)
self.container_profile.add_profile(self.audio_profile)
self.add_encoding_profile(self.container_profile)
......@@ -725,7 +730,6 @@ class Project(Loggable, GES.Project):
self.aencoder = Encoders().default_audio_encoder
self._ensureAudioRestrictions()
self._ensureVideoRestrictions()
has_default_settings = not bool(uri) and not bool(scenario)
self._has_default_audio_settings = has_default_settings
self._has_default_video_settings = has_default_settings
......
......@@ -94,9 +94,9 @@ class Encoders(Loggable):
X264 = "x264enc"
SUPPORTED_ENCODERS_COMBINATIONS = [
(WEBM, VORBIS, VP8),
(OGG, VORBIS, THEORA),
(OGG, OPUS, THEORA),
(WEBM, VORBIS, VP8),
(WEBM, OPUS, VP8),
(MP4, AAC, X264),
(MP4, AC3, X264),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment