19.8 C
New York
Friday, September 20, 2024

ios – Unknown encoder ‘h264_videotoolbox’


I am going through a difficulty with FFmpeg on my iOS app. Once I use the mobile-ffmpeg-full-gpl pod, hardware-accelerated video encoding with h264_videotoolbox works completely. However, when I attempt to use a prebuilt FFmpeg binary, I obtain the next error:

Unknown encoder 'h264_videotoolbox'

I’ve created a construct script to compile FFmpeg for iOS with VideoToolbox help. Right here’s a portion of my configure command:

./configure 
  --cross-prefix="${HOST}-" 
  --sysroot="${SDK_PATH}" 
  --prefix="${FFMPEG_LIBRARY_PATH}" 
  --pkg-config="${HOST_PKG_CONFIG_PATH}" 
  --arch="${TARGET_ARCH}" 
  --cpu="${TARGET_CPU}" 
  --target-os=darwin 
  ${ASM_OPTIONS} 
  --ar="${AR}" 
  --cc="${CC}" 
  --cxx="${CXX}" 
  --as="${AS}" 
  --ranlib="${RANLIB}" 
  --strip="${STRIP}" 
  --nm="${NM}" 
  --extra-ldflags="$(get_min_version_cflags)" 
  --disable-autodetect 
  ${BUILD_LIBRARY_OPTIONS} 
  ${SIZE_OPTIONS} 
  --disable-xmm-clobber-test 
  ${DEBUG_OPTIONS} 
  --disable-neon-clobber-test 
  --enable-version3 
  --enable-gpl 
  --enable-nonfree 
  --enable-pic 
  --enable-static 
  --enable-videotoolbox 
  --enable-decoders 
  --enable-encoders 
  --enable-muxers 
  --enable-demuxers 
  --enable-parsers 
  --enable-protocols 
  --enable-filters 
  --enable-libx264 
  --enable-libx265 
  --enable-libvpx 
  --enable-libvorbis 
  --enable-libmp3lame 
  --enable-libopus 
  --enable-hwaccels 
  --enable-decoder=h264_videotoolbox 
  --enable-encoder=h264_videotoolbox 
  --enable-encoder=hevc_videotoolbox 
  ${CONFIGURE_POSTFIX} 1>>"${BASEDIR}"/construct.log 2>&1

I exploit the next command to execute in FFmpeg:

let command: [String] = [
    "-y",
    "-hide_banner",
    "-i", inputPath,
    "-c:v", "h264_videotoolbox",
    "-vf", "scale=1080:1920",
    "-acodec", "aac",
    outputPath
]

What is likely to be lacking in my construct configuration to trigger h264_videotoolbox to be unrecognized? Are there any particular steps to make sure that the VideoToolbox encoder is enabled correctly in a prebuilt FFmpeg binary for iOS?

Any options on fixing this difficulty can be appreciated!

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles