tanersener / mobile-ffmpeg

FFmpeg for Android, iOS and tvOS. Not maintained anymore. Superseded by FFmpegKit.
https://tanersener.github.io/mobile-ffmpeg
GNU General Public License v3.0
3.85k stars 787 forks source link

[iOS] Immediate fail with rc=1, how can I debug this? #150

Closed jmaton closed 5 years ago

jmaton commented 5 years ago

First thank you for creating this library!

I am attempting to use it to convert mp4 video files to mpeg2. It appears to fail immediately with a return code of 1, and the logged output isn't helpful. Is there a way to get additional output, or some other suggestion for debugging this?

Here is some sample code:

[MobileFFmpegConfig enableRedirection];
[MobileFFmpegConfig setLogLevel:AV_LOG_VERBOSE];
NSString *command = @"-v verbose -i /path/to/video.mp4 -c:v mpeg2video -qscale:v 0 -c:a mp2 /path/to/video.mpeg"; // real paths are used in my code :)
[MobileFFmpeg execute:command];
int rc = [MobileFFmpeg getLastReturnCode];

The logged output is not helpful:

2019-06-09 12:29:29.859418-0400 myapp[29806:660737] Loaded mobile-ffmpeg-full-x86_64-4.2.1-20190530
2019-06-09 12:29:39.026062-0400 myapp[29806:660725] INFO: ffmpeg version v4.2-dev-1156
2019-06-09 12:29:39.026268-0400 myapp[29806:660725] INFO:  Copyright (c) 2000-2019 the FFmpeg developers
2019-06-09 12:29:39.026464-0400 myapp[29806:660725] INFO:
2019-06-09 12:29:39.026591-0400 myapp[29806:660725] INFO:   built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)
2019-06-09 12:29:39.026727-0400 myapp[29806:660725] INFO:   configuration: --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk --prefix=/Users/jmaton/src/mobile-ffmpeg/prebuilt/ios-x86_64-ios-darwin/ffmpeg --enable-version3 --arch=x86_64 --cpu=x86_64 --target-os=darwin --ar=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar --cc=clang --cxx=clang++ --as='clang -arch x86_64 -target x86_64-ios-darwin -march=x86-64 -msse4.2 -mpopcnt -m64 -mtune=intel -DMOBILE_FFMPEG_X86_64 -Wno-unused-function -Wno-deprecated-declarations -fstrict-aliasing -DIOS -DMOBILE_FFMPEG_BUILD_DATE=20190530 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk -O2 -mios-simulator-version-min=12.1 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include' --ranlib=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib --strip=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip --disable-neon --enable-cross-compile --enable-pic --enable-asm --enable-inline-asm --enable-optimizations --enable-swscale --enable-static --disable-shared --disable-v4l2-m2m --disable-outdev=v4l2 --disable-outdev=fbdev --disable-indev=v4l2 --disable-indev=fbdev --disable-openssl --disable-xmm-clobber-test --disable-debug --disable-neon-clobber-test --disable-programs --disable-postproc --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-sndio --disable-schannel --disable-securetransport --disable-xlib --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --disable-appkit --disable-alsa --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-gmp --enable-gnutls --enable-libmp3lame --enable-libass --enable-iconv --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxml2 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libshine --enable-libspeex --enable-libwavpack --enable-libkvazaar --enable-libx264 --enable-gpl --enable-libilbc --enable-libopus --enable-libsnappy --enable-libsoxr --enable-libaom --enable-chromaprint --enable-libtwolame --enable-sdl2 --enable-libtesseract --enable-zlib --enable-audiotoolbox --enable-coreimage --enable-bzlib --enable-videotoolbox --enable-avfoundation

I have executed the same command string with ffmpeg in a terminal; it takes some time (5 seconds or so) and does successfully convert the video.

So my question is how you would suggest I debug this problem. Are there additional calls to MobileFFmpegConfig that I should use?

Environment

Thank you.

tanersener commented 5 years ago

Log output is needed to understand why your command fails.

My suggestions are:

  1. Can you remove [MobileFFmpegConfig enableRedirection];, it is not required.
  2. What is the output of [MobileFFmpeg getLastCommandOutput];?
jmaton commented 5 years ago

Okay, that got me a little further... When I logged the output I saw an error like "protocol not found: /path/to/file.mp4 did you mean file:/path/to/file.mp4"

So I changed the code to:

