Giter VIP home page Giter VIP logo

stream-m's People

Contributors

mbattista avatar rs-fabrica avatar tiff avatar vbence 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  avatar  avatar

stream-m's Issues

URL read error by ffmpeg when streaming WebM file

Hi, thank you for your nice work in streaming WebM format files.

However, I met some problem somehow when running the process according to the guideline.

The program package is from the latest release: https://github.com/vbence/stream-m/releases/tag/v0.2.2.

The streaming server is open with java -jar stream-m.jar server.properties.sample without any change.

When I run the following command to run the ffmpeg as suggested by TESTING THE INSTALLATION of README

ffmpeg -re -i ./file_example_WEBM_1920_3_7MB.webm -vcodec copy -acodec copy -f webm http://localhost:8080/publish/first?password=secret

The error message was as following, it shows that there was some problems with the URL. But I cannot find any mistake or wrong in the command... Would you mind providing some suggestion on how to solve it? Thanks a lot!

av_interleaved_write_frame(): Unknown errortime=00:00:00.00 bitrate=N/A speed=N/A
Error writing trailer of http://localhost:8080/publish/first?password=secret: Error number -10053 occurred
frame=   14 fps=0.0 q=-1.0 Lsize=      50kB time=00:00:00.43 bitrate= 941.4kbits/s speed=1.05x
video:82kB audio:0kB subtitle:0kB other streams:0kB global headers:4kB muxing overhead: unknown
[http @ 000002077444fa00] URL read error: Error number -10053 occurred
Conversion failed!

Here is the full message by ffmpeg:

ffmpeg version 4.4.1-essentials_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 11.2.0 (Rev1, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
Input #0, matroska,webm, from './file_example_WEBM_1920_3_7MB.webm':
  Metadata:
    ENCODER         : Lavf57.83.100
  Duration: 00:00:30.54, start: 0.000000, bitrate: 960 kb/s
  Stream #0:0: Video: vp8, yuv420p(progressive), 1920x1080, SAR 1:1 DAR 16:9, 30 fps, 30 tbr, 1k tbn, 1k tbc (default)
    Metadata:
      HANDLER_NAME    : L-SMASH Video Handler
      COMPATIBLE_BRANDS: mp42mp41isomavc1
      MAJOR_BRAND     : mp42
      MINOR_VERSION   : 0
      ENCODER         : Lavc57.107.100 libvpx
      DURATION        : 00:00:30.036000000
  Stream #0:1: Audio: vorbis, 48000 Hz, stereo, fltp (default)
    Metadata:
      HANDLER_NAME    : L-SMASH Audio Handler
      COMPATIBLE_BRANDS: mp42mp41isomavc1
      MAJOR_BRAND     : mp42
      MINOR_VERSION   : 0
      ENCODER         : Lavc57.107.100 libvorbis
      DURATION        : 00:00:30.543000000
Output #0, webm, to 'http://localhost:8080/publish/first?password=secret':
  Metadata:
    encoder         : Lavf58.76.100
  Stream #0:0: Video: vp8, yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 30 fps, 30 tbr, 1k tbn, 1k tbc (default)
    Metadata:
      HANDLER_NAME    : L-SMASH Video Handler
      COMPATIBLE_BRANDS: mp42mp41isomavc1
      MAJOR_BRAND     : mp42
      MINOR_VERSION   : 0
      ENCODER         : Lavc57.107.100 libvpx
      DURATION        : 00:00:30.036000000
  Stream #0:1: Audio: vorbis, 48000 Hz, stereo, fltp (default)
    Metadata:
      HANDLER_NAME    : L-SMASH Audio Handler
      COMPATIBLE_BRANDS: mp42mp41isomavc1
      MAJOR_BRAND     : mp42
      MINOR_VERSION   : 0
      ENCODER         : Lavc57.107.100 libvorbis
      DURATION        : 00:00:30.543000000
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
av_interleaved_write_frame(): Unknown errortime=00:00:00.00 bitrate=N/A speed=N/A
Error writing trailer of http://localhost:8080/publish/first?password=secret: Error number -10053 occurred
frame=   14 fps=0.0 q=-1.0 Lsize=      50kB time=00:00:00.43 bitrate= 941.4kbits/s speed=1.05x
video:82kB audio:0kB subtitle:0kB other streams:0kB global headers:4kB muxing overhead: unknown
[http @ 000002077444fa00] URL read error: Error number -10053 occurred
Conversion failed!

Stream-M and Wirecast 6.0.4

Hello,

I'd like to use Stream-M with Wirecast v6.0.4 (http://www.telestream.net/wirecast/overview.htm) but i have some issues.

I'm trying to deploy a Stream-M server on a first machine locally (with the IP : 10.0.0.1 and using "java -jar stream-m.jar server.properties" command) then i use Wirecast on another PC (ex : 10.0.0.2) and configure the connexion RTMP to broadcast the video stream with the following URI :
rtmp://10.0.0.1:8081/publish/?

But the broadcast doesn't work (the stream button blinked and displayed a connexion error) but i don't understand why because i can ping and i can reach my server from my browser with my 10.0.0.2 machine. I tried to telnet and it worked too.

When i try to broadcast the stream, the following error appears on my server console :
Exception in thread "Thread-10" java.lang.RuntimeException: java.net.SocketException: Connection reset
at org.czentral.util.stream.Feeder.feedTo(Feeder.java:78)
at org.czentral.minirtmp.MiniRTMP$Worker.run(MiniRTMP.java:95)
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:196)
at java.net.SocketInputStream.read(SocketInputStream.java:122)
at org.czentral.util.stream.Feeder.feedTo(Feeder.java:70)
... 1 more

