Giter VIP home page Giter VIP logo

http-live-video-stream-segmenter-and-distributor's Introduction

iPhone HTTP Streaming Server

For a detailed overview see the http live video segmenter page.

DESCRIPTION

This project is an attempt to make it easier to set up a live streaming server using Apple's HTTP streaming protocol.

The project includes a ruby script and a C program that use FFMpeg to encode and segment an input video stream in the correct format for use with the HTTP streaming protocol.

FEATURES

  • Creates both single and variable bitrate outputs
  • Transfer encoded segments via copy, FTP, SCP or transfer to AWS S3
  • Sending the INT signal to the segmenter process will cause it to terminate gracefully

REQUIREMENTS

FFMpeg is the primary external requirement for the ruby script. The segmenter needs libavformat to compile and that can be obtained by installing FFMpeg. The script also needs the following gems installed if you want to be able to use SCP or S3 as transfer options:

INSTALL

You will need to compile the segmenter first. Assuming that you have all the needed libraries installed this is as easy as doing a make in the root directory.

You may copy the script and the segmenter binary to any location you want. You will need to let the script know where to find the segmenter binary in the configuration file.

CONFIGURATION

A quick overview of the configuration options:

  • temp_dir Where the script will put segments before they are transfered to their final destination
  • segment_prefix The prefix added to each stream segment
  • index_prefix The prefix added to the index
  • log_type The logging type to use. Options are: STDOUT, FILE
  • log_file If using the FILE logging type where to put the log file
  • log_level The level of logging to output. Options are: DEBUG, INFO, WARN, ERROR
  • input_location Where the origin video is coming from. This can be a file, a pipe, a device or any other media that is consumable by FFMpeg or the given source consumer. See the source_command option as well.
  • segment_length The video segment length in seconds
  • url_prefix This is the URL where the stream (ts) files will end up
  • index_segment_count How many segments to keep in the index
  • source_command The command used to push video the encoders
  • segmenter_binary The location of the segmenter
  • encoding_profile Specifies what encoding profile to use. It can be either a single entry, 'ep_128k', or an array, [ 'ep_128k', 'ep_386k', 'ep_512k' ], for multi-bitrate outputs.
  • transfer_profile The transfer profile to use after each segment is produced

Encoding profiles are given a name and have two options following that name:

  • ffmpeg_command The command to use for this encoding profile
  • bandwidth The amount of bandwidth required to transfer this encoding

Transfer profiles are given a name in the same way encoding profiles are and have various options following their name.

For S3 based transfers:

  • transfer_type Must be set to 's3'
  • bucket_name The S3 bucket to put the segments in
  • key_prefix A prefix to attach to the start of each segment stream0001
  • aws_api_key The AWS api key for S3
  • aws_api_secret The AWS api secret for S3

For FTP based transfers:

  • transfer_type Must be set to 'ftp'
  • remote_host The remote host to ftp the segments to
  • user_name The user to use to log into the ftp site
  • password The password to use to log into the ftp site
  • directory The directory to change to before starting the ftp upload

For SCP based transfers:

  • transfer_type Must be set to 'scp'
  • remote_host The host to scp to
  • user_name The user to use in the scp
  • password The password to use for scp. This is optional, if it isn't provided the scp will be done using a previously generated private key.
  • directory The directory to change to before uploading the segment

For copy based transfers:

  • transfer_type Must be set to 'copy'
  • directory The destination directory to copy the segment to

For Cloudfile based transfers:

  • transfer_type Must be set to 'cf'
  • username The username for Cloudfile
  • api_key The api key for Cloudfile
  • container The container to put the results in
  • key_prefix A prefix to attach to the start of each segment stream0001

LICENSE

Copyright (c) 2009-2013 Carson McDonald

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.

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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

http-live-video-stream-segmenter-and-distributor's People

Contributors

beanieboi avatar carsonmcdonald avatar danrossi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

http-live-video-stream-segmenter-and-distributor's Issues

Error port install lfaad2

Hi *,

I'm trying to install on Snow Leopard, but
when I run "sudo port install ffmpeg-devel libconfig libsdl lfaad2" i received the following error:

Error: Port lfaad2 not found

Can you help me?

Mac OS X Build

preface: You've mentioned you haven't tested on Mac OS X, so this is more of a request for help than an issue!

I'm attempting to build the live_segmenter on Mac OS X (specifically Snow Leopard) and I'm running into problems, maybe someone with more technical knowledge can help!

