Recherche avancée

Médias (1)

Mot : - Tags -/graphisme

Autres articles (61)

  • Le plugin : Gestion de la mutualisation

    2 mars 2010, par

    Le plugin de Gestion de mutualisation permet de gérer les différents canaux de mediaspip depuis un site maître. Il a pour but de fournir une solution pure SPIP afin de remplacer cette ancienne solution.
    Installation basique
    On installe les fichiers de SPIP sur le serveur.
    On ajoute ensuite le plugin "mutualisation" à la racine du site comme décrit ici.
    On customise le fichier mes_options.php central comme on le souhaite. Voilà pour l’exemple celui de la plateforme mediaspip.net :
    < ?php (...)

  • Installation en mode ferme

    4 février 2011, par

    Le mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
    C’est la méthode que nous utilisons sur cette même plateforme.
    L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
    Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)

  • Formulaire personnalisable

    21 juin 2013, par

    Cette page présente les champs disponibles dans le formulaire de publication d’un média et il indique les différents champs qu’on peut ajouter. Formulaire de création d’un Media
    Dans le cas d’un document de type média, les champs proposés par défaut sont : Texte Activer/Désactiver le forum ( on peut désactiver l’invite au commentaire pour chaque article ) Licence Ajout/suppression d’auteurs Tags
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire. (...)

