Recherche avancée

Médias (1)

Mot : - Tags -/Rennes

Autres articles (54)

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

  • Les statuts des instances de mutualisation

    13 mars 2010, par

    Pour des raisons de compatibilité générale du plugin de gestion de mutualisations avec les fonctions originales de SPIP, les statuts des instances sont les mêmes que pour tout autre objets (articles...), seuls leurs noms dans l’interface change quelque peu.
    Les différents statuts possibles sont : prepa (demandé) qui correspond à une instance demandée par un utilisateur. Si le site a déjà été créé par le passé, il est passé en mode désactivé. publie (validé) qui correspond à une instance validée par un (...)

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

Sur d’autres sites (7826)

  • mpeg2 ts android ffmpeg openmax

    10 octobre 2014, par WLGfx

    The setup is as follows :

    1. Multicast server 1000Mbs, UDP, Mpeg2-TS Part 1 (H.222) streaming live TV-channels.
    2. Quad core 1.5Ghz Android 4.2.2 GLES 2.0 renderer.
    3. FFMpeg library.
    4. Eclipse Kepler, Android SDK/NDK, etc. Running on Windows 8.1.
    5. Output screen 1920 x 1080, I am using a texture of 2048 x 1024 and getting between 35 and 45 Frames per second.

    The app :

    1. Renderer thread runs continuously and updates a single texture by uploading segments to the gpu when media images are ready.
    2. Media handler thread, downloads and processes media from server/or local storage.
    3. Video thread(s), one for buffering the UDP packets and another for decoding the packets into frames.

    I am connecting ffmpeg to the UDP stream just fine and the packets are being buffered and seemingly decoded fine. The packet buffers are plenty, no under/over-flows. The problem I am facing is it appears to be chopping up frames (ie only playing back 1 out of every so many frames). I understand that I need to distinguish I/P/B frames, but at the moment, hands up, I ain’t got a clue. I’ve even tried a hack to detect I frames to no avail. Plus, I am only rendering the frames to less than a quarter of the screen. So I’m not using full screen decoding.

    The decoded frames are also stored in separate buffers to cut out page tearing. The number of buffers I’ve changed too, from 1 to 10 with no luck.

    From what I’ve found about OpenMax IL, is it only handles MPeg2-TS Part 3 (H.264 and AAC), but you can use your own decoder. I understand that you can add your own decode component to it. Would it be worth me trying this route or should I continue on with ffmpeg ?

    The frame decoder (only the renderer will convert and scale the frames when ready)
    /*
    * This function will run through the packets and keep decoding
    * until a frame is ready first, or out of packets
    */

    while (packetsUsed[decCurrent])
    {
       hack_for_i_frame:
       i = avcodec_decode_video2(pCodecCtx, pFrame, &frameFinished, &packets[decCurrent]);
       packetsUsed[decCurrent] = 0; // finished with this one
       i = packets[decCurrent].flags & 0x0001;
       decCurrent++;
       if (decCurrent >= MAXPACKETS) decCurrent = 0;
       if (frameFinished)
       {
           ready_pFrame = pFrame;
           frameReady = true;  // notify renderer
           frameCounter++;
           if (frameCounter>=MAXFRAMES) frameCounter = 0;
           pFrame = pFrames[frameCounter];
           return 0;
       }
       else if (i)
           goto hack_for_i_frame;
    }

    return 0;

    The packet reader (spawned as a pthread)
    void *mainPacketReader(void *voidptr)

    int res ;

    while ( threadState == TS_RUNNING )
    {
       if (packetsUsed[prCurrent])
       {
           LOGE("Packet buffer overflow, dropping packet...");
           av_read_frame( pFormatCtx, &packet );
       }
       else if ( av_read_frame( pFormatCtx, &packets[prCurrent] ) >= 0 )
       {
           if ( packets[prCurrent].stream_index == videoStream )
           {
               packetsUsed[prCurrent] = 1; // flag as used
               prCurrent++;
               if ( prCurrent >= MAXPACKETS )
               {
                   prCurrent = 0;
               }
           }

           // here check if the packet is audio and add to audio buffer
       }
    }
    return NULL;

    And the renderer just simply does this
    // texture has already been bound before calling this function

    if ( frameReady == false ) return;

    AVFrame *temp;  // set to frame 'not' currently being decoded
    temp = ready_pFrame;

    sws_scale(sws_ctx,(uint8_t const* const *)temp->data,
           temp->linesize, 0, pCodecCtx->height,
           pFrameRGB->data, pFrameRGB->linesize);

    glTexSubImage2D(GL_TEXTURE_2D, 0,
           XPOS, YPOS, WID, HGT,
           GL_RGBA, GL_UNSIGNED_BYTE, buffer);

    frameReady = false;

    In the past, libvlc had audio syncing problems too, so that is my decision for going with ffmpeg and doing all the donkey work from scratch.

    If anybody has any pointers of how to stop the choppiness of the video playback (works great in VLC player) or possibly another route to go down, it would be seriously appreciated.

    EDIT I removed the hack for the I-frame (completely useless). Move the sws_scale function from the renderer to the packet decoder. And I left the udp packet reader thread alone.

    In the meantime I’ve also changed the packet reader thread and the packet decoder threads priority to real-time. Since doing that I don’t get shed loads of dropped packets.

  • How to fix the problem I'm having with FFmpeg ?

    23 février 2023, par John

    I'm working with the ffmpeg library to convert mp4 video files to mp3 audio files.
