Recherche avancée

Médias (1)

Mot : - Tags -/getid3

Autres articles (99)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    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 (...)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

  • L’agrémenter visuellement

    10 avril 2011

    MediaSPIP est basé sur un système de thèmes et de squelettes. Les squelettes définissent le placement des informations dans la page, définissant un usage spécifique de la plateforme, et les thèmes l’habillage graphique général.
    Chacun peut proposer un nouveau thème graphique ou un squelette et le mettre à disposition de la communauté.

Sur d’autres sites (11751)

  • how to add text to the video in android ?

    4 octobre 2024, par Sajad Norouzi

    In my app I record a video and I wanna overlay the url of my company on the right bottom of that video. I record video with MediaRecorder and there is no problem with the recording, but for adding text to the video I haven't been successful. I searched and found some library like FFmpeg and JavaCV which let user overlay a text on the video but I don't know if there is any way for using them in Android. after that found OnPreviewFrame which returns each frame of the camerapreivew. I want to get all frames after user touch record button and draw text using canvas to each frame and then save all those frame together until recording video stops, and videos duration are fix and 15 seconds. Is it a good solution ? if it is, how should I implement OnPreviewFrame function ? I know how to draw canvas but I don't know how to convert data[] to the bitmap.

    


  • ffmpeg/libav - how to wirte video files with valid pts

    9 mai 2017, par Kai Rohmer

    I’m currently trying the write out a real time rendered video into a h264 encoded file. After reading a lot of (mostly) old samples and the few class references they call a documentation, I manager to write my video file and I’m also able to read it. Unfortunately, I need some metadata for each frame but I’m not having a constant frame rate. So my intension was to start with the presentation timestamps to "frametime" during recoding. But after all I tried I get no pts while reading the the file (pts stays -9223372036854775808). Before wring a lot of code, here are the basics steps I’m doing. I’m probably using the wrong container or I’m missing to set a flag and you will notice it right away.

    // open a AVFormatContext
    avformat_alloc_output_context2(&m_FormatContext, nullptr, "avi", m_FileName.c_str());

    // open a stream
    m_VideoStream = avformat_new_stream(m_FormatContext, avcodec_find_encoder(AV_CODEC_ID_H264));

    // setup the codec context (including bitrate, frame size, ...)
    m_CodecContext = m_VideoStream ->codec;
    m_CodecContext->coder_type = FF_CODER_TYPE_VLC;
    m_CodecContext->time_base = AVRational{1, 120}; // I expect 20-60 Hz
    m_CodecContext->pix_fmt = AV_PIX_FMT_YUV420P;
    m_CodecContext->color_range = AVCOL_RANGE_JPEG;
    ...
    av_opt_set(m_CodecContext->priv_data, "preset", "ultrafast", 0);
    av_opt_set(m_CodecContext->priv_data, "tune", "zerolatency,fastdecode", 0);


    // set the same time_base to the stream
    m_VideoStream ->time_base = m_CodecContext->time_base;

    // open the codec
    avcodec_open2(m_CodecContext, m_CodecContext->codec, nullptr);

    // open file and write header
    avio_open(&m_FormatContext->pb, m_FileName.c_str(), AVIO_FLAG_WRITE);
    avformat_write_header(m_FormatContext, nullptr);

    // then in a loop:
    // render frame, convert RGBA to YUV frame, set the frames pts (timestamp is double application time in seconds)
    frameToEncode.pts = int64_t(timestamp / av_q2d(m_VideoStream->time_base));
    av_init_packet(m_EncodedPacket);
    avcodec_encode_video2(m_CodecContext, m_EncodedPacket, frameToEncode, &got_output);

    // check packet infos
    //m_EncodedPacket->pts equals frameToEncode.pts
    m_EncodedPacket->dts = AV_NOPTS_VALUE; // also tried incrementing numbers, or zero
    m_EncodedPacket->stream_index = m_Stream->index;
    m_EncodedPacket->duration = 0;
    m_EncodedPacket->pos = -1;
    m_EncodedPacket->flags = 0;
    m_EncodedPacket->flags |= AV_PKT_FLAG_KEY; // read that somewhere

    // write the packet to stream
    av_interleaved_write_frame(m_FormatContext, m_EncodedPacket);


    // after the loop
    // I encode delayed frames and write the trailer
    av_write_trailer(m_FormatContext);

    Thats pretty much it. I’m not getting what is missing. Since I have some meta data per frame I tried to add side data to each package but this data also disapered after reading from file. If decode the packets directly (instead of writing them to file, the data is there)

    I’m quite sure the problem is with the encoding. I managed to decode the big buck bunny movie in which case i got valid pts values.

    Thanks a lot for your help !

  • The complete guide on tracking your websites and web apps into multiple Piwiks and how to do it easily & efficiently

    23 février 2017, par InnoCraft — Community, Development

    Getting the tracking of your website and apps right is crucial to your success as you need to ensure the measured data is meaningful and correct. That’s why we, at InnoCraft, help our clients setting up their web tracking and digital measurement strategy. Some challenges include tracking your analytics data into multiple Piwik services as well as the tracking of single-page websites and web applications (covered in a previous article). In this blog post, we explain how to track your data into multiple Piwik websites correctly.

    Embedding the tracking code

    First of all you need to embed your JavaScript tracking code into your website or app as usual. If you haven’t done this yet : Log in to your Piwik, click on “Administration” in the top right and go to “Tracking Code”. There you have various options to adjust your tracking code to your needs.

    Tracking the same data into different websites

    Let’s assume you have set up the regular JavaScript tracking code and you want to track the same data into a second Piwik website. This second Piwik website can be either on the same Piwik installation or on a different Piwik. To do this, add the following line to your tracking code :

    _paq.push(['addTracker', 'https://$yourPiwikDomain/piwik.php', idSite]);

    It should look like this :

    var u = '//$yourPiwikDomain';
    _paq.push(['addTracker', u + '/piwik.php', var idSite = 2]); // adds an additional tracker
    _paq.push(['setSiteId', '1']); // configures your regular Piwik tracker
    _paq.push(['setTrackerUrl', u + 'piwik.php']);

    This will track the same data into website 1 and website 2 of your Piwik installation. You can also change the domain in addTracker to point it to a different Piwik installation :

    _paq.push(['addTracker', '//$differentPiwikDomain/piwik.php', var idSite = 2]);

    All Piwik tracker methods that you call afterwards will be applied to all trackers. Say you call _paq.push(['disableCookies']); _paq.push(['trackPageView']);, then both methods will be called on all tracker instances assuring they will behave the same and will track the same data into both Piwik websites.

    Tracking different data into different websites

    If you want to track only certain data into one website, and different data into an additional website, you need to configure the trackers differently. For example, you want to enable link tracking only for one tracker, but not for the other. The problem is that calling _paq.push(['enableLinkTracking']); enables link tracking on all of your trackers. To workaround this limitation, you can configure your trackers differently like this :

    window.piwikAsyncInit = function () {
       Piwik.on('TrackerSetup', function (tracker) {
         if (tracker.getSiteId() == 2
            || tracker.getTrackerUrl() === '//$yourPiwikDomain/piwik.php') {
             tracker.enableLinkTracking();
            }
       });
    };

    Now it enables link tracking only for the tracker that is configured for a certain website ID or Piwik domain.

    Accessing a previously generated tracker instance

    When you configure a tracker via _paq.push, you create a so called “Async tracker” because Piwik will be loaded asynchronously and create the tracker instance as soon as it is loaded. If you need to get the instance of such a tracker, you can use the method Piwik.getAsyncTracker(trackerUrl, idSite). This can be useful if you have a single-page website and want to track different data into different websites :

    window.addEventListener('hashchange', function() {
       if ('undefined' === typeof Piwik) {
           // Piwik might not be loaded yet
           return;
       }
       var tracker1 = Piwik.getAsyncTracker('//$yourPiwikDomain/piwik.php', var idSite = 1);
       var tracker2 = Piwik.getAsyncTracker('//$yourPiwikDomain/piwik.php', var idSite = 2);
       tracker1.setCurrentUrl('/' + window.location.hash.substr(1));
       tracker2.setCurrentUrl('/mywebsite/' + window.location.hash.substr(1));
    });

    Tracking different data into multiple Piwik installations without using “_paq”

    Some users prefer to not use _paq.push and instead directly create tracker instances themselves using the method Piwik.getTracker(trackerUrl, idSite) like this :

    window.piwikAsyncInit = function () {
       var tracker1 = Piwik.getTracker('//$yourPiwikdomain/piwik.php', var idSite = 1);
       tracker1.disableCookies();
       var tracker2 = Piwik.getTracker('//$yourPiwikdomain/piwik.php', var idSite = 2);
       tracker2.enableLinkTracking();

       tracker1.trackPageView();
       tracker2.trackPageView();
    };

    We usually don’t recommend creating trackers manually as it is more complicated and you need to make sure to configure trackers in the right order. For example to prevent the setting of any cookies, it is recommended to call disableCookies before calling any other methods. If you want to create your trackers manually and you use any of the following methods, make sure to call them in this order :

    disableCookies(), setAPIUrl(), enableCrossDomainLinking(), setCookiePath(), setCookieDomain(), setDomains(), setUserId(), enableLinkTracking()

    Roll-Up Reporting – the easy and efficient way

    Often users track data into multiple websites because they need aggregated data over all their websites. They want to see all statistics for a single website, but also which pages were viewed across all their websites, or how much traffic they got from a specific website or search engine across all websites. This means they add a second tracker to all their websites and track data not only into the regular Piwik website, but also into one additional website that gives them statistics over all websites. This has several disadvantages :

    • Complexity in getting the tracking code right and the time needed to integrate and maintain it
    • Slower website performance because everything needs to be tracked into several websites. This can decrease your conversions and sales
    • Slower Piwik performance because it has to handle twice as much traffic. This means tracking becomes slower, generating the report becomes slower, and the database gets twice as big

    Luckily, there is a better solution called Roll-Up Reporting. With Roll-Up Reporting, you can get aggregated data over all websites and / or for a group of websites without any of these disadvantages. It lets you create as many Roll-Ups as you wish and you can choose which websites’ data should be aggregated together into a new website.

    We had customers who were able to remove one Piwik tracker because of this feature which resulted in less server costs, a faster website, and a faster Piwik. On top of all these advantages, it also lets you view the Visitor Log, Real-time Map, and other widgets and reports across several websites.

    Questions ?

    If you got any questions, please let us know and get in touch with us. You can find more information about the Piwik JavaScript tracker on the Piwik Developer Zone. There is a section dedicated to Multiple Piwik Trackers.