[longomatch] Added support for VP8 and WebM !!!
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Added support for VP8 and WebM !!!
- Date: Sun, 30 May 2010 23:18:30 +0000 (UTC)
commit 4cdbcef7804614c758c76a7ae7392b6bbec37e13
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Sat May 29 13:01:43 2010 +0200
Added support for VP8 and WebM !!!
CesarPlayer/Common/Enum.cs | 4 +++-
LongoMatch/Gui/Component/ProjectDetailsWidget.cs | 9 ++++++++-
LongoMatch/Gui/Dialog/VideoEditionProperties.cs | 9 +++++++++
libcesarplayer/src/common.h | 6 ++++--
libcesarplayer/src/gst-camera-capturer.c | 15 +++++++++++++--
libcesarplayer/src/gst-video-editor.c | 12 ++++++++++--
6 files changed, 47 insertions(+), 8 deletions(-)
---
diff --git a/CesarPlayer/Common/Enum.cs b/CesarPlayer/Common/Enum.cs
index 7f0a905..b6c0593 100644
--- a/CesarPlayer/Common/Enum.cs
+++ b/CesarPlayer/Common/Enum.cs
@@ -52,7 +52,8 @@ namespace LongoMatch.Video.Common
Xvid,
Theora,
H264,
- Mpeg2
+ Mpeg2,
+ VP8,
}
public enum AudioEncoderType {
@@ -67,6 +68,7 @@ namespace LongoMatch.Video.Common
Matroska,
Ogg,
MpegPS,
+ WebM,
}
public enum CapturerType{
diff --git a/LongoMatch/Gui/Component/ProjectDetailsWidget.cs b/LongoMatch/Gui/Component/ProjectDetailsWidget.cs
index 29acfe0..27f27e1 100644
--- a/LongoMatch/Gui/Component/ProjectDetailsWidget.cs
+++ b/LongoMatch/Gui/Component/ProjectDetailsWidget.cs
@@ -58,6 +58,7 @@ namespace LongoMatch.Gui.Component
private const string AVI = "AVI (XVID + MP3)";
private const string MP4 = "MP4 (H264 + AAC)";
private const string OGG = "OGG (Theora + Vorbis)";
+ private const string WEBM= "WebM (VP8 + Vorbis)";
public ProjectDetailsWidget()
@@ -289,6 +290,11 @@ namespace LongoMatch.Gui.Component
s.AudioEncoder = AudioEncoderType.Vorbis;
s.Muxer = VideoMuxerType.Ogg;
break;
+ case WEBM:
+ s.VideoEncoder = VideoEncoderType.VP8;
+ s.AudioEncoder = AudioEncoderType.Vorbis;
+ s.Muxer = VideoMuxerType.WebM;
+ break;
}
return s;
}
@@ -421,10 +427,11 @@ namespace LongoMatch.Gui.Component
sizecombobox.AppendText(PAL_1_2_FORMAT);
sizecombobox.Active = 0;
+ videoformatcombobox.AppendText(WEBM);
videoformatcombobox.AppendText(OGG);
videoformatcombobox.AppendText(MP4);
videoformatcombobox.AppendText(AVI);
- videoformatcombobox.Active = 1;
+ videoformatcombobox.Active = 0;
}
protected virtual void OnDateSelected(DateTime dateTime) {
diff --git a/LongoMatch/Gui/Dialog/VideoEditionProperties.cs b/LongoMatch/Gui/Dialog/VideoEditionProperties.cs
index 938b1f8..fd278ba 100644
--- a/LongoMatch/Gui/Dialog/VideoEditionProperties.cs
+++ b/LongoMatch/Gui/Dialog/VideoEditionProperties.cs
@@ -40,6 +40,7 @@ namespace LongoMatch.Gui.Dialog
private const string MP4="MP4 (H.264+AAC)";
private const string AVI="AVI (Xvid+MP3)";
private const string OGG="OGG (Theora+Vorbis)";
+ private const string WEBM="WebM (VP8+Vorbis)";
private const string DVD="DVD (MPEG-2)";
@@ -47,6 +48,7 @@ namespace LongoMatch.Gui.Dialog
public VideoEditionProperties()
{
this.Build();
+ formatcombobox.AppendText(WEBM);
formatcombobox.AppendText(MP4);
formatcombobox.AppendText(AVI);
if (System.Environment.OSVersion.Platform != PlatformID.Win32NT) {
@@ -115,6 +117,8 @@ namespace LongoMatch.Gui.Dialog
return "mkv";
else if (formatcombobox.ActiveText == OGG)
return "ogg";
+ else if (formatcombobox.ActiveText == WEBM)
+ return "webm";
else if (formatcombobox.ActiveText == AVI)
return "avi";
else
@@ -150,6 +154,11 @@ namespace LongoMatch.Gui.Dialog
acodec = AudioEncoderType.Vorbis;
muxer = VideoMuxerType.Ogg;
}
+ else if (formatcombobox.ActiveText == WEBM) {
+ vcodec = VideoEncoderType.VP8;
+ acodec = AudioEncoderType.Vorbis;
+ muxer = VideoMuxerType.WebM;
+ }
else if (formatcombobox.ActiveText == AVI) {
vcodec = VideoEncoderType.Xvid;
acodec = AudioEncoderType.Mp3;
diff --git a/libcesarplayer/src/common.h b/libcesarplayer/src/common.h
index 03bcaa3..ee446ad 100644
--- a/libcesarplayer/src/common.h
+++ b/libcesarplayer/src/common.h
@@ -84,7 +84,8 @@ typedef enum
VIDEO_ENCODER_XVID,
VIDEO_ENCODER_THEORA,
VIDEO_ENCODER_H264,
- VIDEO_ENCODER_MPEG2
+ VIDEO_ENCODER_MPEG2,
+ VIDEO_ENCODER_VP8
} VideoEncoderType;
typedef enum
@@ -100,5 +101,6 @@ typedef enum
VIDEO_MUXER_MP4,
VIDEO_MUXER_MATROSKA,
VIDEO_MUXER_OGG,
- VIDEO_MUXER_MPEG_PS
+ VIDEO_MUXER_MPEG_PS,
+ VIDEO_MUXER_WEBM
} VideoMuxerType;
diff --git a/libcesarplayer/src/gst-camera-capturer.c b/libcesarplayer/src/gst-camera-capturer.c
index 2f9447c..aa21f71 100644
--- a/libcesarplayer/src/gst-camera-capturer.c
+++ b/libcesarplayer/src/gst-camera-capturer.c
@@ -1009,11 +1009,17 @@ gst_camera_capturer_set_video_encoder (GstCameraCapturer * gcc,
break;
case VIDEO_ENCODER_THEORA:
- default:
gcc->priv->videoenc =
gst_element_factory_make ("theoraenc", "video-encoder");
name = "Theora video encoder";
break;
+
+ case VIDEO_ENCODER_VP8:
+ default:
+ gcc->priv->videoenc =
+ gst_element_factory_make ("vp8enc", "video-encoder");
+ name = "VP8 video encoder";
+ break;
}
if (!gcc->priv->videoenc) {
@@ -1049,6 +1055,7 @@ gst_camera_capturer_set_audio_encoder (GstCameraCapturer * gcc,
break;
case AUDIO_ENCODER_VORBIS:
+ default:
gcc->priv->audioenc =
gst_element_factory_make ("vorbisenc", "audio-encoder");
name = "Vorbis audio encoder";
@@ -1092,10 +1099,14 @@ gst_camera_capturer_set_video_muxer (GstCameraCapturer * gcc,
gst_element_factory_make ("matroskamux", "video-muxer");
break;
case VIDEO_MUXER_MP4:
- default:
name = "MP4 muxer";
gcc->priv->videomux = gst_element_factory_make ("qtmux", "video-muxer");
break;
+ case VIDEO_MUXER_WEBM:
+ default:
+ name = "WebM muxer";
+ gcc->priv->videomux = gst_element_factory_make ("webmmux", "video-muxer");
+ break;
}
if (!gcc->priv->videomux) {
diff --git a/libcesarplayer/src/gst-video-editor.c b/libcesarplayer/src/gst-video-editor.c
index 8f916e8..7737258 100644
--- a/libcesarplayer/src/gst-video-editor.c
+++ b/libcesarplayer/src/gst-video-editor.c
@@ -28,9 +28,9 @@
#include "gst-video-editor.h"
-#define DEFAULT_VIDEO_ENCODER "theoraenc"
+#define DEFAULT_VIDEO_ENCODER "vp8enc"
#define DEFAULT_AUDIO_ENCODER "vorbisenc"
-#define DEFAULT_VIDEO_MUXER "oggmux"
+#define DEFAULT_VIDEO_MUXER "webmmux"
#define FONT_SIZE_FACTOR 0.03
#define LAME_CAPS "audio/x-raw-int, rate=44100, channels=2, endianness=1234, signed=true, width=16, depth=16"
#define VORBIS_CAPS "audio/x-raw-float, rate=44100, channels=2, endianness=1234, signed=true, width=32, depth=32"
@@ -1065,6 +1065,10 @@ gst_video_editor_set_video_encoder (GstVideoEditor * gve, gchar ** err,
encoder_name = "theoraenc";
encoder = gst_element_factory_make (encoder_name, encoder_name);
break;
+ case VIDEO_ENCODER_VP8:
+ encoder_name = "vp8enc";
+ encoder = gst_element_factory_make (encoder_name, encoder_name);
+ break;
}
if (encoder)
@@ -1271,6 +1275,10 @@ gst_video_editor_set_video_muxer (GstVideoEditor * gve, gchar ** err,
//FIXME: Until we don't have audio save the mpeg-ps stream without mux.
muxer = gst_element_factory_make ("ffmux_dvd", muxer_name);
break;
+ case VIDEO_MUXER_WEBM:
+ muxer_name = "webmmux";
+ muxer = gst_element_factory_make ("webmmux", muxer_name);
+ break;
}
if (muxer)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]