Here is my code :

    


    package com.exer;


import android.app.Activity;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.os.Environment;
import android.widget.Toast;
import com.github.hiteshsondhi88.libffmpeg.ExecuteBinaryResponseHandler;
import com.github.hiteshsondhi88.libffmpeg.FFmpeg;
import com.github.hiteshsondhi88.libffmpeg.FFmpegLoadBinaryResponseHandler;

public class MainActivity extends Activity {
    
    FFmpeg ffmpeg;
    private ProgressDialog progressDialog;
    
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    
        
        
        try {
            setUp();
            String[] command = {
                "-i", getPaths()+"/dir/input.mp4", "-vn", getPaths()+"/dir/output.mp3"
            };
            //convert("ffmpeg -i input.mp4 -vn output.mp3");
            convert(command);
            
        } catch (Exception e) {
            Toast.makeText(getApplicationContext(), e.getCause().toString(), Toast.LENGTH_SHORT).show();
        }
    }
    
    
    public void setUp() throws Exception {
        
        if(ffmpeg == null) {
            
            ffmpeg = FFmpeg.getInstance(this);
            ffmpeg.loadBinary(new FFmpegLoadBinaryResponseHandler(){
                    
            @Override
            public void onFailure() {
                Toast.makeText(getApplicationContext(), "failed to load library", Toast.LENGTH_SHORT).show();   
            }
                    
            @Override
            public void onSuccess() {
                Toast.makeText(getApplicationContext(), "loaded!", Toast.LENGTH_SHORT).show();
            }
                    
            @Override
            public void onStart() {
                        
            }
                    
            @Override
            public void onFinish() {
                        
            }
                    
                    
            });
            
        }
        
    }
    
    
    private void convert(String[] cmd) throws Exception {
        
        ffmpeg.execute(cmd, new ExecuteBinaryResponseHandler(){
            
            @Override
            public void onFailure(String message){
                super.onFailure(message);
            }
            
            @Override
            public void onFinish(){
                super.onFinish();
                Toast.makeText(getApplicationContext(), "finished!", Toast.LENGTH_SHORT).show();
            }
            
            @Override
            public void onStart(){
                super.onStart();
                Toast.makeText(getApplicationContext(), "start conversion...", Toast.LENGTH_SHORT).show();
            }
            
            @Override
            public void onProgress(String message){
                super.onProgress(message);
            }
        });
        
    
    }
    
    private String getPaths() {
        return Environment.getExternalStorageDirectory().getPath();
    }
    
}


    


    When I run the app, the Toast messages are shown :

    


    loaded!