This is my current flow:

  1. git clone git://github.com/carsonmcdonald/HTTP-Live-Video-Stream-Segmenter-and-Distributor.git
  2. make (in root directory)
    plenty of errors ( http://pastebin.com/fec11bae ) caused by lack of libraries
  3. Use macports to install ffmpeg-devel, libconfig (a hack is required to install libsdl - http://trac.macports.org/attachment/ticket/20235/libsdl.patch)
  4. Alter the makefile to make sure gcc can find the macports libraries:
    [line 2] gcc -Wall -I/opt/local/include -L/opt/local/lib -g live_segmenter.c ... etc (same as before)
    build is sucessful
  5. ./live_segmenter
    dyld: Library not loaded: libopennet.dylib
    Referenced from: /opt/local/lib/libconfig.0.2.3.dylib
    Reason: image not found
    Trace/BPT trap
  6. ls -l /opt/local/lib/libopennet.dylib
    lrwxr-xr-x 1 root admin 22 30 Aug 13:39 /opt/local/lib/libopennet.dylib -> libopennet.0.9.9.dylib
    the library exists! All I can assume is that the non-standard location of the dynamic libraries (in /opt/local rather than /usr/) means the file, though it exists, isn't being found.

Any help would be greatly appreciated!

Automatic clean up?

I'm using the config-simple.yml and have only changed the input to be udp:// and the index_segment_count to be 5. I can see that it does not clean up the old segments. is that how it should work? Shouldn't it remove old segments?

Silent failure

Hi there,

I'm using the following command

./live_segmenter 10
/var/www/ samp ./example-configs/config-simple.yml

nothing happens and the app is totally silent.

unlikely bug if output_index goes over 99999

Hello, my C skills are rather out of date, but I guess that in the (rather unlikely) event that a stream continues for a few days, your code will try to output filenames like:

foo/foo-100000.t

Inserting a

output_index = output_index % 100000;

just before

} while (!decode_done);

should make it wrap, shouldn't it? but then I'm not sure if something else expects the filenames to be increasing, C is always unfriendly to me, it always does the unexpected!

Regards,
Luca de Marinis

bitrate higher than the target bitrate and peak is much higher

I have tried messing a ton with the command in the config file to try and find a good set of ffmpeg commands that gives a fairly constant bitrate and doesn't go too much over in the peak. Apple has a utility called mediastreamvalidator that suggests it is an error to have the bitrate be more than 10% over the reported rate. I am consistently getting 30%-70% over the average bitrate specified by the audiorate+videorate given in the ffmpeg command and the peak is often 80-130% over.

Any suggestions?

Compiling Segmenter on linux m/c

Hi,

I have ffmpeg 0.9.1 version install on my red hat m/c.
But I am getting so many errors for comilation
could u plz let me know wat went wrong ????

Please actaully even m not able to get error

Error

segmenter-cardson.c:1: warning: return type defaults to âintâ
segmenter-cardson.c: In function âopyrightâ:
segmenter-cardson.c:1: error: expected declaration specifiers before numeric constant
segmenter-cardson.c:3: error: expected declaration specifiers before âyouâ
segmenter-cardson.c:8: error: expected declaration specifiers before âwithoutâ
segmenter-cardson.c:13: error: expected declaration specifiers before âifâ
In file included from /usr/include/stdio.h:36,
from segmenter-cardson.c:19:
/usr/include/bits/types.h:34: error: storage class specified for parameter â__u_charâ
/usr/include/bits/types.h:35: error: storage class specified for parameter â__u_shortâ
/usr/include/bits/types.h:36: error: storage class specified for parameter â__u_intâ
/usr/include/bits/types.h:37: error: storage class specified for parameter â__u_longâ
/usr/include/bits/types.h:40: error: storage class specified for parameter â__int8_tâ
/usr/include/bits/types.h:41: error: storage class specified for parameter â__uint8_tâ
/usr/include/bits/types.h:42: error: storage class specified for parameter â__int16_tâ
/usr/include/bits/types.h:43: error: storage class specified for parameter â__uint16_tâ
/usr/include/bits/types.h:44: error: storage class specified for parameter â__int32_tâ
/usr/include/bits/types.h:45: error: storage class specified for parameter â__uint32_tâ
/usr/include/bits/types.h:47: error: storage class specified for parameter â__int64_tâ
/usr/include/bits/types.h:48: error: storage class specified for parameter â__uint64_tâ
/usr/include/bits/types.h:56: error: storage class specified for parameter â__quad_tâ
/usr/include/bits/types.h:57: error: storage class specified for parameter â__u_quad_tâ
In file included from /usr/include/stdio.h:36,
from segmenter-cardson.c:19:
/usr/include/bits/types.h:137: error: storage class specified for parameter â__dev_tâ
/usr/include/bits/types.h:138: error: storage class specified for parameter â__uid_tâ
/usr/include/bits/types.h:139: error: storage class specified for parameter â__gid_tâ
/usr/include/bits/types.h:140: error: storage class specified for parameter â__ino_tâ
/usr/include/bits/types.h:141: error: storage class specified for parameter â__ino64_tâ
/usr/include/bits/types.h:142: error: storage class specified for parameter â__mode_tâ
/usr/include/bits/types.h:143: error: storage class specified for parameter â__nlink_tâ
/usr/include/bits/types.h:144: error: storage class specified for parameter â__off_tâ
/usr/include/bits/types.h:145: error: storage class specified for parameter â__off64_tâ
/usr/include/bits/types.h:146: error: storage class specified for parameter â__pid_tâ
/usr/include/bits/types.h:147: error: storage class specified for parameter â__fsid_tâ
/usr/include/bits/types.h:148: error: storage class specified for parameter â__clock_tâ
/usr/include/bits/types.h:149: error: storage class specified for parameter â__rlim_tâ
/usr/include/bits/types.h:150: error: storage class specified for parameter â__rlim64_tâ
/usr/include/bits/types.h:151: error: storage class specified for parameter â__id_tâ
/usr/include/bits/types.h:152: error: storage class specified for parameter â__time_tâ
/usr/include/bits/types.h:153: error: storage class specified for parameter â__useconds_tâ
/usr/include/bits/types.h:154: error: storage class specified for parameter â__suseconds_tâ
/usr/include/bits/types.h:156: error: storage class specified for parameter â__daddr_tâ
/usr/include/bits/types.h:157: error: storage class specified for parameter â__swblk_tâ
/usr/include/bits/types.h:158: error: storage class specified for parameter â__key_tâ
/usr/include/bits/types.h:161: error: storage class specified for parameter â__clockid_tâ
In file included from segmenter-cardson.c:19:
/usr/include/stdio.h:46: error: storage class specified for parameter âFILEâ
/usr/include/stdio.h:62: error: storage class specified for parameter â__FILEâ
In file included from /usr/include/_G_config.h:14,
from /usr/include/libio.h:32,
from /usr/include/stdio.h:72,
from segmenter-cardson.c:19:
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h:326: error: storage class specified for parameter âwchar_tâ
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h:355: error: storage class specified for parameter âwint_tâ
In file included from /usr/include/_G_config.h:24,
from /usr/include/libio.h:32,
from /usr/include/stdio.h:72,
from segmenter-cardson.c:19:
/usr/include/wchar.h:81: error: expected specifier-qualifier-list before âwint_tâ
/usr/include/wchar.h:84: error: storage class specified for parameter â__mbstate_tâ
In file included from /usr/include/libio.h:32,
from /usr/include/stdio.h:72,
from segmenter-cardson.c:19:
/usr/include/_G_config.h:28: error: expected specifier-qualifier-list before â__off_tâ
/usr/include/_G_config.h:30: error: storage class specified for parameter â_G_fpos_tâ
/usr/include/_G_config.h:33: error: expected specifier-qualifier-list before â__off64_tâ
/usr/include/_G_config.h:35: error: storage class specified for parameter â_G_fpos64_tâ
In file included from /usr/include/_G_config.h:44,
from /usr/include/libio.h:32,
from /usr/include/stdio.h:72,
from segmenter-cardson.c:19:
/usr/include/gconv.h:72: error: expected declaration specifiers or â...â before âsize_tâ
/usr/include/gconv.h:72: error: storage class specified for parameter â__gconv_fctâ
/usr/include/gconv.h:75: error: expected declaration specifiers or â...â before â*â token
/usr/include/gconv.h:75: error: storage class specified for parameter âwint_tâ
/usr/include/gconv.h:75: error: âwint_tâ declared as function returning a function
/usr/include/gconv.h:75: error: conflicting types for âwint_tâ
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h:355: error: previous definition of âwint_tâ was here
/usr/include/gconv.h:78: error: storage class specified for parameter â__gconv_init_fctâ
/usr/include/gconv.h:79: error: storage class specified for parameter â__gconv_end_fctâ
/usr/include/gconv.h:88: error: expected declaration specifiers or â...â before âsize_tâ

..
.
..

In file included from /usr/include/stdio.h:72,
from segmenter-cardson.c:19:
/usr/include/libio.h:177: error: storage class specified for parameter â_IO_lock_tâ
/usr/include/libio.h:297: error: expected specifier-qualifier-list before â__off_tâ
/usr/include/libio.h:338: error: storage class specified for parameter â_IO_FILEâ
/usr/include/libio.h:343: error: storage class specified for parameter â_IO_2_1_stdin_â
/usr/include/libio.h:344: error: storage class specified for parameter â_IO_2_1_stdout_â
/usr/include/libio.h:345: error: storage class specified for parameter â_IO_2_1_stderr_â
/usr/include/libio.h:361: error: expected â=â, â,â, â;â, âasmâ or âattributeâ before âio_read_fnâ
/usr/include/libio.h:369: error: expected â=â, â,â, â;â, âasmâ or â__attribute
â before âio_write_fnâ
/usr/include/libio.h:378: error: expected declaration specifiers or â...â before â__off64_tâ
/usr/include/libio.h:378: error: storage class specified for parameter â__io_seek_fnâ
/usr/include/libio.h:381: error: storage class specified for parameter â__io_close_fnâ
/usr/include/libio.h:413: error: expected â)â before â_â token
/usr/include/libio.h:414: error: expected â)â before â_â token
/usr/include/libio.h:415: error: expected â)â before â*â token
/usr/include/libio.h:416: error: expected â=â, â,â, â;â, âasmâ or â__attribute
â before âwunderflowâ
/usr/include/libio.h:417: error: expected â=â, â,â, â;â, âasmâ or â__attribute
â before âwuflowâ
/usr/include/libio.h:418: error: expected â=â, â,â, â;â, âasmâ or â__attribute
â before â__woverflowâ
/usr/include/libio.h:451: error: expected â)â before â_â token
/usr/include/libio.h:452: error: expected declaration specifiers or â...â before â_IO_FILEâ
/usr/include/libio.h:452: error: storage class specified for parameter â_IO_putcâ
/usr/include/libio.h:453: error: expected â)â before â_â token
/usr/include/_G_config.h:58: error: declaration for parameter â_G_uint32_tâ but no such parameter
/usr/include/_G_config.h:57: error: declaration for parameter â_G_uint16_tâ but no such parameter
/usr/include/_G_config.h:56: error: declaration for parameter â_G_int32_tâ but no such parameter
/usr/include/_G_config.h:55: error: declaration for parameter â_G_int16_tâ but no such parameter
/usr/include/_G_config.h:53: error: declaration for parameter â_G_iconv_tâ but no such parameter

