Recherche avancée

Médias (0)

Mot : - Tags -/content

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

Autres articles (38)

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

Sur d’autres sites (2493)

  • How to stream a screen sharing through a server

    27 mai 2020, par Moaz

    I'm trying to write an application that captures the screen of the client device and streams it (using ffmpeg) to a node-media-server which publishes it as an HLS stream. The stream is then viewed with an HLS player on a web browser (in my approach I used video.js)

    



    What I did so far :

    



      

    • I created a node media server using the default configurations to Remux to HLS live stream in a file called app.js :
    • 


    



    

    

    const NodeMediaServer = require('node-media-server');

const config = {
  rtmp: {
    port: 1935,
    chunk_size: 60000,
    gop_cache: true,
    ping: 30,
    ping_timeout: 60
  },
  http: {
    port: 8000,
    mediaroot: './media',
    allow_origin: '*'
  },
  trans: {
    ffmpeg: '/usr/local/bin/ffmpeg',
    tasks: [
      {
        app: 'live',
        hls: true,
        hlsFlags: '[hls_time=2:hls_list_size=3:hls_flags=delete_segments]',
        dash: true,
        dashFlags: '[f=dash:window_size=3:extra_window_size=5]'
      }
    ]
  }
};

var nms = new NodeMediaServer(config)
nms.run();

    


    


    




      

    • I ran it with the command node app.js
    • 


    • After installing ffmpeg and figuring out which video and audio source I wanted to stream from, I started streaming by running the command :
    • 


    



    ffmpeg -f avfoundation -framerate 30 -i "1:1" -c:v libx264 -preset superfast -tune zerolatency -c:a aac -ar 44100 -f flv rtmp://localhost/live/STREAM_NAME

    



      

    • I prepared a simple html page which uses the video.js player to play the HLS stream :
    • 


    



    

    

    &#xD;&#xA;  &#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;  <h1>Video.js Example Embed</h1>&#xD;&#xA;&#xD;&#xA;  &#xD;&#xA;    <p class="vjs-no-js">&#xD;&#xA;      To view this video please enable JavaScript, and consider upgrading to a&#xD;&#xA;      web browser that&#xD;&#xA;      <a href="https://videojs.com/html5-video-support/" target="_blank">supports HTML5 video&#xD;&#xA;    </a></p>&#xD;&#xA;  &#xD;&#xA;  &#xD;&#xA;  <code class="echappe-js">&lt;script src=&quot;https://vjs.zencdn.net/7.8.2/video.js&quot;&gt;&lt;/script&gt;&#xD;&#xA;  &lt;script src=&quot;https://unpkg.com/@videojs/http-streaming/dist/videojs-http-streaming.js&quot;&gt;&lt;/script&gt;&#xD;&#xA;  &#xD;&#xA;  &lt;script&gt;&amp;#xD;&amp;#xA;    var player = videojs(&amp;#x27;my_video_1&amp;#x27;);&amp;#xD;&amp;#xA;    player.src([{&amp;#xD;&amp;#xA;      &quot;type&quot;:&quot;application/x-mpegURL&quot;,&amp;#xD;&amp;#xA;      &quot;src&quot;:&quot;http://localhost:8000/live/STREAM_NAME/index.m3u8&quot;&amp;#xD;&amp;#xA;    }]);&amp;#xD;&amp;#xA;    player.play();&amp;#xD;&amp;#xA;  &lt;/script&gt;&#xD;&#xA;

    &#xD;&#xA;

    &#xD;&#xA;

    &#xD;&#xA;&#xA;&#xA;

      &#xA;
    • then I ran an http server and served this html page to prevent and origin access errors.
    • &#xA;

    • when opening this html page the stream works well in Chrome (v83.0.4103.61)
    • &#xA;

    &#xA;&#xA;

    BUT :

    &#xA;&#xA;

      &#xA;
    • In Firefox Developer Edition (v76.0b8 (64-bit)) the player hangs on loading and nothing is shown. It keeps loading the HLS manifest file and the .ts files but the video is not showing :&#xA;enter image description here

    • &#xA;

    • In Safari (v13.1) on MacOS the player never loads correctly and the following errors are printed :&#xA;enter image description here

    • &#xA;

    &#xA;&#xA;

    I tried another video player (flv.js) which workes with http-flv streams using the following basic html page :

    &#xA;&#xA;

    &#xD;&#xA;
    &#xD;&#xA;
    &#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;  <video controls="controls" autoplay="autoplay" muted="muted" width="640" height="268"></video>&#xD;&#xA;&#xD;&#xA;  <code class="echappe-js">&lt;script src=&quot;https://cdn.bootcss.com/flv.js/1.5.0/flv.min.js&quot;&gt;&lt;/script&gt;&#xD;&#xA;  &lt;script&gt;&amp;#xD;&amp;#xA;      if (flvjs.isSupported()) {&amp;#xD;&amp;#xA;          var videoElement = document.getElementById(&amp;#x27;flvPlayer&amp;#x27;);&amp;#xD;&amp;#xA;          var flvPlayer = flvjs.createPlayer({&amp;#xD;&amp;#xA;              type: &amp;#x27;flv&amp;#x27;,&amp;#xD;&amp;#xA;              &quot;isLive&quot;: true,&amp;#xD;&amp;#xA;              url: &amp;#x27;http://localhost:8000/live/STREAM_NAME.flv&amp;#x27;&amp;#xD;&amp;#xA;          });&amp;#xD;&amp;#xA;          flvPlayer.attachMediaElement(videoElement);&amp;#xD;&amp;#xA;          flvPlayer.load();&amp;#xD;&amp;#xA;          flvPlayer.play();&amp;#xD;&amp;#xA;      }&amp;#xD;&amp;#xA;  &lt;/script&gt; &#xD;&#xA;&#xD;&#xA;

    &#xD;&#xA;

    &#xD;&#xA;

    &#xD;&#xA;&#xA;&#xA;

      &#xA;
    • It worked as expected in Chrome
    • &#xA;

    &#xA;&#xA;

    BUT :

    &#xA;&#xA;

      &#xA;
    • On Firefox it plays an empty video with some noise showing the following warnings :&#xA;enter image description here

    • &#xA;

    • And on Safari it doesn't play at all and shows the following error : &#xA;enter image description here

    • &#xA;

    &#xA;&#xA;

    I also tried the same steps on IE11 and on Edge and it also didn't work (Unfortunately, I don't have any screenshots)

    &#xA;&#xA;

    So my questions are : what am I doing wrong ? why didn't each approach work ? and are there other/better approaches that I can also try which helps achiving the same goal (preferably something free/open source with as least latency as possible)

    &#xA;

  • ffmpeg/ffprobe different outputs for file input and binary data input

    6 juin 2020, par SMBH

    What I have done :

    &#xA;&#xA;

    video_file = &#x27;Y001BAQ9k3SU-140.mp4&#x27;&#xA;with open(video_file, &#x27;rb&#x27;) as fid:&#xA;    binary_data = fid.read()&#xA;&#xA;vinfo = ffprobe_binary(binary_data)[&#x27;video&#x27;]&#xA;vinfo2 = skvideo.io.ffprobe(video_file)[&#x27;video&#x27;]&#xA;print(vinfo)&#xA;print(vinfo2)&#xA;exit()&#xA;

    &#xA;&#xA;

    The ffprobe_binary is just a piped version of ffprobe :

    &#xA;&#xA;

    command = [&#x27;ffprobe&#x27;, "-v", "error", "-show_streams", "-print_format", "xml", "-i", "pipe:"]&#xA;

    &#xA;&#xA;

    The vinfo and vinfo2 are different :

    &#xA;&#xA;

    OrderedDict([(&#x27;@index&#x27;, &#x27;0&#x27;), (&#x27;@codec_name&#x27;, &#x27;h264&#x27;), (&#x27;@codec_long_name&#x27;, &#x27;H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10&#x27;), (&#x27;@codec_type&#x27;, &#x27;video&#x27;), (&#x27;@codec_time_base&#x27;, &#x27;1001/60000&#x27;), (&#x27;@codec_tag_string&#x27;, &#x27;avc1&#x27;), (&#x27;@codec_tag&#x27;, &#x27;0x31637661&#x27;), (&#x27;@width&#x27;, &#x27;1280&#x27;), (&#x27;@height&#x27;, &#x27;720&#x27;), (&#x27;@coded_width&#x27;, &#x27;1280&#x27;), (&#x27;@coded_height&#x27;, &#x27;720&#x27;), (&#x27;@has_b_frames&#x27;, &#x27;0&#x27;), (&#x27;@sample_aspect_ratio&#x27;, &#x27;1:1&#x27;), (&#x27;@display_aspect_ratio&#x27;, &#x27;16:9&#x27;), (&#x27;@level&#x27;, &#x27;-99&#x27;), (&#x27;@chroma_location&#x27;, &#x27;left&#x27;), (&#x27;@refs&#x27;, &#x27;1&#x27;), (&#x27;@is_avc&#x27;, &#x27;true&#x27;), (&#x27;@nal_length_size&#x27;, &#x27;4&#x27;), (&#x27;@r_frame_rate&#x27;, &#x27;30000/1001&#x27;), (&#x27;@avg_frame_rate&#x27;, &#x27;30000/1001&#x27;), (&#x27;@time_base&#x27;, &#x27;1/90000&#x27;), (&#x27;@duration_ts&#x27;, &#x27;1012050&#x27;), (&#x27;@duration&#x27;, &#x27;11.245000&#x27;), (&#x27;@bit_rate&#x27;, &#x27;1041887&#x27;), (&#x27;@nb_frames&#x27;, &#x27;337&#x27;), (&#x27;disposition&#x27;, OrderedDict([(&#x27;@default&#x27;, &#x27;1&#x27;), (&#x27;@dub&#x27;, &#x27;0&#x27;), (&#x27;@original&#x27;, &#x27;0&#x27;), (&#x27;@comment&#x27;, &#x27;0&#x27;), (&#x27;@lyrics&#x27;, &#x27;0&#x27;), (&#x27;@karaoke&#x27;, &#x27;0&#x27;), (&#x27;@forced&#x27;, &#x27;0&#x27;), (&#x27;@hearing_impaired&#x27;, &#x27;0&#x27;), (&#x27;@visual_impaired&#x27;, &#x27;0&#x27;), (&#x27;@clean_effects&#x27;, &#x27;0&#x27;), (&#x27;@attached_pic&#x27;, &#x27;0&#x27;), (&#x27;@timed_thumbnails&#x27;, &#x27;0&#x27;)])), (&#x27;tag&#x27;, [OrderedDict([(&#x27;@key&#x27;, &#x27;language&#x27;), (&#x27;@value&#x27;, &#x27;und&#x27;)]), OrderedDict([(&#x27;@key&#x27;, &#x27;handler_name&#x27;), (&#x27;@value&#x27;, &#x27;ISO Media file produced by Google Inc. Created on: 12/09/2017.&#x27;)])])])&#xA;

    &#xA;&#xA;

    OrderedDict([(&#x27;@index&#x27;, &#x27;0&#x27;), (&#x27;@codec_name&#x27;, &#x27;h264&#x27;), (&#x27;@codec_long_name&#x27;, &#x27;H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10&#x27;), (&#x27;@profile&#x27;, &#x27;Main&#x27;), (&#x27;@codec_type&#x27;, &#x27;video&#x27;), (&#x27;@codec_time_base&#x27;, &#x27;1001/60000&#x27;), (&#x27;@codec_tag_string&#x27;, &#x27;avc1&#x27;), (&#x27;@codec_tag&#x27;, &#x27;0x31637661&#x27;), (&#x27;@width&#x27;, &#x27;1280&#x27;), (&#x27;@height&#x27;, &#x27;720&#x27;), (&#x27;@coded_width&#x27;, &#x27;1280&#x27;), (&#x27;@coded_height&#x27;, &#x27;720&#x27;), (&#x27;@has_b_frames&#x27;, &#x27;1&#x27;), (&#x27;@sample_aspect_ratio&#x27;, &#x27;1:1&#x27;), (&#x27;@display_aspect_ratio&#x27;, &#x27;16:9&#x27;), (&#x27;@pix_fmt&#x27;, &#x27;yuv420p&#x27;), (&#x27;@level&#x27;, &#x27;31&#x27;), (&#x27;@color_range&#x27;, &#x27;tv&#x27;), (&#x27;@color_space&#x27;, &#x27;bt709&#x27;), (&#x27;@color_transfer&#x27;, &#x27;bt709&#x27;), (&#x27;@color_primaries&#x27;, &#x27;bt709&#x27;), (&#x27;@chroma_location&#x27;, &#x27;left&#x27;), (&#x27;@refs&#x27;, &#x27;1&#x27;), (&#x27;@is_avc&#x27;, &#x27;true&#x27;), (&#x27;@nal_length_size&#x27;, &#x27;4&#x27;), (&#x27;@r_frame_rate&#x27;, &#x27;30000/1001&#x27;), (&#x27;@avg_frame_rate&#x27;, &#x27;30000/1001&#x27;), (&#x27;@time_base&#x27;, &#x27;1/90000&#x27;), (&#x27;@start_pts&#x27;, &#x27;3780&#x27;), (&#x27;@start_time&#x27;, &#x27;0.042000&#x27;), (&#x27;@duration_ts&#x27;, &#x27;1015830&#x27;), (&#x27;@duration&#x27;, &#x27;11.287000&#x27;), (&#x27;@bit_rate&#x27;, &#x27;1041887&#x27;), (&#x27;@bits_per_raw_sample&#x27;, &#x27;8&#x27;), (&#x27;@nb_frames&#x27;, &#x27;337&#x27;), (&#x27;disposition&#x27;, OrderedDict([(&#x27;@default&#x27;, &#x27;1&#x27;), (&#x27;@dub&#x27;, &#x27;0&#x27;), (&#x27;@original&#x27;, &#x27;0&#x27;), (&#x27;@comment&#x27;, &#x27;0&#x27;), (&#x27;@lyrics&#x27;, &#x27;0&#x27;), (&#x27;@karaoke&#x27;, &#x27;0&#x27;), (&#x27;@forced&#x27;, &#x27;0&#x27;), (&#x27;@hearing_impaired&#x27;, &#x27;0&#x27;), (&#x27;@visual_impaired&#x27;, &#x27;0&#x27;), (&#x27;@clean_effects&#x27;, &#x27;0&#x27;), (&#x27;@attached_pic&#x27;, &#x27;0&#x27;), (&#x27;@timed_thumbnails&#x27;, &#x27;0&#x27;)])), (&#x27;tag&#x27;, [OrderedDict([(&#x27;@key&#x27;, &#x27;language&#x27;), (&#x27;@value&#x27;, &#x27;und&#x27;)]), OrderedDict([(&#x27;@key&#x27;, &#x27;handler_name&#x27;), (&#x27;@value&#x27;, &#x27;ISO Media file produced by Google Inc. Created on: 12/09/2017.&#x27;)])])])&#xA;

    &#xA;&#xA;

    What matters the most for me is that piped ffprobe lost the pix_fmt info and the duration info is also not consistent.

    &#xA;&#xA;

    However, if I resave the binary_data to mp4 format. Then it still can produce the same output.

    &#xA;&#xA;

    Anyone know how to avoid this ?

    &#xA;

  • Live streaming Rmtp node-media-server real server not creating video files but wont fail (OBS)

    3 octobre 2020, par Orgil

    I have made a live streaming server with node-media-server and it works well in local but when i put it on a real server (ubuntu, nginx) its just creating the folder but not creating video files and no errors given OBS the streaming sofware not failing. is it something to do with ffmpeg ? maybe needed packages didnt install or ? idk whats going on :D

    &#xA;

    Cofig of node-media-server :

    &#xA;

    rtmp_server: {&#xA;    rtmp: {&#xA;        port: 1935,&#xA;        chunk_size: 60000,&#xA;        gop_cache: false,&#xA;        ping: 60,&#xA;        ping_timeout: 30&#xA;    },&#xA;    http: {&#xA;        port: 8088,&#xA;        mediaroot: &#x27;/home/ubuntu/projects/amjilt_media/media&#x27;,&#xA;        allow_origin: &#x27;*&#x27;&#xA;    },&#xA;    trans: {&#xA;        ffmpeg: &#x27;/usr/bin/ffmpeg&#x27;,&#xA;        // ffmpeg: &#x27;C:/Users/User/Desktop/ffmpeg/bin/ffmpeg.exe&#x27;,&#xA;        tasks: [&#xA;            {&#xA;                app: &#x27;live&#x27;,&#xA;                hls: true,&#xA;                hlsFlags: &#x27;[hls_time=2:hls_list_size=3:hls_flags=delete_segments]&#x27;,&#xA;                dash: true,&#xA;                dashFlags: &#x27;[f=dash:window_size=3:extra_window_size=5]&#x27;&#xA;            }&#xA;        ]&#xA;    }&#xA;}&#xA;

    &#xA;