diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/Makefile b/Makefile old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/TODO b/TODO old mode 100644 new mode 100755 diff --git a/convert-to-avi.sh b/convert-to-avi.sh index cd36454..4c2beae 100755 --- a/convert-to-avi.sh +++ b/convert-to-avi.sh @@ -1,4 +1,47 @@ #!/bin/sh -./filter --audio "$1" | lame - audio.mp3 -./filter --video "$1" | mencoder -vf scale=1280:720 -ovc xvid -xvidencopts bitrate=1800 -oac copy -audiofile audio.mp3 -o video.avi - +#setup default values +audioname="audio.mp3" +videoname="video.avi" +scriptpath= + +#retrieve values. +while getopts a:v:s: name +do + echo "$OPTARG" + case $name in + a) audioname="$OPTARG";; + v) videoname="$OPTARG";; + s) scriptpath="$OPTARG";; + ?) printf "Usage: %s: [-a audiofile] [-v videofile] [-s scriptpath] rawfile.seom\n" $0 + exit 2;; + esac +done + +#retrieving raw file (rawfile.seom) and the encode script path [encodescript] +shift $(($OPTIND - 1)) +echo "$*" +rawfile="$1" + +#if no raw is given, ask for one. +if [ ! -n $rawfile ]; then + echo "you did not give a raw file (rawfile.seom)." + printf "Usage: %s: [-a audiofile] [-b videofile] [-s scriptpath] rawfile.seom\n" $0 + exit 2 +fi + +#extract audio with lame +echo "generating .mp3 audio file from $rawfile ..." +./filter --audio "$rawfile" | lame - "$audioname" +echo "generated! you can find it at $audioname" + +#encode the video. +echo "encoding video from $rawfile ..." +if [ -z $scriptpath ]; then + echo "scriptpath is empty" + ./filter --video "$rawfile" | mencoder -vf scale=1280:720 -ovc xvid -xvidencopts bitrate=1800 -oac copy -audiofile $audioname -o $videoname - +else + echo "scriptpath is not empty" + ./filter --video "$rawfile" | ./"$scriptpath" "$audioname" "$videoname" +fi +echo "generated! you can find it at $videoname" diff --git a/encode_scripts/example.sh b/encode_scripts/example.sh new file mode 100755 index 0000000..1d984a8 --- /dev/null +++ b/encode_scripts/example.sh @@ -0,0 +1 @@ +mencoder -vf scale=960:768 -ovc xvid -xvidencopts bitrate=1800 -oac copy -audiofile "$1" -o "$2" - diff --git a/include/loader.h b/include/loader.h old mode 100644 new mode 100755 diff --git a/include/stream.h b/include/stream.h old mode 100644 new mode 100755 diff --git a/include/yukon.h b/include/yukon.h old mode 100644 new mode 100755 diff --git a/src/core/audio.c b/src/core/audio.c old mode 100644 new mode 100755 diff --git a/src/core/conf.c b/src/core/conf.c old mode 100644 new mode 100755 diff --git a/src/core/engine.c b/src/core/engine.c old mode 100644 new mode 100755 index 42a5c00..bf77022 --- a/src/core/engine.c +++ b/src/core/engine.c @@ -6,12 +6,14 @@ static uint64_t targetInterval; struct yukonEngine *yukonEngineCreate(const char *spec, unsigned long scale, unsigned long size[2]) { struct yukonEngine *engine = malloc(sizeof(struct yukonEngine)); - if (engine == NULL) + if (engine == NULL){ + logMessage(4, "[yukonEngineCreate] Couldn't create engine, probably you don't have enough memory\n"); return NULL; + } engine->stream = yukonStreamCreate(spec, 16); if (engine->stream == NULL) { - logMessage(4, "Failed to open output stream\n"); + logMessage(4, "[yukonEngineCreate] Failed to open output stream\n"); free(engine); return NULL; } @@ -62,11 +64,15 @@ void yukonEngineCapture(struct yukonEngine *engine) lastCapture = now; struct seomPacket *packet = seomPacketCreate(0x01, engine->size[0] * engine->size[1] * 4); - if (packet == NULL) + if (packet == NULL){ + logMessage(4, "[yukonEngineCapture] seomPacketCreate failed\n"); return; + } glReadPixels(0, 0, engine->size[0], engine->size[1], GL_BGRA, GL_UNSIGNED_BYTE, seomPacketPayload(packet)); + logMessage(4, "[yukonEngineCapture] glReadPixels succeded\n"); yukonStreamPut(engine->stream, packet); + logMessage(4, "[yukonEngineCapture] put packed into stream correctly!\n"); } struct yukonEngine *yukonEngineDestroy(struct yukonEngine *engine) diff --git a/src/core/log.c b/src/core/log.c old mode 100644 new mode 100755 diff --git a/src/core/opengl.c b/src/core/opengl.c old mode 100644 new mode 100755 diff --git a/src/filter/main.c b/src/filter/main.c old mode 100644 new mode 100755 diff --git a/src/filter/wav.c b/src/filter/wav.c old mode 100644 new mode 100755 diff --git a/src/filter/y4m.c b/src/filter/y4m.c old mode 100644 new mode 100755 diff --git a/src/glue/glue.c b/src/glue/glue.c old mode 100644 new mode 100755 index 954bb12..49e3d19 --- a/src/glue/glue.c +++ b/src/glue/glue.c @@ -18,8 +18,11 @@ void glueEvent(Display *dpy, XEvent *event) lastEvent = event->xkey.time; hotkeyPressed = !engine; - if (engine) + logMessage(4, "hotkeyPressed: %i\n", hotkeyPressed); + if (engine){ engine = yukonEngineDestroy(engine); + logMessage(4, "Destroyed engine\n"); + } } break; default: @@ -29,7 +32,7 @@ void glueEvent(Display *dpy, XEvent *event) void glueDrawable(Display *dpy, GLXDrawable drawable) { - if (hotkeyPressed && engine == NULL) { + if (hotkeyPressed && engine == NULL) { hotkeyPressed = 0; /* reload configuration in case it changed */ @@ -43,7 +46,6 @@ void glueDrawable(Display *dpy, GLXDrawable drawable) /* create the main engine */ engine = yukonEngineCreate(yukonGlobal.output, yukonGlobal.scale, size); - if (engine) { logMessage(4, "Yukon engine is active now\n"); } else { diff --git a/src/libs/libGL.c b/src/libs/libGL.c old mode 100644 new mode 100755 diff --git a/src/libs/libX11.c b/src/libs/libX11.c old mode 100644 new mode 100755 diff --git a/src/scripts/yukon b/src/scripts/yukon index 11c35e8..a253246 100755 --- a/src/scripts/yukon +++ b/src/scripts/yukon @@ -25,4 +25,5 @@ for DIR in ${SYSDIRS}; do fi done -LD_LIBRARY_PATH="${YLDPATH}:${LD_LIBRARY_PATH}" YUKON="${PROFILE}" "${@}" +echo "${YLDPATH}:${LD_LIBRARY_PATH}" YUKON="${PROFILE}" +LD_LIBRARY_PATH="${YLDPATH}:${LD_LIBRARY_PATH}" YUKON="${PROFILE}" "${@}" \ No newline at end of file diff --git a/src/stream/arch/C/frame.c b/src/stream/arch/C/frame.c old mode 100644 new mode 100755 diff --git a/src/stream/arch/amd64/frame.asm b/src/stream/arch/amd64/frame.asm old mode 100644 new mode 100755 diff --git a/src/stream/arch/x86/frame.asm b/src/stream/arch/x86/frame.asm old mode 100644 new mode 100755 diff --git a/src/stream/buffer.c b/src/stream/buffer.c old mode 100644 new mode 100755 diff --git a/src/stream/stream.c b/src/stream/stream.c old mode 100644 new mode 100755 index af18533..a8bb552 --- a/src/stream/stream.c +++ b/src/stream/stream.c @@ -35,7 +35,7 @@ static void *streamMultiplexerThread(void *data) struct seomPacket *packet = yukonBufferGet(stream->buffer); if (packet == NULL) break; - + switch (packet->type) { case 0x00: memcpy(&header, seomPacketPayload(packet), sizeof(header)); @@ -76,11 +76,14 @@ static struct seomStreamOps ops = { put, get }; struct yukonStream *yukonStreamCreate(const char *spec, unsigned long size) { struct yukonStream *stream = malloc(sizeof(struct yukonStream)); - if (stream == NULL) - return NULL; + if (stream == NULL){ + printf("[yukonStreamCreate] couldn't create stream\n"); + return NULL; + } stream->fileDescriptor = -1; if (strncmp(spec, "file://", 7) == 0) { + printf("[yukonStreamCreate] is a file://!, %s", &spec[7]); stream->fileDescriptor = open(&spec[7], O_WRONLY | O_CREAT | O_TRUNC, 0664); } else if (strncmp(spec, "ipv4://", 7) == 0) { struct sockaddr_in addr = { @@ -96,20 +99,23 @@ struct yukonStream *yukonStreamCreate(const char *spec, unsigned long size) stream->fileDescriptor = -1; } } - + if (stream->fileDescriptor < 0) { + printf("[yukonStreamCreate] fileDescriptor is less than zero, couldn't create file!\n"); free(stream); return NULL; } stream->stream = seomStreamCreate(&ops, stream); if (stream->stream == NULL) { + printf("[yukonStreamCreate] couldn't create stream\n"); free(stream); return NULL; } stream->buffer = yukonBufferCreate(size); if (stream->buffer == NULL) { + printf("[yukonStreamCreate] couldn't create buffer\n"); free(stream); return NULL; } diff --git a/src/tools/stat.c b/src/tools/stat.c old mode 100644 new mode 100755 diff --git a/tools/yukon.conf b/tools/yukon.conf old mode 100644 new mode 100755 index 8da2402..a229314 --- a/tools/yukon.conf +++ b/tools/yukon.conf @@ -11,6 +11,11 @@ # file:// # Specifies a single file which will be used and subsequently # rewritten. +# Please note that, if OUTPUT starts with file:// and ends with a slash +# (/), a file named "[exe]-[date]-[time].seom" will be generated in the +# specified path. +# This behaviour is useful if you plan to make more recording sessions +# in the same day. # ipv4:// # Specifies an IP address where seom-server is running. Please note # there is currently no way to change (or specify) the port number; @@ -18,7 +23,7 @@ # OUTPUT = file:///tmp/yukon.seom # The "Frames Per Second" of Yukon. This isn't a guarantee, but Yukon/Seom -# tries it's best to honor your request here. I recommend setting this to +# tries its best to honor your request here. I recommend setting this to # your vsync rate, and forcing your app to refresh accordingly. # FPS = 30.0