phoboslab / jsmpeg

MPEG1 Video Decoder in JavaScript
MIT License
6.38k stars 1.43k forks source link

memory access out of bounds #264

Open qiangshushu opened 5 years ago

qiangshushu commented 5 years ago

My Steps:

  1. 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

  2. run jsmpeg/websocket-relay.js node websocket-relay.js supersecret 8081 8082

  3. listen rtmp and pull to websocket 8081 ffmpeg -re -i rtmp://localhost/rtmp1/test -f mpegts http://localhost:8081/supersecret/640/360

  4. 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 1544780112 1 1544780237 1

jadaradix commented 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:

Edassap commented 5 years ago

I get the same problem! but there is only one thing different from up.

  1. The local data(mp4 video) was directly pulled to http://localhost:8081/supersecret

And I don't konw how to do with it! crying for help

lthrhx commented 5 years ago

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