Recherche avancée

Médias (1)

Mot : - Tags -/epub

Autres articles (34)

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

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

  • 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

Sur d’autres sites (6185)

  • How to stop perl buffering ffmpeg output

    4 février 2017, par Sebastian King

    I am trying to have a Perl program process the output of an ffmpeg encode, however my test program only seems to receive the output of ffmpeg in periodic chunks, thus I am assuming there is some sort of buffering going on. How can I make it process it in real-time ?

    My test program (the tr command is there because I thought maybe ffmpeg’s carriage returns were causing perl to see one big long line or something) :

    #!/usr/bin/perl

    $i = "test.mkv"; # big file, long encode time
    $o = "test.mp4";

    open(F, "-|", "ffmpeg -y -i '$i' '$o' 2>&1 | tr '\r' '\n'")
           or die "oh no";

    while(<f>) {
           print "A12345: $_"; # some random text so i know the output was processed in perl
    }
    </f>

    Everything works fine when I replace the ffmpeg command with this script :

    #!/bin/bash

    echo "hello";

    for i in `seq 1 10`; do
           sleep 1;
           echo "hello $i";
    done

    echo "bye";

    When using the above script I see the output each second as it happens. With ffmpeg it is some 5-10 seconds or so until it outputs and will output sometimes 100 lines each output.

    I have tried using the program unbuffer ahead of ffmpeg in the command call but it seems to have no effect. Is it perhaps the 2>&amp;1 that might be buffering ?
    Any help is much appreciated.

    If you are unfamiliar with ffmpeg’s output, it outputs a bunch of file information and stuff to STDOUT and then during encoding it outputs lines like

    frame=  332 fps= 93 q=28.0 size=     528kB time=00:00:13.33 bitrate= 324.2kbits/s speed=3.75x

    which begin with carriage returns instead of new lines (hence tr) on STDERR (hence 2>&amp;1).

  • Adding audio to an OpenCV video

    21 février 2019, par pcrunn

    I’m trying to make a script that automates the process of making a video and i’m stuck on the part that i add the audio, I’m not sure if i’ll need to use ffmpeg for that and if so, i’m not sure how to use it the proper way to work with OpenCV (Which I use for rendering the video).

    Thanks for your time, Here is my current code (that I found from a website)

    # Creating the video... The worst part. Literally

    width = 1920
    height = 1080
    FPS = 30
    length = 0

    for song in songs:
       length+=song.info.length

    length = int(length)

    fourcc = VideoWriter_fourcc(*'MP42')
    video = VideoWriter('result.avi', fourcc, float(FPS), (width, height))
    for _ in range(FPS*length):
       frame = np.random.randint(0, 256,
                                 (height, width, 3),
                                 dtype=np.uint8)
       video.write(frame)

    video.release()
  • How to cut out first 5 seconds with youtube_dl and ffmpeg in python

    23 février 2021, par SvenXP

    i have a python script to download and save a MP3 and i would like to add code to cut out 5 seconds from the beginning of the MP3.

    &#xA;

    def download():&#xA;    ydl_opts = {&#xA;        &#x27;format&#x27;: &#x27;bestaudio/best&#x27;,&#xA;        &#x27;outtmpl&#x27;: &#x27;c:/MP3/%(title)s.%(ext)s&#x27;,&#xA;        &#x27;cookiefile&#x27;: &#x27;cookies.txt&#x27;,&#xA;        &#x27;postprocessors&#x27;: [{&#xA;            &#x27;key&#x27;: &#x27;FFmpegExtractAudio&#x27;,&#xA;            &#x27;preferredcodec&#x27;: &#x27;mp3&#x27;,&#xA;            &#x27;preferredquality&#x27;: &#x27;192&#x27;,&#xA;        }],&#xA;    }&#xA;    with youtube_dl.YoutubeDL(ydl_opts) as ydl:&#xA;        ydl.download([inpYTLinkSong.get()])&#xA;

    &#xA;

    I found some code for command line to cut x seconds :

    &#xA;

    ffmpeg -ss 00:00:15.00 -i "OUTPUT-OF-FIRST URL" -t 00:00:10.00 -c copy out.mp4

    &#xA;

    So i think i have to get the -ss part into the postprocessor part in my script, something like :

    &#xA;

    &#x27;postprocessors&#x27;: [{&#xA;        &#x27;key&#x27;: &#x27;FFmpegExtractAudio&#x27;,&#xA;        &#x27;preferredcodec&#x27;: &#x27;mp3&#x27;,&#xA;        &#x27;preferredquality&#x27;: &#x27;192&#x27;,&#xA;        &#x27;ss&#x27;:&#x27;00:00:05.00&#x27;&#xA;    }],&#xA;

    &#xA;

    But of course its not working with 'ss' or 'duration' (found in ffmpeg docu).

    &#xA;

    So any ideas what i have to put there instead of 'ss' ?

    &#xA;