[gst-devel] divxenc testing

Joshua N Pritikin vishnu at pobox.com
Wed May 7 06:53:03 CEST 2003


On Wed, May 07, 2003 at 09:58:14AM +0200, Ronald Bultje wrote:
> On Wed, 2003-05-07 at 06:19, Joshua N Pritikin wrote:
> > Before i write a bunch of code that we have to throw away in a few
> > months, can you give me some clue what the "correct" solution
> > should look like?
> 
> The correct solution is to keep the xvid caps - that's enough info to
> know what we're doing. avimux needs to understand it and fill out the
> internal structs based on that, just like it already does for
> video/jpeg.

Can you comment on the attached patch?

i don't think i changed anything in gstxvidenc.c (but i can't
check because sf.net is borked).

Anyway, i attached the output from gst-launch with & without
gst-mask=-1.  If this mail is too big (40k) then i'll file
a bugzilla report or something.

-- 
Victory to the Divine Mother!!         after all,
  http://sahajayoga.org                  http://why-compete.org
-------------- next part --------------
Index: gstavimux.c
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/gst/avi/gstavimux.c,v
retrieving revision 1.32
diff -u -r1.32 gstavimux.c
--- gstavimux.c	15 Apr 2003 17:11:42 -0000	1.32
+++ gstavimux.c	7 May 2003 13:36:05 -0000
@@ -87,6 +87,12 @@
   ),
   GST_CAPS_NEW (
     "avimux_sink_video",
+    "video/xvid",
+      "width",  GST_PROPS_INT_RANGE (16, 4096),
+      "height", GST_PROPS_INT_RANGE (16, 4096)
+  ),
+  GST_CAPS_NEW (
+    "avimux_sink_video",
     "video/raw",
       "format", GST_PROPS_LIST (
                   GST_PROPS_FOURCC (GST_MAKE_FOURCC('Y','U','Y','2')),
@@ -307,11 +313,32 @@
 
   GST_DEBUG (0, "avimux: sinkconnect triggered on %s", gst_pad_get_name (pad));
 
+  g_warning ("avimux sinkconnect");
+
   for (caps = vscaps; caps != NULL; caps = vscaps = vscaps->next)
   {
     const gchar* mimetype = gst_caps_get_mime(caps);
 
-    if (!strcmp (mimetype, "video/avi"))
+    g_warning ("got %s", mimetype);
+
+    if (!strcmp (mimetype, "video/xvid")) {
+      g_warning ("got xvid");
+      avimux->vids.size        = sizeof(gst_riff_strf_vids);
+      gst_caps_get (caps,
+		    "width",       &avimux->vids.width,
+		    "height",      &avimux->vids.height,
+		    NULL);
+      avimux->vids.compression = GST_MAKE_FOURCC('x','v','i','d');
+      avimux->vids.planes = 1;      
+      avimux->vids.bit_cnt = 24;
+      avimux->vids.image_size  = avimux->vids.height * avimux->vids.width;
+
+      avimux->avi_hdr.width = avimux->vids.width;
+      avimux->avi_hdr.height = avimux->vids.height;
+      avimux->vids_hdr.fcc_handler = avimux->vids.compression;
+      goto done;
+    }
+    else if (!strcmp (mimetype, "video/avi"))
     {
       const gchar* format;
       
@@ -419,9 +446,13 @@
     }
     else if (!strcmp (mimetype, "audio/x-mp3"))
     {
-      gint layer;
+      gint layer = 2;
 
-      gst_caps_get_int(caps, "layer", &layer);
+      if (gst_caps_has_property (caps, "layer"))
+	gst_caps_get_int (caps, "layer", &layer);
+      else
+	g_warning ("avimux: layer not specified for %s, assuming layer %d",
+		   mimetype, layer);
 
       /* we don't need to do anything here, compressed mp3 contains it all */
       avimux->auds.format      = (layer == 3?
-------------- next part --------------
joshua at emit:~/gst/gstreamer/tools$ ./gst-launch filesrc location=/local/aleader/ljr.mpg ! mpegdemux name=demux demux.video_00 ! mpeg2dec ! colorspace ! xvidenc ! avimux ! filesink location=/tmp/test.m1v
INFO (  525: 0) Initializing GStreamer Core Library version 0.7.0.1 
INFO (  525: 0) CPU features: (0081813f) MMX 
INFO (  525: 0) registry: loaded user_registry in 0.926400 seconds
          (/home/joshua/.gstreamer-0.7/registry.xml)
INFO (  525: 0) registry: loaded global_registry in 0.572307 seconds
          (/home/joshua/gst/gstreamer/registry.xml)
WARNING: erroneous pipeline: could not link xvidenc0 to avimux0
         Trying to run anyway
RUNNING pipeline

(process:525): GStreamer-WARNING **: push on pad xvidenc0:src but it is unlinked
(process:525): GStreamer-WARNING **: push on pad xvidenc0:src but it is unlinked
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p3.bz2
Type: application/octet-stream
Size: 39117 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20030507/ee514607/attachment.obj>


More information about the gstreamer-devel mailing list