微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

FFMPEG,macOS Catalina:“ffmpeg stderr:/private/tmp/com.apple.launchd.ID/org.macosforge.xquartz:0:套接字不支持操作”

如何解决FFMPEG,macOS Catalina:“ffmpeg stderr:/private/tmp/com.apple.launchd.ID/org.macosforge.xquartz:0:套接字不支持操作”

我正在尝试使用 FFMPEG 记录 selenium 测试运行,以对 Web 扩展(selenium+js/ts)进行自动化测试。 命令发起的FFMPEG:

    const { spawn } = require("child_process");
        ffmpeg = spawn("ffmpeg",[
          "-x265-params","-f","xcbgrab","-video_size","1280x1024","-i",process.env.disPLAY,// "/private/tmp/com.apple.launchd.ID/org.macosforge.xquartz:0"
          "-loglevel","debug","-y","-pix_fmt","yuv420p",videoPath,]);

不断返回错误,与process.disPLAY有关,我不知道为什么会这样:

    ffmpeg stderr: /private/tmp/com.apple.launchd.W851FkeNXz/org.macosforge.xquartz:0: Operation not supported on socket

完整的调试登录是:

ffmpeg stderr: ffmpeg version 4.3.1 copyright (c) 2000-2020 the FFmpeg developers
ffmpeg stderr:   built with Apple clang version 12.0.0 (clang-1200.0.32.28)
ffmpeg stderr:   configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3.1_9 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolBox --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack
ffmpeg stderr: libavutil      56. 51.100 / 56. 51.100
ffmpeg stderr:   libavcodec     58. 91.100 / 58. 91.100
ffmpeg stderr:   libavformat    58. 45.100 / 58. 45.100
ffmpeg stderr:   libavdevice    58. 10.100 / 58. 10.100
ffmpeg stderr:   libavfilter     7. 85.100 /  7. 85.100
ffmpeg stderr:   libavresample   4.  0.  0 /  4.  0.  0
ffmpeg stderr:   libswscale      5.  7.100 /  5.  7.100
ffmpeg stderr:   libswresample   3.  7.100 /  3.  7.100
ffmpeg stderr:   libpostproc    55.  7.100 / 55.  7.100
ffmpeg stderr: Splitting the commandline.
ffmpeg stderr: Reading option '-x265-params' ...
ffmpeg stderr: matched as AVOption 'x265-params' with argument '-f'.
ffmpeg stderr: Reading option 'xcbgrab' ...
ffmpeg stderr: matched as output url.
ffmpeg stderr: Reading option '-video_size' ...
ffmpeg stderr: matched as AVOption 'video_size' with argument '1280x1024'.
ffmpeg stderr: Reading option '-i' ... matched as input url with argument '/private/tmp/com.apple.launchd.W851FkeNXz/org.macosforge.xquartz:0'.
ffmpeg stderr: Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
ffmpeg stderr: Reading option '-y' ...
ffmpeg stderr: matched as option 'y' (overwrite output files) with argument '1'.
ffmpeg stderr: Reading option '-pix_fmt' ... matched as option 'pix_fmt' (set pixel format) with argument 'yuv420p'.
ffmpeg stderr: Reading option '/Volumes/MacHD2/Upprojects/TEST/log/Checkout-Google.com-Search-on-Google.mp4' ... matched as output url.
ffmpeg stderr: Finished splitting the commandline.
ffmpeg stderr: Parsing a group of options: global .
ffmpeg stderr: Applying option loglevel (set logging level) with argument debug.
ffmpeg stderr: Applying option y (overwrite output files) with argument 1.
ffmpeg stderr: Successfully parsed a group of options.
ffmpeg stderr: Parsing a group of options: input url /private/tmp/com.apple.launchd.W851FkeNXz/org.macosforge.xquartz:0.
ffmpeg stderr: Successfully parsed a group of options.
ffmpeg stderr: opening an input file: /private/tmp/com.apple.launchd.W851FkeNXz/org.macosforge.xquartz:0.
ffmpeg stderr: [NULL @ 0x7fcf80016800] opening '/private/tmp/com.apple.launchd.W851FkeNXz/org.macosforge.xquartz:0' for reading
ffmpeg stderr: [file @ 0x7fcf7f507a00] Setting default whitelist 'file,crypto,data'
ffmpeg stderr: /private/tmp/com.apple.launchd.W851FkeNXz/org.macosforge.xquartz:0: Operation not supported on socket

感谢任何反馈

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。