I don't know what can i do to solve this problem :(
Do you guys have any problems like this using RTMP with Wirecast or another similar software ? Any ideas to help me ?

PS : Sorry for my bad english i'm french ^^

Connection reset

Connect RTMP from Wirecast
Exception in thread "Thread-2" java.lang.RuntimeException: java.net.SocketException: Connection reset
at org.czentral.util.stream.Feeder.feedTo(Feeder.java:78)
at org.czentral.minirtmp.MiniRTMP$Worker.run(MiniRTMP.java:95)
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:196)
at java.net.SocketInputStream.read(SocketInputStream.java:122)
at org.czentral.util.stream.Feeder.feedTo(Feeder.java:70)
... 1 more

is it possible to adjust the stream delay time

i wander if it is possible to change the delay of the stream?
right now it is about 15-20 sec between my camera move and I see the movement on webpage.
I don't mind to manually edit the code myself if you don't have time, as long as I know where to look for.

Gstreamer Pipeline

Instead of encoding with ffmpeg, does anyone have an example for a gstreamer pipeline, preferably using webM instead of H.264?

Connecting via RTMP

When I try to connect via RTMP to server I get:

sie 07, 2016 9:06:19 PM org.czentral.minirtmp.ApplicationContext processMessage
WARNING: /192.168.2.100:49347
java.lang.UnsupportedOperationException: Unknown type ID: 6
at org.czentral.minirtmp.AMFDecoder.readMixed(AMFDecoder.java:155)
at org.czentral.minirtmp.AMFDecoder.readObject(AMFDecoder.java:104)
at org.czentral.minirtmp.AMFDecoder.readMixed(AMFDecoder.java:148)
at org.czentral.minirtmp.ApplicationContext.readCommand(ApplicationContext.java:210)
at org.czentral.minirtmp.ApplicationContext.processMessage(ApplicationContext.java:153)
at org.czentral.minirtmp.ApplicationContext.processChunk(ApplicationContext.java:133)
at org.czentral.minirtmp.RTMPStreamProcessor.processPacket(RTMPStreamProcessor.java:211)
at org.czentral.minirtmp.RTMPStreamProcessor.process(RTMPStreamProcessor.java:75)
at org.czentral.util.stream.Feeder.feedTo(Feeder.java:56)
at org.czentral.minirtmp.MiniRTMP$Worker.run(MiniRTMP.java:96)

Exception in thread "Thread-10" java.lang.RuntimeException: java.lang.UnsupportedOperationException: Unknown type ID: 6
at org.czentral.minirtmp.ApplicationContext.processMessage(ApplicationContext.java:202)
at org.czentral.minirtmp.ApplicationContext.processChunk(ApplicationContext.java:133)
at org.czentral.minirtmp.RTMPStreamProcessor.processPacket(RTMPStreamProcessor.java:211)
at org.czentral.minirtmp.RTMPStreamProcessor.process(RTMPStreamProcessor.java:75)
at org.czentral.util.stream.Feeder.feedTo(Feeder.java:56)
at org.czentral.minirtmp.MiniRTMP$Worker.run(MiniRTMP.java:96)
Caused by: java.lang.UnsupportedOperationException: Unknown type ID: 6
at org.czentral.minirtmp.AMFDecoder.readMixed(AMFDecoder.java:155)
at org.czentral.minirtmp.AMFDecoder.readObject(AMFDecoder.java:104)
at org.czentral.minirtmp.AMFDecoder.readMixed(AMFDecoder.java:148)
at org.czentral.minirtmp.ApplicationContext.readCommand(ApplicationContext.java:210)
at org.czentral.minirtmp.ApplicationContext.processMessage(ApplicationContext.java:153)
... 5 more
Exception in thread "Thread-8" Exception in thread "Thread-9" Exception in thread "Thread-7" java.lang.NullPointerException
at org.czentral.minihttp.MiniHTTP$Worker.run(MiniHTTP.java:108)
java.lang.NullPointerException
at org.czentral.minihttp.MiniHTTP$Worker.run(MiniHTTP.java:108)
java.lang.NullPointerException
at org.czentral.minihttp.MiniHTTP$Worker.run(MiniHTTP.java:108)

stuck on publish

when im trying to acess
http://localhost:8080/publish/first?password=secret

the browser keeps loading infinitely

and terminal shows

processor finished
minihttp connection

How do i publish ?

Also im trying to stream using url

URL : rtmp://localhost:8081/publish/first?secret
Stream Key : [BLANK HERE]

