Recherche avancée

Médias (0)

Mot : - Tags -/performance

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

Autres articles (60)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • 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 (7392)

  • Facing issue with mp4Parser

    20 novembre 2014, par Rohit

    I am trying to trim video with the help of mp4Parser. In output am getting trimmed video but just before video finishes it give error "Sorry cant Play this video". Video am making is H264.

       public static void main(String args) throws IOException {

       Movie movie = new MovieCreator()
               .build(new RandomAccessFileIsoBufferWrapperImpl(
                       new File(
                               "/sdcard/Videos11/"+args+".mp4")));

       List<track> tracks = movie.getTracks();
       Log.e("Tracks","Following are the Tracks:- "+tracks);
       movie.setTracks(new LinkedList<track>());
       // remove all tracks we will create new tracks from the old

       double startTime = 0.000;
       double endTime = 6.000;

       boolean timeCorrected = false;

       // Here we try to find a track that has sync samples. Since we can only
       // start decoding
       // at such a sample we SHOULD make sure that the start of the new
       // fragment is exactly
       // such a frame
       for (Track track : tracks) {
           if (track.getSyncSamples() != null
                   &amp;&amp; track.getSyncSamples().length > 0) {
               if (timeCorrected) {
                   // This exception here could be a false positive in case we
                   // have multiple tracks
                   // with sync samples at exactly the same positions. E.g. a
                   // single movie containing
                   // multiple qualities of the same video (Microsoft Smooth
                   // Streaming file)

                   throw new RuntimeException(
                           "The startTime has already been corrected by another track with SyncSample. Not Supported.");
               }
               startTime = correctTimeToNextSyncSample(track, startTime);
               endTime = correctTimeToNextSyncSample(track, endTime);
               timeCorrected = true;
           }
       }

       for (Track track : tracks) {
           long currentSample = 0;
           double currentTime = 0;
           long startSample = -1;
           long endSample = -1;

           for (int i = 0; i &lt; track.getDecodingTimeEntries().size(); i++) {
               TimeToSampleBox.Entry entry = track.getDecodingTimeEntries().get(i);
               for (int j = 0; j &lt; entry.getCount(); j++) {
                   // entry.getDelta() is the amount of time the current sample
                   // covers.

                   if (currentTime &lt;= startTime) {
                       // current sample is still before the new starttime
                       startSample = currentSample;
                   }
                   if (currentTime &lt;= endTime) {
                       // current sample is after the new start time and still
                       // before the new endtime
                       endSample = currentSample;
                   } else {
                       // current sample is after the end of the cropped video
                       break;
                   }
                   currentTime += (double) entry.getDelta()
                           / (double) track.getTrackMetaData().getTimescale();
                   currentSample++;
               }
           }
           movie.addTrack(new CroppedTrack(track, startSample, endSample));
       }

       IsoFile out = new DefaultMp4Builder().build(movie);

       String filePath = "sdcard/test"+i+".mp4";
       i++;
       File f = new File(filePath);
       FileOutputStream fos = new FileOutputStream(f);
       BufferedOutputStream bos = new BufferedOutputStream(fos, 65535);
       out.getBox(new IsoOutputStream(fos));
       bos.close();
       fos.flush();
       fos.close();

    }

    private static double correctTimeToNextSyncSample(Track track,
           double cutHere) {
       double[] timeOfSyncSamples = new double[track.getSyncSamples().length];
       long currentSample = 0;
       double currentTime = 0;
       for (int i = 0; i &lt; track.getDecodingTimeEntries().size(); i++) {
           TimeToSampleBox.Entry entry = track.getDecodingTimeEntries().get(i);
           for (int j = 0; j &lt; entry.getCount(); j++) {
               if (Arrays.binarySearch(track.getSyncSamples(),
                       currentSample + 1) >= 0) {
                   // samples always start with 1 but we start with zero
                   // therefore +1
                   timeOfSyncSamples[Arrays.binarySearch(
                           track.getSyncSamples(), currentSample + 1)] = currentTime;
               }
               currentTime += (double) entry.getDelta()
                       / (double) track.getTrackMetaData().getTimescale();
               currentSample++;
           }
       }
       for (double timeOfSyncSample : timeOfSyncSamples) {
           if (timeOfSyncSample > cutHere) {
               return timeOfSyncSample;
           }
       }
       return timeOfSyncSamples[timeOfSyncSamples.length - 1];
    }
    </track></track>

    Making video of 30 seconds and want to trim first 6 seconds. Working but in last(between 5 to 6 sec) it shows Cant play this video. Any help will be appreciated.

  • Android - Concat 2 videos using com.netcompss.loader.LoadJNI

    13 mai 2016, par Fabio Bergmann

    I’m using com.netcompss.loader.LoadJNI (FFmpeg4Android) and it was working fine until I try to concat 1 video with audio track and other video without audio track.

    I was using this command line :

    ffmpeg -y -i /storage/emulated/0/app/1.mp4 -i /storage/emulated/0/DCIM/2.mp4 -strict experimental -filter_complex [0:v]scale=640x360,setsar=1:1[v0];[1:v]scale=1280x720,setsar=1:1[v1];[v0][0:a][v1][1:a] concat=n=2:v=1:a=1 -ab 48000 -ac 2 -ar 22050 -s 640x360 -r 30 -vcodec libx264 -acodec aac -crf 18 /storage/emulated/0/app/out.mp4

    1.mp4 has resolution at 640x360 and has audio track.

    2.mp4 has resolution at 1280x720 and has no audio track.

    On vk.log it was showing this :

    Setting 'n' to value '2'
    Setting 'v' to value '1'
    Setting 'a' to value '1'
    Stream specifier ':a' in filtergraph description [0:v]scale=1280x720,setsar=1:1[v0];[1:v]scale=1280x720,setsar=1:1[v1];[v0][0:a][v1][1:a] concat=n=2:v=1:a=1 matches no streams.
    exit_program: 1
    Cannot find a matching stream for unlabeled input pad 3 on filter Parsed_concat_4

    I’m not good with ffmpeg, so I did some changes to the command line without success.

    When all video being concatenated have audio track, there’s no problem. But when one of the videos has no audio track, it fails.

    What would be the correct command line in this case ?

  • Bash : FFmpeg : Automate Album Art Tagging

    8 septembre 2021, par Brett Sjoholm

    Every one of my music folders are set up like Artist > Year Album >

    &#xA;

    Track 01.flac&#xA;Track 02.flac&#xA;Track 03.flac&#xA;folder.jpg, jpeg, png, etc&#xA;

    &#xA;

    And what I need to do is if folder.* is available.

    &#xA;

    if [ -f folder.* ]; then&#xA;

    &#xA;

    Run this command to set smaller size without replacing the original photo.

    &#xA;

    for small in folder.*&#xA;convert $small -resize 1000x1000 temp$small&#xA;

    &#xA;

    Then run these commands on every file to automatically add the smaller sized cover to each audio file's tagging.

    &#xA;

    ffmpeg -i TRACK.flac -i SMALLFOLDER.* -map a -map 1:v -disposition:v attached_pic -metadata:s:v comment="Cover (Front)" -codec copy TRACKWITHART.flac&#xA;&amp;&amp; rm TRACK.flac&#xA;&amp;&amp; mv TRACKWITHART.flac TRACK.flac&#xA;&amp;&amp; rm temp$small&#xA;

    &#xA;

    Last little bit there is me cleaning up. I'm having trouble piping commands into one another with this and not the most experienced with that sort of thing.

    &#xA;

    And also, if it's not available like above, will need to extract it from the first audio file by finding it.

    &#xA;

    else&#xA;find . -name "*.flac" -print -quit &#xA;

    &#xA;

    And extracting it with this command.

    &#xA;

    ffmpeg -i TRACK.flac -vf scale=1000:1000 -an FOLDER.png&#xA;

    &#xA;

    Then run the other commands above.

    &#xA;

    Now I don't know if anyone is familiar with FFmpeg but it's actually kind of nightmare because it's not necessarily for audio tagging but I don't know anything else to handle this kind of automated album art task in the terminal. If anyone can point me more in the right direction with a better CLI utility, that'd be awesome or just help with this bash scripting. You can see I'm fairly familiar with the terminal and getting some things done by searching the web but putting them altogether in a bash script is very difficult for me to understand, if anyone has some links for specifically this, that would be much appreciated.

    &#xA;