Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
Android Video Manipulation Performance ?
13 novembre 2014, par DeanKI am facing a difficult headache where I need to optimize the performance of a outsourced piece of code. In this outsourced application I need to cut, trim, scale and crop video.
I see they were using some kind of FFMPEG Library (without NDK), but the performance was very terrible. It takes the app 30 seconds to
-vf crop=480:480:0:80 -preset ultrafast -threads 5 -vcodec libx264 -acodec copy
a 15 seconds 640x480 videos. I need it to crop in 2 or 3 seconds, just like how Instagram did with their videos.
Any suggestion, tutorial or general approach to this? Should I continue to optimize the FFMPEG parameters, should I compile FFMPEG using
NDK
and use other FFMPEG Wrapper, or should I useTextureView
? I also need to apply filter like-vf curves
, so maybe TextureView is not the right approach. -
Preview video in android before saving to phone
13 novembre 2014, par ZoeI'm in the process of creating a video editor for android. I am loading .mp4 videos into a timeline, where each rectangle in the timeline represents an imported video and I can drag/drop and rearrange these videos etc before saving the new .mp4 to my phone.
I've been using mp4parser to do this, however I have ffmpeg loaded too but have avoided using this as I'm not too familiar with c++
I have a space for a video player in my app. The idea is to have a seek line that can be dragged along the timeline as you are editing, and I want the player to be able to play a the edited video at the given point.
However, the only examples on how to implement video players in android require you to load this video from your phone to play it. I was thinking I could just play the loaded videos separately but one after another giving the impression you're watching a whole video, but I'm later planning to add functionality to include transitions and subtitles to videos which you would not be able to preview using this method.
Any ideas on how about I can go about implementing a video player to preview the media whilst editing?
Thank you.
-
Running FFMPEG in background in PHP file
13 novembre 2014, par Zohaib KhalidHey I am using ffmpeg to store live camera streaming in PHP. I have already downloaded the compiled ffmpeg library and just use its path in php to store stream. The command is :
C:\ffmpeg\bin\ffmpeg -i "http://10.11.16.120:90/livestream.cgi?user=admin&pwd=&streamid=0&audio=0&filename=" -c:v libx264 -t 10 -an F:\Camera_Videos\video.mp4
Now it waits until ffmpeg compeletes its task and then php code will further run but i want to run ffmpeg in background i have also tried this by adding
> /dev/null 2>/dev/null &
but it didn't work . Pleae tell , any help would be appreciated.
-
How to trim the video using FFMPEG library in android ?
13 novembre 2014, par user3069551In My Project,uploading the video ( duration is 10 seconds only) to amazon .So when i choose video from library of 30 seconds then i want trim the video to 10 seconds or may be less.I am using Mp4 Parser for trimming the videos but when trim the portrait video,it is converting to landscape mode and the video rotation also changes.I done lot of research in google but no solution lastly I found one solution that FFMPEG library.In windows the ffmpeg library is not building.So what can I do now?I am new to the FFMPEG library.Please give the suggestions how to build the FFMPEG library in android.Thanks in advance
-
Can I Config FFMEG-2.4.3 to use in android windows 64 ?
13 novembre 2014, par Ngo KyI want to build ffmpeg-2.4.3 (lastest c lib) to use it on android for managing video. my OS is windows 7 Utimate x64 cywin64 in directory: C:/cywin64/ have make installed. NDK in directory: D:\solfware\Programming\android-ndk-r10c
i follow toturial form: http://www.roman10.net/how-to-build-ffmpeg-for-android/comment-page-1/ my project struture like:
i create build_android.sh like roman10 as following code:
# ARMv7+Neon (Cortex-A8) # Customizing: # 1. Feel free to change ./configure parameters for more features # 2. To adapt other ARM variants # set $CPU and $OPTIMIZE_CFLAGS # call build_one ###################################################### NDK=D:\solfware\Programming\android-ndk-r10c PLATFORM=$NDK/platforms/android-8/arch-arm/ PREBUILT=$NDK/prebuilt/windows-x86_64 function build_one { ./configure --target-os=linux \ --prefix=$PREFIX \ --enable-cross-compile \ --extra-libs="-lgcc" \ --arch=arm \ --cc=$PREBUILT/bin/arm-linux-androideabi-gcc \ --cross-prefix=$PREBUILT/bin/arm-linux-androideabi- \ --nm=$PREBUILT/bin/arm-linux-androideabi-nm \ --sysroot=$PLATFORM \ --extra-cflags=" -O3 -fpic -DANDROID -DHAVE_SYS_UIO_H=1 -Dipv6mr_interface=ipv6mr_ifindex -fasm -Wno-psabi -fno-short-enums -fno-strict-aliasing -finline-limit=300 $OPTIMIZE_CFLAGS " \ --disable-shared \ --enable-static \ --extra-ldflags="-Wl,-rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -nostdlib -lc -lm -ldl -llog" \ --disable-everything \ --enable-demuxer=mov \ --enable-demuxer=h264 \ --disable-ffplay \ --enable-protocol=file \ --enable-avformat \ --enable-avcodec \ --enable-decoder=rawvideo \ --enable-decoder=mjpeg \ --enable-decoder=h263 \ --enable-decoder=mpeg4 \ --enable-decoder=h264 \ --enable-parser=h264 \ --disable-network \ --enable-zlib \ --disable-avfilter \ --disable-avdevice \ $ADDITIONAL_CONFIGURE_FLAG make clean make -j4 install $PREBUILT/bin/arm-linux-androideabi-ar d libavcodec/libavcodec.a inverse.o $PREBUILT/bin/arm-linux-androideabi-ld -rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -soname libffmpeg.so -shared -nostdlib -z,noexecstack -Bsymbolic --whole-archive --no-undefined -o $PREFIX/libffmpeg.so libavcodec/libavcodec.a libavformat/libavformat.a libavutil/libavutil.a libswscale/libswscale.a -lc -lm -lz -ldl -llog --warn-once --dynamic-linker=/system/bin/linker $PREBUILT/lib/gcc/arm-linux-androideabi/4.4.3/libgcc.a } #arm v6 #CPU=armv6 #OPTIMIZE_CFLAGS="-marm -march=$CPU" #PREFIX=./android/$CPU #ADDITIONAL_CONFIGURE_FLAG= #build_one #arm v7vfpv3 CPU=armv7-a OPTIMIZE_CFLAGS="-mfloat-abi=softfp -mfpu=vfpv3-d16 -marm -march=$CPU " PREFIX=./android/$CPU ADDITIONAL_CONFIGURE_FLAG= build_one #arm v7vfp #CPU=armv7-a #OPTIMIZE_CFLAGS="-mfloat-abi=softfp -mfpu=vfp -marm -march=$CPU " #PREFIX=./android/$CPU-vfp #ADDITIONAL_CONFIGURE_FLAG= #build_one #arm v7n #CPU=armv7-a #OPTIMIZE_CFLAGS="-mfloat-abi=softfp -mfpu=neon -marm -march=$CPU -mtune=cortex-a8" #PREFIX=./android/$CPU #ADDITIONAL_CONFIGURE_FLAG=--enable-neon #build_one #arm v6+vfp #CPU=armv6 #OPTIMIZE_CFLAGS="-DCMP_HAVE_VFP -mfloat-abi=softfp -mfpu=vfp -marm -march=$CPU" #PREFIX=./android/${CPU}_vfp #ADDITIONAL_CONFIGURE_FLAG= #build_one
i have set my path like above I built it in Eclipse Everything is ok. but when i ran it in Android it crashed Unfortunately. I found the errors in Logcat monitor:
E/AndroidRuntime(1931): java.lang.UnsatisfiedLinkError: Couldn't load avcodec-55 from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/roman10.tutorial.android_ffmpeg_tutorial02-2.apk"],nativeLibraryDirectories=[/data/app-lib/roman10.tutorial.android_ffmpeg_tutorial02-2, /system/lib]]]: findLibrary returned null
E/AndroidRuntime(1931): at java.lang.Runtime.loadLibrary(Runtime.java:358)
In my activity i just call add Library from C preference like:
static { //System.loadLibrary("avutil-52"); System.loadLibrary("avcodec-55"); System.loadLibrary("avformat-55"); System.loadLibrary("swscale-2"); System.loadLibrary("tutorial02"); }
i check in DDMS in app-lib there is no existing Library in there.
The question is: Can i can compile the ffmpeg on windows? if ok. how can i config build_android.sh to point to Android $PREBUILT
PLATFORM=$NDK/platforms/android-8/arch-arm/ PREBUILT=$NDK/prebuilt/windows-x86_64 function build_one { ./configure --target-os=linux \ --prefix=$PREFIX \ --enable-cross-compile \ --extra-libs="-lgcc" \ --arch=arm \ --cc=$PREBUILT/bin/arm-linux-androideabi-gcc \ --cross-prefix=$PREBUILT/bin/arm-linux-androideabi- \ --nm=$PREBUILT/bin/arm-linux-androideabi-nm \ --sysroot=$PLATFORM \ --extra-cflags=" -O3 -fpic -DANDROID -DHAVE_SYS_UIO_H=1 -Dipv6mr_interface=ipv6mr_ifindex -fasm -Wno-psabi -fno-short-enums -fno-strict-aliasing -finline-limit=300 $OPTIMIZE_CFLAGS " \ --disable-shared \
i found that in $NDK/prebuilt/windows-x86_64/bin did not exist arm-linux-androideabi-gcc\ How can i config to be suitable to run on windows?
Thank in advanced