Using OBS its stuck on connecting.
terminal shows processor finished

Access-Control-Allow-Origin Header Missing

Is there an option to allow Cross Origin Requests for the MediaSource player?

Access-Control-Allow-Origin: *

Alternatively, fetch multiple allowed domains from the server.properties file.

Partial header (buffered sample too small).

java.lang.RuntimeException: Partial header (buffered sample too small).
at org.czentral.incubator.streamm.EBMLElement.(EBMLElement.java:61)
at org.czentral.incubator.streamm.HeaderDetectionState.process(HeaderDetectionState.java:62)
at org.czentral.util.stream.Feeder.feedTo(Feeder.java:56)
at org.czentral.incubator.streamm.StreamInput.run(StreamInput.java:47)
at org.czentral.incubator.streamm.web.PublisherResource.serve(PublisherResource.java:98)
at org.czentral.minihttp.MiniHTTP$Worker.run(MiniHTTP.java:124)

using libav

avconv -re -i rtmp://localhost/live/test -vcodec libvpx -acodec libvorbis -s 320x240 -r 29.97 -threads 64 -f webm http://localhost:8090/publish/first?password=secret

avconv version 0.8.16-6:0.8.16-1, Copyright (c) 2000-2014 the Libav developers
built on Sep 16 2014 23:10:48 with gcc 4.7.2
Metadata:
Server NGINX RTMP (github.com/arut/nginx-rtmp-module)
width 1440.00
height 900.00
displayWidth 1440.00
displayHeight 900.00
duration 0.00
framerate 60.00
fps 60.00
videodatarate 250.00
videocodecid 0.00
audiodatarate 128.00
audiocodecid 0.00
profile
level
[flv @ 0x1e19b20] Estimating duration from bitrate, this may be inaccurate
Input #0, flv, from 'rtmp://localhost/live/test':
Duration: N/A, start: 1384.489000, bitrate: N/A
Stream #0.0: Video: h264 (High), yuv420p, 1440x900, 59.94 tbr, 1k tbn, 120 tbc
Stream #0.1: Audio: aac, 44100 Hz, stereo, s16
[buffer @ 0x1e1efc0] w:1440 h:900 pixfmt:yuv420p
[scale @ 0x1efdb60] w:1440 h:900 fmt:yuv420p -> w:320 h:240 fmt:yuv420p flags:0x4
[libvpx @ 0x1e1e420] v1.1.0
Output #0, webm, to 'http://localhost:8090/publish/first?password=secret':
Metadata:
encoder : Lavf53.21.1
Stream #0.0: Video: libvpx, yuv420p, 320x240, q=-1--1, 200 kb/s, 1k tbn, 29.97 tbc
Stream #0.1: Audio: libvorbis, 44100 Hz, stereo, s16
Stream mapping:
Stream #0:0 -> #0:0 (h264 -> libvpx)
Stream #0:1 -> #0:1 (aac -> libvorbis)

I have to restart avconv over until I don't get that error and then things work until I need to restart avconv.

What other info do you need?

HTTPS

Can i use HTTPS protocol?

Buffer full (RuntimeException)

Maybe this issue is related to #3 ...

Trying to transcode a source multicast live stream to stream-m sometimes fails with the following error message; sometimes ffmpeg just freezes completly trying to push a frame to stream-m while stream-m starts using 100% of one cpu until I force a quit of stream-m.

stream-m output:

flo@[...]:~/stream-m$ java -jar ./stream-m.jar ./server.properties.sample
java.lang.RuntimeException: Buffer full
    at org.czentral.incubator.streamm.MatroskaFragment.appendBlock(MatroskaFragment.java:93)
    at org.czentral.incubator.streamm.MatroskaFragment.appendKeyBlock(MatroskaFragment.java:88)
    at org.czentral.incubator.streamm.StreamingState.process(StreamingState.java:139)
    at org.czentral.util.stream.Feeder.feedTo(Feeder.java:56)
    at org.czentral.incubator.streamm.StreamInput.run(StreamInput.java:50)
    at org.czentral.incubator.streamm.web.PublisherResource.serve(PublisherResource.java:98)
    at org.czentral.minihttp.MiniHTTP$Worker.run(MiniHTTP.java:124)

ffmpeg output:

flo@[...]:~/ffmpeg$ /opt/ffmpeg-git/bin/ffmpeg -i "udp://@239.100.0.3:1234?overrun_nonfatal=1&fifo_size=50000000" -map 0:0 -map 0:1 -deinterlace -aspect 16:9 -s 640x352 -async 1 -c:v libvpx -g 125 -b:v 1660k -quality realtime -cpu-used 2 -threads 2 -minrate 0k -maxrate 1880k -bufsize 8500k -qmin 10 -qmax 42 -lag-in-frames 8 -c:a libvorbis -ac 2 -ab 96k -ar 44100 -sn -f webm 'http://localhost:8080/publish/first?password=secret'
ffmpeg version N-71157-g7c6b043 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.7 (Debian 4.7.2-5)
  configuration: --prefix=/opt/ffmpeg-git --enable-gpl --enable-pthreads --enable-libx264 --enable-librtmp --enable-nonfree --enable-libmp3lame --enable-libfdk-aac --enable-openssl --enable-gnutls --enable-libvpx --enable-libvorbis
  libavutil      54. 21.100 / 54. 21.100
  libavcodec     56. 32.100 / 56. 32.100
  libavformat    56. 26.101 / 56. 26.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 13.101 /  5. 13.101
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
[mpeg2video @ 0x377b6c0] Invalid frame dimensions 0x0.
    Last message repeated 10 times
