Recherche avancée

Médias (2)

Mot : - Tags -/documentation

Autres articles (47)

  • MediaSPIP Core : La Configuration

    9 novembre 2010, par

    MediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
    Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...)

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

  • Participer à sa traduction

    10 avril 2011

    Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
    Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
    Actuellement MediaSPIP n’est disponible qu’en français et (...)

Sur d’autres sites (4426)

  • ffmpeg : Downmixing 5.1 to stereo with phase invert

    1er novembre 2022, par anti-hero

    I'd like to use ffmpeg and Dolby Logic Pro II formula to downmix a 5.1 song to stereo :

    


    


    Lt = L + (–3 dB × C) – (–1.2 dB × Ls) – (–6.2 dB × Rs)

    


    Rt = R + (–3 dB × C) + (–6.2 dB × Ls) + (–1.2 dB × Rs)

    


    


    I came up with this long and probably redundant bash script :

    


    # L channel
ffmpeg -i "$filename" -map_channel 0.1.0 -c:a pcm_f32le L.wav
ffmpeg -i "$filename" -map_channel 0.1.2 -filter:a "volume=-3dB" -c:a pcm_f32le C.wav
ffmpeg -i "$filename" -map_channel 0.1.4 -af "volume=-1.2dB" -c:a pcm_f32le Ls.wav
ffmpeg -i "$filename" -map_channel 0.1.5 -af "volume=-6.2dB" -c:a pcm_f32le Rs.wav
ffmpeg -i Ls.wav -af "aeval=-val(0)" -c:a pcm_f32le Lsi.wav
ffmpeg -i Rs.wav -af "aeval=-val(0)" -c:a pcm_f32le Rsi.wav
ffmpeg -i L.wav -i C.wav -i Lsi.wav -i Rsi.wav -filter_complex "amix=inputs=4" -c:a pcm_f32le L_final.wav
rm L.wav Ls.wav Rs.wav Lsi.wav Rsi.wav

# R channel
ffmpeg -i "$filename" -map_channel 0.1.1 -c:a pcm_f32le R.wav
ffmpeg -i "$filename" -map_channel 0.1.4 -filter:a "volume=-6.2dB" -c:a pcm_f32le Ls.wav
ffmpeg -i "$filename" -map_channel 0.1.5 -filter:a "volume=-1.2dB" -c:a pcm_f32le Rs.wav
ffmpeg -i R.wav -i C.wav -i Ls.wav -i Rs.wav -filter_complex "amix=inputs=4" -c:a pcm_f32le R_final.wav
rm R.wav C.wav Ls.wav Rs.wav

# Mix
ffmpeg -i L_final.wav -i R_final.wav -filter_complex "[0:0][1:0] amerge=inputs=2" -c:a pcm_f32le "${filename%.*}_dm.wav"
rm L_final.wav R_final.wav


    


    Would this work ? And is there a simpler way to do this ?

    


    update : I also wrote Python code for the 90 degree phase shift version.

    


    import scipy, os, numpy as np

os.system(f'ffmpeg -i "{filename}" -c:a pcm_f32le temp.wav')
sample_rate, waves = scipy.io.wavfile.read("temp.wav")
os.remove("temp.wav")

L, R, C, LFE, LS, RS = waves.T

LS_shifted = -np.imag(scipy.signal.hilbert(LS))
RS_shifted = np.imag(scipy.signal.hilbert(RS))
L_out = L + 0.708 * C - 0.871 * LS_shifted - 0.49 * RS_shifted
R_out = R + 0.708 * C + 0.49 * LS_shifted + 0.871 * RS_shifted

scipy.io.wavfile.write("out.wav", sample_rate, np.vstack((L_out, R_out)).T)


    


    Hope someone finds this useful ! (and that someone verifies it's correct)

    


  • Is there a way to (automatically) detect if the channels of a stereo video/audio are out of phase and canceling each other ?

    8 mars 2024, par Rhenan Bartels

    Background

    


    I've encountered an issue while attempting to convert an audio downloaded from a youtube video into a mono .wav format using ffmpeg. Despite using typical conversion commands (code below), the resulting audio is either silent or corrupted, indicating potential stereo channel cancellation.
I tried to load the audio into Python and calculate phase and cross-correlation, but this step uses a lot of memory, especially for a 6-hour-long audio.

    


    Goal

    


    I'm seeking a method, preferably using ffmpeg, to detect if stereo channels are canceling each other out due to phase misalignment. Additionally, I aim to automate the process of phase inversion before converting to mono to ensure the integrity of the resulting audio.

    


    Question :

    


    How can I automatically detect if stereo channels are canceling each other and subsequently invert the phase to ensure successful conversion to mono using ffmpeg ? Any insights, solutions, or alternative approaches would be greatly appreciated.

    


    Steps Taken :

    


      

    1. Downloaded audio from YouTube using yt-dlp.
    2. 


    3. Attempted audio conversion to mono using ffmpeg, resulting in silent or corrupted output.
    4. 


    5. Successfully converted audio to mono by manually inverting the phase of one channel prior to conversion.
    6. 


    


    Download audio from youtube

    


    yt-dlp -f bestaudio https://www.youtube.com/watch?v=s3QB_rJzH08 -o input.webm


    


    Audio conversion

    


    The resulting file is silent or corrupted

    


    ffmpeg -i input.webm  -ac 1 -ar 16000 -c:a pcm_s16le output.wav


    


    Audio conversion to mono .wav with phase inversion

    


    The resulting file has audio

    


    ffmpeg -i input.webm -af "aeval=val(0)|-val(1)" -ac 1 -ar 16000 -c:a pcm_s16le output.wav


    


  • Revision 17501 : only generate a random serial number for one stream, and increment it ...

    10 octobre 2010, par oggk — Log

    only generate a random serial number for one stream, and increment it for
    the subsequent streams, to avoid a possible (though unlikely) collision
    OK’d by j.