Sur d’autres sites (7741)

  • Anomalie #4598 (Fermé) : PHP 8 : Resource vs GdImage object problem.

    4 novembre 2020

    GD ne retourne plus une "resource", mais une instance de GdImage.

    Ça fait planter une partie des filtres images dans SPIP.
    Notamment s’il y a des tests avec is_resource()

    Exemple :

    Warning : Trying to access array offset on value of type bool in [...]ecrire/inc/filtres_images_lib_mini.php on line 1607 à 1610
    

    Qui provient de grosso modo :
    [(#CHEMINun_fichier.png|image_applatirico)]

    Docs

    - https://php.watch/versions/8.0/gdimage
    - La correction chez WP : https://core.trac.wordpress.org/ticket/50833

    Avec la solution proposée :

    Note that in PHP 7.2 and older, instanceOf operator requires an object. If you need to make your code function across PHP versions older than 7.3 through PHP 8.0, you will need an additional is_object() check :

    - if (is_resource($image))
    + if (is_resource($image) || (is_object($image) && $image instanceOf \GdImage))

  • Queue in Python processing more than one video at a time ? [closed]

    12 novembre 2024, par Mateus Coelho

    I have an raspberry pi, that i proccess videos, rotate and put 4 water marks, but, when i run into the raspberry pi, it uses 100% of 4CPUS threads and it reboots. I solved this using -threads 1, to prevent the usage of just one of the 4 CPUS cores, it worked.

    &#xA;

    I made a Queue to procces one at a time, because i have 4 buttons that trigger the videos. But, when i send more then 3 videos to the Queue, the rasp still reboots, and im monitoring the CPU usage, is 100% for only one of the four CPUS&#xA;enter image description here

    &#xA;

    But, if i send 4 or 5 videos to the thread folder, it completly reboots, and the most awkward, its after the reboot, it made its way to proceed all the videos.

    &#xA;

    &#xA;import os&#xA;import time&#xA;import subprocess&#xA;from google.cloud import storage&#xA;import shutil&#xA;&#xA;QUEUE_DIR = "/home/abidu/Desktop/ApertaiRemoteClone"&#xA;ERROR_VIDEOS_DIR = "/home/abidu/Desktop/ApertaiRemoteClone/ErrorVideos"&#xA;CREDENTIALS_PATH = "/home/abidu/Desktop/keys.json"&#xA;BUCKET_NAME = "videos-283812"&#xA;&#xA;def is_valid_video(file_path):&#xA;    try:&#xA;        result = subprocess.run(&#xA;            [&#x27;ffprobe&#x27;, &#x27;-v&#x27;, &#x27;error&#x27;, &#x27;-show_entries&#x27;, &#x27;format=duration&#x27;, &#x27;-of&#x27;, &#x27;default=noprint_wrappers=1:nokey=1&#x27;, file_path],&#xA;            stdout=subprocess.PIPE,&#xA;            stderr=subprocess.PIPE&#xA;        )&#xA;        return result.returncode == 0&#xA;    except Exception as e:&#xA;        print(f"Erro ao verificar o v&#xED;deo: {e}")&#xA;        return False&#xA;&#xA;def overlay_images_on_video(input_file, image_files, output_file, positions, image_size=(100, 100), opacity=0.7):&#xA;    inputs = [&#x27;-i&#x27;, input_file]&#xA;    for image in image_files:&#xA;        if image:&#xA;            inputs &#x2B;= [&#x27;-i&#x27;, image]&#xA;    filter_complex = "[0:v]transpose=2[rotated];"&#xA;    current_stream = "[rotated]"&#xA;    for i, (x_offset, y_offset) in enumerate(positions):&#xA;        filter_complex &#x2B;= f"[{i&#x2B;1}:v]scale={image_size[0]}:{image_size[1]},format=rgba,colorchannelmixer=aa={opacity}[img{i}];"&#xA;        filter_complex &#x2B;= f"{current_stream}[img{i}]overlay={x_offset}:{y_offset}"&#xA;        if i &lt; len(positions) - 1:&#xA;            filter_complex &#x2B;= f"[tmp{i}];"&#xA;            current_stream = f"[tmp{i}]"&#xA;        else:&#xA;            filter_complex &#x2B;= ""&#xA;    command = [&#x27;ffmpeg&#x27;, &#x27;-y&#x27;, &#x27;-threads&#x27;, &#x27;1&#x27;] &#x2B; inputs &#x2B; [&#x27;-filter_complex&#x27;, filter_complex, &#x27;-threads&#x27;, &#x27;1&#x27;, output_file]&#xA;&#xA;    try:&#xA;        result = subprocess.run(command, check=True)&#xA;        result.check_returncode()  # Verifica se o comando foi executado com sucesso&#xA;        print(f"V&#xED;deo processado com sucesso: {output_file}")&#xA;    except subprocess.CalledProcessError as e:&#xA;        print(f"Erro ao processar o v&#xED;deo: {e}")&#xA;        if "moov atom not found" in str(e):&#xA;            print("V&#xED;deo corrompido ou sem o moov atom. Pulando o arquivo.")&#xA;        raise  # Relan&#xE7;a a exce&#xE7;&#xE3;o para ser tratada no n&#xED;vel superior&#xA;&#xA;def process_and_upload_video():&#xA;    client = storage.Client.from_service_account_json(CREDENTIALS_PATH)&#xA;    bucket = client.bucket(BUCKET_NAME)&#xA;    &#xA;    while True:&#xA;        # Aguarda 10 segundos antes de verificar novos v&#xED;deos&#xA;        time.sleep(10)&#xA;&#xA;        # Verifica se h&#xE1; arquivos no diret&#xF3;rio de fila&#xA;        queue_files = [f for f in os.listdir(QUEUE_DIR) if f.endswith(".mp4")]&#xA;        &#xA;        if queue_files:&#xA;            video_file = os.path.join(QUEUE_DIR, queue_files[0])  # Pega o primeiro v&#xED;deo na fila&#xA;            &#xA;            # Define o caminho de sa&#xED;da ap&#xF3;s o processamento com o mesmo nome do arquivo de entrada&#xA;            output_file = os.path.join(QUEUE_DIR, "processed_" &#x2B; os.path.basename(video_file))&#xA;            if not is_valid_video(video_file):&#xA;                print(f"Arquivo de v&#xED;deo inv&#xE1;lido ou corrompido: {video_file}. Pulando.")&#xA;                os.remove(video_file)  # Remove arquivo corrompido&#xA;                continue&#xA;&#xA;            # Processa o v&#xED;deo com a fun&#xE7;&#xE3;o overlay_images_on_video&#xA;            try:&#xA;                overlay_images_on_video(&#xA;                    video_file,&#xA;                    ["/home/abidu/Desktop/ApertaiRemoteClone/Sponsor/image1.png", &#xA;                     "/home/abidu/Desktop/ApertaiRemoteClone/Sponsor/image2.png", &#xA;                     "/home/abidu/Desktop/ApertaiRemoteClone/Sponsor/image3.png", &#xA;                     "/home/abidu/Desktop/ApertaiRemoteClone/Sponsor/image4.png"],&#xA;                    output_file,&#xA;                    [(10, 10), (35, 1630), (800, 1630), (790, 15)],&#xA;                    image_size=(250, 250),&#xA;                    opacity=0.8&#xA;                )&#xA;                &#xA;                if os.path.exists(output_file):&#xA;                    blob = bucket.blob(os.path.basename(video_file).replace("-", "/"))&#xA;                    blob.upload_from_filename(output_file, content_type=&#x27;application/octet-stream&#x27;)&#xA;                    print(f"Uploaded {output_file} to {BUCKET_NAME}")&#xA;                    os.remove(video_file)&#xA;                    os.remove(output_file)&#xA;                    print(f"Processed and deleted {video_file} and {output_file}.")&#xA;            &#xA;            except subprocess.CalledProcessError as e:&#xA;                print(f"Erro ao processar {video_file}: {e}")&#xA;                &#xA;                move_error_video_to_error_directory(video_file)&#xA;&#xA;                continue  # Move para o pr&#xF3;ximo v&#xED;deo na fila ap&#xF3;s erro&#xA;&#xA;def move_error_video_to_error_directory(video_file):&#xA;    print(f"Movendo arquivo de v&#xED;deo com erro {video_file} para {ERROR_VIDEOS_DIR}")&#xA;&#xA;    if not os.path.exists(ERROR_VIDEOS_DIR):&#xA;        os.makedirs(ERROR_VIDEOS_DIR)&#xA;                &#xA;    shutil.move(video_file, ERROR_VIDEOS_DIR)&#xA;&#xA;if __name__ == "__main__":&#xA;    process_and_upload_video()&#xA;&#xA;

    &#xA;

  • Correct recording time of the first frame of a video

    27 juillet 2017, par Vítor Cézar

    How do I get the correct time of the first frame recorded on a video ? I executed the command

    ffprobe -v error -show_streams [file_path]

    and got these values of timecode and creation time for the first stream :

    TAG:creation_time=2017-07-26T16:48:10.000000Z
    TAG:language=eng
    TAG:handler_name=   GoPro AVC
    TAG:encoder=GoPro AVC encoder
    TAG:timecode=17:21:54:28

    The problem is that the video started being recorded on 16:48:11:504 and neither timecode nor creation time shows this value. If possible I need the precision on milliseconds.