deviceClient.execOut not working?
Opened this issue · 1 comments
tiennguyen12g commented
Hello my friend
import pkg from "@u4/adbkit";
const { createClient,Utils,} = pkg
const utilRead = new Utils();
const adbClient = createClient();
(async () => {
const devices = await adbClient.listDevices();
if(!devices) return console.log("No device detect");
let deviceClient = devices[0].getClient();
let serial = devices[0].id;
console.log(serial);
deviceClient.framebuffer(serial,(err,raw) =>{
if(err) return console.log("Error at client.framebuffer:", err);
console.log(raw);
})
const getVideoBuffer = await deviceClient.execOut('screenrecord--output-format=h264 --size 720x1600', "base64");
console.log(getVideoBuffer)
})()
- At "deviceClient.framebuffer" it throw an error:
-node:events:491
throw er; // Unhandled 'error' event
^
Error: spawn gm ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:283:19)
at onErrorNT (node:internal/child_process:476:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
at ChildProcess._handle.onexit (node:internal/child_process:289:12)
at onErrorNT (node:internal/child_process:476:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -4058,
code: 'ENOENT',
syscall: 'spawn gm',
path: 'gm',
spawnargs: [ 'convert', '-size', '4608000x720', 'rgba:-', 'R9HT10C4V5X:-' ]
}
- At " console.log(getVideoBuffer)" it is log only "L3N5c3RlbS9iaW4vc2g6IHNjcmVlbnJlY29yZC0tb3V0cHV0LWZvcm1hdD1oMjY0OiBpbmFjY2Vzc2libGUgb3Igbm90IGZvdW5kCg==".
- If i change encoding to "utf8" it throw error :
/system/bin/sh: screenrecord--output-format=h264: inaccessible or not found
Question:
- How can I get frame video stream?
Thank all you
UrielCh commented
const getVideoBuffer = await deviceClient.execOut('screenrecord--output-format=h264 --size 720x1600', "base64");
is not
const getVideoBuffer = await deviceClient.execOut('screenrecord --output-format=h264 --size 720x1600', "base64");
needs a 👓 upgrade ....