Open qiangshushu opened 5 years ago
rtmp
is probably the wrong protocol. the included relay listens for HTTP, not another protocol like RTMP.
For what it's worth, we had a lot of luck+success creating a TCP "sub server" in node which ffmpeg
pipes to as a child process we spawn. You can tell ffmpeg to pipe to a TCP connection via tcp://localhost:8080
as the last parameter instead of http:
or rmtp:
I get the same problem! but there is only one thing different from up.
And I don't konw how to do with it! crying for help
Would it be possible to use only one instance of ffmpeg? Convert mp4 into mpegts stream:
ffmpeg -i /usr/local/src/videos/ychx.mp4 -f mpegts -codec:v mpegvideo1 -s 640x360 -q:v 10 http://localhost:8081/supersecret/640/360
My Steps:
convert mp4 to rtmp stream
ffmpeg -re -i /usr/local/src/videos/ychx.mp4 -vcodec libx264 -vprofile baseline -acodec aac -ar 44100 -strict -2 -ac 1 -f flv -s 512x214 -q 10 rtmp://localhost/rtmp1/test
run jsmpeg/websocket-relay.js
node websocket-relay.js supersecret 8081 8082
listen rtmp and pull to websocket 8081
ffmpeg -re -i rtmp://localhost/rtmp1/test -f mpegts http://localhost:8081/supersecret/640/360
start jsmpeg/view-stream.html
http-server
everything is fine, but the browser gives an error, and video flower screen.
Uncaught RuntimeError: memory access out of bounds