......
.
.
.
.
.
.
/usr/include/bits/types.h:35: error: declaration for parameter â__u_shortâ but no such parameter
/usr/include/bits/types.h:34: error: declaration for parameter â__u_charâ but no such parameter

live_segmenter.c: In function add_output_stream

Hello Guys,

I am doing these tests on a vanila Linux ubuntu 3.0.0-12-generic #20-Ubuntu
Trying to follow the instructions I get to an issue with the compilcation of the segmenter itlself.
When I try to compile with the following command:
gcc -v -Wall -g live_segmenter.c -o live_segmenter -lavformat -lavcodec -lavutil -lvorbis -ltheora -lbz2 -lm -lz -lfaac -lmp3lame -I /tmp/old_ffmpeg/include -L /tmp/old_ffmpeg/lib

I get the following output:

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6.1/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.1-9ubuntu3' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)
COLLECT_GCC_OPTIONS='-v' '-Wall' '-g' '-o' 'live_segmenter' '-I' '/tmp/old_ffmpeg/include' '-L/tmp/old_ffmpeg/lib' '-mtune=generic' '-march=x86-64'
/usr/lib/gcc/x86_64-linux-gnu/4.6.1/cc1 -quiet -v -I /tmp/old_ffmpeg/include -imultilib . -imultiarch x86_64-linux-gnu live_segmenter.c -quiet -dumpbase live_segmenter.c -mtune=generic -march=x86-64 -auxbase live_segmenter -g -Wall -version -fstack-protector -o /tmp/ccDfYQPn.s
GNU C (Ubuntu/Linaro 4.6.1-9ubuntu3) version 4.6.1 (x86_64-linux-gnu)
compiled by GNU C version 4.6.1, GMP version 5.0.1, MPFR version 3.0.1-p3, MPC version 0.9
GGC heuristics: --param ggc-min-expand=98 --param ggc-min-heapsize=127390
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../../x86_64-linux-gnu/include"

include "..." search starts here:

include <...> search starts here:

/tmp/old_ffmpeg/include
/usr/lib/gcc/x86_64-linux-gnu/4.6.1/include
/usr/local/include
/usr/lib/gcc/x86_64-linux-gnu/4.6.1/include-fixed
/usr/include/x86_64-linux-gnu
/usr/include
End of search list.
GNU C (Ubuntu/Linaro 4.6.1-9ubuntu3) version 4.6.1 (x86_64-linux-gnu)
compiled by GNU C version 4.6.1, GMP version 5.0.1, MPFR version 3.0.1-p3, MPC version 0.9
GGC heuristics: --param ggc-min-expand=98 --param ggc-min-heapsize=127390
Compiler executable checksum: 5dede901e38d49932d3155c3e888bca1
live_segmenter.c: In function �add_output_stream�:
live_segmenter.c:70:10: error: �AVMEDIA_TYPE_AUDIO� undeclared (first use in this function)
live_segmenter.c:70:10: note: each undeclared identifier is reported only once for each function it appears in
live_segmenter.c:84:10: error: �AVMEDIA_TYPE_VIDEO� undeclared (first use in this function)
live_segmenter.c: In function �main�:
live_segmenter.c:162:3: warning: implicit declaration of function �av_guess_format� [-Wimplicit-function-declaration]
live_segmenter.c:162:35: warning: initialization makes pointer from integer without a cast [enabled by default]
live_segmenter.c:188:12: error: �AVMEDIA_TYPE_VIDEO� undeclared (first use in this function)
live_segmenter.c:193:12: error: �AVMEDIA_TYPE_AUDIO� undeclared (first use in this function)
live_segmenter.c:210:3: warning: implicit declaration of function �av_dump_format� [-Wimplicit-function-declaration]
live_segmenter.c:228:3: warning: implicit declaration of function �avio_open� [-Wimplicit-function-declaration]
live_segmenter.c:279:7: warning: implicit declaration of function �avio_flush� [-Wimplicit-function-declaration]
live_segmenter.c:280:7: warning: implicit declaration of function �avio_close� [-Wimplicit-function-declaration]

This got me thinking of some time of the installed libraries and included modules and I think I have done all the homework.
Then I tried to compile this other segmenter from source just for the test:
http://code.google.com/p/httpsegmenter/