[MobileFFmpegConfig setLogLevel:AV_LOG_VERBOSE];
NSString *command = @"-v verbose -i file:/path/to/video.mp4 -c:v mpeg2video -qscale:v 0 -c:a mp2 /path/to/video.mpeg"; // real paths are used in my code :)
[MobileFFmpeg execute:command];
int rc = [MobileFFmpeg getLastReturnCode]
NSString *output = [MobileFFmpeg getLastCommandOutput];
NSLog(@"-----\n%@\n-----", output);

The error asking about the "file:" prefix is gone, however the execute invocation still returns immediately with rc=1, and the NSLog(output) is identical to what I posted earlier, plus a line: "WARNING: library configuration mismatch". I pasted the output below.

Another question -- is [MobileFFmpeg execute] a blocking call? Or should I be putting it on a worker thread and checking it periodically? I ask because of the ordering of the logged messages (below.) After my NSLog(output) call has completed, there is another log message from avfilter, so I'm wondering if ffmpeg wasn't actually completed yet?

Following is from Console.app where NSLog writes to:

default 09:14:37.896992 -0400   myapp   Loaded mobile-ffmpeg-full-x86_64-4.2.1-20190530
default 09:14:37.898901 -0400   myapp   INFO: ffmpeg version v4.2-dev-1156
default 09:14:37.899031 -0400   myapp   INFO:  Copyright (c) 2000-2019 the FFmpeg developers
default 09:14:37.899187 -0400   myapp   INFO:
default 09:14:37.899321 -0400   myapp   INFO:   built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)
default 09:14:37.902456 -0400   myapp   INFO:   configuration: --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk --prefix=/Users/jmaton/src/mobile-ffmpeg/prebuilt/ios-x86_64-ios-darwin/ffmpeg --enable-version3 --arch=x86_64 --cpu=x86_64 --target-os=darwin --ar=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar --cc=clang --cxx=clang++ --as='clang -arch x86_64 -target x86_64-ios-darwin -march=x86-64 -msse4.2 -mpopcnt -m64 -mtune=intel -DMOBILE_FFMPEG_X86_64 -Wno-unused-function -Wno-deprecated-declarations -fstrict-aliasing -DIOS -DMOBILE_FFMPEG_BUILD_DATE=20190530 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk -O2 -mios-simulator-version-min=12.1 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include' --ranlib=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib --strip=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip --disable-neon --enable-cross-compile --enable-pic --enable-asm --enable-inline-asm --enable-optimizations --enable-swscale --enable-static --disable-shared --disable-v4l2-m2m --disable-outdev=v4l2 --disable-outdev=fbdev --disable-indev=v4l2 --disable-indev=fbdev --disable-openssl --disable-xmm-clobber-test --disable-debug --disable-neon-clobber-test --disable-programs --disable-postproc --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-sndio --disable-schannel --disable-securetransport --disable-xlib --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --disable-appkit --disable-alsa --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-gmp --enable-gnutls --enable-libmp3lame --enable-libass --enable-iconv --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxml2 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libshine --enable-libspeex --enable-libwavpack --enable-libkvazaar --enable-libx264 --enable-gpl --enable-libilbc --enable-libopus --enable-libsnappy --enable-libsoxr --enable-libaom --enable-chromaprint --enable-libtwolame --enable-sdl2 --enable-libtesseract --enable-zlib --enable-audiotoolbox --enable-coreimage --enable-bzlib --enable-videotoolbox --enable-avfoundation
default 09:14:37.902792 -0400   myapp   INFO:   WARNING: library configuration mismatch
default 09:14:37.903242 -0400   myapp   INFO:   avutil      configuration: --prefix=/Volumes/USB_SSD/cerbero/autotools/master/build/dist/ios_universal --libdir=/Volumes/USB_SSD/cerbero/autotools/master/build/dist/ios_universal/lib --ar=ar --as='ccache clang' --cc='ccache clang' --ld='ccache clang' --nm=nm --ranlib=ranlib --strip=strip --enable-static --enable-pic --enable-shared --disable-avdevice --disable-postproc --disable-swscale --disable-programs --disable-ffplay --disable-ffprobe --disable-ffmpeg --disable-encoder=flac --disable-protocols --disable-devices --disable-network --disable-hwaccels --disable-dxva2 --disable-vdpau --disable-filters --enable-filter=yadif --disable-doc --disable-d3d11va --disable-audiotoolbox --disable-videotoolbox --disable-vaapi --disable-crystalhd --disable-mediacodec --disable-nvenc --disable-mmal --disable-omx --disable-omx-rpi --disable-cuda --disable-cuvid --disable-libmfx --disable-libnpp --disable-iconv --disable-jni --disable-v4l2_m2m --enable-optimizations --disable-nonfree --disable-version3 --extra-cflags=-Wno-ignored-optimization-argument --enable-cross-compile --target-os=darwin --arch=x86_64 --cross-prefix=x86_64-apple-darwin10-
default 09:14:44.509150 -0400   myapp   INFO:   avcodec     configuration: --prefix=/Volumes/USB_SSD/cerbero/autotools/master/build/dist/ios_universal --libdir=/Volumes/USB_SSD/cerbero/autotools/master/build/dist/ios_universal/lib --ar=ar --as='ccache clang' --cc='ccache clang' --ld='ccache clang' --nm=nm --ranlib=ranlib --strip=strip --enable-static --enable-pic --enable-shared --disable-avdevice --disable-postproc --disable-swscale --disable-programs --disable-ffplay --disable-ffprobe --disable-ffmpeg --disable-encoder=flac --disable-protocols --disable-devices --disable-network --disable-hwaccels --disable-dxva2 --disable-vdpau --disable-filters --enable-filter=yadif --disable-doc --disable-d3d11va --disable-audiotoolbox --disable-videotoolbox --disable-vaapi --disable-crystalhd --disable-mediacodec --disable-nvenc --disable-mmal --disable-omx --disable-omx-rpi --disable-cuda --disable-cuvid --disable-libmfx --disable-libnpp --disable-iconv --disable-jni --disable-v4l2_m2m --enable-optimizations --disable-nonfree --disable-version3 --extra-cflags=-Wno-ignored-optimization-argument --enable-cross-compile --target-os=darwin --arch=x86_64 --cross-prefix=x86_64-apple-darwin10-
default 09:14:45.917838 -0400   myapp   INFO:   avformat    configuration: --prefix=/Volumes/USB_SSD/cerbero/autotools/master/build/dist/ios_universal --libdir=/Volumes/USB_SSD/cerbero/autotools/master/build/dist/ios_universal/lib --ar=ar --as='ccache clang' --cc='ccache clang' --ld='ccache clang' --nm=nm --ranlib=ranlib --strip=strip --enable-static --enable-pic --enable-shared --disable-avdevice --disable-postproc --disable-swscale --disable-programs --disable-ffplay --disable-ffprobe --disable-ffmpeg --disable-encoder=flac --disable-protocols --disable-devices --disable-network --disable-hwaccels --disable-dxva2 --disable-vdpau --disable-filters --enable-filter=yadif --disable-doc --disable-d3d11va --disable-audiotoolbox --disable-videotoolbox --disable-vaapi --disable-crystalhd --disable-mediacodec --disable-nvenc --disable-mmal --disable-omx --disable-omx-rpi --disable-cuda --disable-cuvid --disable-libmfx --disable-libnpp --disable-iconv --disable-jni --disable-v4l2_m2m --enable-optimizations --disable-nonfree --disable-version3 --extra-cflags=-Wno-ignored-optimization-argument --enable-cross-compile --target-os=darwin --arch=x86_64 --cross-prefix=x86_64-apple-darwin10-
default 09:14:45.939384 -0400   myapp   -----
ffmpeg version v4.2-dev-1156 Copyright (c) 2000-2019 the FFmpeg developers
  built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)
  configuration: --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk --prefix=/Users/jmaton/src/mobile-ffmpeg/prebuilt/ios-x86_64-ios-darwin/ffmpeg --enable-version3 --arch=x86_64 --cpu=x86_64 --target-os=darwin --ar=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar --cc=clang --cxx=clang++ --as='clang -arch x86_64 -target x86_64-ios-darwin -march=x86-64 -msse4.2 -mpopcnt -m64 -mtune=intel -DMOBILE_FFMPEG_X86_64 -Wno-unused-function -Wno-deprecated-declarations -fstrict-aliasing -DIOS -DMOBILE_FFMPEG_BUILD_DATE=20190530 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk -O2 -mios-simulator-version-min=12.1 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include' --ranlib=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib --strip=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip --disable-neon --enable-cross-compile --enable-pic --enable-asm --enable-inline-asm --enable-optimizations --enable-swscale --enable-static --disable-shared --disable-v4l2-m2m --disable-outdev=v4l2 --disable-outdev=fbdev --disable-indev=v4l2 --disable-indev=fbdev --disable-openssl --disable-xmm-clobber-test --disable-debug --disable-neon-clobber-test --disable-programs --disable-postproc --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-sndio --disable-schannel --disable-securetransport --disable-xlib --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --disable-appkit --disable-alsa --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-gmp --enable-gnutls --enable-libmp3lame --enable-libass --enable-iconv --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxml2 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libshine --enable-libspeex --enable-libwavpack --enable-libkvazaar --enable-libx264 --enable-gpl --enable-libilbc --enable-libopus --enable-libsnappy --enable-libsoxr --enable-libaom --enable-chromaprint --enable-libtwolame --enable-sdl2 --enable-libtesseract --enable-zlib --enable-audiotoolbox --enable-coreimage --enable-bzlib --enable-videotoolbox --enable-avfoundation
  WARNING: library configuration mismatch
  avutil      configuration: --prefix=/Volumes/USB_SSD/cerbero/autotools/master/build/dist/ios_universal --libdir=/Volumes/USB_SSD/cerbero/autotools/master/build/dist/ios_universal/lib --ar=ar --as='ccache clang' --cc='ccache clang' --ld='ccache clang' --nm=nm --ranlib=ranlib --strip=strip --enable-static --enable-pic --enable-shared --disable-avdevice --disable-postproc --disable-swscale --disable-programs --disable-ffplay --disable-ffprobe --disable-ffmpeg --disable-encoder=flac --disable-protocols --disable-devices --disable-network --disable-hwaccels --disable-dxva2 --disable-vdpau --disable-filters --enable-filter=yadif --disable-doc --disable-d3d11va --disable-audiotoolbox --disable-videotoolbox --disable-vaapi --disable-crystalhd --disable-mediacodec --disable-nvenc --disable-mmal --disable-omx --disable-omx-rpi --disable-cuda --disable-cuvid --disable-libmfx --disable-libnpp --disable-iconv --disable-jni --disable-v4l2_m2m --enable-optimizations --disable-nonfree --disable-version3 --extra-cflags=-Wno-ignored-optimization-argument --enable-cross-compile --target-os=darwin --arch=x86_64 --cross-prefix=x86_64-apple-darwin10-
  avcodec     configuration: --prefix=/Volumes/USB_SSD/cerbero/autotools/master/build/dist/ios_universal --libdir=/Volumes/USB_SSD/cerbero/autotools/master/build/dist/ios_universal/lib --ar=ar --as='ccache clang' --cc='ccache clang' --ld='ccache clang' --nm=nm --ranlib=ranlib --strip=strip --enable-static --enable-pic --enable-shared --disable-avdevice --disable-postproc --disable-swscale --disable-programs --disable-ffplay --disable-ffprobe --disable-ffmpeg --disable-encoder=flac --disable-protocols --disable-devices --disable-network --disable-hwaccels --disable-dxva2 --disable-vdpau --disable-filters --enable-filter=yadif --disable-doc --disable-d3d11va --disable-audiotoolbox --disable-videotoolbox --disable-vaapi --disable-crystalhd --disable-mediacodec --disable-nvenc --disable-mmal --disable-omx --disable-omx-rpi --disable-cuda --disable-cuvid --disable-libmfx --disable-libnpp --disable-iconv --disable-jni --disable-v4l2_m2m --enable-optimizations --disable-nonfree --disable-version3 --extra-cflags=-Wno-ignored-optimization-argument --enable-cross-compile --target-os=darwin --arch=x86_64 --cross-prefix=x86_64-apple-darwin10-
  avformat    configuration: --prefix=/Volumes/USB_SSD/cerbero/autotools/master/build/dist/ios_universal --libdir=/Volumes/USB_SSD/cerbero/autotools/master/build/dist/ios_universal/lib --ar=ar --as='ccache clang' --cc='ccache clang' --ld='ccache clang' --nm=nm --ranlib=ranlib --strip=strip --enable-static --enable-pic --enable-shared --disable-avdevice --disable-postproc --disable-swscale --disable-programs --disable-ffplay --disable-ffprobe --disable-ffmpeg --disable-encoder=flac --disable-protocols --disable-devices --disable-network --disable-hwaccels --disable-dxva2 --disable-vdpau --disable-filters --enable-filter=yadif --disable-doc --disable-d3d11va --disable-audiotoolbox --disable-videotoolbox --disable-vaapi --disable-crystalhd --disable-mediacodec --disable-nvenc --disable-mmal --disable-omx --disable-omx-rpi --disable-cuda --disable-cuvid --disable-libmfx --disable-libnpp --disable-iconv --disable-jni --disable-v4l2_m2m --enable-optimizations --disable-nonfree --disable-version3 --extra-cflags=-Wno-ignored-optimization-argument --enable-cross-compile --target-os=darwin --arch=x86_64 --cross-prefix=x86_64-apple-darwin10-

