Recherche avancée

Médias (2)

Mot : - Tags -/documentation

Autres articles (32)

  • 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

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

    5 septembre 2013, par

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

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

Sur d’autres sites (6920)

  • (C_UDP Socket Programming) How can I convert binary file to video format ?

    30 avril 2024, par user24723398

    I am practicing UDP socket programming. My code's functions are below.

    


      

    1. Connect Server-Client and send "hello" message each other (it is working).
    2. 


    3. Then Server is sending video file to client (problem).
    4. 


    


    Transfer video file to client is working. But it is written in binary so I can't open the video.

    


    So I try to use ffmpeg to convert the video, but it doesn't work.

    


    Is there something wrong in my code ? How can I transfer a received file to a video file ?

    


    My environment is MacOs.

    


    Server.c (Server Code) :

    


    #include &#xA;#include &#xA;#include &#xA;#include <arpa></arpa>inet.h>&#xA;#include &#xA;#include <sys></sys>socket.h>&#xA;&#xA;#define PORT 8888&#xA;#define BUF_SIZE 256&#xA;&#xA;int main(){&#xA;    int serv_sock;&#xA;    char message[BUF_SIZE];&#xA;    char buf[BUF_SIZE];&#xA;    int str_len;&#xA;    socklen_t clnt_adr_sz;&#xA;&#xA;    struct sockaddr_in serv_adr, clnt_adr;&#xA;    &#xA;    //create socket&#xA;    serv_sock=socket(PF_INET, SOCK_DGRAM, 0);&#xA;    if(serv_sock == -1){&#xA;        perror("socket() error");&#xA;        exit(1);&#xA;    }&#xA;    &#xA;    //socket address&#xA;    memset(&amp;serv_adr, 0, sizeof(serv_adr));&#xA;    serv_adr.sin_family=AF_INET;&#xA;    serv_adr.sin_addr.s_addr=htonl(INADDR_ANY);&#xA;    serv_adr.sin_port=htons(PORT);&#xA;    //binding socket&#xA;    if(bind(serv_sock, (struct sockaddr*)&amp;serv_adr, sizeof(serv_adr)) == -1){&#xA;        perror("bind() error");&#xA;        exit(1);&#xA;    }&#xA;    &#xA;    while(1){&#xA;        clnt_adr_sz=sizeof(clnt_adr);&#xA;        str_len=recvfrom(serv_sock, message, BUF_SIZE, 0, (struct sockaddr *)&amp;clnt_adr, &amp;clnt_adr_sz);&#xA;         if (str_len &lt; 0) {&#xA;            perror("recvfrom error");&#xA;            exit(1);&#xA;        }&#xA;    &#xA;        char hello_message[] = "hello i am server";&#xA;        if (sendto(serv_sock, hello_message, strlen(hello_message), 0, (struct sockaddr *)&amp;clnt_adr, clnt_adr_sz) &lt; 0) {&#xA;            perror("sendto error");&#xA;            exit(1);&#xA;        }&#xA;        &#xA;        //print message&#xA;        message[str_len] = &#x27;\0&#x27;;&#xA;        printf("client say: %s\n", message);&#xA;        &#xA;        char buf[BUF_SIZE];&#xA;        ssize_t bytes_read;&#xA;        // sending viedo file&#xA;        printf("sending video file...\n");&#xA;        size_t fsize;&#xA;    &#xA;        //video file&#xA;        FILE *file;&#xA;        char *filename = "video.mp4";&#xA;        // open video file&#xA;        file = fopen(filename, "rb");&#xA;        if (file == NULL) {&#xA;            perror("File opening failed");&#xA;            exit(EXIT_FAILURE);&#xA;        }&#xA;        //calculate video file memory&#xA;        fseek(file, 0, SEEK_END);&#xA;        fsize = ftell(file);&#xA;        fseek(file,0,SEEK_SET);&#xA;    &#xA;        size_t size = htonl(fsize);&#xA;        int nsize =0;&#xA;        &#xA;        while(nsize!=fsize){&#xA;            int fpsize = fread(buf,1, BUF_SIZE, file);&#xA;            nsize &#x2B;= fpsize;&#xA;            if (sendto(serv_sock, &amp;size, sizeof(size), 0, (struct sockaddr *)&amp;clnt_adr, clnt_adr_sz) &lt; 0) {&#xA;                perror("sendto");&#xA;                exit(EXIT_FAILURE);    &#xA;            }&#xA;            fclose(file);&#xA;            /*&#xA;            while ((bytes_read = fread(buf, 1, BUF_SIZE, file)) > 0) {&#xA;                if (sendto(serv_sock, buf, bytes_read, 0,&#xA;                       (struct sockaddr *)&amp;clnt_adr, clnt_adr_sz) &lt; 0) {&#xA;                    perror("sendto");&#xA;                    exit(EXIT_FAILURE);&#xA;                }       &#xA;            }&#xA;            */&#xA;        }        &#xA;    }&#xA;    close(serv_sock);&#xA;    return 0;&#xA;}&#xA;

    &#xA;

    Client.c (Client code)

    &#xA;

    #include &#xA;#include &#xA;#include &#xA;#include <arpa></arpa>inet.h>&#xA;#include &#xA;#include <sys></sys>socket.h>&#xA;&#xA;#define BUFSIZE 256&#xA;#define PORT 8888&#xA;&#xA;int main(){&#xA;    int sock;&#xA;    char message[BUFSIZE];&#xA;    int str_len;&#xA;    socklen_t adr_sz;&#xA;&#xA;    struct sockaddr_in serv_addr, client_addr;   &#xA;    &#xA;    sock = socket(PF_INET, SOCK_DGRAM, 0);&#xA;    if(sock == -1){&#xA;        printf("socket() error\n");&#xA;        exit(1);&#xA;    }&#xA;&#xA;    memset(&amp;serv_addr, 0, sizeof(serv_addr));&#xA;    serv_addr.sin_family = AF_INET;&#xA;    serv_addr.sin_addr.s_addr = inet_addr("127.0.0.1");&#xA;    serv_addr.sin_port = htons(PORT);&#xA;&#xA;    char hello_message[] = "hello i am client";&#xA;    sendto(sock, hello_message, strlen(hello_message), 0, (struct sockaddr*)&amp;serv_addr, sizeof(serv_addr));&#xA;    adr_sz = sizeof(client_addr);&#xA;    str_len=recvfrom(sock,message,BUFSIZE,0,(struct sockaddr*)&amp;client_addr,&amp;adr_sz);&#xA;   &#xA;    message[str_len] = &#x27;\0&#x27;;&#xA;    printf("client say: %s\n", message);&#xA;    &#xA;    /*&#xA;    char buf[BUFSIZE];&#xA;    ssize_t bytes_received;&#xA;    socklen_t serv_len = sizeof(serv_addr);&#xA;    while ((bytes_received = recvfrom(sock, buf, BUFSIZE, 0,&#xA;                                      (struct sockaddr *)&amp;serv_addr, &amp;serv_len)) > 0) {&#xA;        fwrite(buf, 1, bytes_received, file);&#xA;    }&#xA;    */&#xA;     &#xA;    FILE *file = fopen("received_test.mp4", "wb");&#xA;&#xA;    int nbyte = BUFSIZE;&#xA;    while(nbyte>= BUFSIZE){&#xA;        nbyte = recvfrom(sock, message, BUFSIZE, 0, (struct sockaddr*)&amp;serv_addr, &amp;adr_sz);&#xA;        fwrite(message, sizeof(char), nbyte, file);&#xA;    }&#xA;&#xA;    if (file == NULL) {&#xA;        perror("File opening failed");&#xA;        exit(EXIT_FAILURE);&#xA;    }&#xA;&#xA;    fclose(file);&#xA;    close(sock);&#xA;    printf("File received successfully\n");&#xA;    &#xA;    return 0;&#xA;}&#xA;

    &#xA;

    I try to convert the binary file to an .mp4 file using ffmpeg&#xA;but it doesn't work :

    &#xA;

    ffmpeg -i received_test.mp4 output.mp4&#xA;ffmpeg version 7.0 Copyright (c) 2000-2024 the FFmpeg developers&#xA;  built with Apple clang version 15.0.0 (clang-1500.3.9.4)&#xA;  configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/7.0 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags=&#x27;-Wl,-ld_classic&#x27; --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libharfbuzz --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopenvino --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox --enable-neon&#xA;  libavutil      59.  8.100 / 59.  8.100&#xA;  libavcodec     61.  3.100 / 61.  3.100&#xA;  libavformat    61.  1.100 / 61.  1.100&#xA;  libavdevice    61.  1.100 / 61.  1.100&#xA;  libavfilter    10.  1.100 / 10.  1.100&#xA;  libswscale      8.  1.100 /  8.  1.100&#xA;  libswresample   5.  1.100 /  5.  1.100&#xA;  libpostproc    58.  1.100 / 58.  1.100&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 0x12a62bdb0] Format mov,mp4,m4a,3gp,3g2,mj2 detected only with low score of 1, misdetection possible!&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 0x12a62bdb0] moov atom not found&#xA;[in#0 @ 0x12b0043c0] Error opening input: Invalid data found when processing input&#xA;Error opening input file received_test.mp4.&#xA;Error opening input files: Invalid data found when processing input&#xA;

    &#xA;

  • lavu/opt : Clarify the scope of AVOptions

    24 avril 2024, par Andrew Sayers
    lavu/opt : Clarify the scope of AVOptions
    

    See discussion on the mailing list :
    https://ffmpeg.org/pipermail/ffmpeg-devel/2024-April/326054.html

    Signed-off-by : Michael Niedermayer <michael@niedermayer.cc>

    • [DH] libavutil/opt.h
  • Consent Mode v2 : Everything You Need to Know

    7 mai 2024, par Alex — Analytics Tips

    Confused about Consent Mode v2 and its impact on your website analytics ? You’re not the only one. 

    Google’s latest update has left many scratching their heads about data privacy and tracking. 

    In this blog, we’re getting straight to the point. We’ll break down what Consent Mode v2 is, how it works, and the impact it has.

    What is Consent Mode ?

    What exaclty is Google Consent Mode and why is there so much buzz surrounding it ? This question has been frustrating analysts and marketers worldwide since the beginning of this year. 

    Consent Mode is the solution from Google designed to manage data collection on websites in accordance with user privacy requirements.

    This mode enables website owners to customise how Google tags respond to users’ consent status for cookie usage. At its core, Consent Mode adheres to privacy regulations such as GDPR in Europe and CCPA in California, without significant loss of analytical data.

    Diagram displaying how consent mode works

    How does Consent Mode work ?

    Consent Mode operates by adjusting the behaviour of tags on a website depending on whether consent for cookie usage is provided or not. If a user does not consent to the use of analytical or advertising cookies, Google tags automatically switch to collecting a limited amount of data, ensuring privacy compliance.

    This approach allows for continued valuable insights into website traffic and user behavior, even if users opt out of most tracking cookies.

    What types of consent are available in Consent Mode ?

    As of 6 March 2024, Consent Mode v2 has become the current standard (and in terms of utilising Google Advertising Services, practically mandatory), indicating the incorporation of four consent types :

    1. ad_storage : allows for the collection and storage of data necessary for delivering personalised ads based on user actions.
    2. ad_user_data : pertains to the collection and usage of data that can be associated with the user for ad customisation and optimisation.
    3. ad_personalization : permits the use of user data for ad personalisation and providing more relevant content.
    4. analytics_storage : relates to the collection and storage of data for analytics, enabling websites to analyse user behaviour and enhance user experience.

    Additionally, in Consent Mode v2, there are two modes :

    1. Basic Consent Mode : in which Google tags are not used for personalised advertising and measurements if consent is not obtained.
    2. Advanced Consent Mode : allows Google tags to utilise anonymised data for personalised advertising campaigns and measurements, even if consent is not obtained.

    What is Consent Mode v2 ? (And how does it differ from Consent Mode v1 ?)

    Consent Mode v2 is an improved version of the original Consent Mode, offering enhanced customisation capabilities and better compliance with privacy requirements. 

    The new version introduces additional consent configuration parameters, allowing for even more precise control over which data is collected and how it’s used. The key difference between Consent Mode v2 and Consent Mode v1 lies in more granular consent management, making this tool even more flexible and powerful in safeguarding personal data.

    In Consent Mode v2, the existing markers (ad_storage and analytics_storage) are accompanied by two new markers :

    1. ad_user_data – does the user agree to their personal data being utilized for advertising purposes ?
    2. ad_personalization – does the user agree to their data being employed for remarketing ?

    In contrast to ad_storage and analytics_storage, these markers don’t directly affect how the tags operate on the site itself. 

    They serve as additional directives sent alongside the pings to Google services, indicating how user data can be utilised for advertising purposes.

    While ad_storage and analytics_storage serve as upstream qualifiers for data (determining which identifiers are sent with the pings), ad_user_data and ad_personalization serve as downstream instructions for Google services regarding data processing.

    How is the implementation of Consent Mode v2 going ?

    The implementation of Consent Mode v2 is encountering some issues and bugs (as expected). The most important thing to understand :

    1. Advanced Consent Mode v2 is essential if you have traffic and campaigns with Google Ads in the European Union.
    2. If you don’t have substantially large traffic, enabling Advanced Consent Mode v2 will likely result in a traffic drop in GA4 – because this version of consent mode (unlike the basic one) applies behavioural modelling to users who haven’t accepted the use of cookies. And modelling the behaviour requires time.

    The aspect of behavioural modelling in Consent Mode v2 implies the following : the data of users who have declined tracking options begin to be modelled using machine learning. 

    However, training the model requires a suitable data volume. As the Google’s documentation states :

    The property should collect at least 1,000 events per day with analytics_storage=’denied’ for at least 7 days. The property should have at least 1,000 daily users submitting events with analytics_storage=’granted’ for at least 7 of the previous 28 days.

    Largely due to this, the market’s response to the Consent Mode v2 implementation was mixed : many reported a significant drop in traffic in their GA4 and Google Ads reports upon enabling the Advanced mode. Essentially, a portion of the data was lost because Google’s models lacked enough data for training. 

    And from the very beginning of implementation, users regularly report about a few examples of that scenario. If your website doesn’t have enough traffic for behaviour modelling, after Consent Mode v2 switching you will face significant drop in your traffic in Google Ads and GA4 reports. There are a lot of cases of observing 90-95% drop in metrics of users and sessions.

    In a nutshell, you should be prepared for significant data losses if you are planning to switch to Google Consent Mode v2.

    How does Consent Mode v2 impact web analytics ? 

    The transition to Consent Mode v2 alters the methods of user data collection and processing. The main concerns arise from the potential loss of accuracy and completeness of analytical data due to restrictions on the use of cookies and other identifiers when user consent is absent. 

    With Google Consent Mode v2, the data of visitors who have not agreed to tracking will be modelled and may not accurately reflect your actual visitors’ behaviours and actions. So as an analyst or marketer, you will not have true insights into these visitors and the data acquired will be more generalised and less accurate.

    Google Consent Mode v2 appears to be a kind of compromise band-aid solution. 

    It tries to solve these issues by using data modelling and anonymised data collection. However, it’s critical to note that there are specific limitations inherent to the modelling mechanism.

    This complicates the analysis of visitor behavior, advertising campaigns, and website optimisation, ultimately impacting decision-making and resulting in poor website performance and marketing outcomes.

    Wrap up

    Consent Mode v2 is a mechanism of managing Google tag operations based on user consent settings. 

    It’s mandatory if you’re using Google’s advertising services, and optional (at least for Advanced mode) if you don’t advertise on Google Ads. 

    There are particular indications that this technology is unreliable from a GDPR perspective. 

    Using Google Consent Mode will inevitably lead to data losses and inaccuracies in its analysis. 

    In other words, it in some sense jeopardises your business.