
Recherche avancée
Autres articles (96)
-
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 -
MediaSPIP Core : La Configuration
9 novembre 2010, parMediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...) -
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
Sur d’autres sites (8543)
-
when i record video with javacv it comes "java.lang.NoClassDefFoundError : org.bytedeco.javacpp.avutil"
9 avril 2020, par Pradeep SimbaI make a video recorder android app with javacv.
But, when i run this app this error occurs "java.lang.NoClassDefFoundError : org.bytedeco.javacpp.avutil".



How can I solve this error ?



gradle.build file



android {
 ..............
 packagingOptions {
 exclude 'META-INF/services/javax.annotation.processing.Processor'
 pickFirst 'META-INF/maven/org.bytedeco.javacpp-presets/opencv/pom.properties'
 pickFirst 'META-INF/maven/org.bytedeco.javacpp-presets/opencv/pom.xml'
 pickFirst 'META-INF/maven/org.bytedeco.javacpp-presets/ffmpeg/pom.properties'
 pickFirst 'META-INF/maven/org.bytedeco.javacpp-presets/ffmpeg/pom.xml'
 }
}

dependencies {

implementation group: 'org.bytedeco', name: 'javacv', version: '1.1'
implementation group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '3.0.0-1.1', classifier: 'android-arm'
implementation group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '2.8.1-1.1', classifier: 'android-arm'
implementation group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '3.0.0-1.1', classifier: 'android-x86'
implementation group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '2.8.1-1.1', classifier: 'android-x86'

}




My demo code VideoService which will invoke in MainActivity



package com.fs.fs.api;

import com.fs.fs.App;
import com.fs.fs.utils.DateUtils;
import com.fs.fs.utils.FileUtils;

import org.bytedeco.javacpp.avcodec;
import org.bytedeco.javacv.FFmpegFrameRecorder;
import org.bytedeco.javacv.FrameRecorder;

import java.util.Date;

/**
 * Created by wyx on 2017/1/11.
 */
public class VideoService {
 private FFmpegFrameRecorder mFrameRecorder;
 private String path;

 private VideoService() {
 }

 private static class SingletonHolder {
 private static final VideoService INSTANCE = new VideoService();
 }

 public static VideoService getInstance() {
 return SingletonHolder.INSTANCE;
 }

 public void startRecordVideo() {
 String fileName = String.format("%s.%s", DateUtils.date2String(new Date(), "yyyyMMdd_HHmmss"), "mp4");
 path = FileUtils.getExternalFullPath(App.getInstance(), fileName);
 mFrameRecorder = new FFmpegFrameRecorder(path, 640, 480, 1);
 mFrameRecorder.setVideoCodec(avcodec.AV_CODEC_ID_H264);
 mFrameRecorder.setVideoOption("tune", "zerolatency");
 mFrameRecorder.setVideoOption("preset", "ultrafast");
 mFrameRecorder.setVideoOption("crf", "28");
 mFrameRecorder.setVideoBitrate(300 * 1000);
 mFrameRecorder.setFormat("mp4");

 mFrameRecorder.setFrameRate(30);
 mFrameRecorder.setAudioOption("crf", "0");
 mFrameRecorder.setSampleRate(48 * 1000);
 mFrameRecorder.setAudioBitrate(960 * 1000);
 mFrameRecorder.setAudioCodec(avcodec.AV_CODEC_ID_AAC);
 try {
 mFrameRecorder.start();
 } catch (FrameRecorder.Exception e) {
 e.printStackTrace();
 }
 }

 public void stop() {
 if (mFrameRecorder != null) {
 try {
 mFrameRecorder.stop();
 mFrameRecorder.release();
 } catch (FrameRecorder.Exception e) {
 e.printStackTrace();
 }
 mFrameRecorder = null;
 }
 }

}




MainActivity



package com.fs.fs.activity;

import android.app.Activity;
import android.os.Bundle;

import com.fs.fs.R;
import com.fs.fs.api.VideoService;

import static java.lang.Thread.sleep;


public class MainActivity extends Activity {

 @Override
 protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.activity_main);


 VideoService.getInstance().startRecordVideo();
 try {
 sleep(10 * 1000);
 } catch (InterruptedException e) {
 e.printStackTrace();
 }
 VideoService.getInstance().stop();
 }
}




Error



