[xiph-commits] r9643 - trunk/theora/examples

msmith at svn.xiph.org msmith at svn.xiph.org
Fri Jul 29 08:45:25 PDT 2005


Author: msmith
Date: 2005-07-29 08:45:23 -0700 (Fri, 29 Jul 2005)
New Revision: 9643

Modified:
   trunk/theora/examples/dump_video.c
Log:
Add an option to dump_video to create output compatible with encoder_example


Modified: trunk/theora/examples/dump_video.c
===================================================================
--- trunk/theora/examples/dump_video.c	2005-07-29 14:15:16 UTC (rev 9642)
+++ trunk/theora/examples/dump_video.c	2005-07-29 15:45:23 UTC (rev 9643)
@@ -50,6 +50,7 @@
 const char *optstring = "o:";
 struct option options [] = {
   {"output",required_argument,NULL,'o'},
+  {"yuv4mpeg2",0, NULL, 'y'}, /* Output YUV4MPEG2, for encoder_example input */
   {NULL,0,NULL,0}
 };
 
@@ -79,6 +80,7 @@
 int          videobuf_ready=0;
 ogg_int64_t  videobuf_granulepos=-1;
 double       videobuf_time=0;
+int          yuv4mpeg2 = 0;
 
 FILE* outfile = NULL;
 
@@ -100,6 +102,8 @@
   yuv_buffer yuv;
   theora_decode_YUVout(&td,&yuv);
 
+  if(yuv4mpeg2)
+    fprintf(outfile, "FRAME\n");
   for(i=0;i<yuv.y_height;i++)
     fwrite(yuv.y+yuv.y_stride*i, 1, yuv.y_width, outfile);
   for(i=0;i<yuv.uv_height;i++)
@@ -173,6 +177,9 @@
         exit(1);
       }
       break;
+      case 'y':
+      yuv4mpeg2 = 1;
+      break;
 
       default:
         usage();
@@ -297,6 +304,11 @@
   /* open video */
   if(theora_p)open_video();
 
+  if(yuv4mpeg2)
+    fprintf(outfile, "YUV4MPEG2 W%d H%d F%d:%d I%c A%d:%d\n",
+          ti.width, ti.height, ti.fps_numerator, ti.fps_denominator, 'p', 
+          ti.aspect_numerator, ti.aspect_denominator);
+
   /* install signal handler */
   signal (SIGINT, sigint_handler);
 



More information about the commits mailing list