Recherche avancée

Médias (1)

Mot : - Tags -/musée

Autres articles (56)

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

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

  • Menus personnalisés

    14 novembre 2010, par

    MediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
    Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
    Menus créés à l’initialisation du site
    Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...)

Sur d’autres sites (5066)

  • Exceeded GA’s 10M hits data limit, now what ?

    1er décembre 2021, par Joselyn Khor

    Exceeded Google Analytics’ 10M hits data limit, now what ?

    “Your data volume (1XXM hits) exceeds the limit of 10M hits per month as outlined in our Terms of Service. If you continue to exceed the limit, we will stop processing new data on XXX 21, 2019. Learn more about possible solutions.”

    Yikes. Alarm bells were ringing when a Google Analytics free user came to us faced with this notice. Let’s call him ‘Mark’. Mark had reached the limits on the data he could collect through Google Analytics and was shocked by the limited options available to fix the problem, without blowing the budget. The thoughts racing through his head were :

    • “What happens to all my data ?”
    • “What if Google starts charging USD150K now ?”

    Then he came across Matomo and decided to get in touch with our support team …

    “Can you fix this issue ?” he asked us.

    “Absolutely !” we said.

    We’ll get back to helping Mark in a minute. For now let’s go over why this was such a dilemma for him.

    In order to resolve this data limits issue, one of the solutions was for him to upgrade to Google Analytics 360, which meant shelling out USD150,000 per year for their 1 billion hits per month option. Going from free to USD150,000 was too much of a stretch for a growing company.

    “Your data volume (1XXM hits) exceeds the limit of 10M hits per month …”, what did this message mean ?

    With the free version, Mark could collect up to 10 million “hits” per month, per account. Going over meant Google Analytics could stop collecting any more data for free as outlined in their Terms.

    Google Analytics’ Terms of Service (2018, sec. 2) states, “Subject to Section 15, the Service is provided without charge to You for up to 10 million Hits per month per account.”[1]

    What is a "hit" in Google Analytics ?

    Data being sent to Google Analytics. It can be a transaction, event, social interaction or pageview - these all produce what Google calls a “hit”.

    Google Analytics data limits
    Google Analytics Terms of Service

    And their Analytics Help Data Limits (n.d.) support page makes clear that : “If a property sends more hits per month to Analytics than allowed by the Analytics Terms of Service, there is no assurance that the excess hits will be processed. If the property’s hit volume exceeds this limit, a warning may be displayed in the user interface and you may be prevented from accessing reports.”[2]

    Google Analytics data collection limit
    Google Analytics’ data limits support page

    Possible solutions

    So the possible solutions given by Google Analytics’ Data Limits support page were (also shown in image below) :

    • To pay USD150K to upgrade to Google Analytics 360
    • To send fewer hits by setting up sampling
    • Or choose the slightly less relevant option to upgrade mobile app tracking to Google Analytics for Firebase.

    Without the means to pay, the free version was fast becoming inaccessible for Mark as he was facing a future where he risked no longer having access to up-to-date data used in his business’ reporting.

    Mark was facing a problem that potentially didn’t have a cost-effective solution.

    Google Analytics data limits
    Google Analytics’ data limits support page

    So what can you really do about it ?

    This is where we can help provide some assistance. If you’re reading this article, we’ll assume you can relate to Mark and share with you the advice on options we gave him.

    Options :

    One option posed by Google is for you to send fewer hits by auditing your data collection processes

    If you really don’t have the budget, you’ll need to reassess your data collection priorities and go over your strategies to see what is necessary to track, and what isn’t.

    • Make sure you know what you’re tracking and why. Look at what websites are being tracked by Google and into what properties.
    • Go through what data you’re tracking and decide what is or isn’t of value.
    • Set up data sampling, this however, will lead to inaccurate data.

    From here you can start to course correct. If you’ve found data you’re not using for analysis, get rid of these events/pageviews in your Google Analytics.

    But the limitations here are that eventually, you’re going to run out of irrelevant metrics and everything you’re tracking will be essential. So you’ll hit another brick wall and return to the same situation.

    Option 2 Ignore and continue using the free version of Google Analytics

    With this option, you’ll have to bear the business risks involved by basing decisions off of analytics reports that may or may not be updated. In this case, you may still get contacted about exceeding the limits. As the free service is provided for only up to 10 million hits, once you’ve gone over them, you’re violating what’s stipulated in the Terms of Service. 

    There’s also the warning that “… you may be prevented from accessing reports” (Data limits, n.d.). So while we may not know for certain what Google Analytics will do, in this case it may be better to be safe rather than sorry by acting quickly to resolve it. 

    Option 3 -The Matomo solution – a privacy-friendly Google Analytics alternative

    Upgrade to a web analytics platform that can handle your demanding data requirements. Save money while continuing to gain valuable insights by moving over to Matomo Analytics (recommended)

    This is where you can save up to USD130,000 a year. As well as that, the transition from Google Analytics to the Matomo Cloud is a seamless experience as setup and maintenance is taken care of by our experts.

    For example, you can get up to 25M hits for USD3,241/month (or USD38,900/year) on the Essentials plan.

    Or even 25M hits for USD4,991/month (or USD59,900/year) on the Business plan – which offers additional web analytics and conversion optimization resources.

    Matomo Cloud is a great option if you’re looking for a secure, cost-effective and powerful analytics solution. You also get what Google Analytics could never offer you : full control and ownership of your own data and privacy. 

    Try Matomo free for 21 days – no credit card required.

    No need to worry about losing your Google Analytics data because …

    Now you can import your historic Google Analytics data directly into your Matomo with the Google Analytics Importer tool. Simply follow the step-by-step guide to get started for free.

    Along with savings you can get :

    • A solution for the data limits issue forever. You choose the right plan to suit your data needs and adapt as you continue growing
    • 100% accurate data (no data sampling)
    • 100% data ownership of all your information without signing away your data to a third party
    • Powerful web analytics and conversion optimization features
    • Matomo Tag Manager
    • Easy setup
    • Support from Matomo’s specialists

    Learn more about Matomo Cloud pricing.

    Or go for Matomo On-Premise

    If you have the in-house infrastructure to support self-hosting Matomo on your own servers then there’s also the option of Matomo On-Premise. Here you’ll get full security knowing the data is on your own servers. 

    Setup will also require technical knowledge. There will also be costs associated with acquiring your own servers, and keeping up with regular maintenance and updates. With On-Premise you get maximum flexibility, with no data limits whatsoever. But if you’re coming over from Google Analytics and don’t have the infrastructure and team to host On-Premise, the Matomo Cloud could be right for you.

    Learn more about Matomo On-Premise.

    Where do you go from here ?

    Getting 10 millions hits per month is no small feat, it’s actually pretty fantastic. But if it means having to shell out USD150,000 just to be able to continue with Google Analytics, we feel your problem could be fixed with Matomo Cloud. You could then put the rest of the money you save to better use.

    If you choose Matomo, you now have the option to : 

    • Raise your data limits for a fraction of Google Analytics 360’s price
    • Get a comprehensive range of analytics features for the most impactful insights to ensure your website continues excelling
    • Get data that’s not sampled – meaning 100% accuracy in your reports
    • Migrate your data easily with the help of Matomo’s support team

    We’ll have you covered. 

    By sharing with you the options and advice we gave to Mark, we hope you’ll be able to find a solution that makes your life easier and solves the issue of data restrictions forever.

    The team at Matomo is here to help you every step of the way to ensure a stress-free transition from Google Analytics if that is what works best for you.

    For next steps, check out our live online Matomo demo and start your free 21-day trial.

    References :

    [1] Terms of Service. (2018, July 24). In Google Analytics Terms of Service. Retrieved June 12, 2019, from https://www.google.com/analytics/terms/us.html

    [2] Data limits. (n.d.). In Analytics Help Data limits. Retrieved June 12, 2019, from https://support.google.com/analytics/answer/1070983?hl=en

  • FFMPEG Api conversion from YUV420P to RGB produces strange output

    20 novembre 2024, par fasc8

    I'm using the FFMPEG Api in Rust to get RGB images from video files.

    


    While some videos work correct and I get the frames back as expected, some work not. Or at least the result is not the way I expected it to be.

    


    The code I use in Rust :

    


    ffmpeg::init().unwrap();