and I am getting the following similar error:

spas@ubuntu:~/httpsegmenter-read-only$ gcc -Wall -g segmenter.c -o segmenter -lavformat -lavcodec -lavutil -I /tmp/old_ffmpeg/include/ -L /tmp/old_ffmpeg/lib/
segmenter.c: In function �add_output_stream�:
segmenter.c:90:5: warning: implicit declaration of function �avformat_new_stream� [-Wimplicit-function-declaration]
segmenter.c:90:19: warning: assignment makes pointer from integer without a cast [enabled by default]
segmenter.c:116:14: error: �AVMEDIA_TYPE_AUDIO� undeclared (first use in this function)
segmenter.c:116:14: note: each undeclared identifier is reported only once for each function it appears in
segmenter.c:128:14: error: �AVMEDIA_TYPE_VIDEO� undeclared (first use in this function)
segmenter.c: In function �updateLivePlaylist�:
segmenter.c:259:9: error: �for� loop initial declarations are only allowed in C99 mode
segmenter.c:259:9: note: use option -std=c99 or -std=gnu99 to compile your code
segmenter.c: In function �releasePlaylist�:
segmenter.c:368:5: error: �for� loop initial declarations are only allowed in C99 mode
segmenter.c: In function �createStreamLace�:
segmenter.c:479:5: error: �for� loop initial declarations are only allowed in C99 mode
segmenter.c: In function �chooseNextStream�:
segmenter.c:502:5: error: �for� loop initial declarations are only allowed in C99 mode
segmenter.c: In function �countPackets�:
segmenter.c:531:5: error: �for� loop initial declarations are only allowed in C99 mode
segmenter.c: In function �removeAllPackets�:
segmenter.c:544:5: error: �for� loop initial declarations are only allowed in C99 mode
segmenter.c: In function �main_utf8�:
segmenter.c:634:14: error: redefinition of �i�
segmenter.c:626:9: note: previous definition of �i� was here
segmenter.c:634:5: error: �for� loop initial declarations are only allowed in C99 mode
segmenter.c:742:5: warning: implicit declaration of function �avformat_open_input� [-Wimplicit-function-declaration]
segmenter.c:748:5: warning: implicit declaration of function �avformat_find_stream_info� [-Wimplicit-function-declaration]
segmenter.c:777:18: error: �AVMEDIA_TYPE_VIDEO� undeclared (first use in this function)
segmenter.c:782:18: error: �AVMEDIA_TYPE_AUDIO� undeclared (first use in this function)
segmenter.c:793:5: warning: implicit declaration of function �av_dump_format� [-Wimplicit-function-declaration]
segmenter.c:801:7: warning: implicit declaration of function �avcodec_open2� [-Wimplicit-function-declaration]
segmenter.c:807:5: warning: implicit declaration of function �avio_open� [-Wimplicit-function-declaration]
segmenter.c:807:45: error: �AVIO_FLAG_WRITE� undeclared (first use in this function)
segmenter.c:812:5: warning: implicit declaration of function �avformat_write_header� [-Wimplicit-function-declaration]
segmenter.c:910:13: warning: implicit declaration of function �avio_flush� [-Wimplicit-function-declaration]
segmenter.c:911:13: warning: implicit declaration of function �avio_close� [-Wimplicit-function-declaration]
segmenter.c:618:15: warning: variable �audio_st� set but not used [-Wunused-but-set-variable]

What am I missing here? Something with the FFMPEG?

Thank you in advance!

how the heck are mp3s segmented?

I have compiled the segmenter noted here: http://www.ioncannon.net/projects/http-live-video-stream-segmenter-and-distributor/ (and all of the dependancies)

using this command to segment:

$ ./segmenter -i input.mp3 -d temp/ -f prefix -o test.m3u8 -l 10 -a

But the output is:

Format mp3 probed with size-2048
File position before avformat_find_stream_info() is 208
max_analyze_duraiton 5000000 reached at 5015510
File position after avformat_find_stream_info() is 41168
Source Stream must have video component

error: ‘CODEC_TYPE_AUDIO’ undeclared

When I run make:

gcc -Wall -g live_segmenter.c -o live_segmenter -lavformat -lavcodec -lavutil -lbz2 -lm -lz -lfaac -lmp3lame -lx264 -lfaad -lpthread
live_segmenter.c: In function ‘add_output_stream’:
live_segmenter.c:70:10: error: ‘CODEC_TYPE_AUDIO’ undeclared (first use in this function)
live_segmenter.c:70:10: note: each undeclared identifier is reported only once for each function it appears in
live_segmenter.c:84:10: error: ‘CODEC_TYPE_VIDEO’ undeclared (first use in this function)
live_segmenter.c: In function ‘main’:
live_segmenter.c:149:3: warning: ‘av_open_input_file’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:1090) [-Wdeprecated-declarations]
live_segmenter.c:165:3: warning: implicit declaration of function ‘guess_format’ [-Wimplicit-function-declaration]
live_segmenter.c:165:35: warning: initialization makes pointer from integer without a cast [enabled by default]
live_segmenter.c:192:12: error: ‘CODEC_TYPE_VIDEO’ undeclared (first use in this function)
live_segmenter.c:197:12: error: ‘CODEC_TYPE_AUDIO’ undeclared (first use in this function)
live_segmenter.c:208:3: warning: ‘av_set_parameters’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:1434) [-Wdeprecated-declarations]
live_segmenter.c:214:3: warning: ‘dump_format’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:1559) [-Wdeprecated-declarations]
live_segmenter.c:232:3: warning: ‘url_fopen’ is deprecated (declared at /usr/local/include/libavformat/avio.h:279) [-Wdeprecated-declarations]
live_segmenter.c:238:3: warning: ‘av_write_header’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:1492) [-Wdeprecated-declarations]
live_segmenter.c:267:63: error: ‘PKT_FLAG_KEY’ undeclared (first use in this function)
live_segmenter.c:283:7: warning: ‘put_flush_packet’ is deprecated (declared at /usr/local/include/libavformat/avio.h:293) [-Wdeprecated-declarations]
live_segmenter.c:284:7: warning: ‘url_fclose’ is deprecated (declared at /usr/local/include/libavformat/avio.h:280) [-Wdeprecated-declarations]
live_segmenter.c:289:7: warning: ‘url_fopen’ is deprecated (declared at /usr/local/include/libavformat/avio.h:279) [-Wdeprecated-declarations]
live_segmenter.c:326:3: warning: ‘url_fclose’ is deprecated (declared at /usr/local/include/libavformat/avio.h:280) [-Wdeprecated-declarations]
make: *** [all] Error 1

segmenter does not compile under latest ffmpeg

I use current FFMPEG on my system (current today = git-29036)