-----
default 09:14:45.939445 -0400   myapp   INFO:   avfilter    configuration: --prefix=/Volumes/USB_SSD/cerbero/autotools/master/build/dist/ios_universal --libdir=/Volumes/USB_SSD/cerbero/autotools/master/build/dist/ios_universal/lib --ar=ar --as='ccache clang' --cc='ccache clang' --ld='ccache clang' --nm=nm --ranlib=ranlib --strip=strip --enable-static --enable-pic --enable-shared --disable-avdevice --disable-postproc --disable-swscale --disable-programs --disable-ffplay --disable-ffprobe --disable-ffmpeg --disable-encoder=flac --disable-protocols --disable-devices --disable-network --disable-hwaccels --disable-dxva2 --disable-vdpau --disable-filters --enable-filter=yadif --disable-doc --disable-d3d11va --disable-audiotoolbox --disable-videotoolbox --disable-vaapi --disable-crystalhd --disable-mediacodec --disable-nvenc --disable-mmal --disable-omx --disable-omx-rpi --disable-cuda --disable-cuvid --disable-libmfx --disable-libnpp --disable-iconv --disable-jni --disable-v4l2_m2m --enable-optimizations --disable-nonfree --disable-version3 --extra-cflags=-Wno-ignored-optimization-argument --enable-cross-compile --target-os=darwin --arch=x86_64 --cross-prefix=x86_64-apple-darwin10-
tanersener commented 5 years ago

