无法在 nativescript 上安装 nativescript-ffmpeg-plugin
Can't install nativescript-ffmpeg-plugin on nativescript
运行 ns plugin add nativescript-ffmpeg-plugin
产生以下错误。
> nativescript-ffmpeg-plugin@0.0.2 postinstall /Users/.../websites/test/ffmpeg/node_modules/nativescript-ffmpeg-plugin
> node postinstall-hooks.js
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module 'nativescript-hook'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/Users/.../websites/test/ffmpeg/node_modules/nativescript-ffmpeg-plugin/postinstall-hooks.js:1:1)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
手动安装 nativescript-hook(即 npm i nativescript-hook --save-dev
)允许安装此插件,但尝试在 iOS 上构建应用程序失败并出现以下错误:
Undefined symbols for architecture x86_64:
"_CVPixelBufferRetain", referenced from:
_videotoolbox_decoder_callback in libavcodec.a(videotoolbox.o)
"_CVPixelBufferRelease", referenced from:
_videotoolbox_buffer_release in libavcodec.a(videotoolbox.o)
_ff_videotoolbox_uninit in libavcodec.a(videotoolbox.o)
_videotoolbox_decoder_callback in libavcodec.a(videotoolbox.o)
_videotoolbox_common_end_frame in libavcodec.a(videotoolbox.o)
"_CVPixelBufferPoolCreatePixelBuffer", referenced from:
_vtenc_send_frame in libavcodec.a(videotoolboxenc.o)
"_kCVImageBufferPixelAspectRatioHorizontalSpacingKey", referenced from:
_vtenc_create_encoder in libavcodec.a(videotoolboxenc.o)
"_kCVImageBufferPixelAspectRatioVerticalSpacingKey", referenced from:
_vtenc_create_encoder in libavcodec.a(videotoolboxenc.o)
"_kCVImageBufferGammaLevelKey", referenced from:
_vtenc_create_encoder in libavcodec.a(videotoolboxenc.o)
"_kCVPixelBufferWidthKey", referenced from:
_vtenc_configure_encoder in libavcodec.a(videotoolboxenc.o)
_videotoolbox_start in libavcodec.a(videotoolbox.o)
"_kCVPixelBufferHeightKey", referenced from:
_vtenc_configure_encoder in libavcodec.a(videotoolboxenc.o)
_videotoolbox_start in libavcodec.a(videotoolbox.o)
"_kCVImageBufferTransferFunction_UseGamma", referenced from:
_vtenc_configure_encoder in libavcodec.a(videotoolboxenc.o)
"_kCVImageBufferYCbCrMatrix_ITU_R_709_2", referenced from:
_vtenc_configure_encoder in libavcodec.a(videotoolboxenc.o)
"_kCVImageBufferTransferFunction_SMPTE_240M_1995", referenced from:
_vtenc_configure_encoder in libavcodec.a(videotoolboxenc.o)
"_kCVPixelBufferPixelFormatTypeKey", referenced from:
_avf_read_header in libavdevice.a(avfoundation.o)
_vtenc_configure_encoder in libavcodec.a(videotoolboxenc.o)
_videotoolbox_start in libavcodec.a(videotoolbox.o)
"_kCVImageBufferTransferFunction_ITU_R_709_2", referenced from:
_vtenc_configure_encoder in libavcodec.a(videotoolboxenc.o)
"_kCVImageBufferColorPrimaries_ITU_R_709_2", referenced from:
_vtenc_configure_encoder in libavcodec.a(videotoolboxenc.o)
"_kCVImageBufferYCbCrMatrix_SMPTE_240M_1995", referenced from:
_vtenc_configure_encoder in libavcodec.a(videotoolboxenc.o)
"_CVPixelBufferGetDataSize", referenced from:
_avf_read_packet in libavdevice.a(avfoundation.o)
"_CVPixelBufferGetPixelFormatType", referenced from:
_videotoolbox_common_end_frame in libavcodec.a(videotoolbox.o)
_vt_map_frame in libavutil.a(hwcontext_videotoolbox.o)
_videotoolbox_retrieve_data in MobileFFmpeg.a(libmobileffmpeg_la-fftools_ffmpeg_videotoolbox.o)
"_kCVPixelBufferOpenGLESCompatibilityKey", referenced from:
_videotoolbox_start in libavcodec.a(videotoolbox.o)
"_CVPixelBufferLockBaseAddress", referenced from:
_avf_read_packet in libavdevice.a(avfoundation.o)
_vtenc_send_frame in libavcodec.a(videotoolboxenc.o)
_vt_map_frame in libavutil.a(hwcontext_videotoolbox.o)
_videotoolbox_retrieve_data in MobileFFmpeg.a(libmobileffmpeg_la-fftools_ffmpeg_videotoolbox.o)
"_kCVImageBufferTransferFunctionKey", referenced from:
_vtenc_configure_encoder in libavcodec.a(videotoolboxenc.o)
"_CVPixelBufferIsPlanar", referenced from:
_avf_read_packet in libavdevice.a(avfoundation.o)
_vtenc_send_frame in libavcodec.a(videotoolboxenc.o)
_vt_map_frame in libavutil.a(hwcontext_videotoolbox.o)
_videotoolbox_retrieve_data in MobileFFmpeg.a(libmobileffmpeg_la-fftools_ffmpeg_videotoolbox.o)
"_kCVImageBufferYCbCrMatrixKey", referenced from:
_vtenc_configure_encoder in libavcodec.a(videotoolboxenc.o)
"_CVPixelBufferGetWidth", referenced from:
_avf_read_packet in libavdevice.a(avfoundation.o)
_videotoolbox_common_end_frame in libavcodec.a(videotoolbox.o)
_vt_map_frame in libavutil.a(hwcontext_videotoolbox.o)
"_CVPixelBufferGetBaseAddressOfPlane", referenced from:
_avf_read_packet in libavdevice.a(avfoundation.o)
_vtenc_send_frame in libavcodec.a(videotoolboxenc.o)
_vt_map_frame in libavutil.a(hwcontext_videotoolbox.o)
_videotoolbox_retrieve_data in MobileFFmpeg.a(libmobileffmpeg_la-fftools_ffmpeg_videotoolbox.o)
"_CVPixelBufferGetBytesPerRowOfPlane", referenced from:
_avf_read_packet in libavdevice.a(avfoundation.o)
_vtenc_send_frame in libavcodec.a(videotoolboxenc.o)
_vt_map_frame in libavutil.a(hwcontext_videotoolbox.o)
_videotoolbox_retrieve_data in MobileFFmpeg.a(libmobileffmpeg_la-fftools_ffmpeg_videotoolbox.o)
"_CVPixelBufferGetBytesPerRow", referenced from:
_avf_read_packet in libavdevice.a(avfoundation.o)
_vtenc_send_frame in libavcodec.a(videotoolboxenc.o)
_vt_map_frame in libavutil.a(hwcontext_videotoolbox.o)
_videotoolbox_retrieve_data in MobileFFmpeg.a(libmobileffmpeg_la-fftools_ffmpeg_videotoolbox.o)
"_CVPixelBufferGetBaseAddress", referenced from:
_avf_read_packet in libavdevice.a(avfoundation.o)
_vtenc_send_frame in libavcodec.a(videotoolboxenc.o)
_vt_map_frame in libavutil.a(hwcontext_videotoolbox.o)
_videotoolbox_retrieve_data in MobileFFmpeg.a(libmobileffmpeg_la-fftools_ffmpeg_videotoolbox.o)
"_CVPixelBufferGetHeight", referenced from:
_avf_read_packet in libavdevice.a(avfoundation.o)
_videotoolbox_common_end_frame in libavcodec.a(videotoolbox.o)
_vt_map_frame in libavutil.a(hwcontext_videotoolbox.o)
"_CVPixelBufferGetPlaneCount", referenced from:
_avf_read_packet in libavdevice.a(avfoundation.o)
_vtenc_send_frame in libavcodec.a(videotoolboxenc.o)
_vt_map_frame in libavutil.a(hwcontext_videotoolbox.o)
_videotoolbox_retrieve_data in MobileFFmpeg.a(libmobileffmpeg_la-fftools_ffmpeg_videotoolbox.o)
"_kCVImageBufferColorPrimariesKey", referenced from:
_vtenc_configure_encoder in libavcodec.a(videotoolboxenc.o)
"_kCVImageBufferYCbCrMatrix_ITU_R_601_4", referenced from:
_vtenc_configure_encoder in libavcodec.a(videotoolboxenc.o)
"_kCVPixelBufferIOSurfacePropertiesKey", referenced from:
_videotoolbox_start in libavcodec.a(videotoolbox.o)
"_CVPixelBufferUnlockBaseAddress", referenced from:
_avf_read_packet in libavdevice.a(avfoundation.o)
_vtenc_send_frame in libavcodec.a(videotoolboxenc.o)
_vt_map_frame in libavutil.a(hwcontext_videotoolbox.o)
_vt_unmap in libavutil.a(hwcontext_videotoolbox.o)
_videotoolbox_retrieve_data in MobileFFmpeg.a(libmobileffmpeg_la-fftools_ffmpeg_videotoolbox.o)
"_CVImageBufferGetEncodedSize", referenced from:
_avf_read_header in libavdevice.a(avfoundation.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我试过这个:
- Mac开发环境
- iOS 14
- 模拟器:iPhone8
Nativescript 详细信息:
- CLI: 7.0.8
- 跨平台模块:7.0.5
- 运行时间:7.0.0
- 插件:
"dependencies": {
"@nativescript/core": "~7.0.0",
"@nativescript/theme": "~2.3.0",
"nativescript-ffmpeg-plugin": "0.0.2",
"nativescript-vue": "~2.8.1"
},
"devDependencies": {
"@babel/core": "~7.11.6",
"@babel/preset-env": "~7.11.5",
"@nativescript/ios": "7.0.0",
"@nativescript/webpack": "~3.0.3",
"babel-loader": "~8.1.0",
"nativescript-hook": "^0.2.5",
"nativescript-vue-template-compiler": "~2.8.1",
"node-sass": "^4.14.1",
"vue-loader": "~15.9.3"
},
您可以通过执行以下操作轻松重现问题:
ns create ffmpeg --vue
cd ffmpeg
npm i nativescript-hook --save-dev
ns plugin add nativescript-ffmpeg-plugin
npm run debug-ios
有没有人最近成功安装了插件并且有解决这些问题的任何提示?
查看 nativescript-ffmpeg-plugin
问题和插件的最后修改,似乎不是 NS7 ready. try to downgrade to nativescript@6
or create a PR fot this plugin to make it compatible with NS7。
我安装了 nativescript-ffmpeg-plugin-fixed
,它在 NS7 上没有问题。
运行 ns plugin add nativescript-ffmpeg-plugin
产生以下错误。
> nativescript-ffmpeg-plugin@0.0.2 postinstall /Users/.../websites/test/ffmpeg/node_modules/nativescript-ffmpeg-plugin
> node postinstall-hooks.js
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module 'nativescript-hook'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/Users/.../websites/test/ffmpeg/node_modules/nativescript-ffmpeg-plugin/postinstall-hooks.js:1:1)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
手动安装 nativescript-hook(即 npm i nativescript-hook --save-dev
)允许安装此插件,但尝试在 iOS 上构建应用程序失败并出现以下错误:
Undefined symbols for architecture x86_64:
"_CVPixelBufferRetain", referenced from:
_videotoolbox_decoder_callback in libavcodec.a(videotoolbox.o)
"_CVPixelBufferRelease", referenced from:
_videotoolbox_buffer_release in libavcodec.a(videotoolbox.o)
_ff_videotoolbox_uninit in libavcodec.a(videotoolbox.o)
_videotoolbox_decoder_callback in libavcodec.a(videotoolbox.o)
_videotoolbox_common_end_frame in libavcodec.a(videotoolbox.o)
"_CVPixelBufferPoolCreatePixelBuffer", referenced from:
_vtenc_send_frame in libavcodec.a(videotoolboxenc.o)
"_kCVImageBufferPixelAspectRatioHorizontalSpacingKey", referenced from:
_vtenc_create_encoder in libavcodec.a(videotoolboxenc.o)
"_kCVImageBufferPixelAspectRatioVerticalSpacingKey", referenced from:
_vtenc_create_encoder in libavcodec.a(videotoolboxenc.o)
"_kCVImageBufferGammaLevelKey", referenced from:
_vtenc_create_encoder in libavcodec.a(videotoolboxenc.o)
"_kCVPixelBufferWidthKey", referenced from:
_vtenc_configure_encoder in libavcodec.a(videotoolboxenc.o)
_videotoolbox_start in libavcodec.a(videotoolbox.o)
"_kCVPixelBufferHeightKey", referenced from:
_vtenc_configure_encoder in libavcodec.a(videotoolboxenc.o)
_videotoolbox_start in libavcodec.a(videotoolbox.o)
"_kCVImageBufferTransferFunction_UseGamma", referenced from:
_vtenc_configure_encoder in libavcodec.a(videotoolboxenc.o)
"_kCVImageBufferYCbCrMatrix_ITU_R_709_2", referenced from:
_vtenc_configure_encoder in libavcodec.a(videotoolboxenc.o)
"_kCVImageBufferTransferFunction_SMPTE_240M_1995", referenced from:
_vtenc_configure_encoder in libavcodec.a(videotoolboxenc.o)
"_kCVPixelBufferPixelFormatTypeKey", referenced from:
_avf_read_header in libavdevice.a(avfoundation.o)
_vtenc_configure_encoder in libavcodec.a(videotoolboxenc.o)
_videotoolbox_start in libavcodec.a(videotoolbox.o)
"_kCVImageBufferTransferFunction_ITU_R_709_2", referenced from:
_vtenc_configure_encoder in libavcodec.a(videotoolboxenc.o)
"_kCVImageBufferColorPrimaries_ITU_R_709_2", referenced from:
_vtenc_configure_encoder in libavcodec.a(videotoolboxenc.o)
"_kCVImageBufferYCbCrMatrix_SMPTE_240M_1995", referenced from:
_vtenc_configure_encoder in libavcodec.a(videotoolboxenc.o)
"_CVPixelBufferGetDataSize", referenced from:
_avf_read_packet in libavdevice.a(avfoundation.o)
"_CVPixelBufferGetPixelFormatType", referenced from:
_videotoolbox_common_end_frame in libavcodec.a(videotoolbox.o)
_vt_map_frame in libavutil.a(hwcontext_videotoolbox.o)
_videotoolbox_retrieve_data in MobileFFmpeg.a(libmobileffmpeg_la-fftools_ffmpeg_videotoolbox.o)
"_kCVPixelBufferOpenGLESCompatibilityKey", referenced from:
_videotoolbox_start in libavcodec.a(videotoolbox.o)
"_CVPixelBufferLockBaseAddress", referenced from:
_avf_read_packet in libavdevice.a(avfoundation.o)
_vtenc_send_frame in libavcodec.a(videotoolboxenc.o)
_vt_map_frame in libavutil.a(hwcontext_videotoolbox.o)
_videotoolbox_retrieve_data in MobileFFmpeg.a(libmobileffmpeg_la-fftools_ffmpeg_videotoolbox.o)
"_kCVImageBufferTransferFunctionKey", referenced from:
_vtenc_configure_encoder in libavcodec.a(videotoolboxenc.o)
"_CVPixelBufferIsPlanar", referenced from:
_avf_read_packet in libavdevice.a(avfoundation.o)
_vtenc_send_frame in libavcodec.a(videotoolboxenc.o)
_vt_map_frame in libavutil.a(hwcontext_videotoolbox.o)
_videotoolbox_retrieve_data in MobileFFmpeg.a(libmobileffmpeg_la-fftools_ffmpeg_videotoolbox.o)
"_kCVImageBufferYCbCrMatrixKey", referenced from:
_vtenc_configure_encoder in libavcodec.a(videotoolboxenc.o)
"_CVPixelBufferGetWidth", referenced from:
_avf_read_packet in libavdevice.a(avfoundation.o)
_videotoolbox_common_end_frame in libavcodec.a(videotoolbox.o)
_vt_map_frame in libavutil.a(hwcontext_videotoolbox.o)
"_CVPixelBufferGetBaseAddressOfPlane", referenced from:
_avf_read_packet in libavdevice.a(avfoundation.o)
_vtenc_send_frame in libavcodec.a(videotoolboxenc.o)
_vt_map_frame in libavutil.a(hwcontext_videotoolbox.o)
_videotoolbox_retrieve_data in MobileFFmpeg.a(libmobileffmpeg_la-fftools_ffmpeg_videotoolbox.o)
"_CVPixelBufferGetBytesPerRowOfPlane", referenced from:
_avf_read_packet in libavdevice.a(avfoundation.o)
_vtenc_send_frame in libavcodec.a(videotoolboxenc.o)
_vt_map_frame in libavutil.a(hwcontext_videotoolbox.o)
_videotoolbox_retrieve_data in MobileFFmpeg.a(libmobileffmpeg_la-fftools_ffmpeg_videotoolbox.o)
"_CVPixelBufferGetBytesPerRow", referenced from:
_avf_read_packet in libavdevice.a(avfoundation.o)
_vtenc_send_frame in libavcodec.a(videotoolboxenc.o)
_vt_map_frame in libavutil.a(hwcontext_videotoolbox.o)
_videotoolbox_retrieve_data in MobileFFmpeg.a(libmobileffmpeg_la-fftools_ffmpeg_videotoolbox.o)
"_CVPixelBufferGetBaseAddress", referenced from:
_avf_read_packet in libavdevice.a(avfoundation.o)
_vtenc_send_frame in libavcodec.a(videotoolboxenc.o)
_vt_map_frame in libavutil.a(hwcontext_videotoolbox.o)
_videotoolbox_retrieve_data in MobileFFmpeg.a(libmobileffmpeg_la-fftools_ffmpeg_videotoolbox.o)
"_CVPixelBufferGetHeight", referenced from:
_avf_read_packet in libavdevice.a(avfoundation.o)
_videotoolbox_common_end_frame in libavcodec.a(videotoolbox.o)
_vt_map_frame in libavutil.a(hwcontext_videotoolbox.o)
"_CVPixelBufferGetPlaneCount", referenced from:
_avf_read_packet in libavdevice.a(avfoundation.o)
_vtenc_send_frame in libavcodec.a(videotoolboxenc.o)
_vt_map_frame in libavutil.a(hwcontext_videotoolbox.o)
_videotoolbox_retrieve_data in MobileFFmpeg.a(libmobileffmpeg_la-fftools_ffmpeg_videotoolbox.o)
"_kCVImageBufferColorPrimariesKey", referenced from:
_vtenc_configure_encoder in libavcodec.a(videotoolboxenc.o)
"_kCVImageBufferYCbCrMatrix_ITU_R_601_4", referenced from:
_vtenc_configure_encoder in libavcodec.a(videotoolboxenc.o)
"_kCVPixelBufferIOSurfacePropertiesKey", referenced from:
_videotoolbox_start in libavcodec.a(videotoolbox.o)
"_CVPixelBufferUnlockBaseAddress", referenced from:
_avf_read_packet in libavdevice.a(avfoundation.o)
_vtenc_send_frame in libavcodec.a(videotoolboxenc.o)
_vt_map_frame in libavutil.a(hwcontext_videotoolbox.o)
_vt_unmap in libavutil.a(hwcontext_videotoolbox.o)
_videotoolbox_retrieve_data in MobileFFmpeg.a(libmobileffmpeg_la-fftools_ffmpeg_videotoolbox.o)
"_CVImageBufferGetEncodedSize", referenced from:
_avf_read_header in libavdevice.a(avfoundation.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我试过这个:
- Mac开发环境
- iOS 14
- 模拟器:iPhone8
Nativescript 详细信息:
- CLI: 7.0.8
- 跨平台模块:7.0.5
- 运行时间:7.0.0
- 插件:
"dependencies": {
"@nativescript/core": "~7.0.0",
"@nativescript/theme": "~2.3.0",
"nativescript-ffmpeg-plugin": "0.0.2",
"nativescript-vue": "~2.8.1"
},
"devDependencies": {
"@babel/core": "~7.11.6",
"@babel/preset-env": "~7.11.5",
"@nativescript/ios": "7.0.0",
"@nativescript/webpack": "~3.0.3",
"babel-loader": "~8.1.0",
"nativescript-hook": "^0.2.5",
"nativescript-vue-template-compiler": "~2.8.1",
"node-sass": "^4.14.1",
"vue-loader": "~15.9.3"
},
您可以通过执行以下操作轻松重现问题:
ns create ffmpeg --vue
cd ffmpeg
npm i nativescript-hook --save-dev
ns plugin add nativescript-ffmpeg-plugin
npm run debug-ios
有没有人最近成功安装了插件并且有解决这些问题的任何提示?
查看 nativescript-ffmpeg-plugin
问题和插件的最后修改,似乎不是 NS7 ready. try to downgrade to nativescript@6
or create a PR fot this plugin to make it compatible with NS7。
我安装了 nativescript-ffmpeg-plugin-fixed
,它在 NS7 上没有问题。