Recherche avancée

Médias (0)

Mot : - Tags -/configuration

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

Autres articles (73)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • XMP PHP

    13 mai 2011, par

    Dixit Wikipedia, XMP signifie :
    Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
    Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
    XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)

Sur d’autres sites (6147)

  • 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;

  • Problem with ffmpeg rtp stream to janus webrtc

    13 juin 2020, par XPModder

    I am trying to use ffmpeg and janus-gateway to stream video in the local network. I am piping the h264 video directly in to ffmpeg and from there it gets transferred to janus as an rtp stream. Janus then does the rest.

    &#xA;&#xA;

    The problem is, that when I try to open the stream using the streamingtest html page included in janus, I can select the stream, but I never get to see anything. On the console where I started janus, it throws multiple errors starting with : "SDP missing mandatory information"

    &#xA;&#xA;

    After starting ffmpeg it shows the SDP in console :

    &#xA;&#xA;

    v=0&#xA;o=- 0 0 IN IP4 127.0.0.1&#xA;s=No Name&#xA;c=IN IP4 127.0.0.1&#xA;t=0 0&#xA;a=tool:libavformat 58.20.100&#xA;m=video 8004 RTP/AVP 96&#xA;a=rtpmap:96 H264/90000&#xA;a=fmtp:96 packetization-mode=1; sprop-parameter-sets=J2QAKKwrQDwBE/LAPEiagA==,KO4BNywA; profile-level-id=640028&#xA;

    &#xA;&#xA;

    The command I use to start ffmpeg is the following :

    &#xA;&#xA;

    ffmpeg -loglevel quiet -y -i - -c:v copy -preset veryfast -f rtp rtp://127.0.0.1:8004&#xA;

    &#xA;&#xA;

    I assume that I am missing something in the ffmpeg command and therefore there is some kind of problem with the SDP.

    &#xA;&#xA;

    Edit : I looked a little further into this and actually looked at the code for janus at the lines that throw the error. Then I traced that to the origin of the error.

    &#xA;&#xA;

    Apparently the SDP is supposed to contain some authorization in for of this :

    &#xA;&#xA;

    a=... ice-ufrag=?; ice-pwd=?&#xA;

    &#xA;&#xA;

    So how do I find out what this username and password are and how do I get it in to the SDP from ffmpeg ?

    &#xA;&#xA;

    Or how do I disable this entirely ?

    &#xA;

  • Decoding H.264 stream using FFmpeg on Java

    25 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 much hours, and decided to use JavaCV / FFmpeg. However I got error from FFmpeg. (I was inspired by this code)

    &#xA;&#xA;

    Questions :

    &#xA;&#xA;

      &#xA;
    • Why does FFmpeg make error ?
    • &#xA;

    • Is it a correct way to convert AVFrame to javafx.scene.image.Image ?
    • &#xA;

    &#xA;&#xA;

    I'm using :

    &#xA;&#xA;

      &#xA;
    • javacv-platform 1.4.4
    • &#xA;

    • ffmpeg-platform 4.1-1.4.4
    • &#xA;

    &#xA;&#xA;

    Code :

    &#xA;&#xA;

    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.)

    &#xA;&#xA;

        import javafx.scene.image.Image;&#xA;&#xA;    private avcodec.AVCodec avCodec;&#xA;    private avcodec.AVCodecContext avCodecContext;&#xA;    private avutil.AVDictionary avDictionary;&#xA;    private avutil.AVFrame avFrame;&#xA;&#xA;    public void initialize() {&#xA;        avCodec = avcodec_find_decoder(AV_CODEC_ID_H264);&#xA;        if (avCodec == null) {&#xA;            throw new RuntimeException("Can&#x27;t find decoder");&#xA;        }&#xA;        avCodecContext = avcodec_alloc_context3(avCodec);&#xA;        if (avCodecContext == null) {&#xA;            throw new RuntimeException("Can&#x27;t allocate decoder context");&#xA;        }&#xA;        int result = avcodec_open2(avCodecContext, avCodec, (AVDictionary) null);&#xA;        if (result &lt; 0) {&#xA;            throw new RuntimeException("Can&#x27;t open decoder");&#xA;        }&#xA;        avFrame = av_frame_alloc();&#xA;        if (avFrame == null) {&#xA;            throw new RuntimeException("Can&#x27;t allocate frame");&#xA;        }&#xA;    }&#xA;

    &#xA;&#xA;

    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.

    &#xA;&#xA;

    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;