Recherche avancée

Médias (39)

Mot : - Tags -/audio

Autres articles (106)

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

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

  • Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs

    12 avril 2011, par

    La manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
    Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras.

Sur d’autres sites (6818)

  • Evolution #4380 : gif animé searching.gif

    9 mars 2021, par cedric -

    Bon donc on a 2 bonnes solutions :
    - le loader purement CSS : je suis parti de celui de Lea Verou https://lea.verou.me/2013/11/cleanest-css-spinner-ever/ dont j’ai retrouvé le code ici https://catswhocode.com/css-spinner/ adapté pour avoir 12 branches, arrondies, ce qui donne ça

    Loading…

    - le loader purement svg qui repose sur https://caniuse.com/svg-smil : je suis parti de https://samherbert.net/svg-loaders/ que j’ai adapté pour retrouver le spinner à 12 branches et ça donne ça pour le spinning.svg










































    Qu’on peut insérer via un

        [(#CHEMINloaders/svg-loaders/spinning.svg|balise_svg’Loading...’,’loader’)]
    


    ou

        [(#CHEMINloaders/svg-loaders/spinning.svg|balise_img’Loading...’,’loader’)]
    

    Visuellement le rendu est assez proche entre l’un et l’autre, rien de foufou.

    Avantage/inconvénients du loader css :
    - purement css, juste 3 divs a inserer là ou on en a besoin avec la bonne chaine de langue. Il peut être stylé avec la couleur de l’espace privé (mais pas contextuellement), et dimensionné en em là où on l’utilise. Inconvénients : il faut les css et donc pour le réutiliser dans le public il faut rechoper les styles, donc les proposer aussi dans une css static (notamment si on veut styler dans l’espace prive en fonction de la couleur de preference), donc réutilisation plus laborieuse et migration plus compliquée depuis le searching.gif

    Avantage/inconvénients du loader svg :
    - c’est juste une image, qui s’utilise d’un coup de cuillère à pot n’importe où, et se style en couleur et taille avec un font-size et un color (si on l’insère avec balise_svg, sinon seulement en taille, la couleur étant du coup noire par défaut). La migration depuis le searching.gif est triviale, il suffit de changer le nom du fichier (on peut même par défaut le mettre dans une taille identique).
    Par contre le support est un peu moins bon que le loader css

    J’ai donc une petite préférence pour la version svg, mais les 2 sont gérables

  • FFMPEG does HTTP range request only once (HTML5 MediaStream/WebM)

    17 décembre 2018, par Youssef Gamil

    The Issue

    I am trying to pass HTML5 MediaStream coming from a browser’s webcam to a Socket.IO namespace which is buffered and be accessible to FFMPEG through HTTP endpoint in form of HTTP partial/range requests. Although, it works on perfectly on Firefox/Chrome.

    Here, I have wrapped a sample and pushed it to a GitHub repo

    Environment

    Install

    • npm i from the project directory

    Run

    • npm start : to start the express server
    • Open http://localhost:3000 in Firefox or Chrome, and accept the webcam access dialog.
    • npm run ffmpeg -i http://localhost:3000/view output.webm : TODO : this doesn’t output the full stream
      • http://localhost:3000/view will be visible once it was opened in Firefox/Chrome and they’ll keep requesting till the end of stream or server down.
      • note, npm run ffmpeg ... is a just a shortcut to ffmpeg executable dependency which should be installed at startup in node_modules/@ffmpeg-installer/linux-x64/ffmpeg (which may differ depending on your OS)

    FFMPEG Log

    What I get after running ffmpeg -v trace -i http://localhost:3000/view -y tmp.mp4 :

    Reading option '-v' ... matched as option 'v' (set logging level) with argument 'trace'.
    Reading option '-i' ... matched as input url with argument 'http://localhost:3000/view'.
    Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
    Reading option 'tmp.mp4' ... matched as output url.
    Finished splitting the commandline.
    Parsing a group of options: global .
    Applying option v (set logging level) with argument trace.
    Applying option y (overwrite output files) with argument 1.
    Successfully parsed a group of options.
    Parsing a group of options: input url http://localhost:3000/view.
    Successfully parsed a group of options.
    Opening an input file: http://localhost:3000/view.
    [NULL @ 0x65f1c40] Opening 'http://localhost:3000/view' for reading
    [http @ 0x65f2540] Setting default whitelist 'http,https,tls,rtp,tcp,udp,crypto,httpproxy'
    [tcp @ 0x65f4000] Original list of addresses:
    [tcp @ 0x65f4000] Address 127.0.0.1 port 3000
    [tcp @ 0x65f4000] Interleaved list of addresses:
    [tcp @ 0x65f4000] Address 127.0.0.1 port 3000
    [tcp @ 0x65f4000] Starting connection attempt to 127.0.0.1 port 3000
    [tcp @ 0x65f4000] Successfully connected to 127.0.0.1 port 3000
    [http @ 0x65f2540] request: GET /view HTTP/1.1
    User-Agent: Lavf/58.18.104
    Accept: */*
    Range: bytes=0-
    Connection: close
    Host: localhost:3000
    Icy-MetaData: 1


    [http @ 0x65f2540] header='HTTP/1.1 206 Partial Content'
    [http @ 0x65f2540] http_code=206
    [http @ 0x65f2540] header='X-Powered-By: Express'
    [http @ 0x65f2540] header='Access-Control-Allow-Origin: *'
    [http @ 0x65f2540] header='Content-Range: bytes 0-1391616/1073741824'
    [http @ 0x65f2540] header='Accept-Ranges: bytes'
    [http @ 0x65f2540] header='Content-Length: 1391616'
    [http @ 0x65f2540] header='Connection: close'
    [http @ 0x65f2540] header='Content-Type: video/webm'
    [http @ 0x65f2540] header='Date: Mon, 17 Dec 2018 10:15:14 GMT'
    [http @ 0x65f2540] header=''
    Probing matroska,webm score:100 size:2048
    Probing mp3 score:1 size:2048
    [matroska,webm @ 0x65f1c40] Format matroska,webm probed with size=2048 and score=100
    st:0 removing common factor 1000000 from timebase
    st:1 removing common factor 1000000 from timebase
    [matroska,webm @ 0x65f1c40] Before avformat_find_stream_info() pos: 317 bytes read:3837 seeks:0 nb_streams:2
    [matroska,webm @ 0x65f1c40] All info found
    [matroska,webm @ 0x65f1c40] rfps: 29.750000 0.016025
    [matroska,webm @ 0x65f1c40] rfps: 29.833333 0.013167
    [matroska,webm @ 0x65f1c40] rfps: 29.916667 0.012378
    [matroska,webm @ 0x65f1c40] rfps: 30.000000 0.013659
    [matroska,webm @ 0x65f1c40] rfps: 29.970030 0.012960
    [matroska,webm @ 0x65f1c40] stream 0: start_time: 0.000 duration: -9223372036854776.000
    [matroska,webm @ 0x65f1c40] stream 1: start_time: -0.001 duration: -9223372036854776.000
    [matroska,webm @ 0x65f1c40] format: start_time: -0.001 duration: -9223372036854.775 bitrate=0 kb/s
    [matroska,webm @ 0x65f1c40] After avformat_find_stream_info() pos: 467388 bytes read:469955 seeks:0 frames:115
    Input #0, matroska,webm, from 'http://localhost:3000/view':
     Metadata:
       encoder         : QTmuxingAppLibWebM-0.0.1
     Duration: N/A, start: -0.001000, bitrate: N/A
       Stream #0:0(eng), 41, 1/1000: Video: vp8, 1 reference frame, yuv420p(progressive), 640x480, 0/1, SAR 1:1 DAR 4:3, 1k tbr, 1k tbn, 1k tbc (default)
       Stream #0:1(eng), 74, 1/1000: Audio: opus, 48000 Hz, stereo, fltp, delay 312 (default)
    Successfully opened the file.
    Parsing a group of options: output url tmp.mp4.
  • 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

    


    Upon receiving an invite request such as

    


    
Received INVITE
INVITE sip:201@192.168.1.2:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.39:5062;branch=z9hG4bK1534941205
From: "Nik" <sip:nik@192.168.1.2>;tag=564148403
To: <sip:201@192.168.1.2>
Call-ID: 2068254636@192.168.1.39
CSeq: 2 INVITE
Contact: <sip:nik@192.168.1.39:5062>
Authorization: Digest username="Nik", realm="NRegistrar", nonce="1234abcd", uri="sip:201@192.168.1.2:5060", response="7fba16dafe3d60c270b774bd5bba524c", algorithm=MD5
Content-Type: application/sdp
Allow: INVITE, INFO, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE, REFER, PUBLISH, UPDATE, MESSAGE
Max-Forwards: 70
User-Agent: Yealink SIP-T42G 29.71.0.120
Supported: replaces
Allow-Events: talk,hold,conference,refer,check-sync
Content-Length: 306

v=0
o=- 20083 20083 IN IP4 192.168.1.39
s=SDP data
c=IN IP4 192.168.1.39
t=0 0
m=audio 11782 RTP/AVP 0 8 18 9 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:9 G722/8000
a=fmtp:101 0-15
a=rtpmap:101 telephone-event/8000
a=ptime:20
a=sendrecv



    


    I can then parse the SDP into an object like this

    


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


    


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

    


    var port = SDPParser.parse(res.message.body).media[0].port
var s = new STREAMER('output.wav', '192.168.1.39', port)


    


    with the following STREAMER class

    


    class Streamer{
    constructor(inputFilePath, rtpAddress, rtpPort){
        this.inputFilePath = 'output.wav';
        this.rtpAddress = rtpAddress;
        this.rtpPort = rtpPort;
    }

    start(){
        return new Promise((resolve) => {
            const ffmpegCommand = `ffmpeg -re -i ${this.inputFilePath} -ar 8000 -f mulaw -f rtp rtp://${this.rtpAddress}:${this.rtpPort}`;
            const ffmpegProcess = spawn(ffmpegCommand, { shell: true });
    
            ffmpegProcess.stdout.on('data', (data) => {
                data = data.toString()
                //replace all instances of 127.0.0.1 with our local ip address
                data = data.replace(new RegExp('127.0.0.1', 'g'), '192.168.1.3');

                resolve(data.toString())
            });
    
            ffmpegProcess.stderr.on('data', (data) => {
              // Handle stderr data if required
              console.log(data.toString())
            });
    
            ffmpegProcess.on('close', (code) => {
              // Handle process close event if required
              console.log('close')
              console.log(code.toString())
            });
    
            ffmpegProcess.on('error', (error) => {
              // Handle process error event if required
              console.log(error.toString())
            });
        })
    }
     
}


    


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

    


    so when i create 200 response with the following sdp

    


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


    


    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

    


    my full attempt looks like this

    


    Client.on('INVITE', (res) => {
    console.log("Received INVITE")
    var d = Client.Dialog(res).then(dialog => {
        dialog.send(res.CreateResponse(100))
        dialog.send(res.CreateResponse(180))
        var port = SDPParser.parse(res.message.body).media[0].port

        var s = new STREAMER('output.wav', '192.168.1.39', port)
        s.start().then(sdp => {
            console.log(sdp.split('SDP:')[1])
            var ok = res.CreateResponse(200)
            ok.body = sdp.split('SDP:')[1]
            dialog.send(ok)
        })

        dialog.on('BYE', (res) => {
            console.log("BYE")
            dialog.send(res.CreateResponse(200))
            dialog.kill()
        })
    })
})


    


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

    


    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.

    


    Update

    


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

    


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


    


    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.

    


    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

    


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


    


    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.