[mpegts @ 0x37545c0] Could not find codec parameters for stream 3 (Unknown: none ([5][0][0][0] / 0x0005)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x37545c0] Could not find codec parameters for stream 4 (Unknown: none ([11][0][0][0] / 0x000B)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpegts, from 'udp://@239.100.0.3:1234?overrun_nonfatal=1&fifo_size=50000000':
  Duration: N/A, start: 72718.371100, bitrate: N/A
  Program 32
    Metadata:
      service_name    : Das Erste
      service_provider: BR
    Stream #0:0[0x201]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv), 720x576 [SAR 64:45 DAR 16:9], max. 2692 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x202](deu): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s (clean effects)
    Stream #0:2[0x204](ger): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
    Stream #0:3[0x816]: Unknown: none ([5][0][0][0] / 0x0005)
    Stream #0:4[0x87c]: Unknown: none ([11][0][0][0] / 0x000B)
-async is forwarded to lavfi similarly to -af aresample=async=1:min_hard_comp=0.100000:first_pts=0.
[libvpx @ 0x377fea0] v1.3.0-5807-g0c85718
Output #0, webm, to 'http://localhost:8080/publish/first?password=secret':
  Metadata:
    encoder         : Lavf56.26.101
    Stream #0:0: Video: vp8 (libvpx), yuv420p, 640x352 [SAR 44:45 DAR 16:9], q=10-42, 1660 kb/s, 25 fps, 1k tbn, 25 tbc
    Metadata:
      encoder         : Lavc56.32.100 libvpx
    Stream #0:1(deu): Audio: vorbis (libvorbis), 44100 Hz, stereo, fltp, 96 kb/s (clean effects)
    Metadata:
      encoder         : Lavc56.32.100 libvorbis
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video (native) -> vp8 (libvpx))
  Stream #0:1 -> #0:1 (mp2 (native) -> vorbis (libvorbis))
Press [q] to stop, [?] for help
av_interleaved_write_frame(): Connection reset by peer6.44 bitrate=1187.4kbits/s
frame= 2632 fps= 26 q=0.0 Lsize=   15498kB time=00:01:46.48 bitrate=1192.4kbits/s
video:14258kB audio:1246kB subtitle:0kB other streams:0kB global headers:4kB muxing overhead: unknown
Conversion failed!

java version:

flo@[...]:~/ffmpeg$ java -version
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)

-Flo

OBS can't connect to stream-m server

Love the work being done on this, would like to contribute somehow, but the first step is to just get it running -

I've installed the JDK and netbeans, to compile the code. That part went well, and now I'm running a server with the default settings. I try and connect with OBS from windows to the server (also running on windows) and OBS fails to connect.

I am pointing OBS to http://localhost:8081/publish/first?password=secret
But according to the OBS log the connection fails, here's the relevant part

:24:32:   Interface: Software Loopback Interface 1 (type 24, 1073 mbps)

17:24:32: Completed handshake with http://localhost:8081/publish/first?password=secret in 3 ms.

17:24:42: Total frames encoded: 330, total frames duplicated: 1 (0.30%)

