holzschu / holzschu/a-Shell-commands
Addition of VideoToolbox hardware acceleration codecs in ffmpeg
- Dominant language
- Shell
- Stars
- 823
- Forks
- 47
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I've noticed when I was encoding a video and audio file together in a-Shell, it takes a bit of patience for it to finish and heats the device up considerably, which lead me into researching a bit more. Turns out ffmpeg does support hardware acceleration on iOS and it's called VideoToolbox. Here's more info from ffmpeg:
https://trac.ffmpeg.org/wiki/HWAccelIntro#VideoToolbox
As far as I can tell, a build of ffmpeg embedded within a-Shell has no ability of hardware acceleration. But, you can add `--enable-videotoolbox` flag in FFmpeg configure script to enable it.
`$ ffmpeg -h encoder=h264_videotoolbox`
`configuration: --cc=/Users/holzschu/src/Xcode_iPad/wasi-sdk/opt/bin/clang --ar=/Users/holzschu/src/Xcode
_iPad/wasi-sdk/opt/bin/ar --ranlib=/Users/holzschu/src/Xcode_iPad/wasi-sdk/opt/bin/ranlib --disable-asm --
enable-cross-compile --disable-avfoundation --disable-appkit --disable-network --disable-pthreads --disabl
e-debug --enable-libx264 --enable-gpl`
`Codec 'h264_videotoolbox' is not recognized by FFmpeg.`
Apparently you can check it in ./configure after running the build script:
https://github.com/kewlbear/FFmpeg-iOS-build-script/issues/58
Here's a build configuration example shared by devs of some app (just in case it helps):
https://medium.com/liveop-x-team/accelerating-h264-decoding-on-ios-with-ffmpeg-and-videotoolbox-1f000cb6c549
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.