]> rtime.felk.cvut.cz Git - frescor/streamer.git/commitdiff
Omkize streamer
authorMartin Molnar <molnam1@fel.cvut.cz>
Tue, 28 Apr 2009 21:24:58 +0000 (23:24 +0200)
committerMartin <molnam1@fel.cvut.cz>
Tue, 28 Apr 2009 21:24:58 +0000 (23:24 +0200)
Makefile
Makefile.omk [new file with mode: 0644]
README.txt [new file with mode: 0644]
codec.c
input.c
output.c
streamer.c

index 57ae86b83fa6a79dcde42ec471c7845a782cc206..b22a35765d37ba44709f41e4182c62dbed0e43b7 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,39 +1,14 @@
-FFSRC ?= $(FFDIR)
-CPPFLAGS= -I $(FFSRC)
-CFLAGS = -Wall
-CFLAGS += -Wdeclaration-after-statement
-CFLAGS += -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls
-CFLAGS += -Wno-pointer-sign 
-LDFLAGS= -L $(FFDIR)/libavutil -L $(FFDIR)/libavcodec -L $(FFDIR)/libavformat -L $(FFDIR)/libavdevice
-LDLIBS = -lavdevice -lavformat -lavcodec -lavutil
+# Generic directory or leaf node makefile for OCERA make framework
 
-LDLIBS += -lm -lz
-CFLAGS += -g
-
-OBJS = input.o codec.o output.o
+ifndef MAKERULES_DIR
+MAKERULES_DIR := $(shell ( old_pwd="" ;  while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" = `pwd`  ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) )
+endif
 
-ifdef AQUOSA
-CPPFLAGS += -I$(AQUOSA)/include
-LDFLAGS += -L$(AQUOSA)/lib
-LDLIBS += -lqreslib -lqmgrlib -lrt
-OBJS += rt_qosmgr.o
+ifeq ($(MAKERULES_DIR),)
+all : default
+.DEFAULT::
+       @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n"
 else
-OBJS += rt.o
+include $(MAKERULES_DIR)/Makefile.rules
 endif
 
-
-all: streamer
-
-streamer: streamer.o $(OBJS)
-
-clean:
-       rm -f *.o streamer *.d
-
-###################################
-%.d: %.c
-       $(CC) $(CPPFLAGS) -MM -MF $@ $<
-
-%.o: %.d
-
--include $(OBJS:.o=.d)
-
diff --git a/Makefile.omk b/Makefile.omk
new file mode 100644 (file)
index 0000000..35be7ae
--- /dev/null
@@ -0,0 +1,26 @@
+#FFSRC ?= $(FFDIR)
+#CPPFLAGS= -I $(FFSRC)
+CFLAGS = -Wall
+CFLAGS += -Wdeclaration-after-statement
+CFLAGS += -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls
+CFLAGS += -Wno-pointer-sign 
+CFLAGS += -I /usr/include/ffmpeg
+#LDFLAGS= -L $(FFDIR)/libavutil -L $(FFDIR)/libavcodec -L $(FFDIR)/libavformat -L $(FFDIR)/libavdevice
+#LDLIBS = -lavdevice -lavformat -lavcodec -lavutil
+
+LDLIBS += -lm -lz
+#CFLAGS += -g
+
+ifdef AQUOSA
+CPPFLAGS += -I$(AQUOSA)/include
+LDFLAGS += -L$(AQUOSA)/lib
+LDLIBS += -lqreslib -lqmgrlib -lrt
+OBJS += rt_qosmgr.o
+else
+OBJS += rt.o
+endif
+
+bin_PROGRAMS=streamer
+streamer_SOURCES=streamer.c input.c codec.c output.c
+
+lib_LOADLIBES+= avformat avcodec avutil m z
diff --git a/README.txt b/README.txt
new file mode 100644 (file)
index 0000000..8bcae56
--- /dev/null
@@ -0,0 +1,29 @@
+The video encoder (see the instructions at the end of the email for building it)
+grabs video from a video4linux2 device, encodes it (currently, to mpeg4 video;
+the video encoder will allow to modify some settings in the future), and streams
+it over RTP.
+It can be started as
+    streamer [<options>]
+where the options allow to change the video capture device, the video size and
+frame rate, the destination address, etc...
+
+The SDP needed for receiving the video stream is saved in the "sdp.txt" file.
+
+
+HOW TO BUILD:
+The encoder and streamer is based on ffmpeg's libraries. So, first you have to download
+and compile ffmpeg
+    tar xvzf RTEncoder-v0.1.tgz
+    cd RTEncoder-v0.1 
+    svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
+    cd ffmpeg
+    ./configure; make
+OR 
+
+install deb packages libswscale-dev, libavformat-dev
+
+
+Compile the streamer
+    cd ..
+    make FFDIR=ffmpeg
+It should create a "streamer" executable. 
diff --git a/codec.c b/codec.c
index ed127207e0aeafd59d4ce072cab7b54da6f941d6..849656218dc9db31a632a3dd0267dd874f6c7994 100644 (file)
--- a/codec.c
+++ b/codec.c
@@ -3,9 +3,13 @@
  *
  *  This is free software; see GPL.txt
  */
-#include "libavformat/avformat.h"
+/*#include "libavformat/avformat.h"
 #include "libavcodec/avcodec.h"
-#include "libswscale/swscale.h"
+#include "libswscale/swscale.h"*/
+
+#include <avformat.h>
+#include <avcodec.h>
+#include <swscale.h>
 
 struct resample_data {
   struct SwsContext *resample_ctx;
diff --git a/input.c b/input.c
index c7baf91a3d658a0255ef92edfffa892c1baa3877..31983349ded44ef959f782b5ee51b94e5ec3a7d9 100644 (file)
--- a/input.c
+++ b/input.c
@@ -4,7 +4,7 @@
  *  This is free software; see GPL.txt
  */
 #include <string.h>
-#include "libavformat/avformat.h"
+#include <avformat.h>
 #include "input.h"
 
 static uint64_t time_convert(uint64_t time, AVStream *st)
index 738f654a57dfcb5577f9b114aed8d176b8ff7585..65e0897bbdc481e699a57a16ae403e0017d82575 100644 (file)
--- a/output.c
+++ b/output.c
@@ -3,7 +3,7 @@
  *
  *  This is free software; see GPL.txt
  */
-#include "libavformat/avformat.h"
+#include <avformat.h>
 
 
 AVFormatContext *open_output_stream(const char *dst, int port, enum CodecType codec_type)
index b8eeff3856b671b47a30e076537a50de9ecf8859..84a320f153353439261e4dd1c5285c318e7115b0 100644 (file)
@@ -6,8 +6,8 @@
 #include <unistd.h>
 #include <stdlib.h>
 
-#include "libavformat/avformat.h"
-#include "libavdevice/avdevice.h"
+#include <avformat.h>
+//#include <avdevice.h>
 
 #include "input.h"
 #include "output.h"