let in_ctx = input(&Path::new(source)).unwrap();
let input = in_ctx
    .streams()
    .best(Type::Video)
    .ok_or(ffmpeg::Error::StreamNotFound)?;

let decoder = input.codec().decoder().video()?;

let scaler = Context::get(
    decoder.format(),
    decoder.width(),
    decoder.height(),
    Pixel::RGB24,
    decoder.width(),
    decoder.height(),
    Flags::FULL_CHR_H_INT | Flags::ACCURATE_RND,
)?; // <--- Is basically sws_getContext

// later to get the actual frame
let mut decoded = Video::empty();
if self.decoder.receive_frame(&mut decoded).is_ok() {
    let mut rgb_frame = Video::empty();
    self.scaler.run(&decoded, &mut rgb_frame)?; // <--- Does sws_scale
    println!("Converted Pixel Format: {}", rgb_frame.format() as i32);
    Ok(Some(rgb_frame))
}


    


    Which should roughly translate to C like so :

    


    // Get the context and video stream
SwsContext * ctx = sws_getContext(imgWidth, imgHeight,
                              imgFormat, imgWidth, imgHeight,
                              AV_PIX_FMT_RGB24, 0, 0, 0, 0);
sws_scale(ctx, decoded.data, decoded.linesize, 0, decoded.height, rgb_frame.data, rbg_frame.linesize);


    


    And like I said earlier, sometimes it works fine and I get the expected frame back. But sometimes I get something like this :
