
Recherche avancée
Médias (1)
-
The Great Big Beautiful Tomorrow
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
Autres articles (82)
-
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 -
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 (...) -
Support audio et vidéo HTML5
10 avril 2011MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)
Sur d’autres sites (4775)
-
lavc/encode : add an encoder-specific get_buffer() variant
23 mars 2022, par Anton Khirnovlavc/encode : add an encoder-specific get_buffer() variant
Several encoders (roqvideo, svq1, snow, and the mpegvideo family)
currently call ff_get_buffer(). However this function is written
assuming it is called by a decoder. Though nothing has been obviously
broken by this until now, that may change in the future.To avoid potential future issues, introduce a simple encode-specific
wrapper around avcodec_default_get_buffer2() and enforce its use in
encoders. -
Read a text file line-by-line (each line as an array), run bash command with array elements, then loop to the next line in the text file
10 janvier, par xiaohouziI'm using immich to manage my media library with photos and videos but appropriate video thumbnails are black or do not have an appropriate thumbnails for my family to view. As a test, I decided to manually recreate the thumbnails and then update appropriate thumbs files in the exact directory ; replacing the auto-generated ones by Immich using ffmpeg. The following script works fine but one by one will take forever.


#!/bin/bash
file=(formula1 "aust_gp_00'23'41_2022_1858658849.mp4" f2dfse3-34gd-23ff-6hdd-p3h4kk/a3/10/a399-dj88-ah29 00:00:30.000)

# create jpeg + webp and replace existing
sudo ffmpeg -i /mnt/f1/"${file[0]}"/"${file[1]}" -ss "${file[3]}" -frames:v 1 /immich/app/thumbs/"${file[2]}"-preview.jpeg -y \
&& \
sudo ffmpeg -i /mnt/f1/"${file[0]}"/"${file[1]}" -ss "${file[3]}" -frames:v 1 /immich/app/thumbs/"${file[2]}"-thumbnail.webp -y



My goal is to put all the needed files in a text file use "readarry" to read each line as an array, use the appropriate index and then repeat for the next line. This is where I am stuck. How could I loop through each line where each line is a new file, keep the same indexes, and repeat ? Anyone familiar with how to accomplish this or if there is a better way using bash ? I was hoping to only use bash instead of python.


For example...


#files.txt
file=(formula1 "aust_gp_00'23'41_2022.mp4" f2dfse3-34gd-23ff-6hdd-p3h4kk/a3/10/a399-dj88-ah29 00:00:30.000)
file=(formula1 "belg_gp_00'13'31_2022.mp4" f2dfse3-34gd-23ff-6hdd-p3h4kk/q4/6/mhf-846d-zpyf 00:00:30.000)
file=(formula1 "melb_gp_00'05'11_2022.mp4" f2dfse3-34gd-23ff-6hdd-p3h4kk/b9/2/q3dd-0988-vr2t 00:00:30.000)




# genthumb.sh
#!/bin/bash
readarray -t lines < files.txt &&
 for line in "${!lines[@]}"; do
 sudo ffmpeg -i /mnt/f1/"${lines[0]}"/"${lines[1]}" -ss "${lines[3]}" -frames:v 1 /immich/app/thumbs/"${lines[2]}"-preview.jpeg -y \
 && \
 sudo ffmpeg -i /mnt/f1/"${file[0]}"/"${file[1]}" -ss "${file[3]}" -frames:v 1 /immich/app/thumbs/"${file[2]}"-thumbnail.webp -y
 done



-
Perspective transformations
Finally (after a long break) I managed to force myself to update the PHP documentation and this time it was distortImage code example. Things have been hectic lately but that does not quite explain the 6 months(?) break between this and the previous post. As a matter of a fact there is no excuse for such a long silence so I will try to update this blog a bit more often from now on.
Back in the day I used to blog the examples and update the documentation if I remembered but I am trying to fix this bad habit. Most of the latest examples have been updated in to the manual. In the case of the two last examples I updated the documentation first and then blogged on the subject.
I took some time to actually understand the perspective transformations properly using the excellent ImageMagick examples (mainly created by Anthony Thyssen) as a reference. The basic idea of perspective distortion seems simple : to distort the control points to new locations. Grabbing the syntax for Imagick was easy, an array of control point pairs in the form of :
-
array(source_x, source_y, dest_x, dest_y ... )
The following example uses the built-in checkerboard pattern to demonstrate perspective distortion :
-
< ?php
-
/* Create new object */
-
$im = new Imagick() ;
-
-
/* Create new checkerboard pattern */
-
$im->newPseudoImage(100, 100, "pattern:checkerboard") ;
-
-
/* Set the image format to png */
-
$im->setImageFormat(’png’) ;
-
-
/* Fill background area with transparent */
-
$im->setImageVirtualPixelMethod(Imagick: :VIRTUALPIXELMETHOD_TRANSPARENT) ;
-
-
/* Activate matte */
-
$im->setImageMatte(true) ;
-
-
/* Control points for the distortion */
-
$controlPoints = array( 10, 10,
-
10, 5,
-
-
10, $im->getImageHeight() - 20,
-
10, $im->getImageHeight() - 5,
-
-
$im->getImageWidth() - 10, 10,
-
$im->getImageWidth() - 10, 20,
-
-
$im->getImageWidth() - 10, $im->getImageHeight() - 10,
-
$im->getImageWidth() - 10, $im->getImageHeight() - 30) ;
-
-
/* Perform the distortion */
-
$im->distortImage(Imagick: :DISTORTION_PERSPECTIVE, $controlPoints, true) ;
-
-
/* Ouput the image */
-
header("Content-Type : image/png") ;
-
echo $im ;
-
?>
Here is the source image :
And the result :
-