Recherche avancée

Médias (0)

Mot : - Tags -/content

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

Autres articles (59)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

Sur d’autres sites (6844)

  • 8 Best Tools to Analyse Website Traffic

    12 septembre 2023, par Erin — Analytics Tips, Marketing

    Do you want to analyse your website traffic ?

    Maybe you want to know how well you’re converting your traffic. Or maybe you’re looking to track the performance and ROI of your marketing campaigns. Regardless, you won’t get far without relying on a dependable web traffic analysis platform.

    In this article, we’ve compiled a list of the top web analytics tools available (including the pricing for each one).

    Let’s dive in.

    What is website traffic analysis ?

    Curious about what it means to analyse website traffic ?

    What is website traffic analysis?

    Simply put, it involves collecting and examining data about your website visitors and the actions they take. Marketers, analysts and website owners can then take this data and use it to optimise their strategy to improve site traffic, conversion rates and ROI.

    A website analytics tool is software that tracks and measures various visitor activities and behaviours on your website. Common metrics include pageviews, traffic source, bounce rate and average time on page. Using a web analytics solution can give you insights into what’s working (and what’s not working) so you can optimise your website, campaigns or marketing strategy.

    Advantages of using a website traffic analysis tool

    1. Performance measurement and optimisation

    Tracking the success of your marketing efforts is a challenging task. The primary benefit of using a web analytics tool is implementing effective performance measurement. If you don’t know how to measure your efforts, you won’t know what’s working and what’s not with your campaigns and content. 

    A web analysis tool can give you the insights you need to understand whether your marketing initiatives have been successful or if they need to be improved.

    For instance, your new web design facelift may seem beautiful, but if visitors aren’t staying on your site as long and it is resulting in lower conversions, then it’s time to go back to the drawing board.

    2. Audience insights to improve the user experience

    Web traffic analysis platforms don’t just show you what your visitors are doing. It shows you who your audience is. A powerful website analytics tool will give you in-depth audience data, including demographics like geographical location (e.g., city, state or country), to help you better understand your audience.

    Additionally, you can learn more about your audience by seeing how they interact with different content on your site. You’ll start to see that certain content performs better than others, giving you a greater understanding of your audience’s needs and wants. This means you’ll be able to tailor your website content and marketing efforts to your audience to improve the overall user experience.

    3. Improve SEO

    In the first two advantages, we touched on how insights can help you craft better content for the visitors already coming to your site to improve the user experience and improve conversions. But did you know that using a website analytics tool can also help improve how much traffic you’re getting to your site ?

    Since a web analytics tool can help you craft better content, one side effect is an increase in traffic from organic search through SEO. Additionally, your platform will likely show you other traffic sources that your visitors are coming from (i.e., another website is referring traffic to you) so you can tap into those high-performing sources and optimise your incoming traffic over time.

    Top 8 Tools to Analyse Website Traffic

    Here’s a breakdown of the top eight web analytics platforms to help you analyse each tool’s unique features, price, advantages and disadvantages so you can make the best decision.

    1. Matomo

    Matomo is an open-source website analytics tool that’s focused on protecting user privacy and data while offering robust insights into your web traffic. It’s one of the most powerful tools to track the entire customer journey on your site.

    Matomo main dashboard

    Why Matomo : As the leader in open-source, privacy-friendly and ethical web analytics, Matomo is trusted by more than 1 million websites, including NASA, the United Nations and the European Commission.

    Matomo plays well with Google Analytics to track your websites by filling in the gaps where Google Analytics has limitations (i.e., cookie consent banner requirement). Matomo combines traditional and behavioural web analytics for deeper insights while ensuring compliance with the strictest privacy regulations like GDPR, LGPD and HIPAA.

    Matomo Standout Features and Integrations :

    Standout features include comprehensive visitor tracking, multi-attribution, goal tracking, event tracking, custom dimensions, custom reports, automated email reports, session recordings, tag manager, roll-up reporting to pull data from multiple sites, Google Analytics importer, heatmaps and more.

    Integrations include WordPress, Google Ads, Wix, Drupal, Joomla, Cloudflare, Magento, Vue, SharePoint, WooCommerce and more.

    Pricing starts free for Matomo On-Premise (but requires technical skills and servers to set up) and $23/month for Matomo Cloud, which includes a 21-day free trial (no credit card required).

    Pros

    • Best for respecting visitor privacy
    • You own your data — ensuring that it’s not shared with third parties for purposes like advertising
    • Compliant with the strictest privacy laws
    • Greater flexibility with open-source advantages, as well as the option to either self-host or cloud host
    • Can run cookieless — providing 100% accurate data and a better user experience without the need for an annoying cookie consent banner 
    • Exceptional customisability — from white labeling, alerts and custom dimensions to dashboards and reports, tailor your insights for faster decisions, deeper insights and superior outcomes

    Cons

    • On-Premise is free, but there are additional costs for advanced features
    • On-Premise requires servers and technical expertise to manage

    2. Google Analytics

    Google Analytics is the most well-known and used web analytics platform in the world, with nearly 30 million active websites.

    Google Analytics 4 dashboard

    Why Google Analytics : It’s one of the leading web traffic analysis tools backed by the Alphabet group of companies. For anyone getting started, it’s a great free option to understand your web traffic and your audience.

    Google Analytics Standout Features and Integrations :

    Standout features include in-depth visitor tracking, event tracking with Google Analytics 4 (GA4), easy integration with Google marketing tools (i.e., Google Search Console and Google Ads), custom reports and easy data importing from third-party sources.

    Integrations include Google Ads, Google Webmaster Tools, AdSense, WordPress, Wix, Shopify, Zendesk, Facebook, Marketo, WordPress, Hotjar, SEMrush, Salesforce, Hootsuite and more.

    Pricing is free.

    Pros

    • Detailed audience insights
    • Customisable reports
    • Seamless integration with other Google products
    • Easy to set up

    Cons

    • Not privacy-friendly — you don’t own your data (data is shared with third parties for advertising purposes)
    • Complex interface
    • Requires cookie consent banner for GDPR compliance, which negatively impacts data accuracy and user experience

    3. Fathom Analytics

    Founded in 2018, Fathom Analytics is a privacy-friendly and lightweight web analytics tool. The platform offers a simple, minimalistic dashboard.

    Fathom Analytics Dashboard

    Why Fathom Analytics : Fathom Analytics is a minimalistic tool to help website owners gain insights into customer behaviour without compromising on privacy. It’s an easy-to-use tool that offers a simplified breakdown of the most popular data points. For newcomers to web analytics seeking essential metrics like visitor counts and traffic sources, Fathom Analytics provides a straightforward, cost-effective solution.

    Fathom Analytics Standout Features and Integrations :

    Standout features include easy, automated GA4 importing with lifetime data retention, a single-page dashboard for a quick overview of metrics, traffic summaries for chosen timeframes, visually striking graphs for better data digestion and privacy protection covering major compliance regulations.

    Integrations include Google Analytics, Squarespace, Drupal, WordPress, Discourse, Bloggi, ConvertKit, Webflow, Transistor, Remix, Gatsby and Carrd.

    Pricing starts at $14/month for up to 100k pageviews (with a 30-day free trial).

    Pros

    • Doesn’t use cookies
    • Out-of-the-box GDPR, ePrivacy, PECR and CCPA compliance
    • Great for visual data insights
    • Lightweight tracking script for fast loading

    Cons

    • Can’t easily see traffic trends on specific pages
    • Metrics may be too simple for those wanting advanced analytics

    4. Mixpanel

    Mixpanel is a web analytics platform that helps you track visitors as well as improve customer retention. The software has 8,000 customers worldwide, including Netflix, Yelp, BuzzFeed and CNN.

    Mixpanel custom dashboard

    Why Mixpanel : Mixpanel is great for websites with e-commerce functionality. The tool helps you understand both your site visitors and your customers so you can optimise your customer experience and improve conversions.

    Mixpanel Standout Features and Integrations :

    Standout features include deep insights into how your products are being used, including your most popular features, user cohorts that let you segment users based on specific actions, and visual analysis showing where users drop off.

    Integrations include Google Cloud, Figma, Mailchimp, Zoho CRM, Databox, Marketo, Hotjar, Slack, Zapier, Amazon Web Services, Google Ads and HubSpot.

    Pricing starts free for up to 20 million events per month and $20/month for Growth.

    Pros

    • Interface is easy for beginners
    • Exhaustive reporting options
    • Custom event tracking options
    • Predict user actions based on data science models
    • Send targeted messages to specific users to encourage action

    Cons

    • User-based pricing isn’t the most ideal for everyone
    • Alert management can be confusing

    5. Kissmetrics

    Kissmetrics is a marketing and product analytics tool that helps e-commerce and SaaS companies grow through qualitative data insights. The web analytics tool is trusted by 10,000 users, including Microsoft, Unbounce, AWeber, Dropbox DocSend and SendGrid.

    Kissmetrics dashboard

    Why Kissmetrics : As an e-commerce-driven analytics platform, the platform is best suited for Enterprise businesses, but it also offers flexible pricing plans that make it easy for someone to get their feet wet with website analytics. 

    Kissmetrics Standout Features and Integrations :

    Standout features include a customisable dashboard to see key metrics at a glance, comprehensive visitor tracking, cohort analysis including power user tracking to understand your most active visitors and customers and insights into customer lifetime value and churn rate.

    Integrations include Chargify, HubSpot, Slack, Live Chat, Marketo, Optimizely, Mailchimp, Recurly, Wufoo Forms, Facebook Ads, WordPress, Shopify and WooCommerce.

    Pricing starts at $0.0025/event for the Pay As You Go Plan, $25.99/month for Build Your Plan and $199/month for Small Teams, which includes a 7-day free trial.

    Pros

    • Flexible pricing options
    • Easy to install
    • Several analytics viewing options
    • Visual checkout funnel insights
    • Track sessions by desktop or mobile

    Cons

    • Despite more pricing options, it’s still quite expensive overall
    • Difficult to use for beginners

    6. Adobe Analytics

    Adobe Analytics is a web and marketing analytics platform within the Adobe Experience Platform. Used by over 170,000 businesses, it’s one of the most popular analytics solutions available.

    dobe Analytics dashboard

    Why Adobe Analytics : Adobe Analytics was created for large organisations. It’s essentially the enterprise version of Google Analytics. The tool does a great job of offering a customised analytics solution that’s capable of delivering personalised user experiences at scale.

    Adobe Analytics Standout Features and Integrations :

    Standout features include attribution, AI-driven predictive analytics, robust customer segmentation and automation based on customer behaviour.

    Integrations include all Adobe products, Salesforce, Hootsuite, Contentsquare, Sisense, Mouseflow, Google Ads, Google Search Console, HubSpot and Microsoft Teams.

    Pricing is custom and available upon request, but users can expect to pay at least $2,000 per month, and there is no free trial.

    Pros

    • Built for enterprise businesses
    • Seamless workflow integration for Adobe Experience Cloud users
    • Incredible customisation options
    • Integration process is flexible
    • Capable of accurately tracking large volumes of traffic

    Cons

    • Very expensive
    • Not suitable for small businesses
    • The setup is challenging for beginners

    7. SimilarWeb

    SimilarWeb is a robust analytics platform used to track your website data and compare it to other websites. Backed by a team of experienced data scientists and mathematicians for in-depth website traffic and search engine analysis. Founded in 2007, the platform is trusted by major brands like Adidas, DHL, PepsiCo and Walmart.

    SimilarWeb dashboard

    Why SimilarWeb : The tool relies on multiple scientific methodologies and approaches to data analysis to help provide a better understanding of visitors and customers. The platform is great for crafting prediction models for customer acquisitions by using machine learning to offer SEO insights and competitive analysis.

    SimilarWeb Standout Features and Integrations :

    Standout features include competition traffic and engagement analysis, in-depth visitor tracking, keyword analysis to optimise your SEO and search ads, affiliate traffic analysis, search traffic analysis and funnel insights.

    Integrations include Salesforce, HubSpot, Google Analytics, Google Search Console, Shift, AT Internet, Adverity, SimilarTech, Biscience and more. 

    Pricing starts at $125/month for the Starter plan, which includes a 7-day free trial.

    Pros

    • Has a user-friendly dashboard for simple insights
    • Highly customisable platform to meet your specific needs
    • Easy competition analysis
    • Funnel insights to improve your conversion rates
    • Great customer support

    Cons

    • Expensive pricing
    • Doesn’t include a code snippet to pull data directly from websites
    • Doesn’t show sub-domains of your site

    8. Hotjar

    Hotjar is a behavioural website analytics tool with a focus on providing insights into individual user sessions with features like heatmaps and session recordings. Founded in 2014, Hotjar is used by 900,000 sites around the world.

    Hotjar heat mapping

    Why Hotjar : Unlike traditional web analytics tools like Google Analytics, Hotjar is a behavioural analytics tool that provides in-depth behaviour insights session by session. The tool offers a variety of features that give you a sneak peek into your users’ behaviours by watching how they interact with your site action by action.

    Hotjar Standout Features and Integrations :

    Standout features include comprehensive heat mapping, visitor session recordings to see what visitors did moment by moment, feedback polls to gain insights from site visitors and conversion funnels to help you analyse leaks in your funnel at each conversion stage.

    Integrations include HubSpot, Slack, Jira, WordPress, Shopify, Google Analytics, Mixpanel, Microsoft Teams, Zapier and ClickFunnels.

    Pricing starts at free for the Basic plan and $80/month for Business, which includes a 15-day free trial.

    Pros

    • You can see exactly where visitors click, move and scroll
    • Watch session replays to see what visitors did step-by-step
    • See what percentage of visitors take certain actions
    • Data segmentation features to help you understand KPIs in-depth
    • There are no user limits with the platform, making it easy to scale

    Cons

    • While it offers behavioural analytics, Hotjar doesn’t provide insights into traditional web analytics like Matomo does, including traffic sources and bounce rate
    • History data monitoring is complex

    Elevate your website performance today

    Understanding your visitors’ behaviour and needs is essential when you’re looking to improve your website performance.

    By leveraging a website analytics platform, you’ll be able to gain new insights into your visitors and use insights from your content and campaign performance to improve your user experience.

    If you’re looking to start using a web traffic analysis tool today, then Matomo is an excellent choice.

    Matomo is a powerful, privacy-friendly and compliant tool that gives in-depth insights into your audience, your content and your marketing efforts to help you improve your site’s performance.

    The platform also includes a variety of robust behavioural analytics features like heatmaps, session recording and more, which are included in your Cloud subscription. 

    Start your 21-day free trial of Matomo today (no credit card required).

  • Split video with ffmpeg segment option is missing frame

    9 février 2024, par Dan

    I’m trying to get the ffmpeg “segment” option to split my video into segments at the Iframes. I'm using ffmpeg V6.1.1.

    


    First I added time stamps to each frame of my video so that when it plays, I can see exactly which frame is being displayed. I used this command :

    


    ffmpeg -i In.mp4 -vf "drawtext=fontfile='C :\Windows\Fonts\Arial.ttf' : text='%frame_num :~ %pts':fontsize=200 : r=25 : x=(w-tw)/2 : y=h-(2*lh) : fontcolor=white : box=1 : boxcolor=0x00000099" -y Out.mp4

    


    Then I used ffprobe to confirm that the video is 30 FPS and the Iframes are as follows :

    


    0.000000
