Recherche avancée

Médias (1)

Mot : - Tags -/book

Autres articles (56)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Le plugin : Podcasts.

    14 juillet 2010, par

    Le problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
    Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
    Types de fichiers supportés dans les flux
    Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-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

Sur d’autres sites (7918)

  • when i record video with javacv it comes "java.lang.NoClassDefFoundError : org.bytedeco.javacpp.avutil"

    9 avril 2020, par Pradeep Simba

    I 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&#xA;    Process: com.example.usb, PID: 660&#xA;    java.lang.NoClassDefFoundError: org.bytedeco.javacpp.avutil&#xA;                      at org.bytedeco.javacpp.Loader.load(Loader.java:590)&#xA;                      at org.bytedeco.javacpp.Loader.load(Loader.java:530)&#xA;                      at org.bytedeco.javacpp.avcodec$AVPacket.<clinit>(avcodec.java:1694)&#xA;                      at org.bytedeco.javacv.FFmpegFrameRecorder.<init>(FFmpegFrameRecorder.java:149)&#xA;                      at com.fs.fs.api.VideoService.startRecordVideo(VideoService.java:34)&#xA;                      at com.fs.fs.activity.MainActivity.onCreate(MainActivity.java:75)&#xA;                      at android.app.Activity.performCreate(Activity.java:5304)&#xA;                      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090)&#xA;                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2245)&#xA;                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2331)&#xA;                      at android.app.ActivityThread.access$1000(ActivityThread.java:143)&#xA;                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1244)&#xA;                      at android.os.Handler.dispatchMessage(Handler.java:102)&#xA;                      at android.os.Looper.loop(Looper.java:136)&#xA;                      at android.app.ActivityThread.main(ActivityThread.java:5291)&#xA;                      at java.lang.reflect.Method.invokeNative(Native Method)&#xA;                      at java.lang.reflect.Method.invoke(Method.java:515)&#xA;                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849)&#xA;                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)&#xA;                      at dalvik.system.NativeStart.main(Native Method)&#xA;                   Caused by: java.lang.ClassNotFoundException: org.bytedeco.javacpp.avutil&#xA;                      at java.lang.Class.classForName(Native Method)&#xA;                      at java.lang.Class.forName(Class.java:251)&#xA;                      at org.bytedeco.javacpp.Loader.load(Loader.java:585)&#xA;                      at org.bytedeco.javacpp.Loader.load(Loader.java:530)&#xA0;&#xA;                      at org.bytedeco.javacpp.avcodec$AVPacket.<clinit>(avcodec.java:1694)&#xA0;&#xA;                      at org.bytedeco.javacv.FFmpegFrameRecorder.<init>(FFmpegFrameRecorder.java:149)&#xA0;&#xA;                      at com.fs.fs.api.VideoService.startRecordVideo(VideoService.java:34)&#xA0;&#xA;                      at com.fs.fs.activity.MainActivity.onCreate(MainActivity.java:75)&#xA0;&#xA;                      at android.app.Activity.performCreate(Activity.java:5304)&#xA0;&#xA;                      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090)&#xA0;&#xA;                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2245)&#xA0;&#xA;                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2331)&#xA0;&#xA;                      at android.app.ActivityThread.access$1000(ActivityThread.java:143)&#xA0;&#xA;                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1244)&#xA0;&#xA;                      at android.os.Handler.dispatchMessage(Handler.java:102)&#xA0;&#xA;                      at android.os.Looper.loop(Looper.java:136)&#xA0;&#xA;                      at android.app.ActivityThread.main(ActivityThread.java:5291)&#xA0;&#xA;                      at java.lang.reflect.Method.invokeNative(Native Method)&#xA0;&#xA;                      at java.lang.reflect.Method.invoke(Method.java:515)&#xA0;&#xA;                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849)&#xA0;&#xA;                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)&#xA0;&#xA;                      at dalvik.system.NativeStart.main(Native Method)&#xA0;&#xA;                   Caused by: java.lang.NoClassDefFoundError: org/bytedeco/javacpp/avutil&#xA;                      at java.lang.Class.classForName(Native Method)&#xA0;&#xA;                      at java.lang.Class.forName(Class.java:251)&#xA0;&#xA;                      at org.bytedeco.javacpp.Loader.load(Loader.java:585)&#xA0;&#xA;                      at org.bytedeco.javacpp.Loader.load(Loader.java:530)&#xA0;&#xA;                      at org.bytedeco.javacpp.avcodec$AVPacket.<clinit>(avcodec.java:1694)&#xA0;&#xA;                      at org.bytedeco.javacv.FFmpegFrameRecorder.<init>(FFmpegFrameRecorder.java:149)&#xA0;&#xA;                      at com.fs.fs.api.VideoService.startRecordVideo(VideoService.java:34)&#xA0;&#xA;                      at com.fs.fs.activity.MainActivity.onCreate(MainActivity.java:75)&#xA0;&#xA;                      at android.app.Activity.performCreate(Activity.java:5304)&#xA0;&#xA;                      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090)&#xA0;&#xA;                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2245)&#xA0;&#xA;                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2331)&#xA0;&#xA;                      at android.app.ActivityThread.access$1000(ActivityThread.java:143)&#xA0;&#xA;                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1244)&#xA0;&#xA;                      at android.os.Handler.dispatchMessage(Handler.java:102)&#xA0;&#xA;                      at android.os.Looper.loop(Looper.java:136)&#xA0;&#xA;                      at android.app.ActivityThread.main(ActivityThread.java:5291)&#xA0;&#xA;                      at java.lang.reflect.Method.invokeNative(Native Method)&#xA0;&#xA;                      at java.lang.reflect.Method.invoke(Method.java:515)&#xA0;&#xA;                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849)&#xA0;&#xA;                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)&#xA0;&#xA;                      at dalvik.system.NativeStart.main(Native Method)&#xA0;&#xA;                   Caused by: java.lang.ClassNotFoundException: Didn&#x27;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]]&#xA;                      at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)&#xA;                      at java.lang.ClassLoader.loadClass(ClassLoader.java:497)&#xA;                      at java.lang.ClassLoader.loadClass(ClassLoader.java:457)&#xA;                      at java.lang.Class.classForName(Native Method)&#xA0;&#xA;                      at java.lang.Class.forName(Class.java:251)&#xA0;&#xA;                      at org.bytedeco.javacpp.Loader.load(Loader.java:585)&#xA0;&#xA;                      at org.bytedeco.javacpp.Loader.load(Loader.java:530)&#xA0;&#xA;                      at org.bytedeco.javacpp.avcodec$AVPacket.<clinit>(avcodec.java:1694)&#xA0;&#xA;                      at org.bytedeco.javacv.FFmpegFrameRecorder.<init>(FFmpegFrameRecorder.java:149)&#xA0;&#xA;                      at com.fs.fs.api.VideoService.startRecordVideo(VideoService.java:34)&#xA0;&#xA;                      at com.fs.fs.activity.MainActivity.onCreate(MainActivity.java:75)&#xA0;&#xA;                      at android.app.Activity.performCreate(Activity.java:5304)&#xA0;&#xA;                      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090)&#xA0;&#xA;                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2245)&#xA0;&#xA;                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2331)&#xA0;&#xA;                      at android.app.ActivityThread.access$1000(ActivityThread.java:143)&#xA0;&#xA;                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1244)&#xA0;&#xA;                      at android.os.Handler.dispatchMessage(Handler.java:102)&#xA0;&#xA;                      at android.os.Looper.loop(Looper.java:136)&#xA0;&#xA;                      at android.app.ActivityThread.main(ActivityThread.java:5291)&#xA0;&#xA;                      at java.lang.reflect.Method.invokeNative(Native Method)&#xA0;&#xA;                      at java.lang.reflect.Method.invoke(Method.java:515)&#xA0;&#xA;                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849)&#xA0;&#xA;                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)&#xA0;&#xA;                      at dalvik.system.NativeStart.main(Native Method)&#xA0;&#xA;</init></clinit></init></clinit></init></clinit></init></clinit>

    &#xA;&#xA;

    How can i solve this error ?

    &#xA;&#xA;

    Why error occurs ?

    &#xA;

  • Why do you need analytics for your WordPress ?

    7 avril 2020, par Joselyn Khor — Analytics Tips, Plugins

    Not many people know this, but having a WordPress analytics tool gives you a competitive advantage. It’s also essential to the growth of your website. For many businesses, websites are the main driver of revenue and sales. In the case of blogs, it’s your first chance to make a lasting impression.

    Now, maybe you’ve heard of Google Analytics or even the privacy-friendly alternative, Matomo Analytics, but have never tried them ? These are analytics platforms that help you understand your website traffic and visitors. (You can find these platforms as plugins in the WordPress directory !)

    They’re important because the insights you get help you determine what changes to make to improve your website. Without them you could face a tougher time figuring out what’s working, what the issues are (and solving them before they get out of hand), and making sure you’re taking your website in the right direction. 

    WordPress analytics gives you an understanding of what’s actually going on.

    How does a WordPress analytics plugin benefit your website ?

    What this means for you is getting a toolkit to learn how to get more sales or followers and subscribers (aka conversions in analytics terms). 

    By getting insights into user behaviour, content performance, and how you can optimise your website, you can reach more of your goals, like increasing sales or growing your audience.

    A WordPress analytics tool helps you get more traffic to your site

    You get a range of features which tell you which acquisition channels are working for you like – social media, search engines, and other websites mentioning you. This helps you make an informed decision on where to focus energies (or spend) to get more of the ideal people coming through to your website. 

    Increase traffic with wordpress analytics

    Example : Looking through your acquisition channels and seeing that Reddit drives a lot of traffic through to your website. Since this channel seems to be working for you, you could then spend more time on Reddit posts to increase traffic.

    But getting more traffic isn’t all there is to it. Once they land on your site, you want them to stay for a little longer so they are intrigued by what you’re offering. Be it a product, or awesome content.

    Which leads us to …

    Increasing engagement by learning about visitor behaviour

    When you get a solid number of visitors on your website, it’s good to then learn about how they behave on your site. A WordPress analytics tool helps with engagement since you’re seeing what’s appealing to them, and what isn’t.

     Increasing engagement is good for a few reasons. 

    • You end up speaking the language of your readers. 
    • You can make a difference with the information you’re putting out. 
    • You get loyal customers and believers in your organisation. 

    With more engaged visitors, you can build trust with them and eventually be able to convince them that your product, service, or blog is needed in their lives.

    WordPress analytics entry pages

    Example : Looking through entry and exit pages to see what first impression is making them stay, and what impression is making them leave. This helps you redirect efforts to give your website a better chance of getting visitors to stay longer.

    Improving your content and engagement can lead to more conversions

    After you get visitors engaged, it’s time to convert. 

    Whether you have an ecommerce site or freelance blog, you’ll need to know how to boost conversions. This simply means getting people to achieve more of the actions you’re wanting them to take on your site. Like subscribing to your newsletter or adding items to a cart.

    With conversion optimization features, you’re finding out how well your website is designed to get buyers through a journey to conversion. 

    Funnels for WordPress analytics

    Example : Say you’ve created a newsletter sign up page, but you’re not getting as many sign ups as you’d like. With a web analytics tool, you can look into it further. A funnels feature could tell you how they’re getting to that page. If people can’t find your page, that could be reason for low conversion rates. Or, maybe you are getting people landing on this page, but you can’t tell why they’re not signing up. Try setting up a heatmap to see how far they’re scrolling down your page to the sign up section. Through these conversion optimization features, you can make tweaks that significantly improve conversions.

    So, how does the Matomo Analytics for WordPress plugin help with all of this ?

    Matomo Analytics for WordPress is a free web analytics plugin that gives you access to all the features mentioned above, right in your own WordPress dashboard. It’s completely free to use and is handy for users of all skill levels. From beginners right through to advanced analysts. 

    You get to move through all the stages to increase traffic, increase engagement, and convert. By using Matomo for WordPress, you put yourself in a better position to track all the needed data from your WordPress website. 

    You have this toolkit to improve your website for free, with a few clicks ! 

    By getting useful insights like visitors, acquisitions, bounce rates etc. you gain a new perspective on how to improve your website so it’s better at doing what you created it to do. Getting these insights also means giving yourself the confidence to do what’s best for your website in a data-driven way. 

    With all this knowledge, you can be competitive, or grow enough that you’re leaving your competitors in the dust. 

  • IplImage crop and rotate - Android

    26 février 2015, par Ganesh

    I’m using ffmpeg to video capture for 30 seconds.

    @Override
           public void onPreviewFrame(byte[] data, Camera camera) {
               if (yuvIplimage != null &amp;&amp; recording &amp;&amp; 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 &amp;&amp; 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 ?