Weird result image

    


    I saved the images as .ppm files for quick visual comparison. I used this method, which basically writes the bytes to a file with a simple .ppm header :

    


    fn save_file(frame: &Video, index: usize) -> std::result::Result<(), std::io::Error> 
{
    let mut file = File::create(format!("frame{}.ppm", index))?;
    file.write_all(format!("P6\n{} {}\n255\n", frame.width(), frame.height()).as_bytes())?;
    file.write_all(frame.data(0))?;
    Ok(())
}


    


    Here you can see that on the left side there is a good image result vs. on the right side there is a bad image result.
Comparison of the .ppm files

    


    To come to the question now :

    


    Why is this happening. I tested everything on my side and the only thing left is ffmpeg conversion. FFMPEG seems to convert these two test files differently even though it reports YUV420P as format for both. I cannot figure out what the difference may be...

    


    Here the info for the two video files i used :

    


    Good video file :

    


    General
Complete name                            : /mnt/smb/Snapchat-174933781.mp4
Format                                   : MPEG-4
Format profile                           : Base Media / Version 2
Codec ID                                 : mp42 (isom/mp42)
File size                                : 1.90 MiB
Duration                                 : 9 s 612 ms
Overall bit rate                         : 1 661 kb/s
Encoded date                             : UTC 2021-07-28 22:09:36
Tagged date                              : UTC 2021-07-28 22:09:36
eng                                      : -180.00

Video
ID                                       : 512
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L3.1
Format settings                          : CABAC / 1 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 1 frame
Format settings, GOP                     : M=1, N=30
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 9 s 598 ms
Bit rate                                 : 1 597 kb/s
Width                                    : 480 pixels
Height                                   : 944 pixels
Display aspect ratio                     : 0.508
Frame rate mode                          : Variable
Frame rate                               : 29.797 FPS
Minimum frame rate                       : 15.000 FPS
Maximum frame rate                       : 30.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.118
Stream size                              : 1.83 MiB (96%)
Title                                    : Snap Video
Language                                 : English
Encoded date                             : UTC 2021-07-28 22:09:36
Tagged date                              : UTC 2021-07-28 22:09:36
Color range                              : Full
colour_range_Original                    : Limited
Color primaries                          : BT.709
Transfer characteristics                 : BT.601
transfer_characteristics_Original        : BT.709
Matrix coefficients                      : BT.709
Codec configuration box                  : avcC

