Recherche avancée

Médias (1)

Mot : - Tags -/embed

Autres articles (111)

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

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

  • Configuration spécifique d’Apache

    4 février 2011, par

    Modules spécifiques
    Pour la configuration d’Apache, il est conseillé d’activer certains modules non spécifiques à MediaSPIP, mais permettant d’améliorer les performances : mod_deflate et mod_headers pour compresser automatiquement via Apache les pages. Cf ce tutoriel ; mode_expires pour gérer correctement l’expiration des hits. Cf ce tutoriel ;
    Il est également conseillé d’ajouter la prise en charge par apache du mime-type pour les fichiers WebM comme indiqué dans ce tutoriel.
    Création d’un (...)

Sur d’autres sites (8452)

  • Playback / recording problems

    3 novembre 2024, par Wessiez

    The code I'm working on gives me some errors. This results in frame lost when recording.

    


    The overview : A video is paused in the first frame. When the motion sensor is detected the video is playing a scary scene. After that it pauses again on the first frame.
At the same time when motion is detected the camera starts recording the reaction of the poeple watching the scary scene.

    


    This is my code :

    


    from gpiozero import MotionSensor
from time import sleep
from picamera2 import Picamera2
from picamera2.encoders import H264Encoder
from picamera2.outputs import FfmpegOutput
import vlc
import datetime

# Creating Instance class object
vlc_instance = vlc.Instance()
player = vlc_instance.media_player_new()
player.set_fullscreen(True)
  
# Define Motion Sensor
pir = MotionSensor(4)

# Camera
camera = Picamera2()
video_config = camera.create_video_configuration()
camera.configure(video_config)
camera.rotation = 180
encoder = H264Encoder(bitrate=10000000)
output = FfmpegOutput('/home/wessie/Halloween/Recordings/' + datetime.datetime.now().strftime('%Y-%m-%d_%H.%M.%S.h264'))

print("Sensor loading")
pir.wait_for_no_motion()
sleep(.1)
player.set_mrl("/home/wessie/Halloween/ScareMedia/FemaleScare.mp4")
player.play()
sleep(.1)

while True:
    try:
        print("Ready")
        pir.wait_for_motion()
        sleep(.1)
        print("Motion detected")
        sleep(.1)
        player.set_mrl("/home/wessie/Halloween/ScareMedia/FemaleScare.mp4")
        player.play()
        sleep(.1)
        camera.start_recording(encoder, output)
        sleep(12)
        camera.stop_recording()
        while player.get_state() in playing:
            sleep(.1)
            continue        
        print("Finished")
        sleep(.1)
    except KeyboardInterrupt:
        break
    except:
        continue


    


    After "Motion detected" the message is :
"Application provided invalid non monotonically increasing dts to muxer in stream 0 :"

    


    I've tried to cleanup this code, but everything I do results in other errors.

    


    Is the code in the right order ? The scary scene seems to work, but the recording is not 100%

    


  • Checking Video Quality using WP Code, Forminator and FFmpeg is not working [closed]

    3 septembre 2024, par guiliannkamga Guilian90

    I have a WordPress website where users should be able to upload videos. The quality of the videos should be checked upon upload, meaning the videos must have a 16:9 aspect ratio and be in HD. If a video does not meet these conditions, the upload should not be allowed, and the user should be informed of the reason.

    


    I am using the WordPress plugin Forminator for the video upload form and WP Code with a code snippet that contains PHP code. FFmpeg version 4.4.2 is installed on my server.

    


    ffmpeg version

    


    Form to upload a Video

    


    My provider is DreamHost, and I can connect to the server via Terminal on my MacBook and run ffmpeg commands without any issues.

    


    I added the form to a page and when I upload invalid videos, unfortunately, I do not receive any error messages, which should be happening according to my code, and I do not know why.

    


    Uploading the Video

    


    Success Message after uploading the Video

    


    Can someone help me ?

    


    add_filter('forminator_custom_form_submit_before_set_fields', 'forminator_video_validation', 10, 3);

function forminator_video_validation($entry, $form_id, $field_data) {
    foreach ($field_data as $field) {
        if ($field['name'] === 'upload-1') { // 'upload-1' is the ID of the Datei-Upload-Field in Forminator
            $file = $field['value']['file']['file_path'];

            // check if the file exists
            if (!file_exists($file)) {
                wp_die('File does not exist');
            }

            // ffmpeg command to check video size and resolution
            $command = "ffmpeg -i " . escapeshellarg($file) . " 2>&1";
            $output = shell_exec($command);

            // extract resoltion from the ffmpeg output
            if (preg_match('/Stream #0:0.*Video:.* (\d+)x(\d+)/', $output, $matches)) {
                $width = (int) $matches[1];
                $height = (int) $matches[2];
                $aspect_ratio = $width / $height;
                $allowed_aspect_ratio = 16 / 9;
                $min_width = 1280;
                $min_height = 720;

                // check if the video fullfills the criterias
                if ($width < $min_width || $height < $min_height || round($aspect_ratio, 2) != round($allowed_aspect_ratio, 2)) {
                    wp_die('The video must be at least in HD (1280x720) and must have the format 16:9. (Found: ' . $width . 'x' . $height . ')');
                }
            } else {
                // If the video could not be analysed
                wp_die('The Video could not be analysed');
            }
        }
    }
}


    


    PHP Code Snippet in WPCode

    


    WPCode Settings

    


  • swscale/range_convert : drop redundant conditionals from arch-specific init functions

    22 septembre 2024, par Ramiro Polla
    swscale/range_convert : drop redundant conditionals from arch-specific init functions
    

    These conditions are already checked for in the main init function.

    • [DH] libswscale/aarch64/swscale.c
    • [DH] libswscale/loongarch/swscale_init_loongarch.c
    • [DH] libswscale/riscv/swscale.c
    • [DH] libswscale/swscale.c
    • [DH] libswscale/x86/swscale.c