Recherche avancée

Médias (3)

Mot : - Tags -/collection

Autres articles (62)

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, 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 (...)

Sur d’autres sites (9462)

  • Video out of LinkedList sequence

    14 janvier 2020, par Marks Gniteckis

    I just started working on a side project to learn JavaFX 13 and the idea is to play a sequence of frames like a video without saving the actual video or frames in temp folders. I’d like to buffer images and output them onto ImageView at 30fps. Here is what I’ve got so far :

    The method that buffers images -

    @FXML void takeVideo(ActionEvent event)
               throws InterruptedException {
           model.purgeBufferedVideo();
           Timer timer = new Timer();
           long startedAt = System.currentTimeMillis();
           TimerTask task = new TimerTask() {
               @Override public void run() {
                   while (System.currentTimeMillis() < startedAt + (1000 * Long.parseLong(s.getText()))) {
                       generateVideo(new Rectangle(Toolkit.getDefaultToolkit()
                               .getScreenSize()));
                       System.out.println(System.currentTimeMillis() != startedAt + (1000 * Long
                               .parseLong(s.getText())));
                   }
                   cancel();
                   System.out.println("Video buffered");
               }
           };
           timer.schedule(task, 0L);
       }

    Method to output images onto ImageView -

    @FXML void playVideo(ActionEvent event) {
           model.getBufferedVideo().forEach(i -> {

               try {
                   preview.setImage(i);
                   Thread.sleep((60000 / Long.parseLong(s.getText()))/30);
                   preview.setImage(i);
               } catch (InterruptedException e) {
                   e.printStackTrace();
               }
           });
       }

    List population is working but only last image in the list is displayed in the ImageView and I can’t really get my head around why... Thanks in advance to everyone !

  • Paperclip Upload Video Without Styles

    16 mars 2017, par Moamen Naanou

    Background :

    In my app, there is a model has image attachment using paperclip gem, now as per new requirements, I have to let the same attachment accept MP4 video files as well and the only validation I have to implement is about file size.

    Product Model (with image attachment only) :

    class Product < ActiveRecord::Base
     has_attached_file :file,
                       :styles => { medium: '300x300>', thumb: '100x100>' },
                       :processors => [:thumbnail],
                       :url => '/assets/:id/:style/:hash.:extension',
                       :hash_digest=>'SHA1',
                       :use_timestamp => false


     validates_attachment_content_type :file, :content_type => /\A(image)\/.*\Z/
     validates_attachment_size :file, :less_than => 5.megabytes
    end

    So after reading many related questions, to accept a video file as well, I’ve used gem paperclip-av-transcoder and installed ffmpeg (Mac) using :

    brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libas

    Then finally I’ve revised my model to be :

    class Product < ActiveRecord::Base
     has_attached_file :file,
                       :styles => lambda {|file| if file.instance.is_image?
                                                   { medium: '300x300>', thumb: '100x100>' }
                                                 elsif file.instance.is_video?
                                                   {:thumb => { :geometry => "100x100#", :format => 'jpg', :time => 10}}
                                                 end },
                       :processors => lambda {|file| if file.is_image?
                                                       [:thumbnail]
                                                     elsif file.is_video?
                                                       [:transcoder]
                                                     end},
                       :url => '/assets/:id/:style/:hash.:extension',
                       :hash_digest=>'SHA1',
                       :use_timestamp => false


     validates_attachment_content_type :file, :content_type => /\A(image|video)\/.*\Z/
     validates_attachment_size :file, :less_than => 5.megabytes

     def is_video?
       file_content_type =~ %r(video)
     end

     def is_image?
       file_content_type =~ %r(image)
     end
    end

    Now the file field accepts both videos & images but the video shouldn’t be compressed, because if it is compressed, I will get IO Error [Closed Stream]

    Question :

    I’m expecting compressed MP4 file to be received from Mobile client(through REST API) and I don’t want to generate any thumb image or any other style or do any processing on this video and without installing any processor (ffmpeg in my case) and if I did so currently, I’m getting the following error because ImageMagic doesn’t work with video files :

    Paperclip::Errors::NotIdentifiedByImageMagickError

    Any ideas ?

  • Using dragonfly and ffmpeg to process a video in Rails

    26 novembre 2015, par Maikell

    I am writing a Ruby on Rails 4 Web application, that gives the user an image-upload functionality. For this I followed this tutorial, which is using the gems

    dragonfly
    jquery-fileupload-rails
    remotipart

    This is working fine.
    Now I want to extend the image-upload functionality, to upload videos as well. But unfortunately I’m stuck with it. Here is what I have tried so far :

    config/initializers/dragonfly.rb

    require 'dragonfly'

    # Configure
    Dragonfly.app.configure do
     plugin :imagemagick

     secret 'd045734b043b4383a246c5c8daf2d3e31217dc8b030f21861e4fd16c4b72d382'

     url_format '/media/:job/:name'

     datastore :file,
               root_path: Rails.root.join('uploads/images/'),
               server_root: Rails.root.join('uploads')
    end

    Dragonfly.app(:videos).configure do
     secret 'd045734b043b4383a246c5c8daf2d3e31217dc8b030f21861e4fd16c4b72d382'

     url_format "/media/:job/:name"

     datastore :file,
               root_path: Rails.root.join('uploads/videos/'),
               server_root: Rails.root.join('uploads')
    end

    # Logger
    Dragonfly.logger = Rails.logger

    # Mount as middleware
    Rails.application.middleware.use Dragonfly::Middleware

    # Add model functionality
    if defined?(ActiveRecord::Base)
     ActiveRecord::Base.extend Dragonfly::Model
     ActiveRecord::Base.extend Dragonfly::Model::Validations
    end

    models/video.rb

    class Video < ActiveRecord::Base
     dragonfly_accessor :video, app_name: :videos do
       storage_options do |video|
         { path: "videos/#{Video.gen_uuid}-#{video.name}.webm" }
       end
     end
    end

    I upload the video with ajax. It is succesfully saved in the systems /tmp-directory. Than in the video-controller I call

    @video = Video.new[video_params]
    @video.save

    Now the video-params are correctly saved in the database, but the video is not saved in the given directory /uploads/videos Also my goal is, to process the video with ffmpeg, to convert it to a webm. ffmpeg is installed in the system and converting a video on the command line works fine.

    • But how do I get dragonfly to start the conversion process and save the video in the rails project ? Where do I have to put the ffmpeg-commands to dragonfly ?
    • Why does dragonfly not save the video in the directory uploads/videos ?

    Everything works fine with images and imagemagick. Only videos are causing problems.