Recherche avancée

Médias (29)

Mot : - Tags -/Musique

Autres articles (39)

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

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

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

Sur d’autres sites (5774)

  • How to restream multicast stream with ffmpeg

    26 octobre 2020, par verb

    I am new to ffmpeg and need to restream multicast and scale it. Tried different parameters and i have managed to restream and scale but it always appear some pat,pmt or pcr error and som interuptions in the stream appear.The input stream is cbr 14Mbit and i try to set the bitrate as 6Mbit please check my config and if you notice something wrong let me know :

    


    


    ffmpeg -re -i "udp ://@238.252.250.9:5000 ?overrun_nonfatal=1&fifo_size=1000000&bitrate=70000000&pkt_size=188" -map 0:0 -map 0:2 -b:v 3000k -minrate 3000k -maxrate 4000k -bufsize 8000K -pcr_period 20 -flush_packets 0 -tune zerolatency -preset ultrafast -threads 2 -c:a copy -qmax 12 -f mpegts -muxrate 6M "udp ://@239.253.251.13:5505 ?pkt_size=188&overrun_nonfatal=1&localaddr=10.253.251.66&bitrate=6000000"

    


    


    here is the input stream :

    


    Input #0, mpegts, from 'udp://@238.252.250.9:5000':
  Duration: N/A, start: 46612.831967, bitrate: N/A
  Program 2002 
    Metadata:
      service_name    : RT Doc HD
      service_provider: GLOBECAST
    Stream #0:0[0x7e5]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 50 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x7e6](eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 192 kb/s
    Stream #0:2[0x7e7](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 192 kb/s


    


    I don't understand all parameters especially the parameters concerning input/output udp stream so please help me to solve the correct command.

    


  • Is there any way to change file FPS in javascript browser or prepare wav conventer to 60FPS videos ?

    16 novembre 2020, par SZtyro

    I'm making web application which stores short audio files that have been cut from large video files. User uploads .mp4 file, chooses sound length and here's a little trick. Cutting audio can only be done in backend (correct me if I'm wrong) and sending 700MB data is not good option, so I use code below to decode audio data from .mp4 and then I send it with start and stop params. Backend (Node.js) use's FFMPEG to cut audio and save's it.

    


    This part works, but i realised that decoded audio from 60FPS video doesn't sound good (not terrible but totally useless in my app). My goal is to avoid third party, especially desktop, apps (like audacity) and allow user to cut revelant part of audio from any mp4 video. Is there any way to convert 60FPS video to 30FPS video (ArrayBuffer) in browser and then decode audio ?

    


          fileInput.onchange = event => {
      this.file = event.target["files"][0];
      //.mp4 file
      this.fileURL = URL.createObjectURL(this.file)

      let baseAudioContext = new AudioContext();
      this.file.arrayBuffer().then(buff => {

        baseAudioContext.decodeAudioData(buff,
          success => {
            console.log(success)
            this.bufferToWave(success, 0, success.length);
          },
          err => console.log(err));
      })
    }

  bufferToWave(abuffer, offset, len) {

    var numOfChan = abuffer.numberOfChannels,
      length = len * numOfChan * 2 + 44,
      buffer = new ArrayBuffer(length),
      view = new DataView(buffer),
      channels = [], i, sample,
      pos = 0;

    // write WAVE header
    setUint32(0x46464952);                         // "RIFF"
    setUint32(length - 8);                         // file length - 8
    setUint32(0x45564157);                         // "WAVE"

    setUint32(0x20746d66);                         // "fmt " chunk
    setUint32(16);                                 // length = 16
    setUint16(1);                                  // PCM (uncompressed)
    setUint16(numOfChan);
    setUint32(abuffer.sampleRate);
    setUint32(abuffer.sampleRate * 2 * numOfChan); // avg. bytes/sec
    setUint16(numOfChan * 2);                      // block-align
    setUint16(16);                                 // 16-bit (hardcoded in this demo)

    setUint32(0x61746164);                         // "data" - chunk
    setUint32(length - pos - 4);                   // chunk length

    // write interleaved data
    for (i = 0; i < abuffer.numberOfChannels; i++)
      channels.push(abuffer.getChannelData(i));

    while (pos < length) {
      for (i = 0; i < numOfChan; i++) {             // interleave channels
        sample = Math.max(-1, Math.min(1, channels[i][offset])); // clamp
        sample = (0.5 + sample < 0 ? sample * 32768 : sample * 32767) | 0; // scale to 16-bit signed int
        view.setInt16(pos, sample, true);          // update data chunk
        pos += 2;
      }
      offset++                                     // next source sample
    }

    // create Blob
    //return (URL || webkitURL).createObjectURL(new Blob([buffer], { type: "audio/wav" }));
    var u = (URL || webkitURL).createObjectURL(new Blob([buffer], { type: "audio/wav" }));

    //temporary part
    //downloading file to check quality
    //in this part sound is already broken, no need to show backend code
    const a = document.createElement('a');
    a.style.display = 'none';
    a.href = u;
    a.download = name;
    document.body.appendChild(a);
    a.click();



    function setUint16(data) {
      view.setUint16(pos, data, true);
      pos += 2;
    }

    function setUint32(data) {
      view.setUint32(pos, data, true);
      pos += 4;
    }
  }


    


  • ffmpeg error MPEG-1/2 does not support 3/1 fps

    29 novembre 2020, par 0 day

    Im trying to broadcast my desktop to web page via ffserver but Im getting this error

    


    MPEG-1/2 does not support 3/1 fps
Error initializing output stream 0:1 -- Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height


    


    Here is my cli

    


    ffmpeg -probesize 1000M -framerate 30 -video_size 1680x1050 -f x11grab -i :0.0 -f alsa -i default -c:a aac -vf format=yuv420p http://localhost:8090/feed1.ffm


    


    And here is whole log

    


    ffmpeg -probesize 1000M -framerate 30 -video_size 1680x1050 -f x11grab -i :0.0 -f alsa -i default -c:a aac -vf format=yuv420p http://localhost:8090/feed1.ffm
ffmpeg version 3.4.8-0ubuntu0.2 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
  configuration: --prefix=/usr --extra-version=0ubuntu0.2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
Input #0, x11grab, from ':0.0':
  Duration: N/A, start: 1606681865.700480, bitrate: N/A
    Stream #0:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 1680x1050, 30 fps, 1000k tbr, 1000k tbn, 1000k tbc
Guessed Channel Layout for Input Stream #1.0 : stereo
Input #1, alsa, from 'default':
  Duration: N/A, start: 1606681866.175206, bitrate: 1536 kb/s
    Stream #1:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Stream mapping:
  Stream #1:0 -> #0:0 (pcm_s16le (native) -> mp2 (native))
  Stream #0:0 -> #0:1 (rawvideo (native) -> mpeg1video (native))
  Stream #0:0 -> #0:2 (rawvideo (native) -> vp8 (libvpx))
Press [q] to stop, [?] for help
[x11grab @ 0x55d455855a00] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
[mpeg1video @ 0x55d455889040] bitrate tolerance 21333 too small for bitrate 64000, overriding
[mpeg1video @ 0x55d455889040] MPEG-1/2 does not support 3/1 fps
Error initializing output stream 0:1 -- Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height
[alsa @ 0x55d45585ec40] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
Conversion failed!


    


    Contents of ffserver.conf :

    


    HTTPPort 8090&#xA;HTTPBindAddress 0.0.0.0&#xA;MaxHTTPConnections 2000&#xA;MaxClients 1000&#xA;MaxBandwidth 1000&#xA;CustomLog -&#xA;&#xA;<feed>&#xA;File /tmp/feed1.ffm&#xA;FileMaxSize 1g&#xA;ACL allow 127.0.0.1&#xA;ACL allow localhost #ovaj&#xA;</feed>&#xA;&#xA;<stream>&#xA;Feed feed1.ffm&#xA;Format mpeg&#xA;AudioBitRate 32&#xA;AudioChannels 1&#xA;AudioSampleRate 44100&#xA;VideoBitRate 64&#xA;VideoBufferSize 40&#xA;VideoFrameRate 3&#xA;VideoSize 160x128&#xA;VideoGopSize 12&#xA;</stream>&#xA;&#xA;<stream>&#xA;Format webm&#xA;Feed feed1.ffm&#xA;VideoCodec libvpx&#xA;VideoSize 320x240&#xA;VideoFrameRate 15&#xA;VideoBitRate 512&#xA;VideoBufferSize 512&#xA;NoAudio&#xA;AVOptionVideo flags &#x2B;global_header&#xA;StartSendOnKey&#xA;</stream>&#xA;&#xA;<stream>&#xA;Format status&#xA;ACL allow localhost&#xA;ACL allow 192.168.0.0 192.168.255.255&#xA;</stream>&#xA;

    &#xA;