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

ffmpeg electron #119

Open
Jinghao1209 opened this issue Feb 8, 2022 · 12 comments
Open

ffmpeg electron #119

Jinghao1209 opened this issue Feb 8, 2022 · 12 comments

Comments

@Jinghao1209
Copy link

操作系统:macOS
作者大大,刚刚看到你的扩展想下载,下载了发现:Please interact with the document first otherwise play() will failed
看了一下,这是很正常的,所以我去了github.com/electron/electron的releases下载了我的vscode的electron版本13.5.2
问题来了,看了你的ffmpeg manual replace,想问下之后该怎么做呢?./Electron.app/Contents/Frameworks/Electron\ Framework.framework/Libraries/libffmpeg.dylib你的这个位置是指哪里呢?是指/Applications/Visual\ Studio\ Code.app/Contents/Frameworks/Electron\ Framework.framework/Libraries/下的libffmpeg.dylib吗?
我有去查了一下,vscode内建是没有ffmpeg的,所以我把下载下来的libffmpeg拖进那个地方,结果再次打开vscode时就被系统报错了,什么原因呢?就算把libffmpeg删除也无济于事......我就卡在这里了......(vscode我删除了,再下载过,默默的等待你的教学😂

@nondanee
Copy link
Owner

nondanee commented Feb 9, 2022

对的,就是用下载下来的 dylib 替换 vscode 里的 dylib

Electron.app/Contents/Frameworks/Electron\ Framework.framework/Libraries/libffmpeg.dylib

/Applications/Visual\ Studio\ Code.app/Contents/Frameworks/Electron\ Framework.framework/Libraries/libffmpeg.dylib

vscode 目录里是有这个文件的

替换后打不开 vscode 是签名问题,README 里有注明

VS Code for macOS 1.43+ 替换后闪退解决方案

@nondanee
Copy link
Owner

nondanee commented Feb 9, 2022

还是推荐用脚本自动替换

发现脚本有点问题,已经修好了

@Jinghao1209
Copy link
Author

新问题出现:闪退

$ ~ curl https://gist.githubusercontent.com/nondanee/f157bbbccecfe29e48d87273cd02e213/raw | python
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3528  100  3528    0     0  44467      0 --:--:-- --:--:-- --:--:-- 49000
vscode 1.64.1 arm64
electron 13.5.2
download well
replace done
remove temp

这样,之后没有报错,可是闪退了,加了这个东东进去~/.zshrc,后,再:

$ ~ code .
/usr/local/bin/code: line 10: 17790 Killed: 9               ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" --ms-enable-electron-run-as-node "$@"

无效....

@nondanee
Copy link
Owner

清除签名的代码执行一次就行了,不用加在 zshrc 里,要用管理员权限运行

@Jinghao1209
Copy link
Author

还是不可以....

#!/bin/bash
# filename: bash.bash

export VSCODE_INSTALLATION="/Applications/Visual Studio Code.app"
codesign --remove-signature "$VSCODE_INSTALLATION/Contents/MacOS/Electron"
codesign --remove-signature "$VSCODE_INSTALLATION/Contents/Frameworks/Code Helper.app"
codesign --remove-signature "$VSCODE_INSTALLATION/Contents/Frameworks/Code Helper (Renderer).app"
codesign --remove-signature "$VSCODE_INSTALLATION/Contents/Frameworks/Code Helper (GPU).app"

步骤

  1. Reinstall visual studio code and drag into /Applications folder
  2. Run command curl https://gist.githubusercontent.com/nondanee/f157bbbccecfe29e48d87273cd02e213/raw | python
  3. Run command sudo bash bash.bash
  4. Close and open again VS Code

Alert crash.

窗口已崩溃(原因:“crashed”,代码:“6”)
我们对此不便表示抱歉! 请重启该窗口以从上次停止的位置继续。

然后我退出程序再打开: 应用程序“Visual Studio Code.app”无法打开。

是我哪里做错了吗?

@nondanee
Copy link
Owner

啊这,m1 芯片我没试过,可能是有问题,等周一借同事电脑看看

你可以试试把把 vscode 里所有内容都 codesign --remove-signature

@Jinghao1209
Copy link
Author

好的,把他全部codesign --remove-signature这个不知道怎么做,等你~ (´ . .̫ . `)

@Jinghao1209
Copy link
Author

有进展了吗?

@nondanee
Copy link
Owner

搞忘了,下周一定 QAQ

@nondanee
Copy link
Owner

在 m1 的机器上试了下,真的不行

只要执行了 --remove-signature 就会报错无法打开,不知道是不是系统的问题,我自己在 Big Sur 上是可以的

看来得想别的办法了,但是我太菜了,我只会用 webview 播放

你用大佬做得这个吧,他这个不依赖 webview 的 https://github.com/YXL76/cloudmusic-vscode

@Jinghao1209
Copy link
Author

好可惜ouo.....

@liudonghua123
Copy link

现在应该不需要了, vscode 新版本已经集成了 ffmpeg

image

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

3 participants