Permalink
Browse files

Release 0.1.0

  • Loading branch information...
iliya-gr committed Aug 17, 2012
2 parents 593b92a + e1a1d36 commit 768de8608206e0929b02bc4d8fff0407b5553024
Showing with 1,046 additions and 629 deletions.
  1. +1 −0 .gitignore
  2. +1 −1 Makefile.am
  3. +49 −2 Makefile.in
  4. +29 −0 README.md
  5. +3 −0 config.h.in
  6. +11 −11 configure
  7. +2 −2 configure.in
  8. +50 −0 log.c
  9. +36 −0 log.h
  10. +130 −613 mediasegmenter.c
  11. +575 −0 segmenter.c
  12. +85 −0 segmenter.h
  13. +43 −0 util.c
  14. +31 −0 util.h
View
@@ -9,3 +9,4 @@ autoscan.log
config.h
Makefile
stamp*
+mediasegmenter
View
@@ -1,4 +1,4 @@
bin_PROGRAMS = mediasegmenter
mediasegmenter_CFLAGS = $(AVFORMAT_CFLAGS) $(AVUTIL_CFLAGS) $(AVCODEC_CFLAGS)
mediasegmenter_LDADD = $(AVFORMAT_LIBS) $(AVUTIL_LIBS) $(AVCODEC_LIBS)
-mediasegmenter_SOURCES = mediasegmenter.c
+mediasegmenter_SOURCES = mediasegmenter.c segmenter.c log.c util.c
View
@@ -65,7 +65,9 @@ CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)"
PROGRAMS = $(bin_PROGRAMS)
-am_mediasegmenter_OBJECTS = mediasegmenter-mediasegmenter.$(OBJEXT)
+am_mediasegmenter_OBJECTS = mediasegmenter-mediasegmenter.$(OBJEXT) \
+ mediasegmenter-segmenter.$(OBJEXT) \
+ mediasegmenter-log.$(OBJEXT) mediasegmenter-util.$(OBJEXT)
mediasegmenter_OBJECTS = $(am_mediasegmenter_OBJECTS)
am__DEPENDENCIES_1 =
mediasegmenter_DEPENDENCIES = $(am__DEPENDENCIES_1) \
@@ -206,7 +208,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
mediasegmenter_CFLAGS = $(AVFORMAT_CFLAGS) $(AVUTIL_CFLAGS) $(AVCODEC_CFLAGS)
mediasegmenter_LDADD = $(AVFORMAT_LIBS) $(AVUTIL_LIBS) $(AVCODEC_LIBS)
-mediasegmenter_SOURCES = mediasegmenter.c
+mediasegmenter_SOURCES = mediasegmenter.c segmenter.c log.c util.c
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-am
@@ -311,7 +313,10 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mediasegmenter-log.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mediasegmenter-mediasegmenter.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mediasegmenter-segmenter.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mediasegmenter-util.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -341,6 +346,48 @@ mediasegmenter-mediasegmenter.obj: mediasegmenter.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mediasegmenter_CFLAGS) $(CFLAGS) -c -o mediasegmenter-mediasegmenter.obj `if test -f 'mediasegmenter.c'; then $(CYGPATH_W) 'mediasegmenter.c'; else $(CYGPATH_W) '$(srcdir)/mediasegmenter.c'; fi`
+mediasegmenter-segmenter.o: segmenter.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mediasegmenter_CFLAGS) $(CFLAGS) -MT mediasegmenter-segmenter.o -MD -MP -MF $(DEPDIR)/mediasegmenter-segmenter.Tpo -c -o mediasegmenter-segmenter.o `test -f 'segmenter.c' || echo '$(srcdir)/'`segmenter.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/mediasegmenter-segmenter.Tpo $(DEPDIR)/mediasegmenter-segmenter.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='segmenter.c' object='mediasegmenter-segmenter.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mediasegmenter_CFLAGS) $(CFLAGS) -c -o mediasegmenter-segmenter.o `test -f 'segmenter.c' || echo '$(srcdir)/'`segmenter.c
+
+mediasegmenter-segmenter.obj: segmenter.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mediasegmenter_CFLAGS) $(CFLAGS) -MT mediasegmenter-segmenter.obj -MD -MP -MF $(DEPDIR)/mediasegmenter-segmenter.Tpo -c -o mediasegmenter-segmenter.obj `if test -f 'segmenter.c'; then $(CYGPATH_W) 'segmenter.c'; else $(CYGPATH_W) '$(srcdir)/segmenter.c'; fi`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/mediasegmenter-segmenter.Tpo $(DEPDIR)/mediasegmenter-segmenter.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='segmenter.c' object='mediasegmenter-segmenter.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mediasegmenter_CFLAGS) $(CFLAGS) -c -o mediasegmenter-segmenter.obj `if test -f 'segmenter.c'; then $(CYGPATH_W) 'segmenter.c'; else $(CYGPATH_W) '$(srcdir)/segmenter.c'; fi`
+
+mediasegmenter-log.o: log.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mediasegmenter_CFLAGS) $(CFLAGS) -MT mediasegmenter-log.o -MD -MP -MF $(DEPDIR)/mediasegmenter-log.Tpo -c -o mediasegmenter-log.o `test -f 'log.c' || echo '$(srcdir)/'`log.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/mediasegmenter-log.Tpo $(DEPDIR)/mediasegmenter-log.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='log.c' object='mediasegmenter-log.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mediasegmenter_CFLAGS) $(CFLAGS) -c -o mediasegmenter-log.o `test -f 'log.c' || echo '$(srcdir)/'`log.c
+
+mediasegmenter-log.obj: log.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mediasegmenter_CFLAGS) $(CFLAGS) -MT mediasegmenter-log.obj -MD -MP -MF $(DEPDIR)/mediasegmenter-log.Tpo -c -o mediasegmenter-log.obj `if test -f 'log.c'; then $(CYGPATH_W) 'log.c'; else $(CYGPATH_W) '$(srcdir)/log.c'; fi`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/mediasegmenter-log.Tpo $(DEPDIR)/mediasegmenter-log.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='log.c' object='mediasegmenter-log.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mediasegmenter_CFLAGS) $(CFLAGS) -c -o mediasegmenter-log.obj `if test -f 'log.c'; then $(CYGPATH_W) 'log.c'; else $(CYGPATH_W) '$(srcdir)/log.c'; fi`
+
+mediasegmenter-util.o: util.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mediasegmenter_CFLAGS) $(CFLAGS) -MT mediasegmenter-util.o -MD -MP -MF $(DEPDIR)/mediasegmenter-util.Tpo -c -o mediasegmenter-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/mediasegmenter-util.Tpo $(DEPDIR)/mediasegmenter-util.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util.c' object='mediasegmenter-util.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mediasegmenter_CFLAGS) $(CFLAGS) -c -o mediasegmenter-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c
+
+mediasegmenter-util.obj: util.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mediasegmenter_CFLAGS) $(CFLAGS) -MT mediasegmenter-util.obj -MD -MP -MF $(DEPDIR)/mediasegmenter-util.Tpo -c -o mediasegmenter-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/mediasegmenter-util.Tpo $(DEPDIR)/mediasegmenter-util.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util.c' object='mediasegmenter-util.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mediasegmenter_CFLAGS) $(CFLAGS) -c -o mediasegmenter-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi`
+
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
View
@@ -0,0 +1,29 @@
+# Mediasegmenter
+
+An attempt to create replacement for mediafilesegmenter and mediastreamsegmenter for Linux operation system.
+
+## Usage
+
+### Video on demand
+
+To create VOD playlist with default parameters:
+
+```bash
+mediasegmenter -f /output_path source.mp4
+```
+
+### Live
+
+Create html page with video tag:
+
+```html
+<video src="path_to_video_directory/prog_index.m3u8" controls="controls" autoplay="autoplay"></video>
+```
+
+```bash
+mkfifo stream
+ffmpeg -re -y -i big_buck_bunny_1080p_h264.mov -c copy -bsf h264_mp4toannexb -f mpegts stream
+mediasegmenter -f /var/www/path_to_video_directory --live -w 5 --delete-files stream
+```
+
+
View
@@ -21,6 +21,9 @@
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
+/* Define to 1 if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
to 0 otherwise. */
#undef HAVE_MALLOC
View
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for mediasegmenter 0.0.1.
+# Generated by GNU Autoconf 2.69 for mediasegmenter 0.1.0.
#
# Report bugs to <iliya.gr@gmail.com>.
#
@@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='mediasegmenter'
PACKAGE_TARNAME='mediasegmenter'
-PACKAGE_VERSION='0.0.1'
-PACKAGE_STRING='mediasegmenter 0.0.1'
+PACKAGE_VERSION='0.1.0'
+PACKAGE_STRING='mediasegmenter 0.1.0'
PACKAGE_BUGREPORT='iliya.gr@gmail.com'
PACKAGE_URL='https://github.com/iliya-gr/mediasegmenter'
@@ -1280,7 +1280,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures mediasegmenter 0.0.1 to adapt to many kinds of systems.
+\`configure' configures mediasegmenter 0.1.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1346,7 +1346,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of mediasegmenter 0.0.1:";;
+ short | recursive ) echo "Configuration of mediasegmenter 0.1.0:";;
esac
cat <<\_ACEOF
@@ -1452,7 +1452,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-mediasegmenter configure 0.0.1
+mediasegmenter configure 0.1.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1951,7 +1951,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by mediasegmenter $as_me 0.0.1, which was
+It was created by mediasegmenter $as_me 0.1.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2778,7 +2778,7 @@ fi
# Define the identity of the package.
PACKAGE='mediasegmenter'
- VERSION='0.0.1'
+ VERSION='0.1.0'
cat >>confdefs.h <<_ACEOF
@@ -4540,7 +4540,7 @@ fi
done
-for ac_header in stdlib.h string.h getopt.h
+for ac_header in stdlib.h limits.h stdint.h string.h getopt.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -5443,7 +5443,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by mediasegmenter $as_me 0.0.1, which was
+This file was extended by mediasegmenter $as_me 0.1.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -5510,7 +5510,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-mediasegmenter config.status 0.0.1
+mediasegmenter config.status 0.1.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
View
@@ -1,5 +1,5 @@
AC_PREREQ([2.63])
-AC_INIT(mediasegmenter, 0.0.1, iliya.gr@gmail.com, mediasegmenter, https://github.com/iliya-gr/mediasegmenter)
+AC_INIT(mediasegmenter, 0.1.0, iliya.gr@gmail.com, mediasegmenter, https://github.com/iliya-gr/mediasegmenter)
AC_CONFIG_SRCDIR([mediasegmenter.c])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([1.11 foreign])
@@ -12,7 +12,7 @@ PKG_CHECK_MODULES([AVUTIL], [libavutil >= 51.54.100], [], [AC_MSG_ERROR([lib
PKG_CHECK_MODULES([AVCODEC], [libavcodec >= 54.23.100], [], [AC_MSG_ERROR([libavcodec version 54.23.100 or later required])])
# Checks for header files.
-AC_CHECK_HEADERS([stdlib.h string.h getopt.h])
+AC_CHECK_HEADERS([stdlib.h limits.h stdint.h string.h getopt.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_INT64_T
View
50 log.c
@@ -0,0 +1,50 @@
+// log.c
+// Copyright (C) 2012 Iliya Grushevskiy <iliya.gr@gmail.com>
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+#include "log.h"
+#include <stdio.h>
+
+static char* sg_log_app = NULL;
+static int sg_log_level = SG_LOG_INFO;
+
+void sg_vlog(int level, const char* fmt, va_list vl) {
+ if (level <= sg_log_level) {
+
+ if(sg_log_app) {
+ fprintf(stderr, "%s: ", sg_log_app);
+ }
+
+ vfprintf(stderr, fmt, vl);
+ fprintf(stderr, "\n");
+ }
+}
+
+void sg_log(int level, const char* fmt, ...) {
+ va_list vl;
+ va_start(vl, fmt);
+ sg_vlog(level, fmt, vl);
+ va_end(vl);
+}
+
+void sg_log_init(char* app) {
+ sg_log_app = app;
+ av_log_set_level(sg_log_level);
+}
+
+void sg_log_set_level(int level) {
+ sg_log_level = level;
+ av_log_set_level(level);
+}
View
36 log.h
@@ -0,0 +1,36 @@
+// log.h
+// Copyright (C) 2012 Iliya Grushevskiy <iliya.gr@gmail.com>
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+#include <libavutil/avutil.h>
+
+#ifndef __SG_LOG__
+#define __SG_LOG__
+
+#define SG_LOG_QUITE AV_LOG_QUITE
+#define SG_LOG_FATAL AV_LOG_FATAL
+#define SG_LOG_ERROR AV_LOG_ERROR
+#define SG_LOG_WARNING AV_LOG_WARNING
+#define SG_LOG_INFO AV_LOG_INFO
+#define SG_LOG_VERBOSE AV_LOG_VERBOSE
+#define SG_LOG_DEBUG AV_LOG_DEBUG
+
+void sg_log(int level, const char* fmt, ...);
+void sg_vlog(int level, const char* fmt, va_list vl);
+void sg_log_init(char*);
+void sg_log_set_level(int);
+
+
+#endif
Oops, something went wrong.

0 comments on commit 768de86

Please sign in to comment.