Recherche avancée

Médias (91)

Autres articles (67)

  • Installation en mode ferme

    4 février 2011, par

    Le mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
    C’est la méthode que nous utilisons sur cette même plateforme.
    L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
    Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)

  • Formulaire personnalisable

    21 juin 2013, par

    Cette page présente les champs disponibles dans le formulaire de publication d’un média et il indique les différents champs qu’on peut ajouter. Formulaire de création d’un Media
    Dans le cas d’un document de type média, les champs proposés par défaut sont : Texte Activer/Désactiver le forum ( on peut désactiver l’invite au commentaire pour chaque article ) Licence Ajout/suppression d’auteurs Tags
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire. (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

Sur d’autres sites (8757)

  • Transcode video using celery and ffmpeg in django

    28 octobre 2015, par Robin

    I would like to transcode user uploaded videos using celery. I think first I should upload the video, and spawn a celery task for transcoding.

    Maybe something like this in the tasks.py :

    subprocess.call('ffmpeg -i path/.../original path/.../output')

    Just completed First steps with celery, so confused how to do so in the views.py and tasks.py. Also is it a good solution ? I would really appreciate your help and advice. Thank you.

    models.py :

    class Video(models.Model):
       user = models.ForeignKey(User)
       title = models.CharField(max_length=100)
       original = models.FileField(upload_to=get_upload_file_name)
       mp4_480 = models.FileField(upload_to=get_upload_file_name, blank=True, null=True)
       mp4_720 = models.FileField(upload_to=get_upload_file_name, blank=True, null=True)
       privacy = models.CharField(max_length=1,choices=PRIVACY, default='F')
       pub_date = models.DateTimeField(auto_now_add=True, auto_now=False)

    my incomplete views.py :

    @login_required
    def upload_video(request):
       if request.method == 'POST':
           form = VideoForm(request.POST, request.FILES)
           if form.is_valid():
               if form.cleaned_data:
                   user = request.user
                   #
                   #
                   # No IDEA WHAT TO DO NEXT
                   #
                   #
                   return HttpResponseRedirect('/')

       else:
           form = VideoForm()
           return render(request, 'upload_video.html', {
               'form':form
               })
  • Processing files and then re-uploading with fog and carrierwave fails on production

    2 mars 2015, par Laurie

    So I’m trying to get use carrierwave and fog to upload a file to my server, processing that file using ffmpeg to cut it into multiple small files, then upload those to s3.

    This works locally (no fog, just file storage), but breaks on production with this error :

    NoMethodError: undefined method 'to_file' for #CarrierWave::Storage::Fog::File:0x0000000639a458>

    And this trace :

    /var/deploy/webapp/web_head/shared/bundle/ruby/2.2.0/gems/carrierwave-0.10.0/lib/carrierwave/storage/fog.rb 259:in `store'
    …gems/carrierwave-0.10.0/lib/carrierwave/storage/fog.rb:  80:in `store!'
    …s/carrierwave-0.10.0/lib/carrierwave/uploader/store.rb:  59:in `block in store!'
    …rrierwave-0.10.0/lib/carrierwave/uploader/callbacks.rb:  17:in `with_callbacks'
    …s/carrierwave-0.10.0/lib/carrierwave/uploader/store.rb:  58:in `store!'
    …2.2.0/gems/carrierwave-0.10.0/lib/carrierwave/mount.rb: 375:in `store!'
    …2.2.0/gems/carrierwave-0.10.0/lib/carrierwave/mount.rb: 207:in `store_audio!'
    …/20150227144932/app/controllers/podcasts_controller.rb:  60:in `update'
    …2.0/gems/actionview-4.2.0/lib/action_view/rendering.rb:  30:in `process'
    …_language-2.0.5/lib/http_accept_language/middleware.rb:  14:in `call'
    …red/bundle/ruby/2.2.0/gems/rack-1.6.0/lib/rack/etag.rb:  24:in `call'
    …/ruby/2.2.0/gems/rack-1.6.0/lib/rack/conditionalget.rb:  38:in `call'
    …red/bundle/ruby/2.2.0/gems/rack-1.6.0/lib/rack/head.rb:  13:in `call'
    …/2.2.0/gems/rack-1.6.0/lib/rack/session/abstract/id.rb: 225:in `context'
    …/2.2.0/gems/rack-1.6.0/lib/rack/session/abstract/id.rb: 220:in `call'

    So, I have two uploaders. The uploader for the small chopped up audio files just sets the storage to fog, that’s it.

    After uploading the big audio file I run this processing function in the uploader (though the error doesn’t seem to come from here) :

    def split
     directory = File.dirname(current_path)
     tmpfile = File.join(directory,'tmpfile.mp3')
     File.rename(current_path,tmpfile)
     File.chmod(0644,tmpfile)

     sound = FFMPEG::Movie.new(tmpfile)
     @model.length = Mp3Info.open(tmpfile).length.round


     i=0
     number_of_lines= @model.ordered_lines.length
     lines = @model.ordered_lines
     while icode>

    Any ideas ?

  • Error with IO.popen and ffmepg

    6 mars 2015, par Florian Dano Clement

    I received files in mp3 (2 minutes/files) I want to concatenate together and create a bigger file. So I created my model a function to do this using ffmpeg and IO.popen

    FileUtils.mkdir_p "#{Rails.root}/tmp/files"
    imported_dir = "#{Rails.root}/tmp/files/#{SecureRandom.uuid}"
    links.each_with_index do |link, index|
     file_path = "#{imported_dir}_#{index}#{File.extname(link)}"
     File.open(file_path, 'wb') do |file|
       file.write open(link).read
     end
     concat_list << "file '#{file_path}'\n"
    end
    File.open("#{imported_dir}.txt", 'w'){ |f| f.write(concat_list)}
    io = IO.popen("#{Rails.root}/lib/ffmpeg/ffmpeg -f concat -i #{imported_dir}.txt -c copy #{imported_dir}.mp3").readlines
    if sound = Sound.create(user_id: user.id, file: File.open("#{imported_dir}.mp3"), lang: lang, title: title)
     audio = FFMPEG::Movie.new("#{imported_dir}.mp3")
     if !audio.valid?
       puts "//_!_\\\\ Failed reading with ffmpeg (#{sound.id})#{sound.title} //_!_\\\\"
       return false
     end
    end

    the problem is that my .txt file containing the file path

    file '/home/test/apps/example/releases/20150305224026/tmp/files/4dbe9707-cfef-467b-ab2c-a5e1e1165953_0.mp3'

    created files as well but the final file is not created and i got the error message :

    No such file or directory @ rb_sysopen - /home/test/apps/example/releases/20150305224026/tmp/files/4dbe9707-cfef-467b-ab2c-a5e1e1165953.mp3

    If anyone could help me