Recherche avancée

Médias (0)

Mot : - Tags -/performance

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

Autres articles (40)

  • Qu’est ce qu’un masque de formulaire

    13 juin 2013, par

    Un masque de formulaire consiste en la personnalisation du formulaire de mise en ligne des médias, rubriques, actualités, éditoriaux et liens vers des sites.
    Chaque formulaire de publication d’objet peut donc être personnalisé.
    Pour accéder à la personnalisation des champs de formulaires, il est nécessaire d’aller dans l’administration de votre MediaSPIP puis de sélectionner "Configuration des masques de formulaires".
    Sélectionnez ensuite le formulaire à modifier en cliquant sur sont type d’objet. (...)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 is the first MediaSPIP stable release.
    Its official release date is June 21, 2013 and is announced here.
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

Sur d’autres sites (4478)

  • Mix audio to video changing volume of both video and audio FFMpeg

    12 septembre 2017, par 1234567

    Mix audio to video changing volume of both video and audio

    I want to reduce volume of (audio in video to 0.5 times original)

    and change

    volume of a second audio files to (2 times original)

    I am refering to this command

    ffmpeg -i video.webm -i audio.oga -filter_complex \
    "[0:a][1:a]amerge=inputs=2[a]" \
    -map 0:v -map "[a]" -c:v copy -c:a libvorbis -ac 2 -shortest out.webm

    from
    How to add a new audio (not mixing) into a video using ffmpeg ?

    also I dont have libvorbis, how can i use the same codec of the video for the new file

  • Trimming videos with 'ffmpeg and ffprobe'

    10 août 2022, par adeshina Ibrahim

    I am working on an ETL process, and I'm now in the final stage of preprocessing my videos. I used the script below (reference : @FarisHijazi) to first auto detected black-screen frames using ffprobe and trim them out using ffmpeg.

    


    The script worked for me but the problems are :

    


      

    1. It cut off all other good frames together with the first bad frames. e.g. if gBgBgBgB represents a sequence of good and BAD frames for 5sec each, the script only returned the first g(5sec) and cut off the other BgBgBgB after it. I want to have only g g g g where all B B B B has been removed

      


    2. 


    3. I also want to detect other colors aside black-screen e.g. green-screen or red-screen or blurry part of video

      


    4. 


    5. Script doesn't work if video has no audio in it.

      


    6. 


    


    import argparse
import os
import shlex
import subprocess

parser = argparse.ArgumentParser(
    __doc__, formatter_class=argparse.ArgumentDefaultsHelpFormatter
)
parser.add_argument("input", type=str, help="input video file")
parser.add_argument(
    "--invert",
    action="store_true",
    help="remove nonblack instead of removing black",
)
args = parser.parse_args()

##FIXME: sadly you must chdir so that the ffprobe command will work
os.chdir(os.path.split(args.input)[0])
args.input = os.path.split(args.input)[1]

spl = args.input.split(".")
outpath = (
    ".".join(spl[:-1])
    + "."
    + ("invert" if args.invert else "")
    + "out."
    + spl[-1]
)


def delete_back2back(l):
    from itertools import groupby

    return [x[0] for x in groupby(l)]


def construct_ffmpeg_trim_cmd(timepairs, inpath, outpath):
    cmd = f'ffmpeg -i "{inpath}" -y -r 20 -filter_complex '
    cmd += '"'
    for i, (start, end) in enumerate(timepairs):
        cmd += (
            f"[0:v]trim=start={start}:end={end},setpts=PTS-STARTPTS,format=yuv420p[{i}v]; "
            + f"[0:a]atrim=start={start}:end={end},asetpts=PTS-STARTPTS[{i}a]; "
        )
    for i, (start, end) in enumerate(timepairs):
        cmd += f"[{i}v][{i}a]"
    cmd += f"concat=n={len(timepairs)}:v=1:a=1[outv][outa]"
    cmd += '"'
    cmd += f' -map [outv] -map [outa] "{outpath}"'
    return cmd


def get_blackdetect(inpath, invert=False):
    ffprobe_cmd = f'ffprobe -f lavfi -i "movie={inpath},blackdetect[out0]" -show_entries tags=lavfi.black_start,lavfi.black_end -of default=nw=1 -v quiet'
    print("ffprobe_cmd:", ffprobe_cmd)
    lines = (
        subprocess.check_output(shlex.split(ffprobe_cmd))
        .decode("utf-8")
        .split("\n")
    )
    times = [
        float(x.split("=")[1].strip()) for x in delete_back2back(lines) if x
    ]
    assert len(times), "no black scene detected"

    if not invert:
        times = [0] + times[:-1]
    timepairs = [
        (times[i], times[i + 1]) for i in range(0, len(times) // 2, 2)
    ]
    return timepairs


if __name__ == "__main__":
    timepairs = get_blackdetect(args.input, invert=args.invert)
    cmd = construct_ffmpeg_trim_cmd(timepairs, args.input, outpath)

    print(cmd)
    os.system(cmd)


    


  • ffmpeg pipe blocks while capturing

    26 juin 2013, par Marco Vasapollo

    I have this code :

    public InputStream getInputStream() throws Exception {
       try {
           process = Runtime.getRuntime().exec("ffmpeg -f dshow -i video=\"" + query + "\":audio=\"" + microPhoneName + "\" -r 25 -vcodec mpeg4 -acodec mp3 -f avi -");
           }
           catch (Exception e) {
           }
       return process.getInputStream();
    }

    When i use the inputStream.read(b) command, it works only for a little bit of times (180 to 400 times, depending from formats and codecs I use) then the inputStream lock on read and the application doesn't go anymore.

    What's the problem ? Memory saturation (ffmpeg process memory is at least 14mb) ?
    Is there a way to unlock this situation (clean memory, use a file as a bridge to prevent locks) ?

    Of course I need a little bit of "realtime", and not "post-process".
    I'm not constrained to use ffmpeg, I can change it if necessary.