4.933333
10.000000
11.533333
18.866667
24.966667

    


    Based on these Iframe times, I’d expect the following segments :

    


    





    


    


    


    


    


    


    



    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    Start Frame Start Time End Frame End Time
    0 0 147 4.900000
    148 4.933333 299 9.966667
    300 10.000000 345 11.500000
    346 11.533333 565 18.833334
    566 18.866667 748 24.933334
    749 24.966667 867 28.906667

    


    


    When I use ffmpeg to split the video into segments with the following command, I get six files as expected :

    


    ffmpeg -i Out.mp4 -f segment -c copy -reset_timestamps 1 -map 0 "Out %d.mp4"

    


    When I play the segments, they are all correct except the first segment file (Out 0.mp4). It seems to be missing the last frame. It contains frames 0 to 146 (4.866667 sec) but should also include frame 147 (4.9 sec). All the other segment files are as expected.

    


    I’ve tried this on several different mp4 videos and they all are missing the last frame on the first segments.

    


    Any idea why my first segment files is missing the last frame of the segment ?

    


    Could this be an ffmpeg bug ?

    


    Thanks for the help !
Dan

    


    Here is my console session with all output :

    


    C:\> ffprobe Out.mp4
ffprobe version 2023-12-21-git-1e42a48e37-full_build-www.gyan.dev Copyright (c) 2007-2023 the FFmpeg developers
  built with gcc 12.2.0 (Rev10, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --pkg-config=pkgconf --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-dxva2 --enable-d3d11va --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      58. 36.100 / 58. 36.100
  libavcodec     60. 36.100 / 60. 36.100
  libavformat    60. 20.100 / 60. 20.100
  libavdevice    60.  4.100 / 60.  4.100
  libavfilter     9. 14.100 /  9. 14.100
  libswscale      7.  6.100 /  7.  6.100
  libswresample   4. 13.100 /  4. 13.100
  libpostproc    57.  4.100 / 57.  4.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Out.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    title           : Short 4k video sample - 4K Ultra HD (3840x2160)
    date            : 2014:05:24 19:00:00
    encoder         : Lavf60.20.100
  Duration: 00:00:28.96, start: 0.000000, bitrate: 3181 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 3045 kb/s, 30 fps, 30 tbr, 15360 tbn (default)
      Metadata:
        handler_name    : VideoHandler
        vendor_id       : [0][0][0][0]
        encoder         : Lavc60.36.100 libx264
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
      Metadata:
        handler_name    : SoundHandler
        vendor_id       : [0][0][0][0]

C:\ ffprobe -loglevel error -skip_frame nokey -select_streams v:0 -show_entries frame=pts_time -of csv=print_section=0 Out.mp4
0.000000,
4.933333
10.000000
11.533333
18.866667
24.966667

C:\ ffmpeg -i Out.mp4 -f segment -c copy -reset_timestamps 1 -map 0 "Out %1d.mp4"
ffmpeg version 2023-12-21-git-1e42a48e37-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 12.2.0 (Rev10, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --pkg-config=pkgconf --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-dxva2 --enable-d3d11va --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      58. 36.100 / 58. 36.100
  libavcodec     60. 36.100 / 60. 36.100
  libavformat    60. 20.100 / 60. 20.100
  libavdevice    60.  4.100 / 60.  4.100
  libavfilter     9. 14.100 /  9. 14.100
  libswscale      7.  6.100 /  7.  6.100
  libswresample   4. 13.100 /  4. 13.100
  libpostproc    57.  4.100 / 57.  4.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Out.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    title           : Short 4k video sample - 4K Ultra HD (3840x2160)
    date            : 2014:05:24 19:00:00
    encoder         : Lavf60.20.100
  Duration: 00:00:28.96, start: 0.000000, bitrate: 3181 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 3045 kb/s, 30 fps, 30 tbr, 15360 tbn (default)
      Metadata:
        handler_name    : VideoHandler
        vendor_id       : [0][0][0][0]
        encoder         : Lavc60.36.100 libx264
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
      Metadata:
        handler_name    : SoundHandler
        vendor_id       : [0][0][0][0]
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
[segment @ 00000195bbc52940] Opening 'Out 0.mp4' for writing
Output #0, segment, to 'Out %1d.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    title           : Short 4k video sample - 4K Ultra HD (3840x2160)
    date            : 2014:05:24 19:00:00
    encoder         : Lavf60.20.100
  Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 3045 kb/s, 30 fps, 30 tbr, 15360 tbn (default)
      Metadata:
        handler_name    : VideoHandler
        vendor_id       : [0][0][0][0]
        encoder         : Lavc60.36.100 libx264
  Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
      Metadata:
        handler_name    : SoundHandler
        vendor_id       : [0][0][0][0]
Press [q] to stop, [?] for help
[segment @ 00000195bbc52940] Opening 'Out 1.mp4' for writing
[segment @ 00000195bbc52940] Opening 'Out 2.mp4' for writing
[segment @ 00000195bbc52940] Opening 'Out 3.mp4' for writing
[segment @ 00000195bbc52940] Opening 'Out 4.mp4' for writing
[segment @ 00000195bbc52940] Opening 'Out 5.mp4' for writing
[out#0/segment @ 00000195bc3e8cc0] video:10757kB audio:456kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
size=N/A time=00:00:28.86 bitrate=N/A speed= 322x


    


  • FFmpeg player backporting to Android 2.1 - one more problem

    22 avril 2024, par tretdm

    I looked for a lot of information about how to build and use FFmpeg in early versions of Android, looked at the source codes of players from 2011-2014 and was able to easily build FFmpeg 4.0.4 and 3.1.4 on the NDKv5 platform. I have highlighted the main things for this purpose :

    


      

    • <android></android>bitmap.h> and <android></android>native_window.h> before Android 2.2 (API Level 8) such a thing did not exist
    • &#xA;

    • this requires some effort to implement buffer management for A/V streams, since in practice, when playing video, the application silently crashed after a few seconds due to overflow (below code example in C++ and Java)
    • &#xA;

    • FFmpeg - imho, the only way to support a sufficient number of codecs that are not officially included in Android 2.1 and above
    • &#xA;

    &#xA;

    void decodeVideoFromPacket(JNIEnv *env, jobject instance,&#xA;                           jclass mplayer_class, AVPacket avpkt, &#xA;                           int total_frames, int length) {&#xA;    AVFrame     *pFrame = NULL&#xA;    AVFrame     *pFrameRGB = NULL;&#xA;    pFrame = avcodec_alloc_frame();&#xA;    pFrameRGB = avcodec_alloc_frame();&#xA;    int frame_size = avpicture_get_size(PIX_FMT_RGB32, gVideoCodecCtx->width, gVideoCodecCtx->height);&#xA;    unsigned char* buffer = (unsigned char*)av_malloc((size_t)frame_size * 3);&#xA;    if (!buffer) {&#xA;        av_free(pFrame);&#xA;        av_free(pFrameRGB);&#xA;        return;&#xA;    }&#xA;    jbyteArray buffer2;&#xA;    jmethodID renderVideoFrames = env->GetMethodID(mplayer_class, "renderVideoFrames", "([BI)V");&#xA;    int frameDecoded;&#xA;    avpicture_fill((AVPicture*) pFrame,&#xA;                   buffer,&#xA;                   gVideoCodecCtx->pix_fmt,&#xA;                   gVideoCodecCtx->width,&#xA;                   gVideoCodecCtx->height&#xA;                  );&#xA;&#xA;    if (avpkt.stream_index == gVideoStreamIndex) { // If video stream found&#xA;        int size = avpkt.size;&#xA;        total_frames&#x2B;&#x2B;;&#xA;        struct SwsContext *img_convert_ctx = NULL;&#xA;        avcodec_decode_video2(gVideoCodecCtx, pFrame, &amp;frameDecoded, &amp;avpkt);&#xA;        if (!frameDecoded || pFrame == NULL) {&#xA;            return;&#xA;        }&#xA;&#xA;        try {&#xA;            PixelFormat pxf;&#xA;            // RGB565 by default for Android Canvas in pre-Gingerbread devices.&#xA;            if(android::get_android_api_version(env) >= ANDROID_API_CODENAME_GINGERBREAD) {&#xA;                pxf = PIX_FMT_BGR32;&#xA;            } else {&#xA;                pxf = PIX_FMT_RGB565;&#xA;            }&#xA;&#xA;            int rgbBytes = avpicture_get_size(pxf, gVideoCodecCtx->width,&#xA;                                            gVideoCodecCtx->height);&#xA;&#xA;            // Converting YUV to RGB frame &amp; RGB frame to char* buffer &#xA;            &#xA;            buffer = convertYuv2Rgb(pxf, pFrame, rgbBytes); // result of av_image_copy_to_buffer()&#xA;&#xA;            if(buffer == NULL) {&#xA;                return;&#xA;            }&#xA;&#xA;            buffer2 = env->NewByteArray((jsize) rgbBytes);&#xA;            env->SetByteArrayRegion(buffer2, 0, (jsize) rgbBytes,&#xA;                                    (jbyte *) buffer);&#xA;            env->CallVoidMethod(instance, renderVideoFrames, buffer2, rgbBytes);&#xA;            env->DeleteLocalRef(buffer2);&#xA;            free(buffer);&#xA;        } catch (...) {&#xA;            if (debug_mode) {&#xA;                LOGE(10, "[ERROR] Render video frames failed");&#xA;                return;&#xA;            }&#xA;        }&#xA;    }&#xA;}&#xA;

    &#xA;

    private void renderVideoFrames(final byte[] buffer, final int length) {&#xA;        new Thread(new Runnable() {&#xA;            @Override&#xA;            public void run() {&#xA;                Canvas c;&#xA;                VideoTrack track = null;&#xA;                for (int tracks_index = 0; tracks_index &lt; tracks.size(); tracks_index&#x2B;&#x2B;) {&#xA;                    if (tracks.get(tracks_index) instanceof VideoTrack) {&#xA;                        track = (VideoTrack) tracks.get(tracks_index);&#xA;                    }&#xA;                }&#xA;                if (track != null) {&#xA;                    int frame_width = track.frame_size[0];&#xA;                    int frame_height = track.frame_size[1];&#xA;                    if (frame_width > 0 &amp;&amp; frame_height > 0) {&#xA;                        try {&#xA;                            // RGB_565  == 65K colours (16 bit)&#xA;                            // RGB_8888 == 16.7M colours (24 bit w/ alpha ch.)&#xA;                            int bpp = Build.VERSION.SDK_INT > 9 ? 16 : 24;&#xA;                            Bitmap.Config bmp_config =&#xA;                                    bpp == 24 ? Bitmap.Config.RGB_565 : Bitmap.Config.ARGB_8888;&#xA;                            Paint paint = new Paint();&#xA;                            if(buffer != null &amp;&amp; holder != null) {&#xA;                                holder.setType(SurfaceHolder.SURFACE_TYPE_NORMAL);&#xA;                                if((c = holder.lockCanvas()) == null) {&#xA;                                    Log.d(MPLAY_TAG, "Lock canvas failed");&#xA;                                    return;&#xA;                                }&#xA;                                ByteBuffer bbuf =&#xA;                                        ByteBuffer.allocateDirect(minVideoBufferSize);&#xA;                                bbuf.rewind();&#xA;                                for(int i = 0; i &lt; buffer.length; i&#x2B;&#x2B;) {&#xA;                                    bbuf.put(i, buffer[i]);&#xA;                                }&#xA;                                bbuf.rewind();&#xA;&#xA;                                // The approximate location where the application crashed.&#xA;                                Bitmap bmp = Bitmap.createBitmap(frame_width, frame_height, bmp_config);&#xA;                                bmp.copyPixelsFromBuffer(bbuf);&#xA;                                &#xA;                                float aspect_ratio = (float) frame_width / (float) frame_height;&#xA;                                int scaled_width = (int)(aspect_ratio * (c.getHeight()));&#xA;                                c.drawBitmap(bmp,&#xA;                                        null,&#xA;                                        new RectF(&#xA;                                                ((c.getWidth() - scaled_width) / 2), 0,&#xA;                                                ((c.getWidth() - scaled_width) / 2) &#x2B; scaled_width,&#xA;                                                c.getHeight()),&#xA;                                        null);&#xA;                                holder.unlockCanvasAndPost(c);&#xA;                                bmp.recycle();&#xA;                                bbuf.clear();&#xA;                            } else {&#xA;                                Log.d(MPLAY_TAG, "Video frame buffer is null");&#xA;                            }&#xA;                        } catch (Exception ex) {&#xA;                            ex.printStackTrace();&#xA;                        } catch (OutOfMemoryError oom) {&#xA;                            oom.printStackTrace();&#xA;                            stop();&#xA;                        }&#xA;                    }&#xA;                }&#xA;            }&#xA;        }).start();&#xA;    }&#xA;

    &#xA;

    Exception (tested in Android 4.1.2 emulator) :

    &#xA;

    E/dalvikvm-heap: Out of memory on a 1228812-byte allocation&#xA;I/dalvikvm: "Thread-495" prio=5 tid=21 RUNNABLE&#xA;   ................................................&#xA;     at android.graphics.Bitmap.nativeCreate(Native Method)&#xA;     at android.graphics.Bitmap.createBitmap(Bitmap.java:640)&#xA;     at android.graphics.Bitmap.createBitmap(Bitmap.java:620)&#xA;     at [app_package_name].MediaPlayer$5.run(MediaPlayer.java:406)&#xA;     at java.lang.Thread.run(Thread.java:856)&#xA;

    &#xA;

    For clarification : I first compiled FFmpeg 0.11.x on a virtual machine with Ubuntu 12.04 LTS from my written build script, looked for player examples suitable for Android below 2.2 (there is little information about them, unfortunately) and opened the file on the player and after showing the first frames it crashed into a stack or buffer overflow, on I put off developing the player for some time.

    &#xA;

    Is there anything ready-made that, as a rule, fits into one C++ file and takes into account all the nuances of backporting ? Thanks in advance.

    &#xA;