Recherche avancée

Médias (0)

Mot : - Tags -/upload

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

Autres articles (112)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

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

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

Sur d’autres sites (6935)

  • The video after editing with ffmpeg in not showing in the phone gallery

    23 novembre 2019, par corgiwooer

    I am working on a video editor app. The app works fine and edits the video. But the problem is the edited video is not showing in the phone gallery. I don’t the problem. I also added the Media Scanner in the end but I didn’t work out for me.

    This is my video editor method

    private void executeCutVideoCommand(int startMs, int endMs) {
           File moviesDir = Environment.getExternalStoragePublicDirectory(
                   Environment.DIRECTORY_MOVIES
           );

           String filePrefix = "cut_video";
           String fileExtn = ".mp4";
           String yourRealPath = getPath(VideoCutterActivity.this, selectedVideoUri);
           File dest = new File(moviesDir, filePrefix + fileExtn);
           int fileNo = 0;
           while (dest.exists()) {
               fileNo++;
               dest = new File(moviesDir, filePrefix + fileNo + fileExtn);
           }

           filePath = dest.getAbsolutePath();
           String[] complexCommand = {"-ss", "" + startMs / 1000, "-y", "-i", yourRealPath, "-t", "" + (endMs - startMs) / 1000,"-vcodec", "mpeg4", "-b:v", "2097152", "-b:a", "48000", "-ac", "2", "-ar", "22050", filePath};

           execFFmpegBinary(complexCommand);
           MediaScannerConnection.scanFile(VideoCutterActivity.this,
                   new String[] { Environment.getExternalStorageDirectory().toString() },
                   null,
                   new MediaScannerConnection.OnScanCompletedListener() {

                       public void onScanCompleted(String path, Uri uri) {

                           Log.i("ExternalStorage", "Scanned " + path + ":");
                           Log.i("ExternalStorage", "-> uri=" + uri);
                       }
                   });

       }

    I just to show the edited video in phone gallery. I don’t know what to do now. Help is much is appreciated

  • Detect Windows Phone 8 in Desktop mode to filter out false positives for file upload support.

    18 juillet 2013, par blueimp
    Detect Windows Phone 8 in Desktop mode to filter out false positives for file upload support.
    

    Thanks to Achim Stöhr for the findings.

  • Are there any libraries on adding effect to audio, like phone, inner monologue, or sounds like a man/woman ? [closed]

    6 mars, par Mathew

    I'm trying to apply different audio effects, such as making audio sound like a phone call. Below is my current approach. As you can see, I'm using multiple filters and simple algorithms to achieve this effect, but the output quality isn't ideal.

    


    Since I need to implement many sound effects/filters, are there any ready-to-use libraries that could help ?

    


    I've looked into FFmpeg filters and noticed mentions of LADSPA/LV2 plugins. Are these viable solutions ? Any other suggestions would be greatly appreciated.

    


    public static void applySceneEffect(String inputPath, String outputPath, int sceneType) {
    LOGGER.info("apply scene effect {} to {}", sceneType, inputPath);

    try (FFmpegFrameGrabber grabber = new FFmpegFrameGrabber(inputPath);
         FFmpegFrameRecorder recorder = new FFmpegFrameRecorder(outputPath, grabber.getAudioChannels())) {

        grabber.setOption("vn", ""); 
        grabber.start();

       
        recorder.setAudioCodec(avcodec.AV_CODEC_ID_PCM_S16LE); 
        recorder.setSampleRate(grabber.getSampleRate());
        recorder.setAudioChannels(grabber.getAudioChannels());
        recorder.setAudioBitrate(grabber.getAudioBitrate());
        recorder.setFormat("wav"); 


        String audioFilter = String.join(",",
                "aresample=8000",      
                "highpass=f=300, lowpass=f=3400",       
                "acompressor=threshold=-15dB:ratio=4:attack=10:release=100", 
                "volume=1.5",          
                "aecho=0.9:0.4:10:0.6"
        );

        FFmpegFrameFilter f1 = new FFmpegFrameFilter(audioFilter, grabber.getAudioChannels());
        f1.setSampleRate(grabber.getSampleRate());
        f1.start();

        recorder.start();

        Random random = new Random();
        double noiseLevel = 0.02; 

   
        while (true) {
            var frame = grabber.grabFrame(true, false, true, true);
            if (frame == null) {
                break;
            }

            ShortBuffer audioBuffer = (ShortBuffer) frame.samples[0];
            short[] audioData = new short[audioBuffer.remaining()];
            audioBuffer.get(audioData);

            applyElectricNoise(audioData, grabber.getSampleRate());

            audioData = applyDistortion(audioData, 1.5, 30000);

            audioBuffer.rewind();
            audioBuffer.put(audioData);
            audioBuffer.flip();


            f1.push(frame); 
            Frame filteredFrame;
            while ((filteredFrame = f1.pull()) != null) {
                recorder.record(filteredFrame); 
            }
        }

        recorder.stop();
        recorder.release();
        grabber.stop();
        grabber.release();
    } catch (FrameGrabber.Exception | FrameRecorder.Exception | FFmpegFrameFilter.Exception e) {
        throw new RuntimeException(e);
    }
}


private static final double NOISE_LEVEL = 0.005; 
private static final int NOISE_FREQUENCY = 60;  

public static void applyElectricNoise(short[] audioData, int sampleRate) {
    Random random = new Random();

    
    for (int i = 0; i < audioData.length; i++) {
        double noise = Math.sin(2 * Math.PI * NOISE_FREQUENCY * i / sampleRate);

        double electricNoise = random.nextGaussian() * NOISE_LEVEL * Short.MAX_VALUE + noise;

        audioData[i] = (short) Math.max(Math.min(audioData[i] + electricNoise, Short.MAX_VALUE), Short.MIN_VALUE); 
    }
}

public static short[] applyTremolo(short[] audioData, int sampleRate, double frequency, double depth) {
    double phase = 0.0;
    double phaseIncrement = 2 * Math.PI * frequency / sampleRate;

    for (int i = 0; i < audioData.length; i++) {
        double modulator = 1.0 - depth + depth * Math.sin(phase); 
        audioData[i] = (short) (audioData[i] * modulator);

        phase += phaseIncrement;
        if (phase > 2 * Math.PI) {
            phase -= 2 * Math.PI;
        }
    }
    return audioData;
}

public static short[] applyDistortion(short[] audioData, double gain, double threshold) {
    for (int i = 0; i < audioData.length; i++) {
        double sample = audioData[i] * gain;

        if (sample > threshold) {
            sample = threshold;
        } else if (sample < -threshold) {
            sample = -threshold;
        }

        audioData[i] = (short) sample;
    }
    return audioData;
}