Recherche avancée

Médias (1)

Mot : - Tags -/biographie

Autres articles (27)

  • D’autres logiciels intéressants

    12 avril 2011, par

    On ne revendique pas d’être les seuls à faire ce que l’on fait ... et on ne revendique surtout pas d’être les meilleurs non plus ... Ce que l’on fait, on essaie juste de le faire bien, et de mieux en mieux...
    La liste suivante correspond à des logiciels qui tendent peu ou prou à faire comme MediaSPIP ou que MediaSPIP tente peu ou prou à faire pareil, peu importe ...
    On ne les connais pas, on ne les a pas essayé, mais vous pouvez peut être y jeter un coup d’oeil.
    Videopress
    Site Internet : (...)

  • Librairies et binaires spécifiques au traitement vidéo et sonore

    31 janvier 2010, par

    Les logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
    Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
    Binaires complémentaires et facultatifs flvtool2 : (...)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

Sur d’autres sites (3073)

  • Paperclip with heroku and paperclip, migration fails

    2 décembre 2013, par jdartland

    I have a created ruby on rails application and I'm using paperclip to handle my file uploads.
    Paperclip works just fine on my local machine. But my video upload stops working when I deploy to Heroku. Does anyone know whats going wrong. I also get an error when I try to upload a video which says that the video filename does not exist. The photo upload works but not the Video, I'm using paperclip iwth nested attributes and ffmpeg.

    Upload Error log :

    Paperclip::Error (Asset model missing required attr_accessor for 'video_file_name')
    2013-12-02T14:38:16.867747+00:00 app[web.1]: Paperclip::Error (Asset model missing required attr_accessor for 'video_file_name'):
    2013-12-02T14:38:16.867747+00:00 app[web.1]:   app/controllers/projects_controller.rb:60:in `block in update'
    2013-12-02T14:38:16.867747+00:00 app[web.1]:   app/controllers/projects_controller.rb:59:in `update'

    Here is my migration error :

    Migrating to AddAttachmentPhotoToAssets (20131021134721)
    ==  AddAttachmentPhotoToAssets: migrating =====================================
    -- change_table(:assets)
      -> 0.0273s
    ==  AddAttachmentPhotoToAssets: migrated (0.0276s) ============================

    Migrating to AddProjectIdToAssets (20131022082744)
    -- add_column(:assets, :project_id, :integer)
    PG::DuplicateColumn: ERROR:  column "project_id" of relation "assets" already exists
    : ALTER TABLE "assets" ADD COLUMN "project_id" integer
    -- add_column(:assets, :project_id, :integer)
    PG::DuplicateColumn: ERROR:  column "project_id" of relation "assets" already exists
    : ALTER TABLE "assets" ADD COLUMN "project_id" integer
    rake aborted!
    PG::DuplicateColumn: ERROR:  column "project_id" of relation "assets" already exists
    : ALTER TABLE "assets" ADD COLUMN "project_id" integer
    /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql/database_statements.rb:128:in `exec'
    /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql/database_statements.rb:128:in `block in execute'
    /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract_adapter.rb:425:in `block in log'
    /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
    /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract_adapter.rb:420:in `log'
    /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql/database_statements.rb:127:in `execute'
    /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/schema_statements.rb:360:in `add_column'
    /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql/schema_statements.rb:379:in `add_column'
    /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:625:in `block in method_missing'
    /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:597:in `block in say_with_time'
    /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:597:in `say_with_time'
    /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:617:in `method_missing'
    /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:383:in `method_missing'
    /app/db/migrate/20131022082744_add_project_id_to_assets.rb:2:in `'
    /app/db/migrate/20131022082744_add_project_id_to_assets.rb:1:in `<top>&#39;
    /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require&#39;
    /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require&#39;
    /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency&#39;
    /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require&#39;
    /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:718:in `load_migration&#39;
    /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:714:in `migration&#39;
    /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:708:in `disable_ddl_transaction&#39;
    /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:1012:in `use_transaction?&#39;
    /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:922:in `rescue in block in migrate&#39;
    /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:919:in `block in migrate&#39;
    /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:916:in `each&#39;
    /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:916:in `migrate&#39;
    /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:764:in `up&#39;
    /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:742:in `migrate&#39;
    /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/railties/databases.rake:42:in `block (2 levels) in <top>&#39;
    Tasks: TOP => db:migrate
    (See full trace by running task with --trace)
    </top></top>

    Here is my table :

    create_table "assets", force: true do |t|
       t.datetime "created_at"
       t.datetime "updated_at"
       t.string   "photo_file_name"
       t.string   "photo_content_type"
       t.integer  "photo_file_size"
       t.datetime "photo_updated_at"
       t.integer  "project_id"
       t.string   "video_file_name"
       t.string   "video_content_type"
       t.integer  "video_file_size"
       t.datetime "video_updated_at"
     end
    add_index "projects", ["permalink"], name: "index_projects_on_permalink", using: :btree

     create_table "settings", force: true do |t|
       t.string   "title"
       t.text     "description"
       t.text     "paragraph"
       t.datetime "created_at"
       t.datetime "updated_at"
       t.string   "photo_file_name"
       t.string   "photo_content_type"
       t.integer  "photo_file_size"
       t.datetime "photo_updated_at"
       t.string   "video_file_name"
       t.string   "video_content_type"
       t.integer  "video_file_size"
       t.datetime "video_updated_at"
     end

    Would gladly need some help ! :)

  • Raising and Rescuing Custom Exception

    24 décembre 2013, par cmw

    I'm using Rails 3 with Carrierwave and FFMPEG to handle video uploads and encoding.

    In my uploader, I'm using FFMPEG to grab the duration of the video from cache before storing it.

    I'd like to raise a custom exception if the video's duration exceeds a specific length and then route the user accordingly. I've spent quite a bit of time trying to figure out how to create, raise and rescue my own custom exceptions in Rails – but, I've had no luck.

    Some posts I've used to try to piece this together include this stack overflow post and this article on customized exception handling in Rails 3. I've had no luck yet.

    I'm hoping someone can offer guidance on the proper approach to this. My mind is blown.

    Below is what my uploader looks like :

    class VideoUploader &lt; CarrierWave::Uploader::Base

     before :store, :ffmpeg

     # Set storage type
     storage :fog

     # Override the directory where uploaded files will be stored.
     def store_dir
       "#{model.class.to_s.underscore}/videos/#{model.id}"
     end

     # Add a white list of extensions which are allowed to be uploaded.
     def extension_white_list
       %w(mov avi mp4 mkv wmv mpg)
     end

     def full_cache_path
       "#{::Rails.root}/public/#{cache_dir}/#{cache_name}"
     end

     private

     def ffmpeg(*args)
       @model.video.cache_stored_file!
       movie = FFMPEG::Movie.new("#{model.video.full_cache_path}")
       if movie.duration > 600
         raise "my custom exception will go here one day"
       end
     end

    end
  • How can fix CalledProcessError : in ffmpeg

    7 décembre 2020, par Mario

    I hope someone can help to troubleshoot this problem. I'm trying to save the loss plots out of Keras in the form of the following animation.

    &#xA;&#xA;

    img

    &#xA;&#xA;

    but I have been facing the following error, and ultimately I can't save the animation :

    &#xA;&#xA;

    MovieWriter stderr:&#xA;[h264_v4l2m2m @ 0x55a67176f430] Could not find a valid device&#xA;[h264_v4l2m2m @ 0x55a67176f430] can&#x27;t configure encoder&#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;&#xA;---------------------------------------------------------------------------&#xA;BrokenPipeError                           Traceback (most recent call last)&#xA;~/anaconda3/envs/CR7/lib/python3.6/site-packages/matplotlib/animation.py in saving(self, fig, outfile, dpi, *args, **kwargs)&#xA;    229         try:&#xA;--> 230             yield self&#xA;    231         finally:&#xA;&#xA;~/anaconda3/envs/CR7/lib/python3.6/site-packages/matplotlib/animation.py in save(self, filename, writer, fps, dpi, codec, bitrate, extra_args, metadata, extra_anim, savefig_kwargs, progress_callback)&#xA;   1155                             frame_number &#x2B;= 1&#xA;-> 1156                     writer.grab_frame(**savefig_kwargs)&#xA;   1157 &#xA;&#xA;~/anaconda3/envs/CR7/lib/python3.6/site-packages/matplotlib/animation.py in grab_frame(self, **savefig_kwargs)&#xA;    383         self.fig.savefig(self._frame_sink(), format=self.frame_format,&#xA;--> 384                          dpi=self.dpi, **savefig_kwargs)&#xA;    385 &#xA;&#xA;~/anaconda3/envs/CR7/lib/python3.6/site-packages/matplotlib/figure.py in savefig(self, fname, transparent, **kwargs)&#xA;   2179 &#xA;-> 2180         self.canvas.print_figure(fname, **kwargs)&#xA;   2181 &#xA;&#xA;~/anaconda3/envs/CR7/lib/python3.6/site-packages/matplotlib/backend_bases.py in print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, bbox_inches, **kwargs)&#xA;   2081                     bbox_inches_restore=_bbox_inches_restore,&#xA;-> 2082                     **kwargs)&#xA;   2083             finally:&#xA;&#xA;~/anaconda3/envs/CR7/lib/python3.6/site-packages/matplotlib/backends/backend_agg.py in print_raw(self, filename_or_obj, *args, **kwargs)&#xA;    445                 cbook.open_file_cm(filename_or_obj, "wb") as fh:&#xA;--> 446             fh.write(renderer._renderer.buffer_rgba())&#xA;    447 &#xA;&#xA;BrokenPipeError: [Errno 32] Broken pipe&#xA;&#xA;During handling of the above exception, another exception occurred:&#xA;&#xA;CalledProcessError                        Traceback (most recent call last)&#xA; in <module>&#xA;     17 print(f&#x27;{model_type.upper()} Train Time: {Timer} sec&#x27;)&#xA;     18 &#xA;---> 19 create_loss_animation(model_type, hist.history[&#x27;loss&#x27;], hist.history[&#x27;val_loss&#x27;], epoch)&#xA;     20 &#xA;     21 evaluate(model, trainX, trainY, testX, testY, scores_train, scores_test)&#xA;&#xA; in create_loss_animation(model_type, loss_hist, val_loss_hist, epoch)&#xA;     34 &#xA;     35     ani = matplotlib.animation.FuncAnimation(fig, animate, fargs=(l1, l2, loss, val_loss, title), repeat=True, interval=1000, repeat_delay=1000)&#xA;---> 36     ani.save(f&#x27;loss_animation_{model_type}_oneDataset.mp4&#x27;, writer=writer)&#xA;&#xA;~/anaconda3/envs/CR7/lib/python3.6/site-packages/matplotlib/animation.py in save(self, filename, writer, fps, dpi, codec, bitrate, extra_args, metadata, extra_anim, savefig_kwargs, progress_callback)&#xA;   1154                             progress_callback(frame_number, total_frames)&#xA;   1155                             frame_number &#x2B;= 1&#xA;-> 1156                     writer.grab_frame(**savefig_kwargs)&#xA;   1157 &#xA;   1158         # Reconnect signal for first draw if necessary&#xA;&#xA;~/anaconda3/envs/CR7/lib/python3.6/contextlib.py in __exit__(self, type, value, traceback)&#xA;     97                 value = type()&#xA;     98             try:&#xA;---> 99                 self.gen.throw(type, value, traceback)&#xA;    100             except StopIteration as exc:&#xA;    101                 # Suppress StopIteration *unless* it&#x27;s the same exception that&#xA;&#xA;~/anaconda3/envs/CR7/lib/python3.6/site-packages/matplotlib/animation.py in saving(self, fig, outfile, dpi, *args, **kwargs)&#xA;    230             yield self&#xA;    231         finally:&#xA;--> 232             self.finish()&#xA;    233 &#xA;    234 &#xA;&#xA;~/anaconda3/envs/CR7/lib/python3.6/site-packages/matplotlib/animation.py in finish(self)&#xA;    365     def finish(self):&#xA;    366         &#x27;&#x27;&#x27;Finish any processing for writing the movie.&#x27;&#x27;&#x27;&#xA;--> 367         self.cleanup()&#xA;    368 &#xA;    369     def grab_frame(self, **savefig_kwargs):&#xA;&#xA;~/anaconda3/envs/CR7/lib/python3.6/site-packages/matplotlib/animation.py in cleanup(self)&#xA;    409         if self._proc.returncode:&#xA;    410             raise subprocess.CalledProcessError(&#xA;--> 411                 self._proc.returncode, self._proc.args, out, err)&#xA;    412 &#xA;    413     @classmethod&#xA;&#xA;CalledProcessError: Command &#x27;[&#x27;/usr/bin/ffmpeg&#x27;, &#x27;-f&#x27;, &#x27;rawvideo&#x27;, &#x27;-vcodec&#x27;, &#x27;rawvideo&#x27;, &#x27;-s&#x27;, &#x27;720x720&#x27;, &#x27;-pix_fmt&#x27;, &#xA;&#x27;rgba&#x27;, &#x27;-r&#x27;, &#x27;5&#x27;, &#x27;-loglevel&#x27;, &#x27;error&#x27;, &#x27;-i&#x27;, &#x27;pipe:&#x27;, &#x27;-vcodec&#x27;, &#x27;h264&#x27;, &#x27;-pix_fmt&#x27;, &#x27;yuv420p&#x27;, &#x27;-b&#x27;, &#x27;800k&#x27;, &#x27;-y&#x27;, &#xA;&#x27;loss_animation_CNN_oneDataset.mp4&#x27;]&#x27; returned non-zero exit status 1.&#xA;</module>

    &#xA;&#xA;

    I tried to ignore the error by this answer but it seems it's not the case. I also checked similar case but its answer for getting a static git binary is not my cas as well since not especial converting PNG to MP4 !

    &#xA;&#xA;

    My code is as follows :

    &#xA;&#xA;

    plt.rcParams[&#x27;animation.ffmpeg_path&#x27;] = &#x27;/usr/bin/ffmpeg&#x27;&#xA;&#xA;def animate(i, data1, data2, line1, line2):&#xA;    temp1 = data1.iloc[:int(i&#x2B;1)]&#xA;    temp2 = data2.iloc[:int(i&#x2B;1)]&#xA;&#xA;    line1.set_data(temp1.index, temp1.value)&#xA;    line2.set_data(temp2.index, temp2.value)&#xA;&#xA;    return (line1, line2)&#xA;&#xA;&#xA;def create_loss_animation(model_type, data1, data2):&#xA;    fig = plt.figure()&#xA;    plt.title(f&#x27;Loss on Train &amp; Test&#x27;, fontsize=25)&#xA;    plt.xlabel(&#x27;Epoch&#x27;, fontsize=20)&#xA;    plt.ylabel(&#x27;Loss MSE for Sx-Sy &amp; Sxy&#x27;, fontsize=20)&#xA;    plt.xlim(min(data1.index.min(), data2.index.min()), max(data1.index.max(), data2.index.max()))&#xA;    plt.ylim(min(data1.value.min(), data2.value.min()), max(data1.value.max(), data2.value.max()))&#xA;&#xA;    l1, = plt.plot([], [], &#x27;o-&#x27;, label=&#x27;Train Loss&#x27;, color=&#x27;b&#x27;, markevery=[-1])&#xA;    l2, = plt.plot([], [], &#x27;o-&#x27;, label=&#x27;Test Loss&#x27;, color=&#x27;r&#x27;, markevery=[-1])&#xA;    plt.legend(loc=&#x27;center right&#x27;, fontsize=&#x27;xx-large&#x27;)&#xA;&#xA;    Writer = animation.writers[&#x27;ffmpeg&#x27;]&#xA;    writer = Writer(fps=5, bitrate=1800)&#xA;&#xA;    ani = matplotlib.animation.FuncAnimation(fig, animate, fargs=(data1, data2, l1, l2), repeat=True, interval=1000, repeat_delay=1000)&#xA;    ani.save(f&#x27;{model_type}.mp4&#x27;, writer=writer)&#xA;&#xA;# create datasets&#xA;x = np.linspace(0,150,50)&#xA;y1 = 41*np.exp(-x/20)&#xA;y2 = 35*np.exp(-x/50)&#xA;&#xA;my_data_number_1 = pd.DataFrame({&#x27;x&#x27;:x, &#x27;value&#x27;:y1}).set_index(&#x27;x&#x27;)&#xA;my_data_number_2 = pd.DataFrame({&#x27;x&#x27;:x, &#x27;value&#x27;:y2}).set_index(&#x27;x&#x27;)&#xA;&#xA;create_loss_animation(&#x27;test&#x27;, my_data_number_1, my_data_number_2)&#xA;

    &#xA;