17:24:42: Total frames rendered: 355, number of late frames: 0 (0.00%) (it's okay for some frames to be late)

17:24:42: librtmp error: RTMPSockBuf_Fill, recv returned -1. GetSockError(): 10053 (An established connection was aborted by the software in your host machine.)

17:24:42: Connection to http://localhost:8081/publish/first?password=secret failed: Could not access the specified channel or stream key.  This could be because the key/channel is invalid, or because the server still thinks you are logged in.

17:24:42: 

17:24:42: RTMPSockBuf_Fill, recv returned -1. GetSockError(): 10053 (An established connection was aborted by the software in your host machine.)

17:24:42: 

17:24:42: ~RTMPPublisher: Packet flush completed in 0 ms

Happy to test whatever needed, though likely I am just plugging in settings incorrectly.

I have tried basically every variation I can think of to connect to with OBS, but none work

org.czentral.minirtmp.RtmpException: Missing previous chunk

Hello Varga Bence,

I am experimenting with stream-m. I installed latest 1.0-SNAPSHOT from https://github.com/vbence/stream-m/releases on a Windows PC and started it with the template properties file: "C:\Program Files\Java\jdk-15.0.1\bin\java" -jar stream-m-1.0-SNAPSHOT.jar server.properties

I got the univac example working and also publishing webm to port 8080. Now I am trying to get publishing h.264 to work.

When I run ffmpeg on Raspberry Pi as followes:
ffmpeg -f video4linux2 -s 320x240 -r 16 -i /dev/video0 -f oss
-g 52 -strict experimental -acodec aac -ab 56k -vcodec libx264 -vb 452k
-profile:v high -level 40 -r 16
-f flv "rtmp://serverhostname:8081/publish/first?secret"

On the server I get:
org.czentral.minirtmp.RtmpException: Missing previous chunk (chunkId: 57, type: 3)
at org.czentral.minirtmp.RtmpReader.read(RtmpReader.java:65)
at org.czentral.minirtmp.RTMPStreamProcessor.processPacket(RTMPStreamProcessor.java:95)
at org.czentral.minirtmp.RTMPStreamProcessor.process(RTMPStreamProcessor.java:75)
at org.czentral.util.stream.Feeder.feedTo(Feeder.java:54)
at org.czentral.minirtmp.MiniRTMP$Worker.run(MiniRTMP.java:94)

I also tried it on a Windows client with:
c:\ffmpeg\bin\ffmpeg -f dshow -s 320x240 -r 16 ^
-i video="Logitech QuickCam Pro 9000":audio="Microfoon (Pro 9000)" ^
-g 52 -strict experimental -acodec aac -ab 56k -vcodec libx264 -vb 452k ^
-profile:v high -pix_fmt yuv420p -level 40 -r 16 ^
-f flv "rtmp://serverhostname:8081/publish/first?secret"

I get the same error:
org.czentral.minirtmp.RtmpException: Missing previous chunk (chunkId: 53, type: 1)
at org.czentral.minirtmp.RtmpReader.read(RtmpReader.java:65)
at org.czentral.minirtmp.RTMPStreamProcessor.processPacket(RTMPStreamProcessor.java:95)
at org.czentral.minirtmp.RTMPStreamProcessor.process(RTMPStreamProcessor.java:75)
at org.czentral.util.stream.Feeder.feedTo(Feeder.java:54)
at org.czentral.minirtmp.MiniRTMP$Worker.run(MiniRTMP.java:94)

Am I doing something wrong?

Audio/video desync as time passes

Hello, vbence! First of all: thanks for this project, even though it's prototype it certainly works wonders!

However, once I start streaming after some time audio and video does desync: I believe audio gets behind the video, but I may need to test this a bit more. As for now I'd like to highlight this issue with somewhat vague info, but I am happy to help if there's need for any specific info (I glanced through the code myself but it seemed like "pieces" of videos [MovieFragments in your class nomenclature] do contain all the data and they are not separated streams but I didn't spend too much time on this).

Anyway:
Receiving end were PCs/laptops with Google Chrome v 96.0.4664.110 (yeah, I didn't check other browsers, just me and my "testers/watchers") - for most of the time refreshing the stream resolved problem for them for next 10 minutes or so.I verified this is also the case for me and refreshing did seem to help.

I was streaming using OBS using rtmp protocol, CBR 5000kbps 1080p with 30 frames (keyframe interval was set to 2, PC is rather hi-end with i9-9900k, so fully capable of streaming such content with very rare frame drops). I was streaming to localhost (so basically there's no latency between OBS sender and stream-m receiver) and I was having 3 people watching which shouldn't be an issue having 20mbps upload (saying "shouldn't", I didn't do any fancy stats.

Of course I am happy to help/log anything more if it's needed: I do have quite good java knowledge, just almost zero knowledge when it comes to encoding/streaming (I mostly do around other types of apps)

Once again, thanks a lot for your app!

Max browser numbers and IE

Hi, thanks for this good tool !
(1) I want to have a Stress Testing on my server hardware and network use stream-m ,an easy php code to open 10 video tags in one page, but only 6 success in one computer, i can keep open this page to more then 10 computers , always 6 video can load on page in each computer , i can't find any setting about this,and there is no any firewall or special network connection setting on server or client site, is there any way to load more tags in one page ?
----------------------------Stress Testing web page (remove some flag for display)

-----------------------------Ffmpeg command
./ffmpeg1 -i "rtmp://stream_source_url:1935/spliveorigin/Stream_REAL" -acodec libvorbis -ab 64k -vsync cfr -r 20 -vcodec libvpx -vb 448k -g 52 -lag-in-frames 1 -slices 4 -deadline realtime -bufsize 512 -f webm "http://10.10.10.1:8083/publish/first?password=secret"

(2) Same url open on IE , can't work , is that normal ?

Thanks for your help !

Contact and cooperation/help possibility?

Hi,

I'm not streaming specialist. My field of specialization is Lightning Network. My dream is to build open-source streaming service witch uses LN as default payment method. I would like to do this based on stream-m project, but it would require your help. Can we contact somehow to talk in real time about this?

Instructions

This is a great project; however, I have found some of the instructions, unclear/confusing/incorrect. I was not able to use the readme.md to successfully start a server. It also was not clear that apache ant is a requsite to build. Furthermore, ant requires a readme.txt and server.conf.sample. I renamed readme.md and server.properties.sample to satisfy those requirements. This produced the stream-m.jar, but I could not run the jar using the instructions given here.

I have been able to use the old zip file from 2012, but I wanted to use the latest code.

Unable to serialize filed

Hey,

first of all thanks for your wonderful open source streaming plugin. I tried to get this working with XSPLIT and OBS (the "new" one, latest official build for Windows). But I'm not very successful. On XSPLIT the rtmp does not work at all. I also tried OBS and had luck - the stream seems to work until the first client connects. I can see and hear 1 or 2 seconds of the video, after that it will freeze. If I reload the /consume/first URL directly in my browser, I see the same video snippet again. After that it stopped.

I got an error after the first client connected. Please have a look :)

server@1:~$ java -jar stream-m.jar server.properties
metadata: [@setDataFrame, onMetaData, {audiocodecid=mp4a, audiosamplerate=44100.0, width=1280.0, audiochannels=2.0, videodatarate=3500.0, videocodecid=avc1, fileSize=0.0, duration=0.0, height=720.0, audiodatarate=160.0, stereo=true, audiosamplesize=16.0, encoder=obs-output module (libobs version 0.10.1), framerate=30.0}]
Exception in thread "Thread-2" java.lang.RuntimeException: Unable to serialize filed [org.czentral.format.mp4.MovieDataBox#content].
        at org.czentral.data.binary.serializer.AnnotatedClass.serializeWithType(AnnotatedClass.java:116)
        at org.czentral.data.binary.serializer.AnnotatedClass.serialize(AnnotatedClass.java:66)
        at org.czentral.data.binary.serializer.GeneralSerializer.serializeWithType(GeneralSerializer.java:93)
        at org.czentral.data.binary.serializer.GeneralSerializer.serializeSingle(GeneralSerializer.java:70)
        at org.czentral.data.binary.serializer.GeneralSerializer.serialize(GeneralSerializer.java:59)
        at org.czentral.incubator.streamm.Mp4FragmentBuilder.build(Mp4FragmentBuilder.java:219)
        at org.czentral.incubator.streamm.PublisherAppInstance.mediaChunk(PublisherAppInstance.java:363)
        at org.czentral.minirtmp.ApplicationContext.processMessage(ApplicationContext.java:179)
        at org.czentral.minirtmp.ApplicationContext.processChunk(ApplicationContext.java:122)
        at org.czentral.minirtmp.RTMPStreamProcessor.processPacket(RTMPStreamProcessor.java:206)
        at org.czentral.minirtmp.RTMPStreamProcessor.process(RTMPStreamProcessor.java:75)
        at org.czentral.util.stream.Feeder.feedTo(Feeder.java:56)
        at org.czentral.minirtmp.MiniRTMP$Worker.run(MiniRTMP.java:95)
Caused by: java.lang.ArrayIndexOutOfBoundsException
        at java.lang.System.arraycopy(Native Method)
        at org.czentral.data.binary.serializer.ByteArraySliceSerializer.serialize(ByteArraySliceSerializer.java:41)
        at org.czentral.data.binary.serializer.GeneralSerializer.serializeWithType(GeneralSerializer.java:93)
        at org.czentral.data.binary.serializer.GeneralSerializer.serializeSingle(GeneralSerializer.java:70)
        at org.czentral.data.binary.serializer.GeneralSerializer.serialize(GeneralSerializer.java:54)
        at org.czentral.data.binary.serializer.AnnotatedClass.serializeWithType(AnnotatedClass.java:114)
        ... 12 more

Thanks for your help!

RTMP URL streamkey support

To work with Flash Media Encoder and Open Broadcaster to stream RTMP, they take two parameters URL & StreamKey. Usually StreamKey is appended to the URL. This works in nginx-rtmp but not stream-m, I've tried various combinations that should give the same results. Any way of making stream-m accept the StreamKey as the password instead of the query parameter?

Publish webcam video & audio to publish http endpoint

I'm working on a poc, where I need to publish and consume the webcam content in the browser.
I am collecting the webcam stream using Media API, and pushing the stream to the publish endpoint using AJAX POST request. But all my AJAX calls are staying in "pending" state. Please help me with how to make calls to publish endpoint.

Streaming RTMP from vlc

Hi,
I'm trying to use vlc to stream rtmp to stream-m. Unfortunately can't use ffmpeg due to a bug related to Logitech C920 (see http://stackoverflow.com/questions/30765700/ffserver-streaming-h-264-from-logitech-c920-without-re-encoding/30779835#30779835 )

When I try the below vlc streams to stream to stream-m running on a different server, stream-m shows:
Processor finished.
metadata: [@setDataFrame, onMetaData, {duration=0.0, videocodecid=7.0, framerate=30.0, width=1920.0, videodatarate=0.0, filesize=0.0, encoder=Lavf54.20.4, height=1088.0}]
Exception in thread "Thread-34" java.lang.ArrayIndexOutOfBoundsException: 1
at org.czentral.incubator.streamm.PublisherAppInstance.mediaChunk(PublisherAppInstance.java:295)
at org.czentral.minirtmp.ApplicationContext.processMessage(ApplicationContext.java:179)
at org.czentral.minirtmp.ApplicationContext.processChunk(ApplicationContext.java:129)
at org.czentral.minirtmp.RTMPStreamProcessor.processPacket(RTMPStreamProcessor.java:206)
at org.czentral.minirtmp.RTMPStreamProcessor.process(RTMPStreamProcessor.java:75)
at org.czentral.util.stream.Feeder.feedTo(Feeder.java:56)
at org.czentral.minirtmp.MiniRTMP$Worker.run(MiniRTMP.java:95)

VLC is called with:
cvlc v4l2:///dev/video0:chroma=h264:width=1920:height=1080 --sout '#standard{access=rtmp,mux=ffmpeg{mux=flv},dst=rtmp://10.65.xx.xx:8081/publish/first?secret}' -vvv

While vlc shows:
[0xb0300560] main input debug: 'v4l2:///dev/video0:chroma=h264:width=1920:height=1080' successfully opened
[0xb0300560] main input debug: Buffering 0%
[0xb0300560] main input debug: switching to sync mode
[0xb014c3b0] packetizer_h264 decoder debug: found NAL_SPS (sps_id=0)
[0xb014c3b0] packetizer_h264 decoder debug: found NAL_PPS (pps_id=0 sps_id=0)
[0xb0300560] main input debug: Buffering 10%
[0xb0100760] main stream output debug: adding a new sout input (sout_input:0xadc00538)
[0xb013cb28] main mux debug: adding a new input
[0xb013cb28] avformat mux debug: adding inputo
[0xb0300560] main input debug: Buffering 21%
[0xb0300560] main input debug: Buffering 33%
[0xb0300560] main input debug: Buffering 43%
[0xb0300560] main input debug: Buffering 54%
[0xb0300560] main input debug: Buffering 66%
[0xb0300560] main input debug: Buffering 77%
[0xb0300560] main input debug: Buffering 87%
[0xb0300560] main input debug: Buffering 99%
[0xb0300560] main input debug: Stream buffering done (331 ms in 331 ms)
[0xb0300560] main input debug: Decoder buffering done in 0 ms
[0xb013cb28] avformat mux debug: writing header
[flv @ 0xb013d180] Codec for stream 0 does not use global headers but container format requires global headers

And when loading http://xxxx.com:8080/consume/first it shows Stream Not Running

Any idea?

Using Wirecast to Publish Stream

Is there any documentation on how to setup Wirecast to publish stream to stream-m? Everything I've tried thus far fails to work. My last attempt was setting these fields in Wirecast:

Destination: RTMP Server
Address: rtmp://localhost:8081/publish
Stream: first
User Agent: Wirecast/FM 1.0

I set the credentials to the password, but do not specify a username. I am currently using Wirecast 6.0.6.

Invalid .jar

Hello,
it seems like neither the pre-release version "1.0-SNAPSHOT" downloaded from Github releases nor .jar file compiled myself is working.

Error:
no main manifest attribute, in stream-m-1.0-SNAPSHOT.jar

The old release "v0.2.2" seems fine.

Can you please have a look into it?

java.lang.RuntimeException / connection reset

Hi,
i try run stream-m - i unpack archive and run "java -jar stream-m.jar server.properties" (server.properties is default configuration, i do only copy server.properties.sample).

I try to connect from flash media encoder and ffmpeg, after i try connect, i get error:
root@debian-2gb-fra1-01:~# java -jar stream-m.jar server.properties Processor finished. Exception in thread "Thread-2" java.lang.RuntimeException: java.net.SocketException: Connection reset at org.czentral.util.stream.Feeder.feedTo(Feeder.java:81) at org.czentral.minirtmp.MiniRTMP$Worker.run(MiniRTMP.java:95) Caused by: java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:196) at java.net.SocketInputStream.read(SocketInputStream.java:122) at org.czentral.util.stream.Feeder.feedTo(Feeder.java:71) ... 1 more

Flash media encoder immediately shutdown.
I try too ffmpeg:
ffmpeg -re -i aaa.flv -f flv rtmp://46.101.226.239:8081/publish/testing

but i get too error...
on ffmpeg side:

rtmp server sent error
RTMP_ReadPacket, failed to read RTMP packet header
rtmp://46.101.226.239:8081/publish/testing: Operation not permitted

on stream-m server side:
Processor finished.
Processor finished.
Processor finished.
Processor finished.
Processor finished.
Processor finished.
Processor finished.
Processor finished.
Processor finished.
Processor finished.
Processor finished.
Processor finished.
Processor finished.
Processor finished.
Connection closed.

I run on debian linux - jessie - installed "openjdk-7-jre openjdk-7-jre default-jre default-jre-headless" packages.

Can you have any tips, please? Thx

Trying to interpret packet with incomplete header (typically on closed connection)

Should return immediately if not enough bytes are available in the buffer.

Exception in thread "Thread-3" java.lang.RuntimeException: Resource limit reached: message too large (3088456 > 4096).
    at org.czentral.minirtmp.ApplicationContext.processChunk(ApplicationContext.java:107)
    at org.czentral.minirtmp.RTMPStreamProcessor.processPacket(RTMPStreamProcessor.java:202)
    at org.czentral.minirtmp.RTMPStreamProcessor.process(RTMPStreamProcessor.java:75)
    at org.czentral.util.stream.Feeder.feedTo(Feeder.java:56)
    at org.czentral.minirtmp.MiniRTMP$Worker.run(MiniRTMP.java:95)

Delay is tooo long

For example, ffserver webm http delay is about 4 secs,
stream-m delay is about 40 secs
with this ffmpeg settings:

ffmpeg -f video4linux2 -video_size 320x240  -i /dev/video0 -g 52 \
-acodec libvorbis -ab 64k \
-vcodec libvpx -vb 448k -cpu-used 4 -quality realtime -bufsize 512 \
-f webm -cluster_time_limit 1000 "http://localhost:8080/publish/first?password=secret"

Note: The bufsize option linearly reduce delay in case of ffserver scenario.
In case of stream-m this option has no effect.
Ho to reduce internal buffer sizes or counts?
What buffers can affect these parameters?

Live stream in firefox

I'm having problem playing stream in Firefox. Both http and rtmp streams are working great in Chrome, but in Firefox stream freezes after some time (approx. 1 min) and. You can see how it looks in this video here.

Windows DirectShow

The README has the following:

FFmpeg is great on multiplexing and output, but the windows version can not access DirectShow, which your sound card uses to give access to the microphone data.

This isn't accurate. FFmpeg can capture from any DirectShow accessible device. https://trac.ffmpeg.org/wiki/DirectShow

No issue

I opened this issue by mistake :P
Butterfingers!

Support for HLS?

like someone read on the issues tread, i had success streaming pre-recorded video clips using stream-m (in webm and h264-flv) but still working on feeding the server with hardware h264/aac encoded live video.

Today i tested the idea to use HLS instead of rtpm, and seems it works.

This ffmpeg command:
ffmpeg -y -re -f mpegts -i /dev/video0 -c:v copy -c:a copy -f hls test.m3u8

generates a bunch of test#.ts files and a plain text file (named test.m3u8) that summarize the ts franctions and the order to playback.

VLC plays ok all the clips and also the m3u8 ... so the question is ... Could be an option to add HLS to stream-m?

cheers.

Federico

how to run on a debian wheezy headless server?

hello, i'm a real nub in the java enviroment, so i had some question to avoid making some mess.
I run a VPS where an icecast2 provide audio streaming to clients.

Now i wish to expand the server and add video features.

Stream-m seems to be interesting so i dig the weeb for an open source video streaming server that handles h264 content (i got video from an hauppauge hd pvr h264 hardware capture card).

The question is: what i had to install in the server to compile/run stream-m?

thanks a lot,

Federico

SHORT_HEAD_WITHOUT_HISTORY. Error message

The file(output.webm) can play via VLC.
I test

D:\ffmpeg-20150806-git-8024002-win64-static\bin>ffmpeg.exe -re -i output.webm -v
codec copy -acodec copy -f webm http://localhost:8081/publish/first?password=sec
ret

I can see the fragment stream to server

Output #0, webm, to 'http://localhost:8081/publish/first?password=secret':
Metadata:
encoder : Lavf56.40.101
Stream #0:0: Video: vp8, yuv420p, 320x240 [SAR 1:1 DAR 4:3], q=2-31, 30 fps,
30 tbr, 1k tbn, 1k tbc (default)
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame= 17 fps=0.0 q=-1.0 size= 0kB time=00:00:00.53 bitrate= 6.6kbits/
frame= 32 fps= 32 q=-1.0 size= 33kB time=00:00:01.03 bitrate= 257.6kbits/
frame= 47 fps= 31 q=-1.0 size= 33kB time=00:00:01.53 bitrate= 173.6kbits/
frame= 62 fps= 31 q=-1.0 size= 45kB time=00:00:02.03 bitrate= 181.6kbits/
frame= 77 fps= 31 q=-1.0 size= 45kB time=00:00:02.53 bitrate= 145.8kbits/
frame= 92 fps= 31 q=-1.0 size= 45kB time=00:00:03.03 bitrate= 121.8kbits/
frame= 107 fps= 30 q=-1.0 size= 70kB time=00:00:03.53 bitrate= 161.8kbits/
frame= 123 fps= 31 q=-1.0 size= 70kB time=00:00:04.06 bitrate= 140.6kbits/

but in server console,I get below error message

Exception in thread "Thread-10" java.lang.RuntimeException: Unsupported feature
encountered: SHORT_HEAD_WITHOUT_HISTORY.

How can I fix this issue?

Stuck at 4-5 seconds

Im streaming with obs . is the error im getting.
Im able to view only 4-5 seconds of streaming in http://localhost:8080/consume/first.
im streaming through obs rtmp.
After 5 seconds the video is ended and stuck (no error on console either)

Im not doing anything with ffmpeg. Do i need to use ffmpeg ? ( if i dont want to store the streamed recording)

screenshot from 2017-02-04 21-07-53

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.