
Recherche avancée
Médias (1)
-
The Slip - Artworks
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
Autres articles (77)
-
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 -
Récupération d’informations sur le site maître à l’installation d’une instance
26 novembre 2010, parUtilité
Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...) -
Pas question de marché, de cloud etc...
10 avril 2011Le vocabulaire utilisé sur ce site essaie d’éviter toute référence à la mode qui fleurit allègrement
sur le web 2.0 et dans les entreprises qui en vivent.
Vous êtes donc invité à bannir l’utilisation des termes "Brand", "Cloud", "Marché" etc...
Notre motivation est avant tout de créer un outil simple, accessible à pour tout le monde, favorisant
le partage de créations sur Internet et permettant aux auteurs de garder une autonomie optimale.
Aucun "contrat Gold ou Premium" n’est donc prévu, aucun (...)
Sur d’autres sites (6518)
-
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.
-
Creating an MP4 video with ffmpeg from timestamped JPEG frames received by pipe
16 août 2024, par Denis FevralevI need to create a video with following conditions :


- 

- It can only be made from a sequence of JPEG files, each having its timestamp (milliseconds) in the name. The images' durations are not the same, they differ, so i cannot just concat them all and use particular fps
- There are several tar archives with the images sequences, the archives are kind of huge so I read them from a file storage as an async steam of data and cannot save them on the disk as files. The frames are read and right away put to ffmpeg running process stdin.
- The images may have different aspect ratios so it's required to make a NxN square and scale the images to fit in with filling the empty space with pads








My current solution :


ffmpeg -r $someFpsValue -i - -vf scale=w=$w:h=$h:force_original_aspect_ratio=1,pad=$w:$h:(((ow-iw)/2)):(((oh-ih)/2)) result.mp4



As you can see, it doesn't let me concat the images with correct durations. I know that the concat demuxer can solve the problem of merging images with different durations but seemingly it doesn't work with pipe protocol. I have an idea of evaluating an average fps as (videoFramesCount) / (videoDurationInSeconds) for
-r
argument, or maybe even counting the fps for each video's second and then getting the avg, but maybe there is a more reliable solution (like some concat demuxer analogue) ?

Thanks in advance :)