Recherche avancée

Médias (91)

Autres articles (100)

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

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

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

Sur d’autres sites (10383)

  • When I run code in Docker I get a Django error [Errno 2]. When running locally everything works. Why ?

    8 février 2021, par Bartłomiej Kokoszka

    I don't know what's going on. A script run by Django works fine, but not through Docker and Django. An error is returned :

    


    Pic Errno 2 No such file or directory

    


    Below is the code of the function with the error and the code of the Dockerfile.

    


    '''

    


    def mediainfo(filepath):
    


    


    Original code :

    


    

        prober = get_prober_name()
    command_args = [
        "-v", "quiet",
        "-show_format",
        "-show_streams",
        filepath
    ]

    command = [prober, '-of', 'old'] + command_args


    


    


    Modified code :

    


    

        command = f"ffprobe -v error -show_format -show_streams -select_streams v:0 {filepath}"


    


    


    The rest of the functions :

    


        res = Popen(command, stdout=PIPE)&#xA;    output = res.communicate()[0].decode("utf-8")&#xA;&#xA;    if res.returncode != 0:&#xA;        output = Popen(command, stdout=PIPE).communicate()[0].decode("utf-8")&#xA;&#xA;    rgx = re.compile(r"(?:(?P.*?):)?(?P<key>.*?)\=(?P<value>.*?)$")&#xA;    info = {}&#xA;&#xA;    if sys.platform == &#x27;win32&#x27;:&#xA;        output = output.replace("\r", "")&#xA;&#xA;    for line in output.split("\n"):&#xA;        # print(line)&#xA;        mobj = rgx.match(line)&#xA;&#xA;        if mobj:&#xA;            # print(mobj.groups())&#xA;            inner_dict, key, value = mobj.groups()&#xA;&#xA;            if inner_dict:&#xA;                try:&#xA;                    info[inner_dict]&#xA;                except KeyError:&#xA;                    info[inner_dict] = {}&#xA;                info[inner_dict][key] = value&#xA;            else:&#xA;                info[key] = value&#xA;&#xA;    return info&#xA;</value></key>

    &#xA;

    '''

    &#xA;

    Code of the Dockerfile

    &#xA;

    '''

    &#xA;

    FROM python:3.7 as base&#xA;&#xA;EXPOSE 80&#xA;&#xA;WORKDIR /app&#xA;COPY . /app&#xA;&#xA;&#xA;ENV PYTHONDONTWRITEBYTECODE=1&#xA;&#xA;ENV PYTHONUNBUFFERED=1&#xA;&#xA;RUN pip install --upgrade pip&#xA;RUN echo &#x27;deb http://deb.debian.org/debian buster-backports main contrib non-free&#x27; >> /etc/apt/sources.list&#xA;RUN apt-get update&#xA;&#xA;RUN apt-get -y install ffmpeg&#xA;RUN apt-get update&#xA;&#xA;COPY requirements.txt .&#xA;RUN python -m pip install -r requirements.txt&#xA;&#xA;FROM base as prod&#xA;&#xA;ENTRYPOINT ["python","manage.py","runserver","0.0.0.0:80"]&#xA;

    &#xA;

    '''

    &#xA;

  • Different code(.java file) for different platform ?

    2 mars 2016, par AR792

    I have a code where image data is passed from bitmap to FFmpeg frame recorder and converted to a video. But i need to make small changes while running it on LG G3(armv7) from Asus zenfone 5(x86).

    Following are the class variables that create the issue :(declared under, class Main Activity)

    inputWidth = 1024 ;

    inputHeight = 650 ;

    Following is the method where the issue occurs :

    byte [] getNV21(int inputWidth, int inputHeight, Bitmap bitmap) {

       int [] argb = new int[inputWidth * inputHeight];

       bitmap.getPixels(argb, 0, inputWidth, 0, 0, inputWidth, inputHeight);

       byte [] yuv = new byte[inputWidth*inputHeight*3/2];
       encodeYUV420SP(yuv, argb, inputWidth, inputHeight);

       return yuv;
    }

    void encodeYUV420SP(byte[] yuv420sp, int[] argb, int width, int height) {
       final int frameSize = width * height;

       int yIndex = 0;
       int uvIndex = frameSize;

       int a, R, G, B, Y, U, V;
       int index = 0;
       for (int j = 0; j &lt; height; j++) {
           for (int i = 0; i &lt; width; i++) {

               a = (argb[index] &amp; 0xff000000) >> 24; // a is not used obviously
               R = (argb[index] &amp; 0xff0000) >> 16;
               G = (argb[index] &amp; 0xff00) >> 8;
               B = (argb[index] &amp; 0xff) >> 0;

               // well known RGB to YUV algorithm
               Y = ( (  66 * R + 129 * G +  25 * B + 128) >> 8) +  16;
               U = ( ( -38 * R -  74 * G + 112 * B + 128) >> 8) + 128;
               V = ( ( 112 * R -  94 * G -  18 * B + 128) >> 8) + 128;

               // NV21 has a plane of Y and interleaved planes of VU each sampled by a factor of 2
               //    meaning for every 4 Y pixels there are 1 V and 1 U.  Note the sampling is every other
               //    pixel AND every other scanline.
               yuv420sp[yIndex++] = (byte) ((Y &lt; 0) ? 0 : ((Y > 255) ? 255 : Y));
               if (j % 2 == 0 &amp;&amp; index % 2 == 0) {
                   yuv420sp[uvIndex++] = (byte)((V&lt;0) ? 0 : ((V > 255) ? 255 : V));
                   yuv420sp[uvIndex++] = (byte)((U&lt;0) ? 0 : ((U > 255) ? 255 : U));
               }

               index ++;
           }
       }
    }

    Working CODE :

    LG G3 :I can use the above variables at any place in the code to get the required output.
    Bitmap size returned = 2734200

    Asus Zenfone 5 : Except at creating the bitmap, I have to use everywhere else bitmap.getHeight() and bitmap.getWidth(), to get the required output.

    Surprisingly here Bitmap size returned = 725760 (So its not setting according to set bitmap parameters ?)

    INCORRECT CODE :

    LG G3 : IF i use bitmap.getHeight() and bitmap.getWidth(), i get java.lang.ArrayIndexOutOfBoundsException : length = 102354 , index = 102354. @getNV21 method

    Asus Zenfone 5 : If i use inputWidth , inputHeight i get
    java.lang.IllegalArgumentException : x + width must be <= bitmap.width() @getNV21 method

    How can i generalize the above code for both phones ?

  • FOR FFMPEQ CODE LIVE [on hold]

    20 août 2017, par Trung lê

    One user live streaming and he used ffmpeg with 1 pc : 1core,1GB ram AND LIVE WITH 20 threads EVENTS ON YOUTUBE @@ unbelievable . i would like need "code live", can i help you ? tks very much
    https://ffmpeg.org/documentation.html