Recherche avancée

Médias (1)

Mot : - Tags -/getid3

Autres articles (107)

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

  • Contribute to documentation

    13 avril 2011

    Documentation is vital to the development of improved technical capabilities.
    MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
    To contribute, register to the project users’ mailing (...)

Sur d’autres sites (6259)

  • how to add effect to audio, sound like a phone call phone, inner monologue, or sounds like a man/woman ? [closed]

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

    


    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;
}


    


  • hwcontext_vulkan : fix downloads ; use the common host map function to map frame data

    13 mars, par Lynne
    hwcontext_vulkan : fix downloads ; use the common host map function to map frame data
    

    This commit uses the recently exported code for host mapping images back
    where it was exported from.

    The function also had broken download code for image downloading since its
    recent refactor.

    • [DH] libavutil/hwcontext_vulkan.c
  • Extract thumbnail from video in amazon s3 and store it in amazon s3 [closed]

    24 juin 2021, par Kanav Raina

    I want to extract thumbnail from video and store it on s3.

    


    import ffmpeg

url="https://link_to_s3_video.mp4"

(
    ffmpeg
    .input(url, ss='00:00:03')  
    .output("frame.png", pix_fmt='rgb24', frames='1')  
    .overwrite_output()
    .run()
)


    


    I am able to extract image but now how should I pass this image to file_upload function and store it on s3

    


    def file_upload(file, filename):
    link = f"https://{PUBLIC_BUCKET_NAME}.s3.us-east-2.amazonaws.com/images/{filename}"
    try:
        s3.Object(PUBLIC_BUCKET_NAME, f"images/{filename}").load()
    except ClientError as e:
        if e.response['Error']['Code'] == "404":
            try:
                s3_client.upload_fileobj(
                    file,
                    PUBLIC_BUCKET_NAME,
                    f"images/{filename}",
                    ExtraArgs={'ACL': 'public-read'}
                )

                return 200, link
            except ClientError as e:
                logging.error(e)
                return 500, ""
        else:
            return 500, ""
    else:
        return 409, link


    


    Thanks