Logs in your first post show that a custom mobile-ffmpeg build is used.

Logs in your second post, including /Volumes/USB_SSD/cerbero/autotools/master/build/dist/ios_universal path and WARNING: library configuration mismatch message does not belong to mobile-ffmpeg. Do you have another ffmpeg implementation in your path?

saalisumer commented 5 years ago

Any solution to the above. I am using mobile-ffmpeg-full for iOS with command = "-i /var/mobile/Containers/Data/Application/EFBB7846-32AC-413A-B033-D05F882D5BE5/Documents/a.mp4" yet getting rc = 1, all the time. tried with mobile-ffmpeg-min also with no result.

tanersener commented 5 years ago

@saalisumer Log output is needed to understand why a command fails. Please create a new issue with required fields if you need help.

saalisumer commented 5 years ago

@tanersener this is the output: ffmpeg version v4.2-dev-1156 Copyright (c) 2000-2019 the FFmpeg developers built with Apple LLVM version 10.0.1 (clang-1001.0.46.3) configuration: --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk --prefix=/Users/taner/Projects/mobile-ffmpeg/prebuilt/ios-x86_64-ios-darwin/ffmpeg --enable-version3 --arch=x86_64 --cpu=x86_64 --target-os=darwin --ar=ar --cc=clang --cxx=clang++ --as='clang -arch x86_64 -target x86_64-ios-darwin -march=x86-64 -msse4.2 -mpopcnt -m64 -mtune=intel -DMOBILE_FFMPEG_X86_64 -Wno-unused-function -Wno-deprecated-declarations -fstrict-aliasing -DIOS -DMOBILE_FFMPEG_BUILD_DATE=20190402 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk -O2 -mios-simulator-version-min=12.1 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/u2019-08-09 12:41:17.703069+0530 Public[30471:2482043] INFO: 0.000000 sr/include' --ranlib=ranlib --strip=strip --disable-neon --enable-cross-compile --enable-pic --enable-asm --enable-inline-asm --enable-optimizations --enable-swscale --enable-static --disable-shared --enable-small --disable-v4l2-m2m --disable-outdev=v4l2 --disable-outdev=fbdev --disable-indev=v4l2 --disable-indev=fbdev --disable-openssl --disable-xmm-clobber-test --disable-debug --disable-neon-clobber-test --disable-programs --disable-postproc --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-sndio --disable-schannel --disable-securetransport --disable-xlib --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --disable-appkit --disable-alsa --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-gmp --enable-gnutls --enable-libmp3lame --enable-libass --enable-iconv --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxml2 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libshine --enable-libspeex --enable-libwavpack --enable-libkvazaar --enable-libilbc --enable-libopus --enable-libsnappy --enable-libsoxr --enable-libaom --enable-libtwolame --disable-sdl2 --enable-zlib --enable-audiotoolbox --enable-coreimage --enable-bzlib --enable-videotoolbox --enable-avfoundation libavutil 56. 26.100 / 56. 26.100 libavcodec 58. 47.106 / 58. 47.106 libavformat 58. 26.101 / 58. 26.101 libavdevice 58. 7.100 / 58. 7.100 libavfilter 7. 48.100 / 7. 48.100 libswscale 5. 4.100 / 5. 4.100 libswresample 3. 4.100 / 3. 4.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/saalisumer/Library/Developer/CoreSimulator/Devices/0D9009A1-C38D-4CDE-819D-4F461511DC26/data/Containers/Bundle/Application/B7B3526E-09A8-4685-9682-FFD5F7120715/Public.app/a.mp4': Metadata: major_brand : mp42 minor_version : 1 compatible_brands: mp41mp42isom


