Recherche avancée

Médias (91)

Autres articles (99)

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

  • Revision 30797 : On passe en version 0.6 avec tout le code revu et plus ou moins corrigé

    10 août 2009, par kent1@… — Log

    On passe en version 0.6 avec tout le code revu et plus ou moins corrigé

  • Unable to convert mov to mp4 using ffmpeg carrierwave in ruby

    9 avril 2021, par LearningROR

    I am unable to convert MOV files to MP4 using carrierwave and FFmpeg.

    


    It does upload mp4 file but does not convert it to mp4 and so on browser only sound gets played not the video.

    


    What I am missing here ? I tried most of the solutions.

    


    Code :

    


    class VideoUploader < CarrierWave::Uploader::Base
  include CarrierWave::MiniMagick
  include CarrierWave::Video
  include CarrierWave::Video::Thumbnailer
  include CarrierWave::FFmpeg
  # Choose what kind of storage to use for this uploader:
  storage :file
  # Override the directory where uploaded files will be stored.
  # This is a sensible default for uploaders that are meant to be mounted:
  def store_dir
    "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
  end
  version :video, :if => :video? do
    process :encode
  end
  version :thumb do
    process thumbnail: [{format: 'jpg', quality: 8, size: 360, logger: Rails.logger, square: false}]
    def full_filename for_file
      jpg_name for_file, version_name
    end
  end
  def encode
    tmp_path = File.join( File.dirname(current_path), "tmpfile.mp4" )
    movie = FFMPEG::Movie.new(current_path)
    movie.transcode(tmp_path, custom: %w(-c:v libx264 -c:a aac -vf format=yuv420p -movflags +faststart)) do |progress|
      puts progress
    end
    File.rename tmp_path, current_path
  end
  protected
  def video?(new_file)
    new_file.content_type.include? 'video'
  end
end


    


    Logs :

    


    I, [2021-04-09T15:33:24.783337 #9397]  INFO -- : Running transcoding...
["/usr/local/bin/ffmpeg", "-y", "-i", "/Users/osx/workspace_ror/xxx-react/tmp/1617964403-459168728101935-0021-9213/video/sample_iTunes__1_.mov", "-c:v", "libx264", "-c:a", "aac", "-vf", "format=yuv420p", "-movflags", "+faststart", "/Users/osx/workspace_ror/xxx-react/tmp/1617964403-459168728101935-0021-9213/video/tmpfile.mp4"]

0.0
0.08304093567251461
0.1672514619883041
0.2327485380116959
0.3229239766081871
0.4008187134502924
0.45426900584795327
0.5033918128654971
0.5403508771929825
0.6100584795321637
0.663859649122807
0.711812865497076
0.7657309941520468
0.8196491228070175
0.87953216374269
0.9394152046783625
1.0
1.0
I, [2021-04-09T15:33:33.555508 #9397]  INFO -- : Transcoding of /Users/osx/workspace_ror/xxx-react/tmp/1617964403-459168728101935-0021-9213/video/sample_iTunes__1_.mov to /Users/osx/workspace_ror/xxx-react/tmp/1617964403-459168728101935-0021-9213/video/tmpfile.mp4 succeeded

Running....ffmpegthumbnailer -i /Users/osx/workspace_ror/xxx-react/tmp/1617964403-459168728101935-0021-9213/thumb/sample_iTunes__1_.mov -o /Users/osx/workspace_ror/xxx-react/tmp/1617964403-459168728101935-0021-9213/thumb/tmpfile.jpg -c jpg -q 8 -s 360
Success!


    


  • Audio extracted using ffmpeg giving nan and very low/high (2.6283893e-37) values

    17 février 2023, par Shreya Gupta

    I'm extracting raw audio from a .flac file(youtube link - https://youtu.be/—BfvyPmVMo , extracting 10sec from this) and storing it as np-array float32. Getting nan, and extremely low and high values = [-8.63468980e+30 -9.76911766e+34 -1.93298665e+37 -2.69400132e+38 .... 2.33467619e-38  5.71834450e-39  6.70703932e-38  7.58865403e-36].

    


    On this when I try to get melspectrogram then it gives an error -

    


    TypeError: array([nan, nan, nan, ..., nan, nan, nan], dtype=float32) has type numpy.ndarray, but expected one of: int, long, float


    


    To extract raw audio using(this is similar to what is done in dmvr lib, https://github.com/deepmind/dmvr/blob/master/examples/generate_from_file.py)

    


    cmd = (
      ffmpeg
      .input(video_path, ss=start, t=end-start)
      .output("pipe:", ac=1, ar=sampling_rate, format="s32le")
  )

  audio, _ = cmd.run(capture_stdout=True, quiet=True)

  audio = np.frombuffer(audio, np.float32) "


    


    To get melspectrogram -

    


    mel_spec = librosa.feature.melspectrogram(audio,sr=16000,hop_length=10,n_mels=128,window=25)


    


    Errors

    


    C:\Users\Shreya Gupta\IS-Project\generate_from_file.py:142: FutureWarning: Pass y=[-6.5381321e+37  1.5676004e-38  7.2428216e-37 ...  2.6283893e-37
  2.5346798e-36  1.9253581e-37] as keyword args. From version 0.10 passing these as positional arguments will result in an error
  mel_spec = librosa.feature.melspectrogram(audio,sr=16000,hop_length=10,n_mels=128,window=25)
C:\ProgramData\Anaconda3\lib\site-packages\librosa\core\spectrum.py:2563: RuntimeWarning: overflow encountered in absolute
  np.abs(
C:\ProgramData\Anaconda3\lib\site-packages\librosa\core\spectrum.py:2563: RuntimeWarning: overflow encountered in square
  np.abs().....
TypeError: array([nan, nan, nan, ..., nan, nan, nan], dtype=float32) has type numpy.ndarray, but expected one of: int, long, float


    


    Could someone please help, thank you !