Recherche avancée

Médias (0)

Mot : - Tags -/signalement

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (15)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • La sauvegarde automatique de canaux SPIP

    1er avril 2010, par

    Dans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
    Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)

  • Automated installation script of MediaSPIP

    25 avril 2011, par

    To overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
    You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
    The documentation of the use of this installation script is available here.
    The code of this (...)

Sur d’autres sites (3025)

  • Humble Video take snapshot of given time

    23 mai 2021, par Boldbayar
      

    1. Hello, I'm using https://github.com/artclarke/humble-video to take a thumbnail from a video.
So far I have successfully managed to take a snapshot from a video at start with following method.

      


      private static Path generateThumbnail(final Path videoFile)
     throws InterruptedException, IOException {

 final Demuxer demuxer = Demuxer.make();
 demuxer.open(videoFile.toString(), null, false, true, null, null);

 int streamIndex = -1;
 Decoder videoDecoder = null;
 String rotate = null;
 final int numStreams = demuxer.getNumStreams();
 for (int i = 0; i < numStreams; ++i) {
     final DemuxerStream stream = demuxer.getStream(i);
     final KeyValueBag metaData = stream.getMetaData();
     final Decoder decoder = stream.getDecoder();
     if (decoder != null
             && decoder.getCodecType() == MediaDescriptor.Type.MEDIA_VIDEO) {
         videoDecoder = decoder;
         streamIndex = i;
         rotate = metaData.getValue("rotate", KeyValueBag.Flags.KVB_NONE);
         break;
     }
 }

 if (videoDecoder == null) {
     throw new IOException("Not a valid video file");
 }
 videoDecoder.open(null, null);

 final MediaPicture picture = MediaPicture.make(videoDecoder.getWidth(),
         videoDecoder.getHeight(), videoDecoder.getPixelFormat());

 final MediaPictureConverter converter = MediaPictureConverterFactory
         .createConverter(MediaPictureConverterFactory.HUMBLE_BGR_24, picture);

 final MediaPacket packet = MediaPacket.make();
 BufferedImage image = null;
 MUX : while (demuxer.read(packet) >= 0) {
     if (packet.getStreamIndex() != streamIndex) {
         continue;
     }
     int offset = 0;
     int bytesRead = 0;
     videoDecoder.decodeVideo(picture, packet, offset);
     do {
         bytesRead += videoDecoder.decode(picture, packet, offset);
         if (picture.isComplete()) {
             image = converter.toImage(null, picture);
             break MUX;
         }
         offset += bytesRead;

     } while (offset < packet.getSize());
 }
 if (image == null) {
     throw new IOException("Unable to find a complete video frame");
 }
 if (rotate != null) {
     final AffineTransform transform = new AffineTransform();
     transform.translate(0.5 * image.getHeight(), 0.5 * image.getWidth());
     transform.rotate(Math.toRadians(Double.parseDouble(rotate)));
     transform.translate(-0.5 * image.getWidth(), -0.5 * image.getHeight());
     final AffineTransformOp op = new AffineTransformOp(transform,
             AffineTransformOp.TYPE_BILINEAR);
     image = op.filter(image, null);
 }

 final Path target = videoFile.getParent()
         .resolve(videoFile.getFileName() + ".thumb.jpg");

 final double mul;
 if (image.getWidth() > image.getHeight()) {
     mul = 216 / (double) image.getWidth();
 } else {
     mul = 216 / (double) image.getHeight();
 }

 final int newW = (int) (image.getWidth() * mul);
 final int newH = (int) (image.getHeight() * mul);
 final Image thumbnailImage = image.getScaledInstance(newW, newH,
         Image.SCALE_SMOOTH);
 image = new BufferedImage(newW, newH, BufferedImage.TYPE_INT_BGR);

 final Graphics2D g2d = image.createGraphics();
 g2d.drawImage(thumbnailImage, 0, 0, null);
 g2d.dispose();

 ImageIO.write(image, "jpeg", target.toFile());
 return target.toAbsolutePath(); }


      


    2. 


    3. Now, what I want to do is take a snapshot after 2 seconds after the video starts, is it possible ? I
have tried using the "Demuxer" -s seek method but no luck.

      


    4. 


    


  • MLT melt slideshow on Windows : unable to control output video length and problems with using wildcards

    10 novembre 2020, par Tjk

    I am using the following command within a batch script to, hopefully, eventually programmatically create simple video slideshows with transitions :

    


    melt 131.jpg 132.jpg 133.jpg ttl=75 -attach crop center=1 -filter luma cycle=75 duration=25 -transition mix -consumer avformat:out.mp4 frame_rate_num=30 frame_rate_den=1


    


    Most of this command is an adaptation for Windows of this command on the MLT website blog (with the exception of the part that scales and transforms the image). For some reason when I run this, however, the output video file is 25 minutes long !

    


    I have two main questions :

    


    a. How do I properly control the duration of each image in the video ? I have experimented quite a bit with changing the parameters and I have a semi-decent understanding of what they all mean (I am a newbie to MLT but I figured that there's no way to do something like this easily in FFMPEG alone). The only way I have found to decrease the duration with any amount of control is to increase the output framerate to absurd numbers (which, of course, is not ideal as it's a massive waste of time and energy and still doesn't really solve the issue).

    


    b. How do I use a wildcard to input all the .jpg files in a folder on Windows ? I tried adding *.jpg but that didn't work and I don't know how else to do it within a batch script (I tried using the following code to get the file names as a variable, but I wasn't able to get string concatenation working correctly because it only outputs the final file name)

    


    set files=
for /r %%i in (*.jpg) do (
    echo %%i
    set files=%files% "%%i"
)
echo %files%


    


    Thank you for any suggestions !

    


  • Black overlay appears when merging a transparent video to another video

    13 juin 2012, par RakeshS

    This is what I have done so far :

    Command to create a transparent PNG image :

    convert -size 640x480 -background transparent -fill blue \
    -gravity South label:ROCK image1-0.png

    Command to create a transparent video :

    ffmpeg -loop 1 -f image2 -i image1-0.png -r 20 -vframes 100 \
    -vcodec png -pix_fmt bgra mov-1.mov

    (as per this post) - I expect this video to be a transparent video.

    Command to overlay a video with another :

    ffmpeg -i final-video.mov -sameq -ar 44100 \
    -vf "movie=mov-1.mov [logo];[in][logo] overlay=0:0 [out]" \
    -strict experimental final-video.mov

    Above commands works perfect and I have not faced any problem, but I don't get what I expect which is kinda watermarking effect, I want mov-1.mov to be transparent with final-video.mov.

    Questions :

    1. Is there any way to verify if the generated video is transparent ? other than merging ?
    2. Not sure why the above mov-1.mov is not transparent when it is merged with final-video.mov, any info to solve this problem would be great.

    Please help.