tanersener commented 5 years ago

@saalisumer Your log is not complete. Are you setting a LogDelegate in your application? Please disable LogDelegate defined in your application or paste logs redirected to LogDelegate?

jmaton commented 5 years ago

Logs in your first post show that a custom mobile-ffmpeg build is used.

Correct.

Logs in your second post, including /Volumes/USB_SSD/cerbero/autotools/master/build/dist/ios_universal path and WARNING: library configuration mismatch message does not belong to mobile-ffmpeg. Do you have another ffmpeg implementation in your path?

Yes, and that was indeed the problem. The project I was working on, it was using GStreamer which was also using some ffmpeg libraries. Unfortunately I was not permitted to change the version of GStreamer, and I didn't want to use an older (matching) version of ffmpeg, nor did I want to go through the pain of trying to get mobile-ffmpeg to compile against an older version of ffmpeg.

So instead I wrote a sed script and changed the library names (prefixed with a 'j') in all the relevant source files and makefiles, then recompiled ffmpeg and mobile-ffmpeg. The final thing I had to do, was to move the mobile-ffmpeg and ffmpeg libraries up to the top of the list in the build settings/frameworks list for my project in xcode. After all that, it works.

I apologize it took me two months to come back and respond. :-) Once I got mobile-ffmpeg working I was racing to meet a deadline.

