Recherche avancée

Médias (0)

Mot : - Tags -/publication

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

Autres articles (33)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

  • Librairies et binaires spécifiques au traitement vidéo et sonore

    31 janvier 2010, par

    Les logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
    Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
    Binaires complémentaires et facultatifs flvtool2 : (...)

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

Sur d’autres sites (5763)

  • Xbox Sphinx Protocol

    21 octobre 2013, par Multimedia Mike — DRM, xbox

    I’ve gone down the rabbit hole of trying to read the Xbox DVD drive from Linux. Honestly, I’m trying to remember why I even care at this point. Perhaps it’s just my metagame of trying to understand how games and related technologies operate. In my last post of the matter, I determined that it is possible to hook an Xbox drive up to a PC using a standard 40-pin IDE interface and read data sectors. However, I learned that just because the Xbox optical drive is reading an Xbox disc, that doesn’t mean it’s just going to read the sectors in response to a host request.

    Oh goodness, no. The drive is going to make the host work for those sectors.

    To help understand the concept of locked/unlocked sectors on an Xbox disc, I offer this simplistic diagram :


    Xbox locked disc diagram

    Any DVD drive (including the Xbox drive) is free to read those first 6992 sectors (about 14 MB of data) which just contain a short DVD video asking the user to insert the disc into a proper Xbox console. Reading the remaining sectors involves performing a sequence of SCSI commands that I have taken to calling the “Sphinx Protocol” for reasons I will explain later in this post.

    References
    Doing a little Googling after my last post on the matter produced this site hosting deep, technical Xbox information. It even has a page about exactly what I am trying to achieve : Use an Xbox DVD Drive in Your PC. The page provides a tool named dvdunlocker written by “The Specialist” to perform the necessary unlocking. The archive includes a compiled Windows binary as well as its source code. The source code is written in Delphi Pascal and leverages Windows SCSI APIs. Still, it is well commented and provides a roadmap, which I will try to describe in this post.

    Sphinx Protocol
    Here is a rough flowchart of the steps that are (probably) involved in the unlocking of those remaining sectors. I reverse engineered this based on the Pascal tool described in the previous section. Disclaimer : at the time of this writing, I haven’t tested all of the steps due to some Linux kernel problems, described later.


    Xbox SCSI Unlock Protocol

    Concerning the challenge/response table that the drive sends back, it’s large (0×664 / 1636 bytes), and not all of the bytes’ meanings are known. However, these are the bytes that seem to be necessary (all multi-byte numbers are big endian) :

     bytes 0-1        Size of mode page payload data (should be 0x0662)
     bytes 2-771      Unknown
     byte  772        Should be 1
     byte  773        Number of entries in challenge/response table
     bytes 774-1026   Encrypted challenge/response table
     bytes 1027-1186  Unknown
     bytes 1187-1230  Key basis (44 bytes)
     bytes 1231-1635  Unknown
    

    The challenge/response table is the interesting part, but it’s encrypted with RC4 a.k.a. ARCFOUR. The key is derived from the 44 bytes I have labeled “key basis”– cryptographic literature probably has a better term for it ; chime in if you know what that might be. An SHA-1 hash is computed over the 44 bytes.

    The resulting SHA-1 hash — the first part of it, to be exact — is fed as the key into the RC4 decryption. The output of SHA-1 contains 160 bits of information. 160 / 8 = 20 bytes of information. To express this as a printable hex digest requires 40 characters. The SHA-1 hash is converted to a hex digest and then the first 7 of the characters are fed into the RC4 initialization function as the key. Then, the RC4 decrypter does its work on the 253 bytes of the challenge/response table.

    So that’s why I took to calling this the “Sphinx Protocol” — I felt like I was being challenged with a bizarre riddle. Perhaps that describes a lot of cryptosystems, though You have to admit it sounds kind of cool.

    The challenge/response table contains 23 11-byte records. The format of this table is (again, multi-byte numbers are big-endian) :

     byte  0     This is 1 if this challenge/response pair is valid
     byte  1     Challenge ID
     bytes 2-5   Challenge
     byte  6     Response ID
     bytes 7-10  Response
    

    Example
    It’s useful to note that the challenge/response table and associated key is different for every disc (at least all the ones I have looked at). So this might be data that comes from the disc, since the values will always be the same for a given disc.

    Let’s examine Official Xbox Magazine disc #16 (Indiana Jones and The Emperor’s Tomb) :


    Xbox Magazine #16 featuring Indiana Jones

    Before I decrypt the challenge/response table, it looks like this :

       0 : 180, 172 : 0xEB100059 ;  66 : 0xD56AFB56
       1 :  34,  71 : 0x8F9BF03A ; 192 : 0xC32CBDF8
       2 : 226, 216 : 0xA29B77F2 ;  12 : 0x4474A6F1
       3 :  72, 122 : 0x9F5ABF33 ; 255 : 0xC5E3C304
       4 :   1, 103 : 0x76142ADA ; 233 : 0xDE145D42 ****
       5 :  49, 193 : 0xA1CD6192 ; 189 : 0x2169DBA5
       6 : 182, 250 : 0x9977894F ;  96 : 0x5A929E2B
       7 : 148,  71 : 0x6DD10A54 ; 115 : 0xF0BDAC4F
       8 :  12,  45 : 0x5D5EB6FD ; 148 : 0x84E60A00
       9 :  99, 121 : 0xFEAED372 ; 201 : 0xDA9986F9
      10 : 172, 230 : 0xE6C0D0B4 ; 214 : 0x9050C250
      11 :  84,  65 : 0x95CB8775 ; 104 : 0x550886C6
      12 : 210,  65 : 0x1ED23619 ; 171 : 0x6DF4A35B
      13 :   2, 155 : 0xD0AAE1E0 ; 130 : 0x00D1FFCF
      14 :  40,   2 : 0x172EFEB8 ; 159 : 0x37E03E50
      15 :  49,  15 : 0x43E5E378 ; 223 : 0x267F9C9A
      16 : 240, 173 : 0x357D5D1C ; 250 : 0x24965D67
      17 :  80, 184 : 0x5E7AF1A3 ;  81 : 0x3A8F69A7
      18 : 154, 186 : 0x6626BEAC ; 245 : 0xE639540A
      19 : 231, 249 : 0xFABAAFB7 ; 227 : 0x4C686A07
      20 : 150, 186 : 0x9A6D7AA3 ; 133 : 0x25971CF0
      21 : 236, 192 : 0x5CD97DD4 ; 247 : 0x26655EFB
      22 :  68, 173 : 0xE2D372E4 ; 207 : 0x103FBF94
    there are 1 valid pairs in the list : 4
    

    My best clue that it’s not right is that there is only 1 valid entry (denoted by my tool using ****). The source I reverse engineered for this data indicates that there needs to be at least 2 valid pairs. After running the RC4 decryption on the table, it looks like this and I get far more valid pairs :

       0 :   1, 174 : 0xBD628255 ;   0 : 0x9F0A31AF ****
       1 :   2, 176 : 0x3151B341 ;   2 : 0x9C87C180
       2 :   3, 105 : 0x018879E5 ;   1 : 0xFF068B5C
       3 :   2,   7 : 0x1F316AAF ;   3 : 0xF420D3ED
       4 :   3,  73 : 0xC2EBFBE9 ;   0 : 0x17062B5B
       5 : 252, 163 : 0xFF14B5CB ; 236 : 0xAF813FBC
       6 :   2, 233 : 0x5EE95C49 ;   1 : 0x37AA5511
       7 :   1, 126 : 0xBD628255 ;   0 : 0x5BA3FBD4 ****
       8 :   3,   4 : 0xB68BFEE6 ;   3 : 0xA8F3B918
       9 :   3,  32 : 0xEA614943 ;   2 : 0xA678D715
      10 :   2, 248 : 0x1BDD374E ;   0 : 0x8D2AC2C7
      11 :   3,  17 : 0x0EABCE81 ;   2 : 0xC90A7242
      12 :   1, 186 : 0xBD628255 ;   0 : 0xC4820242 ****
      13 :   3, 145 : 0xB178F942 ;   3 : 0x4D78AD62
      14 :   3,  37 : 0x4A6CE5E2 ;   2 : 0xBF94E1C6
      15 :   1, 102 : 0xBD628255 ;   0 : 0xFFB83D8D ****
      16 :   3, 122 : 0xF97B0905 ;   1 : 0x38533125
      17 :   3, 197 : 0x57A6865D ;   2 : 0xA61D31EF
      18 :   3,  27 : 0xC7227D7C ;   2 : 0xA3F9BA1E
      19 :   1,  16 : 0xBD628255 ;   0 : 0x8557CCC8 ****
      20 :   2,  53 : 0x1DA9D156 ;   3 : 0xC9051754
      21 :   2,  90 : 0x3CD66BEE ;   3 : 0xFD851D3E
      22 :   1, 252 : 0xBD628255 ;   0 : 0xB3F22701 ****
    there are 6 valid pairs in the list : 0 7 12 15 19 22
    

    So, hopefully, I have the decryption correct.

    Also of note is that you only get one chance to get this unlocking correct– fail, and the drive won’t return a valid DVD structure block again. You will either need to reboot the Xbox or eject & close the tray before you get to try again.

    Problems Making It Work In Linux
    There are a couple of ways to play with SCSI protocols under Linux. In more recent kernels, block devices are named /dev/sda, /dev/sdb, etc. Each of these block devices has a corresponding character device named /dev/sg0, /dev/sg1, etc. ‘sg’ stands for SCSI generic. This character devices can be opened as readable and/or writable and SCSI commands can be freely written with write() and data retrieved with read(). Pretty powerful.

    Except that the one machine I still possess which supports 40-pin IDE/ATAPI devices is running Linux kernel 2.6.24 which dates back to early 2008 and it still enumerates the IDE block devices as /dev/hda, /dev/hdb, etc. There are no corresponding /dev/sgX character devices. What to do ? It seems that a program can still issue SCSI commands using an ioctl() facility named SG_IO.

    I was able to make the SG_IO ioctl() work for the most part (except for the discovery that the Xbox drive doesn’t respond to a basic SCSI Inquiry command). However, I ran into a serious limitation– a program can only open a /dev/hdX block device in read-only mode if the device corresponds to a read-only drive like, for example, a DVD-ROM drive. This means that a program can’t issue SCSI mode select commands to the drive, which counts as writing. This means that my tool can’t unlock the drive.

    Current Status
    So this is where my experiment is blocked right now. I have been trying to compile various Linux kernels to remedy the situation. But I always seem to find myself stuck in one of 2 situations, depending on the configuration options I choose : Either the drives are enumerated with the /dev/hdX convention and I am stuck in read-only mode (with no mode select) ; or the drives are enumerated with /dev/sdX along with corresponding /dev/sgN character devices, in which case the kernel does not recognize the Xbox DVD-ROM drive.

    This makes me wonder if there’s a discrepancy between the legacy ATA/ATAPI drivers (which sees the drive) and the newer SATA/PATA subsystem (which doesn’t see the drive). I also wonder about hacking the kernel logic to allow SCSI mode select logic to proceed to the device for a read-only file handle.

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

  • OpenCV VideoWriter using ffmpeg with "Could not open codec 'libx264'" Error

    28 septembre 2016, par user2262504

    I am new to OpenCV, and I want write Mat images into video using VideoWriter on Ubuntu 12.04. But when constructing VideoWriter, errors came out.

    It seems that OpenCV invoke ffmpeg API using default parameters and ffmpeg invoke x264 using its default parameters. Then these setting is broken for libx264. Thus the "Could not open codec ’libx264’" error.

    Anyone has ideas to solve this problem ?

    More specifically :

    1. anyone knows where and how OpenCV invoke ffmpeg API ?
    2. how to change ffmpeg default settings using code, hopefull, can be easily embeded into OpenCV ?
    3. will changes of default in ffmpeg be carried to libx264 ?

    Errors :

    1. Uising CV_FOURCC('H', '2', '6', '4')
    [libx264 @ 0x255de40] broken ffmpeg default settings detected
    [libx264 @ 0x255de40] use an encoding preset (e.g. -vpre medium)
    [libx264 @ 0x255de40] preset usage: -vpre <speed> -vpre <profile>
    [libx264 @ 0x255de40] speed presets are listed in x264 --help
    [libx264 @ 0x255de40] profile is optional; x264 defaults to high
    Could not open codec 'libx264': Unspecified error

    2. Using FOURCC = -1 to invoke user customized codec
    OpenCV Error: Unsupported format or combination of formats (Gstreamer Opencv
    backend doesn't support this codec acutally.) in CvVideoWriter_GStreamer::open,
    file /home/XXX/Downloads/opencv-2.4.8/modules/highgui/src/cap_gstreamer.cpp,
    line 505 terminate called after throwing an instance of 'cv::Exception'
    what():  /home/XXX/Downloads/opencv-2.4.8/modules/highgui/src/cap_gstreamer.cpp:
    505: error: (-210) Gstreamer Opencv backend doesn't support this codec acutally.
    in function CvVideoWriter_GStreamer::open
    </profile></speed>

    Codes :

    int main(int argc, char *argv[])
    {
       VideoWriter outputVideo;
       bool fourcc_on = true; //switch on / off different error
       if (fourcc_on)
           outputVideo.open("outVideo.avi", CV_FOURCC('H', '2', '6', '4'), 25, Size(100, 100), true);
       else
           outputVideo.open("outVideo.avi", -1, 25, Size(100, 100), true);

       if (!outputVideo.isOpened())
       {
           cout  &lt;&lt; "Could not open the output video for write" &lt;&lt; endl;
           return -1;
       }
       return 0;
    }

    OpenCV Configuration :

    -- Detected version of GNU GCC: 46 (406)
    -- Found OpenEXR: /usr/lib/libIlmImf.so
    -- Looking for linux/videodev.h
    -- Looking for linux/videodev.h - not found
    -- Looking for linux/videodev2.h
    -- Looking for linux/videodev2.h - found
    -- Looking for sys/videoio.h
    -- Looking for sys/videoio.h - not found
    -- Looking for libavformat/avformat.h
    -- Looking for libavformat/avformat.h - found
    -- Looking for ffmpeg/avformat.h
    -- Looking for ffmpeg/avformat.h - not found
    -- Could NOT find JNI (missing:  JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
    --
    -- General configuration for OpenCV 2.4.8 =====================================
    --   Version control:               unknown
    --
    --   Platform:
    --     Host:                        Linux 3.8.0-38-generic x86_64
    --     CMake:                       2.8.7
    --     CMake generator:             Unix Makefiles
    --     CMake build tool:            /usr/bin/make
    --     Configuration:               RELEASE
    --
    --   C/C++:
    --     Built as dynamic libs?:      YES
    --     C++ Compiler:                /usr/bin/c++  (ver 4.6)
    --     C++ flags (Release):         -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -O3 -DNDEBUG  -DNDEBUG
    --     C++ flags (Debug):           -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -g  -O0 -DDEBUG -D_DEBUG
    --     C Compiler:                  /usr/bin/gcc
    --     C flags (Release):           -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -O3 -DNDEBUG  -DNDEBUG
    --     C flags (Debug):             -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -g  -O0 -DDEBUG -D_DEBUG
    --     Linker flags (Release):      
    --     Linker flags (Debug):        
    --     Precompiled headers:         YES
    --
    --   OpenCV modules:
    --     To be built:                 core flann imgproc highgui features2d calib3d ml video legacy objdetect photo gpu ocl nonfree contrib python stitching superres ts videostab
    --     Disabled:                    world
    --     Disabled by dependency:      -
    --     Unavailable:                 androidcamera dynamicuda java
    --
    --   GUI:
    --     QT:                          NO
    --     GTK+ 2.x:                    YES (ver 2.24.10)
    --     GThread :                    YES (ver 2.32.4)
    --     GtkGlExt:                    NO
    --     OpenGL support:              NO
    --
    --   Media I/O:
    --     ZLib:                        /usr/lib/x86_64-linux-gnu/libz.so (ver 1.2.3.4)
    --     JPEG:                        /usr/lib/x86_64-linux-gnu/libjpeg.so (ver )
    --     PNG:                         /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.2.46)
    --     TIFF:                        /usr/lib/x86_64-linux-gnu/libtiff.so (ver 42 - 3.9.5)
    --     JPEG 2000:                   /usr/lib/x86_64-linux-gnu/libjasper.so (ver 1.900.1)
    --     OpenEXR:                     /usr/lib/libImath.so /usr/lib/libIlmImf.so /usr/lib/libIex.so /usr/lib/libHalf.so /usr/lib/libIlmThread.so (ver 1.6.1)
    --
    --   Video I/O:
    --     DC1394 1.x:                  NO
    --     DC1394 2.x:                  YES (ver 2.2.0)
    --     FFMPEG:                      YES
    --       codec:                     YES (ver 55.58.105)
    --       format:                    YES (ver 55.37.101)
    --       util:                      YES (ver 52.78.100)
    --       swscale:                   YES (ver 2.6.100)
    --       gentoo-style:              YES
    --     GStreamer:                  
    --       base:                      YES (ver 0.10.36)
    --       app:                       YES (ver 0.10.36)
    --       video:                     YES (ver 0.10.36)
    --     OpenNI:                      NO
    --     OpenNI PrimeSensor Modules:  NO
    --     PvAPI:                       NO
    --     GigEVisionSDK:               NO
    --     UniCap:                      NO
    --     UniCap ucil:                 NO
    --     V4L/V4L2:                    Using libv4l (ver 1.0.1)
    --     XIMEA:                       NO
    --     Xine:                        NO
    --
    --   Other third-party libraries:
    --     Use IPP:                     NO
    --     Use Eigen:                   NO
    --     Use TBB:                     NO
    --     Use OpenMP:                  NO
    --     Use GCD                      NO
    --     Use Concurrency              NO
    --     Use C=:                      NO
    --     Use Cuda:                    NO
    --     Use OpenCL:                  YES
    --
    --   OpenCL:
    --     Version:                     dynamic
    --     Include path:                /home/shixudongleo/Downloads/opencv-2.4.8/3rdparty/include/opencl/1.2
    --     Use AMD FFT:                 NO
    --     Use AMD BLAS:                NO
    --
    --   Python:
    --     Interpreter:                 /usr/bin/python (ver 2.7.3)
    --     Libraries:                   /usr/lib/libpython2.7.so
    --     numpy:                       /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.6.1)
    --     packages path:               lib/python2.7/dist-packages
    --
    --   Java:
    --     ant:                         NO
    --     JNI:                         NO
    --     Java tests:                  NO
    --
    --   Documentation:
    --     Build Documentation:         NO
    --     Sphinx:                      NO
    --     PdfLaTeX compiler:           /usr/bin/pdflatex
    --
    --   Tests and samples:
    --     Tests:                       YES
    --     Performance tests:           YES
    --     C/C++ Examples:              NO
    --
    --   Install path:                  /usr/local
    --
    --   cvconfig.h is in:              /home/shixudongleo/Downloads/opencv-2.4.8/build
    -- -----------------------------------------------------------------
    --
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/XXX/Downloads/opencv-2.4.8/build

    FFMPEG

    ffmpeg is enable to support OpenCV and libx264 is enabled when compiling ffmpeg.
    By using ffmpeg command line, libx264 is running normally.

    $ ffmpeg -i test.avi -vcodec libx264 test.mp4
    ffmpeg -i test.avi -vcodec libx264 test.mp4 > ~/Downloads/ffmpeg_log.txt
    ffmpeg version 2.2.git Copyright (c) 2000-2014 the FFmpeg developers
     built on Apr 24 2014 16:39:51 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
     configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab --enable-shared --enable-pic
     libavutil      52. 78.100 / 52. 78.100
     libavcodec     55. 58.105 / 55. 58.105
     libavformat    55. 37.101 / 55. 37.101
     libavdevice    55. 13.100 / 55. 13.100
     libavfilter     4.  4.100 /  4.  4.100
     libswscale      2.  6.100 /  2.  6.100
     libswresample   0. 18.100 /  0. 18.100
     libpostproc    52.  3.100 / 52.  3.100
    Input #0, avi, from 'test.avi':
     Duration: 00:00:03.73, start: 0.000000, bitrate: 1757 kb/s
       Stream #0:0: Video: msvideo1 (CRAM / 0x4D415243), rgb555le, 320x240, 1781 kb/s, 15 tbr, 15 tbn, 15 tbc
       Metadata:
         title           : julius.avi Video #1
    File 'test.mp4' already exists. Overwrite ? [y/N] y
    No pixel format specified, yuv444p for H.264 encoding chosen.
    Use -pix_fmt yuv420p for compatibility with outdated media players.
    [libx264 @ 0x25d08e0] using cpu capabilities: none!
    [libx264 @ 0x25d08e0] profile High 4:4:4 Predictive, level 1.2, 4:4:4 8-bit
    [libx264 @ 0x25d08e0] 264 - core 142 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=4 threads=12 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=15 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
    Output #0, mp4, to 'test.mp4':
     Metadata:
       encoder         : Lavf55.37.101
       Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv444p, 320x240, q=-1--1, 15360 tbn, 15 tbc
       Metadata:
         title           : julius.avi Video #1
    Stream mapping:
     Stream #0:0 -> #0:0 (msvideo1 -> libx264)
    Press [q] to stop, [?] for help
    frame=   56 fps=0.0 q=-1.0 Lsize=     321kB time=00:00:03.60 bitrate= 731.0kbits/s    
    video:320kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.409949%
    [libx264 @ 0x25d08e0] frame I:3     Avg QP:15.36  size:  7975
    [libx264 @ 0x25d08e0] frame P:38    Avg QP:26.05  size:  6230
    [libx264 @ 0x25d08e0] frame B:15    Avg QP:28.25  size:  4418
    [libx264 @ 0x25d08e0] consecutive B-frames: 46.4% 53.6%  0.0%  0.0%
    [libx264 @ 0x25d08e0] mb I  I16..4:  1.4% 72.8% 25.8%
    [libx264 @ 0x25d08e0] mb P  I16..4:  1.6%  5.7% 15.1%  P16..4:  7.6%  6.3%  7.4%  0.0%  0.0%    skip:56.3%
    [libx264 @ 0x25d08e0] mb B  I16..4:  0.2%  1.0%  2.0%  B16..8: 13.3%  7.8%  8.7%  direct: 8.3%  skip:58.8%  L0:34.9% L1:36.6% BI:28.5%
    [libx264 @ 0x25d08e0] 8x8 transform intra:37.7% inter:2.3%
    [libx264 @ 0x25d08e0] coded y,u,v intra: 52.1% 42.1% 30.1% inter: 19.6% 9.2% 5.2%
    [libx264 @ 0x25d08e0] i16 v,h,dc,p: 56% 17% 24%  2%
    [libx264 @ 0x25d08e0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 10% 16% 68%  1%  1%  1%  1%  1%  1%
    [libx264 @ 0x25d08e0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 18% 28%  5%  6%  5%  7%  5%  6%
    [libx264 @ 0x25d08e0] Weighted P-Frames: Y:31.6% UV:21.1%
    [libx264 @ 0x25d08e0] ref P L0: 70.5%  9.0% 12.1%  6.5%  2.0%
    [libx264 @ 0x25d08e0] ref B L0: 91.3%  8.7%
    [libx264 @ 0x25d08e0] kb/s:700.56