Streampunk / beamcoder

Node.js native bindings to FFmpeg.
GNU General Public License v3.0
397 stars 76 forks source link

flv and rtmp #61

Closed felicemarra closed 3 years ago

felicemarra commented 3 years ago

Anyone tried to mux in flv format and stream to rtmp? (like facebook & youtube) Any example?

Rock-N-Troll commented 3 years ago

Stream to RTP works. This is how I'm currently handling it locally (so it works at least that much).

Once you have a video outputting correctly to a file in flv format, something like this should work when you swap out the video output file:

var mux = beamcoder.muxer({ vsync: 0, tune: 'zerolatency', format_name: 'flv', flags: 'low_delay', fflags: 'flush_packets'});

await mux.openIO({
     //url: 'file:testFLV.flv'
     url: 'rtmp://localhost/live/teststream'
});

await mux.writeHeader();