Compiling Static FFMPEG Binary - static

I cannot seem to compile a static build of FFMPEG. All of my attempts result with a ffmpeg binary that looks for libraries outside of the binary. Does anything stand out in my configure options?
Some further details - On OSX 10.10.5 and Xcode7. I used homebrew to build all of the dependencies in '/usr/local/Cellar/ffmpeg/2.8/' I then used the same compile options that the homebrew install used and extended it with further options.
Compiling goes without a hitch. The only issue being the ffmpeg binary is not static. I tried specifying --disable--share --enable-static with no luck (though i've read that these are on by default and do not need explicit specification)
## Compile Options ##
./configure --prefix=/usr/local/Cellar/ffmpeg/2.8/ -enable-gpl --enable- pthreads --disable-libfaac --disable-libfdk-aac --enable-ffplay --enable-fontconfig --enable-libfreetype --enable-frei0r --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libquvi --enable-libsoxr --enable-libssh --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libopencore-amrwb --enable-libopencore-amrnb --enable-libopenjpeg --enable-openssl --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-videotoolbox --enable-libwebp --enable-libx265 --enable-libzmq --disable-shared --enable-static --enable-avresample --disable-openssl --enable-opengl --disable-nvenc --enable-filters --arch=x86_64 --enable-runtime-cpudetect && make -j 4 && make install`
## Compiled FFMPEG Binary ##
./ffmpeg -buildconf
ffmpeg version N-75841-g5911eeb Copyright (c) 2000-2015 the FFmpeg developers
built with Apple LLVM version 7.0.0 (clang-700.0.72)
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8/ --enable-gpl --enable-pthreads --disable-libfaac --disable-libfdk-aac --enable-ffplay --enable-fontconfig --enable-libfreetype --enable-frei0r --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libquvi --enable-libsoxr --enable-libssh --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libopenjpeg --enable-openssl --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-videotoolbox --enable-libwebp --enable-libx265 --enable-libzmq --disable-shared --enable-static --enable-avresample --disable-openssl --enable-opengl --disable-nvenc --enable-filters --arch=x86_64 --enable-runtime-cpudetectlibavutil 55. 2.100 / 55. 2.100
libavcodec 57. 4.100 / 57. 4.100
libavformat 57. 3.100 / 57. 3.100
libavdevice 57. 0.100 / 57. 0.100
libavfilter 6. 10.100 / 6. 10.100
libavresample 3. 0. 0 / 3. 0. 0
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.100 / 2. 0.100
libpostproc 54. 0.100 / 54. 0.100
configuration:
--enable-gpl
--enable-pthreads
--disable-libfaac
--disable-libfdk-aac
--enable-ffplay
--enable-fontconfig
--enable-libfreetype
--enable-frei0r
--enable-libbluray
--enable-libbs2b
--enable-libcaca
--enable-libquvi
--enable-libsoxr
--enable-libssh
--enable-libvidstab
--enable-libvorbis
--enable-libvpx
--enable-libopenjpeg
--enable-openssl
--enable-libopus
--enable-librtmp
--enable-libschroedinger
--enable-libspeex
--enable-libtheora
--enable-videotoolbox
--enable-libwebp
--enable-libx265
--enable-libzmq
--disable-shared
--enable-static
--enable-avresample
--disable-openssl
--enable-opengl
--disable-nvenc
--enable-filters
--arch=x86_64
--enable-runtime-cpudetect
Is there somethign glaringly wrong in my configuration? Is it a licensing thing - where certain libraries wont compile statically?
I deeply appreciate any guidance in compiling a static ffmpeg binary.
Thanks for your help!

Related

FFmpeg video overlay function not working

I am simply trying to get a watermarked video from the Flutter FFmpeg package and cannot seem to get it to work. Right now, I am downloading the video from Firebase, storing it in cache, overlaying a watermark image using the Flutter FFmpeg Kit package. The original video file, image file, and output file are being created properly.
However, the overlay function is not working properly. How can I use the FFmpegKit.execute function string? I am not seeing any obvious errors in the function, but it isn't working properly. I tried writing as a new File and asBytes but neither worked.
Edit: I want to take the originalVideo and overlay it with the watermark image with the expected outcome being a new file that contains the new overlayed video. Not concerned with where the overlay is yet.
Pubspec.yaml
ffmpeg_kit_flutter: ^4.5.1
The function is:
import 'package:ffmpeg_kit_flutter/ffmpeg_kit.dart';
Future<File> waterMarkVideo(String videoPath, String watermarkPath) async {
//these calls are to load the video into temporary directory
final response = await http.get(Uri.parse(videoPath));
final originalVideo = File ('${(await getTemporaryDirectory()).path}/video.mp4');
await originalVideo.create(recursive: true);
await originalVideo.writeAsBytes(response.bodyBytes);
print('video path' + originalVideo.path);
//this grabs the watermark image from assets and decodes it
final byteData = await rootBundle.load(watermarkPath);
final watermark = File('${(await getTemporaryDirectory()).path}/image.png');
await watermark.create(recursive: true);
await watermark.writeAsBytes(byteData.buffer.asUint8List(byteData.offsetInBytes, byteData.lengthInBytes));
print('watermark path' + watermark.path);
//this creates temporary directory for new watermarked video
var tempDir = await getTemporaryDirectory();
final newVideoPath = '${tempDir.path}/${DateTime.now().microsecondsSinceEpoch}result.mp4';
final videoFile = await File(newVideoPath).create();
//overlaying video using FFmpegkit where I need some help
await FFmpegKit.executeAsync("-i $originalVideo -i $watermark -filter_complex 'overlay=(W-w)/2:(H-h)/2' $videoFile")
.then((session) async {
final state = FFmpegKitConfig.sessionStateToString(await session.getState());
final returnCode = await session.getReturnCode();
final failStackTrace = await session.getFailStackTrace();
final output = await session.getOutput();
print('FFmpeg process exited with state ${state} and rs ${returnCode}.If failed ${failStackTrace}');
print('Last output $output');
} );
print('new video path' + newVideoPath);
Uint8List videoByteData = await videoFile.readAsBytes();
return videoFile.writeAsBytes(videoByteData);
}
The output for the function above is
flutter: video path/Users/dennisashford/Library/Developer/CoreSimulator/Devices/FBFB4D51-EC31-47DF-8FE0-66B114806EA4/data/Containers/Data/Application/0EA3BB35-D364-4B98-A104-15CDB17AAD54/Library/Caches/video.mp4
flutter: watermark path/Users/dennisashford/Library/Developer/CoreSimulator/Devices/FBFB4D51-EC31-47DF-8FE0-66B114806EA4/data/Containers/Data/Application/0EA3BB35-D364-4B98-A104-15CDB17AAD54/Library/Caches/image.png
ffmpeg version v4.5-dev-3393-g30322ebe3c Copyright (c) 2000-2021 the FFmpeg developers
built with Apple clang version 13.0.0 (clang-1300.0.29.30)
configuration: --cross-prefix=x86_64-ios-darwin- --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.2.sdk --prefix=/Users/taner/Projects/ffmpeg-kit/prebuilt/apple-ios-x86_64/ffmpeg --pkg-config=/opt/homebrew/bin/pkg-config --enable-version3 --arch=x86_64 --cpu=x86_64 --target-os=darwin --disable-neon --disable-asm --ar=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar --cc=clang --cxx=clang++ --as='clang -arch x86_64 -target x86_64-apple-ios12.1-simulator -march=x86-64 -msse4.2 -mpopcnt -m64 -DFFMPEG_KIT_X86_64 -Wno-unused-function -Wno-deprecated-declarations -fstrict-aliasing -DIOS -DFFMPEG_KIT_BUILD_DATE=20220114 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.2.sdk -O2 -mios-simulator-version-min=12.1 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.2.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 --nm=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm --extra-ldflags='-mios-simulator-version-min=12.1' --disable-autodetect --enable-cross-compile --enable-pic --enable-inline-asm --enable-optimizations --enable-swscale --enable-shared --disable-static --install-name-dir='#rpath' --enable-pthreads --disable-v4l2-m2m --disable-outdev=v4l2 --disable-outdev=fbdev --disable-indev=v4l2 --disable-indev=fbdev --enable-small --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-alsa --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --enable-gmp --enable-gnutls --disable-sdl2 --disable-openssl --enable-zlib --enable-audiotoolbox --disable-outdev=audiotoolbox --enable-bzlib --enable-videotoolbox --enable-avfoundation --enable-iconv --disable-coreimage --disable-appkit --disable-opencl --disable-opengl
libavutil 57. 13.100 / 57. 13.100
libavcodec 59. 15.102 / 59. 15.102
libavformat 59. 10.100 / 59. 10.100
libavdevice 59. 1.100 / 59. 1.100
libavfilter 8. 21.100 / 8. 21.100
libswscale 6. 1.102 / 6. 1.102
libswresample 4. 0.100 / 4. 0.100
File:: Protocol not found
Did you mean file:File:?
flutter: FFmpeg process exited with state RUNNING and rs 1.If failed null
flutter: Last output ffmpeg version v4.5-dev-3393-g30322ebe3c Copyright (c) 2000-2021 the FFmpeg developers
flutter: built with Apple clang version 13.0.0 (clang-1300.0.29.30)
flutter: configuration: --cross-prefix=x86_64-ios-darwin- --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.2.sdk --prefix=/Users/taner/Projects/ffmpeg-kit/prebuilt/apple-ios-x86_64/ffmpeg --pkg-config=/opt/homebrew/bin/pkg-config --enable-version3 --arch=x86_64 --cpu=x86_64 --target-os=darwin --disable-neon --disable-asm --ar=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar --cc=clang --cxx=clang++ --as='clang -arch x86_64 -target x86_64-apple-ios12.1-simulator -march=x86-64 -msse4.2 -mpopcnt -m64 -DFFMPEG_KIT_X86_64 -Wno-unused-function -Wno-deprecated-declarations -fstrict-aliasing -DIOS -DFFMPEG_KIT_BUILD_DATE=20220114 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.2.sdk -O2 -mios-simulator-version-min=12.1 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.2.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 --nm=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm --extra-ldflags='-mios-simulator-version-min=12.1' --disable-autodetect --enable-cross-compile --enable-pic --enable-inline-asm --enable-optimizations --enable-swscale --enable-shared --disable-static --install-name-dir='#rpath' --enable-pthreads --disable-v4l2-m2m --disable-outdev=v4l2 --disable-outdev=fbdev --disable-indev=v4l2 --disable-indev=fbdev --enable-small --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-alsa --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --enable-gmp --enable-gnutls --disable-sdl2 --disable-openssl --enable-zlib --enable-audiotoolbox --disable-outdev=audiotoolbox --enable-bzlib --enable-videotoolbox --enable-avfoundation --enable-iconv --disable-coreimage --disable-appkit --disable-opencl --disable-opengl
flutter: libavutil 57. 13.100 / 57. 13.100
flutter: libavcodec 59. 15.102 / 59. 15.102
flutter: libavformat 59. 10.100 / 59. 10.100
flutter: libavdevice 59. 1.100 / 59. 1.100
flutter: libavfilter 8. 21.100 / 8. 21.100
flutter: libswscale 6. 1.102 / 6. 1.102
flutter: libswresample 4. 0.100 / 4. 0.100
flutter: File:: Protocol not found
flutter: Did you mean file:File:?
flutter:
flutter: new video path/Users/dennisashford/Library/Developer/CoreSimulator/Devices/FBFB4D51-EC31-47DF-8FE0-66B114806EA4/data/Containers/Data/Application/0EA3BB35-D364-4B98-A104-15CDB17AAD54/Library/Caches/1661892011213545result.mp4
Update: So I built the code on a physical device and was able to get a little more information for what may be the problem. The error may be coming from
File:: Protocol not found
Did you mean file:File:?
Complete logs from the physical device are given below
flutter: video path/var/mobile/Containers/Data/Application/70EA92CD-DF5D-440E-BBE1-C130BC7F0CC7/Library/Caches/video.mp4
flutter: watermark path/var/mobile/Containers/Data/Application/70EA92CD-DF5D-440E-BBE1-C130BC7F0CC7/Library/Caches/image.png
ffmpeg version v4.5-dev-3393-g30322ebe3c Copyright (c) 2000-2021 the FFmpeg developers
built with Apple clang version 13.0.0 (clang-1300.0.29.30)
configuration: --cross-prefix=arm64-ios-darwin- --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.2.sdk --prefix=/Users/taner/Projects/ffmpeg-kit/prebuilt/apple-ios-arm64/ffmpeg --pkg-config=/opt/homebrew/bin/pkg-config --enable-version3 --arch=aarch64 --cpu=armv8 --target-os=darwin --enable-neon --enable-asm --ar=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar --cc=clang --cxx=clang++ --as='/Users/taner/Projects/ffmpeg-kit/.tmp/gas-preprocessor.pl -arch aarch64 -- clang -arch arm64 -target arm64-apple-ios12.1 -march=armv8-a+crc+crypto -mcpu=generic -DFFMPEG_KIT_ARM64 -Wno-unused-function -Wno-deprecated-declarations -fstrict-aliasing -fembed-bitcode -DIOS -DFFMPEG_KIT_BUILD_DATE=20220114 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.2.sdk -Oz -miphoneos-version-min=12.1 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.2.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 --nm=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm --extra-ldflags='-miphoneos-version-min=12.1' --disable-autodetect --enable-cross-compile --enable-pic --enable-inline-asm --enable-optimizations --enable-swscale --enable-shared --disable-static --install-name-dir='#rpath' --enable-pthreads --disable-v4l2-m2m --disable-outdev=v4l2 --disable-outdev=fbdev --disable-indev=v4l2 --disable-indev=fbdev --enable-small --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-alsa --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --enable-gmp --enable-gnutls --disable-sdl2 --disable-openssl --enable-zlib --enable-audiotoolbox --disable-outdev=audiotoolbox --enable-bzlib --enable-videotoolbox --enable-avfoundation --enable-iconv --disable-coreimage --disable-appkit --disable-opencl --disable-opengl
libavutil 57. 13.100 / 57. 13.100
libavcodec 59. 15.102 / 59. 15.102
libavformat 59. 10.100 / 59. 10.100
libavdevice 59. 1.100 / 59. 1.100
libavfilter 8. 21.100 / 8. 21.100
libswscale 6. 1.102 / 6. 1.102
libswresample 4. 0.100 / 4. 0.100
File:: Protocol not found
Did you mean file:File:?
flutter: FFmpeg process exited with state RUNNING and rs 1.If failed null
flutter: Last output ffmpeg version v4.5-dev-3393-g30322ebe3c Copyright (c) 2000-2021 the FFmpeg developers
built with Apple clang version 13.0.0 (clang-1300.0.29.30)
configuration: --cross-prefix=arm64-ios-darwin- --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.2.sdk --prefix=/Users/taner/Projects/ffmpeg-kit/prebuilt/apple-ios-arm64/ffmpeg --pkg-config=/opt/homebrew/bin/pkg-config --enable-version3 --arch=aarch64 --cpu=armv8 --target-os=darwin --enable-neon --enable-asm --ar=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar --cc=clang --cxx=clang++ --as='/Users/taner/Projects/ffmpeg-kit/.tmp/gas-preprocessor.pl -arch aarch64 -- clang -arch arm64 -target arm64-apple-ios12.1 -march=armv8-a+crc+crypto -mcpu=generic -DFFMPEG_KIT_ARM64 -Wno-unused-function -Wno-deprecated-declarations -fstrict-aliasing -fembed-bitcode -DIOS -DFFMPEG_KIT_BUILD_DATE=20220114 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.2.sdk -Oz -miphoneos-version-min=12.1 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.2.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 --nm=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm --extra-ldflags='-miphoneos-version-min=12.1' --disable-autodetect --enable-cross-compile --enable-pic --enable-inline-asm --enable-optimizations --enable-swscale --enable-shared --disable-static --install-name-dir='#rpath' --enable-pthreads --disable-v4l2-m2m --disable-outdev=v4l2 --disable-outdev=fbdev --disable-indev=v4l2 --disable-indev=fbdev --enable-small --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-alsa --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --enable-gmp --enable-gnutls --disable-sdl2 --disable-openssl --enable-zlib --enable-audiotoolbox --disable-outdev=audiotoolbox --enable-bzlib --enable-videotoolbox --enable-avfoundation --enable-iconv --disable-coreimage --disable-appkit --disable-opencl --disable-opengl
libavutil 57. 13.100 / 57. 13.100
libavcodec 59. 15.102 / 59. 15.102
libavformat 59. 10.100 / 59. 10.100
libavdevice 59. 1.100 / 59. 1.100
libavfilter 8. 21.100 / 8. 21.100
libswscale 6. 1.102 / 6. 1.102
libswresample 4. 0.100 / 4. 0.100
File:: Protocol not found
Did you mean file:File:?
flutter: new video path/var/mobile/Containers/Data/Application/70EA92CD-DF5D-440E-BBE1-C130BC7F0CC7/Library/Caches/1661891272856433result.mp4
Update #2 after a lot of help from #kesh below, this function was actually able to overlay the image on the video.
await FFmpegKit.executeAsync('-i $videoPath -i ${watermark.path} -filter_complex "overlay=10:10" -y ${videoFile.path}')

Enable hardware (GPU) video decode acceleration with ffmpeg C API?

I am using avcodec_decode_video2() to decode a particular video without enabling any GPU hardware support.
While I tried to get the hardware decoder by name:
mVideoCodec = avcodec_find_decoder_by_name("h264_dxva2");
But its results mVideoCodec = NULL although while running ffmpeg from command prompt using dxva2 hwaccel, no error is being shown. Here I am giving the configuration output what I got from the command prompt. can anyone please tell me how can I enable hardware acceleration properly while using avcodec_decode_video2() API to decode the video in C.
I am using a laptop with an NVIDIA GPU.
Log from command prompt:
C:\ffmpeg\bin>ffmpeg -hwaccel dxva2 -i 9.mp4 -r 60 -vsync 0 -f image2 image-%2d.png**
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-cuda --enable-cuvid --enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth --enable-libmfx

getting error in ffmpeg complex filter init

I am trying to build an application using ffmpeg library and that app will scale video and show volume bars (using showvolume filter) over scaled video.
When I use ffmpeg command at that time it works like charm but somehow I cant make it work in c program, please help me to solve this issue
I am trying to set complex filter in two different methods:
using avfilter_graph_parse2 function
manually link each filters
method 1 Error:
[Parsed_showvolume_0 # 0x1aca580] Format change is not supported
Error while feeding the filtergraph
output screenshot
filter graph
method 2 Error:
[afifo # 0x9cd880] Format change is not supported
Error while feeding the filtergraph
output screenshot
filter graph
C Code:
main.c file
ffmpeg version:
ubuntu#ubuntu-VirtualBox:~/eclipse-workspace/compexFilterTest/Debug$ ffmpeg -version
ffmpeg version git-2018-07-11-bd8a5c6 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.1) 20160609
configuration: --enable-gpl --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-version3 --enable-pic --enable-libfreetype --enable-libfdk-aac --enable-openssl --enable-shared --enable-libass --enable-libvpx --enable-libx265 --enable-libtwolame
libavutil 56. 18.102 / 56. 18.102
libavcodec 58. 21.104 / 58. 21.104
libavformat 58. 17.101 / 58. 17.101
libavdevice 58. 4.101 / 58. 4.101
libavfilter 7. 25.100 / 7. 25.100
libswscale 5. 2.100 / 5. 2.100
libswresample 3. 2.100 / 3. 2.100
libpostproc 55. 2.100 / 55. 2.100
ffmpeg CLI command:
ffmpeg -loglevel 40 -i test.ts -filter_complex "[0:a]afifo,showvolume=w=240:h=20:o=1:f=0.50:r=25[vol0];nullsrc=size=320x240[base1];[0:v]fifo,setpts=PTS-STARTPTS,scale=320x240[w0h0];[w0h0][vol0]overlay=eval=0:x=280[w0h0a];[base1][w0h0a]overlay=shortest=1:eval=0" -vcodec h264 -profile:v main -level 4 -metadata service_provider=testScreenProvider -metadata service_name=testScreen -f mpegts -y test123.ts
Thank you in advance.

unrecognized command line option ‘-rdynamic’ on GCC v4.9.2

I'm using GCC v4.9.2 under Cygwin on Windows 7 64-bit, but running into an issue trying to compile uWSGI.
The error I'm receiving is -
gcc: error: unrecognized command line option ‘-rdynamic’
GCC version output -
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-cygwin/4.9.2/lto-wrapper.exe
Target: x86_64-pc-cygwin
Configured with: /cygdrive/i/szsz/tmpp/gcc/gcc-4.9.2-3.x86_64/src/gcc-4.9.2/configure --srcdir=/cygdrive/i/szsz/tmpp/gcc/gcc-4.9.2-3.x86_64/src/gcc-4.9.2 --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/libexec --datadir=/usr/share --localstatedir=/var --sysconfdir=/etc --libdir=/usr/lib --datarootdir=/usr/share --docdir=/usr/share/doc/gcc --htmldir=/usr/share/doc/gcc/html -C --build=x86_64-pc-cygwin --host=x86_64-pc-cygwin --target=x86_64-pc-cygwin --without-libiconv-prefix --without-libintl-prefix --libexecdir=/usr/lib --enable-shared --enable-shared-libgcc --enable-static --enable-version-specific-runtime-libs --enable-bootstrap --enable-__cxa_atexit --with-dwarf2 --with-tune=generic --enable-languages=ada,c,c++,fortran,lto,objc,obj-c++ --enable-graphite --enable-threads=posix --enable-libatomic --enable-libgomp --disable-libitm --enable-libquadmath --enable-libquadmath-support --enable-libssp --enable-libada --enable-libgcj-sublibs --disable-java-awt --disable-symvers --with-ecj-jar=/usr/share/java/ecj.jar --with-gnu-ld --with-gnu-as --with-cloog-include=/usr/include/cloog-isl --without-libiconv-prefix --without-libintl-prefix --with-system-zlib --enable-linker-build-id
Thread model: posix
gcc version 4.9.2 (GCC)
I'm invoking the build with CFLAGS="-Wno-error" make.
I'm not sure why I'm getting this error as I can see in the documentation from here that flag -rdynamic exists.
What am I missing?
I think I've got it...
Here's what happens on my laptop (Cygwin 2.831 (pc032) on Win7 (pc064)):
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i686-pc-cygwin/4.8.2/lto-wrapper.exe
Target: i686-pc-cygwin
Configured with: /cygdrive/i/szsz/tmpp/cygwin64/gcc/gcc-4.8.2-1/src/gcc-4.8.2/configure --srcdir=/cygdrive/i/szsz/tmpp/cygwin64/gcc/gcc-4.8.2-1/src/gcc-4.8.2 --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/libexec --datadir=/usr/share --localstatedir=/var --sysconfdir=/etc --libdir=/usr/lib --datarootdir=/usr/share --docdir=/usr/share/doc/gcc -C --build=i686-pc-cygwin --host=i686-pc-cygwin --target=i686-pc-cygwin --without-libiconv-prefix --without-libintl-prefix --enable-shared --enable-shared-libgcc --enable-static --enable-version-specific-runtime-libs --enable-bootstrap --disable-__cxa_atexit --with-dwarf2 --with-arch=i686 --with-tune=generic --disable-sjlj-exceptions --enable-languages=ada,c,c++,fortran,java,lto,objc,obj-c++ --enable-graphite --enable-threads=posix --enable-libatomic --enable-libgomp --disable-libitm --enable-libquadmath --enable-libquadmath-support --enable-libssp --enable-libada --enable-libjava --enable-libgcj-sublibs --disable-java-awt --disable-symvers --with-ecj-jar=/usr/share/java/ecj.jar --with-gnu-ld --with-gnu-as --with-cloog-include=/usr/include/cloog-isl --without-libiconv-prefix --without-libintl-prefix --with-system-zlib
Thread model: posix
gcc version 4.8.2 (GCC)
When I pass -rdynamic:
gcc -rdynamic
gcc: fatal error: no input files
compilation terminated.
Compared to -rdynamic1:
gcc -rdynamic1
gcc: error: unrecognized command line option ‘-rdynamic1’
gcc: fatal error: no input files
compilation terminated.
[Man7]: GCC(1) mentions it (I'm not sure how relevant is that), but gcc -v --help doesn't display it under the linker specific options.
I thought that maybe something is different about how the GCCs are configured, but I didn't see any difference that would matter (both have --with-gnu-ld - which seems related - specified).
Then I downloaded v4.8.2 and v4.9.2 sources and start searching and comparing, but again I couldn't find anything (it's true, the search could be widely extended).
But while browsing the configure file, I noticed something that could be related, then I checked the ld command line options and I think I have an alternative:
Instead of -rdynamic, you could pass -Wl,--export-all-symbols. That works for me (that's not very relevant since -rdynamic also works for me, unlike in your case :) ).
The link you give says:
-rdynamic
Pass the flag -export-dynamic to the ELF linker, on targets that support it. This instructs the linker to add all symbols, not only used ones, to the dynamic symbol table. This option is needed for some uses of dlopen or to allow obtaining backtraces from within a program.
(Emphasis added.)
Is Cygwin using ELF format object files? It seems unlikely.

Linux Mint LMDE ffmpeg h264

I'm trying to decode H264 using libavcodec on Linux Mint LMDE.
I installed ffmpeg, libavcodec-dev and libx264-dev but the H264 codec is still not recognized by the library in my own program.
However, ffplay works fine on a h264 stream.
Here is what I do :
avcodec_find_decoder(AV_CODEC_ID_H264);
and it returns NULL.
Why doesn't it find the codec ? What should I do to make it work ?
I'd rather not recompile libavcodec because it would mean I would have to link it statically later on in my program.
Here is the version information of ffmpeg :
ffmpeg -version ffmpeg version 2.1.1 built on Nov 20 2013 08:04:32
with gcc 4.8 (Debian 4.8.2-5) configuration: --prefix=/usr
--extra-cflags='-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security ' --extra-ldflags='-Wl,-z,relro' --cc='ccache cc' --enable-shared --enable-libmp3lame --enable-gpl --enable-nonfree --enable-libvorbis --enable-pthreads --enable-libfaac --enable-libxvid --enable-postproc --enable-x11grab --enable-libgsm --enable-libtheora --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libspeex --enable-nonfree --disable-stripping --enable-libvpx --enable-libschroedinger --disable-encoder=libschroedinger --enable-version3 --enable-libopenjpeg --enable-librtmp --enable-avfilter --enable-libfreetype --enable-libvo-aacenc --disable-decoder=amrnb --enable-libvo-amrwbenc --enable-libaacplus --libdir=/usr/lib/x86_64-linux-gnu --disable-vda --enable-libbluray --enable-libcdio --enable-gnutls --enable-frei0r --enable-openssl --enable-libass --enable-libopus --enable-fontconfig --enable-libpulse --disable-mips32r2 --disable-mipsdspr1 --disable-mipsdspr2 --enable-libvidstab --enable-libzvbi --enable-libiec61883 --enable-libfdk-aac --enable-vaapi --enable-libdc1394 --disable-altivec --disable-armv5te --disable-armv6 --disable-vis --shlibdir=/usr/lib/x86_64-linux-gnu libavutil 52. 48.101 / 52. 48.101 libavcodec 55. 39.101 / 55. 39.101 libavformat 55. 19.104 / 55. 19.104 libavdevice 55. 5.100 / 55. 5.100 libavfilter 3. 90.100 / 3. 90.100 libswscale 2. 5.101 / 2. 5.101 libswresample 0. 17.104 / 0. 17.104 libpostproc 52. 3.100 / 52.
3.100
I simply happened to have forgotten to call
avcodec_register_all();
So of course libavcodec wouldn't find any codec available.

Resources