Recherche avancée

Médias (1)

Mot : - Tags -/musée

Autres articles (38)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

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

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

Sur d’autres sites (1723)

  • varying RTP stream result from custom SIP implementation

    1er février, par Nik Hendricks

    I am in the process of creating my own SIP implementation in Node.js. As well as a b2bua as a learning project.

    


    Finding people wise in the ways of SIP has proved to be difficult elsewhere but here I have had good results

    


    this is the GitHub of my library so far node.js-sip

    


    this is the GitHub of my PBX so far FlowPBX

    


    Currently, everything is working as I expect. Although I really have some questions on possible errors in my implementation.

    


    My main issue is with RTP streams. Currently I am utilizing ffmpeg.

    


    my function goes as follows

    


    start_stream(call_id, sdp){
        console.log('Starting Stream')
        let port = sdp.match(/m=audio (\d+) RTP/)[1];
        let ip = sdp.match(/c=IN IP4 (\d+\.\d+\.\d+\.\d+)/)[1];
        let codec_ids = sdp.match(/m=audio \d+ RTP\/AVP (.+)/)[1].split(' ');
        let ffmpeg_codec_map = {
            'opus': 'libopus',
            'PCMU': 'pcm_mulaw',
            'PCMA': 'pcm_alaw',
            'telephone-event': 'pcm_mulaw',
            'speex': 'speex',
            'G722': 'g722',
            'G729': 'g729',
            'GSM': 'gsm',
            'AMR': 'amr',
            'AMR-WB': 'amr_wb',
            'iLBC': 'ilbc',
            'iSAC': 'isac',
        }

        let codecs = [];
        sdp.split('\n').forEach(line => {
            if(line.includes('a=rtpmap')){
                let codec = line.match(/a=rtpmap:(\d+) (.+)/)[2];
                let c_id = line.match(/a=rtpmap:(\d+) (.+)/)[1];
                codecs.push({                    
                    name: codec.split('/')[0],
                    rate: codec.split('/')[1],
                    channels: codec.split('/')[2] !== undefined ? codec.split('/')[2] : 1,
                    id: c_id
                })
            }
        })

        console.log('codecs')
        console.log(codecs)

        let selected_codec = codecs[0]
        if(selected_codec.name == 'telephone-event'){
            selected_codec = codecs[1]
            console.log(selected_codec)
        }

        //see if opus is available
        codecs.forEach(codec => {
            if(codec.name == 'opus'){
                selected_codec = codec;
            }
        })

        if(selected_codec.name != 'opus'){
            //check if g729 is available
            codecs.forEach(codec => {
                if(codec.name == 'G729'){
                    selected_codec = codec;
                }
            })
        }

        console.log('selected_codec')
        console.log(selected_codec)

        let spawn = require('child_process').spawn;
        let ffmpegArgs = [
            '-re',
            '-i', 'song.mp3',
            '-acodec', ffmpeg_codec_map[selected_codec.name],
            '-ar', selected_codec.rate,
            '-ac', selected_codec.channels,
            '-payload_type', selected_codec.id,
            '-f', 'rtp', `rtp://${ip}:${port}`
        ];

        let ffmpeg = spawn('ffmpeg', ffmpegArgs);

        ffmpeg.stdout.on('data', (data) => {
            console.log(`stdout: ${data}`);
        });
        ffmpeg.stderr.on('data', (data) => {
            console.error(`stderr: ${data}`);
        });




}


    


    When using zoiper to test it works great. I have seen the mobile version negotiate speex
and the desktop version negotiate opus mostly for the codec.

    


    today I tried to register a grandstream phone to my pbx and the rtp stream is blank audio.
opus is available and I have tried to prefer that in my stream but still even when selecting that I cannot get audio to the grandstream phone. This is the same case for a yealink phone. I can only get zoiper to work so far.

    


    what could be causing this behavior ? there is a clear path of communication between everything just like the zoiper client's I have used.

    


    Additionally in my sip implementation,
how important is the concept of a dialog ? currently, I just match messages by Call-ID

    


    and then choose what to send based on the method or response. is there any other underlying dialog functionality that I may need to implement ?

    


    It would just be awesome to get someone who really knows what they are talking about eyes on some of my code to direct this large codebase in the right direction but I realize that a big ask lol.

    


  • Why is my FastAPI process being suspended, and how can I avoid this ?

    19 janvier, par blermen

    I'm working on a web app using FastAPI that uses ffmpeg to overlay audio onto video for the user. I'm running into an issue where, when I use subprocess.run(cmd), it automatically suspends the process running my FastAPI app. I can't figure out how to get the error logs to help deduce why this is, and I haven't found anything online talking about this.

    


    @app.get("/overlay-audio/")
async def get_video(audio_file: str, forged_name: Annotated[str, Query()] = "default"):
    video_path = os.path.join(output_path, "sample.mp4")
    audio_path = os.path.join(output_path, audio_file)
    forged_path = os.path.join(output_path, forged_name + ".mp4")
    print("Video path: " + video_path)
    print("Audio path: " + audio_path)
    print("Output path: " + forged_path)

    # command to recreate
    # ffmpeg -i input.mp4 -i input.wav -c:v copy -map 0:v:0 -map 1:a:0 -c:a aac -b:a 192k output.mp4

    cmd = ["/opt/homebrew/bin/ffmpeg", 
           "-i", video_path,
           "-i", audio_path,
           "-c:v", "copy",
           "-map", "0:v:0",
           "-map", "1:a:0",
           "-c:a", "aac",
           "-b:a", "192k",
           forged_path]
    
    subprocess.run(cmd)
           
    return {"forged_vid": f"forged_{forged_name}"}


