const shell = require("shelljs");
const processShell = shell.exec(
`ffmpeg -i "https://pull-hls-l1-va01.tiktokcdn.com/game/stream-2998227837016342624_or4/playlist.m3u8?expire=1728613179&session_id=000-20240927021937E401758EF5D00A0AC325&sign=7aeab541c3ef8072d52a9fe799f8692b" -movflags use_metadata_tags -map_metadata 0 -metadata title="Chill chill kiếm kèo Warthunder" -metadata artist="bacgaucam" -metadata year="2024" -c copy "downloads/bacgaucam-927202491939.mp4" -n -stats -hide_banner -loglevel error`,
{ async: true }
);
setTimeout(() => {
// processShell.kill();
process.exit();
}, 20000);
我的视频仅在我使用 Ctrl+C 停止时才有效。我尝试过使用
process.exit()
、.kill(pid, "SIGINT")
和 .kill()
参考文献中的 shell.exec()
方法,但它们都不起作用
有人可以帮忙吗?谢谢!
const shell = require("shelljs");
shell.exec(
`ffmpeg -i "https://pull-hls-l1-va01.tiktokcdn.com/game/stream-2998227837016342624_or4/playlist.m3u8?expire=1728613179&session_id=000-20240927021937E401758EF5D00A0AC325&sign=7aeab541c3ef8072d52a9fe799f8692b" -movflags use_metadata_tags -map_metadata 0 -metadata title="Chill chill kiếm kèo Warthunder" -metadata artist="bacgaucam" -metadata year="2024" -c copy "downloads/bacgaucam-927202491939.mp4" -n -stats -hide_banner -loglevel error`,
{ async: true }
);
setTimeout(() => {
shell.exit(1);
}, 20000);