Mobile-ffmpeg: Conversion speed becomes slower after custom build with iOS.sh script.

Created on 4 Sep 2019  路  7Comments  路  Source: tanersener/mobile-ffmpeg

Description
I have installed mobile-ffmpeg-full ~> 4.2.1 using pod on Xcode. But in order to enable x264 I had to done a custom build. After successfully completing the custom build I imported all frameworks and run it on an iOS device. Everything has worked fine but conversion speed becomes much slower than the mobile-ffmpeg-full ~> 4.2.1 one.

Expected behavior
After applying custom build with iOS.sh script, conversion speed should be the same as mobile-ffmpeg-full ~> 4.2.1 pod.

Current behavior
Using custom build with iOS.sh script: converted .mov file to .3gb took ~5minutes whereas mobile-ffmpeg-full ~> 4.2.1 via pod took only 50seconds. Tested with the same file, keeping codec info same as well.

Environment

Other
iOS.sh build script command:
/ios.sh -s --disable-x86-64 --enable-ios-audiotoolbox --enable-ios-avfoundation --enable-ios-zlib --enable-freetype --enable-fribidi --enable-gmp --enable-gnutls --enable-kvazaar --enable-lame --enable-libass --enable-libiconv --enable-libilbc --enable-libtheora --enable-libvpx --enable-opencore-amr --enable-openh264 --enable-opus --enable-sdl --enable-shine --enable-wavpack --enable-gpl --enable-x264

question

All 7 comments

Can you please share outputs of both executions?

Output log? or Output file?

I mean output logs.

  • Using pod 'mobile-ffmpeg-full', '~> 4.2.1'
  1. COMMAND: -y -hide_banner -i INPUT_FILE_PATH.MOV -f 3gp -vcodec h264 -preset medium -acodec copy OUTPUT_FILE_PATH.3gp
  2. OUTPUT_EXECUTION_LOG: https://paste.ubuntu.com/p/YTf6YXwdxY/
  3. My Analysis: It uses h264_videotoolbox encoder.
  • Using custom Build ios.sh
  1. COMMAND: -y -hide_banner -i INPUT_FILE_PATH.MOV -f 3gp -vcodec h264 -preset medium -acodec copy OUTPUT_FILE_PATH.3gp
  2. OUTPUT_EXECUTION_LOG: https://paste.ubuntu.com/p/NRb498tT88/
  3. My Analysis: It uses libx264 encoder.

Your analysis is correct, you are using different encoders. Their encoding speed is different and this is creating the difference between your executions.

If you specify encoder name explicitly then conversion speed will be the same. You can use -vcodec libx264 or -vcodec h264_videotoolbox. Videotoolbox is hw assisted and the faster one on iOS.

By the way, libx264 is not included in the full package of mobile-ffmpeg but there are other packages like min-gpl, https-gpl or full-gpl which include libx264. You can use them instead of creating your own build.

h264_videotoolbox encoder works faster but it reduces output resolution.
However, My issue has been fixed, I am using full-gpl now.
Thank you for your nice collaboration.

Happy to hear that.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hantrungkien picture hantrungkien  路  6Comments

nihkilft123 picture nihkilft123  路  5Comments

fayte0618 picture fayte0618  路  3Comments

ZedZeal picture ZedZeal  路  6Comments

tim162 picture tim162  路  5Comments