Anyway, thank you for your help and thanks again for a wonderful library.

I'm going to leave the issue open because @saalisumer has joined with a similar problem. @tanersener it's your project so feel free to close the issue anyway. :-)

jmaton commented 5 years ago

Any solution to the above. I am using mobile-ffmpeg-full for iOS with command = "-i /var/mobile/Containers/Data/Application/EFBB7846-32AC-413A-B033-D05F882D5BE5/Documents/a.mp4" yet getting rc = 1, all the time. tried with mobile-ffmpeg-min also with no result.

Please see my post above. My client's project was also using an older version of GStreamer which was linking older versions of ffmpeg, and thus conflicting with my use of mobile-ffmpeg. I modified class names in the ffmpeg libraries and recompiled. This combined with changing the framework listing order in xcode, fixed the problem for me.

Now that I think about it... I wonder if simply changing the framework order (to put mobile-ffmpeg and dependent libraries FIRST) would have fixed the problem and saved me the trouble of all the recompilation? :-) I would recommend to try that first -- if indeed you are also linking against something which is giving you a conflicting version of ffmpeg. If that doesn't work I would be happy to share my little sed script and you can try the recompilation route.

tanersener commented 5 years ago

... So instead I wrote a sed script and changed the library names (prefixed with a 'j') in all the relevant source files and makefiles, then recompiled ffmpeg and mobile-ffmpeg. The final thing I had to do, was to move the mobile-ffmpeg and ffmpeg libraries up to the top of the list in the build settings/frameworks list for my project in xcode. After all that, it works.

Great 👍

saalisumer commented 5 years ago

I got the issue fixed. My bad. It was an issue with the way I was using URL.