if __name__ == "__main__":
    uvicorn.run("main:app", host="127.0.0.1", port=8000, reload=True)


    


    I've tried not writing output to the terminal, as I've read that could be a reason why it suspends using result = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE), and I've also tried running it asynchronously to avoid blocking the event loop using

    


    result = await asyncio.create_subprocess_exec(
        *cmd,
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE
    )


    


    but nothing works. Any help or possible other ways to go about this would be greatly appreciated. Terminal output about the suspension : [1] + 12526 suspended (tty output) "/Users//Tech Projects/project/tts/videnv/bin/python"

    


  • FFmpeg wrong codecstring for DASH manifest [closed]

    21 novembre 2024, par Suxsem

    I'm trying to create a DASH stream with ffmpeg with the following command :

    


    ffmpeg -i rtsp://admin:***@camera-retro.lan/ch0_0 ^
       -map 0 ^
       -codec:v copy ^
       -codec:a copy ^
       -f dash ^
       -use_template 1 ^
       -use_timeline 1 ^
       -window_size 50 ^
       -extra_window_size 5 ^
       -seg_duration 5 ^
       tmp/output.mpd


    


    The problem is the generated manifest doesn't contain a valid codecstring for the video part (note the codecs="hev1" part) and thus is not playable by the browser :

    


    &lt;?xml version="1.0" encoding="utf-8"?>&#xA;<mpd xmlns="urn:mpeg:dash:schema:mpd:2011" profiles="urn:mpeg:dash:profile:isoff-live:2011" type="dynamic" minimumupdateperiod="PT6S" suggestedpresentationdelay="PT6S" availabilitystarttime="2024-11-21T12:05:52.604Z" publishtime="2024-11-21T12:05:57.559Z" timeshiftbufferdepth="PT5M1.9S" maxsegmentduration="PT5.0S" minbuffertime="PT12.0S">&#xA;    <programinformation>&#xA;        &#xA;    </programinformation>&#xA;    <servicedescription>&#xA;    </servicedescription>&#xA;    <period start="PT0.0S">&#xA;        <adaptationset contenttype="video" startwithsap="1" segmentalignment="true" bitstreamswitching="true" maxwidth="2304" maxheight="1296" par="16:9">&#xA;            <representation mimetype="video/mp4" codecs="hev1" bandwidth="822093" width="2304" height="1296" scantype="unknown" sar="1:1">&#xA;                <segmenttemplate timescale="90000" initialization="init-stream$RepresentationID$.m4s" media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startnumber="1">&#xA;                    <segmenttimeline>&#xA;                        <s t="0" d="542990"></s>&#xA;                    </segmenttimeline>&#xA;                </segmenttemplate>&#xA;            </representation>&#xA;        </adaptationset>&#xA;        <adaptationset contenttype="audio" startwithsap="1" segmentalignment="true" bitstreamswitching="true">&#xA;            <representation mimetype="audio/mp4" codecs="mp4a.40.2" bandwidth="34143" audiosamplingrate="16000">&#xA;                <audiochannelconfiguration schemeiduri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="1"></audiochannelconfiguration>&#xA;                <segmenttemplate timescale="16000" initialization="init-stream$RepresentationID$.m4s" media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startnumber="1">&#xA;                    <segmenttimeline>&#xA;                        <s t="0" d="81001"></s>&#xA;                    </segmenttimeline>&#xA;                </segmenttemplate>&#xA;            </representation>&#xA;        </adaptationset>&#xA;    </period>&#xA;</mpd>&#xA;

    &#xA;

    This is the output of ffprobe :

    &#xA;

    SDP:&#xA;v=0&#xA;o=- 1732188474342789 1 IN IP4 192.168.12.162&#xA;s=Session streamed by "rRTSPServer"&#xA;i=ch0_0.h264&#xA;t=0 0&#xA;a=tool:LIVE555 Streaming Media v2023.01.19&#xA;a=type:broadcast&#xA;a=control:*&#xA;a=range:npt=now-&#xA;a=x-qt-text-nam:Session streamed by "rRTSPServer"&#xA;a=x-qt-text-inf:ch0_0.h264&#xA;m=video 0 RTP/AVP 96&#xA;c=IN IP4 0.0.0.0&#xA;b=AS:700&#xA;a=rtpmap:96 H265/90000&#xA;a=fmtp:96 profile-space=0;profile-id=1;tier-flag=0;level-id=186;interop-constraints=000000000000;sprop-vps=QAEMAf//AWAAAAMAAAMAAAMAAAMAuqwJ;sprop-sps=QgEBAWAAAAMAAAMAAAMAAAMAuqABICAFEf5a7kSIi/Lc1AQEBAI=;sprop-pps=RAHA8oSJAzJA&#xA;a=control:track1&#xA;m=audio 0 RTP/AVP 97&#xA;c=IN IP4 0.0.0.0&#xA;b=AS:32&#xA;a=rtpmap:97 MPEG4-GENERIC/16000&#xA;a=fmtp:97 streamtype=5;profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3;config=1408&#xA;a=control:track2&#xA;

    &#xA;

    it seems to me that all codec informations are present :

    &#xA;

    a=fmtp:96 profile-space=0;profile-id=1;tier-flag=0;level-id=186;interop-constraints=000000000000;&#xA;

    &#xA;

    why ffmpeg is putting only codecs="hev1" instead of the full codecstring (containing the profile, the level and the constraints) ?

    &#xA;

    Thank you

    &#xA;