
Recherche avancée
Médias (1)
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
Autres articles (47)
-
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Librairies et binaires spécifiques au traitement vidéo et sonore
31 janvier 2010, parLes logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
Binaires complémentaires et facultatifs flvtool2 : (...) -
Utilisation et configuration du script
19 janvier 2011, parInformations spécifiques à la distribution Debian
Si vous utilisez cette distribution, vous devrez activer les dépôts "debian-multimedia" comme expliqué ici :
Depuis la version 0.3.1 du script, le dépôt peut être automatiquement activé à la suite d’une question.
Récupération du script
Le script d’installation peut être récupéré de deux manières différentes.
Via svn en utilisant la commande pour récupérer le code source à jour :
svn co (...)
Sur d’autres sites (8445)
-
IOException : Error running exec() Command, When calling FFmpeg method
21 avril 2016, par kc ochibilii am trying to create a slide show mp4 using this ffmpeg method but i keep getting this IOException
Error running exec(). Command
when i click the button.here is my call
ffmpegController = new FfmpegController(getTempDirectory(), new File(""));
ffmpegController.createSlideshowFromImagesAndAudio(slideFrames, getAudioPath(), getOutPath(), 500, mCallbackResponse);Here is the source code of the small project.
Here is the apkAnd here is my Error message
Error running exec(). Command: [ffmpeg, -y, -i, /storage/emulated/0/TestFFmpeg/frame1.png, /storage/emulated/0/TestFFmpeg/temp/image-000.jpg]
Working Directory: lib Environment: [VIBE_PIPE_PATH=/dev/pipes, ANDROID_ROOT=/system, EMULATED_STORAGE_SOURCE=/mnt/shell/emulated, LOOP_MOUNTPOINT=/mnt/obb, EMULATED_STORAGE_TARGET=/storage/emulated, ANDROID_BOOTLOGO=1, LD_LIBRARY_PATH=/vendor/lib:/system/lib, EXTERNAL_STORAGE=/storage/emulated/legacy, ANDROID_SOCKET_zygote=9, ANDROID_DATA=/data, PATH=/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin, ANDROID_ASSETS=/system/app, ASEC_MOUNTPOINT=/mnt/asec, BOOTCLASSPATH=/system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/framework2.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/sec_edm.jar:/system/framework/seccamera.jar:/system/framework/secocsp.jar:/system/framework/sc.jar:/system/framework/scrollpause.jar:/system/framework/stayrotation.jar:/system/framework/smartfaceservice.jar:/system/framework/sws.jar:/system/framework/WfdCommon.jar, ANDROID_PROPERTY_WORKSPACE=8,66560, SECONDARY_STORAGE=/storage/extSdCard:/storage/UsbDriveA:/storage/UsbDriveB:/storage/UsbDriveC:/storage/UsbDriveD:/storage/UsbDriveE:/storage/UsbDriveF, ANDROID_STORAGE=/storage]Here is my Activity code :
public class MainActivity extends Activity {
Button testButton;
EditText errorLogView;
TinyDB tinydb;// sharedPreference Wrapper
static Context context;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
context = getApplicationContext();
tinydb = new TinyDB(context); // sharedPreference Wrapper
testButton = (Button) findViewById(R.id.test_Image_View);
errorLogView = (EditText) findViewById(R.id.errorlog);
setListeners();
}
public void setListeners(){
testButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Bitmap frame1Bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher);
//Saves the image to the file system an returns the path
String firstFrame = tinydb.putImagePNG("TestFFmpeg", "frame1.png", frame1Bitmap);
String secondFrame = tinydb.putImagePNG("TestFFmpeg", "frame2.png", frame1Bitmap);
String thirdFrame = tinydb.putImagePNG("TestFFmpeg", "frame3.png", frame1Bitmap);
ArrayList<clip> slideFrames = new ArrayList<clip>();
slideFrames.add(new Clip(firstFrame));
slideFrames.add(new Clip(secondFrame));
slideFrames.add(new Clip(thirdFrame));
copyResourceSoundToSDCard();
FfmpegController ffmpegController = null;
try {
ffmpegController = new FfmpegController(getTempDirectory(), new File(""));
ffmpegController.createSlideshowFromImagesAndAudio(slideFrames, getAudioPath(), getOutPath(), 500, mCallbackResponse);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
toast("FileNotFoundException");
toast(e.getLocalizedMessage());
} catch (IOException e) {
// TODO Auto-generated catch block
toast("IOException");
toast(e.getLocalizedMessage());
errorLogView.setText(e.getLocalizedMessage());
e.printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
toast("Exception ");
toast(e.getLocalizedMessage());
}
}
});
}
public Clip getAudioPath(){
Clip mAudPath = null;
try {
mAudPath = new Clip(new File(tinydb.getString("audpath")).getCanonicalPath());
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
return mAudPath;
}
public Clip getOutPath(){
String videoName = ("myTestVideo.mp4");
String saveFolder = ("TestFFmpeg/videos");
String movieFullPath = setupAudioFolder(saveFolder, videoName);
Clip outPath = null;
try {
outPath = new Clip(new File(movieFullPath).getCanonicalPath());
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
tinydb.putString("outhPath", outPath.path);
return outPath;
}
public void copyResourceSoundToSDCard(){
try {
copyRawFile(context, R.raw.screens_shot_sound, getResaveDirectory(), "755");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
private File getResaveDirectory(){
String audioName = ("ShotSound.wav");
String saveFolder = ("TestFFmpeg");
File appRootFile;
String path = setupAudioFolder(saveFolder, audioName);
tinydb.putString("audpath", path);
appRootFile = new File(path);
return appRootFile;
}
public String setupAudioFolder(String theFolder, String theImageName){
File sdcard_path = Environment.getExternalStorageDirectory();
File mFolder = new File(sdcard_path, theFolder);
if (!mFolder.exists()) {
if (!mFolder.mkdirs()) {
Log.e("While creatingsave path",
"Default Save Path Creation Error");
// Toast("Default Save Path Creation Error");
}
}
String mFullPath = mFolder.getPath() + '/' + theImageName;
return mFullPath;
}
private static void copyRawFile(Context ctx, int resid, File file, String mode) throws IOException, InterruptedException
{
final String abspath = file.getAbsolutePath();
// Write the iptables binary
final FileOutputStream out = new FileOutputStream(file);
final InputStream is = ctx.getResources().openRawResource(resid);
byte buf[] = new byte[1024];
int len;
while ((len = is.read(buf)) > 0) {
out.write(buf, 0, len);
}
out.close();
is.close();
// Change the permissions
Runtime.getRuntime().exec("chmod "+mode+" "+abspath).waitFor();
}
ShellCallback mCallbackResponse = new ShellUtils.ShellCallback() {
@Override
public void shellOut(String shellLine) {
// TODO Auto-generated method stub
}
@Override
public void processComplete(int exitValue) {
// TODO Auto-generated method stub
toast("process done");
}
};
public File getTempDirectory(){
String saveFolder = ("TestFFmpeg/temp");
File appRootFile = setupCustomFile(saveFolder);
return appRootFile;
}
public File setupCustomFile(String theFolder){
File sdcard_path = Environment.getExternalStorageDirectory();
File mFolder = new File(sdcard_path, theFolder);
if (!mFolder.exists()) {
if (!mFolder.mkdirs()) {
Log.e("While creatingsave path",
"Default Save Path Creation Error");
// Toast("Default Save Path Creation Error");
}
}
return mFolder;
}
public static void toast(String thetext) {
Toast.makeText(context, thetext, Toast.LENGTH_LONG).show();
}
</clip></clip>any help would be appreciated
-
avcodec/mjpegdec : Fix chroma width rounding
13 septembre 2014, par Clément Bœsch -
Filter complex apply on ffmpeg for android outputs low quality video
17 septembre 2014, par AlinI finally managed to build ffmpeg as detailed in here : https://enoent.fr/blog/2014/06/20/compile-ffmpeg-for-android/ and in the end, I have a ffmpeg library which accepts command arguments.
I am trying to apply a watermark image over the video so for it I am using preparing this ffmpeg command :
ffmpeg -i input.avi -i logo.png -filter_complex 'overlay=10:main_h-overlay_h-10' output.avi
I have first tried it on windows using ffmpeg.exe and the result was as expected.
I have tried it on android using the compiled android and the output is as follows :
09-17 01:16:57.156: I/Videokit(1229): Loading native library compiled at 22:33:10 Sep 15 2014
09-17 01:16:57.156: I/Videokit(1229): Option: ffmpeg
09-17 01:16:57.156: I/Videokit(1229): Option: -loglevel
09-17 01:16:57.156: I/Videokit(1229): Option: debug
09-17 01:16:57.156: I/Videokit(1229): Option: -i
09-17 01:16:57.156: I/Videokit(1229): Option: /storage/emulated/0/mute.mp4
09-17 01:16:57.156: I/Videokit(1229): Option: -i
09-17 01:16:57.156: I/Videokit(1229): Option: /storage/emulated/0/logo.png
09-17 01:16:57.156: I/Videokit(1229): Option: -filter_complex
09-17 01:16:57.156: I/Videokit(1229): Option: overlay=10:main_h-overlay_h-10
09-17 01:16:57.156: I/Videokit(1229): Option: /storage/emulated/0/outVid.mp4
09-17 01:16:57.156: I/Videokit(1229): Running main
09-17 01:16:57.163: D/Videokit(1229): Splitting the commandline.
09-17 01:16:57.163: D/Videokit(1229): Reading option '-loglevel' ...
09-17 01:16:57.163: D/Videokit(1229): matched as option 'loglevel' (set logging level) with argument 'debug'.
09-17 01:16:57.163: D/Videokit(1229): Reading option '-i' ...
09-17 01:16:57.163: D/Videokit(1229): matched as input file with argument '/storage/emulated/0/mute.mp4'.
09-17 01:16:57.163: D/Videokit(1229): Reading option '-i' ...
09-17 01:16:57.163: D/Videokit(1229): matched as input file with argument '/storage/emulated/0/logo.png'.
09-17 01:16:57.163: D/Videokit(1229): Reading option '-filter_complex' ...
09-17 01:16:57.163: D/Videokit(1229): matched as option 'filter_complex' (create a complex filtergraph) with argument 'overlay=10:main_h-overlay_h-10'.
09-17 01:16:57.163: D/Videokit(1229): Reading option '/storage/emulated/0/outVid.mp4' ...
09-17 01:16:57.163: D/Videokit(1229): matched as output file.
09-17 01:16:57.163: D/Videokit(1229): Finished splitting the commandline.
09-17 01:16:57.163: D/Videokit(1229): Parsing a group of options: global .
09-17 01:16:57.163: D/Videokit(1229): Applying option loglevel (set logging level) with argument debug.
09-17 01:16:57.163: D/Videokit(1229): Applying option filter_complex (create a complex filtergraph) with argument overlay=10:main_h-overlay_h-10.
09-17 01:16:57.163: D/Videokit(1229): Successfully parsed a group of options.
09-17 01:16:57.163: D/Videokit(1229): Parsing a group of options: input file /storage/emulated/0/mute.mp4.
09-17 01:16:57.163: D/Videokit(1229): Successfully parsed a group of options.
09-17 01:16:57.163: D/Videokit(1229): Opening an input file: /storage/emulated/0/mute.mp4.
09-17 01:16:57.296: D/Videokit(1229): Successfully opened the file.
09-17 01:16:57.296: D/Videokit(1229): Parsing a group of options: input file /storage/emulated/0/logo.png.
09-17 01:16:57.296: D/Videokit(1229): Successfully parsed a group of options.
09-17 01:16:57.296: D/Videokit(1229): Opening an input file: /storage/emulated/0/logo.png.
09-17 01:16:57.304: D/Videokit(1229): Successfully opened the file.
09-17 01:16:57.304: D/Videokit(1229): Parsing a group of options: output file /storage/emulated/0/outVid.mp4.
09-17 01:16:57.304: D/Videokit(1229): Successfully parsed a group of options.
09-17 01:16:57.304: D/Videokit(1229): Opening an output file: /storage/emulated/0/outVid.mp4.
09-17 01:16:57.312: D/Videokit(1229): Successfully opened the file.
09-17 01:16:57.351: I/Videokit(1229): Stream mapping:
09-17 01:16:57.351: I/Videokit(1229): Stream #0:0 (h264) -> overlay:main
09-17 01:16:57.351: I/Videokit(1229): Stream #1:0 (png) -> overlay:overlay
09-17 01:16:57.351: I/Videokit(1229): overlay
09-17 01:16:57.351: I/Videokit(1229): -> Stream #0:0 (mpeg4)
09-17 01:16:57.351: I/Videokit(1229): Press [q] to stop, [?] for help
09-17 01:16:57.890: I/Videokit(1229): frame= 12 fps=0.0 q=24.3 size= 113kB time=00:00:00.40 bitrate=2314.9kbits/s
09-17 01:16:58.413: I/Videokit(1229): frame= 26 fps= 25 q=31.0 size= 154kB time=00:00:00.86 bitrate=1455.1kbits/s
09-17 01:16:58.953: I/Videokit(1229): frame= 38 fps= 24 q=31.0 size= 180kB time=00:00:01.26 bitrate=1165.0kbits/s
09-17 01:17:00.085: I/Videokit(1229): frame= 50 fps= 24 q=31.0 size= 205kB time=00:00:01.66 bitrate=1006.8kbits/s
09-17 01:17:00.163: I/Videokit(1229): frame= 51 fps= 19 q=31.0 size= 206kB time=00:00:01.70 bitrate= 992.8kbits/s
09-17 01:17:00.632: I/Videokit(1229): frame= 64 fps= 20 q=31.0 size= 230kB time=00:00:02.13 bitrate= 883.9kbits/s
09-17 01:17:01.156: I/Videokit(1229): frame= 78 fps= 21 q=31.0 size= 254kB time=00:00:02.60 bitrate= 798.5kbits/s
09-17 01:17:01.679: I/Videokit(1229): frame= 92 fps= 21 q=31.0 size= 275kB time=00:00:03.06 bitrate= 734.7kbits/s
09-17 01:17:02.179: I/Videokit(1229): frame= 106 fps= 22 q=31.0 size= 296kB time=00:00:03.53 bitrate= 684.8kbits/s
09-17 01:17:02.726: I/Videokit(1229): frame= 121 fps= 23 q=24.8 size= 325kB time=00:00:04.03 bitrate= 660.1kbits/s
09-17 01:17:03.249: I/Videokit(1229): frame= 134 fps= 23 q=31.0 size= 344kB time=00:00:04.47 bitrate= 629.8kbits/s
09-17 01:17:03.781: I/Videokit(1229): frame= 147 fps= 23 q=31.0 size= 368kB time=00:00:04.90 bitrate= 614.2kbits/s
09-17 01:17:04.335: I/Videokit(1229): frame= 159 fps= 23 q=31.0 size= 390kB time=00:00:05.30 bitrate= 602.1kbits/s
09-17 01:17:04.921: I/Videokit(1229): frame= 171 fps= 23 q=31.0 size= 412kB time=00:00:05.70 bitrate= 591.3kbits/s
09-17 01:17:05.437: I/Videokit(1229): frame= 183 fps= 23 q=31.0 size= 432kB time=00:00:06.10 bitrate= 579.8kbits/s
09-17 01:17:05.937: I/Videokit(1229): frame= 196 fps= 23 q=31.0 size= 453kB time=00:00:06.53 bitrate= 568.0kbits/s
09-17 01:17:06.453: I/Videokit(1229): frame= 210 fps= 23 q=31.0 size= 483kB time=00:00:07.00 bitrate= 565.2kbits/s
09-17 01:17:06.976: I/Videokit(1229): frame= 224 fps= 23 q=31.0 size= 513kB time=00:00:07.47 bitrate= 562.3kbits/s
09-17 01:17:07.515: I/Videokit(1229): frame= 239 fps= 24 q=31.0 size= 538kB time=00:00:07.97 bitrate= 553.1kbits/s
09-17 01:17:08.007: I/Videokit(1229): frame= 249 fps= 23 q=31.0 size= 559kB time=00:00:08.30 bitrate= 551.2kbits/s
09-17 01:17:08.531: I/Videokit(1229): frame= 262 fps= 24 q=31.0 size= 581kB time=00:00:08.74 bitrate= 544.6kbits/s
09-17 01:17:09.359: I/Videokit(1229): frame= 272 fps= 23 q=31.0 size= 602kB time=00:00:09.07 bitrate= 543.1kbits/s
09-17 01:17:09.882: I/Videokit(1229): frame= 284 fps= 23 q=31.0 size= 624kB time=00:00:09.47 bitrate= 539.5kbits/s
09-17 01:17:10.374: I/Videokit(1229): frame= 296 fps= 23 q=31.0 size= 651kB time=00:00:09.87 bitrate= 540.2kbits/s
09-17 01:17:10.898: I/Videokit(1229): frame= 309 fps= 23 q=31.0 size= 682kB time=00:00:10.31 bitrate= 542.1kbits/s
09-17 01:17:11.406: I/Videokit(1229): frame= 324 fps= 23 q=31.0 size= 710kB time=00:00:10.81 bitrate= 538.3kbits/s
09-17 01:17:11.929: I/Videokit(1229): frame= 343 fps= 24 q=31.0 size= 749kB time=00:00:11.44 bitrate= 536.2kbits/s
09-17 01:17:12.437: I/Videokit(1229): frame= 361 fps= 24 q=24.8 size= 787kB time=00:00:12.04 bitrate= 535.3kbits/s
09-17 01:17:12.953: I/Videokit(1229): frame= 379 fps= 24 q=31.0 size= 821kB time=00:00:12.64 bitrate= 531.8kbits/s
09-17 01:17:13.460: I/Videokit(1229): frame= 397 fps= 25 q=24.8 size= 869kB time=00:00:13.24 bitrate= 537.2kbits/s
09-17 01:17:13.960: I/Videokit(1229): frame= 413 fps= 25 q=31.0 size= 903kB time=00:00:13.78 bitrate= 537.0kbits/s
09-17 01:17:14.468: I/Videokit(1229): frame= 430 fps= 25 q=31.0 size= 942kB time=00:00:14.34 bitrate= 537.7kbits/s
09-17 01:17:14.601: V/Videokit(1229): No more output streams to write to, finishing.
09-17 01:17:14.609: I/Videokit(1229): frame= 435 fps= 25 q=31.0 Lsize= 959kB time=00:00:14.51 bitrate= 541.2kbits/s
09-17 01:17:14.609: I/Videokit(1229): video:956kB audio:0kB subtitle:0 data:0 global headers:0kB muxing overhead 0.275524%
09-17 01:17:14.609: D/Videokit(1229): 439 frames successfully decoded, 0 decoding errors
09-17 01:17:14.617: I/Videokit(1229): Main ended with status 0The problem is that the output on android has very poor quality How can I make ffmpeg build a video with a quality close to the original file. I presume that filter_complex forces a new video encode.