Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
Android ndk link failed on libgnustl_shared.so
15 juin 2016, par nmxprimei have compiled ffmpeg with libstagefright
In the last, while linking i got undefined references using below
$PREBUILT/bin/arm-linux-androideabi-ld -rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -soname libffsft1.so -shared -nostdlib -z,noexecstack -Bsymbolic --whole-archive --no-undefined -o $PREFIX/libffsft1.so libavcodec/libavcodec.a libavformat/libavformat.a libavutil/libavutil.a libswscale/libswscale.a -lc -lm -lz -ldl -llog -lstdc++ -lx264 -lmedia -lutils -lstagefright -lbinder --warn-once --dynamic-linker=/system/bin/linker $PREBUILT/lib/gcc/arm-linux-androideabi/4.4.3/$CPU/libgcc.a
Refering this i modified as below
$PREBUILT/bin/arm-linux-androideabi-ld -rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -soname libffsft1.so -shared -nostdlib -z,noexecstack -Bsymbolic --whole-archive --no-undefined -o $PREFIX/libffsft1.so libavcodec/libavcodec.a libavformat/libavformat.a libavutil/libavutil.a libswscale/libswscale.a -lc -lm -lz -ldl -llog -lstdc++ -lx264 -lmedia -lutils -lstagefright -lbinder --warn-once --dynamic-linker=/system/bin/linker $NDK/sources/cxx-stl/gnu-libstdc++/libs/armeY-›v7a/libgnustl_shared.so $PREBUILT/lib/gcc/arm-linux-androideabi/4.4.3/$CPU/libgcc.a
where
CPU=armv7-a PREFIX=./android/$CPU NDK=~/Android/android-ndk-r7c PLATFORM=$NDK/platforms/android-9/arch-arm/ PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86
Now i got the .so file, but when using it in Android, i got
03-11 03:26:35.760: E/AndroidRuntime(24036): at dalvik.system.NativeStart.main(Native Method) 03-11 03:26:35.760: E/AndroidRuntime(24036): Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1892]: 1908 could not load needed library 'libgnustl_shared.so' for 'libffsft1.so' (load_library[1094]: Library 'libgnustl_shared.so' not found) 03-11 03:26:35.760: E/AndroidRuntime(24036): at java.lang.Runtime.loadLibrary(Runtime.java:370) 03-11 03:26:35.760: E/AndroidRuntime(24036): at java.lang.System.loadLibrary(System.java:535)
So should i copy the required library and use a
System.loadlibrary
to load it? or do am i doing it in wrong way?
For your reference, i add the undefied references i got while not linking with
$NDK/sources/cxx-stl/gnu-libstdc++/libs/armeY-›v7a/libgnustl_shared.so
libavcodec/libavcodec.a(libstagefright.o):In function `std::_Rb_tree_const_iterator >::operator--()':/home/Android/android-ndk-r7c/sources/cxx-stl/gnu-libstdc++/include/bits/stl_tree.h:274: undefined reference to `std::_Rb_tree_decrement(std::_Rb_tree_node_base const*)' libavcodec/libavcodec.a(libstagefright.o): In function `std::_Rb_tree
, std::_Select1st >, std::less , std::allocator > >::_M_insert_(std::_Rb_tree_node_base const*, std::_Rb_tree_node_base const*, std::pair const&)':/home/Android/android-ndk-r7c/sources/cxx-stl/gnu-libstdc++/include/bits/stl_tree.h:923: undefined reference to `std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)' libavcodec/libavcodec.a(libstagefright.o): In function `std::_Rb_tree_const_iterator >::operator++()':/home/Android/android-ndk-r7c/sources/cxx-stl/gnu-libstdc++/include/bits/stl_tree.h:259: undefined reference to `std::_Rb_tree_increment(std::_Rb_tree_node_base const*)' libavcodec/libavcodec.a(libstagefright.o): In function `std::_Rb_tree_iterator >::operator++(int)':/home/Android/android-ndk-r7c/sources/cxx-stl/gnu-libstdc++/include/bits/stl_tree.h:192: undefined reference to `std::_Rb_tree_increment(std::_Rb_tree_node_base*)' libavcodec/libavcodec.a(libstagefright.o): In function `std::_Rb_tree , std::_Select1st >, std::less , std::allocator > >::erase(std::_Rb_tree_iterator >)':/home/Android/android-ndk-r7c/sources/cxx-stl/gnu-libstdc++/include/bits/stl_tree.h:1387: undefined reference to `std::_Rb_tree_rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)' libavcodec/libavcodec.a(libstagefright.o): In function `std::_Rb_tree_iterator >::operator--()':/home/Android/android-ndk-r7c/sources/cxx-stl/gnu-libstdc++/include/bits/stl_tree.h:199: undefined reference to `std::_Rb_tree_decrement(std::_Rb_tree_node_base*)' -
How to sync video and audio using ffmpeg ? [closed]
15 juin 2016, par Lợi NèI have a code. it's :
ffmpeg -i thu.mp4 -i hinhthu3.png -filter_complex "overlay=1:1" -af "atempo=1.15,equalizer=f=32:width_type=o:width=1:g=-5,equalizer=f=64:width_type=o:width=1:g=-5,equalizer=f=125:width_type=o:width=1:g=-5,equalizer=f=250:width_type=o:width=1:g=-5,equalizer=f=500:width_type=o:width=1:g=-5,equalizer=f=1000:width_type=o:width=1:g=-5,equalizer=f=2000:width_type=o:width=1:g=-5,equalizer=f=4000:width_type=o:width=1:g=-5,equalizer=f=8000:width_type=o:width=1:g=-5,equalizer=f=16000:width_type=o:width=1:g=-5,aecho=0.8:0.88:6:0.4,pan=stereo|c0code>
The audio faster than image. So how to match it together.I had tried many times but can't
-
FFMPEG merging two videos (Concatenation)
14 juin 2016, par Akshay SoodI have been trying to merge (concatenate) two mp4 videos with same height and width but some error occurs . The code is :
FFmpeg ffmpeg = FFmpeg.getInstance(EditVideoActivity.this); String list = generateList(new String[]{ActualVideoFile.getAbsolutePath(), path}); try { ffmpeg.execute("ffmpeg -f concat -i " + list + " -c:v copy " + mergedVideo.getAbsolutePath(), new FFmpegExecuteResponseHandler() { @Override public void onStart() { Log.e("Start", "Start"); } @Override public void onFinish() { Log.e("FINISHED", "finish"); } @Override public void onSuccess(String message) { Log.e("SUCCESS", message); } @Override public void onProgress(String message) { Log.e("PROGRESSSS", message); } @Override public void onFailure(String message) { Log.e("FAILURE", message); } }); } catch (FFmpegCommandAlreadyRunningException e) { e.printStackTrace(); Log.e("FFMEG Exception", "" + e); }
Logcat:
/PROGRESSSS: ffmpeg version 0.11.1 Copyright (c) 2000-2012 the FFmpeg developers 06-09 01:24:09.400 8512-8512/com.myApp E/PROGRESSSS: built on Dec 22 2014 12:52:34 with gcc 4.6 20120106 (prerelease) 06-09 01:24:09.400 8512-8512/com.myApp E/PROGRESSSS: configuration: --arch=arm --cpu=cortex-a8 --target-os=linux --enable-runtime-cpudetect --prefix=/data/data/info.guardianproject.ffmpeg/app_opt --enable-pic --disable-shared --enable-static --cross-prefix=/home/n8fr8/dev/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi- --sysroot=/home/n8fr8/dev/android/ndk/platforms/android-16/arch-arm --extra-cflags='-I../x264 -mfloat-abi=softfp -mfpu=neon -fPIE -pie' --extra-ldflags='-L../x264 -fPIE -pie' --enable-version3 --enable-gpl --disable-doc --enable-yasm --enable-decoders --enable-encoders --enable-muxers --enable-demuxers --enable-parsers --enable-protocols --enable-filters --enable-avresample --enable-libfreetype --disable-indevs --enable-indev=lavfi --disable-outdevs --enable-hwaccels --enable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-network --enable-libx264 --enable-zlib 06-09 01:24:09.400 8512-8512/com.myApp E/PROGRESSSS: libavutil 51. 54.100 / 51. 54.100 06-09 01:24:09.400 8512-8512/com.myApp E/PROGRESSSS: libavcodec 54. 23.100 / 54. 23.100 06-09 01:24:09.400 8512-8512/com.myApp E/PROGRESSSS: libavformat 54. 6.100 / 54. 6.100 06-09 01:24:09.400 8512-8512/com.myApp E/PROGRESSSS: libavdevice 54. 0.100 / 54. 0.100 06-09 01:24:09.400 8512-8512/com.myApp E/PROGRESSSS: libavfilter 2. 77.100 / 2. 77.100 06-09 01:24:09.400 8512-8512/com.myApp E/PROGRESSSS: libswscale 2. 1.100 / 2. 1.100 06-09 01:24:09.400 8512-8512/com.myApp E/PROGRESSSS: libswresample 0. 15.100 / 0. 15.100 06-09 01:24:09.400 8512-8512/com.myApp E/PROGRESSSS: libpostproc 52. 0.100 / 52. 0.100 06-09 01:24:09.400 8512-8512/com.myApp E/PROGRESSSS: [NULL @ 0x2aeef3b0] Unable to find a suitable output format for 'ffmpeg' 06-09 01:24:09.400 8512-8512/com.myApp E/PROGRESSSS: ffmpeg: Invalid argument 06-09 01:24:09.400 8512-8512/com.myApp E/FAILURE: ffmpeg version 0.11.1 Copyright (c) 2000-2012 the FFmpeg developers built on Dec 22 2014 12:52:34 with gcc 4.6 20120106 (prerelease) configuration: --arch=arm --cpu=cortex-a8 --target-os=linux --enable-runtime-cpudetect --prefix=/data/data/info.guardianproject.ffmpeg/app_opt --enable-pic --disable-shared --enable-static --cross-prefix=/home/n8fr8/dev/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi- --sysroot=/home/n8fr8/dev/android/ndk/platforms/android-16/arch-arm --extra-cflags='-I../x264 -mfloat-abi=softfp -mfpu=neon -fPIE -pie' --extra-ldflags='-L../x264 -fPIE -pie' --enable-version3 --enable-gpl --disable-doc --enable-yasm --enable-decoders --enable-encoders --enable-muxers --enable-demuxers --enable-parsers --enable-protocols --enable-filters --enable-avresample --enable-libfreetype --disable-indevs --enable-indev=lavfi --disable-outdevs --enable-hwaccels --enable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-network --enable-libx264 --enable-zlib libavutil 51. 54.100 / 51. 54.100 libavcodec 54. 23.100 / 54. 23.100 libavformat 54. 6.100 / 54. 6.100 libavdevice 54. 0.100 / 54. 0.100 libavfilter 2. 77.100 / 2. 77.100 libswscale 2. 1.100 / 2. 1.100 libswresample 0. 15.100 / 0. 15.100 libpostproc 52. 0.100 / 52. 0.100 [NULL @ 0x2aeef3b0] Unable to find a suitable output format for 'ffmpeg' ffmpeg: Invalid argument
I am using hiteshsondhi88 's FFMPEG Library Any help would be appreciated. Thanks
-
windows CMD send CRLF inside double quote
14 juin 2016, par uingteaI want to pass multiple headers for ffplay or ffmpeg, it say I need to split with CRLF. on linux I can use
\
or$'\r\n'
but how for windows?SET CRLF=^ ffplay -v debug -i "http://example.com/test" -headers "Accept-Language: en-US,en;q=0.5%CRLF%Connection: keep-alive"
debug log:
Connection: keep-alive
is not sent[http @ 04df3f40] No trailing CRLF found in HTTP header. [http @ 04df3f40] request: GET /test HTTP/1.1 0KB sq= 0B f=0/0 User-Agent: Lavf/57.37.101 Accept: */* Range: bytes=0- Connection: close Host: example.com Icy-MetaData: 1 Accept-Language: en-US,en;q=0.5
thanks
-
Errors when streaming h264 video from gstreamer to ffmpeg
14 juin 2016, par Michael NgHi I am trying to receive a udp/rtp stream with ffmpeg in the client side but is having trouble.
Server side pipeline:
gst-launch-1.0 -v filesrc location=video2.mp4 ! decodebin ! x264enc ! rtph264pay ! udpsink host=127.0.0.1 port=5006
On the client side, I can play the video with the following pipeline:
gst-launch-1.0 -e udpsrc uri=udp://0.0.0.0:5006 ! application/x-rtp, clock-rate=90000, payload=96 ! rtph264depay ! decodebin ! autovideosink
However, since I want to convert the stream into a rtsp/http stream, I tried to receive the rtp stream with ffmpeg and perform something like:
ffmpeg -i udp://127.0.0.1:5006 -acodec copy -vcodec copy http://localhost:8090/feed1.ffm
But before doing that, I was testing this approach by saving the stream into a mp4 file with:
ffmpeg -f h264 -i udp://127.0.0.1:5006 -strict -2 -f mp4 stream.mp4
But this did not work, it gave me the following error:
missing picture in access unit with size 15019525 [h264 @ 0x11d5100] no frame! [h264 @ 0x11f06c0] decoding for stream 0 failed [h264 @ 0x11f06c0] Could not find codec parameters for stream 0 (Video: h264): unspecified size Consider increasing the value for the 'analyzeduration' and 'probesize' options [h264 @ 0x11f06c0] Estimating duration from bitrate, this may be inaccurate udp://127.0.0.1:5006: could not find codec parameters
Have anyone tried such approach before or experienced similar problem, I would like to get some direction on how to solve it. Thanks!