Ive tried to compile the segmenter and it fails. Ive seen this behaviour with many versions of ffmpeg and was wondering if you could provide some pointers to getting it working?

Thanks in advance!

HTTP-Live-Video-Stream-Segmenter-and-Distributor$ make
gcc -Wall -g live_segmenter.c -o live_segmenter -lavformat -lavcodec -lavutil -lbz2 -lm -lz -lfaac -lmp3lame -lx264 -lfaad -lpthread
live_segmenter.c: In function ‘main’:
live_segmenter.c:214:3: warning: ‘dump_format’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:1484)
live_segmenter.c:232:3: warning: ‘url_fopen’ is deprecated (declared at /usr/local/include/libavformat/avio.h:280)
live_segmenter.c:283:7: warning: ‘put_flush_packet’ is deprecated (declared at /usr/local/include/libavformat/avio.h:294)
live_segmenter.c:284:7: warning: ‘url_fclose’ is deprecated (declared at /usr/local/include/libavformat/avio.h:281)
live_segmenter.c:289:7: warning: ‘url_fopen’ is deprecated (declared at /usr/local/include/libavformat/avio.h:280)
live_segmenter.c:326:3: warning: ‘url_fclose’ is deprecated (declared at /usr/local/include/libavformat/avio.h:281)
/usr/local/lib/libavcodec.a(libopencore-amr.o): In function amr_wb_decode_frame': /home/simonn/ffmpeg/ffmpeg/libavcodec/libopencore-amr.c:300: undefined reference toD_IF_decode'
/usr/local/lib/libavcodec.a(libopencore-amr.o): In function amr_wb_decode_close': /home/simonn/ffmpeg/ffmpeg/libavcodec/libopencore-amr.c:309: undefined reference toD_IF_exit'
/usr/local/lib/libavcodec.a(libopencore-amr.o): In function amr_nb_decode_frame': /home/simonn/ffmpeg/ffmpeg/libavcodec/libopencore-amr.c:136: undefined reference toDecoder_Interface_Decode'
/usr/local/lib/libavcodec.a(libopencore-amr.o): In function amr_nb_encode_frame': /home/simonn/ffmpeg/ffmpeg/libavcodec/libopencore-amr.c:208: undefined reference toEncoder_Interface_Encode'
/usr/local/lib/libavcodec.a(libopencore-amr.o): In function amr_wb_decode_init': /home/simonn/ffmpeg/ffmpeg/libavcodec/libopencore-amr.c:263: undefined reference toD_IF_init'
/usr/local/lib/libavcodec.a(libopencore-amr.o): In function amr_nb_encode_close': /home/simonn/ffmpeg/ffmpeg/libavcodec/libopencore-amr.c:191: undefined reference toEncoder_Interface_exit'
/usr/local/lib/libavcodec.a(libopencore-amr.o): In function amr_nb_encode_init': /home/simonn/ffmpeg/ffmpeg/libavcodec/libopencore-amr.c:173: undefined reference toEncoder_Interface_init'
/usr/local/lib/libavcodec.a(libopencore-amr.o): In function amr_nb_decode_close': /home/simonn/ffmpeg/ffmpeg/libavcodec/libopencore-amr.c:105: undefined reference toDecoder_Interface_exit'
/usr/local/lib/libavcodec.a(libopencore-amr.o): In function amr_nb_decode_init': /home/simonn/ffmpeg/ffmpeg/libavcodec/libopencore-amr.c:85: undefined reference toDecoder_Interface_init'
/usr/local/lib/libavcodec.a(libtheoraenc.o): In function submit_stats': /home/simonn/ffmpeg/ffmpeg/libavcodec/libtheoraenc.c:134: undefined reference toth_encode_ctl'
/usr/local/lib/libavcodec.a(libtheoraenc.o): In function get_stats': /home/simonn/ffmpeg/ffmpeg/libavcodec/libtheoraenc.c:93: undefined reference toth_encode_ctl'
/usr/local/lib/libavcodec.a(libtheoraenc.o): In function encode_frame': /home/simonn/ffmpeg/ffmpeg/libavcodec/libtheoraenc.c:294: undefined reference toth_encode_ycbcr_in'
/home/simonn/ffmpeg/ffmpeg/libavcodec/libtheoraenc.c:317: undefined reference to th_encode_packetout' /home/simonn/ffmpeg/ffmpeg/libavcodec/libtheoraenc.c:274: undefined reference toth_encode_packetout'
/usr/local/lib/libavcodec.a(libtheoraenc.o): In function encode_close': /home/simonn/ffmpeg/ffmpeg/libavcodec/libtheoraenc.c:349: undefined reference toth_encode_free'
/usr/local/lib/libavcodec.a(libtheoraenc.o): In function encode_init': /home/simonn/ffmpeg/ffmpeg/libavcodec/libtheoraenc.c:162: undefined reference toth_info_init'
/home/simonn/ffmpeg/ffmpeg/libavcodec/libtheoraenc.c:214: undefined reference to th_encode_alloc' /home/simonn/ffmpeg/ffmpeg/libavcodec/libtheoraenc.c:222: undefined reference toth_info_clear'
/home/simonn/ffmpeg/ffmpeg/libavcodec/libtheoraenc.c:224: undefined reference to th_encode_ctl' /home/simonn/ffmpeg/ffmpeg/libavcodec/libtheoraenc.c:249: undefined reference toth_comment_init'
/home/simonn/ffmpeg/ffmpeg/libavcodec/libtheoraenc.c:251: undefined reference to th_encode_flushheader' /home/simonn/ffmpeg/ffmpeg/libavcodec/libtheoraenc.c:255: undefined reference toth_comment_clear'
/usr/local/lib/libavcodec.a(libvorbis.o): In function oggvorbis_encode_frame': /home/simonn/ffmpeg/ffmpeg/libavcodec/libvorbis.c:170: undefined reference tovorbis_analysis_buffer'
/home/simonn/ffmpeg/ffmpeg/libavcodec/libvorbis.c:177: undefined reference to vorbis_analysis_wrote' /home/simonn/ffmpeg/ffmpeg/libavcodec/libvorbis.c:184: undefined reference tovorbis_analysis_blockout'
/home/simonn/ffmpeg/ffmpeg/libavcodec/libvorbis.c:185: undefined reference to vorbis_analysis' /home/simonn/ffmpeg/ffmpeg/libavcodec/libvorbis.c:186: undefined reference tovorbis_bitrate_addblock'
/home/simonn/ffmpeg/ffmpeg/libavcodec/libvorbis.c:188: undefined reference to vorbis_bitrate_flushpacket' /home/simonn/ffmpeg/ffmpeg/libavcodec/libvorbis.c:180: undefined reference tovorbis_analysis_wrote'
/usr/local/lib/libavcodec.a(libvorbis.o): In function oggvorbis_encode_close': /home/simonn/ffmpeg/ffmpeg/libavcodec/libvorbis.c:233: undefined reference tovorbis_analysis_wrote'
/home/simonn/ffmpeg/ffmpeg/libavcodec/libvorbis.c:235: undefined reference to vorbis_block_clear' /home/simonn/ffmpeg/ffmpeg/libavcodec/libvorbis.c:236: undefined reference tovorbis_dsp_clear'
/home/simonn/ffmpeg/ffmpeg/libavcodec/libvorbis.c:237: undefined reference to vorbis_info_clear' /usr/local/lib/libavcodec.a(libvorbis.o): In functionoggvorbis_encode_init':
/home/simonn/ffmpeg/ffmpeg/libavcodec/libvorbis.c:111: undefined reference to vorbis_info_init' /usr/local/lib/libavcodec.a(libvorbis.o): In functionoggvorbis_init_encoder':
/home/simonn/ffmpeg/ffmpeg/libavcodec/libvorbis.c:69: undefined reference to vorbis_encode_setup_vbr' /home/simonn/ffmpeg/ffmpeg/libavcodec/libvorbis.c:78: undefined reference tovorbis_encode_setup_managed'
/home/simonn/ffmpeg/ffmpeg/libavcodec/libvorbis.c:84: undefined reference to vorbis_encode_ctl' /home/simonn/ffmpeg/ffmpeg/libavcodec/libvorbis.c:91: undefined reference tovorbis_encode_ctl'
/home/simonn/ffmpeg/ffmpeg/libavcodec/libvorbis.c:96: undefined reference to vorbis_encode_ctl' /home/simonn/ffmpeg/ffmpeg/libavcodec/libvorbis.c:99: undefined reference tovorbis_encode_setup_init'
/usr/local/lib/libavcodec.a(libvorbis.o): In function oggvorbis_encode_init': /home/simonn/ffmpeg/ffmpeg/libavcodec/libvorbis.c:116: undefined reference tovorbis_analysis_init'
/home/simonn/ffmpeg/ffmpeg/libavcodec/libvorbis.c:117: undefined reference to vorbis_block_init' /home/simonn/ffmpeg/ffmpeg/libavcodec/libvorbis.c:119: undefined reference tovorbis_comment_init'
/home/simonn/ffmpeg/ffmpeg/libavcodec/libvorbis.c:120: undefined reference to vorbis_comment_add_tag' /home/simonn/ffmpeg/ffmpeg/libavcodec/libvorbis.c:122: undefined reference tovorbis_analysis_headerout'
/home/simonn/ffmpeg/ffmpeg/libavcodec/libvorbis.c:145: undefined reference to vorbis_comment_clear' /usr/local/lib/libavcodec.a(libvpxdec.o): In functionvp8_decode':
/home/simonn/ffmpeg/ffmpeg/libavcodec/libvpxdec.c:68: undefined reference to vpx_codec_decode' /home/simonn/ffmpeg/ffmpeg/libavcodec/libvpxdec.c:80: undefined reference tovpx_codec_get_frame'
/home/simonn/ffmpeg/ffmpeg/libavcodec/libvpxdec.c:70: undefined reference to vpx_codec_error' /home/simonn/ffmpeg/ffmpeg/libavcodec/libvpxdec.c:71: undefined reference tovpx_codec_error_detail'
/usr/local/lib/libavcodec.a(libvpxdec.o): In function vp8_free': /home/simonn/ffmpeg/ffmpeg/libavcodec/libvpxdec.c:110: undefined reference tovpx_codec_destroy'
/usr/local/lib/libavcodec.a(libvpxdec.o): In function vp8_init': /home/simonn/ffmpeg/ffmpeg/libavcodec/libvpxdec.c:46: undefined reference tovpx_codec_version_str'
/home/simonn/ffmpeg/ffmpeg/libavcodec/libvpxdec.c:47: undefined reference to vpx_codec_build_config' /home/simonn/ffmpeg/ffmpeg/libavcodec/libvpxdec.c:49: undefined reference tovpx_codec_vp8_dx_algo'
/home/simonn/ffmpeg/ffmpeg/libavcodec/libvpxdec.c:49: undefined reference to vpx_codec_dec_init_ver' /home/simonn/ffmpeg/ffmpeg/libavcodec/libvpxdec.c:50: undefined reference tovpx_codec_error'
/usr/local/lib/libavcodec.a(libvpxenc.o): In function vp8_encode': /home/simonn/ffmpeg/ffmpeg/libavcodec/libvpxenc.c:474: undefined reference tovpx_codec_encode'
/usr/local/lib/libavcodec.a(libvpxenc.o): In function queue_frames': /home/simonn/ffmpeg/ffmpeg/libavcodec/libvpxenc.c:396: undefined reference tovpx_codec_get_cx_data'
/usr/local/lib/libavcodec.a(libvpxenc.o): In function vp8_free': /home/simonn/ffmpeg/ffmpeg/libavcodec/libvpxenc.c:195: undefined reference tovpx_codec_destroy'
/usr/local/lib/libavcodec.a(libvpxenc.o): In function log_encoder_error': /home/simonn/ffmpeg/ffmpeg/libavcodec/libvpxenc.c:80: undefined reference tovpx_codec_error'
/home/simonn/ffmpeg/ffmpeg/libavcodec/libvpxenc.c:81: undefined reference to vpx_codec_error_detail' /usr/local/lib/libavcodec.a(libvpxenc.o): In functioncodecctl_int':
/home/simonn/ffmpeg/ffmpeg/libavcodec/libvpxenc.c:181: undefined reference to vpx_codec_control_' /usr/local/lib/libavcodec.a(libvpxenc.o): In functionvp8_init':
/home/simonn/ffmpeg/ffmpeg/libavcodec/libvpxenc.c:211: undefined reference to vpx_codec_version_str' /home/simonn/ffmpeg/ffmpeg/libavcodec/libvpxenc.c:212: undefined reference tovpx_codec_build_config'
/home/simonn/ffmpeg/ffmpeg/libavcodec/libvpxenc.c:214: undefined reference to vpx_codec_vp8_cx_algo' /home/simonn/ffmpeg/ffmpeg/libavcodec/libvpxenc.c:214: undefined reference tovpx_codec_enc_config_default'
/home/simonn/ffmpeg/ffmpeg/libavcodec/libvpxenc.c:215: undefined reference to vpx_codec_err_to_string' /home/simonn/ffmpeg/ffmpeg/libavcodec/libvpxenc.c:303: undefined reference tovpx_codec_vp8_cx_algo'
/home/simonn/ffmpeg/ffmpeg/libavcodec/libvpxenc.c:303: undefined reference to vpx_codec_enc_init_ver' /home/simonn/ffmpeg/ffmpeg/libavcodec/libvpxenc.c:316: undefined reference tovpx_img_wrap'
/usr/local/lib/libavcodec.a(libxvidff.o): In function xvid_encode_frame': /home/simonn/ffmpeg/ffmpeg/libavcodec/libxvidff.c:478: undefined reference toxvid_encore'
/usr/local/lib/libavcodec.a(libxvidff.o): In function xvid_encode_close': /home/simonn/ffmpeg/ffmpeg/libavcodec/libxvidff.c:528: undefined reference toxvid_encore'
/usr/local/lib/libavcodec.a(libxvidff.o): In function xvid_encode_init': /home/simonn/ffmpeg/ffmpeg/libavcodec/libxvidff.c:227: undefined reference toxvid_global'
/home/simonn/ffmpeg/ffmpeg/libavcodec/libxvidff.c:298: undefined reference to xvid_plugin_2pass2' /home/simonn/ffmpeg/ffmpeg/libavcodec/libxvidff.c:307: undefined reference toxvid_plugin_single'
/home/simonn/ffmpeg/ffmpeg/libavcodec/libxvidff.c:314: undefined reference to xvid_plugin_lumimasking' /home/simonn/ffmpeg/ffmpeg/libavcodec/libxvidff.c:392: undefined reference toxvid_encore'
/usr/local/lib/libavcodec.a(libxvid_rc.o): In function ff_xvid_rate_control_init': /home/simonn/ffmpeg/ffmpeg/libavcodec/libxvid_rc.c:80: undefined reference toxvid_plugin_2pass2'
/usr/local/lib/libavcodec.a(libxvid_rc.o): In function ff_xvid_rate_estimate_qscale': /home/simonn/ffmpeg/ffmpeg/libavcodec/libxvid_rc.c:127: undefined reference toxvid_plugin_2pass2'
/home/simonn/ffmpeg/ffmpeg/libavcodec/libxvid_rc.c:119: undefined reference to xvid_plugin_2pass2' /usr/local/lib/libavcodec.a(libxvid_rc.o): In functionff_xvid_rate_control_uninit':
/home/simonn/ffmpeg/ffmpeg/libavcodec/libxvid_rc.c:146: undefined reference to xvid_plugin_2pass2' /usr/local/lib/libavcodec.a(vaapi.o): In functioncommit_slices':
/home/simonn/ffmpeg/ffmpeg/libavcodec/vaapi.c:97: undefined reference to vaCreateBuffer' /home/simonn/ffmpeg/ffmpeg/libavcodec/vaapi.c:106: undefined reference tovaCreateBuffer'
/usr/local/lib/libavcodec.a(vaapi.o): In function alloc_buffer': /home/simonn/ffmpeg/ffmpeg/libavcodec/vaapi.c:125: undefined reference tovaCreateBuffer'
/home/simonn/ffmpeg/ffmpeg/libavcodec/vaapi.c:127: undefined reference to vaMapBuffer' /home/simonn/ffmpeg/ffmpeg/libavcodec/vaapi.c:125: undefined reference tovaCreateBuffer'
/home/simonn/ffmpeg/ffmpeg/libavcodec/vaapi.c:127: undefined reference to vaMapBuffer' /home/simonn/ffmpeg/ffmpeg/libavcodec/vaapi.c:125: undefined reference tovaCreateBuffer'
/home/simonn/ffmpeg/ffmpeg/libavcodec/vaapi.c:127: undefined reference to vaMapBuffer' /usr/local/lib/libavcodec.a(vaapi.o): In functiondestroy_buffers':
/home/simonn/ffmpeg/ffmpeg/libavcodec/vaapi.c:37: undefined reference to vaDestroyBuffer' /home/simonn/ffmpeg/ffmpeg/libavcodec/vaapi.c:37: undefined reference tovaDestroyBuffer'
/home/simonn/ffmpeg/ffmpeg/libavcodec/vaapi.c:37: undefined reference to vaDestroyBuffer' /home/simonn/ffmpeg/ffmpeg/libavcodec/vaapi.c:37: undefined reference tovaDestroyBuffer'
/usr/local/lib/libavcodec.a(vaapi.o): In function render_picture': /home/simonn/ffmpeg/ffmpeg/libavcodec/vaapi.c:48: undefined reference tovaUnmapBuffer'
/home/simonn/ffmpeg/ffmpeg/libavcodec/vaapi.c:61: undefined reference to vaBeginPicture' /home/simonn/ffmpeg/ffmpeg/libavcodec/vaapi.c:52: undefined reference tovaUnmapBuffer'
/home/simonn/ffmpeg/ffmpeg/libavcodec/vaapi.c:57: undefined reference to vaUnmapBuffer' /home/simonn/ffmpeg/ffmpeg/libavcodec/vaapi.c:65: undefined reference tovaRenderPicture'
/home/simonn/ffmpeg/ffmpeg/libavcodec/vaapi.c:69: undefined reference to vaRenderPicture' /home/simonn/ffmpeg/ffmpeg/libavcodec/vaapi.c:74: undefined reference tovaEndPicture'
collect2: ld returned 1 exit status
make: *** [all] Error 1

