Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script not working on Windows with latest Node.js (18.7.0) #3

Closed
papaj-na-wrotkach opened this issue Aug 9, 2022 · 5 comments
Closed

Comments

@papaj-na-wrotkach
Copy link

File is not created after selecting a time range. Neither COPY nor ENCODE works.
Logged error:

[mpv_cut] node:fs:221
[mpv_cut]   let mode = stats[1];
[mpv_cut]                   ^
[mpv_cut]
[mpv_cut] TypeError: Cannot read properties of undefined (reading '1')
[mpv_cut]     at isFileType (node:fs:221:19)
[mpv_cut]     at readFileSync (node:fs:470:16)
[mpv_cut]     at parse_stdin (C:\Users\WDAGUtilityAccount\AppData\Roaming\mpv\scripts\mpv-cut\make_cuts:37:13)
[mpv_cut]     at main (C:\Users\WDAGUtilityAccount\AppData\Roaming\mpv\scripts\mpv-cut\make_cuts:65:17)
[mpv_cut]     at Object.<anonymous> (C:\Users\WDAGUtilityAccount\AppData\Roaming\mpv\scripts\mpv-cut\make_cuts:147:1)
[mpv_cut]     at Module._compile (node:internal/modules/cjs/loader:1120:14)
[mpv_cut]     at Module._extensions..js (node:internal/modules/cjs/loader:1174:10)
[mpv_cut]     at Module.load (node:internal/modules/cjs/loader:998:32)
[mpv_cut]     at Module._load (node:internal/modules/cjs/loader:839:12)
[mpv_cut]     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
[mpv_cut]
[mpv_cut] Node.js v18.7.0

OS: Windows 11 Enterprise Insider Preview 22H2 (build 25158.1000) [tried on actual Windows machine and Windows Sandbox VM - the same error]
Node.js: v18.7.0
FFmpeg: Latest Auto-Build (2022-08-09 12:37) ffmpeg-N-107736-g9e029dc265-win64-gpl.zip
Output of mpv -V:

mpv 0.34.0-395-g9add44b11a Copyright © 2000-2022 mpv/MPlayer/mplayer2 projects
 built on Sun Aug 07 12:25:20 2022
FFmpeg library versions:
   libavutil       57.32.101
   libavcodec      59.41.101
   libavformat     59.29.100
   libswscale      6.8.102
   libavfilter     8.46.101
   libswresample   4.8.100
FFmpeg version: git-2022-08-06-d93e29154
@familyfriendlymikey
Copy link
Owner

I would assume this is a problem with Win11 but it seems like this issue might be related and it's open from 2018.

I would test things myself but I don't think I can reproduce, since last time I tested it on my Win10 machine it worked fine. Could try playing with line ~39 in C:\Users\WDAGUtilityAccount\AppData\Roaming\mpv\scripts\mpv-cut\make_cuts:

let data = readFileSync(0,'utf8');

Maybe changing it to this is worth a shot:

let data = readFileSync(process.stdin.fd,'utf8');

If that doesn't work I can try making it async instead and push that for you to try.

@papaj-na-wrotkach
Copy link
Author

Changing line 37. to

let data = readFileSync(process.stdin.fd,'utf8');

didn't work. I would appreciate if you made it async so I can try it.

@familyfriendlymikey
Copy link
Owner

Thanks for trying.

I managed to reproduce. Doesn't seem to work for any version of Node on my Windows machine anymore, despite it working in the past, weird. Will probably fix it tonight one way or another.

@familyfriendlymikey
Copy link
Owner

Should be fixed now, just git pull and give it a shot. Though you made changes to a file, so you may have to git reset --hard in the mpv-cut repo to revert all changes before it lets you pull.

@papaj-na-wrotkach
Copy link
Author

Thank you, it's working fine now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants