Recherche avancée

Médias (9)

Mot : - Tags -/soundtrack

Autres articles (90)

  • 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

  • MediaSPIP Player : problèmes potentiels

    22 février 2011, par

    Le lecteur ne fonctionne pas sur Internet Explorer
    Sur Internet Explorer (8 et 7 au moins), le plugin utilise le lecteur Flash flowplayer pour lire vidéos et son. Si le lecteur ne semble pas fonctionner, cela peut venir de la configuration du mod_deflate d’Apache.
    Si dans la configuration de ce module Apache vous avez une ligne qui ressemble à la suivante, essayez de la supprimer ou de la commenter pour voir si le lecteur fonctionne correctement : /** * GeSHi (C) 2004 - 2007 Nigel McNie, (...)

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

Sur d’autres sites (9161)

  • Video fingerprinting not working for the video

    2 septembre 2024, par Veer Pratap

    I implemented video fingerprinting, and it works well when the videos are exactly the same, producing a similarity score of 1. However, I encounter an issue when comparing videos that have been merged in different orders. For instance, if I merge video1 and video2 to create a new video and then merge them in reverse order (video2 + video1), the system fails to detect any matching frames between the two resulting videos.

    


    The challenge lies in comparing frames between videos regardless of their timing or order. How can I modify the comparison process to ensure that frames are matched correctly even when the order of video segments changes ?

    


    use ffmpeg_next::{codec, format, frame, media, packet, Error};&#xA;use sha2::{Digest, Sha256};&#xA;use std::collections::HashSet;&#xA;&#xA;pub fn extract_frames(video_path: &amp;str) -> Result>, Error> {&#xA;    ffmpeg_next::init()?;&#xA;    let mut ictx = format::input(&amp;video_path)?;&#xA;    let input_stream_index = ictx&#xA;        .streams()&#xA;        .best(media::Type::Video)&#xA;        .ok_or(Error::StreamNotFound)?&#xA;        .index();&#xA;    let codec_params = ictx&#xA;        .stream(input_stream_index)&#xA;        .ok_or(Error::StreamNotFound)?&#xA;        .parameters();&#xA;    let codec = codec::Id::from(codec_params.id());&#xA;    let mut decoder = codec::Context::from_parameters(codec_params)?&#xA;        .decoder()&#xA;        .video()?;&#xA;    let mut frame = frame::Video::empty();&#xA;    let mut frames = Vec::new();&#xA;    let mut packet_count = 0;&#xA;    let mut frame_count = 0;&#xA;&#xA;    for (stream, packet) in ictx.packets() {&#xA;        packet_count &#x2B;= 1;&#xA;        if stream.index() == input_stream_index {&#xA;            decoder.send_packet(&amp;packet)?;&#xA;            while let Ok(()) = decoder.receive_frame(&amp;mut frame) {&#xA;                let frame_data = frame.data(0).to_vec();&#xA;                frames.push(frame_data);&#xA;                frame_count &#x2B;= 1;&#xA;                eprintln!("Extracted frame {}", frame_count);&#xA;            }&#xA;        }&#xA;    }&#xA;    eprintln!(&#xA;        "Processed {} packets and extracted {} frames",&#xA;        packet_count, frame_count&#xA;    );&#xA;    Ok(frames)&#xA;}&#xA;&#xA;pub fn hash_frame(frame: &amp;[u8]) -> Vec<u8> {&#xA;    let mut hasher = Sha256::new();&#xA;    hasher.update(frame);&#xA;    hasher.finalize().to_vec()&#xA;}&#xA;&#xA;/// Generates a vector of fingerprints for the given video frames.&#xA;///&#xA;/// This function takes a vector of frames (each represented as a vector of bytes)&#xA;/// and generates a fingerprint for each frame using the SHA-256 hash function.&#xA;///&#xA;/// # Arguments&#xA;///&#xA;/// * `frames` - A vector of video frames, where each frame is a `Vec<u8>` representing the frame&#x27;s raw data.&#xA;///&#xA;/// # Returns&#xA;///&#xA;/// * `Vec>` - A vector of fingerprints, where each fingerprint is a `Vec<u8>` representing the SHA-256 hash of the corresponding frame.&#xA;pub fn generate_fingerprints(frames: Vec>) -> Vec> {&#xA;    frames.into_iter().map(|frame| hash_frame(&amp;frame)).collect()&#xA;}&#xA;&#xA;/// Compares two videos by extracting frames and generating fingerprints, then computing the similarity between the two sets of fingerprints.&#xA;///&#xA;/// This function extracts frames from the two provided video files, generates fingerprints for each frame,&#xA;/// and compares the fingerprints to determine the similarity between the two videos.&#xA;///&#xA;/// # Arguments&#xA;///&#xA;/// * `video_path1` - A string slice that holds the path to the first video file.&#xA;/// * `video_path2` - A string slice that holds the path to the second video file.&#xA;///&#xA;/// # Returns&#xA;///&#xA;/// * `Result>` - The similarity score between the two videos as a floating-point value (0.0 to 1.0).&#xA;///    Returns an error if there is an issue with extracting frames or generating fingerprints.&#xA;///&#xA;/// # Errors&#xA;///&#xA;/// This function will return an error if:&#xA;/// * There is an issue with opening or reading the video files.&#xA;/// * There is an issue with extracting frames from the video files.&#xA;/// * There is an issue with generating fingerprints from the frames.&#xA;pub fn compare_videos(&#xA;    video_path1: &amp;str,&#xA;    video_path2: &amp;str,&#xA;) -> Result> {&#xA;    println!("Comparing videos: {} and {}", video_path1, video_path2);&#xA;    let frames1 = extract_frames(video_path1)?;&#xA;    let frames2 = extract_frames(video_path2)?;&#xA;&#xA;    let fingerprints1: HashSet&lt;_> = generate_fingerprints(frames1).into_iter().collect();&#xA;    let fingerprints2: HashSet&lt;_> = generate_fingerprints(frames2).into_iter().collect();&#xA;&#xA;    println!("Number of fingerprints in video 1: {}", fingerprints1.len());&#xA;    println!("Number of fingerprints in video 2: {}", fingerprints2.len());&#xA;&#xA;    if !fingerprints1.is_empty() &amp;&amp; !fingerprints2.is_empty() {&#xA;        println!(&#xA;            "Sample fingerprint from video 1: {:?}",&#xA;            fingerprints1.iter().take(1).collect::>()&#xA;        );&#xA;        println!(&#xA;            "Sample fingerprint from video 2: {:?}",&#xA;            fingerprints2.iter().take(1).collect::>()&#xA;        );&#xA;    }&#xA;&#xA;    // Calculate Jaccard similarity&#xA;    let intersection_size = fingerprints1.intersection(&amp;fingerprints2).count();&#xA;    let union_size = fingerprints1.union(&amp;fingerprints2).count();&#xA;&#xA;    println!("Intersection size: {}", intersection_size);&#xA;    println!("Union size: {}", union_size);&#xA;&#xA;    let similarity = if union_size == 0 {&#xA;        0.0&#xA;    } else {&#xA;        intersection_size as f64 / union_size as f64&#xA;    };&#xA;&#xA;    println!("Similarity score: {}", similarity);&#xA;&#xA;    Ok(similarity)&#xA;}&#xA;&#xA;</u8></u8></u8>

    &#xA;

  • Batch processing removal of closed captions in video files with ffmpeg [closed]

    3 octobre 2024, par user27616468

    I am trying to find an easier way of removing closed captions with ffmpeg from a lot of files, so far I have been using this and copy pasting file names in

    &#xA;

    "C :\ffmpeg\bin\ffmpeg.exe" -i "E :\Videos.mkv" -bsf:v "filter_units=remove_types=6" -c copy "E :.mkv"

    &#xA;

    Is there some way to make it do all files within the initial folder so I don't have to do each file name ?

    &#xA;

    I have seen similar inquiries in regards to closed captions from 10+ years ago on this site but after a bit of using the search feature could not find anything that may relate to my specific need.

    &#xA;

    This kind of thing is all new to me and there was a way to batch remove video titles easily but no idea how I would go about figuring the above out.

    &#xA;

    Thank you for taking the time to read through my jibber jabba.

    &#xA;

    This section is not currently applicable.

    &#xA;

    I did see this thread but it is for subtitles and not closed captions and unfortunately with my limited knowledge I don't understand it.

    &#xA;

    FFmpeg remove subtitles from file "if exists"

    &#xA;

  • How to accurately detect the start of the main beat and soundtracks in diverse audio tracks ?

    18 juin 2024, par SnoofFloof

    I'm working on a project where I need to edit soundtracks. The challenge is to detect when the main beat and melody of any given soundtrack is properly developed. I am certain there is better terminology to describe what I am aiming for, but ideally, I want to skip the "build-up" and immediately have the song starting at the "main part". This needs to work for various songs across different genres, which often have different structures and onset patterns, making it difficult to streamline the process.

    &#xA;

    For example :

    &#xA;

    https://www.youtube.com/watch?v=P77CNtHrnmI -> I would want to my code to identify the onset at 0:24

    &#xA;

    https://www.youtube.com/watch?v=OOsPCR8SyRo -> Onset detection at 0:12

    &#xA;

    https://www.youtube.com/watch?v=XKiZBlelIzc -> Onset detection at 0:19

    &#xA;

    I've tried using librosa to analyze the onset strength and detect beats, but the current implementation either detects the very beginning of the song or fails to consistently identify when the beat is fully developed.

    &#xA;

    This was my approach ;

    &#xA;

    def analyze_and_edit_audio(input_file, output_file):&#xA;    y, sr = librosa.load(input_file)&#xA;    tempo, beat_frames = librosa.beat.beat_track(y=y, sr=sr)&#xA;    beat_times = librosa.frames_to_time(beat_frames, sr=sr)&#xA;    main_beat_start = beat_times[0]&#xA;

    &#xA;

    I have very little experience with librosa/audio editing, so I would appreciate any suggestions you might have !

    &#xA;