Recherche avancée

Médias (1)

Mot : - Tags -/copyleft

Autres articles (77)

  • Librairies et logiciels spécifiques aux médias

    10 décembre 2010, par

    Pour un fonctionnement correct et optimal, plusieurs choses sont à prendre en considération.
    Il est important, après avoir installé apache2, mysql et php5, d’installer d’autres logiciels nécessaires dont les installations sont décrites dans les liens afférants. Un ensemble de librairies multimedias (x264, libtheora, libvpx) utilisées pour l’encodage et le décodage des vidéos et sons afin de supporter le plus grand nombre de fichiers possibles. Cf. : ce tutoriel ; FFMpeg avec le maximum de décodeurs et (...)

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

Sur d’autres sites (5946)

  • Matomo vs WP-Statistics – which web analytics plugin suits you best ?

    2 avril 2020, par Joselyn Khor — Analytics Tips, Plugins

    Due to the endless choices, you may be wondering which web analytics plugin (GA, Slimstat or WP-Statistics) to choose from on the WordPress directory. If the choice is between WP-Statistics and Matomo for WordPress, we’ve got you covered. Have a look at which could be the best option for you. Our team tested the WP-Statistics plugin to see how it compares. It’s hard not to be biased, but we’ll try our best to give you a fair assessment.

    The main considerations in this article : 

    General overview

    What’s Matomo Analytics for WordPress ?

    Matomo for WordPress is a free, privacy-friendly web analytics plugin that lets you understand website visitors and how they behave on your site. With comprehensive insights, you get the opportunity to increase conversions, and the know-how to improve your website. 

    It lets you undertake essential analysis by tracking information, such as, where visitors are coming from, what your most popular pages are, and how visitors are using your site.

    In addition to the fundamentals, the tool also allows for advanced tracking and analysis with features that give you a full understanding of behavioural patterns and website performance. This enables you to optimise your WordPress website to increase sales or engagement.

    It offers a complete analytics package with the bonuses of 100% data ownership, no data sampling, and GDPR compliance. 

    What’s WP-Statistics ?

    WP-Statistics is currently the most used self-hosted WordPress statistics plugin. It provides reports that let you analyse who your visitors are, where they’re coming from, and to an extent what they’re doing on your website.

    Like Matomo for WordPress, it gives you an understanding of your audience which helps you make decisions on how to improve your website for more conversions. 

    As it’s self-hosted on your own WordPress servers it can be seen as a privacy-friendly choice with a few tweaks (more on this below).

    Like Matomo for WordPress, it gives you an understanding of your audience which helps you make decisions on how to improve your website for more conversions. 

    General comparison

    Let’s compare the installation process and the dashboards that get installed in your WordPress.

    Installation

    Both Matomo and WP-Statistics are installed directly in your WordPress so you’ll be able to see your analytics reports right in your WordPress dashboard. You can install them both straight from the WordPress Directory.

    The installation process for both plugins is beginner-friendly. You simply need to find them on the WordPress directory, click on ‘Install Now’, and tracking should start immediately in your WordPress dashboard.

    Dashboard

    For the main Matomo platform you’ll see :

    • Visitors – Overview, Visits Log, Real-time, Real-time Map, Locations, Devices, Software, Times, User IDs, Custom Variables, User Type
    • Behaviour – Pages, Entry Pages, Exit Pages, Page titles, Site Search, Outlinks, Downloads, Events, Contents, Engagement, Transitions, Users Flow, Top Paths, Page Author, Page Location, Page Type, Crawling errors
    • Acquisition – Overview, All Channels, Search Engine & Keywords, Websites, Social Networks, Campaigns, Campaign URL Builder, Crawling overview
    • Ecommerce – Overview, Ecommerce Log, Products, Sales, Multi Attribution
    • Goals – Overview, Multi Attribution, Choose Goals, Manage Goals
    • These may be worded differently from WP-Statistics, but they show you all the information you need to know about your traffic, pages, etc.
    Previous
    Next

    In the dashboard for WP-Statistics you’ll see :

    • Overview, Hits, Online, Referrers, Search Words, Search Engines, Pages, Visitors, Categories, Tags, Authors, Browsers, Top Visitors Today
    • These are the only things you can see in the dashboard. So you can’t click into them for a drop down section to get deeper insights. 
    •  
    WP-Statistics dashboard

    Key similarities between Matomo and WP-Statistics

    • Free to use
    • Self-hosted – All data collected is stored only within your own servers, no third parties have rights over your data, and logs or report data will never be sent to other servers. 
    • Beginner-friendly – Both offer simple reporting for people who are very much beginners and only want basic insights. With Matomo the advantage is also that you can get more details should you ever want/need to.

    Key differences between Matomo and WP-Statistics

    The main differences fall in these categories : features, privacy, documentation/support, security, active development, extensibility, price and ads.

    Features : 

    WP-Statistics – On a fundamental level, WP-Statistics is focused on simplicity and the basics. There are fewer reports than Matomo and they function on a level that suits beginners who are interested in seeing only the numbers of visitors on the website, and how often each page is viewed. 

    Matomo – provides an interface with similar simplicity. However, there is also a more feature-rich and more comprehensive user interface available. In addition to the basics, Matomo offers features like Goals, Ecommerce, in the free version which show a deeper level of insight. WP Statistics does not let you track essentials like Goals or Ecommerce.

    Privacy : 

    WP-Statistics – One of the concerns we wish to raise here is for data privacy. There doesn’t appear to be an opt-out option in WP-Statistics, which could be problematic for some privacy laws such as GDPR. There’s also no documentation on this.

    We were a bit concerned to see that WP-Statistics didn’t have IP anonymization enabled by default. Considering the IP address is personal data, it means you are not compliant with privacy laws such as the GDPR when you use this plugin unless you tweak the settings. They mentioned : “In previous versions, there was an option called Hash IP. When Hash IP was activated, the IP addresses wouldn’t be stored in the database, but instead, a unique hash would be used. In this new version, an option has been added to store IPs anonymously. This option is active by default.” However, when we installed this and tested it on multiple WordPress installations, this option was not active by default. 

    Matomo – has more measures in place to ensure privacy is respected, such as, opt-outs. Due to the stringent privacy features in place, Matomo is well equipped to ensure GDPR compliance. Matomo has an abundance of user guides and FAQs you can follow to configure your platform to fully comply with GDPR. There’s even an 12-step compliant checklist. The most compelling proof is that the leading voice on GDPR – The European Commission uses Matomo Analytics. 

    Documentation/Support : 

    WP-Statistics – has little documentation, FAQs, and no support.

    Matomo – has thousands of FAQs and user guides, as well as a dedicated support team and forum you can turn to for help. Should you ever run into any issue, this might be something important to consider.

    The contrast in support between WP-Statistics and Matomo for WordPress :

    statistics for wordpress
    WP-Statistics support
    wordpress statistics
    Matomo Analytics support

    Security :

    Matomo takes protecting your data very seriously. We have a security bounty programme giving security researchers money should they find any security issues. Matomo also performs a security review for every new release. We couldn’t find anything similar in WP-Statistics.

    Active development : 

    WP Statistics – doesn’t seem to have active development. The last change in this plugin was over three months ago (source : https://github.com/wp-statistics/wp-statistics/commits/master) and in general, only 10 people really contributed to it (source : https://github.com/wp-statistics/wp-statistics/graphs/contributors, the graphs shows little contributor activity.) 

    Matomo – has been built by hundreds of contributors (source : https://github.com/matomo-org/matomo/graphs/contributors), and is actively maintained by multiple developers including developers who work on this full time. This means you can rest assured that Matomo will be there for you in the future, it will receive regular improvements.

    Extensibility :

    WP-Statistics – have a section on their website offering customisation but for a price. 

    Matomo – should you want any changes and have some developer knowledge or some developers at hand, you can completely customise and extend Matomo for free. There are also one hundred additional plugins available for Matomo for free. 

    Price :

    The main WordPress plugins ‘WP Statistics‘ and ‘Matomo Analytics – Ethical Stats. Powerful Insights.‘ are both free.

    WP Statistics and Matomo also sell paid add-ons. However, WP-Statistics’ paid add-ons are ones already integrated in Matomo for free. These basic features are provided as the development team believe they’re necessities to a fully functional analytics platform. 

    Ads :

    WP Statistics shows you ads, whereas Matomo doesn’t.

    Three most notable feature category comparisons

    Both Matomo and WP-Statistics have basic tracking categories in the WP dashboard. In addition, Matomo has feature categories that can be expanded e.g. when clicked, Visitors drops down to reveal 11 more features. 

    We’ll compare three feature categories : Visitors, Behaviour, and Acquisitions.

    1. Visitors (WP-Statistics) vs Visitors (Matomo)

    Let’s dive into how each analytics platform provides insight into the visitors feature category.

    WP-Statistics

    WP-Statistics visitors

    WP-Statistics – We can see WP-Statistics gives you bare bones tracking capabilities so you don’t get a really detailed picture of your visitors. It allows you to monitor users currently online in real-time, which is useful to look at the most recent activity on your site. WP-Statistics doesn’t offer a dropdown section to see more about your visitor’s behavioural patterns. There is no Visitors category in WP-Statistics, just individual features in the dashboard but we can group three options together to compare with Matomo’s Visitors category, these are : Online, Browsers, Top Visitors Today.

    Matomo

    WordPress analytics visitors
    WordPress analytics visit log

    Comparison

    Matomo – In comparison, Matomo has a Visitors category with a dropdown list that lets you drill deeper into what your visitors are doing. It lets you evaluate every action an individual user has taken on your website which is compiled into a full historical profile. Matomo gives an in-depth view. E.g. you can look at individual visit logs, locations, and devices.

    This lets you see what the life-time journey of an active user looks like, or perhaps you want to see what a profile looks like for a user who comes back time-and-time again without ever purchasing ; there is no better way to gain insights to these journeys and this is why the Visitor Profiles feature is so widely used by Matomo users.

    2. Pages tracking (WP-Statistics) vs Behaviour (Matomo)

    For this comparison, WP-Statistics has a few features that can be combined to compare with Matomo’s Behaviour category. 

    WP-Statistics

    WP-Statistics pages

    The Pages section in WP-Statistics gives a basic look at your most popular pages so you know which pages get more visits and those which aren’t performing. This helps with content improvement. You can also see other features in this Behaviour category like Browsers and Hits – these also provide basic stats to help you get a general sense of visitor behaviour. 

    Matomo

    Analytics for WordPress behaviours

    Comparison :

    Matomo on the other hand has stats that go into greater detail. The features under the Behaviour section of the tool let you draw actionable conclusions e.g. seeing that a page has a higher exit rate than it’s supposed to, so you optimise that page to prevent people leaving and help them progress through your website. 

    Not only can you see popular pages, you can look at : which page people viewed first when they visited your website ; which page they left from ; what people search for on your site ; and see how people are flowing through pages. Most importantly you can see how each of these reports perform over time so you can improve engagement and conversions on your website.

    3. Referrers (WP-Statistics) vs Acquisition (Matomo)

    For this comparison, WP-Statistics has a few features that can be combined to compare with Matomo’s Acquisition category. 

    WP-Statistics

    WP-Statistics gives you Referrers, Search Words, and Search Engines. Which give a basic understanding of the channels that work best for you. This is helpful to know where to focus more of your attention.

    Matomo

    WordPress analytics acquisition

    Comparison :

    With Matomo you see multiple layers of stats to understand how your acquisition channels are performing. So you can see tables of data that drill into visits, downloads, bounce rate, and newsletter sign ups. For example seeing that Facebook is the channel bringing in the most visitors to your site. This gives you a better sense of which acquisition strategy is working for your site. 

    Who suits WP-Statistics

    This is a great starter pack for people who want a lightweight, functional statistics plugin that gives you a basic overview of website hits and visitors. It’s very easy to use, so it’s great for beginners and those who want simple tracking. If you have basic goals for your website or blog’s success then WP-Statistics is enough for you to get numbers on visitors, page views, and hits, but won’t be suitable for a larger-scale business or organisation. 

    It’s suited for hobby websites, blogs, and freelancers who want simple, effective stats tracking, who don’t need detailed insights on site performance or tracking. 

    Who suits Matomo

    Matomo can be used for the same basic reporting, but has the capability for you to go deeper into more advanced reporting in a different UI if you need it. It’s an option that can work for a wider range of users – from beginners to analysts. There are features to suit all skill levels. This complete suite of features makes it a more comprehensive tool, as you can get more out of it. Ideal not only for bloggers and beginners, but also powerful enough to suit businesses, privacy-respecting organisations, and those who would benefit from conversion optimisation features. 

    You can draw insights from all stages of the customer journey – you’ll track behavioural patterns as soon as visitors enter your site, to their progression through your site, and ultimately to conversion and exit. It’s also an ethical choice because you get 100% data ownership. 

    If you’d like to look deeper into your data then Matomo would also be suitable for you. Matomo’s UI is lean, very easy to learn and shouldn’t overwhelm users in the way another tool like Google Analytics might do. If you think Matomo suits you best, you can install it for free now.

    Advantages of using Matomo

    Truly privacy-respecting

    There’s no messing about when it comes to privacy. As a lot of users are based in Europe, Matomo adheres to the strictest privacy laws and can be counted on as a privacy-respecting tool that’s used by many government entities. Needing to comply with major privacy laws (GDPR) in Europe means Matomo can proudly ensure users are making the ethical choice.

    GDPR compliance

    You mitigate the risks of getting caught out and fined for breaching GDPR regulations. There’s a complete list of documentation, guides, information, and tools to make sure you’re on the right side of GDPR. 

    All-rounder

    Matomo gives you a clearer picture of your visitors which helps you make better decisions for your website overall. The support and documentation is thorough which means you get more out of your Matomo experience.

    Conclusion

    Both tools will do you justice in terms of fundamental reporting, but Matomo Analytics will outshine if you want a greater understanding of your website and want to carry out deeper levels of analysis.

    You can draw useful insights with WP-Statistics so it has to be said that they are doing something right with an entry-level offering. The simplicity is great, but you won’t really get more than a basic idea of how your site is performing.

    On the flipside, this simplicity could also be a double-edged sword for WP-Statistics in that it’s too simplistic to draw actionable insights. If you’re wanting to know anything that could increase sales, conversions or subscribers – then you wouldn’t really get the reports to do so. 

    WP-Statistics also falls short when it comes to updates and support. So a major difference can be seen in support, active development, ads, security, documentation, which many people may think about until they’re in trouble and find they need these resources. Matomo offers support, continuous product development, and extensive documentation. There are also no ads, making it more enjoyable to use.

    One thing we’d like to raise awareness about is WP-Statistics’ claims of being privacy-respecting without much documentation to back up those claims. There is a lack of privacy features which could put some website owners at risk of non-compliance. Just be sure to check that you’ve carried out the steps to comply with the privacy laws in your country.

    Matomo makes it clear that privacy is essential as is compliance to privacy laws like GDPR. The strength also lies in the peace of mind you get from a tool that’s used by global privacy leaders such as the European Commission. 

  • Exceeded GA’s 10M hits data limit, now what ?

    21 juin 2019, par Joselyn Khor

    Exceeded GA’s 10M hits data limit, now what ? Matomo has the answers

    “Your data volume (1XXM hits) exceeds the limit of 10M hits per month as outlined in our Terms of Service. If you continue to exceed the limit, we will stop processing new data on XXX 21, 2019. Learn more about possible solutions.”

    Yikes. Alarm bells were ringing when a Google Analytics free user came to us faced with this notice. Let’s call him ‘Mark’. Mark had reached the limits on the data he could collect through Google Analytics and was shocked by the limited options available to fix the problem, without blowing the budget. The thoughts racing through his head were :

    • “What happens to all my data ?”
    • “What if Google starts charging USD150K now ?”

    Then he came across Matomo and decided to get in touch with our support team …

    “Can you fix this issue ?” he asked us.

    “Absolutely !” we said.

    We’ll get back to helping Mark in a minute. For now let’s go over why this was such a dilemma for him.

    In order to resolve this data limits issue, one of the solutions was for him to upgrade to Google Analytics 360, which meant shelling out USD150,000 per year for their 1 billion hits per month option. Going from free to USD150,000 was too much of a stretch for a growing company.

    “Your data volume (1XXM hits) exceeds the limit of 10M hits per month …”, what did this message mean ?

    With the free version, Mark could collect up to 10 million “hits” per month, per account. Going over meant Google Analytics could stop collecting any more data for free as outlined in their Terms.

    Google Analytics’ Terms of Service (2018, sec. 2) states, “Subject to Section 15, the Service is provided without charge to You for up to 10 million Hits per month per account.”[1]

    In general, what’s a "hit" ?

    Data being sent to Google Analytics. It can be a transaction, event, social interaction or pageview - these all produce what Google calls a “hit”.

    Google Analytics data limits
    Google Analytics Terms of Service

    And their Analytics Help Data Limits (n.d.) support page makes clear that : “If a property sends more hits per month to Analytics than allowed by the Analytics Terms of Service, there is no assurance that the excess hits will be processed. If the property’s hit volume exceeds this limit, a warning may be displayed in the user interface and you may be prevented from accessing reports.”[2]

    Google Analytics data collection limit
    Google Analytics’ data limits support page

    Possible solutions

    So the possible solutions given by Google Analytics’ Data Limits support page were (also shown in image below) :

    • To pay USD150K to upgrade to Google Analytics 360
    • To send fewer hits by setting up sampling
    • Or choose the slightly less relevant option to upgrade mobile app tracking to Google Analytics for Firebase.

    Without the means to pay, the free version was fast becoming inaccessible for Mark as he was facing a future where he risked no longer having access to up-to-date data used in his business’ reporting.

    Mark was facing a problem that potentially didn’t have a cost-effective solution.

    Google Analytics data limits
    Google Analytics’ data limits support page

    So what can you really do about it ?

    This is where we can help provide some assistance. If you’re reading this article, we’ll assume you can relate to Mark and share with you the advice on options we gave him.

    Options :

    One option posed by Google is for you to send fewer hits by auditing your data collection processes

    If you really don’t have the budget, you’ll need to reassess your data collection priorities and go over your strategies to see what is necessary to track, and what isn’t.

    • Make sure you know what you’re tracking and why. Look at what websites are being tracked by Google and into what properties.
    • Go through what data you’re tracking and decide what is or isn’t of value.
    • Set up data sampling, this however, will lead to inaccurate data.

    From here you can start to course correct. If you’ve found data you’re not using for analysis, get rid of these events/pageviews in your Google Analytics.

    But the limitations here are that eventually, you’re going to run out of irrelevant metrics and everything you’re tracking will be essential. So you’ll hit another brick wall and return to the same situation.

    Option 2 Ignore and continue using the free version of Google Analytics

    With this option, you’ll have to bear the business risks involved by basing decisions off of analytics reports that may or may not be updated. In this case, you may still get contacted about exceeding the limits. As the free service is provided for only up to 10 million hits, once you’ve gone over them, you’re violating what’s stipulated in the Terms of Service. 

    There’s also the warning that “… you may be prevented from accessing reports” (Data limits, n.d.). So while we may not know for certain what Google Analytics will do, in this case it may be better to be safe rather than sorry by acting quickly to resolve it. 

    Option 3 The Matomo solution. Upgrade to a web analytics platform that can handle your demanding data requirements

    Save money while continuing to gain valuable insights by moving over to Matomo Analytics (recommended)

    This is where you can save up to USD130,000 a year. As well as that, the transition from Google Analytics to the Matomo Cloud is a seamless experience as setup and maintenance is taken care of by our experts.

    For example, you can get up to 15M pageviews for USD1,612.50/month (or USD19,350/year) on the Essentials plan.

    Or even 25M pageviews for USD2400/month (or USD24000/year) on the Business plan – which offers additional web analytics and conversion optimization resources.

    Matomo Cloud is a great option if you’re looking for a secure, cost-effective and powerful analytics solution. You also get what Google Analytics could never offer you : full control and ownership of your own data and privacy. 

    No need to worry about losing your Google Analytics data because …

    Now you can import your historic Google Analytics data directly into your Matomo with the Google Analytics Importer tool. Simply follow the step-by-step guide to get started for free.

    Along with savings you can get :

    • A solution for the data limits issue forever. You choose the right plan to suit your data needs and adapt as you continue growing
    • 100% accurate data (no data sampling)
    • 100% data ownership of all your information without signing away your data to a third party
    • Powerful web analytics and conversion optimization features
    • Matomo Tag Manager
    • Easy setup
    • Support from Matomo’s specialists

    Learn more about Matomo Cloud pricing.

    Or go for Matomo On-Premise

    If you have the in-house infrastructure to support self-hosting Matomo on your own servers then there’s also the option of Matomo On-Premise. Here you’ll get full security knowing the data is on your own servers. 

    Setup will also require technical knowledge. There will also be costs associated with acquiring your own servers, and keeping up with regular maintenance and updates. With On-Premise you get maximum flexibility, with no data limits whatsoever. But if you’re coming over from Google Analytics and don’t have the infrastructure and team to host On-Premise, the Matomo Cloud could be right for you.

    Learn more about Matomo On-Premise.

    Where do you go from here ?

    Getting 10 millions hits per month is no small feat, it’s actually pretty fantastic. But if it means having to shell out USD150,000 just to be able to continue with Google Analytics, we feel your problem could be fixed with Matomo Cloud. You could then put the rest of the money you save to better use.

    If you choose Matomo, you now have the option to : 

    • Raise your data limits for a fraction of Google Analytics 360’s price
    • Get a comprehensive range of analytics features for the most impactful insights to ensure your website continues excelling
    • Get data that’s not sampled – meaning 100% accuracy in your reports
    • Migrate your data easily with the help of Matomo’s support team

    We’ll have you covered. 

    By sharing with you the options and advice we gave to Mark, we hope you’ll be able to find a solution that makes your life easier and solves the issue of data restrictions forever.

    The team at Matomo is here to help you every step of the way to ensure a stress-free transition from Google Analytics if that is what works best for you.

    For next steps, why not check out our pricing page to see what could suit your needs !

    References :

    [1] Terms of Service. (2018, July 24). In Google Analytics Terms of Service. Retrieved June 12, 2019, from https://www.google.com/analytics/terms/us.html

    [2] Data limits. (n.d.). In Analytics Help Data limits. Retrieved June 12, 2019, from https://support.google.com/analytics/answer/1070983?hl=en

  • Developing A Shader-Based Video Codec

    22 juin 2013, par Multimedia Mike — Outlandish Brainstorms

    Early last month, this thing called ORBX.js was in the news. It ostensibly has something to do with streaming video and codec technology, which naturally catches my interest. The hype was kicked off by Mozilla honcho Brendan Eich when he posted an article asserting that HD video decoding could be entirely performed in JavaScript. We’ve seen this kind of thing before using Broadway– an H.264 decoder implemented entirely in JS. But that exposes some very obvious limitations (notably CPU usage).

    But this new video codec promises 1080p HD playback directly in JavaScript which is a lofty claim. How could it possibly do this ? I got the impression that performance was achieved using WebGL, an extension which allows JavaScript access to accelerated 3D graphics hardware. Browsing through the conversations surrounding the ORBX.js announcement, I found this confirmation from Eich himself :

    You’re right that WebGL does heavy lifting.

    As of this writing, ORBX.js remains some kind of private tech demo. If there were a public demo available, it would necessarily be easy to reverse engineer the downloadable JavaScript decoder.

    But the announcement was enough to make me wonder how it could be possible to create a video codec which effectively leverages 3D hardware.

    Prior Art
    In theorizing about this, it continually occurs to me that I can’t possibly be the first person to attempt to do this (or the ORBX.js people, for that matter). In googling on the matter, I found various forums and Q&A posts where people asked if it were possible to, e.g., accelerate JPEG decoding and presentation using 3D hardware, with no answers. I also found a blog post which describes a plan to use 3D hardware to accelerate VP8 video decoding. It was a project done under the banner of Google’s Summer of Code in 2011, though I’m not sure which open source group mentored the effort. The project did not end up producing the shader-based VP8 codec originally chartered but mentions that “The ‘client side’ of the VP8 VDPAU implementation is working and is currently being reviewed by the libvdpau maintainers.” I’m not sure what that means. Perhaps it includes modifications to the public API that supports VP8, but is waiting for the underlying hardware to actually implement VP8 decoding blocks in hardware.

    What’s So Hard About This ?
    Video decoding is a computationally intensive task. GPUs are known to be really awesome at chewing through computationally intensive tasks. So why aren’t GPUs a natural fit for decoding video codecs ?

    Generally, it boils down to parallelism, or lack of opportunities thereof. GPUs are really good at doing the exact same operations over lots of data at once. The problem is that decoding compressed video usually requires multiple phases that cannot be parallelized, and the individual phases often cannot be parallelized. In strictly mathematical terms, a compressed data stream will need to be decoded by applying a function f(x) over each data element, x0 .. xn. However, the function relies on having applied the function to the previous data element, i.e. :

    f(xn) = f(f(xn-1))
    

    What happens when you try to parallelize such an algorithm ? Temporal rifts in the space/time continuum, if you’re in a Star Trek episode. If you’re in the real world, you’ll get incorrect, unusuable data as the parallel computation is seeded with a bunch of invalid data at multiple points (which is illustrated in some of the pictures in the aforementioned blog post about accelerated VP8).

    Example : JPEG
    Let’s take a very general look at the various stages involved in decoding the ubiquitous JPEG format :


    High level JPEG decoding flow

    What are the opportunities to parallelize these various phases ?

    • Huffman decoding (run length decoding and zig-zag reordering is assumed to be rolled into this phase) : not many opportunities for parallelizing the various Huffman formats out there, including this one. Decoding most Huffman streams is necessarily a sequential operation. I once hypothesized that it would be possible to engineer a codec to achieve some parallelism during the entropy decoding phase, and later found that On2′s VP8 codec employs the scheme. However, such a scheme is unlikely to break down to such a fine level that WebGL would require.
    • Reverse DC prediction : JPEG — and many other codecs — doesn’t store full DC coefficients. It stores differences in successive DC coefficients. Reversing this process can’t be parallelized. See the discussion in the previous section.
    • Dequantize coefficients : This could be very parallelized. It should be noted that software decoders often don’t dequantize all coefficients. Many coefficients are 0 and it’s a waste of a multiplication operation to dequantize. Thus, this phase is sometimes rolled into the Huffman decoding phase.
    • Invert discrete cosine transform : This seems like it could be highly parallelizable. I will be exploring this further in this post.
    • Convert YUV -> RGB for final display : This is a well-established use case for 3D acceleration.

    Crash Course in 3D Shaders and Humility
    So I wanted to see if I could accelerate some parts of JPEG decoding using something called shaders. I made an effort to understand 3D programming and its associated math throughout the 1990s but 3D technology left me behind a very long time ago while I got mixed up in this multimedia stuff. So I plowed through a few books concerning WebGL (thanks to my new Safari Books Online subscription). After I learned enough about WebGL/JS to be dangerous and just enough about shader programming to be absolutely lethal, I set out to try my hand at optimizing IDCT using shaders.

    Here’s my extremely high level (and probably hopelessly naive) view of the modern GPU shader programming model :


    Basic WebGL rendering pipeline

    The WebGL program written in JavaScript drives the show. It sends a set of vertices into the WebGL system and each vertex is processed through a vertex shader. Then, each pixel that falls within a set of vertices is sent through a fragment shader to compute the final pixel attributes (R, G, B, and alpha value). Another consideration is textures : This is data that the program uploads to GPU memory which can be accessed programmatically by the shaders).

    These shaders (vertex and fragment) are key to the GPU’s programmability. How are they programmed ? Using a special C-like shading language. Thought I : “C-like language ? I know C ! I should be able to master this in short order !” So I charged forward with my assumptions and proceeded to get smacked down repeatedly by the overall programming paradigm. I came to recognize this as a variation of the scientific method : Develop a hypothesis– in my case, a mental model of how the system works ; develop an experiment (short program) to prove or disprove the model ; realize something fundamental that I was overlooking ; formulate new hypothesis and repeat.

    First Approach : Vertex Workhorse
    My first pitch goes like this :

    • Upload DCT coefficients to GPU memory in the form of textures
    • Program a vertex mesh that encapsulates 16×16 macroblocks
    • Distribute the IDCT effort among multiple vertex shaders
    • Pass transformed Y, U, and V blocks to fragment shader which will convert the samples to RGB

    So the idea is that decoding of 16×16 macroblocks is parallelized. A macroblock embodies 6 blocks :


    JPEG macroblocks

    It would be nice to process one of these 6 blocks in each vertex. But that means drawing a square with 6 vertices. How do you do that ? I eventually realized that drawing a square with 6 vertices is the recommended method for drawing a square on 3D hardware. Using 2 triangles, each with 3 vertices (0, 1, 2 ; 3, 4, 5) :


    2 triangles make a square

    A vertex shader knows which (x, y) coordinates it has been assigned, so it could figure out which sections of coefficients it needs to access within the textures. But how would a vertex shader know which of the 6 blocks it should process ? Solution : Misappropriate the vertex’s z coordinate. It’s not used for anything else in this case.

    So I set all of that up. Then I hit a new roadblock : How to get the reconstructed Y, U, and V samples transported to the fragment shader ? I have found that communicating between shaders is quite difficult. Texture memory ? WebGL doesn’t allow shaders to write back to texture memory ; shaders can only read it. The standard way to communicate data from a vertex shader to a fragment shader is to declare variables as “varying”. Up until this point, I knew about varying variables but there was something I didn’t quite understand about them and it nagged at me : If 3 different executions of a vertex shader set 3 different values to a varying variable, what value is passed to the fragment shader ?

    It turns out that the varying variable varies, which means that the GPU passes interpolated values to each fragment shader invocation. This completely destroys this idea.

    Second Idea : Vertex Workhorse, Take 2
    The revised pitch is to work around the interpolation issue by just having each vertex shader invocation performs all 6 block transforms. That seems like a lot of redundant. However, I figured out that I can draw a square with only 4 vertices by arranging them in an ‘N’ pattern and asking WebGL to draw a TRIANGLE_STRIP instead of TRIANGLES. Now it’s only doing the 4x the extra work, and not 6x. GPUs are supposed to be great at this type of work, so it shouldn’t matter, right ?

    I wired up an experiment and then ran into a new problem : While I was able to transform a block (or at least pretend to), and load up a varying array (that wouldn’t vary since all vertex shaders wrote the same values) to transmit to the fragment shader, the fragment shader can’t access specific values within the varying block. To clarify, a WebGL shader can use a constant value — or a value that can be evaluated as a constant at compile time — to index into arrays ; a WebGL shader can not compute an index into an array. Per my reading, this is a WebGL security consideration and the limitation may not be present in other OpenGL(-ES) implementations.

    Not Giving Up Yet : Choking The Fragment Shader
    You might want to be sitting down for this pitch :

    • Vertex shader only interpolates texture coordinates to transmit to fragment shader
    • Fragment shader performs IDCT for a single Y sample, U sample, and V sample
    • Fragment shader converts YUV -> RGB

    Seems straightforward enough. However, that step concerning IDCT for Y, U, and V entails a gargantuan number of operations. When computing the IDCT for an entire block of samples, it’s possible to leverage a lot of redundancy in the math which equates to far fewer overall operations. If you absolutely have to compute each sample individually, for an 8×8 block, that requires 64 multiplication/accumulation (MAC) operations per sample. For 3 color planes, and including a few extra multiplications involved in the RGB conversion, that tallies up to about 200 MACs per pixel. Then there’s the fact that this approach means a 4x redundant operations on the color planes.

    It’s crazy, but I just want to see if it can be done. My approach is to pre-compute a pile of IDCT constants in the JavaScript and transmit them to the fragment shader via uniform variables. For a first order optimization, the IDCT constants are formatted as 4-element vectors. This allows computing 16 dot products rather than 64 individual multiplication/addition operations. Ideally, GPU hardware executes the dot products faster (and there is also the possibility of lining these calculations up as matrices).

    I can report that I actually got a sample correctly transformed using this approach. Just one sample, through. Then I ran into some new problems :

    Problem #1 : Computing sample #1 vs. sample #0 requires a different table of 64 IDCT constants. Okay, so create a long table of 64 * 64 IDCT constants. However, this suffers from the same problem as seen in the previous approach : I can’t dynamically compute the index into this array. What’s the alternative ? Maintain 64 separate named arrays and implement 64 branches, when branching of any kind is ill-advised in shader programming to begin with ? I started to go down this path until I ran into…

    Problem #2 : Shaders can only be so large. 64 * 64 floats (4 bytes each) requires 16 kbytes of data and this well exceeds the amount of shader storage that I can assume is allowed. That brings this path of exploration to a screeching halt.

    Further Brainstorming
    I suppose I could forgo pre-computing the constants and directly compute the IDCT for each sample which would entail lots more multiplications as well as 128 cosine calculations per sample (384 considering all 3 color planes). I’m a little stuck with the transform idea right now. Maybe there are some other transforms I could try.

    Another idea would be vector quantization. What little ORBX.js literature is available indicates that there is a method to allow real-time streaming but that it requires GPU assistance to yield enough horsepower to make it feasible. When I think of such severe asymmetry between compression and decompression, my mind drifts towards VQ algorithms. As I come to understand the benefits and limitations of GPU acceleration, I think I can envision a way that something similar to SVQ1, with its copious, hierarchical vector tables stored as textures, could be implemented using shaders.

    So far, this all pertains to intra-coded video frames. What about opportunities for inter-coded frames ? The only approach that I can envision here is to use WebGL’s readPixels() function to fetch the rasterized frame out of the GPU, and then upload it again as a new texture which a new frame processing pipeline could reference. Whether this idea is plausible would require some profiling.

    Using interframes in such a manner seems to imply that the entire codec would need to operate in RGB space and not YUV.

    Conclusions
    The people behind ORBX.js have apparently figured out a way to create a shader-based video codec. I have yet to even begin to reason out a plausible approach. However, I’m glad I did this exercise since I have finally broken through my ignorance regarding modern GPU shader programming. It’s nice to have a topic like multimedia that allows me a jumping-off point to explore other areas.