Issue with cat %s source_command and multirate

Hi,

When attempting to run the config-recommended-ipad-16x9-multirate.yml on a Mac OS X I receive the following error.

[buffer @ 0x7f9190c0da20] Unable to parse option value "-1" as pixel format
Error opening filters!
[mpegts @ 0x7faf89806600] Could not detect TS packet size, defaulting to non-FEC/DVHS
[mpegts @ 0x7faf89806600] Estimating duration from bitrate, this may be inaccurate
Segmenter error: Could not read stream information

If I manually run the command i receive the same error.

cat ~/Downloads/IMG_0045.MOV | ffmpeg -i - -f mpegts -acodec libmp3lame -ar 32000 -ab 48k -s 400x224 -vcodec libx264 -b 110k -flags +loop+mv4 -cmp 256 -partitions +parti4x4+partp8x8+partb8x8 -subq 7 -trellis 1 -refs 5 -coder 0 -me_range 16 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -b:v 110k -maxrate 110k -bufsize 110k -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 30 -aspect 16:9 -r 10 -g 30 -async 2 - | /Users/tate/Downloads/HTTP-Live-Video-Stream-Segmenter-and-Distributor-master/live_segmenter 10 /tmp/ sample_cell_16x9_150k cell_16x9_150k

ffmpeg version 1.1.3 Copyright (c) 2000-2013 the FFmpeg developers
built on Mar 9 2013 16:48:10 with Apple clang version 4.0 (tags/Apple/clang-421.0.60) (based on LLVM 3.1svn)
configuration: --prefix=/usr/local/Cellar/ffmpeg/1.1.3 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --cc=cc --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid
libavutil 52. 13.100 / 52. 13.100
libavcodec 54. 86.100 / 54. 86.100
libavformat 54. 59.106 / 54. 59.106
libavdevice 54. 3.102 / 54. 3.102
libavfilter 3. 32.100 / 3. 32.100
libswscale 2. 1.103 / 2. 1.103
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fde4a806600] stream 1, offset 0x24: partial file
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fde4a806600] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), 1280x720, 10586 kb/s): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options

