Recherche avancée

Médias (91)

Autres articles (99)

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

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, 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 (...)

Sur d’autres sites (15290)

  • On-premise analytics demand grows as Google Analytics GDPR uncertainties continue

    7 janvier 2020, par Jake Thornton — Privacy

    The Google Analytics GDPR relationship is a complicated one. Website owners in states like Berlin in Germany are now required to ask users for consent to collect their data. This doesn’t make for the friendliest user-experience and often the website visitor will simply click “no.”

    The problem Google Analytics now presents website owners in the EU is with more visitors clicking “no”, the less accurate your data will become.

    Why do you need to ask your visitors for consent ?

    At this stage it’s simply because Google Analytics collects data for its own purposes. An example of this is using your visitor’s personal data for retargeting purposes across their advertising platforms like Google Ads and YouTube. 

    Google’s Privacy & Terms states : “when you visit a website that uses advertising services like AdSense, including analytics tools like Google Analytics, or embeds video content from YouTube, your web browser automatically sends certain information to Google. This includes the URL of the page you’re visiting and your IP address. We may also set cookies on your browser or read cookies that are already there. Apps that use Google advertising services also share information with Google, such as the name of the app and a unique identifier for advertising.”

    The rise of hosting web analytics on-premise

    Managing Google Analytics and GDPR can quickly become complicated, so there’s been an increase in website owners switching from cloud-hosted web analytics platforms, like Google Analytics, to more GDPR compliant alternatives, where you can host web analytics software on your own servers. This is called hosting web analytics on-premise.

    Hosting web analytics on your own servers means :

    No third-parties are involved

    The visitor data your website collects is stored on your own internal infrastructure. This means no third-parties are involved and there’s no risk of personal data being used in the way Google Analytics uses it e.g. sending personal data to its advertising platforms. 

    When you sign up with Google Analytics you sign away control of your user’s personal data. With on-premise website analytics, you own your data and are in full control.

    NOTE : Though Google Analytics uses personal data for its own purposes, not all cloud hosted web analytics platforms do this. As an example, Matomo Analytics Cloud hosted solution states that all personal data collected is not used for its own purposes and that Matomo has no rights in accessing or using this personal data. 

    You control where in the world your personal data is stored

    Google Analytics servers are based out of USA, Europe and Asia, so where your personal data will end up is uncertain and you don’t have the option to choose which location it goes to when using free Google Analytics.

    Different countries have different laws when it comes to accessing personal data. When you choose to host your web analytics on-premise, you can choose the location of your servers and where the personal data is stored.

    More flexibility

    With self-hosted web analytics platforms like Matomo On-Premise, you can extend the platform to do anything you want without the restrictions that cloud hosted platforms impose.

    You can :

    • Get full access to the source code of open-source solutions, like Matomo
    • Extend the platform however you want for your business
    • Get access to APIs
    • Have no data limitations or restrictions
    • Get RAW data access
    • Have control over security

    >> Read more about on-premise flexibility for web analytics here

    So what does the future look like for Google Analytics and GDPR ?

    It’s difficult to assess this right now. How exactly GDPR is enforced is still quite unclear. 

    What is clear however, is now website owners in Berlin using Google Analytics are lawfully required to ask their visitors for consent to collect personal data. It has been reported that Google Analytics has already received 200,000 complaints in Germany alone and it appears this trend is likely to continue across much of the EU.

    When using Google Analytics in the EU you must also ensure your privacy policy is updated so website visitors are aware that data is being collected through Google Analytics for its own purposes.

    Moving to a web analytics on-premise platform

    Matomo Analytics is the #1 open-source web analytics platform in the world and has been rated as an exceptional alternative to Google Analytics. Check the reviews on Capterra.

    Choosing Matomo On-Premise means you can control exactly where your data is stored, you have full flexibility to customise the platform to do what you want and it’s FREE.

    Matomo’s mission is to give control back to website owners and the team has designed the platform so that moving away from Google Analytics is seamless. Matomo offers most of your favourite Google Analytics features, a leaner interface to navigate, and the option to add free and paid premium features that Google Analytics can’t even offer you.

    And now you can import your historical Google Analytics data directly into your Matomo with the Google Analytics Importer plugin.

    And if you can’t host web analytics on your own servers ...

    Hosting web analytics on-premise is not an option for all businesses as you do need the internal infrastructure and technical knowledge to host your own platform.

    If you can’t self-host, then Matomo has a Cloud hosted solution you can easily install and operate like Google Analytics, which is hosted on Matomo’s servers in the EU. 

    The GDPR advantages of choosing Matomo Cloud over Google Analytics are :

    • Servers are secure and based in the EU (strict laws forbid outside access)
    • 100% data ownership – we never use data for our own purposes
    • You can export your data anytime and switch to Matomo On-Premise whenever you like
    • User-privacy protection
    • Advanced GDPR Manager and data anonymisation features which GA doesn’t offer

    Interested to learn more ?

    If you are wanting to learn more about why users are making the move from Google Analytics to Matomo, check out our Matomo Analytics vs Google Analytics comparison page.

    >> Matomo Analytics vs Google Analytics

  • How to save h264 frames as jpeg images using ffmpeg ?

    17 août 2020, par Matthew Czarnek

    I would like to save thumbnails from a h264 stream that I'm turning into ffmpeg avpackets as jpegs.

    


    I'm started with a h264 AVPacket (iframe) and decode it into an AVFrame using avcodec_send_packet/avcodec_receive_frame. Now trying to go from AVFrame and convert into AVPacket using avcodec_send_frame/avcodec_receive_packet

    


    I can convert to png instead jpg, though I do get a the video looking like it's outputting three separate frames squeezed side by side into one. Wondering if it's one frame is R, next G, and finally B. I'm not sure, clearly I'm doing something wrong there. I figured it's possible it's the png encoder and I don't need it, so let's get jpg working first. But jpg is outputting unopenable files.

    


    Any advice ?

    


    Here is my code :

    


    int output_thumbnails(AVPacket* video_packet)
{
    char png_file_name[max_chars_per_filename];
    char thumbnail_id_char[10];
    _itoa_s(thumbnail_id, thumbnail_id_char, 10);
    strcpy_s(png_file_name, max_chars_per_filename, time_stamped_filepath);
    strcat_s(png_file_name, max_chars_per_filename, time_stamped_filename);
    strcat_s(png_file_name, max_chars_per_filename, thumbnail_id_char);
    strcat_s(png_file_name, max_chars_per_filename, ".jpg");
    thumbnail_id++;

    int error_code = send_AVPacket_to_videocard(video_packet, av_codec_context_RTSP);

    //if (error_code == AVERROR_EOF)
    //{
    //  //  error_code = videocard_to_PNG(png_file_name, av_codec_context_RTSP, av_codec_RTSP);
    //}
    if (error_code == AVERROR(EAGAIN)) //send packets to videocard until function returns EAGAIN
    {
        error_code = videocard_to_PNG(png_file_name, av_codec_context_RTSP);

        //EAGAIN means that the video card buffer is ready to have the png pulled off of it
        if (error_code == AVERROR_EOF)
        {
            //  error_code = videocard_to_PNG(png_file_name, av_codec_context_RTSP, av_codec_RTSP);
        }
        else if (error_code == AVERROR(EAGAIN))
        {

        }
        else
        {
            deal_with_av_errors(error_code, __LINE__, __FILE__);
        }
    }
    else
    {
        deal_with_av_errors(error_code, __LINE__, __FILE__);
    }
    
    return 0;
}


    


    VideoThumbnailGenerator.h :
