Recherche avancée

Médias (1)

Mot : - Tags -/lev manovitch

Autres articles (68)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

Sur d’autres sites (7470)

  • UserWarning : x bytes wanted but 0 bytes read at frame index y (out of a total z frames), at time q sec. Using the last valid frame instead

    1er juillet, par Wiz

    I have a script which subclips a larger video and then stitches needed parts together using concatenate and write video file in moviepy. But the problem is everytime i run the script i get the video but the audio is off sync, usually the audio starts normally, but over time becomes delayed. I suspect it is because i want to concatenate around 220 smaller mp4 videos into one big mp4 video, but every smaller clips receives the error :'UserWarning : In file test.mp4, 1555200 bytes wanted but 0 bytes read at frame index y (out of a total y+1 frames), at time x sec. Using the last valid frame instead.'

    


    I use moviepy v2

    


    MY CODE (it doesnt produce any strict errors, but does give the aformentioned UserWarning when writing video_unsilenced.mp4) :

    


    n = 0

cuts = []
input_paths = []
vc = []
os.makedirs(r"ShortsBot\SUBCLIPS")
for timer in range(len(startsilence)-1):
   w = VideoFileClip(r"ShortsBot\output\cropped_video.mp4").subclipped(endsilence[n],(startsilence[n+1]+0.5))
   w.write_videofile(r"ShortsBot\SUBCLIPS\video" + str(n) + ".mp4")
   a = VideoFileClip(r"ShortsBot\SUBCLIPS\video" + str(n) + ".mp4")
   vc.append(a)
   n+=1

output_fname = "video_unsilenced.mp4"
clip = mpy.concatenate_videoclips(clips=vc, method= 'compose')
clip.write_videofile(filename=output_fname, fps=30)
_ = [a.close() for a in vc]


    


    Because moviepy is shaving off a frame or two for every video clip and at the same time writing the audio of the concatenated clip normally (without shaving off the audio that is in the missing frames), the video and audio slowly become out of sync.And the more clips i want to concatenate, the more the audio becomes out of sync, basically confirming my suspicion that it is because moviepy is using the last valid frame and writing the audio normally. The question i have is how can i fix this ? Ive looked for similar questions, but havent found the exact answer i was looking for. Sorry if this is something basic, im a beginner programmer in python and would really appreciate some tips or some sort of fix. Thanks everyone !

    


  • Node.js, fluent-ffmpeg : Generate thumbnails with size dependent on if the video is wider or taller

    13 mars 2020, par Bone Jones

    I am trying to use fluent-ffmpeg to generate thumbnails in Node.js. These thumbnails need to be no wider/taller than 150px and maintain the original aspect ratio of the video. For example, if the width of the video is greater than the height the size should be 150xSmallerHeight and if the video is taller SmallerWidthx150.

    This is my current code :

    var ffmpeg = require('fluent-ffmpeg');
    ...
    ffmpeg(fileName)
       .thumbnail({
           timestamps: [0],
           folder: outFolder,
           filename: outName,
           size: '150x150' // Generates a 150px square thumbnail as expected, but is not the desired behavior
       })
       .on('end', function () {
            console.log('Screenshot taken');
       });

    From what I can see in the fluent-ffmpeg docs these are the only options to control the size of a thumbnail :

    - 640x480: set a fixed output frame size. Unless autopad() is called, this may result in the video being stretched or squeezed to fit the requested size.
    - 640x?: set a fixed width and compute height automatically. If aspect() is also called, it is used to compute video height; otherwise it is computed so that the input aspect ratio is preserved.
    - ?x480: set a fixed height and compute width automatically. If aspect() is also called, it is used to compute video width; otherwise it is computed so that the input aspect ratio is preserved.
    - 50%: rescale both width and height to the given percentage. Aspect ratio is always preserved.

    I don’t believe any of these options would allow me to generate the thumbnail described unless I had access to the video’s original width and height, for example :

    ...
    size: `${video.width >= video.height ? '150' : '?'}x${video.height >= video.width ? '150' : '?'}`
    ...

    How can I create a thumbnail as described using fluent-ffmpeg ?

  • Discord.js voice stop playing audio after 10 consecutive files

    29 avril 2021, par Spiralio

    I am trying to do the simple task of playing a single MP3 file when a command is run. The file is stored locally, and I have FFmpeg installed on my computer. The code below is part of my command's file :

    


    const Discord = require("discord.js");
const fs = require('fs');
const { Client, RichEmbed } = require('discord.js');
const config = require("../config.json");

let playing = undefined;
let connection = undefined;

module.exports.run = async (client, message, args, config) => {


  if (playing) playing.end()
  if (connection == undefined) await message.member.voice.channel.join().then((c) => {
    connection = c;
  })
  playing = connection.play('./sounds/sound.mp3')

}


    


    (note that this code is heavily narrowed down to single out the issue)

    


    When I run the command the first 9 times, it works perfectly - the file is played, and cuts off if it is already playing. I also want to note that the file is 2 minutes long. However, once I play the file for exactly the 10th time, the bot stops playing audio entirely - as long as all 10 times are overlapping (meaning I don't let the audio finish).

    


    What's more confusing is that if an error is passed after the bot stops playing audio, it appears in an entirely different format than the standard Discord.js errors. For example, this code does not test to see if the user is in a voice channel, so if I purposefully crash the bot by initiating the command without being in a voice channel (after running the command 10 times), the error looks like this :

    


    abort(RangeError: offset is out of bounds). Build with -s ASSERTIONS=1 for more info.
(Use `electron --trace-uncaught ...` to show where the exception was thrown)


    


    (Preceded by a bunch of unformatted code) This however, is not consistent. It seems to only appear after letting the files run entirely.

    


    The issue only fixes itself when the entire bot restarts. Any help would be appreciated.