Audio
ID                                       : 256
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 9 s 612 ms
Bit rate mode                            : Constant
Bit rate                                 : 62.0 kb/s
Channel(s)                               : 1 channel
Channel layout                           : C
Sampling rate                            : 44.1 kHz
Frame rate                               : 43.066 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 73.3 KiB (4%)
Title                                    : Snap Audio
Language                                 : English
Encoded date                             : UTC 2021-07-28 22:09:36
Tagged date                              : UTC 2021-07-28 22:09:36


    


    Bad video file :

    


    General
Complete name                            : /mnt/smb/Snapchat-1989594918.mp4
Format                                   : MPEG-4
Format profile                           : Base Media / Version 2
Codec ID                                 : mp42 (isom/mp42)
File size                                : 2.97 MiB
Duration                                 : 6 s 313 ms
Overall bit rate                         : 3 948 kb/s
Encoded date                             : UTC 2019-07-11 06:43:04
Tagged date                              : UTC 2019-07-11 06:43:04
com.android.version                      : 9

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Baseline@L3.1
Format settings                          : 1 Ref Frames
Format settings, CABAC                   : No
Format settings, Reference frames        : 1 frame
Format settings, GOP                     : M=1, N=30
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 6 s 313 ms
Bit rate                                 : 3 945 kb/s
Width                                    : 496 pixels
Height                                   : 960 pixels
Display aspect ratio                     : 0.517
Frame rate mode                          : Variable
Frame rate                               : 29.306 FPS
Minimum frame rate                       : 19.767 FPS
Maximum frame rate                       : 39.508 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.283
Stream size                              : 2.97 MiB (100%)
Title                                    : VideoHandle
Language                                 : English
Encoded date                             : UTC 2019-07-11 06:43:04
Tagged date                              : UTC 2019-07-11 06:43:04
Color range                              : Limited
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709
Codec configuration box                  : avcC


    


    Or as a diff image : image diff

    


    The problem is that I am not that familiar with ffmpeg yet I don't know all the quirks it has.

    


    I hope someone can point me in the right direction.

    


  • Decode H264 video using libavcodec, C

    10 janvier 2015, par deadman

    I’m trying to decode a raw h264 file with ffmpeg/libavcodec, but can’t get it to work properly. Output should be a raw YUV-File for now. It’s possible to compile the code with GCC

    gcc -o decoder decoder.c -L./lib/ -llibavcodec -llibavutil

    avcodec.dll, avutil.dll and swresample.dll must be placed in the directory for the .exe to start. Output in the CMD looks like this (only part of it, but its always like this) :

    [h264 @ 00a80f20] reference picture missing during reorder
    [h264 @ 00a80f20] Missing reference picture, default is 65562
    [h264 @ 00a80f20] error while decoding MB 80 54, bytestream -10
    [h264 @ 00a80f20] concealing 1649 DC, 1649 AC, 1649 MV errors in B frame
    [h264 @ 00a80f20] reference picture missing during reorder
    [h264 @ 00a80f20] reference picture missing during reorder
    [h264 @ 00a80f20] reference picture missing during reorder
    [h264 @ 00a80f20] Missing reference picture, default is 65566
    [h264 @ 00a80f20] Missing reference picture, default is 65566
    [h264 @ 00a80f20] Missing reference picture, default is 65566
    [h264 @ 00a80f20] reference picture missing during reorder
    [h264 @ 00a80f20] Missing reference picture, default is 65568
    [h264 @ 00a80f20] reference picture missing during reorder
    [h264 @ 00a80f20] Missing reference picture, default is 65570
    [h264 @ 00a80f20] reference picture missing during reorder

    Heres my code

    #include
    #include

    #ifdef HAVE_AV_CONFIG_H
    #undef HAVE_AV_CONFIG_H
    #endif

    #include "libavcodec/avcodec.h"
    //#include "libavcodec/libavutil/mathematics.h"

    #define INBUF_SIZE 4096

    void video_decode(char *outfilename, char *filename)
    {
       AVCodec *codec;
       AVCodecContext *c= NULL;
       int frame, got_picture, len;
       FILE *f, *outf;
       AVFrame *picture;
       uint8_t inbuf[INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE];
       AVPacket avpkt;
       int i;

       av_init_packet(&avpkt);

       memset(inbuf + INBUF_SIZE, 0, FF_INPUT_BUFFER_PADDING_SIZE);

       codec = avcodec_find_decoder(AV_CODEC_ID_H264);
       if (!codec) {
           fprintf(stderr, "codec not found\n");
           exit(1);
       }

       c = avcodec_alloc_context3(codec);
       picture = av_frame_alloc();

       if((codec->capabilities)&CODEC_CAP_TRUNCATED)
           (c->flags) |= CODEC_FLAG_TRUNCATED;

       c->height = 1080;
       c->width = 1920;

       if (avcodec_open2(c, codec, NULL) < 0) {
           fprintf(stderr, "could not open codec\n");
           exit(1);
       }

       f = fopen(filename, "rb");
       if (!f) {
           fprintf(stderr, "could not open %s\n", filename);
           exit(1);
       }

       outf = fopen(outfilename,"w");
       if(!outf){
           fprintf(stderr, "could not open %s\n", filename);
           exit(1);
       }
       frame = 0;
       for(;;) {
           avpkt.size = fread(inbuf, 1, INBUF_SIZE, f);
           if (avpkt.size == 0)
               break;

           avpkt.data = inbuf;
           while (avpkt.size > 0) {

               len = avcodec_decode_video2(c, picture, &got_picture, &avpkt);

               if (len < 0) {
                   fprintf(stderr, "Error while decoding frame %d\n", frame);
                   exit(1);
               }
               if (got_picture) {
                   printf("saving frame %3d\n", frame);
                   fflush(stdout);
                   for(i=0; iheight; i++)
                       fwrite(picture->data[0] + i * picture->linesize[0], 1, c->width, outf  );
                   for(i=0; iheight/2; i++)
                       fwrite(picture->data[1] + i * picture->linesize[1], 1, c->width/2, outf );
                   for(i=0; iheight/2; i++)
                       fwrite(picture->data[2] + i * picture->linesize[2], 1, c->width/2, outf );
                   frame++;
               }
               avpkt.size -= len;
               avpkt.data += len;
           }
       }

       avpkt.data = NULL;
       avpkt.size = 0;
       len = avcodec_decode_video2(c,picture, &got_picture, &avpkt);
       if(got_picture) {
           printf("saving last frame %d\n",frame);
           fflush(stdout);
           for(i=0; iheight; i++)
               fwrite(picture->data[0] + i * picture->linesize[0], 1, c->width, outf );
           for(i=0; iheight/2; i++)
               fwrite(picture->data[1] + i * picture->linesize[1], 1, c->width/2, outf );
           for(i=0; iheight/2; i++)
               fwrite(picture->data[2] + i * picture->linesize[2], 1, c->width/2, outf );
           frame++;
       }

       fclose(f);
       fclose(outf);

       avcodec_close(c);
       av_free(c);
       av_frame_free(&picture);
       printf("\n");
    }

    int main(int argc, char **argv){
       avcodec_register_all();
       video_decode("test", "trailer.264");

       return 0;
    }

    I also tried different videos in different formats (of course i changed the codec in the code in this case) like MPEG1, H263, H265, but none of those was working properly either.
    I hope someone can help me with this and tell me what I’m doing wrong here. Thanks