#include "VideoThumbnailGenerator.h"

    


    bool decoder_context_created = false;
bool encoder_context_created = false;

AVCodecContext* h264_decoder_codec_ctx;
AVCodecContext* thumbnail_encoder_codec_ctx;

int send_AVPacket_to_videocard(AVPacket* packet, AVCodecContext* codec_ctx)
{
    if(!decoder_context_created)
    {
        AVCodec* h264_codec = avcodec_find_decoder(codec_ctx->codec_id);
        h264_decoder_codec_ctx = avcodec_alloc_context3(h264_codec);

        h264_decoder_codec_ctx->width = codec_ctx->width;
        h264_decoder_codec_ctx->height = codec_ctx->height;
        h264_decoder_codec_ctx->pix_fmt = AV_PIX_FMT_RGB24;
        h264_decoder_codec_ctx->codec_type = AVMEDIA_TYPE_VIDEO;
        h264_decoder_codec_ctx->skip_frame = AVDISCARD_NONINTRA;//AVDISCARD_NONREF;//AVDISCARD_NONINTRA;
        
        h264_decoder_codec_ctx->time_base.num = 1;
        h264_decoder_codec_ctx->time_base.den = 30;

        h264_decoder_codec_ctx->extradata = codec_ctx->extradata;
        h264_decoder_codec_ctx->extradata_size = codec_ctx->extradata_size;
        
        int error_code = avcodec_open2(h264_decoder_codec_ctx, h264_codec, NULL);
        if (!h264_codec) {
            return -1;
        }

        if (error_code < 0)
        {
            return error_code;
        }
        decoder_context_created = true;
    }

    
    //use hardware decoding to decode video frame
    int error_code = avcodec_send_packet(h264_decoder_codec_ctx, packet);
    if(error_code == AVERROR(EAGAIN))
    {
        return AVERROR(EAGAIN);
    }
    if(error_code<0)
    {
        printf("Error: Could not send packet to video card");
        return error_code;
    }

    return 0;
}

