Recherche avancée

Médias (91)

Autres articles (16)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

  • Configuration spécifique pour PHP5

    4 février 2011, par

    PHP5 est obligatoire, vous pouvez l’installer en suivant ce tutoriel spécifique.
    Il est recommandé dans un premier temps de désactiver le safe_mode, cependant, s’il est correctement configuré et que les binaires nécessaires sont accessibles, MediaSPIP devrait fonctionner correctement avec le safe_mode activé.
    Modules spécifiques
    Il est nécessaire d’installer certains modules PHP spécifiques, via le gestionnaire de paquet de votre distribution ou manuellement : php5-mysql pour la connectivité avec la (...)

  • Contribute to documentation

    13 avril 2011

    Documentation is vital to the development of improved technical capabilities.
    MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
    To contribute, register to the project users’ mailing (...)

Sur d’autres sites (4309)

  • Winamp and the March of GUI

    1er juillet 2012, par Multimedia Mike — General, ars technica, gui, user interface, winamp

    Ars Technica recently published a 15-year retrospective on the venerable Winamp multimedia player, prompting bouts of nostalgia and revelations of "Huh ? That program is still around ?" from many readers. I was among them.



    I remember first using Winamp in 1997. I remember finding a few of these new files called MP3s online and being able to play the first 20 seconds using the official Fraunhofer Windows player— full playback required the fully licensed version. Then I searched for another player and came up with Winamp. The first version I ever used was v1.05 in the summer of 1997. I remember checking the website often for updates and trying out every single one. I can’t imagine doing that nowadays— programs need to auto-update themselves (which Winamp probably does now ; I can’t recall the last time I used the program).

    Video Underdog
    The last time Winamp came up on my radar was early in 2003 when a new version came with support for a custom, proprietary multimedia audio/video format called Nullsoft Video (NSV). I remember the timeframe because the date is indicated in the earliest revision of my NSV spec document (back when I was maintaining such docs in a series of plaintext files). This was cobbled together from details I and others in the open source multimedia community sorted out from sample files. It was missing quite a few details, though.

    Then, Winamp founder Justin Frankel — introduced through a colleague on the xine team — emailed me his official NSV format and told me I was free to incorporate details into my document just as long as it wasn’t obvious that I had the official spec. This put me in an obnoxious position of trying to incorporate details which would have been very difficult to reverse engineer without the official doc. I think I coped with the situation by never really getting around to updating my doc in any meaningful way. Then, one day, the official spec was released to the world anyway, and it is now mirrored here at multimedia.cx.

    I don’t think the format ever really caught on in any meaningful way, so not a big deal. (Anytime I say that about a format, I always learn it saw huge adoption is some small but vocal community.)

    What’s Wrong With This Picture ?
    What I really wanted to discuss in this post was the matter of graphical user interfaces and how they have changed in the last 15 years.

    I still remember when I first downloaded Winamp v1.05 and tried it on my Windows machine at the time. Indignantly, the first thought I had was, "What makes this program think it’s so special that it’s allowed to violate the user interface conventions put forth by the rest of the desktop ?" All of the Windows programs followed a standard set of user interface patterns and had a consistent look and feel... and then Winamp came along and felt it could violate all those conventions.

    I guess I let the program get away with it because it was either that or only play 20-second clips from the unregistered Fraunhofer player. Though incredibly sterile by comparison, the Fraunhofer player, it should be noted, followed Windows UI guidelines to the letter.

    As the summer of 1997 progressed and more Winamp versions were released, eventually one came out (I think it was v1.6 or so) that supported skins. I was excited because there was a skin that made the program look like a proper Windows program— at least if you used the default Windows color scheme, and had all of your fonts a certain type and size.

    Skins were implemented by packaging together a set of BMP images to overlay on various UI elements. I immediately saw a number of shortcomings with this skinning approach. A big one was UI lock-in. Ironically, if you skin an app and wish to maintain backwards compatibility with the thousands of skins selflessly authored by your vibrant community (seriously, I couldn’t believe how prolific these things were), then you were effectively locked into the primary UI. Forget about adding a new button anywhere.

    Another big problem was resolution-independence. Basing your UI on static bitmaps doesn’t scale well with various resolutions. Winamp had its normal mode and it also had double-sized mode.

    Skins proliferated among many types of programs in the late 1990s. I always treasured this Suck.com (remember them ? that’s a whole other nostalgia trip) essay from April, 2000 entitled Skin Cancer. Still, Winamp was basically the standard, and the best, and I put away my righteous nerd rage and even dug through the vast troves of skins. I remember settling on Swankamp for a good part of 1998, probably due to the neo-swing revival at the time.



    Then again, if Winamp irked me, imagine my reaction when I was first exposed to the Sonique Music Player in 1998 :



    The New UI Order
    Upon reflection, I realize now that I had a really myopic view of what a computer GUI should be. I thought the GUIs were necessarily supposed to follow the WIMP (windows, icons, mouse, pointer) paradigm and couldn’t conceive of anything different. For a long time, I couldn’t envision a useful GUI on a small device (like a phone) because WIMP didn’t fit well on such a small interface (even though I saw various ill-fated attempts to make it work). This thinking seriously crippled me when I was trying to craft a GUI for a custom console media player I was developing as a hobby many years ago.

    I’m looking around at what I have open on my Windows 7 desktop right now. Google Chrome browser, Apple iTunes, Adobe Photoshop Elements, and VMware Player are 4 programs which all seem to have their own skins. Maybe Winamp doesn’t look so out of place these days.

  • Exit Status with ffmpeg Command in Rails

    25 novembre 2012, par DragonFire353

    I am trying to get uploaded videos to be converted in the background, running windows. I am using :

    gem 'paperclip'
    gem 'aasm'
    gem 'delayed_job_active_record'
    gem 'ffmpeg'

    I was using purely paperclip before and making the user wait and it worked great, now I am having problems with the return of the error status for the command, I have tried editing to possible fix the command wondering if it was failing in the first place but I keep getting :

    undefined method `exitstatus' for nil:NilClass

    no matter what. I've tried looking this up and it's supposedly valid syntax that should work... Also I've commented out the actual spawn do part because I get another error if I leave that in :

    wrong number of arguments

    Does anyone know how to properly get this working ? I've went through a few tutorials that have bits and pieces of what I need but I can't get them working together. Here's what I have so far, lemme know if you need more :

    Model :

       class Video < ActiveRecord::Base
     include AASM

     belongs_to :user
     has_many :comments, dependent: :destroy
     attr_accessible :video, :user_id, :video_file_name, :title, :public, :description, :views

     has_attached_file :video, url: "/users/:user_id/videos/:id/:basename_:style.:extension"
     #, :styles => {
        # :video => { geometry: "800x480>", format: 'webm' },
        # :thumb => { geometry: "200x200>", format: 'png', time: 3 },
      # }, processors: [:ffmpeg], url: "/users/:user_id/videos/:id/:basename_:style.:extension"

     #process_in_background :video #causes death

     validates :video, presence: true
     validates :description, presence: true, length: { minimum: 5, maximum: 100}
     validates :title, presence: true, length: { minimum: 1, maximum: 15 }

     validates_attachment_size :video, less_than: 1.gigabytes
     validates_attachment :video, presence: true

     default_scope order: 'created_at DESC'

     Paperclip.interpolates :user_id do |attachment, style|attachment.instance.user_id
     end

     #acts as state machine plugin
     aasm state: :pending do
      state :pending, initial: true
      state :converting
      state :converted
      #, enter: :set_new_filename
      state :error

       event :convert do
        transitions from: :pending, to: :converting
      end

       event :converted do
        transitions from: :converting, to: :converted
      end

       event :failure do
         transitions from: :converting, to: :error
       end
     end

      # This method is called from the controller and takes care of the converting
     def convert
       self.convert!

       #spawn a new thread to handle conversion
       #spawn do
         success = delay.system(convert_command)
         logger.debug 'Converting File: ' + success.to_s
         if success && $?.exitstatus.to_i == 0
           self.converted!
         else
           self.failure!
         end
       #end
     end

     def self.search(search)
       if search
         find(:all, conditions: ["public = 't' AND title LIKE ?", "%#{search}%"], order: "created_at DESC")
       else
         find(:all, conditions: ["public = 't'"], order: "created_at DESC")
       end
     end

     def self.admin_search(search)
       if search
         find(:all, conditions: ['title LIKE ?', "%#{search}%"], order: "created_at DESC")
       else
         find(:all, order: "created_at DESC")
       end
     end

     private
       def convert_command
         #construct new file extension
         webm =  "." + id.to_s + ".webm"

         #build the command to execute ffmpeg
         command = <<-end_command
           ffmpeg -i #{ RAILS_ROOT + '/public/users/:user_id/videos/:id/:basename_:style.:extension' }  -ar 22050 -ab 32 -s 1280x720 -vcodec webm -r 25 -qscale 8 -f webm -y #{ RAILS_ROOT + '/public/users/:user_id/videos/:id/:basename_.webm' }

         end_command

         logger.debug "Converting video...command: " + command
         command
       end

       handle_asynchronously :convert_command

       # This updates the stored filename with the new flash video file
       def set_new_filename
         #update_attribute(:filename, "#{filename}.#{id}.webm")
         update_attribute(:content_type, "video/x-webm")
       end

    end

    Controller :

    class VideosController < ApplicationController
    before_filter :signed_in_user, only: [:upload, :update, :destroy]
    before_filter :admin_user, only: :admin_index

    def upload
       @video = Video.new
       # generate a unique id for the upload
       @uuid = (0..29).to_a.map {|x| rand(10)}
    end

    def create
       @video = Video.new(params[:video])
       @video.user_id = current_user.id

       if @video.save
           @video.convert
           flash[:success] = "Uploaded Succefully!"
           redirect_to @video.user
       else
           render 'upload'
       end
    end

    def show
       @video = Video.find(params[:id])
       @comments = @video.comments.paginate(page: params[:page], per_page: 6)
       if !@video.public
           if !signed_in? || current_user.id != @video.user_id  && !current_user.admin && !current_user.approved?(@video.user)
           flash[:notice] = "Video is private"
           redirect_to root_path
       end
    end
    end

    def update
       @video = Video.find(params[:id])
       if @video.update_attributes(params[:video])
     flash[:success] = "Video preferences saved"
    else
       flash[:fail] = "Failed to update video preferences"
    end
    redirect_to :back
    end

    def destroy
       @video = Video.find(params[:id])
       @video.destroy
       flash[:deleted] = "Deleted Succefully!"
       redirect_to :back
    end

    def index
       @videos = Video.paginate(page: params[:page], per_page: 6).search(params[:search])
    end

    def admin_index
       @videos = Video.paginate(page: params[:page], per_page: 6).admin_search(params[:search])
    end

    def ajax_video_comments
       @video = Video.find(params[:id])
       @comments = @video.comments.paginate(page: params[:page], per_page: 6)

       respond_to do |format|
       format.js   { render partial: 'shared/comments', content_type: 'text/html' }
    end
    end

    def ajax_video_watched
       @video = Video.find(params[:id])
       @video.views += 1
       @video.save
    end

    private

    def signed_in_user
       redirect_to root_path, notice: "Please Login." unless signed_in?
    end

    def admin_user
       redirect_to(root_path) unless current_user.admin?
    end

    end
  • Anomalie #3113 : Absence de contrôle d’unicité du champ email dans le formulaire auteur

    14 décembre 2013, par realet RealET

    Si j’ai bien compris le code, ça interdit complètement de créer un nouvel auteur ayant le même email qu’un autre.
    Ça ne touche donc pas aux auteurs existant.
    Du coup, un auteur déjà existant qui irait modifier ses infos, que se passera-t-il si son mail est déjà un doublon ?

    D’autre part, ça interdit un usage assez courant : la création d’un auteur de contact sans login ni mot de passe (servant uniquement avec tout à afficher le formulaire de contact d’auteur).
    ==> Pour cela, il suffirait dans les conditions de vérifier les doublons d’email uniquement pour s’il y a en plus un login.