Recherche avancée

Médias (1)

Mot : - Tags -/artwork

Autres articles (67)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

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

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

Sur d’autres sites (9446)

  • ffmpeg convert wav to mp3 using php variable

    17 janvier 2016, par Jeff

    I am working on a php function to upload a .wav and also create an .mp3 version of it in the same folder. So far everything is working how it should except for when I try using :

    shell_exec('ffmpeg -i ' . $file_path . '-f mp2 ' . $mp3name);

    within the function it isn’t creating the .mp3 in the beats folder.

    I tried

    shell_exec('ffmpeg -i test.wav -f mp2 test.mp3');

    on its own and it worked great.

    php Function :

    function upload_a_sound($user_id, $file_temp, $file_extn, $name, $uploader, $keywords) {
       $timecode = substr(md5(time()), 0, 10);
       $mp3name = 'beats/' . $timecode . '.mp3';
       $file_path = 'beats/' . $timecode . '.' . $file_extn;
       //$date = date('m-d-Y');
       move_uploaded_file($file_temp, $file_path);
       shell_exec('ffmpeg -i ' . $file_path . '-f mp2 ' . $mp3name);
       require ('classAudioFile.php');
       $AF = new AudioFile;
       $AF->loadFile($file_path);
       $AF->visual_width=200;
       $AF->visual_height=200;
       $AF->visual_graph_color="#c491db";
       $AF->visual_background_color="#000000";
       $AF->visual_grid=false;
       $AF->visual_border=false;
       $AF->visual_graph_mode=0;
       $AF->getVisualization ('images/song/' . $timecode . '.png');
       $imageloc = 'images/song/' . $timecode . '.png';
       mysql_query("INSERT INTO `content` VALUES ('', '', '$name', '$uploader', '$keywords', '$file_path', '$imageloc', '$mp3name')");

    }
  • Mimic Audacity amplification with Pydub

    16 août 2022, par Unisionzz

    For my music library I have used Audacity for recent years to amplify the music to similar levels of loudness ; technically speaking this is not completely true, but for me it is sufficient. However, as it is tedious to do this all by hand, I decided to write a Python code to automate this process for me. The code after the imported package(s) and defined functions will run in a loop in which the filename changes depending on which song is processed.

    


    The difficult part is that I have not yet been able to find a consistent way to amplify different songs so that when the output files are put through Audacity, it will not want to change the amplitude by more than 0.1 dB(FS).

    


    Below are two attempts which seem to have come closest to the desirable output ; other methods that I have tried were either less succesfull or resulted in clipping.

    


    The first attempt finds the maximum dBFS of the song and then applies a gain in order for the maximum dBFS to equal 0 (I have also tried this method with sound.dBFS and sound.apply_gain, but results seem more mixed than the attempt below) :

    


    from pydub import AudioSegment

def change_amplitude(sound, target_dBFS):
    change_in_dBFS = target_dBFS - sound.max_dBFS
    return sound.apply_gain_stereo(change_in_dBFS)

# Audio is gathered from a hard coded path
s = AudioSegment.from_file(Dir+filename+".mp3", "mp3")
amp_s = change_amplitude(s, 0)
amp_s.export(Dir+filename+".mp3", format = "mp3")


    


    The second attempt finds the amplitude and the maximum allowable amplitude (before clipping), recalculates both to dB and then adds the dB_diff to the sound :

    


    import numpy as np
from pydub import AudioSegment

s = AudioSegment.from_file(Dir+filename+".mp3", "mp3")

# Get dB amplitude of song and maximum allowable value
dB_sound = 20*np.log10(s.max)
dB_max = 20*np.log10(s.max_possible_amplitude)
dB_diff = dB_max - dB_sound

amp_sound = s + dB_diff


    


    Summarizing, I would like to import a music file, amplify it similar to Audacity amplification and then export the file again.

    


  • Trouble with converting webm into mp3 with pydub in python

    15 août 2020, par rc_marty

    so basically I want to convert song what I downloaded from youtube in webm and convert to into mp3

    


    when I wanted export song just with song.export("neco.mp3") it didn't work too

    


    I have in workfolder ffmpeg.exe and ffprobe.exe

    


    here is the code

    


    from pydub import AudioSegment

song = AudioSegment.from_file(downloaded.webm,"webm")
print("Loaded")
song.export("neco.mp3", format="mp3", bitrate="320k")
print("Converted and saved")


    


    here is the output of the console

    


    Loaded&#xA;Traceback (most recent call last):&#xA;  File "e:/martan/projekty/Python/programek na pisnicky/songDownloader.py", line 188, in <module>&#xA;    song.export("neco.mp3", format="mp3", bitrate="320k")&#xA;  File "C:\Users\BIBRAIN\AppData\Local\Programs\Python\Python38\lib\site-packages\pydub\audio_segment.py", line 911, in export&#xA;    raise CouldntEncodeError(&#xA;pydub.exceptions.CouldntEncodeError: Encoding failed. ffmpeg/avlib returned error code: 1&#xA;&#xA;Command:[&#x27;ffmpeg&#x27;, &#x27;-y&#x27;, &#x27;-f&#x27;, &#x27;wav&#x27;, &#x27;-i&#x27;, &#x27;C:\\Users\\BIBRAIN\\AppData\\Local\\Temp\\tmpo20ooz_z&#x27;, &#x27;-b:a&#x27;, &#x27;320k&#x27;, &#x27;-f&#x27;, &#x27;mp3&#x27;, &#x27;C:\\Users\\BIBRAIN\\AppData\\Local\\Temp\\tmpiqpl57g7&#x27;]&#xA;&#xA;Output from ffmpeg/avlib:&#xA;&#xA;ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers&#xA;  built with gcc 10.2.1 (GCC) 20200726&#xA;  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf&#xA;  libavutil      56. 51.100 / 56. 51.100&#xA;  libavcodec     58. 91.100 / 58. 91.100&#xA;  libavformat    58. 45.100 / 58. 45.100&#xA;  libavdevice    58. 10.100 / 58. 10.100&#xA;  libavfilter     7. 85.100 /  7. 85.100&#xA;  libswscale      5.  7.100 /  5.  7.100&#xA;  libswresample   3.  7.100 /  3.  7.100&#xA;  libpostproc    55.  7.100 / 55.  7.100&#xA;Guessed Channel Layout for Input Stream #0.0 : stereo&#xA;Input #0, wav, from &#x27;C:\Users\BIBRAIN\AppData\Local\Temp\tmpo20ooz_z&#x27;:&#xA;  Duration: 00:03:54.71, bitrate: 3072 kb/s&#xA;    Stream #0:0: Audio: pcm_s32le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s32, 3072 kb/s&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (pcm_s32le (native) -> mp3 (mp3_mf))&#xA;Press [q] to stop, [?] for help&#xA;[mp3_mf @ 00000000004686c0] could not find any MFT for the given media type&#xA;[mp3_mf @ 00000000004686c0] could not create MFT&#xA;Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height&#xA;Conversion failed!&#xA;</module>

    &#xA;

    I think it is something with codec but I have no idea what to do

    &#xA;