Recherche avancée

Médias (1)

Mot : - Tags -/biomaping

Autres articles (46)

  • Personnaliser les catégories

    21 juin 2013, par

    Formulaire de création d’une catégorie
    Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
    Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire.
    Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
    Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-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

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

Sur d’autres sites (11061)

  • How to find higest bitrate in mp4 file and extract jpg ?

    10 octobre 2018, par Igor Petev

    I im using ffmpeg and have mp4 file that is in size around 50MB and duration 2m7sec.I need to write batch script for windows that will read whole mp4 file find position in seconds where higest bitrate is there and extract jpg image from that position.

    For example, i have mp4 trailer file that i would like to extract cover, using above script where i define time to extract jpg i get on some mp4 trailers black screen...so using above idea to find higet bitrate for shure will not be black screen, will be picture of some scene.

    Here is windows batch code that extract jpg dfrom mp4 using user defined time :

    @ECHO OFF
    SET oldName=
    SET newName=

    FOR %%A IN (*.mp4) DO (
    SET oldName=%%A
    SET newName=%%A
    CALL :MAKEJPG
    )

    :MAKEJPG
    SET newName=%newName:mp4=jpg%
    IF NOT EXIST %newName% (
    START /B /WAIT D:\www\ffmpeg.exe -i "%oldName%" -ss 00:00:17.30 -vcodec mjpeg -vframes 1 -f image2 "%newName%"
    EXIT
    )
  • Code runs when in a main method but not when in another method

    8 août 2018, par Zubair Ahmed

    I created the setArtwork method to set the artwork of an aac file in an .m4a container and it does exactly what I want it to when I run the main method

    public static void setArtwork(File art, File m4a) throws Exception{
       Mp4TagReader reader = new Mp4TagReader();
       Mp4TagWriter writer = new Mp4TagWriter();
       RandomAccessFile song = new RandomAccessFile(m4a.toString(),"rw");
       Mp4Tag mp4tag = reader.read(song);

       Artwork artwork = ArtworkFactory.createArtworkFromFile(art);
       mp4tag.addField(artwork);
       mp4tag.setField(artwork);

       RandomAccessFile temp = new RandomAccessFile(m4a,"rw");
       writer.write(mp4tag,song,temp);
    }
    public static void main(String[] args) throws Exception{
       File art = new File("C:\\Users\\Zubair\\Documents\\music\\coverArt.jpeg");
       File m4a = new File("C:\\Users\\Zubair\\Documents\\music\\song.m4a");
       setArtwork(art,m4a);
    }

    BUT, when I try to use the setArtwork method in a different method in a different class it doesn’t actually save the mp4 tag to the File. I did some debugging to see if the picture was even being added to the artwork tag and it all looks good, but it seems that the tag doesn’t get written to the file.

    public static void mp3Tom4a(File mp3File, File m4aFolder, File coverArt) throws Exception {
       String input = mp3File.toString();
       String name = mp3File.getName();

       String output = name.substring(0,name.indexOf(MP3)) + M4A;
       output = m4aFolder.toString() + "\\" + output;

       //cd ffmpeg\bin && ffmpeg -y -i input.mp3 -an -vcodec copy cover.jpg && ffmpeg -y -i input.mp3 -c:a aac -b:a 192k -vn output.m4a
       ProcessBuilder builder = new ProcessBuilder(
               "cmd.exe","/c","cd ffmpeg\\bin && ffmpeg -y -i "
               + input +" -an -vcodec copy "+coverArt+
               " && ffmpeg -y -i " + input + " -c:a aac -b:a 128k -vn " + output);
       builder.redirectErrorStream(true);
       builder.start();
       JAudioData.setArtwork(coverArt,new File(output));
    }
    public static void main(String[] args) throws Exception {
       mp3Tom4a(new File("C:\\Users\\Zubair\\Documents\\music\\song.mp3"),
               new File("C:\\Users\\Zubair\\Documents\\music"),
               new File("C:\\Users\\Zubair\\Documents\\music\\coverArt.jpeg"));
    }

    it doesn’t make sense that setArtwork only works when it’s in the main method of its own class, especially because the objects I am using for the parameters are identical to eachother, so there should be no difference in the result. I think it might have something to do with the RandomAccessFile object being updated but the physical storage not getting updated

    Edit- If I comment out builder.start() then it can successfully write the mp4tag to the m4a file. But I don’t see why having builder.start() would prevent that from happenning. My best guess is that because builder.start() is what creates song.m4a it is still being "edited" by that and can’t be edited by any other processes.

  • Using ffprobe to get number of keyframes in raw AVI file *without* processing entire file ?

    26 juillet 2018, par aggieNick02

    This question and answer cover how to get the framecount and keyframe count from an AVI file, which is very useful. I’ve got a raw AVI file and want to count the number of keyframes (equivalent to non-dropped frames for raw AVI), but it takes a long time to process through a raw AVI file.

    There is some way to get this information without fully processing the file, as VirtualDub provides both framecount and key framecount in the file information, as well as total keyframe size, almost instantly for a 25-second raw 1920x1080 AVI. But ffprobe requires count_frames to populate nb_read_frames, which takes some good processing time.

    I can do some math with the file’s size and the frame’s width/height/format to get a fairly good estimate of the number of frames, but I’m worried the overhead of the container could be enough to throw the math off for very short clips. (For my 25 second clip, I get 1286.12 frames, when there are really 1286.)

    Any thoughts on if there is a way to get this information programatically with ffprobe or ffmpeg without processing the whole file ? Or with another API on windows ?