Answer the question
In order to leave comments, you need to log in
How to remove delay when transferring mp4 video?
When using mpegts, there is no delay, but this format is not played by the browser. When using mp4, everything is fine, but there is a delay of 6 seconds between sending data on the tcp socket.
How to remove the delay? or what to do to make mpegts play in the browser?
Settings:
mp4:
ffmpeg -f gdigrab -framerate 30 -i desktop -c:v h264 -movflags frag_keyframe+empty_moov -f mp4 tcp://127.0.0.1:4444
ffmpeg -f gdigrab -framerate 30 -i desktop -c:v h264 -movflags frag_keyframe+empty_moov -f mpegts tcp://127.0.0.1:4444
let net = require("net");
let fs = require("fs");
let file = fs.createWriteStream("tcp.mp4");
let server = net.createServer(socket => {
socket.on("data", data => {
file.write(data);
//console.log(data)
console.log(fs.statSync("tcp.mp4").size)
})
})
server.listen(4444, "127.0.0.1");
Answer the question
In order to leave comments, you need to log in
Try to do this ..
Next to app.js, put a bat file with this code and start it, it instantly takes off for me.
I changed the codec to mpeg4 this is the main one.
@echo off
color a
start node app.js
set c=ffmpeg
set f=-f gdigrab -framerate 30 -rtbufsize 999999k -thread_queue_size 9999999 -indexmem 9999999 -i desktop -c:v mpeg4 -qscale:v 3 -movflags frag_keyframe+empty_moov -f mp4 tcp://127.0.0.1:4444
%c% %f%
exit
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question