Recherche avancée

Médias (1)

Mot : - Tags -/intégration

Autres articles (102)

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

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

Sur d’autres sites (11380)

  • JavaFX MediaPlayer unable to play local m3u8 file

    3 mai 2017, par Lennart

    I want to show a live stream of a web cam in my JavaFX application using the MediaPlayer/MediaView. My attempt was to use ffmpeg to record a HLS and to play the resulting m3u8 file, but that throws the following exception (VLC plays the video without problems) :

    MediaException: UNKNOWN : com.sun.media.jfxmedia.MediaException: Could not create player! : com.sun.media.jfxmedia.MediaException: Could not create player!
       at javafx.scene.media.MediaException.exceptionToMediaException(MediaException.java:146)
       at javafx.scene.media.MediaPlayer.init(MediaPlayer.java:511)
       at javafx.scene.media.MediaPlayer.<init>(MediaPlayer.java:414)
       at de.fraunhofer.iosb.ias.flow.assessment.management.monitor.MonitorViewController.testStream(MonitorViewController.java:203)
       ... 58 more
    Caused by: com.sun.media.jfxmedia.MediaException: Could not create player!
       at com.sun.media.jfxmediaimpl.NativeMediaManager.getPlayer(NativeMediaManager.java:274)
       at com.sun.media.jfxmedia.MediaManager.getPlayer(MediaManager.java:118)
       at javafx.scene.media.MediaPlayer.init(MediaPlayer.java:467)
       ... 60 more
    </init>

    I debugged the player creation and the error occurs inside the constructor of GSTMediaPlayer when GSTMediaPlayer.gstInitPlayer() is called. This native method returns the error code 257, which javafx maps to MediaError.ERROR_MEDIA_NULL.

    I used the following ffmpeg command to record the video :

    ffmpeg -hide_banner -y -rtbufsize 250MB -f dshow -pixel_format yuv420p -video_size 960x720 -i video="Logitech HD Pro Webcam C920" -c:v libx264 -crf 20 -pix_fmt yuv420p out.m3u8

    I’m pretty sure that the encoding matches the requirements of javafx, because if I change the output container from m3u8 to mp4, the video is played without problems using the exact same ffmpeg command.

    This is the output of ffprobe for the m3u8 file :

    Input #0, hls,applehttp, from 'out.m3u8':
     Duration: 00:00:24.23, start: 1.466667, bitrate: 0 kb/s
     Program 0
       Metadata:
         variant_bitrate : 0
       Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 960x720, 30 fps, 30 tbr, 90k tbn, 60 tbc

    And for the mp4 file :

    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'out.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf57.41.100
     Duration: 00:01:04.93, start: 0.000000, bitrate: 1676 kb/s
       Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 960x720, 1673 kb/s, 30 fps, 30 tbr, 10000k tbn, 60 tbc (default)
       Metadata:
         handler_name    : VideoHandler

    The resulting m3u8 file looks like this :

    #EXTM3U
    #EXT-X-VERSION:3
    #EXT-X-TARGETDURATION:9
    #EXT-X-MEDIA-SEQUENCE:0
    #EXTINF:8.333322,
    out0.ts
    #EXTINF:8.333333,
    out1.ts
    #EXTINF:7.133322,
    out2.ts
    #EXTINF:0.433333,
    out3.ts
    #EXT-X-ENDLIST

    Update : After I found this reference m3u file, I think that the problem is that the file is stored locally and isn’t delivered via HTTP. The video plays fine with this :

    Media media = new Media("http://download.oracle.com/otndocs/products/javafx/JavaRap/prog_index.m3u8");
    MediaPlayer player = new MediaPlayer(media);
    player.setAutoPlay(true);
    mediaView.setMediaPlayer(player);

    But after I downloaded the reference m3u and all of its segments and tried to open the local file like this, the error occurred again :

    File video = new File("H://Projects//Tools//ref//prog_index.m3u8");
    Media media = new Media(video.toURI().toString());
    MediaPlayer player = new MediaPlayer(media);
    player.setAutoPlay(true);
    mediaView.setMediaPlayer(player);

    I tried to change my m3u file so that the segements are referenced with absolute paths. I tried different notations (H:\f\out0.ts, H:/f/out0.ts, H://f//out0.ts, file:/H:/f/out0.ts, file:///H:/f/out0.ts), but I couldn’t get it to work.

  • JavaFX MediaPlayer unable to play local m3u8 file

    22 février 2020, par Lennart

    I want to show a live stream of a web cam in my JavaFX application using the MediaPlayer/MediaView. My attempt was to use ffmpeg to record a HLS and to play the resulting m3u8 file, but that throws the following exception (VLC plays the video without problems) :

    MediaException: UNKNOWN : com.sun.media.jfxmedia.MediaException: Could not create player! : com.sun.media.jfxmedia.MediaException: Could not create player!
       at javafx.scene.media.MediaException.exceptionToMediaException(MediaException.java:146)
       at javafx.scene.media.MediaPlayer.init(MediaPlayer.java:511)
       at javafx.scene.media.MediaPlayer.<init>(MediaPlayer.java:414)
       at de.fraunhofer.iosb.ias.flow.assessment.management.monitor.MonitorViewController.testStream(MonitorViewController.java:203)
       ... 58 more
    Caused by: com.sun.media.jfxmedia.MediaException: Could not create player!
       at com.sun.media.jfxmediaimpl.NativeMediaManager.getPlayer(NativeMediaManager.java:274)
       at com.sun.media.jfxmedia.MediaManager.getPlayer(MediaManager.java:118)
       at javafx.scene.media.MediaPlayer.init(MediaPlayer.java:467)
       ... 60 more
    </init>

    I debugged the player creation and the error occurs inside the constructor of GSTMediaPlayer when GSTMediaPlayer.gstInitPlayer() is called. This native method returns the error code 257, which javafx maps to MediaError.ERROR_MEDIA_NULL.

    I used the following ffmpeg command to record the video :

    ffmpeg -hide_banner -y -rtbufsize 250MB -f dshow -pixel_format yuv420p -video_size 960x720 -i video="Logitech HD Pro Webcam C920" -c:v libx264 -crf 20 -pix_fmt yuv420p out.m3u8

    I’m pretty sure that the encoding matches the requirements of javafx, because if I change the output container from m3u8 to mp4, the video is played without problems using the exact same ffmpeg command.

    This is the output of ffprobe for the m3u8 file :

    Input #0, hls,applehttp, from 'out.m3u8':
     Duration: 00:00:24.23, start: 1.466667, bitrate: 0 kb/s
     Program 0
       Metadata:
         variant_bitrate : 0
       Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 960x720, 30 fps, 30 tbr, 90k tbn, 60 tbc

    And for the mp4 file :

    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'out.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf57.41.100
     Duration: 00:01:04.93, start: 0.000000, bitrate: 1676 kb/s
       Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 960x720, 1673 kb/s, 30 fps, 30 tbr, 10000k tbn, 60 tbc (default)
       Metadata:
         handler_name    : VideoHandler

    The resulting m3u8 file looks like this :

    #EXTM3U
    #EXT-X-VERSION:3
    #EXT-X-TARGETDURATION:9
    #EXT-X-MEDIA-SEQUENCE:0
    #EXTINF:8.333322,
    out0.ts
    #EXTINF:8.333333,
    out1.ts
    #EXTINF:7.133322,
    out2.ts
    #EXTINF:0.433333,
    out3.ts
    #EXT-X-ENDLIST

    Update : After I found this reference m3u file, I think that the problem is that the file is stored locally and isn’t delivered via HTTP. The video plays fine with this :

    Media media = new Media("http://download.oracle.com/otndocs/products/javafx/JavaRap/prog_index.m3u8");
    MediaPlayer player = new MediaPlayer(media);
    player.setAutoPlay(true);
    mediaView.setMediaPlayer(player);

    But after I downloaded the reference m3u and all of its segments and tried to open the local file like this, the error occurred again :

    File video = new File("H://Projects//Tools//ref//prog_index.m3u8");
    Media media = new Media(video.toURI().toString());
    MediaPlayer player = new MediaPlayer(media);
    player.setAutoPlay(true);
    mediaView.setMediaPlayer(player);

    I tried to change my m3u file so that the segements are referenced with absolute paths. I tried different notations (H:\f\out0.ts, H:/f/out0.ts, H://f//out0.ts, file:/H:/f/out0.ts, file:///H:/f/out0.ts), but I couldn’t get it to work.

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

    &#xA;

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

    &#xA;

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

    &#xA;

    this is the GitHub of my PBX so far FlowPBX

    &#xA;

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

    &#xA;

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

    &#xA;

    my function goes as follows

    &#xA;

    start_stream(call_id, sdp){&#xA;        console.log(&#x27;Starting Stream&#x27;)&#xA;        let port = sdp.match(/m=audio (\d&#x2B;) RTP/)[1];&#xA;        let ip = sdp.match(/c=IN IP4 (\d&#x2B;\.\d&#x2B;\.\d&#x2B;\.\d&#x2B;)/)[1];&#xA;        let codec_ids = sdp.match(/m=audio \d&#x2B; RTP\/AVP (.&#x2B;)/)[1].split(&#x27; &#x27;);&#xA;        let ffmpeg_codec_map = {&#xA;            &#x27;opus&#x27;: &#x27;libopus&#x27;,&#xA;            &#x27;PCMU&#x27;: &#x27;pcm_mulaw&#x27;,&#xA;            &#x27;PCMA&#x27;: &#x27;pcm_alaw&#x27;,&#xA;            &#x27;telephone-event&#x27;: &#x27;pcm_mulaw&#x27;,&#xA;            &#x27;speex&#x27;: &#x27;speex&#x27;,&#xA;            &#x27;G722&#x27;: &#x27;g722&#x27;,&#xA;            &#x27;G729&#x27;: &#x27;g729&#x27;,&#xA;            &#x27;GSM&#x27;: &#x27;gsm&#x27;,&#xA;            &#x27;AMR&#x27;: &#x27;amr&#x27;,&#xA;            &#x27;AMR-WB&#x27;: &#x27;amr_wb&#x27;,&#xA;            &#x27;iLBC&#x27;: &#x27;ilbc&#x27;,&#xA;            &#x27;iSAC&#x27;: &#x27;isac&#x27;,&#xA;        }&#xA;&#xA;        let codecs = [];&#xA;        sdp.split(&#x27;\n&#x27;).forEach(line => {&#xA;            if(line.includes(&#x27;a=rtpmap&#x27;)){&#xA;                let codec = line.match(/a=rtpmap:(\d&#x2B;) (.&#x2B;)/)[2];&#xA;                let c_id = line.match(/a=rtpmap:(\d&#x2B;) (.&#x2B;)/)[1];&#xA;                codecs.push({                    &#xA;                    name: codec.split(&#x27;/&#x27;)[0],&#xA;                    rate: codec.split(&#x27;/&#x27;)[1],&#xA;                    channels: codec.split(&#x27;/&#x27;)[2] !== undefined ? codec.split(&#x27;/&#x27;)[2] : 1,&#xA;                    id: c_id&#xA;                })&#xA;            }&#xA;        })&#xA;&#xA;        console.log(&#x27;codecs&#x27;)&#xA;        console.log(codecs)&#xA;&#xA;        let selected_codec = codecs[0]&#xA;        if(selected_codec.name == &#x27;telephone-event&#x27;){&#xA;            selected_codec = codecs[1]&#xA;            console.log(selected_codec)&#xA;        }&#xA;&#xA;        //see if opus is available&#xA;        codecs.forEach(codec => {&#xA;            if(codec.name == &#x27;opus&#x27;){&#xA;                selected_codec = codec;&#xA;            }&#xA;        })&#xA;&#xA;        if(selected_codec.name != &#x27;opus&#x27;){&#xA;            //check if g729 is available&#xA;            codecs.forEach(codec => {&#xA;                if(codec.name == &#x27;G729&#x27;){&#xA;                    selected_codec = codec;&#xA;                }&#xA;            })&#xA;        }&#xA;&#xA;        console.log(&#x27;selected_codec&#x27;)&#xA;        console.log(selected_codec)&#xA;&#xA;        let spawn = require(&#x27;child_process&#x27;).spawn;&#xA;        let ffmpegArgs = [&#xA;            &#x27;-re&#x27;,&#xA;            &#x27;-i&#x27;, &#x27;song.mp3&#x27;,&#xA;            &#x27;-acodec&#x27;, ffmpeg_codec_map[selected_codec.name],&#xA;            &#x27;-ar&#x27;, selected_codec.rate,&#xA;            &#x27;-ac&#x27;, selected_codec.channels,&#xA;            &#x27;-payload_type&#x27;, selected_codec.id,&#xA;            &#x27;-f&#x27;, &#x27;rtp&#x27;, `rtp://${ip}:${port}`&#xA;        ];&#xA;&#xA;        let ffmpeg = spawn(&#x27;ffmpeg&#x27;, ffmpegArgs);&#xA;&#xA;        ffmpeg.stdout.on(&#x27;data&#x27;, (data) => {&#xA;            console.log(`stdout: ${data}`);&#xA;        });&#xA;        ffmpeg.stderr.on(&#x27;data&#x27;, (data) => {&#xA;            console.error(`stderr: ${data}`);&#xA;        });&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;

    &#xA;

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

    &#xA;

    today I tried to register a grandstream phone to my pbx and the rtp stream is blank audio.&#xA;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.

    &#xA;

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

    &#xA;

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

    &#xA;

    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 ?

    &#xA;

    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.

    &#xA;