If I remove the 'cat | ' and supply the filename manually to ffmpeg it works fine.

Any ideas what I could be doing wrong? The movies are short, only10-15 seconds.

Full output.

HTTP-Live-Video-Stream-Segmenter-and-Distributor-master tate$ ruby http_streamer.rb example-configs/config-recommended-iphone-16x9-multirate.yml
I, [2013-06-29T14:34:22.798221 #9359] INFO -- : HTTP Streamer started
I, [2013-06-29T14:34:22.798441 #9359] INFO -- : Transfer thread started
I, [2013-06-29T14:34:22.798536 #9359] INFO -- : Transfer initiated with value = mr_index
I, [2013-06-29T14:34:22.798577 #9359] INFO -- : Master encoding thread started
D, [2013-06-29T14:34:22.798627 #9359] DEBUG -- : Creating multirate index
I, [2013-06-29T14:34:22.798695 #9359] INFO -- : Encoding thread started: cell_16x9_150k
D, [2013-06-29T14:34:22.798819 #9359] DEBUG -- : Executing: cat /Users/tate/Downloads/IMG_0045.MOV
D, [2013-06-29T14:34:22.798930 #9359] DEBUG -- : Executing: ffmpeg -i - -f mpegts -acodec libmp3lame -ar 32000 -ab 48k -s 400x224 -vcodec libx264 -b 110k -flags +loop+mv4 -cmp 256 -partitions +parti4x4+partp8x8+partb8x8 -subq 7 -trellis 1 -refs 5 -coder 0 -me_range 16 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -b:v 110k -maxrate 110k -bufsize 110k -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 30 -aspect 16:9 -r 10 -g 30 -async 2 - | /Users/tate/Downloads/HTTP-Live-Video-Stream-Segmenter-and-Distributor-master/live_segmenter 10 /tmp/ sample_cell_16x9_150k cell_16x9_150k
D, [2013-06-29T14:34:22.805269 #9359] DEBUG -- : Transfering multirate index
I, [2013-06-29T14:34:22.807655 #9359] INFO -- : Transfer done
D, [2013-06-29T14:34:23.199288 #9359] DEBUG -- : Return code from master encoding: 0
I, [2013-06-29T14:34:23.199362 #9359] INFO -- : Master encoding thread terminated
D, [2013-06-29T14:34:23.203414 #9359] DEBUG -- : Encoder cell_16x9_150k: ffmpeg version 1.1.3 Copyright (c) 2000-2013 the FFmpeg developers
built on Mar 9 2013 16:48:10 with Apple clang version 4.0 (tags/Apple/clang-421.0.60) (based on LLVM 3.1svn)
configuration: --prefix=/usr/local/Cellar/ffmpeg/1.1.3 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --cc=cc --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid
libavutil 52. 13.100 / 52. 13.100
libavcodec 54. 86.100 / 54. 86.100
libavformat 54. 59.106 / 54. 59.106
libavdevice 54. 3.102 / 54. 3.102
libavfilter 3. 32.100 / 3. 32.100
libswscale 2. 1.103 / 2. 1.103
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9191006600] stream 1, offset 0x24: partial file
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9191006600] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), 1280x720, 10586 kb/s): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'pipe:':
Metadata:
major_brand : qt
minor_version : 0
compatible_brands: qt
creation_time : 2013-06-29 04:24:45
model : iPhone 4
model-eng : iPhone 4
encoder : 6.1.3
encoder-eng : 6.1.3
date : 2013-06-29T14:24:45+1000
date-eng : 2013-06-29T14:24:45+1000
location : -17.3359+145.5777+724.797/
location-eng : -17.3359+145.5777+724.797/
make : Apple
make-eng : Apple
Duration: 00:00:34.35, bitrate: N/A
Stream #0:0(und): Video: h264 (avc1 / 0x31637661), 1280x720, 10586 kb/s, 29.97 fps, 600 tbr, 600 tbn, 1200 tbc
Metadata:
creation_time : 2013-06-29 04:24:45
handler_name : Core Media Data Handler
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 63 kb/s
Metadata:
creation_time : 2013-06-29 04:24:45
handler_name : Core Media Data Handler
Please use -b:a or -b:v, -b is ambiguous
[buffer @ 0x7f9190c0da20] Unable to parse option value "-1" as pixel format
Error opening filters!
[mpegts @ 0x7faf89806600] Could not detect TS packet size, defaulting to non-FEC/DVHS
[mpegts @ 0x7faf89806600] Estimating duration from bitrate, this may be inaccurate
Segmenter error: Could not read stream information

Cannot Play the .m3u8

Hey,
  I want to restream the rtmp to iDevice. I found this project from (http://blog.kyri0s.org/post/1406637341/free-live-video-streaming-with-http-live-streaming).
  I setup the HTTP Segementer with this tutorial on Ubuntu, and it is able to work. It produce the .ts files and .m3u8 playlist. But i can't play the .m3u8 on Apache with HTML5

  second qustion, i can catch rtmp from Wowza but cannot get rtmp stream from CRTMP. Is it some problem with encoding profile?

sorry for my bad english...

/dev/video0: Operation not permitted

Hi folks
I managed to build the live segmenter. It now works with input_location of being disk files such as *.ts. When the input_location points to /dev/video0 that is a webcamera, the live segmenter fails to work. The major problem lies in "/dev/video0: Operation not permitted". Can anyone help me? In contrast, the webcamera works well with other applications such as VLC or Cheese. My system is Ubuntu 10.10

segfault in the compiler

I tried a lot of things, but I couldn't get the segmenter to work properply.
If I run it with the provides ruby script, I get this error:
sh: line 1: 19863 broken pipe ffmpeg -er 4 -y -i /var/www/test.mp3 -f mpegts -acodec libmp3lame -ac 1 -ar 44100 -ab 64k - 19864 segmentation fault | /usr/local/bin/live_segmenter 10 /tmp/ touchtalk_audiomp3_64k audiomp3_64k
I successfuly compiled it and confirm that ffmpeg works correctly.
I'm currently running this on a Pentium III machine with Debian OS (Lenny)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.