Recherche avancée

Médias (1)

Mot : - Tags -/musée

Autres articles (36)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

Sur d’autres sites (4436)

  • ffmpeg error : Data doesn't look like RTP packets, make sure the RTP muxer is used

    29 juin 2016, par SOFuser

    I am trying to stream both video&audio from usbcam&mic throw ffmpeg over ffserver
    I got 2 errors :
    - ffmpeg seems functionning but showing "Data doesn’t look like RTP packets, make sure the RTP muxer is used"
    - i can connect to ffserver only for static files

    here is server.conf file :

    HTTPPort 1235
    RTSPPort 1234
    HTTPBindAddress 0.0.0.0
    MaxHTTPConnections 2000
    MaxClients 1000
    MaxBandwidth 100000
    #CustomLog –

    ########################################
    ##  static file for testing
    ########################################
    #HTTP requests
    <stream>
    File "/home/username/media.flv"
    Format flv
    </stream>

    #RTSP requests
    <stream>
    #preconverted file:
    File "/home/username/media.mpg"
    Format rtp
    VideoFrameRate 30
    VideoCodec libx264
    VideoSize 720x720
    StartSendOnKey
    Preroll 0
    </stream>

    ##################################################
    ## usb cam
    ###################################################
    <feed>
    File /tmp/test.ffm
    FileMaxSize 20K
    ACL allow 192.168.1.149
    </feed>

    <stream>
    Feed test.ffm
    Format rtp
    VideoFrameRate 25
    VideoCodec libx264
    VideoSize 720x720
    PreRoll 0
    StartSendOnKey
    </stream>

    my ffmpeg cmd is

    ffmpeg -s 720x720 -f video4linux2 -i /dev/video0 -r 25 -f alsa -i hw:0 -c:v libx264 -c:a aac -strict -2 rtp://192.168.1.149:1234/test.ffm

    it seems working but showing this error :

    "Data doesn’t look like RTP packets, make sure the RTP muxer is used"

    when i stream the static files it works
    but when i try to play usbcam stream throw ffplay and vlc nothing works

    thank you in advance,

  • Calculate in Node audio bitrate given bytes and duration and viceversa

    6 mai 2016, par loretoparisi

    Supposed to not have access to ffmpeg I need a simple way to calculate the bitrate of an audio (or video) file given media length (bytes) and duration (seconds), i.e. the function

    bitrate = MediaInfo.bitrate(bytes, duration);

    Also I need to do the opposite, so that given approximate media bitrate and length I need calculate the duration :

    duration = MediaInfo.duration(bytes, bitrate);

    So, this is my attempt, inspired by bitrate node module :

    var console = {
       log: function(s) {
         document.getElementById("console").innerHTML += s + "<br />"
       }
    }

    /**
    * Get media file info
    * @see https://www.npmjs.com/package/bitrate
    * * @author Loreto Parisi (loretoparisi at gmail dot com)
    */
    var MediaInfo = {

       /** unit divisors */
       DIVISORS : {
         bps: 0.125,
         kbps: 125,
         mbps: 125000,
         Bps: 1,
         KBps: 1000,
         MBps: 1000000
       },

       /**
        * Calcuate approximate bitrate
        * @param bytes integer media length in bytes
        * @param seconds float media duration
        * @param format string: bps|kbps|Bps|KBps|MBps
        * @param pos integer decimal approximation
       */
       bitrate : function(bytes, seconds, format, pos) {
               if (typeof format !== 'string') throw new TypeError('Expected \'format\' to be a string')
               format = format.replace('/', 'p')

         var divisor = this.DIVISORS[format];
               if (!divisor) throw new Error('\'format\' is an invalid string')
         var bitrate = bytes / seconds / divisor;
         pos=pos||4;

         return (Math.round(bitrate * Math.pow(10,pos)) / Math.pow(10,pos) );

       },

       /**
        * Calcuate approximate duration
        * @param bytes integer media length in bytes
        * @param bitrate float media bitrate per seconds
        * @param format string: bps|kbps|Bps|KBps|MBps
        * @param pos integer decimal approximation
       */
       duration : function(bytes, bitrate, format, pos) {
         if (typeof format !== 'string') throw new TypeError('Expected \'format\' to be a string')
               format = format.replace('/', 'p')

         var divisor = this.DIVISORS[format];
         if (!divisor) throw new Error('\'format\' is an invalid string')
         var seconds = bytes / bitrate / divisor;
         pos=pos||4;

         return (Math.round(seconds * Math.pow(10,pos)) / Math.pow(10,pos) );
       }
     } //MediaInfo

    // example of usage
     var bytes = 57511; // media file size in bytes
     var seconds = 20.35 // media file duration in seconds

     // calculate media bitrate given media length and duration
     var kilobitsPerSecond = MediaInfo.bitrate(bytes, seconds, 'kbps', 3) // => 326.3
     var bitsPerSecond = MediaInfo.bitrate(bytes, seconds, 'bps', 3) // => 326279
     var BytesPerSecond = MediaInfo.bitrate(bytes, seconds, 'Bps', 3) // => 40785

     // inverse: calculate media duration given media length and bitrate
     var duration = MediaInfo.duration(bytes, kilobitsPerSecond, 'kbps', 3);

     var data = {
         bytes : bytes,
         seconds : seconds,
         kilobitsPerSecond : kilobitsPerSecond + " kb/s",
         bitsPerSecond : bitsPerSecond + " b/s",
         BytesPerSecond : BytesPerSecond + " B/s",
         duration : duration
     }

     console.log( JSON.stringify(data, null, 2) );
    <div></div>

    The result media info are

    {
       "bytes": 57511,
       "seconds": 20.35,
       "kilobitsPerSecond": "22.609 kb/s",
       "bitsPerSecond": "22608.747 b/s",
       "BytesPerSecond": "2826.093 B/s",
       "duration": 20.35
    }

    while ffmpeg gives

    Duration: 00:00:20.35, start: 0.000000, bitrate: 22 kb/s
       Stream #0:0(eng): Audio: aac (mp4a / 0x6134706D), 8000 Hz, mono, fltp, 16 kb/s (default)

    Of course, the problem here is the assumption that I have a fixed bitrate when calculating the duration. But, is there any other way without having ffprobe or lame in node ?

  • ValueError When Reading Video Frame

    27 juin 2016, par Bassie

    I am following this article, from where I got this code :

    FFMPEG_BIN ="Z:\ffmpeg\bin\ffmpeg.exe"

    import subprocess as sp
    command = [ FFMPEG_BIN,
               '-i', 'video.mp4',
               '-f', 'image2pipe',
               '-pix_fmt', 'rgb24',
               '-vcodec', 'rawvideo', '-']
    pipe = sp.Popen(command, stdout = sp.PIPE, bufsize=10**8, shell=True)

    import numpy
    # read 420*360*3 bytes (= 1 frame)
    raw_image = pipe.stdout.read(420*360*3)
    # transform the byte read into a numpy array
    image =  numpy.fromstring(raw_image, dtype='uint8')
    image = image.reshape((360,420,3))
    # throw away the data in the pipe's buffer.
    pipe.stdout.flush()

    When I run it I see this error :

    Traceback (most recent call last):
     File "Z:\py\ffmtest\test.py", line 16, in <module>
       image = image.reshape((360,420,3))
    ValueError: total size of new array must be unchanged
    </module>

    Where line 16 is image = image.reshape((360,420,3)). I think this error is produced by numpy, but probably because I am calculating the values for my video incorrectly.

    Output :

    raw_image : b’ ’

    len(raw_image) : 0

    image : [ ]

    len(image) : 0

    I am not sure whether I am passing in the correct values for read or reshape functions - any help at all is much appreciated !