start converting...
finished! as I write them in the functions, apart that nothing else happens the file is not converted what's wrong ?

    


    Here my manifest file :

    


    &lt;?xml version="1.0" encoding="utf-8"?>&#xA;<manifest package="com.exer">&#xA;    &#xA;    &#xA;    &#xA;    &#xA;    &#xA;        &#xA;            &#xA;                <action></action>&#xA;&#xA;                <category></category>&#xA;            &#xA;        &#xA;    &#xA;&#xA;</manifest>&#xA;

    &#xA;

    I've tried to delete the specified file on the phone to see what erros I might got, but still those three Toasts.

    &#xA;

  • Google Analytics 4 (GA4) vs Matomo

    7 avril 2022, par Erin

    Google announced that Universal Analytics’ days are numbered. Universal Analytics will be replaced by Google Analytics 4 (or GA4) on the 1st of July 2023. 

    If Google Analytics users want to compare year-on-year data, they have until July 2022 to get set up and start collecting data before the sun sets on Universal Analytics (or UA).

    But is upgrading to Google Analytics 4 the right move ? There’s a lot to consider, and many organisations are looking for an alternative to Google Analytics. So in this blog, we’ll compare GA4 to Matomo – the leading Google Analytics alternative. 

    In this blog, we’ll look at :

    What is Matomo ?

    Matomo is a powerful privacy-first web analytics platform that gives you 100% data ownership. First launched in 2007, Matomo is now the world’s leading open-source web analytics platform and is used by more than 1 million websites. 

    Matomo’s core values are based on ethical data collection and processing. Consistently more businesses and organisations from around the globe are adopting data-privacy-compliant web analytics solutions like Matomo. 

    Matomo offers both Cloud and On-Premise solutions (and a five-star rated WordPress plugin), making for an adaptable and flexible solution. 

    What is Google Analytics 4 ?

    Google Analytics 4 is the latest version of Google Analytics and represents a completely new approach to data-modelling than its predecessor, Universal Analytics. For an in-depth look at how GA4 and UA compare, check out this Google Analytics 4 vs Universal Analytics comparison

    Google Analytics 4 will soon be the only available version of analytics software from Google. So what’s the issue ? Surely, in 2022, Google makes it easy to migrate to their newest (and only) analytics platform ? Not quite.

    Google Analytics 4 vs Matomo

    Whilst the core purpose of GA4 and Matomo is similar (providing web analytics that help to optimise your website and grow your business), there are several key differences that organisations should consider before making the switch.

    Importing Historical Data from Universal Analytics

    Google Analytics 4

    Users assuming that historical data from Universal Analytics could be imported into Google Analytics 4 were faced with swift disappointment. Unfortunately, Google Analytics 4 does not have an option to import data from its predecessor, Universal Analytics. This means that businesses won’t be able to import and compare data from previous years.

    Matomo

    If you don’t want to start from scratch with your web analytics data, then Matomo is an ideal solution for data continuity. Matomo offers users the ability to import their historical Universal Analytics data. So you can keep all that valuable historical data you’ve collected over the years.

    Google Analytics 4 Migration
    Tino Didriksen via Twitter

    User Interface

    Google Analytics 4

    GA4’s new user interface has been met with mixed reviews. Many claim that it’s overly complex and difficult to navigate. Some have even suggested that the tool has been designed specifically for enterprises with specialised analytics teams. 

    Kevin Levesquea via Twitter

    Matomo

    Matomo, on the other hand, is recognised for an easy to use interface, with a rating of 4.5 out of 5 stars for ease of use on Capterra. Matomo perfectly balances powerful features with a user-friendly interface so valuable insights are only a click away. There’s a reason why over 1 million websites are using Matomo. 

    Matomo Features

    Advanced Behavioural Analytics Features 

    Google Analytics 4

    While Google Analytics is undoubtedly robust in some areas (machine learning, for instance), what it really lacks is advanced behavioural analytics. Heatmaps, session recordings and other advanced tools can give you valuable insights into how users are engaging with your site. Well beyond pageviews and other metrics.

    Unfortunately, with this new generation of GA, Google still hasn’t introduced these features. So users have to manage subscriptions and tracking in third-party behavioural analytics tools like Hotjar or Lucky Orange, for example. This is inefficient, costly and time-consuming to manage. 

    Matomo Heatmaps Feature

    Matomo 

    Meanwhile, Matomo is a one-stop shop for all of your web analytics needs. Not only do you get access to the metrics you’ve grown accustomed to with Universal Analytics, but you also get built-in behavioural analytics features like Heatmaps, Scroll Depth, Session Recordings and more. 

    Want to know if visitors are reaching your call to action at the bottom of the page ? Scroll Depth will answer that.

    Want to know why visitors aren’t clicking through to the next page ? Heatmaps will give you the insights you need.

    You get the picture – the full picture, that is. 

    All-in-one web analytics

    Data Accuracy

    Google Analytics 4

    GA4 aims to make web and app analytics more privacy-centric by reducing the reliance on cookies to record certain events across platforms and devices. 

    However, when site and application visitors opt-out of cookie tracking, GA4 instead relies on machine learning to fill in the gaps. Data sampling could mean that your business is making business decisions based on inaccurate reports. 

    Matomo

    Data is the backbone of web analytics, so why make critical business decisions on sampled data ? With Matomo, you’re guaranteed 100% unsampled accurate data. So you can rest assured that any decisions you make are based on actual facts. 

    Compliance with Privacy Laws (GDPR, CCPA, etc.) 

    Google Analytics 4

    Google is making changes in an attempt to become compliant with privacy laws. However, even with GA4, users are still transferring data to the US. For this reason, both Austrian and French governments have ruled Google Analytics illegal under GDPR.

    The only possible workaround is “Privacy Shield 2.0”, but GDPR experts are still sceptical of this one. 

    Matomo

    If compliance with global privacy laws is a concern (and it should be), then Matomo is the clear winner here. 

    As an EU hosted web analytics tool, your data is stored in Europe, and no data is transferred to the US. On the other hand, if you choose to self-host, the data is stored in your country of choice.

    In addition, with cookieless tracking enabled, you can say goodbye to those pesky cookie consent screens. 

    Also, remember that under GDPR, and many other data privacy laws like CCPA and LGPD, end users have a legal right to access, amend and/or erase the personal data collected about them. 

    With Matomo you get 100% ownership of your web analytics data. This means that we don’t on-sell to third parties ; can’t claim ownership of the data ; and you can export your data at any time.

    Matomo vs GA4
    @tersmantoll via Twitter

    Wrap up

    At the end of the day, the worst thing an organisation can do is nothing. Waiting until July 2023 to migrate to GA4 or another web analytics platform would be very disruptive and costly. Organisations need to consider their options now and start migrating in the next few months. 

    With all that said, moving to Google Analytics 4 could prove to be a costly and time-consuming operation. The global trend towards increased data privacy is a threat to platforms like Google Analytics which uses data for advertising and transfers data across borders.

    With Matomo, you get an easy to use all-in-one web analytics platform and keep your historical Universal Analytics data. Plus, you can future-proof your business by being compliant with global privacy laws and get access to advanced behavioural analytics features. 

    There’s a lot to weigh up here but fortunately, getting started with Matomo is easy. Try it free for 21-days (no credit card required) and see for yourself why over 1 million websites choose Matomo. 

    While this is the end of the road for Universal Analytics, it’s also an opportune time for organisations to find a better fit web analytics tool.