Recherche avancée

Médias (91)

Autres articles (35)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Publier sur MédiaSpip

    13 juin 2013

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

Sur d’autres sites (5749)

  • Data Privacy Issues to Be Aware of and How to Overcome Them

    9 mai 2024, par Erin

    Data privacy issues are a significant concern for users globally.

    Around 76% of US consumers report that they would not buy from a company they do not trust with their data. In the European Union, a 2021 study found that around 53% of EU internet users refused to let companies access their data for advertising purposes.

    These findings send a clear message : if companies want to build consumer trust, they must honour users’ data privacy concerns. The best way to do this is by adopting transparent, ethical data collection practices — which also supports the simultaneous goal of maintaining compliance with regional data privacy acts.

    So what exactly is data privacy ?

    Explanation of the term data privacy

    Data privacy refers to the protections that govern how personal data is collected and used, especially with respect to an individual’s control over when, where and what information they share with others.

    Data privacy also refers to the extent to which organisations and governments go to protect the personal data that they collect. Different parts of the world have different data privacy acts. These regulations outline the measures organisations must take to safeguard the data they collect from their consumers and residents. They also outline the rights of data subjects, such as the right to opt out of a data collection strategy and correct false data. 

    As more organisations rely on personal data to provide services, people have become increasingly concerned about data privacy, particularly the level of control they have over their data and what organisations and governments do with their data.

    Why should organisations take data privacy issues seriously ?

    Organisations should take data privacy seriously because consumer trust depends on it and because they have a legal obligation to do so. Doing so also helps organisations prevent threat actors from illegally accessing consumer data. Strong data privacy helps you : 

    Comply with data protection acts

    Organisations that fail to comply with regional data protection acts could face severe penalties. For example, consider the General Data Protection Regulation (GDPR), which is the primary data protection action for the European Union. The penalty system for GDPR fines consists of two tiers :

    • Less severe infringements — Which can lead to fines of up to €10 million (or 2% of an organisation’s worldwide annual revenue from the last financial year) per infringement.
    • More severe infringements — This can lead to fines of up to €20 million (or 4% of an organisation’s worldwide annual revenue from the last financial year) per infringement.

    The monetary value of these penalties is significant, so it is in the best interest of all organisations to be GDPR compliant. Other data protection acts have similar penalty systems to the GDPR. In Brazil, organisations non-compliant with the Lei Geral de Proteção de Dados Pessoais (LGPD) could be fined up to 50 million reals (USD 10 million) or 2% of their worldwide annual revenue from the last financial year.

    Improve brand reputation

    Research shows that 81% of consumers feel that how an organisation treats their data reflects how they treat them as a consumer. This means a strong correlation exists between how people perceive an organisation’s data collection practices and their other business activities.

    Statistic on data privacy and brand reputation

    Data breaches can have a significant impact on an organisation, especially their reputation and level of consumer trust. In 2022, hackers stole customer data from the Australian private health insurance company, Medibank, and released the data onto the dark web. Optus was also affected by a cyberattack, which compromised the information of current and former customers. Following these events, a study by Nature revealed that 83 percent of Australians were concerned about the security of their data, particularly in the hands of their service providers.

    Protect consumer data

    Protecting consumer data is essential to preventing data breaches. Unfortunately, cybersecurity attacks are becoming increasingly sophisticated. In 2023 alone, organisations like T-Mobile and Sony have been compromised and their data stolen.

    One way to protect consumer data is to retain 100% data ownership. This means that no external parties can see your data. You can achieve this with the web analytics platform, Matomo. With Matomo, you can store your own data on-premises (your own servers) or in the Cloud. Under both arrangements, you retain full ownership of your data.

    Try Matomo for Free

    Get the web insights you need, while respecting user privacy.

    No credit card required

    What are the most pressing data privacy issues that organisations are facing today ?

    Today’s most pressing data privacy challenges organisations face are complying with new data protection acts, maintaining consumer trust, and choosing the right web analytics platform. Here is a detailed breakdown of what these challenges mean for businesses.

    Complying with new and emerging data protection laws

    Ever since the European Union introduced the GDPR in 2018, other regions have enacted similar data protection acts. In the United States, California (CCPA), Virginia (VCDPA) and Colorado have their own state-level data protection acts. Meanwhile, Brazil and China have the General Data Protection Law (LGPD) and the Personal Information Protection Law (PIPL), respectively.

    For global organisations, complying with multiple data protection acts can be tough, as each act interprets the GDPR model differently. They each have their own provisions, terminology (or different interpretations of the same terminology), and penalties.

    A web analytics platform like Matomo can help your organisation comply with the GDPR and similar data protection acts. It has a range of privacy-friendly features including data anonymisation, IP anonymisation, and first-party cookies by default. You can also create and publish custom opt-out forms and let visitors view your collected data.

    The US is one of the few countries to not have a national data protection standard

    Today’s most pressing data privacy challenges organisations face are complying with new data protection acts, maintaining consumer trust, and choosing the right web analytics platform. Here is a detailed breakdown of what these challenges mean for businesses.

    Complying with new and emerging data protection laws

    Ever since the European Union introduced the GDPR in 2018, other regions have enacted similar data protection acts. In the United States, California (CCPA), Virginia (VCDPA) and Colorado have their own state-level data protection acts. Meanwhile, Brazil and China have the General Data Protection Law (LGPD) and the Personal Information Protection Law (PIPL), respectively.

    For global organisations, complying with multiple data protection acts can be tough, as each act interprets the GDPR model differently. They each have their own provisions, terminology (or different interpretations of the same terminology), and penalties.

    A web analytics platform like Matomo can help your organisation comply with the GDPR and similar data protection acts. It has a range of privacy-friendly features including data anonymisation, IP anonymisation, and first-party cookies by default. You can also create and publish custom opt-out forms and let visitors view your collected data.

    Try Matomo for Free

    Get the web insights you need, while respecting user privacy.

    No credit card required

    Maintaining consumer trust

    Building (and maintaining) consumer trust is a major hurdle for organisations. Stories about data breaches and data scandals — notably the Cambridge Analytical scandal — instil fear into the public’s hearts. After a while, people wonder, “Which company is next ?”

    One way to build and maintain trust is to be transparent about your data collection practices. Be open and honest about what data you collect (and why), where you store the data (and for how long), how you protect the data and whether you share data with third parties. 

    You should also prepare and publish your cyber incident response plan. Outline the steps you will take to contain, assess and manage a data breach.

    Choosing the right web analytics platform

    Organisations use web analytics to track and monitor web traffic, manage advertising campaigns and identify potential revenue streams. The most widely used web analytics platform is Google Analytics ; however, many users have raised concerns about privacy issues

    When searching for a Google Analytics alternative, consider a web analytics platform that takes data privacy seriously. Features like cookieless tracking, data anonymisation and IP anonymisation will let you track user activity without collecting personal data. Custom opt-out forms will let your web visitors enforce their data subject rights.

    What data protection acts exist right now ?

    The United States, Australia, Europe and Brazil each have data protection laws.

    As time goes on and more countries introduce their own data privacy laws, it becomes harder for organisations to adapt. Understanding the basics of each act can help streamline compliance. Here is what you need to know about the latest data protection acts.

    General Data Protection Regulation (GDPR)

    The GDPR is a data protection act created by the European Parliament and Council of the European Union. It comprises 11 chapters covering the general provisions, principles, data subject rights, penalties and other relevant information.

    The GDPR established a framework for organisations and governments to follow regarding the collection, processing, storing, transferring and deletion of personal data. Since coming into effect on 25 May 2018, other countries have used the GDPR as a model to enact similar data protection acts.

    General Data Protection Law (LGPD)

    The LGPD is Brazil’s main data protection act. The Federal Republic of Brazil signed the act on August 14, 2018, and it officially commenced on August 16, 2020. The act aimed to unify the 40 Brazilian laws that previously governed the country’s approach to processing personal data.

    Like the GDPR, the LGPD serves as a legal framework to regulate the collection and usage of personal data. It also outlines the duties of the national data protection authority, the Autoridade Nacional de Proteção de Dados (ANPD), which is responsible for enforcing the LGPD.

    Privacy Amendment (Notifiable Data Breaches) for the Privacy Act 1988

    Established by the Australian House of Representatives, the Privacy Act 1988 outlines how organisations and governments must manage personal data. The federal government has amended the Privacy Act 1988 twice — once in 2000, and again in 2014 — and is committing to a significant overhaul.

    The new proposals will make it easier for individuals to opt out of data collection, organisations will have to destroy collected data after a reasonable period, and small businesses will no longer be exempt from the Privacy Act.

    United States

    The US is one of the few countries to not have a national data protection standard

    The United States does not have a federally mandated data protection act. Instead, each state has been gradually introducing its data protection acts, with the first being California, followed by Virginia and Colorado. Over a dozen other states are following suit, too.

    • California — The then-Governor of California Jerry Brown signed the California Consumer Privacy Act (CCPA) into law on June 28, 2018. The act applies to organisations with gross annual revenue of more than USD 25 million, and that buy or sell products and services to 100,000 or more households or consumers.
    • Virginia — The Virginia Consumer Data Protection Act (VCDPA) took effect on January 1, 2023. It applies to organisations that process (or control) the personal data of 100,000 or more consumers in a financial year. It also applies to organisations that process (or control) the personal data of 25,000 or more consumers and gain more than 50% of gross revenue by selling that data.
    • Colorado — Colorado Governor Jared Polis signed the Colorado Privacy Act (ColoPA) into law in July 2021. The act applies to organisations that process (or control) the personal data of 100,000 or more Colorado residents annually. It also applies to organisations that earn revenue from the sale of personal data of at least 25,000 Colorado residents.

    Because the US regulations are a patchwork of differing legal acts, compliance can be a complicated endeavour for organisations operating across multiple jurisdictions. 

    How can organisations comply with data protection acts ?

    One way to ensure compliance is to keep up with the latest data protection acts. But that is a very time-consuming task.

    Over 16 US states are in the process of signing new acts. And countries like China, Turkey and Australia are about to overhaul — in a big way — their own data privacy protection acts. 

    Knowledge is power. But you also have a business to run, right ? 

    That’s where Matomo comes in.

    Streamline data privacy compliance with Matomo

    Although data privacy is a major concern for individuals and companies operating in multiple parts of the world — as they must comply with new, conflicting data protection laws — it is possible to overcome the biggest data privacy issues.

    Matomo enables your visitors to take back control of their data. You can choose where you store your data on-premises and in the Cloud (EU-based). You can use various features, retain 100% data ownership, protect visitor privacy and ensure compliance.

    Try the 21-day free trial of Matomo today, start your free analytics trial. No credit card required.

  • Why does the frame count change when scaling with FFmpeg ?

    22 octobre 2016, par ajmicek

    I use this to scale 1920x1080 H.264 videos :

    ffmpeg -i IMG_1438.MOV -threads 2 -vf scale=-2:600 IMG_1438_scaledTo600.MOV

    And it works great ! But here is my question : most of the time, the frame rate stays exactly the same between the original file and the scaled file. For example :

    $ mediainfo -F IMG_1426.MOV | grep Frame\ rate
    Frame rate                               : 29.970
    Frame rate                               : 29.970 FPS
    Frame rate mode                          : VFR
    Frame rate mode                          : Variable
    Frame rate                               : 29.970
    Frame rate                               : 29.970 (29970/1000) FPS

    $ mediainfo -F IMG_1426_scaledTo600.MOV | grep Frame\ rate
    Frame rate                               : 29.970
    Frame rate                               : 29.970 FPS
    Frame rate mode                          : CFR
    Frame rate mode                          : Constant
    Frame rate                               : 29.970
    Frame rate                               : 29.970 (30000/1001) FPS

    But sometimes, the frame rate increases dramatically :

    $ mediainfo -F IMG_1438.MOV | grep Frame\ rate
    Frame rate                               : 25.044
    Frame rate                               : 25.044 FPS
    Frame rate mode                          : VFR
    Frame rate mode                          : Variable
    Frame rate                               : 25.044
    Frame rate                               : 25.044 FPS

    $ mediainfo -F IMG_1438_scaledTo600.MOV | grep Frame\ rate
    Frame rate                               : 120.000
    Frame rate                               : 120.000 FPS
    Frame rate mode                          : CFR
    Frame rate mode                          : Constant
    Frame rate                               : 120.000
    Frame rate                               : 120.000 FPS

    What should I know about FFmpeg or libx264 or libswscale that will help me understand why this happens ? (Hoping to hear from LordNeckbeard, in particular).

    mediainfo IMG_1438.MOV --Full outputs :

    General
    Count                                    : 327
    Count of stream of this kind             : 1
    Kind of stream                           : General
    Kind of stream                           : General
    Stream identifier                        : 0
    Count of video streams                   : 1
    Count of audio streams                   : 1
    OtherCount                               : 2
    Video_Format_List                        : AVC
    Video_Format_WithHint_List               : AVC
    Codecs Video                             : AVC
    Audio_Format_List                        : AAC
    Audio_Format_WithHint_List               : AAC
    Audio codecs                             : AAC LC
    Complete name                            : IMG_1438.MOV
    File name                                : IMG_1438
    File extension                           : MOV
    Format                                   : MPEG-4
    Format                                   : MPEG-4
    Format/Extensions usually used           : mp4 m4v m4a m4b m4p 3gpp 3gp 3gpp2 3g2 k3g jpm jpx mqv ismv isma f4v
    Commercial name                          : MPEG-4
    Format profile                           : QuickTime
    Internet media type                      : video/mp4
    Codec ID                                 : qt  
    Codec ID                                 : qt   0000.00 (qt  )
    Codec ID/Url                             : http://www.apple.com/quicktime/download/standalone.html
    CodecID_Version                          : 0000.00
    CodecID_Compatible                       : qt  
    Codec                                    : MPEG-4
    Codec                                    : MPEG-4
    Codec/Extensions usually used            : mp4 m4v m4a m4b m4p 3gpp 3gp 3gpp2 3g2 k3g jpm jpx mqv ismv isma f4v
    File size                                : 113990140
    File size                                : 109 MiB
    File size                                : 109 MiB
    File size                                : 109 MiB
    File size                                : 109 MiB
    File size                                : 108.7 MiB
    Duration                                 : 52268
    Duration                                 : 52 s 268 ms
    Duration                                 : 52 s 268 ms
    Duration                                 : 52 s 268 ms
    Duration                                 : 00:00:52.268
    Duration                                 : 00:00:52:09
    Duration                                 : 00:00:52.268 (00:00:52:09)
    Overall bit rate                         : 17447026
    Overall bit rate                         : 17.4 Mb/s
    Frame rate                               : 25.044
    Frame rate                               : 25.044 FPS
    Frame count                              : 1309
    Stream size                              : 56670
    Stream size                              : 55.3 KiB (0%)
    Stream size                              : 55 KiB
    Stream size                              : 55 KiB
    Stream size                              : 55.3 KiB
    Stream size                              : 55.34 KiB
    Stream size                              : 55.3 KiB (0%)
    Proportion of this stream                : 0.00050
    HeaderSize                               : 28
    DataSize                                 : 113966271
    FooterSize                               : 23841
    IsStreamable                             : No
    Encoded date                             : UTC 2016-10-08 22:51:19
    Tagged date                              : UTC 2016-10-08 22:52:12
    File last modification date              : UTC 2016-10-08 22:51:19
    File last modification date (local)      : 2016-10-08 17:51:19
    Writing library                          : Apple QuickTime
    Writing library                          : Apple QuickTime
    Encoded_Library_Name                     : Apple QuickTime
    com.apple.quicktime.make                 : Apple
    com.apple.quicktime.model                : iPhone 5
    com.apple.quicktime.software             : 10.0.2
    com.apple.quicktime.creationdate         : 2016-10-08T17:51:19-0500

    Video
    Count                                    : 334
    Count of stream of this kind             : 1
    Kind of stream                           : Video
    Kind of stream                           : Video
    Stream identifier                        : 0
    StreamOrder                              : 0
    ID                                       : 1
    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format/Url                               : http://developers.videolan.org/x264.html
    Commercial name                          : AVC
    Format profile                           : High@L4.1
    Format settings                          : CABAC / 1 Ref Frames
    Format settings, CABAC                   : Yes
    Format settings, CABAC                   : Yes
    Format settings, ReFrames                : 1
    Format settings, ReFrames                : 1 frame
    Internet media type                      : video/H264
    Codec ID                                 : avc1
    Codec ID/Info                            : Advanced Video Coding
    Codec ID/Url                             : http://www.apple.com/quicktime/download/standalone.html
    Codec                                    : AVC
    Codec                                    : AVC
    Codec/Family                             : AVC
    Codec/Info                               : Advanced Video Codec
    Codec/Url                                : http://developers.videolan.org/x264.html
    Codec/CC                                 : avc1
    Codec profile                            : High@L4.1
    Codec settings                           : CABAC / 1 Ref Frames
    Codec settings, CABAC                    : Yes
    Codec_Settings_RefFrames                 : 1
    Duration                                 : 52268
    Duration                                 : 52 s 268 ms
    Duration                                 : 52 s 268 ms
    Duration                                 : 52 s 268 ms
    Duration                                 : 00:00:52.268
    Duration                                 : 00:00:52:09
    Duration                                 : 00:00:52.268 (00:00:52:09)
    Bit rate                                 : 17375530
    Bit rate                                 : 17.4 Mb/s
    Width                                    : 1920
    Width                                    : 1 920 pixels
    Height                                   : 1080
    Height                                   : 1 080 pixels
    Stored_Height                            : 1088
    Sampled_Width                            : 1920
    Sampled_Height                           : 1080
    Pixel aspect ratio                       : 1.000
    Display aspect ratio                     : 1.778
    Display aspect ratio                     : 16:9
    Rotation                                 : 90.000
    Rotation                                 : 90°
    Frame rate mode                          : VFR
    Frame rate mode                          : Variable
    Frame rate                               : 25.044
    Frame rate                               : 25.044 FPS
    Minimum frame rate                       : 23.077
    Minimum frame rate                       : 23.077 FPS
    Maximum frame rate                       : 30.000
    Maximum frame rate                       : 30.000 FPS
    Frame count                              : 1309
    Resolution                               : 8
    Resolution                               : 8 bits
    Colorimetry                              : 4:2:0
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Scan type                                : Progressive
    Interlacement                            : PPF
    Interlacement                            : Progressive
    Bits/(Pixel*Frame)                       : 0.335
    Stream size                              : 113523046
    Stream size                              : 108 MiB (100%)
    Stream size                              : 108 MiB
    Stream size                              : 108 MiB
    Stream size                              : 108 MiB
    Stream size                              : 108.3 MiB
    Stream size                              : 108 MiB (100%)
    Proportion of this stream                : 0.99590
    Title                                    : Core Media Video
    Encoded date                             : UTC 2016-10-08 22:51:19
    Tagged date                              : UTC 2016-10-08 22:52:12
    Color range                              : Limited
    colour_description_present               : Yes
    Color primaries                          : BT.709
    Transfer characteristics                 : BT.709
    Matrix coefficients                      : BT.709

    Audio
    Count                                    : 272
    Count of stream of this kind             : 1
    Kind of stream                           : Audio
    Kind of stream                           : Audio
    Stream identifier                        : 0
    StreamOrder                              : 1
    ID                                       : 2
    ID                                       : 2
    Format                                   : AAC
    Format/Info                              : Advanced Audio Codec
    Commercial name                          : AAC
    Format profile                           : LC
    Codec ID                                 : 40
    Codec                                    : AAC LC
    Codec                                    : AAC LC
    Codec/Family                             : AAC
    Codec/CC                                 : 40
    Duration                                 : 52268
    Duration                                 : 52 s 268 ms
    Duration                                 : 52 s 268 ms
    Duration                                 : 52 s 268 ms
    Duration                                 : 00:00:52.268
    Duration                                 : 00:00:52:15
    Duration                                 : 00:00:52.268 (00:00:52:15)
    Source duration                          : 52338
    Source duration                          : 52 s 338 ms
    Source duration                          : 52 s 338 ms
    Source duration                          : 52 s 338 ms
    Source duration                          : 00:00:52.338
    Bit rate mode                            : CBR
    Bit rate mode                            : Constant
    Bit rate                                 : 64000
    Bit rate                                 : 64.0 kb/s
    Channel(s)                               : 1
    Channel(s)                               : 1 channel
    Channel positions                        : Front: C
    Channel positions                        : 1/0/0
    ChannelLayout                            : C
    Samples per frame                        : 1024
    Sampling rate                            : 44100
    Sampling rate                            : 44.1 kHz
    Samples count                            : 2305019
    Frame rate                               : 43.066
    Frame rate                               : 43.066 FPS (1024 spf)
    Frame count                              : 2251
    Source frame count                       : 2254
    Compression mode                         : Lossy
    Compression mode                         : Lossy
    Stream size                              : 410424
    Stream size                              : 401 KiB (0%)
    Stream size                              : 401 KiB
    Stream size                              : 401 KiB
    Stream size                              : 401 KiB
    Stream size                              : 400.8 KiB
    Stream size                              : 401 KiB (0%)
    Proportion of this stream                : 0.00360
    Source stream size                       : 410894
    Source stream size                       : 401 KiB (0%)
    Source stream size                       : 401 KiB
    Source stream size                       : 401 KiB
    Source stream size                       : 401 KiB
    Source stream size                       : 401.3 KiB
    Source stream size                       : 401 KiB (0%)
    Source_StreamSize_Proportion             : 0.00360
    Title                                    : Core Media Audio
    Encoded date                             : UTC 2016-10-08 22:51:19
    Tagged date                              : UTC 2016-10-08 22:52:12

    Other #1
    Count                                    : 112
    Count of stream of this kind             : 2
    Kind of stream                           : Other
    Kind of stream                           : Other
    Stream identifier                        : 0
    Stream identifier                        : 1
    Type                                     : meta
    Duration                                 : 52268
    Duration                                 : 52 s 268 ms
    Duration                                 : 52 s 268 ms
    Duration                                 : 52 s 268 ms
    Duration                                 : 00:00:52.268
    Duration                                 : 00:00:52.268
    Frame count                              : 6
    Bit rate mode                            : VBR

    Other #2
    Count                                    : 112
    Count of stream of this kind             : 2
    Kind of stream                           : Other
    Kind of stream                           : Other
    Stream identifier                        : 1
    Stream identifier                        : 2
    Type                                     : meta
    Duration                                 : 52268
    Duration                                 : 52 s 268 ms
    Duration                                 : 52 s 268 ms
    Duration                                 : 52 s 268 ms
    Duration                                 : 00:00:52.268
    Duration                                 : 00:00:52.268
    Frame count                              : 1
    Bit rate mode                            : CBR

    and ffprobe IMG_1438.MOV outputs :

    ffprobe version 3.1.3 Copyright (c) 2007-2016 the FFmpeg developers
     built with Apple LLVM version 7.3.0 (clang-703.0.31)
     configuration: --prefix=/usr/local/Cellar/ffmpeg/3.1.3 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --disable-lzma --enable-vda
     libavutil      55. 28.100 / 55. 28.100
     libavcodec     57. 48.101 / 57. 48.101
     libavformat    57. 41.100 / 57. 41.100
     libavdevice    57.  0.101 / 57.  0.101
     libavfilter     6. 47.100 /  6. 47.100
     libavresample   3.  0.  0 /  3.  0.  0
     libswscale      4.  1.100 /  4.  1.100
     libswresample   2.  1.100 /  2.  1.100
     libpostproc    54.  0.100 / 54.  0.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'IMG_1438.MOV':
     Metadata:
       major_brand     : qt  
       minor_version   : 0
       compatible_brands: qt  
       creation_time   : 2016-10-08 22:51:19
       com.apple.quicktime.make: Apple
       com.apple.quicktime.model: iPhone 5
       com.apple.quicktime.software: 10.0.2
       com.apple.quicktime.creationdate: 2016-10-08T17:51:19-0500
     Duration: 00:00:52.27, start: 0.000000, bitrate: 17446 kb/s
       Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080, 17375 kb/s, 25.04 fps, 120 tbr, 600 tbn, 1200 tbc (default)
       Metadata:
         rotate          : 90
         creation_time   : 2016-10-08 22:51:19
         handler_name    : Core Media Data Handler
         encoder         : H.264
       Side data:
         displaymatrix: rotation of -90.00 degrees
       Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 62 kb/s (default)
       Metadata:
         creation_time   : 2016-10-08 22:51:19
         handler_name    : Core Media Data Handler
       Stream #0:2(und): Data: none (mebx / 0x7862656D), 0 kb/s (default)
       Metadata:
         creation_time   : 2016-10-08 22:51:19
         handler_name    : Core Media Data Handler
       Stream #0:3(und): Data: none (mebx / 0x7862656D), 0 kb/s (default)
       Metadata:
         creation_time   : 2016-10-08 22:51:19
         handler_name    : Core Media Data Handler
    Unsupported codec with id 0 for input stream 2
    Unsupported codec with id 0 for input stream 3

    UPDATE
    To clarify : my video above, the one with the high framerate (120 FPS) output after scaling, plays perfectly before and after scaling with FFmpeg (no sync issues, and 120 FPS is only about 14% larger in file size), I am simply trying to understand why this increase in framerate happens (just a little beyond Mulvya’s note that the framerate stored in the container is wrong).

    From a programming perspective, the initial issue I ran into was that I was using frame= from FFmpeg’s sterr console output to determine progress, which reports erroneous results when the frame count increases dramatically on output ("I’m 372% done encoding ?!") ; I have since read another stackoverflow answer and changed my code to use time=, which appears to be a more robust way for me to display FFmpeg progress. (Also, there is FFmpeg’s -progress option, of course).

    Improving on the original command

    My new command to scale, preserve a useful framerate, and optimize threads :

    ffmpeg -i IMG_1438.MOV -vf scale=-2:600 -r 30 -vsync 0 IMG_1438_scaledTo600.MOV

    Where 30 is the "Maximum frame rate" from mediainfo.

    Thanks to help in the comments, I now know I do not fully understand FFmpeg’s use of three different time bases for timestamps : tbn, tbc, and tbr.
    They were explained by Robert Swain in 2009 and his explanation was also used to answer a Stackoverflow question about tbn, tbc, tbr.

    It sounds to me, as I’m pulling together comments from Mulvya below and Michael Rampe at another forum, that tbr is guessed ; it is frequently but not always the best value to use when changing from a variable to a constant frame rate video.

    Which leaves these 2 questions...

    (1) tbr is incorrect when "field rate and frame rate" differ ? Does this happen a lot ?
    (2) Is -r 30 where 30 is the maximum frame rate reported by mediainfo the best way to do it for most codec/container combinations ? (Or should I only use this method when I am scaling a H.264/MPEG-4 AVC video ?)

  • How to create a widget – Introducing the Piwik Platform

    4 septembre 2014, par Thomas Steur — Development

    This is the next post of our blog series where we introduce the capabilities of the Piwik platform (our previous post was How to create a scheduled task in Piwik). This time you’ll learn how to create a new widget. For this tutorial you will need to have basic knowledge of PHP.

    What is a widget in Piwik ?

    Widgets can be added to your dashboards or exported via a URL to embed it on any page. Most widgets in Piwik represent a report but a widget can display anything. For instance a RSS feed of your corporate news. If you prefer to have most of your business relevant data in one dashboard why not display the number of offline sales, the latest stock price, or other key metrics together with your analytics data ?

    Getting started

    In this series of posts, we assume that you have already set up your development environment. If not, visit the Piwik Developer Zone where you’ll find the tutorial Setting up Piwik.

    To summarize the things you have to do to get setup :

    • Install Piwik (for instance via git).
    • Activate the developer mode : ./console development:enable --full.
    • Generate a plugin : ./console generate:plugin --name="MyWidgetPlugin". There should now be a folder plugins/MyWidgetPlugin.
    • And activate the created plugin under Settings => Plugins.

    Let’s start creating a widget

    We start by using the Piwik Console to create a widget template :

    ./console generate:widget

    The command will ask you to enter the name of the plugin the widget should belong to. I will simply use the above chosen plugin name “MyWidgetPlugin”. It will ask you for a widget category as well. You can select any existing category, for instance “Visitors”, “Live !” or “Actions”, or you can define a new category, for instance your company name. There should now be a file plugins/MyWidgetPlugin/Widgets.php which contains already some examples to get you started easily :

    1. class Widgets extends \Piwik\Plugin\Widgets
    2. {
    3.     /**
    4.      * Here you can define the category the widget belongs to. You can reuse any existing widget category or define your own category.
    5.      * @var string
    6.      */
    7.     protected $category = 'ExampleCompany';
    8.  
    9.     /**
    10.      * Here you can add one or multiple widgets. You can add a widget by calling the method "addWidget()" and pass the name of the widget as well as a method name that should be called to render the widget. The method can be defined either directly here in this widget class or in the controller in case you want to reuse the same action for instance in the menu etc.
    11.      */
    12.     protected function init()
    13.     {
    14.         $this->addWidget('Example Widget Name', $method = 'myExampleWidget');
    15.         $this->addWidget('Example Widget 2',    $method = 'myExampleWidget', $params = array('myparam' => 'myvalue'));
    16.     }
    17.  
    18.     /**
    19.      * This method renders a widget as defined in "init()". It's on you how to generate the content of the widget. As long as you return a string everything is fine. You can use for instance a "Piwik\View" to render a twig template. In such a case don't forget to create a twig template (eg. myViewTemplate.twig) in the "templates" directory of your plugin.
    20.      *
    21.      * @return string
    22.      */
    23.     public function myExampleWidget()
    24.     {
    25.         $view = new View('@MyWidgetPlugin/myViewTemplate');
    26.         return $view->render();
    27.     }
    28. }

    Télécharger

    As you might have noticed in the generated template we put emphasis on adding comments to explain you directly how to continue and where to get more information. Ideally this saves you some time and you don’t even have to search for more information on our developer pages. The category is defined in the property $category and can be changed at any time. Starting from Piwik 2.6.0 the generator will directly create a translation key if necessary to make it easy to translate the category into any language. Translations will be a topic in one of our future posts until then you can explore this feature on our Internationalization guide.

    A simple example

    We can define one or multiple widgets in the init method by calling addWidget($widgetName, $methodName). To do so we define the name of a widget which will be seen by your users as well as the name of the method that shall render the widget.

    protected $category = 'Example Company';

    public function init()
    {
       // Registers a widget named 'News' under the category 'Example Company'.
       // The method 'myCorporateNews' will be used to render the widget.
       $this->addWidget('News', $method = 'myCorporateNews');
    }

    public function myCorporateNews()
    {
       return file_get_contents('http://example.com/news');
    }

    This example would display the content of the specified URL within the widget as defined in the method myCorporateNews. It’s on you how to generate the content of the widget. Any string returned by this method will be displayed within the widget. You can use for example a View to render a Twig template. For simplification we are fetching the content from another site. A more complex version would cache this content for faster performance. Caching and views will be covered in one of our future posts as well.

    Example Widget

    Did you know ? To make your life as a developer as stress-free as possible the platform checks whether the registered method actually exists and whether the method is public. If not, Piwik will display a notification in the UI and advice you with the next step.

    Checking permissions

    Often you do not want to have the content of a widget visible to everyone. You can check for permissions by using one of our many convenient methods which all start with \Piwik\Piwik::checkUser*. Just to introduce some of them :

    // Make sure the current user has super user access
    \Piwik\Piwik::checkUserHasSuperUserAccess();

    // Make sure the current user is logged in and not anonymous
    \Piwik\Piwik::checkUserIsNotAnonymous();

    And here is an example how you can use it within your widget :

    public function myCorporateNews()
    {
       // Make sure there is an idSite URL parameter
       $idSite = Common::getRequestVar('idSite', null, 'int');

       // Make sure the user has at least view access for the specified site. This is useful if you want to display data that is related to the specified site.
       Piwik::checkUserHasViewAccess($idSite);

       $siteUrl = \Piwik\Site::getMainUrlFor($idSite);

       return file_get_contents($siteUrl . '/news');
    }

    In case any condition is not met an exception will be thrown and an error message will be presented to the user explaining that he does not have enough permissions. You’ll find the documentation for those methods in the Piwik class reference.

    How to test a widget

    After you have created your widgets you are surely wondering how to test it. First, you should write a unit or integration test which we will cover in one of our future blog posts. Just one hint : You can use the command ./console generate:test to create a test. To manually test a widget you can add a widget to a dashboard or export it.

    Publishing your Plugin on the Marketplace

    In case you want to share your widgets with other Piwik users you can do this by pushing your plugin to a public GitHub repository and creating a tag. Easy as that. Read more about how to distribute a plugin.

    Advanced features

    Isn’t it easy to create a widget ? We never even created a file ! Of course, based on our API design principle “The complexity of our API should never exceed the complexity of your use case.” you can accomplish more if you want : You can clarify parameters that will be passed to your widget, you can create a method in the Controller instead of the Widget class to make the same method also reusable for adding it to the menu, you can assign different categories to different widgets, you can remove any widgets that were added by the Piwik core or other plugins and more.

    Would you like to know more about widgets ? Go to our Widgets class reference in the Piwik Developer Zone.

    If you have any feedback regarding our APIs or our guides in the Developer Zone feel free to send it to us.