Recherche avancée

Médias (91)

Autres articles (77)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Participer à sa traduction

    10 avril 2011

    Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
    Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
    Actuellement MediaSPIP n’est disponible qu’en français et (...)

Sur d’autres sites (8941)

  • Delayed::Job ffmpeg hangs when processing large files using delayed_paperclip

    11 septembre 2016, par Noah Passalacqua

    I am trying to use delayed_job to process large videos and audio files in the background. For the most part everything works. The only time it runs into any hiccups is when larger files are uploaded ( >200MB)

    app/models/userfile.rb

    has_attached_file :userfile,
       path: ':dir_path/:style_:filename',
       use_timestamp: false, styles: lambda { |a| UserfileStyles.get(a.instance)[:styles] },
       only_process: lambda { |a| UserfileStyles.get(a.instance)[:foreground] },
       source_file_options: { all: '-auto-orient' }
    validates_attachment_content_type :userfile, content_type: /.*/
    process_in_background :userfile,
       url_with_processing: false,
       only_process: lambda { |a| UserfileStyles.get(a.instance)[:background] }

    app/models/userfile_styles.rb

    module UserfileStyles
       def self.get userfile
           if userfile.video?
               {
                   styles: {
                       screenshot: ['300x300', :jpg],
                       thumbnail: {
                           gemoetry: '100x100#',
                           format: :jpg,
                           convert_options: '-thumbnail 100%'
                       },
                       preview: {
                           format: 'mp4',
                           convert_options: {
                               output: { ss: '0', t: '10' }
                           },
                           processors: [:transcoder]
                       },
                       mp4: {
                           format: 'mp4',
                           convert_options: {
                               output: {
                                   vcodec: 'libx264',
                                   vb: '1000k',
                                   'profile:v': 'baseline',
                                   vf: 'scale=-2:480',
                                   acodec: 'aac',
                                   ab: '128k',
                                   preset: 'slow',
                                   threads: 0,
                                   movflags: 'faststart',
                               }
                           },
                           processors: [:transcoder]
                       }
                   },
                   foreground: [:screenshot, :thumbnail],
                   background: [:preview, :mp4]
               }
           end
       end
    end

    Example (the first file is being converted from the second file, and the third file is being converted from the fourth file) :

    v2@web1 ~/divshare-v2 $ ls -alh /tmp
    -rw-------  1 v2   v2    70M Sep 10 00:01 2158940a8739e7219125179e0d1528c120160909-14061-8dqfx020160909-14061-egeyeq.mp4
    -rw-------  1 v2   v2   515M Sep  9 23:57 2158940a8739e7219125179e0d1528c120160909-14061-8dqfx0.mp4
    -rw-------  1 v2   v2   145M Sep  9 23:33 76ba144beb8a14b6cf542225ef885a7c20160909-12733-1ui03vo20160909-12733-y7ywn.mp4
    -rw-------  1 v2   v2   604M Sep  9 23:27 76ba144beb8a14b6cf542225ef885a7c20160909-12733-1ui03vo.mp4

    I have tried uploading a couple times and with different files. Always gets caught around the same point. However everything works perfectly when smaller videos ( 100-200MB).

    This is the command being ran :

    v2@web1 ~/divshare-v2 $ ps ux | grep ffmpeg
    USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
    v2       14588 26.4  2.9 849840 240524 ?       Sl   Sep09  12:00 ffmpeg -i /tmp/2158940a8739e7219125179e0d1528c120160909-14061-8dqfx0.mp4 -acodec aac -strict experimental -vcodec libx264 -vb 1000k -profile:v baseline -vf scale=-2:480 -acodec aac -ab 128k -preset slow -threads 0 -movflags faststart -y /tmp/2158940a8739e7219125179e0d1528c120160909-14061-8dqfx020160909-14061-egeyeq.mp4

    Any sort of help debugging this would be awesome.

    NOTE : I copied the above command and manually ran it so that I could see some logs from ffmpeg, and worked flawlessly.

  • fftools/ffmpeg_filter : factor processing a single frame out of reap_filters()

    23 juillet 2023, par Anton Khirnov
    fftools/ffmpeg_filter : factor processing a single frame out of reap_filters()
    

    This is easier to read.

    • [DH] fftools/ffmpeg_filter.c
  • How improves Video Player processing using Qt and FFmpeg ?

    13 septembre 2016, par Eric Menezes

    A time ago, I started to develop a video player/analyser. For beeing an analyser as well, the application should have inside its buffer the next frames and the previous as well. That’s where the complication begins.

    For that, we started to use an VideoProducer that decodes the frames and audio from video (using ffmpeg), added it into a buffer from where the video and audio consumers retrieve that objects (VideoFrame and AudioChunk). For this job, we have some QThreads which is one producer, 2 consumers and (the biggest trouble maker) 2 workers that is used to retrieve objects from producer’s buffer and insert them into a circular buffer (that because of previous frames). These workers are important because of the backwards buffering job (this player should play backwards too).

    So, now the player is running well, but not so good. It’s notable that is losing performance. Like removing producer buffer and using just the circular. But still, some questions remains :

    • Should I continue using QThread with reimplemented run() ? I read that works better with Signals & Slots ;

    • If Signals & Slots worth it, the producer still needs to reimplement QThread::run(), right ?

    • Cosidering that buffer must have some previous frames and bad quality videos will be reproduced, is that (VideoProducer insert objects into a Buffer, AudioConsumer and FrameConsumer retrieve these objects from Buffer and display/reproducer them) the better way ?

    • What is the best way to sync audio and video ? The sync using audio pts is doing well, but some troubles appear sometimes ; and

    • For buffering backwards, ffmpeg does not provide frames this way, so I need to seek back, decode older frames, reorder them and prepend to the buffer. This job has been done by that Workers, another QThread the keep consuming from Producer buffer and, if buffering backwards, asks for seek and do the reorder job. I can just guess that it is bad. And I assume that do this reorder job should be done at Producer level. Is that any way to do this better ?

    I know it’s a lot of questions, and I’m sorry for that, but I don’t know where to find these answers.

    Thanks for helping.

    For better understanding, heres how its been done :

    • VideoProducer -> Decoder QThread. Runs in a loop decoding and enqueuing frames into a Buffer.

    • FrameConsumer -> Video consumer. Retrieves frames from frame CircularBuffer in a loop using another QThread. Display the frame and sleep few mseconds based on video fps and AudioConsumer clock time.

    • AudioConsumer -> Audio consumer and video’s clock. Works with signals using QAudioOutput::notify() to retrieve chunks of audio from audio CircularBuffer and insert them into QAudioOutput buffer. When decodes the first frame, its pts is used to start the clock. (if a seek has been called, the next audio frame will mark the clock start time)

    • Worker -> Each stream (audio and video) has one. It’s a QThread running in a loop (run() reimplemented) retrieving objects from Buffer and inserting (backwards or forward) to CircularBuffer.

    And another ones that manage UI, filters, some operations with frames/chunks...