
Recherche avancée
Autres articles (60)
-
Soumettre améliorations et plugins supplémentaires
10 avril 2011Si vous avez développé une nouvelle extension permettant d’ajouter une ou plusieurs fonctionnalités utiles à MediaSPIP, faites le nous savoir et son intégration dans la distribution officielle sera envisagée.
Vous pouvez utiliser la liste de discussion de développement afin de le faire savoir ou demander de l’aide quant à la réalisation de ce plugin. MediaSPIP étant basé sur SPIP, il est également possible d’utiliser le liste de discussion SPIP-zone de SPIP pour (...) -
MediaSPIP : Modification des droits de création d’objets et de publication définitive
11 novembre 2010, parPar défaut, MediaSPIP permet de créer 5 types d’objets.
Toujours par défaut les droits de création et de publication définitive de ces objets sont réservés aux administrateurs, mais ils sont bien entendu configurables par les webmestres.
Ces droits sont ainsi bloqués pour plusieurs raisons : parce que le fait d’autoriser à publier doit être la volonté du webmestre pas de l’ensemble de la plateforme et donc ne pas être un choix par défaut ; parce qu’avoir un compte peut servir à autre choses également, (...) -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir
Sur d’autres sites (9286)
-
Playback / recording problems
3 novembre 2024, par WessiezThe 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 Guilian90I 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.






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.




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');
 }
 }
 }
}







-
swscale/range_convert : drop redundant conditionals from arch-specific init functions
22 septembre 2024, par Ramiro Pollaswscale/range_convert : drop redundant conditionals from arch-specific init functions
These conditions are already checked for in the main init function.