Recherche avancée

Médias (91)

Autres articles (101)

  • 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

  • Use, discuss, criticize

    13 avril 2011, par

    Talk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
    The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
    A discussion list is available for all exchanges between users.

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

Sur d’autres sites (6208)

  • MediaMetadataRetriever setDataSource failed : status = 0xFFFFFFED

    22 février 2016, par darja

    I need to fetch frames from video located in the web. That’s how I do this :

    class PlayerWrapper {
       private static final MediaMetadataRetriever mMediaMetadataRetriever = new MediaMetadataRetriever();

       …

       public void initPlayback(final Context context, final VideoSurfaceView videoSurface, final String url) {
           new Thread(new Runnable() {
               @Override
               public void run() {
                   …

                   try {
                       mMediaMetadataRetriever.setDataSource(url, new HashMap());
                   } catch (Exception e) {
                       DPLog(e);
                   }

               }
           }).start();
       }

       public Bitmap getFrameAt(int positionMillis) {
           if (mMediaMetadataRetriever != null) {
               DPLog.d("Creating frame for position [%s]", positionMillis);
               try {
                   return mMediaMetadataRetriever.getFrameAtTime(positionMillis * 1000);
               } catch (Exception e) {
                   …
                   return null;
               }
           } else {
               return null;
           }
       }
    }

    This works fine on several devices with Android 4.4, 5 and 6. But on one device with Android 4.1.2 setDataSource function fails with following stack trace :

    java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFED
          at android.media.MediaMetadataRetriever._setDataSource(MediaMetadataRetriever.java)
          at android.media.MediaMetadataRetriever.setDataSource(MediaMetadataRetriever.java:99)
          at co.unreel.videoapp.playback.UnreelPlayer$3.run(UnreelPlayer.java:138)
          at java.lang.Thread.run(Thread.java:856)

    Also tried this code on emulator, got almost the same but with status 0x80000000

    Url is got from YouTube API, looks like this :

    https://r2---sn-n3toxu-axqe.googlevideo.com/videoplayback?gcr=ru&sver=3&mm=31&mn=sn-n3toxu-axqe&key=yt6&signature=D1CE7B8615F3D96A58A9D2679057D676E7777E05.5A318AD8C5F48FCED2D1A9149348CD269F466FA9&mt=1456173450&pl=24&mv=m&ms=au&lmt=1455616987173757&itag=22&requiressl=yes&ip=188.242.217.203&source=youtube&dur=848.248&id=o-ABIn_CbRwqIO6qpvlaWe_ekyTZPLVd0w_eM80awd6uRQ&fexp=9408087%2C9416126%2C9419451%2C9420452%2C9421340%2C9422596%2C9423661%2C9423662%2C9425078%2C9425963%2C9427767%2C9427801%2C9428013%2C9428432%2C9428660%2C9429602&mime=video%2Fmp4&upn=P5qxGGbPoc0&sparams=dur%2Cgcr%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cupn%2Cexpire&expire=1456195127&initcwndbps=3140000&ratebypass=yes&ipbits=0

    Permissions :

    Why this can happen and what to do ?

    I also tried to use FFmpegMediaMetadataRetriever with the same logic, but it doesn’t work at all, setDataSource causes exceptions with status 0xFFFFFFFF on all devices. As I found on SO, that means that url is invalid, but it is ok and played by MediaPlayer without any issues. Also I found that ffmpeg has issues with urls longer than 1024, but that’s not my case too.

    May be there are another way to get frames from video ?

  • java.lang.UnsatifiedLinkError : no jniavutil in java.library.path using JavaCV FFmpegFrameGrabber

    31 mars 2015, par Noah Lutz

    I’m writing a program that is using JavaCV to grab frames from a stream. Its trying to use FFmpegFrameGrabber to capture the frames but when I try to run it, I get an UnsatisfiedLinkError.

    Here is the code :

    FrameGrabber frameGrabber;
       try{
           frameGrabber = new FFmpegFrameGrabber("http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8");
           frameGrabber.start();

           while(true){
               video.addFrame(new Frame(frameGrabber.grab()));
               System.out.println(video.getLength());
           }
       }catch(Exception e){
           e.printStackTrace();
       }

    And here is the stack trace :

    Exception in thread "Thread-0" java.lang.UnsatisfiedLinkError: no jniavutil in java.library.path
       at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1857)
       at java.lang.Runtime.loadLibrary0(Runtime.java:870)
       at java.lang.System.loadLibrary(System.java:1119)
       at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:535)
       at org.bytedeco.javacpp.Loader.load(Loader.java:410)
       at org.bytedeco.javacpp.Loader.load(Loader.java:353)
       at org.bytedeco.javacpp.avutil.<clinit>(avutil.java:10)
       at java.lang.Class.forName0(Native Method)
       at java.lang.Class.forName(Class.java:344)
       at org.bytedeco.javacpp.Loader.load(Loader.java:385)
       at org.bytedeco.javacpp.Loader.load(Loader.java:353)
       at org.bytedeco.javacpp.avcodec.<clinit>(avcodec.java:12)
       at org.bytedeco.javacv.FFmpegFrameGrabber.<clinit>(FFmpegFrameGrabber.java:103)
       at com.noahlutz.gopro.GoProDVR.run(GoProDVR.java:23)
       at java.lang.Thread.run(Thread.java:745)
    Caused by: java.lang.UnsatisfiedLinkError: /private/var/folders/4q/tw0nqgpn4cv2q7yr052_szh00000gn/T/javacpp104085411945039/libjniavutil.dylib: dlopen(/private/var/folders/4q/tw0nqgpn4cv2q7yr052_szh00000gn/T/javacpp104085411945039/libjniavutil.dylib, 1): Library not loaded: @rpath/libavutil.52.dylib
     Referenced from: /private/var/folders/4q/tw0nqgpn4cv2q7yr052_szh00000gn/T/javacpp104085411945039/libjniavutil.dylib
     Reason: no suitable image found.  Did find:
       /private/var/folders/4q/tw0nqgpn4cv2q7yr052_szh00000gn/T/javacpp104085411945039/./libavutil.52.dylib: malformed mach-o image: load command #16 length (0) too small in /private/var/folders/4q/tw0nqgpn4cv2q7yr052_szh00000gn/T/javacpp104085411945039/./libavutil.52.dylib
       at java.lang.ClassLoader$NativeLibrary.load(Native Method)
       at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1929)
       at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1814)
       at java.lang.Runtime.load0(Runtime.java:809)
       at java.lang.System.load(System.java:1083)
       at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:524)
       ... 11 more

    Process finished with exit code 0
    </clinit></clinit></clinit>

    I have both OpenCV and FFmpeg installed and I followed the instructions for the manual installation of JavaCV on their github page.

    Thanks for your help.

  • Writing only video (no audio) file using ffmpeg. av_write_header fails

    19 janvier 2018, par Kamal

    I have RTP packets with VP8 encoded data. I want to write it to a mkv file or webm file. I tried a bit, but I have not been successful yet. My code is as below

    #include
    #include
    #include
    #include
    #include

    #include <libavutil></libavutil>avassert.h>
    #include <libavutil></libavutil>channel_layout.h>
    #include <libavutil></libavutil>opt.h>
    #include <libavutil></libavutil>mathematics.h>
    #include <libavutil></libavutil>timestamp.h>
    #include <libavformat></libavformat>avformat.h>
    #include <libswscale></libswscale>swscale.h>
    #include <libswresample></libswresample>swresample.h>

    bool mfmedia_init_ffmpeg();
    void mfmedia_ffprint(void *handle, int cnt, const char *format, va_list valist);

    int main()
    {
       mfmedia_init_ffmpeg();
       return 0;
    }

    bool mfmedia_init_ffmpeg()
    {
       bool ret = false;

       AVCodecContext* context;
       AVCodec* codec;
       AVFormatContext* format;
       AVStream* stream;

       unsigned fps = 24;
       unsigned width = 768;
       unsigned height = 608;

       av_register_all();

       int err = 0;
       char errorLog[128] = { 0 };

       av_log_set_level(AV_LOG_TRACE);
       av_log_set_callback(mfmedia_ffprint);

       err = avformat_alloc_output_context2(&amp;format, NULL, NULL, "o.webm");
       if (err &lt; 0)
       {
           printf("Cannot allocate output context: %s\n", av_make_error_string(errorLog, 128, err));
           goto last;
       }

       codec = avcodec_find_encoder(AV_CODEC_ID_VP8);
       if (!codec)
       {
           printf("Cannot find an encoder\n");
           goto last;
       }

       context = avcodec_alloc_context3(codec);
       if (!context)
       {
           printf("Cannot allocate a codec context\n");
           goto last;
       }

       context->pix_fmt = AV_PIX_FMT_YUV420P;
       context->width = width;
       context->height = height;
       context->time_base = (AVRational){1, fps};

       err = avcodec_open2(context, codec, NULL);
       if(err &lt; 0)
       {
           printf("Cannot open codec: %s\n", av_make_error_string(errorLog, 128, err));
           goto last;
       }

       stream = avformat_new_stream(format, codec);
       if (!stream)
       {
           printf("Cannot create a new stream\n");
           goto last;
       }

       //av_dump_format(format, 0, "o.webm", 1);

       err = avio_open(&amp;format->pb, "o.webm", AVIO_FLAG_WRITE);
       if(err &lt; 0)
       {
           printf("Cannot open output: %s\n", av_make_error_string(errorLog, 128, err));
           goto last;
       }

       err = avformat_write_header(format, NULL);
       if(err &lt; 0)
       {
           printf("Cannot write header to stream: %s\n", av_make_error_string(errorLog, 128, err));
           goto last;
       }
       ret = true;

    last:
       return ret;
    }

    void mfmedia_ffprint(void *handle, int cnt, const char *format, va_list valist)
    {
       char *log_buf = (char *)malloc(38192);
       int length;

       if(log_buf)
       {
           time_t rawtime;
           time ( &amp;rawtime );

           length = vsprintf(log_buf ,format, valist);
           length += sprintf((log_buf + length), " : %s ", ctime (&amp;rawtime));
           *(log_buf + length) = 0x0;

           printf("%s", log_buf);
           fflush(stdout);
           free(log_buf);
       }
    }

    It is failing when I call avformat_write_header.

    From trace log (towards end) I see

    Setting default whitelist ’file,crypto’
     : Fri Jan 19 16:58:57 2018
    Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
     : Fri Jan 19 16:58:57 2018
    dimensions not set
     : Fri Jan 19 16:58:57 2018
    Cannot write header to stream : Invalid argument

    Please let me know why avformat_write_header is failing.