簡體   English   中英

為 Mac OSX High Sierra 10.13 編譯 ffmpeg

[英]compiling ffmpeg for Mac OSX High Sierra 10.13

Hello I made an electron app that uses ffmpeg to combine audio and renders video, it works fine on windows, linux, and modern mac osx computers, but a user has reported to me that on an older version of mac osx such as High Sierra 10.13 ,我設置 ffmpeg 的方式不起作用。

我有一個帶有 High Sierra v10.13 的虛擬機,我從我的RenderTune 發布頁面安裝RenderTune-mac.dmg ,然后我從這個鏈接下載 2 個音頻文件和圖像。 我打開 RenderTune,然后嘗試渲染視頻。 我將音頻文件組合成單個 mp3 的命令工作正常,但是當我嘗試將該 mp3 與圖像文件組合時,我與 electron 應用程序打包的 ffmpeg 構建失敗並出現此錯誤:

Command was killed with SIGABRT (Aborted): /Applications/RenderTune.app/Contents/Resources/ffmpeg -loop 1 -framerate 2 -i /Users/martin/Downloads/R-3777978-1344032418-8379.jpeg.jpg -i /Users/martin/Downloads/output-871140.mp3 -y -acodec copy -b:a 320k -vcodec libx264 -b:v 8000k -maxrate 8000k -minrate 8000k -bufsize 3M -filter:v scale=w=1920:h=1954 -preset medium -tune stillimage -crf 18 -pix_fmt yuv420p -shortest /Users/martin/Downloads/concatVideo-871140.mp4
ffmpeg version git-2021-03-24-13335df Copyright (c) 2000-2021 the FFmpeg developers
  built with Apple LLVM version 10.0.1 (clang-1001.0.46.4)
  configuration: --pkgconfigdir=/Users/martinbarker/Documents/projects/rendertune-0.5.0/workspace/lib/pkgconfig --prefix=/Users/martinbarker/Documents/projects/rendertune-0.5.0/workspace --pkg-config-flags=--static --extra-cflags='-I/Users/martinbarker/Documents/projects/rendertune-0.5.0/workspace/include -mmacosx-version-min=10.10' --extra-ldflags='-L/Users/martinbarker/Documents/projects/rendertune-0.5.0/workspace/lib -mmacosx-version-min=10.10' --extra-libs='-lpthread -lm' --enable-static --disable-securetransport --disable-debug --disable-shared --disable-ffplay --disable-lzma --disable-doc --enable-version3 --enable-pthreads --enable-runtime-cpudetect --enable-avfilter --enable-filters --disable-libxcb --enable-gpl --enable-nonfree --disable-libass --enable-libfdk-aac --enable-libmp3lame --enable-libx264
  libavutil      56. 66.100 / 56. 66.100
  libavcodec     58.128.100 / 58.128.100
  libavformat    58. 69.100 / 58. 69.100
  libavdevice    58. 12.100 / 58. 12.100
  libavfilter     7.107.100 /  7.107.100
  libswscale      5.  8.100 /  5.  8.100
  libswresample   3.  8.100 /  3.  8.100
  libpostproc    55.  8.100 / 55.  8.100
Input #0, image2, from '/Users/martin/Downloads/R-3777978-1344032418-8379.jpeg.jpg':
  Duration: 00:00:00.50, start: 0.000000, bitrate: 1758 kb/s
  Stream #0:0: Video: mjpeg (Progressive), yuvj444p(pc, bt470bg/unknown/unknown), 590x600 [SAR 1:1 DAR 59:60], 2 fps, 2 tbr, 2 tbn, 2 tbc
Input #1, mp3, from '/Users/martin/Downloads/output-871140.mp3':
  Metadata:
    title           : My Little Grass Shack
    album           : Our Hawaii - A Collection Of Personal Favorites
    artist          : Society Of Seven
    track           : 11
    encoder         : Lavf58.69.100
  Duration: 00:06:25.59, start: 0.025057, bitrate: 320 kb/s
  Stream #1:0: Audio: mp3, 44100 Hz, stereo, fltp, 320 kb/s
    Metadata:
      encoder         : Lavc58.12
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
  Stream #1:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
[swscaler @ 0x7fbad9167600] deprecated pixel format used, make sure you did set range correctly
[libx264 @ 0x7fbad9040400] using SAR=2681/2679
dyld: lazy symbol binding failed: Symbol not found: ____chkstk_darwin
  Referenced from: /Applications/RenderTune.app/Contents/Resources/ffmpeg
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: ____chkstk_darwin
  Referenced from: /Applications/RenderTune.app/Contents/Resources/ffmpeg
  Expected in: /usr/lib/libSystem.B.dylib

    at makeError (/Applications/Render…eca/lib/error.js:59)
    at handlePromise (/Applications/Render…/execa/index.js:114)
    at async file:/Applicat…js/newindex.js:1323

這些文件將在 windows/linux 和最近的 mac 版本上正常呈現。 為了在 Mac 計算機上的 electron 應用程序中使用 package ffmpeg,我必須構建一個沒有動態鏈接庫的自定義沙盒版本。 我有一個 .sh 文件,它會自動下載 ffmpeg 並使用 mac 計算機的所有必要標志構建它。 https://github.com/MartinBarker/RenderTune/blob/master/buildffmpeg.sh在this.sh文件中是我使用這些標志編譯ffmpeg的地方:

./configure \
    --pkgconfigdir="$WORKSPACE/lib/pkgconfig" \
    --prefix=${WORKSPACE} \
    --pkg-config-flags="--static" \
    --extra-cflags="-I$WORKSPACE/include -mmacosx-version-min=${MACOS_MIN}" \
    --extra-ldflags="-L$WORKSPACE/lib -mmacosx-version-min=${MACOS_MIN}" \
    --extra-libs="-lpthread -lm" \
        --enable-static \
        --disable-securetransport \
        --disable-debug \
        --disable-shared \
        --disable-ffplay \
        --disable-lzma \
        --disable-doc \
        --enable-version3 \
        --enable-pthreads \
        --enable-runtime-cpudetect \
        --enable-avfilter \
        --enable-filters \
        --disable-libxcb \
        --enable-gpl \
        --enable-nonfree \
        --disable-libass \
        --enable-libfdk-aac \
        --enable-libmp3lame \
        --enable-libx264 

如果我嘗試在我的 High Sierra VM 中運行此腳本,則會失敗並顯示以下消息:

Unknown option "-extra-libs=-lpthread"

如果我刪除該標志,它會失敗並顯示不同的消息:

Unknown option "--enable-static"

我需要這個標志才能在 mac Apple Store 上發布我的 electron 應用程序,誰能幫我編譯 ffmpeg 的 static 版本?13 適用於現代 macos 1 等舊版本。

如果您支持多個操作系統及其各種版本,您將需要多個版本。 我通過編譯AdoptOpenJDK然后編譯FFmpeg 2.8在 High Sierra 10.13 上成功編譯了 FFmpeg 。 我手動使用自制軟件,現在將自動使用網絡請求下載 static 版本。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM