Recherche avancée

Médias (1)

Mot : - Tags -/blender

Autres articles (53)

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

  • Les images

    15 mai 2013
  • Mediabox : ouvrir les images dans l’espace maximal pour l’utilisateur

    8 février 2011, par

    La visualisation des images est restreinte par la largeur accordée par le design du site (dépendant du thème utilisé). Elles sont donc visibles sous un format réduit. Afin de profiter de l’ensemble de la place disponible sur l’écran de l’utilisateur, il est possible d’ajouter une fonctionnalité d’affichage de l’image dans une boite multimedia apparaissant au dessus du reste du contenu.
    Pour ce faire il est nécessaire d’installer le plugin "Mediabox".
    Configuration de la boite multimédia
    Dès (...)

Sur d’autres sites (7686)

  • FFmpeg does not detect bitstream filter parameter

    6 mai 2024, par FFmpegEnthusiast

    I have tried to make a bitstream filter for FFmpeg that drops the nth keyframe for positive numbers and allows the first n keyframes and drops the rest for nonpositive numbers, called "datamosh" :

    


    ffmpeg -i input.webm -bsf:v datamosh=target=20 -c copy output.webm


    


    outputs the error :

    


    Option 'target' not found
[vost#0:0/copy @ 0x54edc40] Error parsing bitstream filter sequence 'datamosh=target=20': Option not found


    


    Here is the code for the "datamosh" bitstream filter :

    


    #include "bsf.h"
#include "bsf_internal.h"

#include "libavutil/opt.h"

typedef struct {
    const AVClass *class;

    int target, i;
} DatamoshContext;

static int datamosh_init(AVBSFContext *ctx)
{
    DatamoshContext *s = ctx->priv_data;

    s->i = 0;

    return 0;
}

static int datamosh(AVBSFContext *ctx, AVPacket *pkt)
{
    DatamoshContext *s = ctx->priv_data;
    int ret;

    ret = ff_bsf_get_packet_ref(ctx, pkt);
    if (ret < 0)
        return ret;

    if (s->target < 1) {
        if (s->i <= -s->target)
            return 0;
        else {
            av_packet_unref(pkt);
            return AVERROR(EAGAIN);
        }
    }

    if (pkt->flags & AV_PKT_FLAG_KEY)
        ++s->i;

    if (s->i == s->target) {
        av_packet_unref(pkt);
        return AVERROR(EAGAIN);
    }

    return 0;
}


#define OFFSET(x) offsetof(DatamoshContext, x)
#define FLAGS (AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_BSF_PARAM)

static const AVOption options[] = {
    { "target", NULL, OFFSET(target), AV_OPT_TYPE_INT, { .i64 = 0 }, -INT_MAX, INT_MAX, FLAGS },
    { NULL },
};

static const AVClass datamosh_class = {
    .class_name = "datamosh",
    .item_name = av_default_item_name,
    .option = options,
    .version = LIBAVUTIL_VERSION_INT,
};

const FFBitStreamFilter ff_datamosh_bsf = {
    .p.name = "datamosh",
    .p.priv_class = &datamosh_class,
    .priv_data_size = sizeof(DatamoshContext),
    .init = datamosh_init,
    .filter = datamosh,
};


    


    n is called "target" in the code.

    


    Weirdly, ffmpeg -h bsf=datamosh prints :

    


    Bit stream filter datamosh&#xA;datamosh AVOptions:&#xA;  -target            <int>        ...VA...B.. (from -2.14748e&#x2B;09 to INT_MAX) (default 0)&#xA;</int>

    &#xA;

  • How To send a RSTP stream with the newest FFmpeg(NOT BY COMMAND)

    21 juillet 2016, par GuardSkill

    Can any body give me a example or indicate to use FFmpeg library to capture the USB video (or capture the internet RSTP stream )and send the information to our own server by RTSP stream.Very Thanks your answer

  • Streaming RTP with ffmpeg and node.js to voip phone

    5 juillet 2023, par Nik Hendricks

    I am trying to implement SIP in node.js. Here is the library i am working on

    &#xA;

    Upon receiving an invite request such as

    &#xA;

    &#xA;Received INVITE&#xA;INVITE sip:201@192.168.1.2:5060 SIP/2.0&#xA;Via: SIP/2.0/UDP 192.168.1.39:5062;branch=z9hG4bK1534941205&#xA;From: "Nik" &lt;sip:nik@192.168.1.2&gt;;tag=564148403&#xA;To: &lt;sip:201@192.168.1.2&gt;&#xA;Call-ID: 2068254636@192.168.1.39&#xA;CSeq: 2 INVITE&#xA;Contact: &lt;sip:nik@192.168.1.39:5062&gt;&#xA;Authorization: Digest username="Nik", realm="NRegistrar", nonce="1234abcd", uri="sip:201@192.168.1.2:5060", response="7fba16dafe3d60c270b774bd5bba524c", algorithm=MD5&#xA;Content-Type: application/sdp&#xA;Allow: INVITE, INFO, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE, REFER, PUBLISH, UPDATE, MESSAGE&#xA;Max-Forwards: 70&#xA;User-Agent: Yealink SIP-T42G 29.71.0.120&#xA;Supported: replaces&#xA;Allow-Events: talk,hold,conference,refer,check-sync&#xA;Content-Length: 306&#xA;&#xA;v=0&#xA;o=- 20083 20083 IN IP4 192.168.1.39&#xA;s=SDP data&#xA;c=IN IP4 192.168.1.39&#xA;t=0 0&#xA;m=audio 11782 RTP/AVP 0 8 18 9 101&#xA;a=rtpmap:0 PCMU/8000&#xA;a=rtpmap:8 PCMA/8000&#xA;a=rtpmap:18 G729/8000&#xA;a=fmtp:18 annexb=no&#xA;a=rtpmap:9 G722/8000&#xA;a=fmtp:101 0-15&#xA;a=rtpmap:101 telephone-event/8000&#xA;a=ptime:20&#xA;a=sendrecv&#xA;&#xA;

    &#xA;

    I can then parse the SDP into an object like this

    &#xA;

     &#xA;{&#xA;    "session":{&#xA;        "version":"0",&#xA;        "origin":"- 20084 20084 IN IP4 192.168.1.39",&#xA;        "sessionName":"SDP data"&#xA;    },&#xA;    "media":[&#xA;        {&#xA;            "media":"audio",&#xA;            "port":11784,&#xA;            "protocol":"RTP/AVP",&#xA;            "format":"0",&#xA;            "attributes":[&#xA;                "rtpmap:0 PCMU/8000",&#xA;                "rtpmap:8 PCMA/8000",&#xA;                "rtpmap:18 G729/8000",&#xA;                "fmtp:18 annexb=no",&#xA;                "rtpmap:9 G722/8000",&#xA;                "fmtp:101 0-15",&#xA;                "rtpmap:101 telephone-event/8000",&#xA;                "ptime:20",&#xA;                "sendrecv"&#xA;            ]&#xA;        }&#xA;    ]&#xA;}&#xA;

    &#xA;

    After sending the 100 and 180 responses with my library i attempt to start a RTP stream with ffmpeg

    &#xA;

    var port = SDPParser.parse(res.message.body).media[0].port&#xA;var s = new STREAMER(&#x27;output.wav&#x27;, &#x27;192.168.1.39&#x27;, port)&#xA;

    &#xA;

    with the following STREAMER class

    &#xA;

    class Streamer{&#xA;    constructor(inputFilePath, rtpAddress, rtpPort){&#xA;        this.inputFilePath = &#x27;output.wav&#x27;;&#xA;        this.rtpAddress = rtpAddress;&#xA;        this.rtpPort = rtpPort;&#xA;    }&#xA;&#xA;    start(){&#xA;        return new Promise((resolve) => {&#xA;            const ffmpegCommand = `ffmpeg -re -i ${this.inputFilePath} -ar 8000 -f mulaw -f rtp rtp://${this.rtpAddress}:${this.rtpPort}`;&#xA;            const ffmpegProcess = spawn(ffmpegCommand, { shell: true });&#xA;    &#xA;            ffmpegProcess.stdout.on(&#x27;data&#x27;, (data) => {&#xA;                data = data.toString()&#xA;                //replace all instances of 127.0.0.1 with our local ip address&#xA;                data = data.replace(new RegExp(&#x27;127.0.0.1&#x27;, &#x27;g&#x27;), &#x27;192.168.1.3&#x27;);&#xA;&#xA;                resolve(data.toString())&#xA;            });&#xA;    &#xA;            ffmpegProcess.stderr.on(&#x27;data&#x27;, (data) => {&#xA;              // Handle stderr data if required&#xA;              console.log(data.toString())&#xA;            });&#xA;    &#xA;            ffmpegProcess.on(&#x27;close&#x27;, (code) => {&#xA;              // Handle process close event if required&#xA;              console.log(&#x27;close&#x27;)&#xA;              console.log(code.toString())&#xA;            });&#xA;    &#xA;            ffmpegProcess.on(&#x27;error&#x27;, (error) => {&#xA;              // Handle process error event if required&#xA;              console.log(error.toString())&#xA;            });&#xA;        })&#xA;    }&#xA;     &#xA;}&#xA;

    &#xA;

    the start() function resolves with the SDP that ffmpeg generates. I am starting to think that ffmpeg cant generate proper SDP for voip calls.

    &#xA;

    so when i create 200 response with the following sdp

    &#xA;

    v=0&#xA;o=- 0 0 IN IP4 192.168.1.3&#xA;s=Impact Moderato&#xA;c=IN IP4 192.168.1.39&#xA;t=0 0&#xA;a=tool:libavformat 58.29.100&#xA;m=audio 12123 RTP/AVP 97&#xA;b=AS:128&#xA;a=rtpmap:97 PCMU/8000/2&#xA;

    &#xA;

    the other line never picks up. from my understanding the first invite from the caller will provide SDP that will tell me where to send the RTP stream too and the correct codecs and everything. I know that currently, my wav file is PCMU and i can listen to it with ffplay and the provided sdp. what is required to make the other line pickup specifically a Yealink t42g

    &#xA;

    my full attempt looks like this

    &#xA;

    Client.on(&#x27;INVITE&#x27;, (res) => {&#xA;    console.log("Received INVITE")&#xA;    var d = Client.Dialog(res).then(dialog => {&#xA;        dialog.send(res.CreateResponse(100))&#xA;        dialog.send(res.CreateResponse(180))&#xA;        var port = SDPParser.parse(res.message.body).media[0].port&#xA;&#xA;        var s = new STREAMER(&#x27;output.wav&#x27;, &#x27;192.168.1.39&#x27;, port)&#xA;        s.start().then(sdp => {&#xA;            console.log(sdp.split(&#x27;SDP:&#x27;)[1])&#xA;            var ok = res.CreateResponse(200)&#xA;            ok.body = sdp.split(&#x27;SDP:&#x27;)[1]&#xA;            dialog.send(ok)&#xA;        })&#xA;&#xA;        dialog.on(&#x27;BYE&#x27;, (res) => {&#xA;            console.log("BYE")&#xA;            dialog.send(res.CreateResponse(200))&#xA;            dialog.kill()&#xA;        })&#xA;    })&#xA;})&#xA;

    &#xA;

    I have provided a link to my library at the top of this message. My current problem is in the examples/Client folder.

    &#xA;

    I'm not sure what could be going wrong here. Maybe i'm not using the right format or codec for the VOIP phone i dont see whats wrong with the SDP. especially if i can listen to SDP generated by ffmpeg if i stream RTP back to the same computer i use ffplay on. Any help is greatly appreciated.

    &#xA;

    Update

    &#xA;

    As i test i decided to send the caller back SDP that was generated by a Yealink phone like itself. but with some modifications

    &#xA;

    v=0&#xA;o=- ${this.output_port} ${this.output_port} IN IP4 192.168.1.39&#xA;s=SDP data&#xA;c=IN IP4 192.168.1.39&#xA;t=0 0&#xA;m=audio ${this.output_port} RTP/AVP 0 8 18 9 101&#xA;a=rtpmap:0 PCMU/8000&#xA;a=rtpmap:8 PCMA/8000&#xA;a=rtpmap:18 G729/8000&#xA;a=fmtp:18 annexb=no&#xA;a=rtpmap:9 G722/8000&#xA;a=fmtp:101 0-15&#xA;a=rtpmap:1&#xA;01 telephone-event/8000&#xA;a=ptime:20&#xA;a=sendrecv&#xA;

    &#xA;

    Finally, the phone that makes the call in the first place will fully answer but still no audio stream. I notice if I change the IP address or port to something wrong the other phone Will hear its own audio instead of just quiet. so this leads me to believe I am headed in the right direction. And maybe the problem lies in not sending the right audio format for what I'm describing.

    &#xA;

    Additionaly, Whenever using ffmpeg to stream my audio with rtp I notice that it sees the file format as this pcm_alaw, 8000 Hz, mono, s16, 64 kb/s My new SDP describes using both ulaw and alaw but I'm not sure which it is saying it prefers

    &#xA;

    v=0&#xA;o=- ${this.output_port} ${this.output_port} IN IP4 192.168.1.39&#xA;s=SDP data&#xA;c=IN IP4 192.168.1.39&#xA;t=0 0&#xA;m=audio ${this.output_port} RTP/AVP 0 101&#xA;a=rtpmap:0 PCMU/8000&#xA;a=fmtp:101 0-15&#xA;a=rtpmap:101 telephone-event/8000&#xA;a=ptime:0&#xA;a=sendrecv&#xA;

    &#xA;

    I have been able to simply the SDP down to this. This will let the other phone actually pickup and not hear its own audio. it's just a completely dead air stream.

    &#xA;