Recherche avancée

Médias (0)

Mot : - Tags -/serveur

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (100)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

  • Modifier la date de publication

    21 juin 2013, par

    Comment changer la date de publication d’un média ?
    Il faut au préalable rajouter un champ "Date de publication" dans le masque de formulaire adéquat :
    Administrer > Configuration des masques de formulaires > Sélectionner "Un média"
    Dans la rubrique "Champs à ajouter, cocher "Date de publication "
    Cliquer en bas de la page sur Enregistrer

Sur d’autres sites (9817)

  • Error of FFmpeg on Java in "av_image_copy_to_buffer" method during decoding H.264 stream

    26 mai 2020, par maru2213

    I'm trying to decode H.264 stream, which is sent over Socket from an Android application to a computer. And I also want to show the decoded stream using JavaFX. I searched for a long time, and decided to use JavaCV / FFmpeg. However I got error from FFmpeg. (I was inspired by this code.)

    



    Questions :

    



      

    • Why does FFmpeg make error ?
    • 


    • Is it a correct way to convert AVFrame to javafx.scene.image.Image ?
    • 


    



    I'm using :

    



      

    • javacv-platform 1.4.4
    • 


    • ffmpeg-platform 4.1-1.4.4
    • 


    



    Code :

    



    This is a part of import and class fields, and method which runs once at the first time. (Actually the content of initialize() is wrapped by try catch.)

    



        import javafx.scene.image.Image;

    private avcodec.AVCodec avCodec;
    private avcodec.AVCodecContext avCodecContext;
    private avutil.AVDictionary avDictionary;
    private avutil.AVFrame avFrame;

    public void initialize() {
        avCodec = avcodec_find_decoder(AV_CODEC_ID_H264);
        if (avCodec == null) {
            throw new RuntimeException("Can't find decoder");
        }
        avCodecContext = avcodec_alloc_context3(avCodec);
        if (avCodecContext == null) {
            throw new RuntimeException("Can't allocate decoder context");
        }
        int result = avcodec_open2(avCodecContext, avCodec, (AVDictionary) null);
        if (result < 0) {
            throw new RuntimeException("Can't open decoder");
        }
        avFrame = av_frame_alloc();
        if (avFrame == null) {
            throw new RuntimeException("Can't allocate frame");
        }
    }


    



    And this is a method which is called every time when I receive a packet from Android. byte[] data is the packet data starting with 0x00, 0x00, 0x00, 0x01.

    



    The place where I get error is number_of_written_bytes. It always gets <0.

    &#xA;&#xA;

        private void decode(byte[] data) {&#xA;        AVPacket avPacket = new AVPacket();&#xA;        av_init_packet(avPacket);&#xA;        avPacket.pts(AV_NOPTS_VALUE);&#xA;        avPacket.dts(AV_NOPTS_VALUE);&#xA;        BytePointer bytePointer = new BytePointer(data);&#xA;        bytePointer.capacity(data.length);&#xA;        avPacket.data(bytePointer);&#xA;        avPacket.size(data.length);&#xA;        avPacket.pos(-1);&#xA;&#xA;        avcodec_send_packet(avCodecContext, avPacket);&#xA;        int result = avcodec_receive_frame(avCodecContext, avFrame);&#xA;        if (result >= 0) {&#xA;            int bufferOutputSize = av_image_get_buffer_size(avFrame.format(), avFrame.width(), avFrame.height(), 16);&#xA;            Pointer pointer = av_malloc(bufferOutputSize);&#xA;            BytePointer outputPointer = new BytePointer(pointer);&#xA;            int number_of_written_bytes = av_image_copy_to_buffer(outputPointer, bufferOutputSize, avFrame.data(), avFrame.linesize(), avFrame.chroma_location(), avFrame.width(), avFrame.height(), 1);&#xA;            if (number_of_written_bytes &lt; 0) {&#xA;                //The process always come here.&#xA;                throw new RuntimeException("Can&#x27;t copy image to buffer");&#xA;            }&#xA;&#xA;            System.out.println("decode success");&#xA;            Image image = new Image(new ByteArrayInputStream(outputPointer.asBuffer().array()));&#xA;        } else {&#xA;            System.out.println("decode failed");&#xA;        }&#xA;    }&#xA;

    &#xA;&#xA;

    Anything is helpful for me. Thanks.

    &#xA;

  • ffmpeg "filtergraph join" to use copy of channels and preserve input channel configuration (format - s32_le)

    29 avril 2020, par vishwanath patil

    Command that I am using is below, with that command I am getting 8 channel output.wav.

    &#xA;&#xA;

    ffmpeg.exe    -i one.wav -i two.wav -i three.wav -i four.wav \&#xA;-i five.wav -i six.wav -i seven.wav -i eight.wav \&#xA;-filter_complex &#x27;[0:0][1:0][2:0][3:0][4:0][5:0][6:0] \&#xA;[7:0]join=8:channel_layout=octagonal&#x27;  output.wav&#xA;

    &#xA;&#xA;

    All input files one.wav, two.wav so on eight.wav are 32khz,s32le and one channel. but, output generated is output.wav which is s16le, 32khz.

    &#xA;&#xA;

    I can make output s32le with below command,

    &#xA;&#xA;

    ffmpeg.exe -i one.wav -i two.wav -i three.wav -i four.wav \&#xA;-i five.wav -i six.wav -i seven.wav -i eight.wav \&#xA;-filter_complex &#x27;[0:0][1:0][2:0][3:0][4:0][5:0][6:0] \&#xA;[7:0]join=8:channel_layout=octagonal&#x27;  -acodec pcm_s32le output.wav&#xA;

    &#xA;&#xA;

    But, above command seems todo conversion from s16_le to s32_le (i.e one.wav doesn't match with output.wav first channel completely). However what I want is to directly copy data from input channels since audio format of all input files is same as expected audio format of output file channels (output.wav)

    &#xA;&#xA;

    is there way to instruct filter_graph todo processing at pcm_s32le ?

    &#xA;&#xA;

    Here is link to log with loglevel set to debug,&#xA;https://pastebin.com/ms4x1fLz

    &#xA;&#xA;

    MediaInfo.exe one.wav&#xA;General&#xA;Complete name                            : one.wav&#xA;Format                                   : Wave&#xA;File size                                : 6.50 MiB&#xA;Duration                                 : 53 s 280 ms&#xA;Overall bit rate mode                    : Constant&#xA;Overall bit rate                         : 1 024 kb/s&#xA;&#xA;Audio&#xA;Format                                   : PCM&#xA;Format settings                          : Little / Signed&#xA;Codec ID                                 : 1&#xA;Duration                                 : 53 s 280 ms&#xA;Bit rate mode                            : Constant&#xA;Bit rate                                 : 1 024 kb/s&#xA;Channel(s)                               : 1 channel&#xA;Sampling rate                            : 32.0 kHz&#xA;Bit depth                                : 32 bits&#xA;Stream size                              : 6.50 MiB (100%)&#xA;

    &#xA;

  • FFmpeg Android concat. "–safe 0" is an invalid argument

    18 avril 2020, par AK. Bab

    I am trying to append two .mp4 videos on Android. Following an unsafe file name error with command :

    &#xA;&#xA;

    String[] complexCommand = {"ffmpeg", "-f", "concat", "-i", list, "-c", "copy", outputFilePath};&#xA;

    &#xA;&#xA;

    I added the string "–safe 0" as recommended on FFmpeg documentation :

    &#xA;&#xA;

    String[] complexCommand = {"ffmpeg", "-f", "concat","–safe 0", "-i", list, "-c", "copy", outputFilePath};&#xA;

    &#xA;&#xA;

    However, FFmpeg does not recognise the command, giving this error message :

    &#xA;&#xA;

    Failure with output&#xA; ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers&#xA;   built with gcc 4.8 (GCC)&#xA;   configuration: --target-os=linux --cross-prefix=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/home/vagrant/SourceCode/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/vagrant/SourceCode/ffmpeg-android/build/armeabi-v7a --extra-cflags=&#x27;-I/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all&#x27; --extra-ldflags=&#x27;-L/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie&#x27; --extra-libs=&#x27;-lpng -lexpat -lm&#x27; --extra-cxxflags=&#xA;   libavutil      55. 17.103 / 55. 17.103&#xA;   libavcodec     57. 24.102 / 57. 24.102&#xA;   libavformat    57. 25.100 / 57. 25.100&#xA;   libavdevice    57.  0.101 / 57.  0.101&#xA;   libavfilter     6. 31.100 /  6. 31.100&#xA;   libswscale      4.  0.100 /  4.  0.100&#xA;   libswresample   2.  0.101 /  2.  0.101&#xA;   libpostproc    54.  0.100 / 54.  0.100&#xA; Unrecognized option ‘–safe 0&#x27;.&#xA;Error splitting the argument list: Option not found&#xA;

    &#xA;&#xA;

    I have tried various permutations with the type of dash (–) and (-), used, but still get an error. Sometimes, using a certain dash or no dash at all returns a slightly different error message :

    &#xA;&#xA;

    Failure with output&#xA;I/System.out: ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers&#xA;I/System.out:   built with gcc 4.8 (GCC)&#xA;I/System.out:   configuration: --target-os=linux --cross-prefix=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/home/vagrant/SourceCode/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/vagrant/SourceCode/ffmpeg-android/build/armeabi-v7a --extra-cflags=&#x27;-I/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all&#x27; --extra-ldflags=&#x27;-L/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie&#x27; --extra-libs=&#x27;-lpng -lexpat -lm&#x27; --extra-cxxflags=&#xA;I/System.out:   libavutil      55. 17.103 / 55. 17.103&#xA;   libavcodec     57. 24.102 / 57. 24.102&#xA;   libavformat    57. 25.100 / 57. 25.100&#xA;   libavdevice    57.  0.101 / 57.  0.101&#xA;   libavfilter     6. 31.100 /  6. 31.100&#xA;   libswscale      4.  0.100 /  4.  0.100&#xA;   libswresample   2.  0.101 /  2.  0.101&#xA;   libpostproc    54.  0.100 / 54.  0.100&#xA; Input #0, tty, from &#x27;/data/user/0/com.example.cameraapp2/cache/ffmpeg-list1251307830.txt&#x27;:&#xA;&#xA;Duration: 00:00:00.04, bitrate: 28 kb/s&#xA;     Stream #0:0: Video: ansi, pal8, 640x400, 25 fps, 25 tbr, 25 tbn, 25 tbc&#xA; [NULL @ 0xed834600] Unable to find a suitable output format for &#x27;ffmpeg&#x27;&#xA; ffmpeg: Invalid argument&#xA;

    &#xA;&#xA;

    However, amendments I make there (such as removing "ffmpeg") haven't resolved the issue.

    &#xA;&#xA;

    String list is the absolute path of a textfile, generated with code I have copied written by user Marc Plano-Lesay :

    &#xA;&#xA;

    private static String generateList(String[] inputs) {&#xA;    File list;&#xA;    Writer writer = null;&#xA;    try {&#xA;        list = File.createTempFile("ffmpeg-list", ".txt");&#xA;        writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(list)));&#xA;        for (String input: inputs) {&#xA;            writer.write("file &#x27;" &#x2B; input &#x2B; "&#x27;\n");&#xA;        }&#xA;    } catch (IOException e) {&#xA;        e.printStackTrace();&#xA;        return "/";&#xA;    } finally {&#xA;        try {&#xA;            if (writer != null)&#xA;                writer.close();&#xA;        } catch (IOException ex) {&#xA;            ex.printStackTrace();&#xA;        }&#xA;    }&#xA;

    &#xA;&#xA;

    and here are relevant code snippets that refers to it :

    &#xA;&#xA;

    inputFilePath1 = "/storage/emulated/0/Pictures/MyCameraApp/VID_20200416_162058.mp4";&#xA;inputFilePath2 = "/storage/emulated/0/Pictures/MyCameraApp/VID_20200418_104909.mp4";&#xA;

    &#xA;&#xA;

    String list = generateList(new String[] {inputFilePath1, inputFilePath2});

    &#xA;&#xA;

    Android can usually find the input files just fine, so I'm not sure what's left to try. The error messages above confirm my assumption that I'm running FFmpeg 0.3.1 which should be recent enough.

    &#xA;&#xA;

    Thank you for any help.

    &#xA;