Recherche avancée

Médias (0)

Mot : - Tags -/performance

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

Autres articles (35)

  • Encodage et transformation en formats lisibles sur Internet

    10 avril 2011

    MediaSPIP transforme et ré-encode les documents mis en ligne afin de les rendre lisibles sur Internet et automatiquement utilisables sans intervention du créateur de contenu.
    Les vidéos sont automatiquement encodées dans les formats supportés par HTML5 : MP4, Ogv et WebM. La version "MP4" est également utilisée pour le lecteur flash de secours nécessaire aux anciens navigateurs.
    Les documents audios sont également ré-encodés dans les deux formats utilisables par HTML5 :MP3 et Ogg. La version "MP3" (...)

  • Monitoring de fermes de MediaSPIP (et de SPIP tant qu’à faire)

    31 mai 2013, par

    Lorsque l’on gère plusieurs (voir plusieurs dizaines) de MediaSPIP sur la même installation, il peut être très pratique d’obtenir d’un coup d’oeil certaines informations.
    Cet article a pour but de documenter les scripts de monitoring Munin développés avec l’aide d’Infini.
    Ces scripts sont installés automatiquement par le script d’installation automatique si une installation de munin est détectée.
    Description des scripts
    Trois scripts Munin ont été développés :
    1. mediaspip_medias
    Un script de (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

Sur d’autres sites (5397)

  • how to stream h.264 video with mp3 audio using libavcodec ?

    29 août 2020, par dasg

    I read h.264 frames from webcamera and capture audio from microphone. I need to stream live video to ffserver. During debug I read video from ffserver using ffmpeg with following command :

    



    ffmpeg -i http://127.0.0.1:12345/robot.avi -vcodec copy -acodec copy out.avi


    



    My video in output file is slightly accelerated. If I add a audio stream it is accelerated several times. Sometimes there is no audio in the output file.

    



    Here is my code for encoding audio :

    



    #include "v_audio_encoder.h"&#xA;&#xA;extern "C" {&#xA;#include <libavcodec></libavcodec>avcodec.h>&#xA;}&#xA;#include <cassert>&#xA;&#xA;struct VAudioEncoder::Private&#xA;{&#xA;    AVCodec *m_codec;&#xA;    AVCodecContext *m_context;&#xA;&#xA;    std::vector m_outBuffer;&#xA;};&#xA;&#xA;VAudioEncoder::VAudioEncoder( int sampleRate, int bitRate )&#xA;{&#xA;    d = new Private( );&#xA;    d->m_codec = avcodec_find_encoder( CODEC_ID_MP3 );&#xA;    assert( d->m_codec );&#xA;    d->m_context = avcodec_alloc_context3( d->m_codec );&#xA;&#xA;    // put sample parameters&#xA;    d->m_context->channels = 2;&#xA;    d->m_context->bit_rate = bitRate;&#xA;    d->m_context->sample_rate = sampleRate;&#xA;    d->m_context->sample_fmt = AV_SAMPLE_FMT_S16;&#xA;    strcpy( d->m_context->codec_name, "libmp3lame" );&#xA;&#xA;    // open it&#xA;    int res = avcodec_open2( d->m_context, d->m_codec, 0 );&#xA;    assert( res >= 0 );&#xA;&#xA;    d->m_outBuffer.resize( d->m_context->frame_size );&#xA;}&#xA;&#xA;VAudioEncoder::~VAudioEncoder( )&#xA;{&#xA;    avcodec_close( d->m_context );&#xA;    av_free( d->m_context );&#xA;    delete d;&#xA;}&#xA;&#xA;void VAudioEncoder::encode( const std::vector&amp; samples, std::vector&amp; outbuf )&#xA;{&#xA;    assert( (int)samples.size( ) == d->m_context->frame_size );&#xA;&#xA;    int outSize = avcodec_encode_audio( d->m_context, d->m_outBuffer.data( ),&#xA;                                        d->m_outBuffer.size( ), reinterpret_cast<const>( samples.data( ) ) );&#xA;    if( outSize ) {&#xA;        outbuf.resize( outSize );&#xA;        memcpy( outbuf.data( ), d->m_outBuffer.data( ), outSize );&#xA;    }&#xA;    else&#xA;        outbuf.clear( );&#xA;}&#xA;&#xA;int VAudioEncoder::getFrameSize( ) const&#xA;{&#xA;    return d->m_context->frame_size;&#xA;}&#xA;</const></cassert>

    &#xA;&#xA;

    Here is my code for streaming video :

    &#xA;&#xA;

    #include "v_out_video_stream.h"&#xA;&#xA;extern "C" {&#xA;#include <libavformat></libavformat>avformat.h>&#xA;#include <libavutil></libavutil>opt.h>&#xA;#include <libavutil></libavutil>avstring.h>&#xA;#include <libavformat></libavformat>avio.h>&#xA;}&#xA;&#xA;#include <stdexcept>&#xA;#include <cassert>&#xA;&#xA;struct VStatticRegistrar&#xA;{&#xA;    VStatticRegistrar( )&#xA;    {&#xA;        av_register_all( );&#xA;        avformat_network_init( );&#xA;    }&#xA;};&#xA;&#xA;VStatticRegistrar __registrar;&#xA;&#xA;struct VOutVideoStream::Private&#xA;{&#xA;    AVFormatContext * m_context;&#xA;    int m_videoStreamIndex;&#xA;    int m_audioStreamIndex;&#xA;&#xA;    int m_videoBitrate;&#xA;    int m_width;&#xA;    int m_height;&#xA;    int m_fps;&#xA;    int m_bitrate;&#xA;&#xA;    bool m_waitKeyFrame;&#xA;};&#xA;&#xA;VOutVideoStream::VOutVideoStream( int width, int height, int fps, int bitrate )&#xA;{&#xA;    d = new Private( );&#xA;    d->m_width = width;&#xA;    d->m_height = height;&#xA;    d->m_fps = fps;&#xA;    d->m_context = 0;&#xA;    d->m_videoStreamIndex = -1;&#xA;    d->m_audioStreamIndex = -1;&#xA;    d->m_bitrate = bitrate;&#xA;    d->m_waitKeyFrame = true;&#xA;}&#xA;&#xA;bool VOutVideoStream::connectToServer( const std::string&amp; uri )&#xA;{&#xA;    assert( ! d->m_context );&#xA;&#xA;    // initalize the AV context&#xA;    d->m_context = avformat_alloc_context();&#xA;    if( !d->m_context )&#xA;        return false;&#xA;    // get the output format&#xA;    d->m_context->oformat = av_guess_format( "ffm", NULL, NULL );&#xA;    if( ! d->m_context->oformat )&#xA;        return false;&#xA;&#xA;    strcpy( d->m_context->filename, uri.c_str( ) );&#xA;&#xA;    // add an H.264 stream&#xA;    AVStream *stream = avformat_new_stream( d->m_context, NULL );&#xA;    if ( ! stream )&#xA;        return false;&#xA;    // initalize codec&#xA;    AVCodecContext* codec = stream->codec;&#xA;    if( d->m_context->oformat->flags &amp; AVFMT_GLOBALHEADER )&#xA;        codec->flags |= CODEC_FLAG_GLOBAL_HEADER;&#xA;    codec->codec_id = CODEC_ID_H264;&#xA;    codec->codec_type = AVMEDIA_TYPE_VIDEO;&#xA;    strcpy( codec->codec_name, "libx264" );&#xA;//    codec->codec_tag = ( unsigned(&#x27;4&#x27;) &lt;&lt; 24 ) &#x2B; (unsigned(&#x27;6&#x27;) &lt;&lt; 16 ) &#x2B; ( unsigned(&#x27;2&#x27;) &lt;&lt; 8 ) &#x2B; &#x27;H&#x27;;&#xA;    codec->width = d->m_width;&#xA;    codec->height = d->m_height;&#xA;    codec->time_base.den = d->m_fps;&#xA;    codec->time_base.num = 1;&#xA;    codec->bit_rate = d->m_bitrate;&#xA;    d->m_videoStreamIndex = stream->index;&#xA;&#xA;    // add an MP3 stream&#xA;    stream = avformat_new_stream( d->m_context, NULL );&#xA;    if ( ! stream )&#xA;        return false;&#xA;    // initalize codec&#xA;    codec = stream->codec;&#xA;    if( d->m_context->oformat->flags &amp; AVFMT_GLOBALHEADER )&#xA;        codec->flags |= CODEC_FLAG_GLOBAL_HEADER;&#xA;    codec->codec_id = CODEC_ID_MP3;&#xA;    codec->codec_type = AVMEDIA_TYPE_AUDIO;&#xA;    strcpy( codec->codec_name, "libmp3lame" );&#xA;    codec->sample_fmt = AV_SAMPLE_FMT_S16;&#xA;    codec->channels = 2;&#xA;    codec->bit_rate = 64000;&#xA;    codec->sample_rate = 44100;&#xA;    d->m_audioStreamIndex = stream->index;&#xA;&#xA;    // try to open the stream&#xA;    if( avio_open( &amp;d->m_context->pb, d->m_context->filename, AVIO_FLAG_WRITE ) &lt; 0 )&#xA;         return false;&#xA;&#xA;    // write the header&#xA;    return avformat_write_header( d->m_context, NULL ) == 0;&#xA;}&#xA;&#xA;void VOutVideoStream::disconnect( )&#xA;{&#xA;    assert( d->m_context );&#xA;&#xA;    avio_close( d->m_context->pb );&#xA;    avformat_free_context( d->m_context );&#xA;    d->m_context = 0;&#xA;}&#xA;&#xA;VOutVideoStream::~VOutVideoStream( )&#xA;{&#xA;    if( d->m_context )&#xA;        disconnect( );&#xA;    delete d;&#xA;}&#xA;&#xA;int VOutVideoStream::getVopType( const std::vector&amp; image )&#xA;{&#xA;    if( image.size( ) &lt; 6 )&#xA;        return -1;&#xA;    unsigned char *b = (unsigned char*)image.data( );&#xA;&#xA;    // Verify NAL marker&#xA;    if( b[ 0 ] || b[ 1 ] || 0x01 != b[ 2 ] ) {&#xA;        &#x2B;&#x2B;b;&#xA;        if ( b[ 0 ] || b[ 1 ] || 0x01 != b[ 2 ] )&#xA;            return -1;&#xA;    }&#xA;&#xA;    b &#x2B;= 3;&#xA;&#xA;    // Verify VOP id&#xA;    if( 0xb6 == *b ) {&#xA;        &#x2B;&#x2B;b;&#xA;        return ( *b &amp; 0xc0 ) >> 6;&#xA;    }&#xA;&#xA;    switch( *b ) {&#xA;    case 0x65: return 0;&#xA;    case 0x61: return 1;&#xA;    case 0x01: return 2;&#xA;    }&#xA;&#xA;    return -1;&#xA;}&#xA;&#xA;bool VOutVideoStream::sendVideoFrame( std::vector&amp; image )&#xA;{&#xA;    // Init packet&#xA;    AVPacket pkt;&#xA;    av_init_packet( &amp;pkt );&#xA;    pkt.flags |= ( 0 >= getVopType( image ) ) ? AV_PKT_FLAG_KEY : 0;&#xA;&#xA;    // Wait for key frame&#xA;    if ( d->m_waitKeyFrame ) {&#xA;        if( pkt.flags &amp; AV_PKT_FLAG_KEY )&#xA;            d->m_waitKeyFrame = false;&#xA;        else&#xA;            return true;&#xA;    }&#xA;&#xA;    pkt.stream_index = d->m_videoStreamIndex;&#xA;    pkt.data = image.data( );&#xA;    pkt.size = image.size( );&#xA;    pkt.pts = pkt.dts = AV_NOPTS_VALUE;&#xA;&#xA;    return av_write_frame( d->m_context, &amp;pkt ) >= 0;&#xA;}&#xA;&#xA;bool VOutVideoStream::sendAudioFrame( std::vector&amp; audio )&#xA;{&#xA;    // Init packet&#xA;    AVPacket pkt;&#xA;    av_init_packet( &amp;pkt );&#xA;    pkt.stream_index = d->m_audioStreamIndex;&#xA;    pkt.data = audio.data( );&#xA;    pkt.size = audio.size( );&#xA;    pkt.pts = pkt.dts = AV_NOPTS_VALUE;&#xA;&#xA;    return av_write_frame( d->m_context, &amp;pkt ) >= 0;&#xA;}&#xA;</cassert></stdexcept>

    &#xA;&#xA;

    Here is how I use it :

    &#xA;&#xA;

    BOOST_AUTO_TEST_CASE(testSendingVideo)&#xA;{&#xA;    const int framesToGrab = 90000;&#xA;&#xA;    VOutVideoStream stream( VIDEO_WIDTH, VIDEO_HEIGHT, FPS, VIDEO_BITRATE );&#xA;    if( stream.connectToServer( URI ) ) {&#xA;        VAudioEncoder audioEncoder( AUDIO_SAMPLE_RATE, AUDIO_BIT_RATE );&#xA;        VAudioCapture microphone( MICROPHONE_NAME, AUDIO_SAMPLE_RATE, audioEncoder.getFrameSize( ) );&#xA;&#xA;        VLogitecCamera camera( VIDEO_WIDTH, VIDEO_HEIGHT );&#xA;        BOOST_REQUIRE( camera.open( CAMERA_PORT ) );&#xA;        BOOST_REQUIRE( camera.startCapturing( ) );&#xA;&#xA;        std::vector image, encodedAudio;&#xA;        std::vector voice;&#xA;        boost::system_time startTime;&#xA;        int delta;&#xA;        for( int i = 0; i &lt; framesToGrab; &#x2B;&#x2B;i ) {&#xA;            startTime = boost::posix_time::microsec_clock::universal_time( );&#xA;&#xA;            BOOST_REQUIRE( camera.read( image ) );&#xA;            BOOST_REQUIRE( microphone.read( voice ) );&#xA;            audioEncoder.encode( voice, encodedAudio );&#xA;&#xA;            BOOST_REQUIRE( stream.sendVideoFrame( image ) );&#xA;            BOOST_REQUIRE( stream.sendAudioFrame( encodedAudio ) );&#xA;&#xA;            delta = ( boost::posix_time::microsec_clock::universal_time( ) - startTime ).total_milliseconds( );&#xA;            if( delta &lt; 1000 / FPS )&#xA;                boost::thread::sleep( startTime &#x2B; boost::posix_time::milliseconds( 1000 / FPS - delta ) );&#xA;        }&#xA;&#xA;        BOOST_REQUIRE( camera.stopCapturing( ) );&#xA;        BOOST_REQUIRE( camera.close( ) );&#xA;    }&#xA;    else&#xA;        std::cout &lt;&lt; "failed to connect to server" &lt;&lt; std::endl;&#xA;}&#xA;

    &#xA;&#xA;

    I think my problem is in PTS and DTS. Can anyone help me ?

    &#xA;

  • Blog series part 1 : How to use Matomo to increase customer acquisitions for your business

    2 septembre 2020, par Joselyn Khor — Analytics Tips, Marketing

    Are you investing time and money into marketing your business and unsure if it’s paying off ? Web analytics provides the tools and insights to help you know which marketing channels to target and focus on. Without it you might be going in blind and missing opportunities that might’ve been easily found in your metrics.

    Increasing acquisition cheat sheet

    To increase customer acquisition on your website you need to first attract the right visitors to your website. Then capturing their attention and engaging them in your content. Finally you’ll want to convert by driving them through a streamlined funnel/buyer’s journey on your website all backed up by data.

    So, how do you attract audiences to your site with a web analytics tool like Matomo ?

    1. Figure out who your audience is through the Visitor Profiles feature. 
    2. Calculate the Cost of Customer Acquisition (CAC) to plan for growth. To grow and make your business/website sustainable, you’ll need to earn more money from a customer than you spend on acquiring them. How to calculate : Divide marketing spend by the number of customers acquired. 
    3. Figure out which marketing channels e.g., social media, PPC, SEO, content marketing, etc., you should invest more in and which of those you should focus less on.

    How to increase acquisitions with Matomo

    1. Use the Acquisitions feature
    2. Use funnels
    3. Study Visitor Profiles
    4. Focus on SEO efforts
    5. Look at the Multi Attribution feature
    6. Set goals
    7. Set Advanced eCommerce reporting

    1. Use the Acquisitions feature

    Matomo Analytics has a dedicated Acquisition feature to help with some of the heavy-lifting, making it easy for you to formulate targeted acquisition plans.

    Acquisitions feature

    This feature helps you learn who your potential customers are and figure out what marketing channels are converting the best for these visitors.

    • Learn what traffic you get from external websites : Knowing who’s helping you succeed from external websites is a crucial step to be able to focus your attention. Paid sponsorships, guest blog posts or even spending more on advertising on the particular website could result in greater traffic.
    • Social Networks : See which social media channels are connecting with the audiences you want. Take the guesswork out by using only the ones you need. By finding out which social channels your ideal audience prefers, you can generate shareable, convincing and engaging content to drive shares and traffic through to your site.
    • Campaigns : Your marketing team may have spent precious time and resource coming up with campaigns that are designed to succeed, but how can you be so sure ? With Campaigns you can understand what marketing campaigns are working, what aren’t, and shift your marketing efforts accordingly to gain more visitors, more effectively, with less costs. Keep track of every ad and content piece you display across internal and external channels to see which is having the biggest impact on your business objectives. Learn more

    Watch this video to learn about the Acquisitions feature

    2. Use funnels

    Creating conversion funnels gives you the big picture on whether your acquisition plans are paying off and where they may be falling short.

    Funnels feature

    If the ultimate goal of your site is to drive conversions, then each funnel can tell you how effectively you’re driving traffic through to your desired outcome.

    By integrating this with Visitor Profiles, you can view historic visitor profiles of any individual user at any stage of the conversion funnel. You see the full user journey at an individual level, including where they entered the funnel from and where they exited. Learn more

    How to amplify acquisition strategies with Funnels : Use conversion funnels to guide acquisition as you can tell which entry point is bringing the most success and which one needs more attention. Tailor your strategies to zone in on areas that have the most potential. You can identify where your visitors are encountering obstacles from the start, that are stopping them from progressing through their journey on your site.

    3. Study Visitor Profiles

    Visitor Profiles helps you understand visitors on a user-by-user basis, detailing each visitors’ history into a profile which summarises every visit, action and purchase made.

    Visitor Profiles feature

    Better understand :

    • Why your visitors viewed your website.

    • Why your returning visitors continue to view your website.

    • What specifically your visitors are looking for and whether they found it on your website.

    The benefit is being able to see how a combination of acquisition channels play a part in a single buyer’s journey.

    How Visitor Profiles helps with acquisition : By understanding the full behavioural patterns of any individual user coming through from external channels, you’ll see the path that led them to take action, where they may have gotten lost, and how engaged they are with your business over time. This gives you an indication of what kinds of visitors you’re attracting and helps you craft a buyer persona that more accurately reflects the audience most interested in you.

    4. Focus on SEO efforts

    Every acquisition plan needs a focus on maximising your Search Engine Optimization (SEO) efforts. When it comes to getting conclusive search engine referrer metrics, you need to be sure you’re getting ALL the insights to drive your SEO strategy.

    Integrate Google, Bing and Yahoo search consoles directly into your Matomo Analytics. This helps kickstart your acquisition goals as you rank highly for keywords that get the most traffic to your website.

    As another major SEO benefit, you can see how the most important search keywords to your business increased and decreased in ranking over time. 

    How to amplify acquisitions strategies with search engines and keywords : By staying on top of your competitors across ALL search engines, you may uncover traffic converting highly from one search engine, or find you could be losing traffic and business opportunities to your competitors across others.

    5. Look at the Multi Attribution feature

    Multi Attribution lets you measure the success of every touchpoint in the customer journey.

    Multi Attribution feature

    Accurately measure (and assign value to) channels where visitors first engaged with your business, where they came from after that, as well as the final channel they came from before purchasing your product or service.

    No longer falsely over-estimate any marketing channel and make smarter decisions when determining acquisition spend to accurately calculate the Customer Acquisition Cost (CAC). Learn more

    6. Set your Goals

    What are the acquisition goals you want to achieve the most ? The Goals feature lets you measure the most important metrics you need to grow your business.

    Goals feature

    Goals are crucial for building your marketing strategy and acquiring new customers. The more goals you track, the more you can learn about behavioural changes as you implement and modify paths that impact acquisition and conversions over time. You’ll understand which channels are converting the best for your business, which cities/countries are most popular, what devices will attract the most visitors and how engaged your visitors are before converting.

    This way you can see if your campaigns (SEO, PPC, signups, blogs etc.) or optimising efforts (A/B Testing, Funnels) have made an impact with the time and investment you have put in. Learn more

    7. Set Advanced Ecommence reporting

    If your website’s overall purpose is to generate revenue whether it be from an online store, asking for donations or from an online paid membership site ; the Ecommerce feature gives you comprehensive insights into your customers’ purchasing behaviours.

    Ecommerce feature

    When you use Ecommerce analytics, you heavily reduce risk when marketing your products to potential customers because you will understand who to target, what to target them with and where further opportunities exist to have the greatest impact for your business. Learn more

    Key takeaway

    Having the tools to ensure you’re creating a well planned acquisition strategy is key to attracting and capturing the attention of potential visitors/leads, and then driving them through a funnel/buyer’s journey on your website. Because of Matomo’s reputation as a trusted analytics platform, the features above can be used to assist you in making smarter data-driven decisions. You can pursue different acquisition avenues with confidence and create a strategy that’s agile and ready for success, all while respecting user privacy.

    Want to learn how to increase engagement with Matomo ? Look out for part 2 ! We’ll go through how you can boost engagement on your website via web analytics.

  • Song name under video

    2 septembre 2020, par ottpeter

    I'm trying to write the song name under the video with ffmpeg. My mp3 files are running in a loop like this :&#xA;-stream_loop -1 -i music.txt&#xA;My workaround would be to write an SRT file with timecodes, a script would determine when next song is comming, and I would repeat this, let's say, a 1000 times (time codes adjusted), then I would get song names for a month for example. (this would be done before ffmpeg is started)&#xA;Obviously this is not optimal, especially because I can't loop the SRT file as well, because of the timecode. It would be better to do this with a filter complex.

    &#xA;

    Is there a way to know the name of the mp3 that is currently playing, in ffmpeg ?

    &#xA;