Recherche avancée

Médias (10)

Mot : - Tags -/wav

Autres articles (40)

  • 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 (...)

  • Déploiements possibles

    31 janvier 2010, par

    Deux types de déploiements sont envisageable dépendant de deux aspects : La méthode d’installation envisagée (en standalone ou en ferme) ; Le nombre d’encodages journaliers et la fréquentation envisagés ;
    L’encodage de vidéos est un processus lourd consommant énormément de ressources système (CPU et RAM), il est nécessaire de prendre tout cela en considération. Ce système n’est donc possible que sur un ou plusieurs serveurs dédiés.
    Version mono serveur
    La version mono serveur consiste à n’utiliser qu’une (...)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 is the first MediaSPIP stable release.
    Its official release date is June 21, 2013 and is announced here.
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

Sur d’autres sites (4574)

  • Decoding by libjpeg -> Encoding by x264, strange artefacts on frames

    15 mai 2013, par mmmaaak

    I have a collection of jpeg, which must be decoded by lib jpeg, and after it, encoded by x264 (after it encoded packets are streamed via rtmp).
    Code I used for decoding :

    struct my_error_mgr
    {  
       struct jpeg_error_mgr pub;
       jmp_buf setjmp_buffer;
    };
    typedef my_error_mgr *my_error_ptr;

    METHODDEF(void) my_error_exit (j_common_ptr cinfo)
    {
       my_error_ptr myerr = (my_error_ptr) cinfo->err;
       (*cinfo->err->output_message) (cinfo);
       longjmp(myerr->setjmp_buffer, 1);  
    }

    void init_source(j_decompress_ptr ptr)
    {
       Q_UNUSED(ptr)
    }

    boolean fill_input_buffer(j_decompress_ptr ptr)
    {
        Q_UNUSED(ptr)
       return TRUE;
    }

    void term_source(j_decompress_ptr ptr)
    {
       Q_UNUSED(ptr)
    }

    void skip_input_data(j_decompress_ptr ptr, long num_bytes)
    {
       if(num_bytes>0)
       {
           ptr->src->next_input_byte+=(size_t)num_bytes;
           ptr->src->bytes_in_buffer-=(size_t)num_bytes;  
       }
    }

    EtherDecoder::EtherDecoder(QObject *parent):
    QObject(parent)
    {
    }

    void EtherDecoder::dataBlockReady(QByteArray data)
    {
       jpeg_decompress_struct decompressInfo;
       jpeg_create_decompress(&decompressInfo);
       my_error_mgr err;
       decompressInfo.do_fancy_upsampling = FALSE;
       decompressInfo.src = (jpeg_source_mgr *) (*decompressInfo.mem->alloc_small)       ((j_common_ptr) &decompressInfo, JPOOL_PERMANENT, sizeof(jpeg_source_mgr));
       decompressInfo.err = jpeg_std_error(&err.pub);
       err.pub.error_exit = my_error_exit;
       if (setjmp(err.setjmp_buffer))  
       {
           jpeg_destroy_decompress(&decompressInfo);
           return;
       }
       decompressInfo.src->init_source = init_source;
       decompressInfo.src->resync_to_restart = jpeg_resync_to_restart;
       decompressInfo.src->fill_input_buffer = fill_input_buffer;
       decompressInfo.src->skip_input_data = skip_input_data;
       decompressInfo.src->term_source = term_source;
       decompressInfo.src->next_input_byte = reinterpret_cast<const>(data.data());
       decompressInfo.src->bytes_in_buffer = data.size();
       jpeg_read_header(&amp;decompressInfo, TRUE);
       jpeg_start_decompress(&amp;decompressInfo);
       int size = 0;
       int n_samples = 0;
       char *samples = new char[5242880];
       char *reserv = samples;
       while (decompressInfo.output_scanline &lt; decompressInfo.output_height)  
       {
           n_samples = jpeg_read_scanlines(&amp;decompressInfo, (JSAMPARRAY) &amp;samples, 1);
           samples += n_samples * decompressInfo.image_width * decompressInfo.num_components;
           size += n_samples * decompressInfo.image_width * decompressInfo.num_components;
       }
       jpeg_finish_decompress(&amp;decompressInfo);
       QByteArray output(reserv, size);
       emit frameReady(output, decompressInfo.output_width, decompressInfo.output_height);
       jpeg_destroy_decompress(&amp;decompressInfo);
       delete[] reserv;
    }
    </const>

    When I emit frameReady signal, I send data to Encoder, method, where I init Encedor looks like :

    bool EtherEncoder::initEncoder(unsigned int width, unsigned int height)
    {
       x264_param_t param;
       x264_param_default_preset(&amp;param, "veryfast", "zerolatency");
       param.i_width=width;
       param.i_height=height;
       param.i_frame_total=0;
       param.i_csp=X264_CSP_I420;
       param.i_timebase_num=1;
       param.i_timebase_den=96000;
       param.b_annexb=true;
       param.b_repeat_headers=false;
       x264_param_apply_fastfirstpass(&amp;param);
       x264_param_apply_profile(&amp;param, "baseline");
       _context=x264_encoder_open(&amp;param);
       if(!_context)
           return false;
       int nal_count;
       x264_nal_t *nals;
       if(x264_encoder_headers(_context, &amp;nals, &amp;nal_count)&lt;0)
       {
           x264_encoder_close(_context);
           _context=0;
           return false;  
       }
       _extradata=QByteArray();
       _width=width;
       _height=height;
       if(nal_count>0)
       {
           _extradata=QByteArray(
               (const char *)nals[0].p_payload,
               nals[nal_count-1].p_payload+nals[nal_count-1].i_payload-nals[0].p_payload);
       }
       return true;
    }

    And encoding method :

    void EtherEncoder::onFrameReady(QByteArray data, int width, int height)
    {
       while(data.size()>0)    
       {
           if(!_context &amp;&amp; initEncoder(width, height))
           {
               _timestampDelta=realTimestamp();
           }
           if(_context)
           {
               x264_picture_t pic;
               x264_picture_init(&amp;pic);
               pic.i_type=X264_TYPE_AUTO;
               pic.i_pts=_timestampDelta*96000;
               pic.img.i_csp=X264_CSP_I420;
               pic.img.i_plane=3;
               int planeSize = width*height;
               uint8_t *p = (uint8_t*)data.data();
               pic.img.plane[0]=p;
               p+=planeSize;
               pic.img.plane[1]=p;
               p+=planeSize/4;
               pic.img.plane[2]=p;
               pic.img.i_stride[0]=width;
               pic.img.i_stride[1]=width/2;
               pic.img.i_stride[2]=width/2;
               if(_forceKeyFrame)
               {
                   pic.i_type=X264_TYPE_I;
                   _forceKeyFrame=false;
               }
               int nal_count;
               x264_nal_t *nals;
               int rc=x264_encoder_encode(_context, &amp;nals, &amp;nal_count, &amp;pic, &amp;pic);
               if(rc>0)
               {
                   _mutex.lock();
                   _packets.push_back(
                       Packet(
                           QByteArray(
                               (const char *)nals[0].p_payload,         nals[nal_count-    1].p_payload+nals[nal_count-1].i_payload-nals[0].p_payload),
                           _timestampDelta/96.0,
                           _timestampDelta/96.0,
                           pic.b_keyframe));
                   _timestampDelta+=40;
                   data.clear();
                   _mutex.unlock();
                   emit onPacketReady();
               }
           }  
       }
    }

    Decoding and encoding proceeds without errors, at the end I get valid video stream, but, it seems that in one of this steps I set Invalid data for decoder/encoder. I get only 1/4 part of image (top-left, as I understood) and it has invalid color and come color stripes. Maybe I set invalid strides and planes when encode frame, or maybe my setting data for libjpeg decoder is incorrect.. Please ask questions about my code, I'll try to make some explanations for you. I explodes my brain.. Thank you.

  • Museum of Multimedia Software, Part 2

    16 août 2010, par Multimedia Mike — Software Museum

    This installment includes a bunch of old, discontinued Adobe software as well as some Flash-related mutlimedia software.

    Screen Time for Flash Screen Saver Factory
    "Create High Impact Screen Savers Using Macromedia Flash."



    Requirements include Windows 3.1, 95 or NT 3.5.1. A 486 computer is required to play the resulting screensavers which are Flash projectors using Macromedia Flash 3.0.

    Monster Interactive Instant GUI 2
    Create eye-popping GUIs more easily for use in Flash. Usability experts would argue that this is not a good thing.



    Adobe Dimensions 3.0
    "The Easy Yet Powerful 3D Rendering Tool." This software was end-of-life’d in late 2004-early 2005 (depending on region).



    Adobe ImageStyler
    "Instantly add style to your Web site." Wikipedia claims that this product was sold from 1998 to 2000 when it was superseded by Adobe LiveMotion (see below).



    Google is able to excavate a link to the Latin American site for Adobe ImageStyler, a page that doesn’t seem to be replicated in any other language.

    Adobe LiveMotion
    "Professional Web graphics and animation." This is version 1, where the last version was #2, released in 2002.



    Adobe Streamline 4.0
    "The most powerful way to convert images into line art." This was discontinued in mid-2005.



    Adobe SuperATM
    "The magic that maintains the look of your documents." This is the oldest item in my collection. A close examination of the back of the box reveals an old Adobe logo. The latest copyright date on the box is 1992.



  • error : ‘avcodec_send_packet’ was not declared in this scope

    4 juillet 2018, par StarShine

    The following snippet of ffmpeg-based code is building and working on Windows VC2012, VC20155, VC2017.

    With gcc on Ubuntu LTS 16.04 this is giving me issues, more specifically it does not seem to recognize avcodec_send_packet, avcodec_receive_frame and struct AVCodecParameters, and possibly more functions and structures that I’m not currently using.

    error : ‘AVCodecParameters’ was not declared in this scope
    error : ‘avcodec_send_packet’ was not declared in this scope
    error : ‘avcodec_receive_frame ’ was not declared in this scope

    The code snippet is :

    // the includes are actually in a precompiled header, included in cmake
    extern "C" {

    #include <libavcodec></libavcodec>avcodec.h>
    #include <libavdevice></libavdevice>avdevice.h>
    #include <libavfilter></libavfilter>avfilter.h>
    #include <libpostproc></libpostproc>postprocess.h>
    #include <libswresample></libswresample>swresample.h>
    #include <libswscale></libswscale>swscale.h>
    #include <libavformat></libavformat>avformat.h>
    #include <libavutil></libavutil>avutil.h>  
    #include <libavutil></libavutil>avassert.h>
    #include <libavutil></libavutil>avstring.h>
    #include <libavutil></libavutil>bprint.h>
    #include <libavutil></libavutil>display.h>
    #include <libavutil></libavutil>mathematics.h>  
    #include <libavutil></libavutil>imgutils.h>
    //#include <libavutil></libavutil>libm.h>
    #include <libavutil></libavutil>parseutils.h>
    #include <libavutil></libavutil>pixdesc.h>
    #include <libavutil></libavutil>eval.h>
    #include <libavutil></libavutil>dict.h>
    #include <libavutil></libavutil>opt.h>
    #include <libavutil></libavutil>cpu.h>
    #include <libavutil></libavutil>ffversion.h>
    #include <libavutil></libavutil>version.h>

    }

    //
    ...
    {
       if (av_read_frame(m_FormatContext, m_Packet) &lt; 0) {
           av_packet_unref(m_Packet);
           m_AllPacketsSent = true;
       } else {
           if (m_Packet->stream_index == m_StreamIndex) {                  
               avcodec_send_packet(m_CodecContext, m_Packet);
           }
       }
    }
    ...

    I read up on the ffmpeg history and learned that on Debian based systems at one point they followed the fork to libavutil when that came about, and then recently some of the platforms switched back to the ffmpeg branch due to the fact that ffmpeg was much more actively supported in terms of bugfixes, features and support. As a result, some of the interfaces were possibly broken.

    I’ve seen git fixes on a library called mediatombs who seem to have ecountered the same if not very similar issues with codecpar (which I initially also had and fixed the same way) :

    https://github.com/gerbera/gerbera/issues/52

    https://github.com/gerbera/gerbera/commit/32efd463f138557c54535225d84136df95bab3dd#diff-af3b638bc2a3e6c650974192a53c7291

    Here the commit seems to fix their specific issue by wrapping the codecpar field that is being renamed back to codec, which I also applied and works.

    I wonder if anyone knows which functions can be used for the errors given above, since in fact these functions are themselves replacing deprecated functionality according the ffmpeg avcodec.h header comments. (https://www.ffmpeg.org/doxygen/trunk/avcodec_8h_source.html). I hope this does not mean I would have to settle back into avcodec_encode_video2() type of functions ?

    Update :

    For reference, it seems it has also popped up here : https://github.com/Motion-Project/motion/issues/338. The issue seems to be resolved if you can rebuild your ffmpeg stack.

    Update :

    To resolve the version API mingle, I ended up wiping out any ffmpeg reference and rebuilding ffmpeg from sources. This seems to push things further along in the right direction ; I have my source compiling correctly but there is still something wrong with the way I’m linking things together.

    Also, I’m using CMake to set up my makefiles, and using find_package for some of the dependencies and handwritten find_path / find_library stuff for everything else. I’ve seen other people complain about the following linking issue, and a ton of case-specific replies but none of them really shed some light on what the actual problem is. My installed Ubuntu version of ALSA is 1.1.xx but still I get complaints about a 0.9 version I’m supposedly linking. Anyone knows what’s wrong with this ?

    Also, my libasound.so is symbol linked into libasound.so.2.0.0 if that clears anything up. (Hope that double slashed path at the end is correct also).

    /usr/bin/ld: /usr/lib/ffmpeg/libavdevice.a(alsa.o): undefined reference to symbol 'snd_pcm_hw_params_any@@ALSA_0.9' //usr/lib/x86_64-linux-gnu/libasound.so.2: