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

vscode 1.43.0 Mac版本替换ffmpeg之后闪退 #86

Open
laofangxose opened this issue Mar 18, 2020 · 11 comments
Open

vscode 1.43.0 Mac版本替换ffmpeg之后闪退 #86

laofangxose opened this issue Mar 18, 2020 · 11 comments
Labels
common Helpful tips for freshman enhancement New feature or request help wanted Extra attention is needed

Comments

@laofangxose
Copy link

感谢作者的付出!
环境:macOS Mojave 10.14.6
升级到vscode 1.43.0 + electron 7.1.7版本,利用自动脚本替换ffmpeg之后,会导致整个vscode卡死并闪退
之前的Vscode 1.42.1 + electron 6.1.6版本一切正常

@nondanee
Copy link
Owner

不好意思比较忙
我试了下 1.43.1 版本没问题,脚本替换的,你试试看

可能是网络原因,下载或替换的文件有问题
要是真的由于 vscode electron 版本有对应 dll 的限制导致闪退了我也没辙啊 (只能放弃) ==

@laofangxose
Copy link
Author

感谢!
升级到1.43.1还是不行,大概不是插件的问题。我还是先用老版本吧。
最新测试条件:
Version: 1.43.1
Commit: fe22a9645b44368865c0ba92e2fb881ff1afce94
Date: 2020-03-18T07:01:41.240Z
Electron: 7.1.11
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Darwin x64 18.7.0

@nondanee nondanee added the common Helpful tips for freshman label Mar 25, 2020
@nondanee nondanee reopened this Mar 25, 2020
@nondanee
Copy link
Owner

我看了下同事的错误信息是签名验证失败

Exception Type:        EXC_BAD_ACCESS (Code Signature Invalid)
Exception Codes:       0x0000000000000032, 0x000000010f4b6000
Exception Note:        EXC_CORPSE_NOTIFY
......
Application Specific Information:
dyld: launch, loading dependent libraries
@rpath/libffmpeg.dylib  Thread 0 Crashed: 
......

有几种可能

  • 是不是 electron 7 里的 dll 没签名?
    • 自己签可不可以?
    • 换用 electron 6/8 的 dll 可不可以?

可以看下 https://www.cnblogs.com/csuftzzk/p/macos_code_signature_invalid.html

  • dll 有签名但合 vscode 签名对不上?(如果是这样就凉了)
    • 关闭 SIP 后可不可以?

@nondanee
Copy link
Owner

搜了下可能和这个事情有关
https://www.theregister.co.uk/2020/03/10/visual_studio_code_apple_notarisation

看了签名指南发现自己签名我都测试不了 (没 developer 账号)
https://github.com/electron/electron/blob/master/docs/tutorial/mac-app-store-submission-guide.md

试了下关闭 sip 可以使用

这个问题得改实现方式了,就调用本地 chrome/edge (headless) 来播放

现在应急方案就是关闭 sip 或者用老版本吧,我尽快修

@nondanee nondanee added the help wanted Extra attention is needed label Mar 30, 2020
@nondanee nondanee added the enhancement New feature or request label Apr 12, 2020
@nondanee
Copy link
Owner

查过了是脚本替换的问题,手动替换没问题,已经修了
调用本地 chrome 的 feature 还是之后再做hhhh~~~

@yliu342
Copy link

yliu342 commented Oct 1, 2020

试了下自签名依然会闪退。错误信息是签名不匹配

@hzfmer
Copy link

hzfmer commented Nov 8, 2020

我也有这个问题,用了 automatic script 之后,显示 ffmpeg 签名有问题,然后 Electron 似乎也不对,VSCode 就再也打不开了。手动下载的话,我的 electron 是在 anaconda 里面,似乎挪过去也没用。暂时先不试了,以免又得重装 VSCode。。

提一个小建议,doc里面的

https://raw.githubusercontent.com/Microsoft/vscode/%version%/.yarnrc 查看其使用的 Electron 版本,并于 https://github.com/electron/electron/releases/tag/%version% 下载对应的 Electron 完整版本进行替换

这里的 %version% 对 VSCode 来说是 1.51.0 这种,对 Electron 来说应该是 v9.3.3这种,有些人可能不清楚 version 具体指的什么(比如有没有 v),就不好手动下载了。可以给一个具体的例子说明一下。

@willin
Copy link

willin commented Jan 30, 2021

vsc crashed (vsc 1.15.2, electron 9.3.5)

@nondanee
Copy link
Owner

看别人分享 M1 vscode 卡顿的问题解决方法时发现签名可以去掉
microsoft/vscode#107103 (comment)

之前试过去掉所有签名就可以启动了,就是比较暴力。。。
今天测了下去签名的最小集应该是这样

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"

This was referenced Feb 26, 2021
nondanee added a commit that referenced this issue Feb 26, 2021
@liudonghua123
Copy link

https://stackoverflow.com/questions/48321919/show-html5-video-on-previewhtml-command-in-vscode-extension/51735036#51735036

This is possible with VS Code 1.71+. This version of VS Code now includes support for the following formats/codecs:

  • Vorbis
  • Flac
  • H.264
  • VP8
  • WAV
  • MP3
  • Ogg

You should be able to include audio/video in those format just like you can on a normal webpage

For older versions of VS Code, this is not possible because VS Code uses a version of electron that does not include ffmpeg. That means that playback of many common media formats is not supported inside vscode, or inside its webviews. There are no plans to change this. (I am the developer of vscode's webview API)

You can try either finding a format that is supported (such as gifs or mjpegs for short clips) or use a library to play back the content in software.

(PS. Don't use vscode.previewHtml; use the proper webview API)

@fdy696
Copy link

fdy696 commented May 29, 2023

咋回退呀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
common Helpful tips for freshman enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

7 participants