
Recherche avancée
Médias (1)
-
Revolution of Open-source and film making towards open film making
6 octobre 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (103)
-
Mise à jour de la version 0.1 vers 0.2
24 juin 2013, parExplications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...) -
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Keeping control of your media in your hands
13 avril 2011, parThe vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)
Sur d’autres sites (9172)
-
vf_paletteuse : fix color cache lookup for Bayer dithering mode.
10 janvier 2022, par Rudolf Polzervf_paletteuse : fix color cache lookup for Bayer dithering mode.
To trigger this bug, use `paletteuse=dither=bayer:bayer_scale=0` ; you will see
that adjacent pixel lines will use the same dither pattern, instead of being
shifted from each other by 32 units (0x20).One way to demostrate the bug is :
$ convert -size 64x256 gradient:black-white -rotate 270 grad.png
$ echo 'P2 2 1 255 0 255' > bw.pnm
$ ffmpeg -i grad.png -filter_complex 'movie=bw.pnm,scale=256x1[bw] ; [0:v][bw]paletteuse=dither=bayer:bayer_scale=0' gradbw.pngPreviously : https://www.rm.cloudns.org/img/uploaded/0bd152c11b9cd99e5945115534b1bdde.png
Now : https://www.rm.cloudns.org/img/uploaded/89caaa5e36c38bc2c01755b30811f969.pngThis was caused by passing inconsistent color vs (a,r,g,b) parameters to
color_get(), and NBITS being 5 meaning actually hitting the same cache node
does happen in this case, but ONLY if bayer_scale is zero.The fix is passing the correct color value to color_get().
Also added a previous-failing FATE test ; image comparison of the first frame :
Previously : https://www.rm.cloudns.org/img/uploaded/d0ff9db8d8a7d8a3b8b88bbe92bf5fed.png
Now : https://www.rm.cloudns.org/img/uploaded/a72389707e719b5cd1c58916a9e79ca8.png(on this less synthetic test image, the bug basically causes noise from cache
hits vs misses)Tested : FATE passes, which exercises this filter but at the default bayer_scale.
Reviewed-by : Paul B Mahol <onemda@gmail.com>
-
Started Programming Young
6 septembre 2011, par Multimedia Mike — ProgrammingI have some of the strangest memories of my struggles to jump into computer programming.
Back To BASIC
I remember doing some Logo programming on Apple II computers at school in 5th grade (1987 timeframe). But that was mostly driving turtle graphics. Then I remember doing some TRS-80 BASIC in 7th grade, circa 1989. Emboldened by what very little I had learned in perhaps the week or 2 we took in a science class to do this, I tried a little GW-BASIC on my family’s “IBM-PC compatible” computer (they were still called that back then). I still remember what my first program consisted of. Even back then I was interested in manipulating graphics and color on a computer screen. Thus :10 color 1 20 print "This is color 1" 30 color 2 40 print "This is color 2" ...
And so on through 15 colors. Hey, it did the job– it demonstrated the 15 different colors you could set in text mode.
What’s FOR For ?
That 7th grade computer unit in science class wasn’t very thick on computer science details. I recall working with a lab partner to transcribe code listings into a computer (and also saving my work to a storage cassette). We also developed form processing programs that would print instructions to input text followed by an “INPUT I$” statement to obtain the user’s output.I remember there was some situation where we needed a brief delay between input and printing. The teacher told us to use a construct of the form :
10 FOR I = 1 TO 20000 20 NEXT I
We had to calibrate the number based on our empirical assessment of how long it lasted but I recall that the number couldn’t be much higher than about 32000, for reasons that would become clearer much later.
Imagine my confusion when I would read and try to comprehend BASIC program code I would find in magazines. I would of course see that FOR..NEXT construct all over the place but obviously not in the context of introducing deliberate execution delays. Indeed, my understanding of one of the fundamental building blocks of computer programming — iteration — was completely skewed because of this early lesson.
Refactoring
Somewhere along the line, I figured out that the FOR..NEXT could be used to do the same thing a bunch of times, possibly with different values. A few years after I had written that color program, I found it again and realized that I could write it as :10 for I = 1 to 15 20 color I 30 print I 40 next I
It still took me a few more years to sort out the meaning of WHILE..WEND, though.
-
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');
 }
 }
 }
}