E/AndroidRuntime: FATAL EXCEPTION: main
 Process: com.example.usb, PID: 660
 java.lang.NoClassDefFoundError: org.bytedeco.javacpp.avutil
 at org.bytedeco.javacpp.Loader.load(Loader.java:590)
 at org.bytedeco.javacpp.Loader.load(Loader.java:530)
 at org.bytedeco.javacpp.avcodec$AVPacket.<clinit>(avcodec.java:1694)
 at org.bytedeco.javacv.FFmpegFrameRecorder.<init>(FFmpegFrameRecorder.java:149)
 at com.fs.fs.api.VideoService.startRecordVideo(VideoService.java:34)
 at com.fs.fs.activity.MainActivity.onCreate(MainActivity.java:75)
 at android.app.Activity.performCreate(Activity.java:5304)
 at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090)
 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2245)
 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2331)
 at android.app.ActivityThread.access$1000(ActivityThread.java:143)
 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1244)
 at android.os.Handler.dispatchMessage(Handler.java:102)
 at android.os.Looper.loop(Looper.java:136)
 at android.app.ActivityThread.main(ActivityThread.java:5291)
 at java.lang.reflect.Method.invokeNative(Native Method)
 at java.lang.reflect.Method.invoke(Method.java:515)
 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849)
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)
 at dalvik.system.NativeStart.main(Native Method)
 Caused by: java.lang.ClassNotFoundException: org.bytedeco.javacpp.avutil
 at java.lang.Class.classForName(Native Method)
 at java.lang.Class.forName(Class.java:251)
 at org.bytedeco.javacpp.Loader.load(Loader.java:585)
 at org.bytedeco.javacpp.Loader.load(Loader.java:530) 
 at org.bytedeco.javacpp.avcodec$AVPacket.<clinit>(avcodec.java:1694) 
 at org.bytedeco.javacv.FFmpegFrameRecorder.<init>(FFmpegFrameRecorder.java:149) 
 at com.fs.fs.api.VideoService.startRecordVideo(VideoService.java:34) 
 at com.fs.fs.activity.MainActivity.onCreate(MainActivity.java:75) 
 at android.app.Activity.performCreate(Activity.java:5304) 
 at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090) 
 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2245) 
 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2331) 
 at android.app.ActivityThread.access$1000(ActivityThread.java:143) 
 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1244) 
 at android.os.Handler.dispatchMessage(Handler.java:102) 
 at android.os.Looper.loop(Looper.java:136) 
 at android.app.ActivityThread.main(ActivityThread.java:5291) 
 at java.lang.reflect.Method.invokeNative(Native Method) 
 at java.lang.reflect.Method.invoke(Method.java:515) 
 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849) 
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665) 
 at dalvik.system.NativeStart.main(Native Method) 
 Caused by: java.lang.NoClassDefFoundError: org/bytedeco/javacpp/avutil
 at java.lang.Class.classForName(Native Method) 
 at java.lang.Class.forName(Class.java:251) 
 at org.bytedeco.javacpp.Loader.load(Loader.java:585) 
 at org.bytedeco.javacpp.Loader.load(Loader.java:530) 
 at org.bytedeco.javacpp.avcodec$AVPacket.<clinit>(avcodec.java:1694) 
 at org.bytedeco.javacv.FFmpegFrameRecorder.<init>(FFmpegFrameRecorder.java:149) 
 at com.fs.fs.api.VideoService.startRecordVideo(VideoService.java:34) 
 at com.fs.fs.activity.MainActivity.onCreate(MainActivity.java:75) 
 at android.app.Activity.performCreate(Activity.java:5304) 
 at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090) 
 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2245) 
 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2331) 
 at android.app.ActivityThread.access$1000(ActivityThread.java:143) 
 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1244) 
 at android.os.Handler.dispatchMessage(Handler.java:102) 
 at android.os.Looper.loop(Looper.java:136) 
 at android.app.ActivityThread.main(ActivityThread.java:5291) 
 at java.lang.reflect.Method.invokeNative(Native Method) 
 at java.lang.reflect.Method.invoke(Method.java:515) 
 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849) 
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665) 
 at dalvik.system.NativeStart.main(Native Method) 
 Caused by: java.lang.ClassNotFoundException: Didn't find class "org.bytedeco.javacpp.avutil" on path: DexPathList[[zip file "/data/app/com.fs.fs-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.fs.fs-2, /vendor/lib, /system/lib, /data/datalib]]
 at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
 at java.lang.Class.classForName(Native Method) 
 at java.lang.Class.forName(Class.java:251) 
 at org.bytedeco.javacpp.Loader.load(Loader.java:585) 
 at org.bytedeco.javacpp.Loader.load(Loader.java:530) 
 at org.bytedeco.javacpp.avcodec$AVPacket.<clinit>(avcodec.java:1694) 
 at org.bytedeco.javacv.FFmpegFrameRecorder.<init>(FFmpegFrameRecorder.java:149) 
 at com.fs.fs.api.VideoService.startRecordVideo(VideoService.java:34) 
 at com.fs.fs.activity.MainActivity.onCreate(MainActivity.java:75) 
 at android.app.Activity.performCreate(Activity.java:5304) 
 at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090) 
 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2245) 
 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2331) 
 at android.app.ActivityThread.access$1000(ActivityThread.java:143) 
 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1244) 
 at android.os.Handler.dispatchMessage(Handler.java:102) 
 at android.os.Looper.loop(Looper.java:136) 
 at android.app.ActivityThread.main(ActivityThread.java:5291) 
 at java.lang.reflect.Method.invokeNative(Native Method) 
 at java.lang.reflect.Method.invoke(Method.java:515) 
 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849) 
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665) 
 at dalvik.system.NativeStart.main(Native Method) 
