Recherche avancée

Médias (1)

Mot : - Tags -/Christian Nold

Autres articles (77)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • XMP PHP

    13 mai 2011, par

    Dixit Wikipedia, XMP signifie :
    Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
    Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
    XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)

Sur d’autres sites (8323)

  • Include zlib.h when necessary.

    8 janvier 2013, par Tim Terriberry
    Include zlib.h when necessary.
    

    Newer versions of png.h don't include it for us.
    This is only needed when compiling with OC_DUMP_IMAGES (i.e., for
    debugging).

    git-svn-id : http://svn.xiph.org/trunk/theora@18760 0101bb08-14d6-0310-b084-bc0e0c8e3800

    • [DH] lib/state.c
  • Converting Videos In the Background ROR 3

    2 octobre 2012, par DragonFire353

    I've searched around on google and have come up with only one site that explains how to do this : http://railsonedge.blogspot.com/2009/01/flash-video-tutorial-with-rails-ffmpeg.html?m=0 I'm already using paperclip and already have everything set up with it and like using it better than the way this site is doing it. Is there a way to convert videos in the background while keeping track of the state of it using paperclip ? My Video.rb currently :

    class Video < ActiveRecord::Base
     belongs_to :user
     has_many :comments, dependent: :destroy
     attr_accessible :video, :user_id, :video_file_name, :title, :public, :description, :views

     has_attached_file :video, :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

     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

    end
  • Converting FFmpeg frame to OpenGL ES texture

    10 juillet 2015, par joe

    I’m trying to convert from a video using FFmpeg to an OpenGL ES texture in jni, but all that I get is a black texture. I have output the OpenGL with the glGetError(), but there is no error.

    Here is my code :

    void* pixels;
    int err;
    int i;
    int frameFinished = 0;
    AVPacket packet;
    static struct SwsContext *img_convert_ctx;
    static struct SwsContext *scale_context = NULL;
    int64_t seek_target;

    int target_width = 320;
    int target_height = 240;
    GLenum error = GL_NO_ERROR;
    sws_freeContext(img_convert_ctx);  

    i = 0;
    while((i==0) && (av_read_frame(pFormatCtx, &packet)>=0)) {
           if(packet.stream_index==videoStream) {
           avcodec_decode_video2(pCodecCtx, pFrame, &frameFinished, &packet);

           if(frameFinished) {
               LOGI("packet pts %llu", packet.pts);
               img_convert_ctx = sws_getContext(pCodecCtx->width, pCodecCtx->height,
                      pCodecCtx->pix_fmt,
                      target_width, target_height, PIX_FMT_RGB24, SWS_BICUBIC,
                      NULL, NULL, NULL);
               if(img_convert_ctx == NULL) {
                   LOGE("could not initialize conversion context\n");
                   return;
               }
                   sws_scale(img_convert_ctx, (const uint8_t* const*)pFrame->data, pFrame->linesize, 0, pCodecCtx->height, pFrameRGB->data, pFrameRGB->linesize);
                   LOGI("sws_scale");

                   videoTextures = new Texture*[1];
                   videoTextures[0]->mWidth = 256; //(unsigned)pCodecCtx->width;
                   videoTextures[0]->mHeight = 256; //(unsigned)pCodecCtx->height;
                   videoTextures[0]->mData = pFrameRGB->data[0];

                   glPixelStorei(GL_UNPACK_ALIGNMENT, 1);

                   glGenTextures(1, &(videoTextures[0]->mTextureID));
                   glBindTexture(GL_TEXTURE_2D, videoTextures[0]->mTextureID);
                   glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
                   glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

                   if(0 == got_texture)
                   {
                       glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, videoTextures[0]->mWidth, videoTextures[0]->mHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, (GLvoid *)videoTextures[0]->mData);

                       glTexSubImage2D(GL_TEXTURE_2D, 0, 0,0, videoTextures[0]->mWidth, videoTextures[0]->mHeight, GL_RGBA, GL_UNSIGNED_BYTE, (GLvoid *)videoTextures[0]->mData);
                   }else
                   {
                       glTexSubImage2D(GL_TEXTURE_2D, 0, 0,0, videoTextures[0]->mWidth, videoTextures[0]->mHeight, GL_RGBA, GL_UNSIGNED_BYTE, (GLvoid *)videoTextures[0]->mData);

                   }

                   i = 1;
                   error = glGetError();
                   if( error != GL_NO_ERROR ) {
                       LOGE("couldn't create texture!!");
                          switch (error) {
                           case GL_INVALID_ENUM:
                           LOGE("GL Error: Enum argument is out of range");
                           break;
                           case GL_INVALID_VALUE:
                               LOGE("GL Error: Numeric value is out of range");
                           break;
                           case GL_INVALID_OPERATION:
                               LOGE("GL Error: Operation illegal in current state");
                           break;
                           case GL_OUT_OF_MEMORY:
                               LOGE("GL Error: Not enough memory to execute command");
                           break;
                           default:
                               break;
                          }
                   }
           }
       }
       av_free_packet(&packet);
    }

    I have succeeded in changing pFrameRGB to a java bitmap, but I just want to change it to a texture in the c code.

    Edit1 I have output the Texture ID, it is 0 ; could texture ID be zero ? I changed my code
    but it always be zero.

    Edit2
    the Texture display, but it is a mess.