Recherche avancée

Médias (1)

Mot : - Tags -/copyleft

Autres articles (83)

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

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

Sur d’autres sites (9045)

  • demucs.api or demucs.pretrained aren't working

    9 décembre 2023, par user22801597

    I created my environment and installed several packages for CUDA 11.8.0 (including demucs, pytorch, torchaudio, ffmpeg...). I want to separate a track with demucs with a python code in spyder (i don't want to do it on the anaconda prompt) however I've tried several codes and they seem not be working. I get errors like :

    


      

    • AttributeError : module 'demucs' has no attribute 'Separator' (1)
    • 


    • ImportError : cannot import name 'load_pretrained' from 'demucs.pretrained' (2) (C :\Users\User\anaconda3\envs\Pytorch\Lib\site-packages\demucs\pretrained.py)
    • 


    • ModuleNotFoundError : No module named 'demucs.api' (3)
    • 


    • ModuleNotFoundError : No module named 'demucs.model'(4)
    • 


    


    So through the errors I assume my demucs package isn't working correctly but I don't know why. I've done the following (I'Ve found this either in google or in chatgpt) :

    


      

    • Checked Library Versions
    • 


    • Upgraded demucs and other packages
-deinstalled and reinstalled it
Can someone please help me to solve this ? What am I doing worng or why is demucs not working correctly ?
    • 


    


    This are the different codes I tested according to their errors above :

    


    (1)

    


       import demucs
   separator = demucs.Separator()
   model = demucs.load_pretrained('demucs')
   audio_sources = separator.separate('Zweite_Aufnahme_mit_Piano.wav')
   for source_name, source_audio in audio_sources.items():
       source_audio.to_file(source_name + '.wav')



    


    (2)

    


       import torchaudio
   from demucs.pretrained import load_pretrained
   import soundfile as sf
   import os

   input_audio_file = 'Zweite_Aufnahme_mit_Piano.wav'
   output_directory = 'Separated_audios'

   model = load_pretrained('demucs_quantized')

   audio, _ = torchaudio.load(input_audio_file)

   sources = model(audio)

   os.makedirs(output_directory, exist_ok=True)

   for i, source in enumerate(sources):
       source_path = os.path.join(output_directory, f'source_{i}.wav')
       sf.write(source_path, source[0].numpy(), 44100)

   print("Source separation complete. Separated sources saved in the output directory.")



    


    (3)

    


       from pydub import AudioSegment
   import IPython
   import numpy as np
   import demucs.api
   import pathlib
   import torch

   audiosegment = AudioSegment.from_mp3("Zweite_Aufnahme_mit_Piano.wav")
   arr = audiosegment.get_array_of_samples()
   sr = audiosegment.frame_rate
   ch = audiosegment.channels
   aac = np.array(arr, dtype=np.float32).reshape((-1, ch))
   aac = aac[30*sr:40*sr,:]
   IPython.display.Audio(aac[:, 0], rate=sr)

   separator = demucs.api.Separator()
   model = separator.load_model()
   input = torch.from_numpy(aac.reshape((ch, -1)))
   separator.add_track("born", input)
   separated = separator.separate_loaded_audio()
   for (file, stems) in separated:
       for stem, waveform in stems.items():
         print(stem)
         print(waveform.shape)
         aac_again = waveform.numpy().reshape((-1, ch))
         IPython.display.display(IPython.display.Audio(aac_again[:,0], rate=sr))



    


    (4)

    


       import torchaudio
   from demucs.model import load_pretrained

   audio, sample_rate = torchaudio.load('Zweite_Aufnahme_mit_Piano.wav')
   model = load_pretrained('demucs')
   separated_sources = model(audio)
   torchaudio.save('vocals.wav', separated_sources['vocals'], sample_rate)
   torchaudio.save('accompaniment.wav', separated_sources['accompaniment'], sample_rate)
   torchaudio.save('drums.wav', separated_sources['drums'], sample_rate)
   torchaudio.save('bass.wav', separated_sources['bass'], sample_rate)


    


  • How to insert bullet screen comments into a video by using ffmpeg ?

    7 septembre 2019, par Saeron Meng

    I would like to add some real-time comments in my video but I do not know how to use ffmpeg to realize this. The comments are like screen bullets through the screen, scrolling from right to left.

    My thought is to count the length of the comments and define speeds for them to move. Don’t worry about the source of the comments, I have already gotten them saved as an xml file. Also, I can transfer it into srt. For instance :

    <chat timestamp="671.195">
       <ems utctime="1562584080" sender="Bill">
           <richtext></richtext>
       </ems>
    </chat>
    <chat timestamp="677.798">
       <ems utctime="1562584086" sender="Jack">
           <richtext></richtext>
       </ems>
    </chat>

    The final result is like this (I did not find an example displayed in English), these fancy characters can move horizontally :

    example

    I have searched some solutions on the Internet, most of which talk about how to write ass/srt files and add motionless subtitles. Like this :

    3
    00:00:39,770 --> 00:00:41,880
    When I was lying there in the VA hospital ...

    4
    00:00:42,550 --> 00:00:44,690
    ... with a big hole blown through the middle of my life,

    5
    00:00:45,590 --> 00:00:48,120
    ... I started having these dreams of flying.

    ffmpeg -i infile.mp4 -i infile.srt -c copy -c:s mov_text outfile.mp4

    But I need another kind of "subtitles" which can move.

    So my question is, how to modify the ffmpeg command and the template of srt file so as to arrange the subtitles from the top to the bottom and let them move from right to left ?

  • Evolution #4754 : Mettre à jeu le jeu des icônes de extensions

    30 avril 2021, par b b