Recherche avancée

Médias (91)

Autres articles (52)

  • 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 logiciels spécifiques aux médias

    10 décembre 2010, par

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

  • Gestion générale des documents

    13 mai 2011, par

    MédiaSPIP ne modifie jamais le document original mis en ligne.
    Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
    Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...)

Sur d’autres sites (4040)

  • what is the good function php to deal with ffmpeg and progress bar [duplicate]

    17 mai 2014, par Abed Soliman

    This question already has an answer here :

    I ask about ffmpeg and progressbar

    I used exec function with ffmpeg and output the result to txt file

    and using some of code I found here to

    <center>



       &lt;?php

       define('RAPIDLEECH', 'yes');
       define('CONFIG_DIR', 'configs/');
       require_once('configs/config.php');
       define ( 'TEMPLATE_DIR', 'templates/'.$options['template_used'].'/' );
       // Include other useful functions
       require_once('classes/other.php');
       error_reporting(0);

       login_check();

       include(TEMPLATE_DIR.'header.php');

       echo ('<br /><br /><br /><b>AudioXtractor</b>, un complemento <br /> que te permite extraer el audio de tus videos.<br /><br /><br />');

       putenv('GDFONTPATH=' . realpath('.')); ?>

       <br />

       <form method="post"><center>
       <table>
         <td>Movie:
       <select>

       &lt;?php
       $exts=array(".ac3", ".avi", ".f4v", ".flv", ".mkv", ".mov", ".mp4", ".mpg", ".mpeg", ".rmvb", ".srt", ".swf", ".wav", ".wmv");
       $ext="";
       function vidlist($dir)
       {
       $results = array();
       $handler = opendir($dir);
       while ($file = readdir($handler))
       {
       if (strrchr($file,'.')!="")
       {
       $ext=strtolower(strrchr($file,'.'));
       }
       if ($file != '.' &amp;&amp; $file != '..' &amp;&amp; in_array($ext,$GLOBALS["exts"]))
       {
       $results[] = $file;
       }
       }
       closedir($handler);
       sort($results);
       return $results;
       }
       function Output($command) {
       $output = array($command);
       exec($command.' 2>&amp;1', $output);
       return ($output);
       }
       $files = vidlist("./files/");
       foreach($files as $file)
       {
           echo '<option value="'.$file.'">'.$file.'</option>';
       }

       ?>


       </select></td></table>

       <br /> >
       New MP3's name:
       <input type="text" value="nuevoaudio" />
       <br /> >
       <br />
       <br />

       <center><input type="submit" style="font-size:16px; font-weight:bold; cursor:pointer;" value="Extract" />
       

       </center></center></form>


       &lt;?php
       if ($_POST['video']!="")

           $video = 'files/';
           $video=array();    
           $video[0] = $_POST['video'];

       if ($_POST['nvdo']!="")

           $nvdo = 'files/';
           $nvdo=array();      
           $nvdo[0] = $_POST['nvdo'];



       foreach ($video as $vdo)
       foreach ($nvdo as $nvd)

       if (isset($_POST["analize"])) {

           exec("ffmpeg -i files/$vdo -ab 192k files/$nvd.mp3 -y 2> files/$nvd.txt");

           $ext=strtolower(strrchr($vdo,'.'));

       /////////////////////////////////////////////////////my code //////////////////////////////////////////

       $content = @file_get_contents("files/$nvd.txt");


           //get duration of source
           preg_match("/Duration: (.*?), start:/", $content, $matches);

           $rawDuration = $matches[1];

           //rawDuration is in 00:00:00.00 format. This converts it to seconds.
           $ar = array_reverse(explode(":", $rawDuration));
           $duration = floatval($ar[0]);
           if (!empty($ar[1])) $duration += intval($ar[1]) * 60;
           if (!empty($ar[2])) $duration += intval($ar[2]) * 60 * 60;

           //get the time in the file that is already encoded
           preg_match_all("/time=(.*?) bitrate/", $content, $matches);

           $rawTime = array_pop($matches);

           //this is needed if there is more than one match
           if (is_array($rawTime)){$rawTime = array_pop($rawTime);}

           //rawTime is in 00:00:00.00 format. This converts it to seconds.
           $ar = array_reverse(explode(":", $rawTime));
           $time = floatval($ar[0]);
           if (!empty($ar[1])) $time += intval($ar[1]) * 60;
           if (!empty($ar[2])) $time += intval($ar[2]) * 60 * 60;

           //calculate the progress
           $progress = round(($time/$duration) * 100);




           echo '<br /><br />¡Su video fue convertido correctamente! <br /><br />Link al archivo:';

           echo ' <a href="http://stackoverflow.com/feeds/tag/files/'.$nvd.'.mp3">'.$nvd.'.mp3</a><br />' . "<br />";
           echo "Duration: " . $duration . "<br />";
           echo "Current Time: " . $time . "<br />";
           echo "Progress: " . $progress . "%" . "<br />";

       //////////////////////////////////////my coed //////////////////////////////////////////////
       }

       ?>
       <br /><br /><a href="http://stackoverflow.com/feeds/tag/index.php">Volver al RapidLeech</a>

       <br /><br /><br />Formatos Aceptados: <br /><b>.ac3, .avi, .f4v, .flv, .mkv, .mov, .mp3,<br /> .mp4, .mpg, .mpeg, .rmvb, .srt, .swf, .wav, .wmv</b>
       <br /><br />
       </center>

       &lt;?php



       ?>

    so i ask some one he told me the exec stop php script and never give me

    You can't get the progress directly if you are using exec, because the php script is stopped until ffmpeg closes. (Because exec returns the whole execution output)

    You should use popen, for being able to get the output from the process in real time (without reading any file) for parse and show the progressbar

    Here is a example for get the output:

    When you get the progress info from ffmpeg, you can use your code for parse it and show your progressbar

    this is my popen script

    &lt;?php

    $handle = popen ("ffmpeg.exe -i files/fz.mp4 -ab 192k files/vdf.mp3 2>&amp;1 ", 'r');
    $handles = (string)$handle;
    $line = "";

    while (false !== ($char = fgetc($handle)))
    {
     if ($char == "\r")
     {
       // You could now parse the $line for status information.
       echo "$line\n";
       $line = "";
     } else {
       $line .= $char;
     }
     ob_flush();
     flush();
    }
    pclose ($handle);


       //get duration of source
       preg_match("/Duration: (.*?), start:/", $handles, $matches);

       $rawDuration = $matches[1];

       //rawDuration is in 00:00:00.00 format. This converts it to seconds.
       $ar = array_reverse(explode(":", $rawDuration));
       $duration = floatval($ar[0]);
       if (!empty($ar[1])) $duration += intval($ar[1]) * 60;
       if (!empty($ar[2])) $duration += intval($ar[2]) * 60 * 60;

       //get the time in the file that is already encoded
       preg_match_all("/time=(.*?) bitrate/", $handles, $matches);

       $rawTime = array_pop($matches);

       //this is needed if there is more than one match
       if (is_array($rawTime)){$rawTime = array_pop($rawTime);}

       //rawTime is in 00:00:00.00 format. This converts it to seconds.
       $ar = array_reverse(explode(":", $rawTime));
       $time = floatval($ar[0]);
       if (!empty($ar[1])) $time += intval($ar[1]) * 60;
       if (!empty($ar[2])) $time += intval($ar[2]) * 60 * 60;

       //calculate the progress
       $progress = round(($time/$duration) * 100);




       echo '<br /><br />¡Su video fue convertido correctamente! <br /><br />Link al archivo:';


       echo "Duration: " . $duration . "<br />";
       echo "Current Time: " . $time . "<br />";
       echo "Progress: " . $progress . "%" . "<br />";

    //////////////////////////////////////my coed //////////////////////////////////////////////

    ?>

    so i dont under stand what is good for ffmpeg progressbAR

    is exec or popen

    so please give me hints for ffmpeg real time progressbar

    what is good for progressbar

    is html5 progress bar

    or javascript progress bar

  • Your guide to cookies, web analytics, and GDPR compliance

    25 février 2020, par Joselyn Khor — Analytics Tips, Privacy, Security

    It’s been almost two years since the GDPR came into effect and turned the online world on its head. Confusion around cookies/cookie consent/cookie compliance remains till today. So we’d like to take this chance to talk more about the supposed “big bad” of the latest century. 

    Online cookies seem to have a bad reputation, but are they as bad as they seem ?

    To start, what are cookies on the internet ?

    An internet cookie a.k.a. an HTTP cookie, is a small piece of data sent from websites that is stored on your computer or mobile when you visit that site.

    Are all cookies bad ?

    No. Cookies themselves are usually harmless as they can’t infect computers with malware. 

    They can also be helpful for both websites who use them and individuals visiting those websites. For example, when online shopping, cookies on ecommerce sites keep track of what you’re shopping for. If you didn’t have that tracking, your cart would be empty every time you moved away from that site.

    For businesses/websites, cookies can be used for authentication (logins) and tracking website user experience. For example, tracking multiple visits to the same site in order to provide better experiences to customers visiting their website.

    internet cookies tracking

    The not-so-sweet types of cookies :

    Cookies that contain personal data

    Another example of a bad cookie is when cookies contain personal data directly in the cookie itself. For example, when websites store demographics or your name in a cookie ; or when a website stores survey results in a cookie. Use of cookies in these ways is considered bad practice nowadays.

    Third-party cookies

    They can be used by websites to learn about your visit and activity across multiple websites. Cookies can enter harmful territory when employed for “big brother” types of tracking i.e. when they’re used to build a virtual fingerprint of individuals after their activity is tracked from website to website. For example most advertising networks create third party cookies in your browser when you view an ad, which lets these advertisers track users across these websites and let companies buy more targeted ads.

    Why does Matomo use cookies ?

    web analytics cookies

    For accurate reporting of new and returning visitors. Matomo uses cookies to store some information about visitors between visits. We also use cookies to remember if someone gave consent to tracking, or opted out of tracking. 

    Types of cookies Matomo uses :

    • Matomo by default uses first-party cookies, set on the domain of your site.
    • Cookies created by Matomo start with : _pk_ref_pk_cvar_pk_id_pk_ses. See a list of all Matomo cookies : https://matomo.org/faq/general/faq_146/

    Cookie-less tracking - disable cookies and ensure cookie compliance :

    It’s possible to disable tracking cookies in Matomo by adding a line on the javascript code. When cookies are disabled, Matomo data will become slightly less accurateAlso, when cookies are disabled, there may still be a few cookies created in specific cases.

    If you disable cookies, Matomo tries to detect unique visitors by a fingerprint based on a few browser attributes : operating system, browser, browser plugins, IP address and browser language.

    By disabling tracking cookies, you may also use Matomo without needing to display a cookie consent screen. You can also keep tracking when they reject cookie consent by keeping cookies disabled.

    Cookies and the GDPR

    In some countries and according to the GDPR, websites need to provide a way for users to opt-out of all tracking, in particular tracking cookies.

    The GDPR regulates the use of cookies when they compromise an individual’s privacy. When cookies can identify an individual, it is considered personal data.

    cookies and GDPR

    Cookie compliance and the GDPR

    To be GDPR compliant you must :

    • Receive user consent before using any cookies (except strictly necessary cookies). Read more on cookies that are “clearly exempt from consent”.
    • Provide accurate and specific information about the data each cookie tracks and its purpose in plain language before consent is received.
    • Document and store consent received from users.
    • Allow users to access your service even if they refuse to allow the use of certain cookies
    • Make it as easy for users to withdraw their consent as it was for them to give their consent in the first place.

    Source : https://gdpr.eu/cookies/

    When does GDPR require cookie consent ?

    The purpose of the GDPR is to give individuals control over their personal data. As such this regulation has provisions and requirements which regulate the processing of personal data to protect the privacy of individuals. 

    This means in order to use cookies, you will sometimes need explicit consent from those individuals.

    When does GDPR not require cookie consent ?

    Then there are many cookies that generally do NOT require consent (Source : https://wikis.ec.europa.eu/display/WEBGUIDE/04.+Cookies). 

    These are :

    • user input cookies, for the duration of a session
    • authentication cookies, for the duration of a session
    • user-centric security cookies, used to detect authentication abuses and linked to the functionality explicitly requested by the user, for a limited persistent duration
    • multimedia content player session cookies, such as flash player cookies, for the duration of a session
    • load balancing session cookies and other technical cookies, for the duration of session
    • user interface customisation cookies, for a browser session or a few hours, when additional information in a prominent location is provided (e.g. “uses cookies” written next to the customisation feature)

    Tracking cookies and consent vs legitimate interest

    cookie consent and GDPR legitimate interests

    User consent is not always required :

    We understand that whenever you collect and process personal data, you need – almost always – to ask for their consent. However, there are instances where you have to process data under “legitimate interests”. The GDPR states that processing of personal data is lawful “if processing is necessary for the purposes of the legitimate interests”. This means if you have “legitimate interests” you can avoid asking for consent for collecting and processing personal information. Learn more : https://cookieinformation.com/resources/blog/what-is-legitimate-interest-under-the-gdpr 

    A lawful basis for processing personal data (proceeding with caution) :

    We’ve also written about having a lawful basis for processing personal data under GDPR with Matomo. The caveat here is you need to have a strong argument for legitimate interests. If you are processing personal data which may represent a risk to the final user, then getting consent is, for us, still the right lawful basis. If you are not sure, at the time of writing ICO is providing a tool in order to help you make this decision.

    How is Matomo Analytics GDPR compliant ?

    Matomo can be configured to automatically anonymise data so you don’t process any personal data. This allows you to completely avoid GDPR. If you decide to process personal data, Matomo provides you with 12 steps to easily comply with the GDPR guidelines.

    New developments on cookies and the GDPR

    In the early days of the GDPR, a spate of cookie management platforms (CMPs) popped up to help websites and people comply with GDPR rules around cookies.

    These have become problematic in recent years. Europe’s highest court ruled pre-checked box for cookie boxes does not give enough consent

    As well as that, new research suggests most cookie consent pop-ups in the EU fall short of GDPR. A new study called, ‘Dark Patterns after the GDPR’ from MIT, UCL and Aarhus University found that a vast majority of websites aren’t following GDPR rules around cookies. The study found most cookie consent pop-ups in the EU to be undermining the GDPR by finding sneaky ways to convince website visitors to click ‘accept’.

    Disclaimer

    We are not lawyers and don’t claim to be. The information provided here is to help give an introduction to issues you may encounter when dealing cookies. We encourage every business and website to take data privacy seriously and discuss these issues with your lawyer if you have any concerns. 

    Additional resources :

  • What is data anonymization in web analytics ?

    11 février 2020, par Joselyn Khor — Analytics Tips, Privacy

    Collecting information via web analytics platforms is needed to help a website grow and improve. When doing so, it’s best to strike a balance between getting valuable insights, and keeping the trust of your users by protecting their privacy.

    This means not collecting or processing any personally identifiable information (PII). But what if your organisation requires you to collect PII ?

    That’s where data anonymization comes in.

    What is data anonymization ?

    Data anonymization makes identifiable information unidentifiable. This is done through data processing techniques which remove or modify PII data. So data becomes anonymous and can’t be linked to any individual.

    In the context of web analytics, data anonymization is handy because you can collect useful data while protecting the privacy of website visitors.

    Why is data anonymization important ?

    Through modern threats of identity theft, credit card fraud and the like, data anonymization is a way to protect the identity and privacy of individuals. As well as protect private and sensitive information of organisations. 

    Data anonymization lets you follow the many laws around the world which protect user privacy. These laws provide safeguards around collecting personal data or personally identifiable information (PII), so data anonymization is a good solution to ensure you’re not processing such sensitive information.

    In some cases, implementing data anonymization techniques means you can avoid having to show your users a consent screen. Which means you may not need to ask for consent in order to track data. This is a bonus as consent screens can annoy and stop people from engaging with your site.

    GDPR and data anonymization

    Matomo Analytics GDPR Google Analytics

    The GDPR is a law in the EU that limits the collection and processing of personal data. The aim is to give people more control over their online personal information. Which is why website owners need to follow certain rules to become GDPR compliant and protect user privacy. According to the GDPR, you can be fined up to 4% of your yearly revenue for data breaches or non-compliance. 

    In the case of web analytics, tools can be easily made compliant by following a number of steps

    This is why anonymizing data is a big deal.

    Anonymized data isn’t personal data according to the GDPR : 

    “The principles of data protection should therefore not apply to anonymous information, namely information which does not relate to an identified or identifiable natural person or to personal data rendered anonymous in such a manner that the data subject is not or no longer identifiable.”

    This means, you still get the best of both worlds. By anonymizing data, you’re still able to collect useful information like visitor behavioural data.

    US privacy laws and data anonymization

    In the US, there isn’t one single law that governs the protection of personal data, called personally identifiable information (PII). There are hundreds of federal and state laws that protect the personal data of US residents. As well as, industry-specific statutes related to data privacy, like the California Consumer Privacy Act (CCPA) and the Health Insurance Portability and Accountability Act (HIPAA).

    Website owners in the US need to know exactly what laws govern their area of business in order to follow them.

    A general guideline is to protect user privacy regardless of whether you are or aren’t allowed to collect PII. This means anonymizing identifiable information so your website users aren’t put at risk.

    Data anonymization techniques in Matomo Analytics

    If you carry these out, you won’t need to ask your website visitors for tracking consent since anonymized data is no longer considered personal data under the GDPR.

    The techniques listed above make it easy for you when using a tool like Matomo, as they are automatically anonymized.

    Tools like Google Analytics on the other hand don’t provide some of the privacy options and leave it up to you to take on the burden of implementation without providing steps.

    Data anonymization tools

    If you’re a website owner who wants to grow your business or learn more about your website visitors, privacy-friendly tools like Matomo Analytics are a great option. By following the easy steps to be GDPR compliant, you can anonymize all data that could put your visitors at risk.