</init></clinit></init></clinit></init></clinit></init></clinit>



How can i solve this error ?



Why error occurs ?


-
IplImage crop and rotate - Android
26 février 2015, par GaneshI’m using ffmpeg to video capture for 30 seconds.
@Override
public void onPreviewFrame(byte[] data, Camera camera) {
if (yuvIplimage != null && recording && rec)
{
new SaveFrame().execute(data);
}
}
}save frame class is below
private class SaveFrame extends AsyncTask {
long t;
protected File doInBackground(byte[]... arg) {
t = 1000 * (System.currentTimeMillis() - firstTime - pausedTime);
toSaveFrames++;
File pathCache = new File(Environment.getExternalStorageDirectory()+"/DCIM", (System.currentTimeMillis() / 1000L)+ "_" + toSaveFrames + ".tmp");
BufferedOutputStream bos;
try {
bos = new BufferedOutputStream(new FileOutputStream(pathCache));
bos.write(arg[0]);
bos.flush();
bos.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
pathCache = null;
toSaveFrames--;
} catch (IOException e) {
e.printStackTrace();
pathCache = null;
toSaveFrames--;
}
return pathCache;
}
@Override
protected void onPostExecute(File filename)
{
if(filename!=null)
{
savedFrames++;
tempList.add(new FileFrame(t,filename));
}
}
}finally i add all frames with crop and rotation
private class AddFrame extends AsyncTask {
private int serial = 0;
@Override
protected Void doInBackground(Void... params) {
for(int i=0; i/ final int startY = 640*(480-480)/2;
// final int lenY = 640*480;
// yuvIplimage.getByteBuffer().put(bytes, startY, lenY);
// final int startVU = 640*480+ 640*(480-480)/4;
// final int lenVU = 640* 480/2;
// yuvIplimage.getByteBuffer().put(bytes, startVU, lenVU);
if (tempList.get(i).time > recorder.getTimestamp()) {
recorder.setTimestamp(tempList.get(i).time);
}
image = cropImage(image);
image = rotate(image, 270);
// image = rotateImage(image);
recorder.record(image);
Log.i(LOG_TAG, "record " + i);
image = null;
serial++;
publishProgress(serial);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (com.googlecode.javacv.FrameRecorder.Exception e) {
e.printStackTrace();
}
}
return null;
}
@Override
protected void onProgressUpdate(Integer... serial) {
int value = serial[0];
creatingProgress.setProgress(value);
}
@Override
protected void onPostExecute(Void v)
{
creatingProgress.dismiss();
if (recorder != null && recording) {
recording = false;
Log.v(LOG_TAG,"Finishing recording, calling stop and release on recorder");
try {
recorder.stop();
recorder.release();
finish();
startActivity(new Intent(RecordActivity.this,AnswerViewActivity.class));
} catch (FFmpegFrameRecorder.Exception e) {
e.printStackTrace();
}
recorder = null;
}
}
}my crop and rotate method are below
private IplImage cropImage(IplImage src)
{
cvSetImageROI(src, r);
IplImage cropped = IplImage.create(imageHeight, imageHeight, IPL_DEPTH_8U, 2);
cvCopy(src, cropped);
return cropped;
}
public static IplImage rotate(IplImage image, double angle) {
IplImage copy = opencv_core.cvCloneImage(image);
IplImage rotatedImage = opencv_core.cvCreateImage(opencv_core.cvGetSize(copy), copy.depth(), copy.nChannels());
CvMat mapMatrix = opencv_core.cvCreateMat( 2, 3, opencv_core.CV_32FC1 );
//Define Mid Point
CvPoint2D32f centerPoint = new CvPoint2D32f();
centerPoint.x(copy.width()/2);
centerPoint.y(copy.height()/2);
//Get Rotational Matrix
opencv_imgproc.cv2DRotationMatrix(centerPoint, angle, 1.0, mapMatrix);
//Rotate the Image
opencv_imgproc.cvWarpAffine(copy, rotatedImage, mapMatrix, opencv_imgproc.CV_INTER_CUBIC + opencv_imgproc.CV_WARP_FILL_OUTLIERS, opencv_core.cvScalarAll(170));
opencv_core.cvReleaseImage(copy);
opencv_core.cvReleaseMat(mapMatrix);
return rotatedImage;
}my final video crop and rotate but green frames and colored frames mixed with this.
How to fix this problem. I’m not aware of iplimage. In some blogs they mention its YUV format. first u need to convert Y and then convert UV.
How to solve this problem ?
-
convert multi file in multi folder with ffmpeg
6 avril 2020, par SaeiDi want to use ffmpeg for convert all file in multi folder
for example
i want to convert all audio on more then 170 folder with ffmpeg at once



..\voice\SP_WL6_kismet1_a_LOC_INT\snd_vo_SP_WL_wav
..\voice\SP_WL6_kismet1_a_LOC_INT\ed_vo_SP_WL_wav
....
....
....




This folder also contains files in other formats



on these folders i have more then 1000, ogg file i want to convert all of them to wav at once