Recherche avancée

Médias (91)

Autres articles (8)

  • Contribute to a better visual interface

    13 avril 2011

    MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
    Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community.

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

Sur d’autres sites (2502)

  • JavaCV : avformat_open_input() hangs (not network, but with custom AVIOContext)

    14 octobre 2015, par Yun Tao Hai

    I’m using a custom AVIOContext to bridge FFMpeg with java IO. The function avformat_open_input() never returns. I have searched the web for similar problems, all of which were caused by faulty network or wrong server configurations. However, I’m not using network at all, as you can see in the following little program :

    package com.example;

    import org.bytedeco.javacpp.*;
    import java.io.File;
    import java.io.IOException;
    import java.io.RandomAccessFile;
    import static org.bytedeco.javacpp.avcodec.*;
    import static org.bytedeco.javacpp.avformat.*;
    import static org.bytedeco.javacpp.avutil.*;
    import static org.bytedeco.javacpp.avdevice.*;
    import static org.bytedeco.javacpp.avformat.AVFormatContext.*;

    public class Test {

       public static void main(String[] args) throws Exception {
           File dir = new File(System.getProperty("user.home"), "Desktop");
           File file = new File(dir, "sample.3gp");
           final RandomAccessFile raf = new RandomAccessFile(file, "r");

           Loader.load(avcodec.class);
           Loader.load(avformat.class);
           Loader.load(avutil.class);
           Loader.load(avdevice.class);
           Loader.load(swscale.class);
           Loader.load(swresample.class);

           avcodec_register_all();
           av_register_all();
           avformat_network_init();
           avdevice_register_all();

           Read_packet_Pointer_BytePointer_int reader = new Read_packet_Pointer_BytePointer_int() {
               @Override
               public int call(Pointer pointer, BytePointer buf, int bufSize) {
                   try {
                       byte[] data = new byte[bufSize]; // this is inefficient, just use as a quick example
                       int read = raf.read(data);

                       if (read <= 0) {
                           System.out.println("EOF found.");
                           return AVERROR_EOF;
                       }

                       System.out.println("Successfully read " + read + " bytes of data.");
                       buf.position(0);
                       buf.put(data, 0, read);
                       return read;
                   } catch (Exception ex) {
                       ex.printStackTrace();
                       return -1;
                   }
               }
           };

           Seek_Pointer_long_int seeker = new Seek_Pointer_long_int() {
               @Override
               public long call(Pointer pointer, long offset, int whence) {
                   try {
                       raf.seek(offset);
                       System.out.println("Successfully seeked to position " + offset + ".");
                       return offset;
                   } catch (IOException ex) {
                       return -1;
                   }
               }
           };

           int inputBufferSize = 32768;
           BytePointer inputBuffer = new BytePointer(av_malloc(inputBufferSize));
           AVIOContext ioContext = avio_alloc_context(inputBuffer, inputBufferSize, 1, null, reader, null, seeker);
           AVInputFormat format = av_find_input_format("3gp");
           AVFormatContext formatContext = avformat_alloc_context();
           formatContext.iformat(format);
           formatContext.flags(formatContext.flags() | AVFMT_FLAG_CUSTOM_IO);
           formatContext.pb(ioContext);

           // This never returns. And I can never get result.
           int result = avformat_open_input(formatContext, "", format, null);

           // all clean-up code omitted for simplicity
       }

    }

    And below is my sample console output :

    Successfully read 32768 bytes of data.
    Successfully read 32768 bytes of data.
    Successfully read 32768 bytes of data.
    Successfully read 32768 bytes of data.
    Successfully read 32768 bytes of data.
    Successfully read 7240 bytes of data.
    EOF found.

    I’ve checked the sum of bytes, which corresponds to the file size ; EOF is also hit, meaning the file is completely read. Actually I am a bit skeptical as why avformat_open_input() would even read the entire file and still without returning ? There must be something wrong with what I am doing. Can any expert shed some lights or point me to the right direction ? I’m new to javacv and ffmpeg and especially to programming with Buffers and stuff. Any help, suggestion or criticism is welcome. Thanks in advance.

  • ffmpeg converting video to images while video file is being written

    15 octobre 2015, par user3398227

    Hopefully an easy question for an ffmpeg expert !

    I’m currently converting large (+6GB) mpeg video into an image sequence - which is working well using the below ffmpeg command :

    ffmpeg -i "input.mpeg" -vf - fps=fps=2 -f image2 -qscale 1 -s 1026x768 "output%6d.jpg"

    however i have to wait for the file to finish being written to disk before i kick off ffmpeg - but this takes a good hour or so to finish writing, but what i’ve noticed is that ffmpeg can start reading the file while its being written to disk - the only snag here is it gets to the end of the file and stops before the file has finished being written...

    Question is, is there a way that ffmpeg can convert to an image sequence at the same pace the video is being written (and not exit out ?)... or know to wait for the next frame to be written from the source. (unfortunately the input doesn’t support streaming, I only get a network drive and file to work off.. ) I thought i read somewhere that ffmpeg can process at the video frame rate but cant seem to find this command for love or money in the doco !!

    Thanks !

  • Cannot include FFmpegMediaPlayer lib in my android project

    20 août 2015, par Lucabro

    I’ve to include in my Android studio project a lib for managing audio streams from urls. I’m tying to use this, but when I try to run the app and it reach the point where have to instantiate a FFmpegMediaPlayer object, it crush with the error

    31444-31444/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
       java.lang.ExceptionInInitializerError

    These the steps I’ve done to integrate the lib in my project :

    • I’ve copied all .so, gdb.setup and gdbserver files from demo project and put them into my jniLibs replicating the exact folder structure
    • I’ve copied fmp.jar from demo my libs forlder
    • I’ve changed all paths in gdb.setup files accordingly with my project folder structure
    • synch with gradle

    I’m not an expert of Android specially for tasks like this, am I missing something important ? If you need it I can give a test app

    Thankyou

    Edit 1

    This is the complete error

    08-19 10:20:42.066  31444-31444/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
       java.lang.ExceptionInInitializerError
               at com.example.lucabrognara.radiostreamprova.RadioActivity.onCreate(RadioActivity.java:126)
               at android.app.Activity.performCreate(Activity.java:5206)
               at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
               at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2074)
               at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2135)
               at android.app.ActivityThread.access$700(ActivityThread.java:140)
               at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1237)
               at android.os.Handler.dispatchMessage(Handler.java:99)
               at android.os.Looper.loop(Looper.java:137)
               at android.app.ActivityThread.main(ActivityThread.java:4921)
               at java.lang.reflect.Method.invokeNative(Native Method)
               at java.lang.reflect.Method.invoke(Method.java:511)
               at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)
               at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
               at dalvik.system.NativeStart.main(Native Method)
        Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1892]:  1836 could not load needed library 'libswresample.so' for 'libavcodec.so' (load_library[1094]: Library 'libswresample.so' not found)
               at java.lang.Runtime.load(Runtime.java:340)
               at java.lang.System.load(System.java:521)
               at wseemann.media.FFmpegMediaPlayer.<clinit>(FFmpegMediaPlayer.java:604)
                at com.example.lucabrognara.radiostreamprova.RadioActivity.onCreate(RadioActivity.java:126)
                at android.app.Activity.performCreate(Activity.java:5206)
                at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
                at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2074)
                at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2135)
                at android.app.ActivityThread.access$700(ActivityThread.java:140)
                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1237)
                at android.os.Handler.dispatchMessage(Handler.java:99)
                at android.os.Looper.loop(Looper.java:137)
                at android.app.ActivityThread.main(ActivityThread.java:4921)
                at java.lang.reflect.Method.invokeNative(Native Method)
                at java.lang.reflect.Method.invoke(Method.java:511)
                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)
                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
                at dalvik.system.NativeStart.main(Native Method)
    </clinit>