Code Monkey home page Code Monkey logo

m3u8-segmenter's Introduction

Inactive and Deprecated

I no longer have much time to work on this project and for the most part it is deprecated now that both ffmpeg and libav have direct support for segmenting and creating m3u files. Quite happy to point this elsewhere if someone else would like to take over the project.

m3u8-segmenter

m3u8-segmenter is an Apple HTTP Live Segmenter. It takes an MPEG-TS stream from a tool like ffmpeg and breaks it up into multiple ts-segments suitable for HTTP Live streaming from devices like iPhones. It also creates the M3U8 stream descriptor which is required for this type of stream.

It was originally written by Chase Douglas and is now maintained by John Ferlito.

##Installing

TO install from source you will need to make sure you have the libav/ffmpeg libraries installed. On Ubuntu/Debian you would run

apt-get install libavformat-dev

You can then build and install m3u8-segmenter by running

aclocal
automake -ac
autoconf
./configure
make
sudo make install

Usage

Some example command lines

ffmpeg -loglevel quiet  -i big_buck_bunny.ogv -f mpegts - | \
  m3u8-segmenter -i - -d 10 -p tmp/big_buck_bunny -m tmp/big_buck.m3u8 -u http://inodes.org/bigbuck/

ffmpeg -er 4 -i input.mp3 -f mpegts -acodec libmp3lame -ar 22050 -ab 32k -vn - | \
  m3u8-segmenter -i - -d 10 -p outputdir/prefix -m outputdir/output.m3u8 -u http://domain.com/

Note on Patches/Pull Requests

  • Fork the project.
  • Make your feature addition or bug fix.
  • Add tests for it. This is important so I don't break it in a future version unintentionally.
  • Commit, do not mess with Rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
  • Send me a pull request. Bonus points for topic branches.

Copyright

Copyright (c) 2011 John Ferlito. See COPYING for details.

m3u8-segmenter's People

Contributors

bmurphy1976 avatar dnwe avatar johnf avatar krisbulman 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

m3u8-segmenter's Issues

Warning: Could not write frame of stream

On my lion , when running m3u8-segmenter -i 2.ts -d 10 -p play -m index.m3u8 -u http://localhost:8080/m3u8/

It shows many lines:

Warning: Could not write frame of stream
[mpegts @ 0x7ff5e3038a00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 576450 >= 572696
Warning: Could not write frame of stream
[mpegts @ 0x7ff5e3038a00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 583958 >= 583958

m3u8-segmenter stops working after 27-53 hours

When I use m3u8-segmenter for extended periods of time, it stops working and just displays this error:

[mpegts @ 0x803019a00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 8589937458 >= 4878761008
Warning: Could not write frame of stream
[mpegts @ 0x803019a00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 8589937458 >= 4878763097
Warning: Could not write frame of stream
[mpegts @ 0x803019a00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 8589937458 >= 4878765186
Warning: Could not write frame of stream
[mpegts @ 0x803019a00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 8589937458 >= 4878767275
Warning: Could not write frame of stream
[mpegts @ 0x803019a00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 8589937458 >= 4878769364
Warning: Could not write frame of stream
[mpegts @ 0x803019a00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 8589937458 >= 4878771453
Warning: Could not write frame of stream
[mpegts @ 0x803019a00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 8589937458 >= 4878773542

I did a bit of digging and a common solution is to run ffmpeg with the "-strict experimental" flag set. Is there an equivalent flag in the API? Or is this due to some other problem? (this also happens with http-segmenter and segmenter.c...)

error when compile m3u8-segmenter in redhat

when i compile m3u8-segmenter in redhat use:
gcc -Wall -g m3u8-segmenter.c -o m3u8-segmenter -I/root/ffmpeg_build/include -L/root/ffmpeg_build/lib -lavformat -lavutil -lm -lavcodec -lswresample -lm -lz
It happened many error:
root/ffmpeg_build/lib/libavcodec.a(ansi.o): In function execute_code': /opt/ffmpeg/libavcodec/ansi.c:221: undefined reference toavpriv_vga16_font'
/opt/ffmpeg/libavcodec/ansi.c:241: undefined reference to avpriv_cga_font' /opt/ffmpeg/libavcodec/ansi.c:235: undefined reference toavpriv_cga_font'
/opt/ffmpeg/libavcodec/ansi.c:227: undefined reference to avpriv_cga_font' /opt/ffmpeg/libavcodec/ansi.c:215: undefined reference toavpriv_cga_font'
/root/ffmpeg_build/lib/libavcodec.a(ansi.o): In function decode_init': /opt/ffmpeg/libavcodec/ansi.c:88: undefined reference toavpriv_vga16_font'
/root/ffmpeg_build/lib/libavcodec.a(apedec.o): In function emms_c': /opt/ffmpeg/./libavutil/x86/emms.h:37: undefined reference toav_get_cpu_flags'
/root/ffmpeg_build/lib/libavcodec.a(asvdec.o): In function emms_c': /opt/ffmpeg/./libavutil/x86/emms.h:37: undefined reference toav_get_cpu_flags'
/root/ffmpeg_build/lib/libavcodec.a(asvenc.o): In function emms_c': /opt/ffmpeg/./libavutil/x86/emms.h:37: undefined reference toav_get_cpu_flags'
/root/ffmpeg_build/lib/libavcodec.a(atrac1.o): In function atrac1_decode_init': /opt/ffmpeg/libavcodec/atrac1.c:364: undefined reference toavpriv_float_dsp_alloc'
/root/ffmpeg_build/lib/libavcodec.a(atrac3.o): In function atrac3_decode_init': /opt/ffmpeg/libavcodec/atrac3.c:919: undefined reference toavpriv_float_dsp_alloc'
/root/ffmpeg_build/lib/libavcodec.a(atrac3plusdec.o): In function atrac3p_decode_init': /opt/ffmpeg/libavcodec/atrac3plusdec.c:171: undefined reference toavpriv_float_dsp_alloc'
/root/ffmpeg_build/lib/libavcodec.a(bink.o): In function emms_c': /opt/ffmpeg/./libavutil/x86/emms.h:37: undefined reference toav_get_cpu_flags'
/root/ffmpeg_build/lib/libavcodec.a(bintext.o): In function decode_init': /opt/ffmpeg/libavcodec/bintext.c:87: undefined reference toavpriv_cga_font'
/opt/ffmpeg/libavcodec/bintext.c:90: undefined reference to avpriv_vga16_font' /root/ffmpeg_build/lib/libavcodec.a(dcadec.o): In functiondca_decode_init':
/opt/ffmpeg/libavcodec/dcadec.c:2638: undefined reference to avpriv_float_dsp_alloc' /root/ffmpeg_build/lib/libavcodec.a(dvdec.o): In functionemms_c':
/opt/ffmpeg/./libavutil/x86/emms.h:37: undefined reference to av_get_cpu_flags' /root/ffmpeg_build/lib/libavcodec.a(dvenc.o): In functionemms_c':
/opt/ffmpeg/./libavutil/x86/emms.h:37: undefined reference to av_get_cpu_flags' /root/ffmpeg_build/lib/libavcodec.a(ffv1dec.o): In functionemms_c':
/opt/ffmpeg/./libavutil/x86/emms.h:37: undefined reference to av_get_cpu_flags' /root/ffmpeg_build/lib/libavcodec.a(ffv1enc.o): In functionemms_c':
/opt/ffmpeg/./libavutil/x86/emms.h:37: undefined reference to av_get_cpu_flags' /root/ffmpeg_build/lib/libavcodec.a(flacenc.o): In functionremove_wasted_bits':
/opt/ffmpeg/libavcodec/flacenc.c:963: undefined reference to av_ctz' /root/ffmpeg_build/lib/libavcodec.a(h264.o): In functionemms_c':
/opt/ffmpeg/./libavutil/x86/emms.h:37: undefined reference to av_get_cpu_flags' /root/ffmpeg_build/lib/libavcodec.a(huffyuvdec.o): In functionemms_c':
/opt/ffmpeg/./libavutil/x86/emms.h:37: undefined reference to av_get_cpu_flags' /opt/ffmpeg/./libavutil/x86/emms.h:37: undefined reference toav_get_cpu_flags'
/root/ffmpeg_build/lib/libavcodec.a(huffyuvenc.o): In function emms_c': /opt/ffmpeg/./libavutil/x86/emms.h:37: undefined reference toav_get_cpu_flags'
/root/ffmpeg_build/lib/libavcodec.a(imc.o): In function `imc_decode_init':

why? How i fix it? Tahnk you!

PAT/PMT are not present at the start of a segment

According to the HTTP live streaming draft, at the beginning of each segment there should be PMT/PAT tables. Currently m3u8-segmenter puts these tables later in the file and they also appear several times in a single segment file.

I suspect that this may be causing a problem in the iPhone simulator and in QuickTime on OSX. Sometimes in the middle of a segmented stream the video suddenly starts to play in slow motion. The same source file segmented with Apple's own mediastreamsegmenter plays just fine both in the iPhone simulator and in QuickTime.

This problem doesn't seem to affect the hardware devices (iPhones/iPads), just the QuickTime player in OSX and in iPhone simulator.

Not sure if this is indeed cased by the PAT/PMT tables, but it was the most obvious difference between the files produced by m3u8-segmenter and the ones produced by Apple's mediastreamsegmenter. Also, mediastreamsegmenter seems to put just a single copy of these tables in the beginning of a segment, while m3u8-segmenter puts them at random (probably at the same places and just as frequently as they appear in the source TS file).

HTTP Live Streaming Draft:
"Transport Stream files MUST contain a single MPEG-2 Program. There
SHOULD be a Program Association Table and a Program Map Table at the
start of each file. A file that contains video SHOULD have at least
one key frame and enough information to completely initialize a video
decoder."

New maintainer or close down project

Howdy,

I don't really have time to maintain this any more and since ffmpeg now seens to contain this functionality (see #17) then I'm not sure if there is much point.

@midnox you seem to have the most active branch, are you interested in taking over maintainership?

How to build? build fails in ubuntu 10.04(32 bit) and 11.04(64 bit)

Hello,

Is there any write up on how to build m3u8-segmenter and how to use it?

It will be nice if the home page atleast mentions where it might work properly (windows, linux etc)

Thanks
George

P.S make output

gcc -g -O -Wall -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return -Wcast-align -Wcast-qual -Wnested-externs -Wshadow -Wbad-function-cast -Wwrite-strings -Werror m3u8-segmenter.c -o m3u8-segmenter -lavformat -lavcodec -lavutil
m3u8-segmenter.c: In function âadd_output_streamâ:
m3u8-segmenter.c:82:14: error: âCODEC_TYPE_AUDIOâ undeclared (first use in this function)
m3u8-segmenter.c:82:14: note: each undeclared identifier is reported only once for each function it appears in
m3u8-segmenter.c:94:14: error: âCODEC_TYPE_VIDEOâ undeclared (first use in this function)
cc1: warnings being treated as errors
m3u8-segmenter.c: In function âmainâ:
m3u8-segmenter.c:338:5: error: âav_open_input_fileâ is deprecated (declared at /usr/local/include/libavformat/avformat.h:1105)
m3u8-segmenter.c:352:5: error: implicit declaration of function âguess_formatâ
m3u8-segmenter.c:352:5: error: nested extern declaration of âguess_formatâ
m3u8-segmenter.c:352:10: error: assignment makes pointer from integer without a cast
m3u8-segmenter.c:371:18: error: âCODEC_TYPE_VIDEOâ undeclared (first use in this function)
m3u8-segmenter.c:376:18: error: âCODEC_TYPE_AUDIOâ undeclared (first use in this function)
m3u8-segmenter.c:387:5: error: âav_set_parametersâ is deprecated (declared at /usr/local/include/libavformat/avformat.h:1449)
m3u8-segmenter.c:392:5: error: âdump_formatâ is deprecated (declared at /usr/local/include/libavformat/avformat.h:1592)
m3u8-segmenter.c:400:7: error: âavcodec_openâ is deprecated (declared at /usr/local/include/libavcodec/avcodec.h:3749)
m3u8-segmenter.c:406:5: error: âurl_fopenâ is deprecated (declared at /usr/local/include/libavformat/avio.h:279)
m3u8-segmenter.c:411:5: error: âav_write_headerâ is deprecated (declared at /usr/local/include/libavformat/avformat.h:1507)
m3u8-segmenter.c:444:67: error: âPKT_FLAG_KEYâ undeclared (first use in this function)
m3u8-segmenter.c:455:13: error: âput_flush_packetâ is deprecated (declared at /usr/local/include/libavformat/avio.h:289)
m3u8-segmenter.c:456:13: error: âurl_fcloseâ is deprecated (declared at /usr/local/include/libavformat/avio.h:280)
m3u8-segmenter.c:476:13: error: âurl_fopenâ is deprecated (declared at /usr/local/include/libavformat/avio.h:279)
m3u8-segmenter.c:482:13: error: âav_write_headerâ is deprecated (declared at /usr/local/include/libavformat/avformat.h:1507)
m3u8-segmenter.c:514:5: error: âurl_fcloseâ is deprecated (declared at /usr/local/include/libavformat/avio.h:280)
make: *** [all] Error 1

error on debian squeezy with debian-multimedia repo

hello
i have problem with version 0.3 on debian

gcc -g -O -Wall -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return -Wcast-align -Wcast-qual -Wnested-externs -Wshadow -Wbad-function-cast -Wwrite-strings -Werror m3u8-segmenter.c -o m3u8-segmenter -lavformat -lavcodec -lavutil
cc1: warnings being treated as errors
m3u8-segmenter.c: In function ‘main’:
m3u8-segmenter.c:338: error: ‘av_open_input_file’ is deprecated (declared at /usr/include/libavformat/avformat.h:1170)
m3u8-segmenter.c:387: error: ‘av_set_parameters’ is deprecated (declared at /usr/include/libavformat/avformat.h:1520)
m3u8-segmenter.c:392: error: ‘dump_format’ is deprecated (declared at /usr/include/libavformat/avformat.h:1645)
m3u8-segmenter.c:406: error: ‘url_fopen’ is deprecated (declared at /usr/include/libavformat/avio.h:281)
m3u8-segmenter.c:411: error: ‘av_write_header’ is deprecated (declared at /usr/include/libavformat/avformat.h:1578)
m3u8-segmenter.c:455: error: ‘put_flush_packet’ is deprecated (declared at /usr/include/libavformat/avio.h:295)
m3u8-segmenter.c:456: error: ‘url_fclose’ is deprecated (declared at /usr/include/libavformat/avio.h:282)
m3u8-segmenter.c:476: error: ‘url_fopen’ is deprecated (declared at /usr/include/libavformat/avio.h:281)
m3u8-segmenter.c:482: error: ‘av_write_header’ is deprecated (declared at /usr/include/libavformat/avformat.h:1578)
m3u8-segmenter.c:514: error: ‘url_fclose’ is deprecated (declared at /usr/include/libavformat/avio.h:282)
make: *** [all] Error 1

libs version:
libffms2-dev (2.14-0.0)
libavformat-dev (5:0.7.8-0.1)

maybe you have .deb on amd64 arch?

Cannot build on Ubuntu 12.04 / amd64

Just checked out from Github, and configured/compiled as instructed:

$ aclocal
$ automake -ac
$ autoconf
$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking whether make sets $(MAKE)... (cached) yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for sys/types.h... (cached) yes
checking signal.h usability... yes
checking signal.h presence... yes
checking for signal.h... yes
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for memmove... yes
checking for memset... yes
checking for strrchr... yes
checking for strtol... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for FFMPEG... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating tests/Makefile
config.status: executing depfiles commands

$ make
Making all in tests
...
gcc -DPACKAGE_NAME="m3u8-segmenter" -DPACKAGE_TARNAME="m3u8-segmenter" -DPACKAGE_VERSION="0.3" -DPACKAGE_STRING="m3u8-segmenter\ 0.3" -DPACKAGE_BUGREPORT="http://github.com/johnf/m3u8-segmenter/issues\" -DPACKAGE_URL="http://m3u8-segmenter.inodes.org\" -DPACKAGE="m3u8-segmenter" -DVERSION="0.3" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SIGNAL_H=1 -DHAVE_GETOPT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_MEMMOVE=1 -DHAVE_MEMSET=1 -DHAVE_STRRCHR=1 -DHAVE_STRTOL=1 -I. -I/usr/local/include -g -O2 -Wall -Wextra -Wdeclaration-after-statement -Wpointer-arith -funsigned-char -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return -Wcast-align -Wcast-qual -Wnested-externs -Wshadow -Wbad-function-cast -Wwrite-strings -MT m3u8_segmenter-m3u8-segmenter.o -MD -MP -MF .deps/m3u8_segmenter-m3u8-segmenter.Tpo -c -o m3u8_segmenter-m3u8-segmenter.o test -f 'm3u8-segmenter.c' || echo './'m3u8-segmenter.c
m3u8-segmenter.c: In function ‘add_output_stream’:
m3u8-segmenter.c:58:5: error: implicit declaration of function ‘avformat_new_stream’ [-Werror=implicit-function-declaration]
m3u8-segmenter.c:58:5: error: nested extern declaration of ‘avformat_new_stream’ [-Werror=nested-externs]
m3u8-segmenter.c:58:19: error: assignment makes pointer from integer without a cast [-Werror]
m3u8-segmenter.c: In function ‘main’:
m3u8-segmenter.c:343:5: error: implicit declaration of function ‘avformat_find_stream_info’ [-Werror=implicit-function-declaration]
m3u8-segmenter.c:343:5: error: nested extern declaration of ‘avformat_find_stream_info’ [-Werror=nested-externs]
m3u8-segmenter.c:390:7: error: implicit declaration of function ‘avcodec_open2’ [-Werror=implicit-function-declaration]
m3u8-segmenter.c:390:7: error: nested extern declaration of ‘avcodec_open2’ [-Werror=nested-externs]
cc1: all warnings being treated as errors
make[1]: *** [m3u8_segmenter-m3u8-segmenter.o] Error 1
make[1]: Leaving directory '/home/kasper/src/m3u8-segmenter'
make: *** [all-recursive] Error 1

compilation error

m3u8-segmenter.c: In function ‘add_output_stream’:
m3u8-segmenter.c:88:92: error: ‘CODEC_ID_MP3’ undeclared (first use in this function)
if ((input_codec_context->block_align == 1 && input_codec_context->codec_id == CODEC_ID_MP3) || input_co
^
m3u8-segmenter.c:88:92: note: each undeclared identifier is reported only once for each function it appears in
m3u8-segmenter.c:88:142: error: ‘CODEC_ID_AC3’ undeclared (first use in this function)

Leading silence (gaps) in audio segments

I'm seeing gaps (silence) at the beginning of each audio segment.

Segment 1 = no gap,
Segment 2 = 1s gap,
Segment 3 = 2s gap,
Segment 4 = 3s gap,
... and so on.

This causes gaps/pops/clicks in playback.

Both mediastreamsegmenter and mediafilesegmenter are all fine (no gaps) on same source file (libfaac mpegts via ffmpeg).

All tests are using same default segment duration 10s.

v1.0 does not compile with ffmpeg 0.11.1 (re-open)

~/johnf-m3u8-segmenter-dc29d5b$ aclocal
~/johnf-m3u8-segmenter-dc29d5b$ automake -ac
~/johnf-m3u8-segmenter-dc29d5b$ autoconf
/johnf-m3u8-segmenter-dc29d5b$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking whether make sets $(MAKE)... (cached) yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for sys/types.h... (cached) yes
checking signal.h usability... yes
checking signal.h presence... yes
checking for signal.h... yes
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for memmove... yes
checking for memset... yes
checking for strrchr... yes
checking for strtol... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for FFMPEG... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating tests/Makefile
config.status: executing depfiles commands
pi@raspberrypi:
/johnf-m3u8-segmenter-dc29d5b$ make
Making all in tests
make[1]: Entering directory /home/pi/johnf-m3u8-segmenter-dc29d5b/tests' make[1]: Nothing to be done forall'.
make[1]: Leaving directory /home/pi/johnf-m3u8-segmenter-dc29d5b/tests' make[1]: Entering directory/home/pi/johnf-m3u8-segmenter-dc29d5b'
gcc -DPACKAGE_NAME="m3u8-segmenter" -DPACKAGE_TARNAME="m3u8-segmenter" -DPACKAGE_VERSION="0.3" -DPACKAGE_STRING="m3u8-segmenter\ 0.3" -DPACKAGE_BUGREPORT="http://github.com/johnf/m3u8-segmenter/issues\" -DPACKAGE_URL="http://m3u8-segmenter.inodes.org\" -DPACKAGE="m3u8-segmenter" -DVERSION="0.3" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SIGNAL_H=1 -DHAVE_GETOPT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_MEMMOVE=1 -DHAVE_MEMSET=1 -DHAVE_STRRCHR=1 -DHAVE_STRTOL=1 -I. -I/usr/local/include -g -O2 -Wall -Wextra -Wdeclaration-after-statement -Wpointer-arith -funsigned-char -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return -Wcast-align -Wcast-qual -Wnested-externs -Wshadow -Wbad-function-cast -Wwrite-strings -MT m3u8_segmenter-m3u8-segmenter.o -MD -MP -MF .deps/m3u8_segmenter-m3u8-segmenter.Tpo -c -o m3u8_segmenter-m3u8-segmenter.o test -f 'm3u8-segmenter.c' || echo './'m3u8-segmenter.c
m3u8-segmenter.c: In function ‘main’:
m3u8-segmenter.c:397: error: ‘URL_WRONLY’ undeclared (first use in this function)
m3u8-segmenter.c:397: error: (Each undeclared identifier is reported only once
m3u8-segmenter.c:397: error: for each function it appears in.)
make[1]: *** [m3u8_segmenter-m3u8-segmenter.o] Error 1
make[1]: Leaving directory `/home/pi/johnf-m3u8-segmenter-dc29d5b'
make: *** [all-recursive] Error 1
~/johnf-m3u8-segmenter-dc29d5b$ ffmpeg -version
ffmpeg version 0.11.1
built on Jul 4 2012 13:56:57 with gcc 4.4.5
configuration: --enable-gpl --enable-nonfree --enable-libfaac --enable-libmp3lame
libavutil 51. 54.100 / 51. 54.100
libavcodec 54. 23.100 / 54. 23.100
libavformat 54. 6.100 / 54. 6.100
libavdevice 54. 0.100 / 54. 0.100
libavfilter 2. 77.100 / 2. 77.100
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 15.100 / 0. 15.100
libpostproc 52. 0.100 / 52. 0.100

problem in launchpad repo

in readme you have said to add
apt-add-repository ppa:johnf-inodes/m3u8-segmenter

but it is apt-add-repository ppa:johnf-inodes/segmenter

Autoconf fails

Hi John,

I am trying to build the segmenter on CentOS 5.7. I installed autoconf 2.68, but when I run it on the segmenter project I get the following error:
configure.ac:16: error: possibly undefined macro: AM_INIT_AUTOMAKE
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.

I've looked at the doc, but I know nothing of autoconf and it's not making sense to me. Can you help me out so I can build the project?

Thank you.

Don

stack smashing detected

I am using v0.3 tag, OS is ubuntu 10.04 LTS

everytime the segmenter tries to segment the 50th ts, it crashes:

mpegts @ 0xf52f00] muxrate VBR, pcr every 5 pkts, sdt every 200, pat/pmt every 40 pkts
[mpegts @ 0xf52f00] muxrate VBR, pcr every 5 pkts, sdt every 200, pat/pmt every 40 pkts
*** stack smashing detected ***: m3u8-segmenter terminated
======= Backtrace: =========
/lib/libc.so.6(__fortify_fail+0x37)[0x7fe3b4372217]
/lib/libc.so.6(__fortify_fail+0x0)[0x7fe3b43721e0]
/usr/local/lib/libavformat.so.52(+0x7344b)[0x7fe3b567944b]
/usr/local/lib/libavformat.so.52(+0x7367b)[0x7fe3b567967b]
/usr/local/lib/libavformat.so.52(av_interleaved_write_frame+0x76)[0x7fe3b56bf1b6]
m3u8-segmenter[0x40266d]
/lib/libc.so.6(__libc_start_main+0xfd)[0x7fe3b4291c4d]
m3u8-segmenter[0x4013d9]
======= Memory map: ========
00400000-00404000 r-xp 00000000 fb:00 4463503 /usr/bin/m3u8-segmenter
00603000-00604000 r--p 00003000 fb:00 4463503 /usr/bin/m3u8-segmenter
00604000-00605000 rw-p 00004000 fb:00 4463503 /usr/bin/m3u8-segmenter
00f34000-0105c000 rw-p 00000000 00:00 0 [heap]
7fe3b1b19000-7fe3b1b2f000 r-xp 00000000 fb:00 2621495 /lib/libgcc_s.so.1
7fe3b1b2f000-7fe3b1d2e000 ---p 00016000 fb:00 2621495 /lib/libgcc_s.so.1
7fe3b1d2e000-7fe3b1d2f000 r--p 00015000 fb:00 2621495 /lib/libgcc_s.so.1
7fe3b1d2f000-7fe3b1d30000 rw-p 00016000 fb:00 2621495 /lib/libgcc_s.so.1
7fe3b1d30000-7fe3b1e26000 r-xp 00000000 fb:00 4458002 /usr/lib/libstdc++.so.6.0.13
7fe3b1e26000-7fe3b2026000 ---p 000f6000 fb:00 4458002 /usr/lib/libstdc++.so.6.0.13
7fe3b2026000-7fe3b202d000 r--p 000f6000 fb:00 4458002 /usr/lib/libstdc++.so.6.0.13
7fe3b202d000-7fe3b202f000 rw-p 000fd000 fb:00 4458002 /usr/lib/libstdc++.so.6.0.13
7fe3b202f000-7fe3b2044000 rw-p 00000000 00:00 0
7fe3b2044000-7fe3b204a000 r-xp 00000000 fb:00 4464264 /usr/lib/libogg.so.0.6.0
7fe3b204a000-7fe3b2249000 ---p 00006000 fb:00 4464264 /usr/lib/libogg.so.0.6.0
7fe3b2249000-7fe3b224a000 r--p 00005000 fb:00 4464264 /usr/lib/libogg.so.0.6.0
7fe3b224a000-7fe3b224b000 rw-p 00006000 fb:00 4464264 /usr/lib/libogg.so.0.6.0
7fe3b224b000-7fe3b225a000 r-xp 00000000 fb:00 4464260 /usr/lib/libfaac.so.0.0.0
7fe3b225a000-7fe3b2459000 ---p 0000f000 fb:00 4464260 /usr/lib/libfaac.so.0.0.0
7fe3b2459000-7fe3b245a000 r--p 0000e000 fb:00 4464260 /usr/lib/libfaac.so.0.0.0
7fe3b245a000-7fe3b245d000 rw-p 0000f000 fb:00 4464260 /usr/lib/libfaac.so.0.0.0
7fe3b245d000-7fe3b24a2000 r-xp 00000000 fb:00 4464262 /usr/lib/libmp3lame.so.0.0.0
7fe3b24a2000-7fe3b26a2000 ---p 00045000 fb:00 4464262 /usr/lib/libmp3lame.so.0.0.0
7fe3b26a2000-7fe3b26a3000 r--p 00045000 fb:00 4464262 /usr/lib/libmp3lame.so.0.0.0
7fe3b26a3000-7fe3b26a4000 rw-p 00046000 fb:00 4464262 /usr/lib/libmp3lame.so.0.0.0
7fe3b26a4000-7fe3b26d5000 rw-p 00000000 00:00 0
7fe3b26d5000-7fe3b2704000 r-xp 00000000 fb:00 4464248 /usr/local/lib/libopencore-amrnb.so.0.0.2
7fe3b2704000-7fe3b2904000 ---p 0002f000 fb:00 4464248 /usr/local/lib/libopencore-amrnb.so.0.0.2
7fe3b2904000-7fe3b2905000 rw-p 0002f000 fb:00 4464248 /usr/local/lib/libopencore-amrnb.so.0.0.2
7fe3b2905000-7fe3b291b000 r-xp 00000000 fb:00 4464245 /usr/local/lib/libopencore-amrwb.so.0.0.2
7fe3b291b000-7fe3b2b1a000 ---p 00016000 fb:00 4464245 /usr/local/lib/libopencore-amrwb.so.0.0.2
7fe3b2b1a000-7fe3b2b1b000 rw-p 00015000 fb:00 4464245 /usr/local/lib/libopencore-amrwb.so.0.0.2
7fe3b2b1b000-7fe3b2b34000 r-xp 00000000 fb:00 4464219 /usr/local/lib/libtheoradec.so.1.1.4
7fe3b2b34000-7fe3b2d33000 ---p 00019000 fb:00 4464219 /usr/local/lib/libtheoradec.so.1.1.4
7fe3b2d33000-7fe3b2d34000 rw-p 00018000 fb:00 4464219 /usr/local/lib/libtheoradec.so.1.1.4
7fe3b2d34000-7fe3b2d70000 r-xp 00000000 fb:00 4464224 /usr/local/lib/libtheoraenc.so.1.1.2
7fe3b2d70000-7fe3b2f70000 ---p 0003c000 fb:00 4464224 /usr/local/lib/libtheoraenc.so.1.1.2
7fe3b2f70000-7fe3b2f71000 rw-p 0003c000 fb:00 4464224 /usr/local/lib/libtheoraenc.so.1.1.2
7fe3b2f71000-7fe3b2f9d000 r-xp 00000000 fb:00 4464272 /usr/lib/libvorbis.so.0.4.3
7fe3b2f9d000-7fe3b319c000 ---p 0002c000 fb:00 4464272 /usr/lib/libvorbis.so.0.4.3
7fe3b319c000-7fe3b319d000 r--p 0002b000 fb:00 4464272 /usr/lib/libvorbis.so.0.4.3
7fe3b319d000-7fe3b319e000 rw-p 0002c000 fb:00 4464272 /usr/lib/libvorbis.so.0.4.3
7fe3b319e000-7fe3b3361000 r-xp 00000000 fb:00 4464275 /usr/lib/libvorbisenc.so.2.0.6
7fe3b3361000-7fe3b3561000 ---p 001c3000 fb:00 4464275 /usr/lib/libvorbisenc.so.2.0.6
7fe3b3561000-7fe3b3578000 r--p 001c3000 fb:00 4464275 /usr/lib/libvorbisenc.so.2.0.6
7fe3b3578000-7fe3b3579000 rw-p 001da000 fb:00 4464275 /usr/lib/libvorbisenc.so.2.0.6
7fe3b3579000-7fe3b3672000 r-xp 00000000 fb:00 4464217 /usr/local/lib/libx264.so.116
7fe3b3672000-7fe3b3871000 ---p 000f9000 fb:00 4464217 /usr/local/lib/libx264.so.116
7fe3b3871000-7fe3b3873000 r--p 000f8000 fb:00 4464217 /usr/local/lib/libx264.so.116
7fe3b3873000-7fe3b3874000 rw-p 000fa000 fb:00 4464217 /usr/local/lib/libx264.so.116
7fe3b3874000-7fe3b38ae000 rw-p 00000000 00:00 0
7fe3b38ae000-7fe3b3947000 r-xp 00000000 fb:00 4464548 /usr/lib/libxvidcore.so.4.2
7fe3b3947000-7fe3b3b47000 ---p 00099000 fb:00 4464548 /usr/lib/libxvidcore.so.4.2
7fe3b3b47000-7fe3b3b48000 r--p 00099000 fb:00 4464548 /usr/lib/libxvidcore.so.4.2
7fe3b3b48000-7fe3b3b52000 rw-p 0009a000 fb:00 4464548 /usr/lib/libxvidcore.so.4.2
7fe3b3b52000-7fe3b3bbc000 rw-p 00000000 00:00 0
7fe3b3bbc000-7fe3b3bd4000 r-xp 00000000 fb:00 2621471 /lib/libpthread-2.11.1.soAborted

Incorrect video duration

I installed m3u8-segmenter and its generating m3u8 playlist . I am using the following command to generate the playlist :

m3u8-segmenter -i $videoBasePath -d 2 -p $videoPrefix -m $finalName -u "nlt/".$fileN."/"

now , even though I am getting the m3u8 file, when I play it in video tag on my website, for the video of duration 10.18 seconds, it is showing 12 second duration and if I used -d 10, it shows 20 sec, which is incorrect.

Please help me out with this issue.

Regards,
Avi

segmenter disobeys -d duration (also default value is not obeyed)

Hi Johnf,

I am using your latest segmenter along with latest stable ffmpeg release (0.8). I have observed that segmenter disobeys -d options and generates segments of variable length. Even the default value (10) for -d option genrating chunks of variable length.

Example 1:
ffmpeg -i out.ts => Duration: 00:00:48.00 secs

m3u8-segmenter -i out.ts -d 5 -p file -m index_main.m3u8 -u "";

generates chunks of below sizes.
file-1.ts => 4.16 secs file-2.ts => 6.32 secs file-3.ts => 10.00 secs file-4.ts => 12.40 secs file-5.ts => 7.98 secs file-6.ts => 7.56

Example 2: (segmenter run with default option, removed -d option)

m3u8-segmenter -i out.ts -p file -m index_main.m3u8 -u "";

file-1.ts => 10.04 secs file-2.ts => 12.36 secs file-3.ts => 10.12 secs file-4.ts =>15.48 secs

Please let me know is this usage issue or bug in the segmenter code?

Thanks a lot
Rakesh

PS:
I have done below changes to compile latest segmenter with ffmpeg 0.8

changed:

CODEC_TYPE_AUDIO => AVMEDIA_TYPE_AUDIO
CODEC_TYPE_VIDEO => AVMEDIA_TYPE_VIDEO
PKT_FLAG_KEY => AV_PKT_FLAG_KEY

MinGW Windows compile

Hello. I've already been using a version of your m3u8-segmenter that I compiled for Mac and have been very pleased with the results. I been wanting to create a version for Windows using the source on MinGW but have not had any success. I get through the configure fine, but during Make, I get the following errors:

$ make
Making all in tests
make[1]: Entering directory /usr/local/m3u8-segmenter/tests' make[1]: Nothing to be done forall'.
make[1]: Leaving directory /usr/local/m3u8-segmenter/tests' make[1]: Entering directory/usr/local/m3u8-segmenter'
gcc -DPACKAGE_NAME="m3u8-segmenter" -DPACKAGE_TARNAME="m3u8-segmenter" -DPAC
KAGE_VERSION="0.3" -DPACKAGE_STRING="m3u8-segmenter\ 0.3" -DPACKAGE_BUGREPOR
T="http://github.com/johnf/m3u8-segmenter/issues\" -DPACKAGE_URL="http://m3u8-
segmenter.inodes.org" -DPACKAGE="m3u8-segmenter" -DVERSION="0.3" -DSTDC_HEA
DERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_
H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -
DHAVE_UNISTD_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SIGNAL_H=1 -DHAVE_GETOPT_H=1 -DHAVE
_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_MEMMOVE=1 -DHAVE_MEMSET=1 -DHAVE_STRRCHR=1 -D
HAVE_STRTOL=1 -I. -Ic:/MinGW/msys/1.0/local/include -g -O2 -Wall -Wextra -W
declaration-after-statement -Wpointer-arith -funsigned-char -Werror -Wall -Wstri
ct-prototypes -Wmissing-prototypes -Waggregate-return -Wcast-align -Wcast-qual -
Wnested-externs -Wshadow -Wbad-function-cast -Wwrite-strings -MT m3u8_segmenter
-m3u8-segmenter.o -MD -MP -MF .deps/m3u8_segmenter-m3u8-segmenter.Tpo -c -o m3u8
_segmenter-m3u8-segmenter.o test -f 'm3u8-segmenter.c' || echo './'m3u8-segmen
ter.c
m3u8-segmenter.c: In function 'main':
m3u8-segmenter.c:212:22: error: storage size of 'act' isn't known
m3u8-segmenter.c:413:5: error: implicit declaration of function 'sigaction' [-We
rror=implicit-function-declaration]
m3u8-segmenter.c:413:5: error: nested extern declaration of 'sigaction' [-Werror
=nested-externs]
m3u8-segmenter.c:212:22: error: unused variable 'act' [-Werror=unused-variable]
cc1.exe: all warnings being treated as errors

make[1]: *** [m3u8_segmenter-m3u8-segmenter.o] Error 1
make[1]: Leaving directory `/usr/local/m3u8-segmenter'

make: *** [all-recursive] Error 1

Would you happen to know the reason for 'storage size of 'act' isn't know' errors?

Thanks, Joe

compilation error

Hi,

using a recent FFMPEG release (v38280), compilation stops with an error :

m3u8-segmenter.c:395: error: 'URL_WRONLY' undeclared (first use in this function)
m3u8-segmenter.c:395: error: (Each undeclared identifier is reported only once

Please, advise.

Thanks,
Xris

m3u8 segmenter not building in centos 6

when i try to make it show me error oplease find below error which i am getting

cc1: warnings being treated as errors
m3u8-segmenter.c: In function ‘add_output_stream’:
m3u8-segmenter.c:58: error: implicit declaration of function ‘avformat_new_stream’
m3u8-segmenter.c:58: error: nested extern declaration of ‘avformat_new_stream’
m3u8-segmenter.c:58: error: assignment makes pointer from integer without a cast
m3u8-segmenter.c: In function ‘main’:
m3u8-segmenter.c:343: error: implicit declaration of function ‘avformat_find_stream_info’
m3u8-segmenter.c:343: error: nested extern declaration of ‘avformat_find_stream_info’
m3u8-segmenter.c:390: error: implicit declaration of function ‘avcodec_open2’
m3u8-segmenter.c:390: error: nested extern declaration of ‘avcodec_open2’
m3u8-segmenter.c:397: error: ‘AVIO_FLAG_WRITE’ undeclared (first use in this function)
m3u8-segmenter.c:397: error: (Each undeclared identifier is reported only once
m3u8-segmenter.c:397: error: for each function it appears in.)
make[1]: *** [m3u8_segmenter-m3u8-segmenter.o] Error 1
make[1]: Leaving directory `/usr/local/src/m3u8-segmenter'
make: *** [all-recursive] Error 1

Note: i have ffmpeg and all required libraries installed already

Audio-only

Hi,

Can we create audio-only segments with m3u8-segmenter like de apple segmenter ?
I got a segfault when i want to segment a video file with 64k audio only :(

Thanks,

No compiling with latest Ffmpeg

This is my ffmpeg version:

$ ffmpeg -version
ffmpeg version N-39609-g50ec8a2
built on Apr 7 2012 13:07:46 with gcc 4.6.1
configuration: --enable-gpl --enable-gray --enable-runtime-cpudetect --enable-bzlib --enable-gnutls --enable-libass --enable-libcelt --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libcdio --enable-libdc1394 --enable-libdirac --enable-libfaac --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libnut --enable-libopenjpeg --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libv4l2 --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-openal --enable-openssl --enable-zlib --enable-nonfree --enable-version3 --enable-x11grab
libavutil 51. 45.100 / 51. 45.100
libavcodec 54. 13.100 / 54. 13.100
libavformat 54. 3.100 / 54. 3.100
libavdevice 53. 4.100 / 53. 4.100
libavfilter 2. 67.101 / 2. 67.101
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 10.100 / 0. 10.100
libpostproc 52. 0.100 / 52. 0.100

This is what I did to try to download and compile it:

$ mkdir mygits
$ cd mygits
$ git clone https://github.com/johnf/m3u8-segmenter.git
$ cd m3u8-segmenter/
$ ls -l
$ autoconf
$ autoreconf -f -i -Wall,no-obsolete
$ ./configure
$ make

This is the error I get:

~/mygits/m3u8-segmenter$ make
Making all in tests
make[1]: Entering directory /home/me/mygits/m3u8-segmenter/tests' make[1]: Nothing to be done forall'.
make[1]: Leaving directory /home/me/mygits/m3u8-segmenter/tests' make[1]: Entering directory/home/me/mygits/m3u8-segmenter'
gcc -DPACKAGE_NAME="m3u8-segmenter" -DPACKAGE_TARNAME="m3u8-segmenter" -DPACKAGE_VERSION="0.3" -DPACKAGE_STRING="m3u8-segmenter\ 0.3" -DPACKAGE_BUGREPORT="http://github.com/johnf/m3u8-segmenter/issues\" -DPACKAGE_URL="http://m3u8-segmenter.inodes.org\" -DPACKAGE="m3u8-segmenter" -DVERSION="0.3" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SIGNAL_H=1 -DHAVE_GETOPT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_MEMMOVE=1 -DHAVE_MEMSET=1 -DHAVE_STRRCHR=1 -DHAVE_STRTOL=1 -I. -I/usr/local/include -g -O2 -Wall -Wextra -Wdeclaration-after-statement -Wpointer-arith -funsigned-char -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return -Wcast-align -Wcast-qual -Wnested-externs -Wshadow -Wbad-function-cast -Wwrite-strings -MT m3u8_segmenter-m3u8-segmenter.o -MD -MP -MF .deps/m3u8_segmenter-m3u8-segmenter.Tpo -c -o m3u8_segmenter-m3u8-segmenter.o test -f 'm3u8-segmenter.c' || echo './'m3u8-segmenter.c
m3u8-segmenter.c: In function ‘add_output_stream’:
m3u8-segmenter.c:58:5: error: ‘av_new_stream’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:1543) [-Werror=deprecated-declarations]
m3u8-segmenter.c: In function ‘main’:
m3u8-segmenter.c:341:5: error: ‘av_find_stream_info’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:1343) [-Werror=deprecated-declarations]
m3u8-segmenter.c:388:7: error: ‘avcodec_open’ is deprecated (declared at /usr/local/include/libavcodec/avcodec.h:3723) [-Werror=deprecated-declarations]
m3u8-segmenter.c:395:45: error: ‘URL_WRONLY’ undeclared (first use in this function)
m3u8-segmenter.c:395:45: note: each undeclared identifier is reported only once for each function it appears in
cc1: all warnings being treated as errors

make[1]: *** [m3u8_segmenter-m3u8-segmenter.o] Error 1
make[1]: Leaving directory `/home/me/mygits/m3u8-segmenter'
make: *** [all-recursive] Error 1
me@mbp-ubuntu:~/mygits/m3u8-segmenter$

Please let me know what version of Ffmpeg and libraries are known to work,
Thanks,

Ad.

For h264 stream, error "Application provided invalid ..." occurs

I utilize m3u8-segmenter to segment hls ts file with little change(i change it to work for streaming input instead of file input, and add things like data management), it works fine for mpeg stream, but bad for h264 stream, stable error occurs. the output is like the following:

[h264 @ 0xb7e351b0] non-existing PPS 0 referenced
[h264 @ 0xb7e351b0] non-existing PPS 0 referenced
[h264 @ 0xb7e351b0] decode_slice_header error
[h264 @ 0xb7e351b0] no frame!
[h264 @ 0xb7e351b0] non-existing PPS 0 referenced
[h264 @ 0xb7e351b0] non-existing PPS 0 referenced
[h264 @ 0xb7e351b0] decode_slice_header error
[h264 @ 0xb7e351b0] no frame!
[h264 @ 0xb7e351b0] mmco: unref short failure
[h264 @ 0xb7e351b0] mmco: unref short failure
[h264 @ 0xb7e351b0] number of reference frames (0+4) exceeds max (3; probably corrupt input), discarding one
Output #0, mpegts, to '/data/hls_root/live':
Stream #0:0: Video: h264 ([27][0][0][0] / 0x001B), yuv420p, 720x576, q=2-31, 25 tbc
Stream #0:1: Audio: aac ([15][0][0][0] / 0x000F), 48000 Hz, stereo, 120 kb/s
[mpegts @ 0xb7e58bd0] Using AVStream.codec.time_base as a timebase hint to the muxer is deprecated. Set AVStream.time_base instead.
[mpegts @ 0xb7e58bd0] Using AVStream.codec.time_base as a timebase hint to the muxer is deprecated. Set AVStream.time_base instead.
Ignoring attempt to set invalid timebase 1/0 for st:1
live: first_segment = 1
live: last_segment = 0
live: first_segment = 1
live: last_segment = 1
[mpegts @ 0xb7e58bd0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 5031503020 >= 5031494020
Warning: Could not write frame of stream, discarding one packet
[mpegts @ 0xb7e58bd0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 5031503020 >= 5031494020
Warning: Could not write frame of stream, discarding one packet
[mpegts @ 0xb7e58bd0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 5031503020 >= 5031490420
Warning: Could not write frame of stream, discarding one packet
[mpegts @ 0xb7e58bd0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 5031503020 >= 5031492220
Warning: Could not write frame of stream, discarding one packet
[mpegts @ 0xb7e58bd0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 5031503020 >= 5031495820
Warning: Could not write frame of stream, discarding one packet
[mpegts @ 0xb7e58bd0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 5031503020 >= 5031497620
Warning: Could not write frame of stream, discarding one packet
[mpegts @ 0xb7e58bd0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 5031503020 >= 5031499420
Warning: Could not write frame of stream, discarding one packet
[mpegts @ 0xb7e58bd0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 5031515620 >= 5031508420
Warning: Could not write frame of stream, discarding one packet
[mpegts @ 0xb7e58bd0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 5031515620 >= 5031510220
Warning: Could not write frame of stream, discarding one packet
[mpegts @ 0xb7e58bd0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 5031515620 >= 5031504820
Warning: Could not write frame of stream, discarding one packet
[mpegts @ 0xb7e58bd0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 5031515620 >= 5031506620
Warning: Could not write frame of stream, discarding one packet
[mpegts @ 0xb7e58bd0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 5031515620 >= 5031512020
Warning: Could not write frame of stream, discarding one packet
[mpegts @ 0xb7e58bd0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 5031515620 >= 5031513820
Warning: Could not write frame of stream, discarding one packet
[mpegts @ 0xb7e58bd0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 5031530020 >= 5031522820
Warning: Could not write frame of stream, discarding one packet
[mpegts @ 0xb7e58bd0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 5031530020 >= 5031524620

I have seen the author published problems like this, but didn't find any solution on the internet, i wonder if the problem had been solved? or the problem does not lie in the m3u8-segmenter, but the input stream itself?

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.