int videocard_to_PNG(char *png_file_path, AVCodecContext* codec_ctx)
{
    if (!encoder_context_created)
    {
        //AVCodec* thumbnail_codec = avcodec_find_encoder(AV_CODEC_ID_PNG);
        AVCodec* thumbnail_codec = avcodec_find_encoder(AV_CODEC_ID_JPEG2000);
        thumbnail_encoder_codec_ctx = avcodec_alloc_context3(thumbnail_codec);

        thumbnail_encoder_codec_ctx->width = 128;
        thumbnail_encoder_codec_ctx->height = (int)(((float)codec_ctx->height/(float)codec_ctx->width) * 128);
        thumbnail_encoder_codec_ctx->pix_fmt = AV_PIX_FMT_RGB24; //AV_PIX_FMT_YUVJ420P
        thumbnail_encoder_codec_ctx->codec_type = AVMEDIA_TYPE_VIDEO;

        thumbnail_encoder_codec_ctx->time_base.num = 1;
        thumbnail_encoder_codec_ctx->time_base.den = 30;

        bool thread_check = thumbnail_encoder_codec_ctx->thread_type & FF_THREAD_FRAME;
        bool frame_threads_check = thumbnail_encoder_codec_ctx->codec->capabilities & AV_CODEC_CAP_FRAME_THREADS;
        
        int error_code = avcodec_open2(thumbnail_encoder_codec_ctx, thumbnail_codec, NULL);
        if (!thumbnail_codec) {
            return -1;
        }

        if (error_code < 0)
        {
            return error_code;
        }
        encoder_context_created = true;
    }
    
    AVFrame* thumbnail_frame = av_frame_alloc();
    AVPacket* thumbnail_packet = av_packet_alloc();
    //av_init_packet(png_packet);
    int error_code = avcodec_receive_frame(h264_decoder_codec_ctx, thumbnail_frame);

    //check for errors everytime
    //note EAGAIN errors won't get here since they won't get past while
    if (error_code < 0 && error_code != AVERROR(EAGAIN))
    {
        printf("Error: Could not get frame from video card");
        return error_code;
    }
    //empty buffer if there are any more frames to pull (there shouldn't be)
    //while(error_code != AVERROR(EAGAIN))
    //{
    //  //check for errors everytime
    //  //note EAGAIN errors won't get here since they won't get past while
    //  if (error_code < 0)
    //  {
    //      printf("Error: Could not get frame from video card");
    //      return error_code;
    //  }
    //  
    //  error_code = avcodec_receive_frame(h264_decoder_codec_ctx, png_frame);
    //}

    //now we convert back to AVPacket, this time one holding PNG info, so we can store to file
    error_code = avcodec_send_frame(thumbnail_encoder_codec_ctx, thumbnail_frame);

    if (error_code >= 0) {
        error_code = avcodec_receive_packet(thumbnail_encoder_codec_ctx, thumbnail_packet);

        FILE* out_PNG;

        errno_t err = fopen_s(&out_PNG, png_file_path, "wb");
        if (err == 0) {
            fwrite(thumbnail_packet->data, thumbnail_packet->size, 1, out_PNG);
        }
        fclose(out_PNG);

    }
    return error_code;
}


    


  • Thumbnail is not created in php

    21 novembre 2014, par Desipicforu Blogspot

    I am writing this code to create thumbnail of uploaded video. Video is successfully created but thumbnail is not crated to directory.

    There is no error in apache error log file. And when i run this command in terminal thumbnail is successfully created to my directory, But it’s not working by php.

    Here is my code :-

               <?php
               if(isset($_REQUEST['AddFiles'])){
               $targetFolder = 'uploads'; //Path to the Uploads Folder
                   if (!empty($_FILES)) {
                       for($i=0;$i' .  uniqid().".".$info->getExtension();
                           $fileParts = pathinfo($_FILES['upload_file']['name'][$i]);
                           if(isset($fileParts['extension'])){
                               //if (in_array($fileParts['extension'],$fileTypes))
                               {
                                   move_uploaded_file($tempFile,$targetFile);
                                   echo '<div class="success">'.$_FILES['upload_file']['name'][$i].' was saved successfully inside '.  $_SERVER['HTTP_HOST']."/". dirname($_SERVER["REQUEST_URI"])."/".$targetFile.' Directory</div>';
                                   $videoUrl=$_SERVER['HTTP_HOST']."/". dirname($_SERVER["REQUEST_URI"])."/".$targetFile;
                                   $servername = "localhost";
                                   $username = "root";
                                   $password = "root";
                                   $dbname = "a7630155_google";

               // Create connection
               $conn = new mysqli($servername, $username, $password, $dbname);
               // Check connection
               if ($conn->connect_error) {
                   die("Connection failed: " . $conn->connect_error);
               }

               $sql = "INSERT INTO video (title, artist, duration,thumb_url,video)
               VALUES ('".$_REQUEST['videoName']."', '".$_REQUEST['category']."','', 'john@example.com','".$videoUrl."')";

               if ($conn->query($sql) === TRUE) {

                                   // where ffmpeg is located  
                               $ffmpeg = '/usr/bin/ffmpeg';  
                               //video dir  
                               $video = "http://".$videoUrl;  
                               //where to save the image  
                               $image = rtrim($targetFolder,'/');  
                               //time to take screenshot at  
                               $interval = 5;  
                               //screenshot size  
                               $size = '640x480';  
                               //ffmpeg command  
                               $cmd = "$ffmpeg -i $video -deinterlace -an -ss $interval -f mjpeg -t 1 -r 1 -y -s $size $image 2>&amp;1";

                               shell_exec($cmd);
                   echo $cmd;
               exit;
                   echo "New record created successfully";
               } else {
                   echo "Error: " . $sql . "<br />" . $conn->error;
               }

               $conn->close();


                               }
                               /*else{
                                   echo '<div class="fail">'.$_FILES['upload_file']['name'][$i].' couldn\'t be saved because of invalid file type.</div>';
                               }*/
                           }else{
                               echo '<div class="fail">'.$_FILES['upload_file']['name'][$i].' couldn\'t be saved because of invalid file type.</div>';
                           }
                       }
                   }
               }

               ?>
               
                   
                   <code class="echappe-js">&lt;script src=&quot;//code.jquery.com/jquery-1.10.2.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
    &lt;script&gt;<br />
                       var selDiv = &quot;&quot;;<br />
                   document.addEventListener(&quot;DOMContentLoaded&quot;, init, false);<br />
    <br />
                   function init() {<br />
                       document.querySelector('#upload_file').addEventListener('change', handleFileSelect, false);<br />
                       selDiv = document.querySelector(&quot;#selectedFiles&quot;);<br />
                   }<br />
    <br />
                   function handleFileSelect(e) {<br />
                       if(!e.target.files) return;<br />
                       var files = e.target.files;<br />
                       for(var i=0; i&lt;files.length; i++) {<br />
                           var f = files[i];<br />
                           selDiv.innerHTML += &quot;&lt;div class='file_list'&gt;&quot;+f.name + &quot;&lt;/div&gt;&quot;;<br />
                       }<br />
                               $('#uploadimages').show();<br />
                   }<br />
    <br />
                   $(document).ready(function(){<br />
                       $(&quot;#uploadTrigger&quot;).click(function(){<br />
                       $(&quot;#upload_file&quot;).click();<br />
                           }); <br />
                   });<br />
    <br />
                   &lt;/script&gt;


    Video Title
    Video Category
    Upload Video
    Select Video