Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
Free video file converter for c#
29 novembre 2011, par Richard77I'm looking for a library in C#(not commandline) that converts video files' from one format to another.
While googling, I've seen that many people have asked this question before. Unfortunately those questions were asked years in the past. The most recent of them was aked in april of 2010.
I've read a lot about FFMPEG, but I don't see any tutorial on how to use that library in C#.
Please, help with sample codes if possible.
Thanks for helping
-
ffmpeg command to convert jpg and mp3 to a video [closed]
28 novembre 2011, par ParminderI want to convert a song and jpg file into a mpg video. What is the exact command for that. I tried this one Add an image to mp3, and convert it to a video file using ffmpeg, but couldnt understand what is loop input and things.
Help will be appreciated.
Parminder
-
System command - doesn't get return
28 novembre 2011, par waxicalSeem to have a problem with PHP system command - I place a command with it and if return code is above 0 - I cite failure otherwise I carry on.
It never seems to return on FFMPEG commands lower than a certain number of seconds (generally 3-5 seconds duration video encodes that are very quick to encode). Is this something that'd be from FFMPEG not returning properly or system command?
An example command:-
system('ffmpeg -i /home/test.wmv -f flv 340x160 -vcodec libx264 export.flv', $returnCode); if($returnCode > 0) { error(); }
The only way to get round this seems to be to run a timer and check log files if nothing back after an amount of time but if anyone has any pointers - be gratefully received.
-
ffmpeg random images from video but in order
28 novembre 2011, par RussellHarrowerOk, so I am using linux, and I have ffmpeg working, coding videos and making the image
But what I would like is to make ffmpeg make up to 10 images from the video.
I was wondering how I would do this. currently I use the following for images.
//execute ffmepg to get picture exec("/usr/bin/ffmpeg -vframes 1 -ss ".$time_in_seconds." -i converted_vids/".$name.".".$type." video_images/".$name."_%02d.jpg -y 2> log/image_".$name.".txt");
-
UnsatisfiedLInkError Linking to FFMPEG with NDK
28 novembre 2011, par U AvalosI compiled FFMPEG for android using bambuser's files. The compile runs fine. No errors. I also made sure to change the package name in build.sh. However, once I try to link to the files, the phone throws an UnsatisfiedLinkError. This is the Androkd.mk file:
LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) MY_LIB_PATH := ffmpeg-android/build/ffmpeg/armeabi/lib LOCAL_MODULE := bambuser-libavcore LOCAL_SRC_FILES := $(MY_LIB_PATH)/libavcore.so include $(PREBUILT_SHARED_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := bambuser-libavformat LOCAL_SRC_FILES := $(MY_LIB_PATH)/libavformat.so include $(PREBUILT_SHARED_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := bambuser-libavcodec LOCAL_SRC_FILES := $(MY_LIB_PATH)/libavcodec.so include $(PREBUILT_SHARED_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := bambuser-libavdevice LOCAL_SRC_FILES := $(MY_LIB_PATH)/libavdevice.so include $(PREBUILT_SHARED_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := bambuser-libavfilter LOCAL_SRC_FILES := $(MY_LIB_PATH)/libavfilter.so include $(PREBUILT_SHARED_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := bambuser-libavutil LOCAL_SRC_FILES := $(MY_LIB_PATH)/libavutil.so include $(PREBUILT_SHARED_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := bambuser-libswscale LOCAL_SRC_FILES := $(MY_LIB_PATH)/libswscale.so include $(PREBUILT_SHARED_LIBRARY) #local_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := libtest_jni LOCAL_SRC_FILES := libtest/video.c LOCAL_C_INCLUDES := \ $(LOCAL_PATH)/include \ $(LOCAL_PATH)/ffmpeg-android/ffmpeg LOCAL_LDLIBS := -L$(NDK_PLATFORMS_ROOT)/$(TARGET_PLATFORM)/arch-arm/usr/lib -L$(LOCAL_PATH) -L$(LOCAL_PATH)/ffmpeg-android/build/ffmpeg/armeabi/lib/ -lavformat -lavcodec -lavdevice -lavfilter -lavutil -lswscale -llog -lz -lm #dl -lgcc include $(BUILD_SHARED_LIBRARY)
Video.c is dead simple:
#include
avcodec.h> #include avformat.h> #include swscale.h> #include #include #include #include log.h> void Java_com_bukabros_videolivewallpaper_Opengl2Renderer_loadNthFrame3 (JNIEnv * env, jobject this, jstring fileName) { jboolean isCopy; const char * szLogThis = (*env)->GetStringUTFChars(env, fileName, &isCopy); __android_log_print(ANDROID_LOG_DEBUG, "NDK: ", "NDK:LC: [%s]", szLogThis); } Tne corresponding Java code is also simple:
private native void loadNthFrame3(String fileName); static { System.loadLibrary("libtest_jni"); }
But I get this error:
E/AndroidRuntime(11489): FATAL EXCEPTION: main E/AndroidRuntime(11489): java.lang.ExceptionInInitializerError E/AndroidRuntime(11489): at com.bukabros.videolivewallpaper.VideoLiveWallpaper$CubeEngine.
(VideoLiveWallpaper.java:147) E/AndroidRuntime(11489): at com.bukabros.videolivewallpaper.VideoLiveWallpaper.onCreateEngine(VideoLiveWallpaper.java:120) E/AndroidRuntime(11489): at android.service.wallpaper.WallpaperService$IWallpaperEngineWrapper.executeMessage(WallpaperService.java:814) E/AndroidRuntime(11489): at com.android.internal.os.HandlerCaller$MyHandler.handleMessage(HandlerCaller.java:61) E/AndroidRuntime(11489): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime(11489): at android.os.Looper.loop(Looper.java:123) E/AndroidRuntime(11489): at android.app.ActivityThread.main(ActivityThread.java:4627) E/AndroidRuntime(11489): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime(11489): at java.lang.reflect.Method.invoke(Method.java:521) E/AndroidRuntime(11489): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878) E/AndroidRuntime(11489): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636) E/AndroidRuntime(11489): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime(11489): Caused by: java.lang.UnsatisfiedLinkError: Library libtest_jni not found E/AndroidRuntime(11489): at java.lang.Runtime.loadLibrary(Runtime.java:461) E/AndroidRuntime(11489): at java.lang.System.loadLibrary(System.java:557) E/AndroidRuntime(11489): at com.bukabros.videolivewallpaper.Opengl2Renderer. (Opengl2Renderer.java:389) E/AndroidRuntime(11489): ... 12 more I tried manually loading the prebuilt shared libraries (the bambuser files) in Java (using System.loadLibrary) but then it tells me that the files are not found.
If it helps, here's the output of readelf:
0x00000001 (NEEDED) Shared library: [libc.so] 0x00000001 (NEEDED) Shared library: [libstdc++.so] 0x00000001 (NEEDED) Shared library: [libm.so] 0x00000001 (NEEDED) Shared library: [/data/data/com.bukabros.videolivewallpaper/lib/libavformat.so] 0x00000001 (NEEDED) Shared library: [/data/data/com.bukabros.videolivewallpaper/lib/libavcodec.so] 0x00000001 (NEEDED) Shared library: [/data/data/com.bukabros.videolivewallpaper/lib/libavdevice.so] 0x00000001 (NEEDED) Shared library: [/data/data/com.bukabros.videolivewallpaper/lib/libavfilter.so] 0x00000001 (NEEDED) Shared library: [/data/data/com.bukabros.videolivewallpaper/lib/libavutil.so] 0x00000001 (NEEDED) Shared library: [/data/data/com.bukabros.videolivewallpaper/lib/libswscale.so] 0x00000001 (NEEDED) Shared library: [liblog.so] 0x00000001 (NEEDED) Shared library: [libz.so] 0x00000001 (NEEDED) Shared library: [libdl.so] 0x0000000e (SONAME) Library soname: [libtest_jni.so] 0x00000010 (SYMBOLIC) 0x0 0x00000004 (HASH) 0xd4 0x00000005 (STRTAB) 0x250 0x00000006 (SYMTAB) 0x130 0x0000000a (STRSZ) 712 (bytes) 0x0000000b (SYMENT) 16 (bytes) 0x00000003 (PLTGOT) 0x174c 0x00000002 (PLTRELSZ) 32 (bytes) 0x00000014 (PLTREL) REL 0x00000017 (JMPREL) 0x55c 0x6ffffffe (VERNEED) 0x53c 0x6fffffff (VERNEEDNUM) 1 0x6ffffff0 (VERSYM) 0x518 0x00000000 (NULL) 0x0
Oh yeah. I'm using ndk r5.