Recherche avancée

Médias (0)

Mot : - Tags -/metadatas

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

Autres articles (96)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

  • Configuration spécifique d’Apache

    4 février 2011, par

    Modules spécifiques
    Pour la configuration d’Apache, il est conseillé d’activer certains modules non spécifiques à MediaSPIP, mais permettant d’améliorer les performances : mod_deflate et mod_headers pour compresser automatiquement via Apache les pages. Cf ce tutoriel ; mode_expires pour gérer correctement l’expiration des hits. Cf ce tutoriel ;
    Il est également conseillé d’ajouter la prise en charge par apache du mime-type pour les fichiers WebM comme indiqué dans ce tutoriel.
    Création d’un (...)

  • Librairies et logiciels spécifiques aux médias

    10 décembre 2010, par

    Pour un fonctionnement correct et optimal, plusieurs choses sont à prendre en considération.
    Il est important, après avoir installé apache2, mysql et php5, d’installer d’autres logiciels nécessaires dont les installations sont décrites dans les liens afférants. Un ensemble de librairies multimedias (x264, libtheora, libvpx) utilisées pour l’encodage et le décodage des vidéos et sons afin de supporter le plus grand nombre de fichiers possibles. Cf. : ce tutoriel ; FFMpeg avec le maximum de décodeurs et (...)

Sur d’autres sites (10206)

  • How do I change the speed of an audio file in Python, like in Audacity, without quality loss ?

    23 août 2023, par Somnia Quia

    I'm building a simple Python application that involves altering the speed of an audio track.
(I acknowledge that changing the framerate of an audio also make pitch appear different, and I do not care about pitch of the audio being altered).
I have tried using solution from abhi krishnan using pydub, which looks like this.

    


    from pydub import AudioSegment
sound = AudioSegment.from_file(…)

def speed_change(sound, speed=1.0):
    # Manually override the frame_rate. This tells the computer how many
    # samples to play per second
    sound_with_altered_frame_rate = sound._spawn(sound.raw_data, overrides={
         "frame_rate": int(sound.frame_rate * speed)
      })
     # convert the sound with altered frame rate to a standard frame rate
     # so that regular playback programs will work right. They often only
     # know how to play audio at standard frame rate (like 44.1k)
    return sound_with_altered_frame_rate.set_frame_rate(sound.frame_rate)


    


    However, the audio with changed speed sounds distorted, or crackled, which would not be heard with using Audacity to do the same, and I hope I find out a way to reproduce in Python how Audacity (or other digital audio editors) changes the speed of audio tracks.

    


    I presume that the quality loss is caused by the original audio having low framerate, which is 8kHz, and that .set_frame_rate(sound.frame_rate) tries to sample points of the audio with altered speed in the original, low framerate. Simple attempts of setting the framerate of the original audio or the one with altered framerate, and the one that were to be exported didn't work out.

    


    Is there a way in Pydub or in other Python modules that perform the task in the same way Audacity does ?

    


  • avcodec/pngenc : support writing iCCP chunks

    11 mars 2022, par Niklas Haas
    avcodec/pngenc : support writing iCCP chunks
    

    We re-use the PNGEncContext.zstream for deflate-related operations.
    Other than that, the code is pretty straightforward. Special care needs
    to be taken to avoid writing more than 79 characters of the profile
    description (the maximum supported).

    To write the (dynamically sized) deflate-encoded data, we allocate extra
    space in the packet and use that directly as a scratch buffer. Modify
    png_write_chunk slightly to allow pre-writing the chunk contents like
    this.

    Also add a FATE transcode test to ensure that the ICC profile gets
    encoded correctly.

    Signed-off-by : Niklas Haas <git@haasn.dev>

    • [DH] libavcodec/pngenc.c
    • [DH] tests/fate/image.mak
    • [DH] tests/ref/fate/png-icc
  • Suppress subprocess console output in a python windowed (Tkinter) app

    16 juin 2017, par Eliad Cohen

    I am attempting to run the following code in a python app executable made using

    pyinstaller -w -F script.py

     :

    def ffmpeg_command(sec):
       cmd1 = ['ffmpeg', '-f','gdigrab','-framerate',config.get('FFMPEG_Settings','Framerate'),'-i','desktop',gen_filename_from_timestamp_and_extension()]


       proc = subprocess.Popen(cmd1,stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)

       duration = sec
       sleeptime = 0
       while proc.poll() is None and sleeptime &lt; duration:
           # Wait for the specific duration or for the process to finish
           time.sleep(1)
           sleeptime += 1

       proc.terminate()

    The above code is run when a Tkinter button is pressed and this code is called from the button click handler.

    My problem is that when I am running the exe this doesn’t run ffmpeg.
    However, If I set the command to be :

    proc = subprocess.Popen(cmd1)

    FFMPEG does run, I get the movie file I wanted but I can see the console window for FFMPEG. So I end up getting the console window in my movie.
    (I take care of minimizing the Tkinter window in the button click handler)

    My question is how do I suppress the console window and still have FFMPEG run the way I want it to ?
    I looked at the following threads but couldn’t make it work :
    How to hide output of subprocess in Python 2.7,
    Open a program with python minimized or hidden

    Thank you