|
@@ -82,12 +82,12 @@ server.on("connection", async (socket) => {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
// linux
|
|
// linux
|
|
|
- // exec(`ffmpeg -f -video_size 640x480 -i /dev/video0 -pix_fmt yuv420p -c h264 -cpu-used 10 -g 5 -preset ultrafast -tune zerolatency -f rtp rtp://127.0.0.1:${port}`, (error, stdout, stderr) => {
|
|
|
|
|
- // if (error) {
|
|
|
|
|
- // console.error(`exec error: ${error}`);
|
|
|
|
|
- // return;
|
|
|
|
|
- // }
|
|
|
|
|
- // })
|
|
|
|
|
|
|
+ exec(`ffmpeg -re -f -video_size 640x480 -i /dev/video0 -pix_fmt yuv420p -c h264_omx -vstats -cpu-used 10 -g 5 -preset ultrafast -tune zerolatency -f rtp rtp://127.0.0.1:${port}`, (error, stdout, stderr) => {
|
|
|
|
|
+ if (error) {
|
|
|
|
|
+ console.error(`exec error: ${error}`);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
|
|
|
udp.on("message", (data) => {
|
|
udp.on("message", (data) => {
|
|
|
const rtp = RtpPacket.deSerialize(data);
|
|
const rtp = RtpPacket.deSerialize(data);
|