[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-promo
Subject:    Re: [kde-promo] recording a KDE session
From:       Tim Jansen <ml () tjansen ! de>
Date:       2003-01-30 18:24:20
[Download RAW message or body]

On Thursday 30 January 2003 13:58, Philippe FREMY wrote:
> > http://www.tjansen.de/krfb/demo.html
>
> Now, do you think it would be possible to integrate audio comments to this
> ? That would be top of the top.

I wrote the attached patch for vnc2swf that adds the capability to integrate a 
mp3 as 'soundtrack' for the flash movie.

The problem, however, is that you can not record sound while you are recording 
the movie. The mp3 must available as a file while the movie is recorded. This 
is because the Ming(.sourceforge.net) library that creates the flash file can 
not handle streams, only files (it seeks on the fd). If someone would fix 
Ming it should be possible to record audio while recording the desktop.

Possible solutions:
1. Fix the MP3 parser in Ming. Then you can live-encode the MP3 to a fifo and 
give the fifo's name to vnc2swf as argument.
2. Record using rfbproxy and capture the audio while you do this. Then encode 
the audio as mp3, and play the recorded rfbproxy movie to vnc2swf with the 
created mp3 as 'soundtrack'. 
3. Use a tool that can attach a soundtrack to the flash movie, e.g. 
Macromedia's authoring tool.

bye...


["vnc2swf-mp3.patch" (text/x-diff)]

diff -u vnc2swf-0.2/argsresources.c vnc2swf-0.2.mp3/argsresources.c
--- vnc2swf-0.2/argsresources.c	2002-06-19 01:10:55.000000000 +0200
+++ vnc2swf-0.2.mp3/argsresources.c	2003-01-30 19:11:57.000000000 +0100
@@ -198,6 +198,9 @@
   {"dumpFile", "DumpFile", XtRString, sizeof(String),
    XtOffsetOf(AppData, dumpfileString), XtRImmediate, (XtPointer) "out.swf"},
 
+  {"soundFile", "SoundMP3File", XtRString, sizeof(String),
+   XtOffsetOf(AppData, soundfileString), XtRImmediate, (XtPointer) 0},
+
   {"frameRate", "FrameRate", XtRInt, sizeof(int),
    XtOffsetOf(AppData, frameRate), XtRImmediate, (XtPointer) 12},
 
@@ -224,6 +227,7 @@
   {"-truecolour", "*forceTrueColour",   XrmoptionNoArg,  "True"},
   {"-depth",      "*requestedDepth",    XrmoptionSepArg, 0},
   {"-dumpfile",   "*dumpFile",          XrmoptionSepArg, 0},
+  {"-soundfile",  "*soundFile",         XrmoptionSepArg, 0},
   {"-framerate",  "*frameRate",         XrmoptionSepArg, 0},
   {"-nommhack",   "*macromediaHack",    XrmoptionNoArg,  "False"},
 };
@@ -274,6 +278,7 @@
 	  "              -truecolour\n"
 	  "              -depth <depth>\n"
 	  "              -dumpfile <file-to-dump>\n"
+	  "              -soundfile <mp3-to-play>\n"
 	  "              -framerate <frames-per-sec>\n"
 	  "              -nommhack\n"
 	  ,programName,programName);
diff -u vnc2swf-0.2/rfbproto.c vnc2swf-0.2.mp3/rfbproto.c
--- vnc2swf-0.2/rfbproto.c	2002-06-19 01:10:55.000000000 +0200
+++ vnc2swf-0.2.mp3/rfbproto.c	2003-01-30 19:11:57.000000000 +0100
@@ -233,6 +233,7 @@
   PrintPixelFormat(&si.format);
   
   if (!WriteInitMovie(appData.dumpfileString, 
+  		      appData.soundfileString,
 		      appData.frameRate,
 		      appData.macromediaHack,
 		      si.framebufferWidth, 
diff -u vnc2swf-0.2/vncviewer.h vnc2swf-0.2.mp3/vncviewer.h
--- vnc2swf-0.2/vncviewer.h	2002-06-19 18:43:19.000000000 +0200
+++ vnc2swf-0.2.mp3/vncviewer.h	2003-01-30 19:11:57.000000000 +0100
@@ -88,6 +88,7 @@
   int bumpScrollPixels;
 
   String dumpfileString;
+  String soundfileString;
   int frameRate;
   int macromediaHack;
 } AppData;
@@ -236,7 +237,7 @@
 extern Widget toplevel;
 
 /* writeswf.c */
-extern Bool WriteInitMovie(char* filename, int frate, int mmhack, int w, int h);
+extern Bool WriteInitMovie(char* filename, char *soundfile, int frate, int mmhack, int w, int h);
 extern Bool WriteFinishMovie(void);
 extern Bool WriteRawImage(char* buf, int x, int y, int w, int h, int skip);
 extern Bool WriteMoveImage(Display* dpy, Drawable d, XImage* img,
diff -u vnc2swf-0.2/writeswf.c vnc2swf-0.2.mp3/writeswf.c
--- vnc2swf-0.2/writeswf.c	2002-06-19 19:56:54.000000000 +0200
+++ vnc2swf-0.2.mp3/writeswf.c	2003-01-30 19:11:57.000000000 +0100
@@ -348,7 +348,7 @@
 /* WriteInitMovie:
  *   Initialize Ming and prepare a movie file.
  */
-Bool WriteInitMovie(char* filename, int frate, int mmhack, int w, int h)
+Bool WriteInitMovie(char* filename, char *soundname, int frate, int mmhack, int w, int h)
 {
   fprintf(stderr,"WriteInitMovie: Opening file: \"%s\" with frame rate %d\n", 
 	  filename, frate);
@@ -372,6 +372,8 @@
   movie = newSWFMovie();
   Ming_init();
   SWFMovie_setRate(movie, frate);
+  if (soundname)
+    SWFMovie_setSoundStream(movie, newSWFSound(fopen(soundname, "r")));
   SWFMovie_setDimension(movie, w, h);
   intervalusec = 1000000L / frate;
   tv0.tv_sec = tv0.tv_usec = -1;

_______________________________________________
This message is from the kde-promo mailing list.

Visit http://mail.kde.org/mailman/listinfo/kde-promo to unsubscribe, set digest on or \
temporarily stop your subscription.



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic