Recherche avancée

Médias (0)

Mot : - Tags -/clipboard

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (111)

  • Script d’installation automatique de MediaSPIP

    25 avril 2011, par

    Afin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
    Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
    La documentation de l’utilisation du script d’installation (...)

  • Selection of projects using MediaSPIP

    2 mai 2011, par

    The examples below are representative elements of MediaSPIP specific uses for specific projects.
    MediaSPIP farm @ Infini
    The non profit organizationInfini develops hospitality activities, internet access point, training, realizing innovative projects in the field of information and communication technologies and Communication, and hosting of websites. It plays a unique and prominent role in the Brest (France) area, at the national level, among the half-dozen such association. Its members (...)

  • Utilisation et configuration du script

    19 janvier 2011, par

    Informations spécifiques à la distribution Debian
    Si vous utilisez cette distribution, vous devrez activer les dépôts "debian-multimedia" comme expliqué ici :
    Depuis la version 0.3.1 du script, le dépôt peut être automatiquement activé à la suite d’une question.
    Récupération du script
    Le script d’installation peut être récupéré de deux manières différentes.
    Via svn en utilisant la commande pour récupérer le code source à jour :
    svn co (...)

Sur d’autres sites (3660)

  • "File doesn't exist" - streamio FFMPEG on screenshot after create method

    3 mai 2013, par dodgerogers747

    I have videos being directly uploaded to S3 using Amazon's CORS configuration. Videos are uploaded via a dedicated S3 form, once they have been uploaded successfully the URL of the video is appended to the @video.file hidden_field via javascript and then the video saves.

    I can't get this after_save method to work which takes a screenshot of the video and saves it to S3 via carrierwave after the video has been saved as a rails object. ( It was previously working using a carrierwave video upload instance )

    It errors out withErrno::ENOENT - No such file or directory - the file 'http://bucket-name.s3.amazonaws.com/uploads/video/file/secure-random-hex/video_name.m4v' does not exist: I have tried running this method as a class method to call it from the console but it always comes back with the same error, even though the video exists.

    My bucket is set to public, read and write. How come it doesn't think the file exists ?

    If anyone needs more code just shout, thanks in advance.

    application trace

    Started POST "/videos" for 127.0.0.1 at 2013-05-03 10:48:07 -0700
    Processing by VideosController#create as JS
     Parameters: {"utf8"=>"✓", "authenticity_token"=>"MAHxrVcmPDtVIMfDWZBwL0YnzaAaAe1PTGip5M4OVoY=", "video"=>{"user_id"=>"5", "file"=>"http://bucket-name.s3.amazonaws.com/uploads/video/file/secure-random-hex/video.m4v"}}
     User Load (0.3ms)  SELECT `users`.* FROM `users` WHERE `users`.`id` = 5 LIMIT 1
      (0.1ms)  BEGIN
     SQL (20.5ms)  INSERT INTO `videos` (`created_at`, `file`, `question_id`, `screenshot`, `updated_at`, `user_id`) VALUES ('2013-05-03 17:48:07', 'http://teebox-network.s3.amazonaws.com/uploads/video/file/secure-random-hex/video.m4v', NULL, NULL, '2013-05-03 17:48:07', 5)
      (44.0ms)  ROLLBACK
    Completed 500 Internal Server Error in 71ms

    Errno::ENOENT - No such file or directory - the file 'http://teebox-network.s3.amazonaws.com/uploads/video/file/secure-random-hex/video.m4v' does not exist:
     (gem) streamio-ffmpeg-0.9.0/lib/ffmpeg/movie.rb:10:in `initialize'
     app/models/video.rb:25:in `new'
     app/models/video.rb:25:in `take_screenshot'

    video.rb

     attr_accessible :user_id, :question_id, :file, :screenshot
     belongs_to :question
     belongs_to :user

     default_scope order('created_at DESC')

     after_create :take_screenshot

     mount_uploader :screenshot, ImageUploader

     validates_presence_of :user_id, :file

     def take_screenshot
       FFMPEG.ffmpeg_binary = '/opt/local/bin/ffmpeg'
       movie = FFMPEG::Movie.new("#{self.file}")
       self.screenshot = movie.screenshot("#{Rails.root}/public/uploads/tmp/screenshots/#{File.basename(self.file)}.jpg", seek_time: 2 )
       self.save!
     end

    videos/_form.html.erb

    <form action="http://bucket-name.s3.amazonaws.com" data-remote="true" class="direct-upload" enctype="multipart/form-data" method="post">
     <input type="hidden" />
     <input type="hidden" value="ACCESS_KEY" />
     <input type="hidden" value="public-read" />
     <input type="hidden" />
     <input type="hidden" />
     <input type="hidden" value="201" />
     <input type="file" />
    </form>

    &lt;%= form_for @video, html: { multipart: true, id: "new_video" }, remote: true do |f| %>
           &lt;% if @video.errors.any? %>
       <div>
       <h2>&lt;%= pluralize(@video.errors.count, "error") %> prohibited this post from being saved:</h2>

     <ul>
       &lt;% @video.errors.full_messages.each do |msg| %>
           <li>&lt;%= msg %></li>
           &lt;% end %>
       </ul>
       </div>
    &lt;% end %>

       &lt;%= f.hidden_field :user_id, value: current_user.id %>
       &lt;%= f.hidden_field :file %><br />

       &lt;% end %>

    ImageUploader

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

     include CarrierWave::RMagick

      include Sprockets::Helpers::RailsHelper
      include Sprockets::Helpers::IsolatedHelper

     storage :fog

     before :store, :remember_cache_id
     after :store, :delete_tmp_dir

       def cache_dir
         Rails.root.join(&#39;public/uploads/tmp/&#39;)
       end

       def remember_cache_id(new_file)
         @cache_id_was = cache_id
       end

       def delete_tmp_dir(new_file)
         if @cache_id_was.present? &amp;&amp; @cache_id_was =~ /\A[\d]{8}\-[\d]{4}\-[\d]+\-[\d]{4}\z/
           FileUtils.rm_rf(File.join(root, cache_dir, @cache_id_was))
         end
       end

     process resize_and_pad: [306, 150, &#39;#000&#39;]

     def store_dir
       "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
     end

     def extension_white_list
       %w(jpg)
       # %w(ogg ogv 3gp mp4 m4v webm mov)
     end
  • how to scale server setup with ffmpeg for converting videos on website

    26 mai 2020, par Tom

    I have a website that will offer video conversion service with ffmpeg. Users will select some options and click a button to process and create a video. The site is currently using laravel/php. If there are many requests at the same time, how should I handle the scaling up ? How can it be done with traditional ISP ? How about cloud service, e.g. Amazon, Digital Ocean ?

    &#xA;

  • AWS Lambda : ffmpeg thumbnails Generator : empty JPG

    3 septembre 2020, par Magikey

    When a video is uploaded on S3 i want to store a JPG screenshot.

    &#xA;&#xA;

    On a lambda function with amazon AWS, i do :

    &#xA;&#xA;

    ...&#xA;&#xA;  let tmpFile = createWriteStream(`/tmp/screenshot.jpg`)&#xA;&#xA;  var ffmpeg = spawn(ffmpegPath, [&#xA;      "-ss","00:00:05",&#xA;      "-i", target,&#xA;      "-vf", "thumbnail,scale=200:200", &#xA;      "-qscale:v" ,"2",&#xA;      "-frames:v", "1",&#xA;      "-f", "image2",&#xA;      "-c:v", "mjpeg",&#xA;      "pipe:1"&#xA;    ]);&#xA;&#xA;  ffmpeg.stdout.pipe(tmpFile).on("error", err => {&#xA;      console.log("Error A: ",err);&#xA;    });&#xA;&#xA;  ffmpeg.on(&#x27;error&#x27;, err => {&#xA;    console.log("Error B", err)&#xA;    reject()&#xA;  })&#xA;&#xA;  ffmpeg.on(&#x27;close&#x27;, code => {&#xA;    tmpFile.end();&#xA;    console.log(&#x27;Log A&#x27;, ffmpeg);&#xA;&#xA;    child_process.exec("echo `ls -l -R /tmp`",&#xA;      (error, stdout, stderr) => {&#xA;        console.log(stdout)&#xA;    });&#xA;&#xA;    resolve()&#xA;  })&#xA;...&#xA;

    &#xA;&#xA;

    But the result is an empty JPG file in S3.

    &#xA;&#xA;

    Logs shows no errors, my "target" is OK, stdout ls show me the empty JPG file.

    &#xA;&#xA;

    I have try a lot of things, like use other version of ffmpeg but same.

    &#xA;&#xA;

    There is the "console.log('Log A', ffmpeg)" :

    &#xA;&#xA;

    ChildProcess {&#xA; _events: [Object: null prototype] { error: [Function], close: [Function] },&#xA; _eventsCount: 2,&#xA; _maxListeners: undefined,&#xA; _closesNeeded: 3,&#xA; _closesGot: 3,&#xA; connected: false,&#xA; signalCode: &#x27;SIGSEGV&#x27;,&#xA; exitCode: null,&#xA; killed: false,&#xA; spawnfile: &#x27;/opt/nodejs/ffmpeg&#x27;,&#xA; _handle: null,&#xA; spawnargs: [&#xA;   &#x27;/opt/nodejs/ffmpeg&#x27;,&#xA;   &#x27;-ss&#x27;,&#xA;   &#x27;00:00:05&#x27;,&#xA;   &#x27;-i&#x27;,&#xA;   &#x27;https://xxxxxxxxx&#x27;,&#xA;   &#x27;-vf&#x27;,&#xA;   &#x27;thumbnail,scale=200:200&#x27;,&#xA;   &#x27;-qscale:v&#x27;,&#xA;   &#x27;2&#x27;,&#xA;   &#x27;-frames:v&#x27;,&#xA;   &#x27;1&#x27;,&#xA;   &#x27;-f&#x27;,&#xA;   &#x27;image2&#x27;,&#xA;   &#x27;-v&#x27;,&#xA;   &#x27;16&#x27;,&#xA;   &#x27;-c:v&#x27;,&#xA;   &#x27;mjpeg&#x27;,&#xA;   &#x27;pipe:1&#x27;&#xA; ],&#xA; pid: 24,&#xA; stdin: Socket {&#xA;   connecting: false,&#xA;   _hadError: false,&#xA;   _parent: null,&#xA;   _host: null,&#xA;   _readableState: ReadableState {&#xA;     objectMode: false,&#xA;     highWaterMark: 16384,&#xA;     buffer: BufferList { head: null, tail: null, length: 0 },&#xA;     length: 0,&#xA;     pipes: null,&#xA;     pipesCount: 0,&#xA;     flowing: null,&#xA;     ended: false,&#xA;     endEmitted: false,&#xA;     reading: false,&#xA;     sync: true,&#xA;     needReadable: false,&#xA;     emittedReadable: false,&#xA;     readableListening: false,&#xA;     resumeScheduled: false,&#xA;     paused: true,&#xA;     emitClose: false,&#xA;     autoDestroy: false,&#xA;     destroyed: true,&#xA;     defaultEncoding: &#x27;utf8&#x27;,&#xA;     awaitDrain: 0,&#xA;     readingMore: false,&#xA;     decoder: null,&#xA;     encoding: null&#xA;   },&#xA;   readable: false,&#xA;   _events: [Object: null prototype] { end: [Function: onReadableStreamEnd] },&#xA;   _eventsCount: 1,&#xA;   _maxListeners: undefined,&#xA;   _writableState: WritableState {&#xA;     objectMode: false,&#xA;     highWaterMark: 16384,&#xA;     finalCalled: false,&#xA;     needDrain: false,&#xA;     ending: false,&#xA;     ended: false,&#xA;     finished: false,&#xA;     destroyed: true,&#xA;     decodeStrings: false,&#xA;     defaultEncoding: &#x27;utf8&#x27;,&#xA;     length: 0,&#xA;     writing: false,&#xA;     corked: 0,&#xA;     sync: true,&#xA;     bufferProcessing: false,&#xA;     onwrite: [Function: bound onwrite],&#xA;     writecb: null,&#xA;     writelen: 0,&#xA;     bufferedRequest: null,&#xA;     lastBufferedRequest: null,&#xA;     pendingcb: 0,&#xA;     prefinished: false,&#xA;     errorEmitted: false,&#xA;     emitClose: false,&#xA;     autoDestroy: false,&#xA;     bufferedRequestCount: 0,&#xA;     corkedRequestsFree: [Object]&#xA;   },&#xA;   writable: false,&#xA;   allowHalfOpen: false,&#xA;   _sockname: null,&#xA;   _pendingData: null,&#xA;   _pendingEncoding: &#x27;&#x27;,&#xA;   server: null,&#xA;   _server: null,&#xA;   [Symbol(asyncId)]: 5,&#xA;   [Symbol(kHandle)]: null,&#xA;   [Symbol(lastWriteQueueSize)]: 0,&#xA;   [Symbol(timeout)]: null,&#xA;   [Symbol(kBuffer)]: null,&#xA;   [Symbol(kBufferCb)]: null,&#xA;   [Symbol(kBufferGen)]: null,&#xA;   [Symbol(kBytesRead)]: 0,&#xA;   [Symbol(kBytesWritten)]: 0&#xA; },&#xA; stdout: Socket {&#xA;   connecting: false,&#xA;   _hadError: false,&#xA;   _parent: null,&#xA;   _host: null,&#xA;   _readableState: ReadableState {&#xA;     objectMode: false,&#xA;     highWaterMark: 16384,&#xA;     buffer: BufferList { head: null, tail: null, length: 0 },&#xA;     length: 0,&#xA;     pipes: null,&#xA;     pipesCount: 0,&#xA;     flowing: false,&#xA;     ended: true,&#xA;     endEmitted: true,&#xA;     reading: false,&#xA;     sync: false,&#xA;     needReadable: false,&#xA;     emittedReadable: false,&#xA;     readableListening: false,&#xA;     resumeScheduled: false,&#xA;     paused: false,&#xA;     emitClose: false,&#xA;     autoDestroy: false,&#xA;     destroyed: true,&#xA;     defaultEncoding: &#x27;utf8&#x27;,&#xA;     awaitDrain: 0,&#xA;     readingMore: false,&#xA;     decoder: null,&#xA;     encoding: null&#xA;   },&#xA;   readable: false,&#xA;   _events: [Object: null prototype] {&#xA;     end: [Function: onReadableStreamEnd],&#xA;     close: [Function]&#xA;   },&#xA;   _eventsCount: 2,&#xA;   _maxListeners: undefined,&#xA;   _writableState: WritableState {&#xA;     objectMode: false,&#xA;     highWaterMark: 16384,&#xA;     finalCalled: false,&#xA;     needDrain: false,&#xA;     ending: false,&#xA;     ended: false,&#xA;     finished: false,&#xA;     destroyed: true,&#xA;     decodeStrings: false,&#xA;     defaultEncoding: &#x27;utf8&#x27;,&#xA;     length: 0,&#xA;     writing: false,&#xA;     corked: 0,&#xA;     sync: true,&#xA;     bufferProcessing: false,&#xA;     onwrite: [Function: bound onwrite],&#xA;     writecb: null,&#xA;     writelen: 0,&#xA;     bufferedRequest: null,&#xA;     lastBufferedRequest: null,&#xA;     pendingcb: 0,&#xA;     prefinished: false,&#xA;     errorEmitted: false,&#xA;     emitClose: false,&#xA;     autoDestroy: false,&#xA;     bufferedRequestCount: 0,&#xA;     corkedRequestsFree: [Object]&#xA;   },&#xA;   writable: false,&#xA;   allowHalfOpen: false,&#xA;   _sockname: null,&#xA;   _pendingData: null,&#xA;   _pendingEncoding: &#x27;&#x27;,&#xA;   server: null,&#xA;   _server: null,&#xA;   write: [Function: writeAfterFIN],&#xA;   [Symbol(asyncId)]: 6,&#xA;   [Symbol(kHandle)]: null,&#xA;   [Symbol(lastWriteQueueSize)]: 0,&#xA;   [Symbol(timeout)]: null,&#xA;   [Symbol(kBuffer)]: null,&#xA;   [Symbol(kBufferCb)]: null,&#xA;   [Symbol(kBufferGen)]: null,&#xA;   [Symbol(kBytesRead)]: 0,&#xA;   [Symbol(kBytesWritten)]: 0&#xA; },&#xA; stderr: Socket {&#xA;   connecting: false,&#xA;   _hadError: false,&#xA;   _parent: null,&#xA;   _host: null,&#xA;   _readableState: ReadableState {&#xA;     objectMode: false,&#xA;     highWaterMark: 16384,&#xA;     buffer: BufferList { head: null, tail: null, length: 0 },&#xA;     length: 0,&#xA;     pipes: null,&#xA;     pipesCount: 0,&#xA;     flowing: null,&#xA;     ended: true,&#xA;     endEmitted: true,&#xA;     reading: false,&#xA;     sync: false,&#xA;     needReadable: false,&#xA;     emittedReadable: false,&#xA;     readableListening: false,&#xA;     resumeScheduled: false,&#xA;     paused: true,&#xA;     emitClose: false,&#xA;     autoDestroy: false,&#xA;     destroyed: true,&#xA;     defaultEncoding: &#x27;utf8&#x27;,&#xA;     awaitDrain: 0,&#xA;     readingMore: false,&#xA;     decoder: null,&#xA;     encoding: null&#xA;   },&#xA;   readable: false,&#xA;   _events: [Object: null prototype] {&#xA;     end: [Function: onReadableStreamEnd],&#xA;     close: [Function]&#xA;   },&#xA;   _eventsCount: 2,&#xA;   _maxListeners: undefined,&#xA;   _writableState: WritableState {&#xA;     objectMode: false,&#xA;     highWaterMark: 16384,&#xA;     finalCalled: false,&#xA;     needDrain: false,&#xA;     ending: false,&#xA;     ended: false,&#xA;     finished: false,&#xA;     destroyed: true,&#xA;     decodeStrings: false,&#xA;     defaultEncoding: &#x27;utf8&#x27;,&#xA;     length: 0,&#xA;     writing: false,&#xA;     corked: 0,&#xA;     sync: true,&#xA;     bufferProcessing: false,&#xA;     onwrite: [Function: bound onwrite],&#xA;     writecb: null,&#xA;     writelen: 0,&#xA;     bufferedRequest: null,&#xA;     lastBufferedRequest: null,&#xA;     pendingcb: 0,&#xA;     prefinished: false,&#xA;     errorEmitted: false,&#xA;     emitClose: false,&#xA;     autoDestroy: false,&#xA;     bufferedRequestCount: 0,&#xA;     corkedRequestsFree: [Object]&#xA;   },&#xA;   writable: false,&#xA;   allowHalfOpen: false,&#xA;   _sockname: null,&#xA;   _pendingData: null,&#xA;   _pendingEncoding: &#x27;&#x27;,&#xA;   server: null,&#xA;   _server: null,&#xA;   write: [Function: writeAfterFIN],&#xA;   [Symbol(asyncId)]: 7,&#xA;   [Symbol(kHandle)]: null,&#xA;   [Symbol(lastWriteQueueSize)]: 0,&#xA;   [Symbol(timeout)]: null,&#xA;   [Symbol(kBuffer)]: null,&#xA;   [Symbol(kBufferCb)]: null,&#xA;   [Symbol(kBufferGen)]: null,&#xA;   [Symbol(kBytesRead)]: 0,&#xA;   [Symbol(kBytesWritten)]: 0&#xA; },&#xA; stdio: [&#xA;   Socket {&#xA;     connecting: false,&#xA;     _hadError: false,&#xA;     _parent: null,&#xA;     _host: null,&#xA;     _readableState: [ReadableState],&#xA;     readable: false,&#xA;     _events: [Object: null prototype],&#xA;     _eventsCount: 1,&#xA;     _maxListeners: undefined,&#xA;     _writableState: [WritableState],&#xA;     writable: false,&#xA;     allowHalfOpen: false,&#xA;     _sockname: null,&#xA;     _pendingData: null,&#xA;     _pendingEncoding: &#x27;&#x27;,&#xA;     server: null,&#xA;     _server: null,&#xA;     [Symbol(asyncId)]: 5,&#xA;     [Symbol(kHandle)]: null,&#xA;     [Symbol(lastWriteQueueSize)]: 0,&#xA;     [Symbol(timeout)]: null,&#xA;     [Symbol(kBuffer)]: null,&#xA;     [Symbol(kBufferCb)]: null,&#xA;     [Symbol(kBufferGen)]: null,&#xA;     [Symbol(kBytesRead)]: 0,&#xA;     [Symbol(kBytesWritten)]: 0&#xA;   },&#xA;   Socket {&#xA;     connecting: false,&#xA;     _hadError: false,&#xA;     _parent: null,&#xA;     _host: null,&#xA;     _readableState: [ReadableState],&#xA;     readable: false,&#xA;     _events: [Object: null prototype],&#xA;     _eventsCount: 2,&#xA;     _maxListeners: undefined,&#xA;     _writableState: [WritableState],&#xA;     writable: false,&#xA;     allowHalfOpen: false,&#xA;     _sockname: null,&#xA;     _pendingData: null,&#xA;     _pendingEncoding: &#x27;&#x27;,&#xA;     server: null,&#xA;     _server: null,&#xA;     write: [Function: writeAfterFIN],&#xA;     [Symbol(asyncId)]: 6,&#xA;     [Symbol(kHandle)]: null,&#xA;     [Symbol(lastWriteQueueSize)]: 0,&#xA;     [Symbol(timeout)]: null,&#xA;     [Symbol(kBuffer)]: null,&#xA;     [Symbol(kBufferCb)]: null,&#xA;     [Symbol(kBufferGen)]: null,&#xA;     [Symbol(kBytesRead)]: 0,&#xA;     [Symbol(kBytesWritten)]: 0&#xA;   },&#xA;   Socket {&#xA;     connecting: false,&#xA;     _hadError: false,&#xA;     _parent: null,&#xA;     _host: null,&#xA;     _readableState: [ReadableState],&#xA;     readable: false,&#xA;     _events: [Object: null prototype],&#xA;     _eventsCount: 2,&#xA;     _maxListeners: undefined,&#xA;     _writableState: [WritableState],&#xA;     writable: false,&#xA;     allowHalfOpen: false,&#xA;     _sockname: null,&#xA;     _pendingData: null,&#xA;     _pendingEncoding: &#x27;&#x27;,&#xA;     server: null,&#xA;     _server: null,&#xA;     write: [Function: writeAfterFIN],&#xA;     [Symbol(asyncId)]: 7,&#xA;     [Symbol(kHandle)]: null,&#xA;     [Symbol(lastWriteQueueSize)]: 0,&#xA;     [Symbol(timeout)]: null,&#xA;     [Symbol(kBuffer)]: null,&#xA;     [Symbol(kBufferCb)]: null,&#xA;     [Symbol(kBufferGen)]: null,&#xA;     [Symbol(kBytesRead)]: 0,&#xA;     [Symbol(kBytesWritten)]: 0&#xA;   }&#xA; ]&#xA;} ```&#xA;

    &#xA;