Recherche avancée

Médias (1)

Mot : - Tags -/ticket

Autres articles (47)

  • Les statuts des instances de mutualisation

    13 mars 2010, par

    Pour des raisons de compatibilité générale du plugin de gestion de mutualisations avec les fonctions originales de SPIP, les statuts des instances sont les mêmes que pour tout autre objets (articles...), seuls leurs noms dans l’interface change quelque peu.
    Les différents statuts possibles sont : prepa (demandé) qui correspond à une instance demandée par un utilisateur. Si le site a déjà été créé par le passé, il est passé en mode désactivé. publie (validé) qui correspond à une instance validée par un (...)

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

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

Sur d’autres sites (9527)

  • FFmpeg : audio synchronization with audioqueue

    21 août 2013, par juanramoney

    I have a video player in my aplication. I have no problem with avi files and mp3 audio, but when I play mpg or wmv, and I have to use avcodec_decode_audio3. The first seconds plays and then when the buffer refill, I get a silence for a few seconds and then the audio continues from the same place, this happen each time the buffer refill.

    This is the AudioQueue Format :

           playState.format.mSampleRate = _av->audio.sample_rate;
           playState.format.mFormatID = kAudioFormatLinearPCM;
           playState.format.mFormatFlags =  kAudioFormatFlagsCanonical;
           playState.format.mChannelsPerFrame = _av->audio.channels_per_frame;
           playState.format.mBytesPerPacket = sizeof(AudioSampleType) *_av->audio.channels_per_frame;
           playState.format.mBytesPerFrame = sizeof(AudioSampleType) *_av->audio.channels_per_frame;
           playState.format.mBitsPerChannel = 8 * sizeof(AudioSampleType);

           playState.format.mFramesPerPacket = 1;
           playState.format.mReserved = 0;

    fillAudioBuffer :

    static void fillAudioBuffer(AudioQueueRef queue, AudioQueueBufferRef buffer){

    int lengthCopied = INT32_MAX;
    int dts= 0;
    int isDone = 0;

    buffer->mAudioDataByteSize = 0;
    buffer->mPacketDescriptionCount = 0;

    OSStatus err = 0;
    AudioTimeStamp bufferStartTime;

    AudioQueueGetCurrentTime(queue, NULL, &bufferStartTime, NULL);

    while(buffer->mPacketDescriptionCount < numPacketsToRead && lengthCopied > 0){

       lengthCopied = getNextAudio(_av,buffer->mAudioDataBytesCapacity-buffer->mAudioDataByteSize, (uint8_t*)buffer->mAudioData+buffeg->mAudioDataByteSize,&dts,&isDone);
       if(!lengthCopied || isDone) break;

       if(aqStartDts < 0) aqStartDts = dts;
       if(buffer->mPacketDescriptionCount ==0){
           bufferStartTime.mFlags = kAudioTimeStampSampleTimeValid;
           bufferStartTime.mSampleTime = (Float64)(dts-aqStartDts);
       }
       buffer->mPacketDescriptions[buffer->mPacketDescriptionCount].mStartOffset = buffer->mAudioDataByteSize;
       buffer->mPacketDescriptions[buffer->mPacketDescriptionCount].mDataByteSize = lengthCopied;
       buffer->mPacketDescriptions[buffer->mPacketDescriptionCount].mVariableFramesInPacket = _av->audio.frame_size;
       buffer->mPacketDescriptionCount++;
       buffer->mAudioDataByteSize += lengthCopied;

    }
    if(buffer->mAudioDataByteSize){
       if((err=AudioQueueEnqueueBufferWithParameters(queue, buffer, 0, NULL, 0, 0, 0, NULL, &bufferStartTime, NULL)))
       {

       }
    }


    int   getNextAudio(video_data_t* vInst, int maxlength, uint8_t* buf, int* pts, int* isDone) {
    struct video_context_t  *ctx = vInst->context;
    int    datalength            = 0;
    while(ctx->audio_ring.lock || ((ctx->audio_ring.count <= 0 && ((ctx->play_state & STATE_DIE) != STATE_DIE))&&((ctx->play_state & STATE_EOF) != STATE_EOF))){
       PMSG1(stdout,"die get audio %d", ctx->play_state);
       if((ctx->play_state & STATE_STOP) != STATE_STOP){
           PMSG1(stdout,"die NO CARGADO %d",ctx->play_state);
           return 0;
       }
       usleep(100);
    }
    *pts = 0;
    ctx->audio_ring.lock = kLocked;

    if(ctx->audio_ring.count>0 && maxlength > ctx->audio_buffer[ctx->audio_ring.read].size){
       memcpy(buf, ctx->audio_buffer[ctx->audio_ring.read].data, ctx->audio_buffer[ctx->audio_ring.read].size);
       datalength = ctx->audio_buffer[ctx->audio_ring.read].size;
       *pts = ctx->audio_buffer[ctx->audio_ring.read].pts;
       ctx->audio_ring.read++;
       ctx->audio_ring.read %= ABUF_SIZE;
       ctx->audio_ring.count--;
    }
    ctx->audio_ring.lock = kUnlocked;

    if((ctx->play_state & STATE_EOF) == STATE_EOF && ctx->audio_ring.count == 0) *isDone = 1;
    return datalength;

    This is a log playing a mpg file :

    Input #0, mpeg, '1.MPG':
     Duration: 00:03:14.74, start: 3370.475789, bitrate: 2489 kb/s
       Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p, 544x576 [SAR 24:17 DAR 4:3], 9000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
       Stream #0:1[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16, 192 kb/s
    mpeg2video  MPEG-2 video
    aspect 1.333333
    startPlayback
    DTS: 0.000000 time base: 0.000011 StartDTS: 303347520 Orig DTS: 303347520
    Video Buffer: 157/1024 Audio Buffer: 33/1024
    Bytes copied for buffer 0xc292ac0: 1046016
    DTS: 490320.000000 time base: 0.000011 StartDTS: 303347520 Orig DTS: 303837840
    Video Buffer: 276/1024 Audio Buffer: 2/1024
    Bytes copied for buffer 0x1225f8b0: 1046016
    DTS: 980640.000000 time base: 0.000011 StartDTS: 303347520 Orig DTS: 304328160
    Video Buffer: 411/1024 Audio Buffer: 1/1024
    Bytes copied for buffer 0x13380840: 1046016
    DTS: 1470960.000000 time base: 0.000011 StartDTS: 303347520 Orig DTS: 304818480
    Video Buffer: 885/1024 Audio Buffer: 797/1024
    Bytes copied for buffer 0xc292ac0: 1046016
    -----Here the audio stop for 4 or 5 seconds
    -----then continues for 4 or 5 seconds
    DTS: 1961280.000000 time base: 0.000011 StartDTS: 303347520 Orig DTS: 305308800
    Video Buffer: 765/1024 Audio Buffer: 797/1024
    Bytes copied for buffer 0x1225f8b0: 1046016
    -----Here the audio stop for 4 or 5 seconds
    -----then continues for 4 or 5 seconds
    DTS: 2451600.000000 time base: 0.000011 StartDTS: 303347520 Orig DTS: 305799120
    Video Buffer: 644/1024 Audio Buffer: 798/1024
    Bytes copied for buffer 0x13380840: 1046016
    ...

    if I reduce the buffer, the silence and sound time is reduced.
    So I want to know how to fix it ? Thanks !!

  • 11 ways Piwik Analytics helps you to protect your visitors privacy

    11 janvier 2017, par InnoCraft — Community

    At Piwik and at InnoCraft, we think Privacy matters. From the beginning, Piwik has had a strong focus on privacy and ensures the privacy of your visitors and analytics data. As a result, Piwik has been recommended as a privacy-compliant analytics tool for example by the Independent Center for Privacy Protection in Germany (ULD) and by the Center for Data Privacy Protection in France (CNIL). In France, Piwik is the only web analytics tool that does not require Cookie Consent.

    Here are some ways how you can ensure your users and visitors privacy by using Piwik.

    1. You own the data

    Whether you host Piwik on premise yourself, managed on premise by InnoCraft, or whether you use our Piwik cloud, when you use Piwik, YOU keep control of your data and nobody else. This also means you can decide where your data should be located physically.

    2. Anonymized IP addresses

    For better privacy by default, Piwik will not record the full IP address of your visitors because otherwise the browsing history could be easily tracked across several days and even across websites within the same Piwik server. Some countries even require to anonymize the IP address, considered Personally Identifiable Information (PII).

    To change the IP anonymization settings go to “Administration > Privacy”. Optionally, you can use the full IP to still get for example accurate location data.

    3. Delete old visitor logs

    The visitor logs contain information all the collected raw data about every visitor and every action. You can configure Piwik to automatically delete logs from the database. When you delete old logs, only the real time and visitor log reports will no longer work for this old time period, all other aggregated reports will still work.

    For privacy reasons, we highly recommend that you keep the detailed Piwik logs for only 3 to 6 months and delete older log data. This has one other nice side effect : it will free significant database space, which will, in turn, slightly increase performance !

    4. Support Do Not Track preference

    Do Not Track enables users to opt out of any tracking by websites they do not visit, including analytics services, advertising networks, and social platforms. By default, Piwik respects users preference and will not track visitors which have specified “I do not want to be tracked” in their web browsers. Get more information about DoNotTrack.

    To make sure Do Not Track is respected, go to “Administration => Privacy”.

    5. Include an Opt-Out Feature on your website or app

    By embedding the Opt-Out feature in your website, you give your visitors the possibility to opt-out of the tracking. When you go to “Administration > Privacy”, you will be able to copy and paste an HTML Iframe code to embed the opt-out feature for example into your privacy policy page or in your ‘Legal’ page. Your users can then click on a link to opt-out.

    On the Piwik Marketplace there are also some plugins available to customize the Opt-Out experience. For example AjaxOptOut and CustomOptOut.

    6. Disable Live features

    The Real-Time, Visitor Log and Visitor Profile features give you insights into the tracked raw data by showing you details about every visitor and every action they performed. To protect the privacy of your visitors you may decide to prevent access to such features by disabling the “Live” plugin in “Administration => Plugins”. This way only aggregated reports will be shown in your Piwik.

    7. Disable fingerprinting across websites

    By default, when one of your visitors visits several of your websites, Piwik will create a fingerprint for this user that will be different across the websites to increase the visitors’ privacy. You can make sure that this feature is disabled by going to “Administration => Config file” and verifying that the value of “enable_fingerprinting_across_websites” is set to zero.

    8. Disable tracking cookies

    Piwik uses cookies to store some information about visitors between visits. In some countries, the legislation requires websites to provide a way for users to opt-out of all tracking, in particular tracking cookies. You can disable cookies by adding one line in the Piwik Javascript code.

    9. Custom development

    Piwik is an open platform that lets you extend and customize the tracking, the reporting and the Piwik user interface to your needs and to protect your visitors’ privacy the way you want or need it. Learn more in the Piwik Developer Zone. You may also have a look at our Piwik Marketplace where you can find several free and premium features to extend your Piwik.

    10. Transparency

    By default, all information and all collected data in your Piwik server are protected and nobody can access it. However, Piwik allows you to optionally make your collected data public and you can export any Piwik report including the whole dashboard to embed it into your website. This way you can show your users exactly which information you track. When you decide to make reports public, we do our best to protect privacy and automatically hide any Personally Identifiable Information such as the Visitor Profile and we make sure to not show any Visitor IP address and the Visitor ID.

    11. Privacy policy

    When you use Piwik to track your visitors, we recommend to update your Privacy Policy to explain how Piwik is used and what data it gathers. We provide a Privacy Policy template for Piwik users that you can copy on your site.

    Continuous privacy improvements

    We are always interested in improving the privacy. If you miss any feature or have an idea on how to improve the privacy, please let us know.

    More information about all the Piwik features

    If you want to learn more about all the features in Piwik, have a look at our User Guides and FAQ entries.

  • How to play avi files on browser

    31 janvier 2017, par mvalencaa

    My team needs to develop a system that plays avi files on the web. These files are recorded by a hardware whose firmware we don’t have access to. We are trying to negotiate it with the manufacturer to change the file format to mp4, but until now we have nothing.

    Because of this, we are trying another manners to make it work. Our first attempt was to use FFMPEG to convert the files to mp4 (or webm or ogg), but this process takes too long because we have to do it everyday with a really huge amount of videos.

    We also tried to use FFMPEG’s copy command (which is much faster), but the video always crashes at some point (mainly when we need to navigate in its timeline) and we don’t know why.

    So now we are thinking to customize videojs flash player to reproduce the AVI files, but because we don’t have too much experience with video programming and flash, we don’t know if this is possible. Is it possible to write a decoder in action script to read avi files ?

    I saw that Youtube and Facebook can play AVI files... How do they do this ? I have already looked a lot about it, but had no success.

    EDIT 1

    avi video file before copy command :

    $ ffmpeg -i video.avi
    ffmpeg version N-82324-g872b358 Copyright (c) 2000-2016 the FFmpeg developers
     built with gcc 5.4.0 (GCC)
     configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-dx                                                                                                                                                                                               va2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-lib                                                                                                                                                                                               ebur128 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --ena                                                                                                                                                                                               ble-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfree                                                                                                                                                                                               type --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enab                                                                                                                                                                                               le-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-lib                                                                                                                                                                                               openh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschr                                                                                                                                                                                               oedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheor                                                                                                                                                                                               a --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvo                                                                                                                                                                                               rbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --ena                                                                                                                                                                                               ble-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --e                                                                                                                                                                                               nable-decklink --enable-zlib
     libavutil      55. 36.100 / 55. 36.100
     libavcodec     57. 66.101 / 57. 66.101
     libavformat    57. 57.100 / 57. 57.100
     libavdevice    57.  2.100 / 57.  2.100
     libavfilter     6. 66.100 /  6. 66.100
     libswscale      4.  3.100 /  4.  3.100
     libswresample   2.  4.100 /  2.  4.100
     libpostproc    54.  2.100 / 54.  2.100
    Input #0, avi, from 'video.avi':
     Metadata:
       encoder         :
     Duration: 00:50:07.67, start: 0.000000, bitrate: 6 kb/s
       Stream #0:0: Video: h264 (Constrained Baseline) (H264 / 0x34363248), yuv420p                                                                                                                                                                                               (progressive), 352x240, 3 fps, 3 tbr, 3 tbn, 6 tbc
    At least one output file must be specified

    copy command (with no audio stream because the videos don’t have it) :

    $ ffmpeg -i video.avi -vcodec copy video.mp4
    ffmpeg version N-82324-g872b358 Copyright (c) 2000-2016 the FFmpeg developers
     built with gcc 5.4.0 (GCC)
     configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-libebur128 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
     libavutil      55. 36.100 / 55. 36.100
     libavcodec     57. 66.101 / 57. 66.101
     libavformat    57. 57.100 / 57. 57.100
     libavdevice    57.  2.100 / 57.  2.100
     libavfilter     6. 66.100 /  6. 66.100
     libswscale      4.  3.100 /  4.  3.100
     libswresample   2.  4.100 /  2.  4.100
     libpostproc    54.  2.100 / 54.  2.100
    Input #0, avi, from 'video.avi':
     Metadata:
    encoder         :
     Duration: 00:50:07.67, start: 0.000000, bitrate: 6 kb/s
    Stream #0:0: Video: h264 (Constrained Baseline) (H264 / 0x34363248), yuv420p(progressive), 352x240, 3 fps, 3 tbr, 3 tbn, 6 tbc
    Output #0, mp4, to 'video.mp4':
     Metadata:
    encoder         : Lavf57.57.100
    Stream #0:0: Video: h264 (Constrained Baseline) ([33][0][0][0] / 0x0021), yuv420p(progressive), 352x240, q=2-31, 3 fps, 3 tbr, 12288 tbn, 3 tbc
    Stream mapping:
     Stream #0:0 -> #0:0 (copy)
    Press [q] to stop, [?] for help
    [mp4 @ 0000000002513fc0] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
    [NULL @ 0000000002524020] missing picture in access unit with size 16
    Last message repeated 300 times
    frame= 9324 fps=0.0 q=-1.0 Lsize=    1388kB time=01:38:27.66 bitrate=   1.9kbits/s speed=3.32e+004x
    video:1354kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.493988%

    mp4 video file after copy command :

    $ ffmpeg -i video.mp4
    ffmpeg version N-82324-g872b358 Copyright (c) 2000-2016 the FFmpeg developers
     built with gcc 5.4.0 (GCC)
     configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-dx                                                                                                                                                                                               va2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-lib                                                                                                                                                                                               ebur128 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --ena                                                                                                                                                                                               ble-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfree                                                                                                                                                                                               type --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enab                                                                                                                                                                                               le-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-lib                                                                                                                                                                                               openh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschr                                                                                                                                                                                               oedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheor                                                                                                                                                                                               a --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvo                                                                                                                                                                                               rbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --ena                                                                                                                                                                                               ble-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --e                                                                                                                                                                                               nable-decklink --enable-zlib
     libavutil      55. 36.100 / 55. 36.100
     libavcodec     57. 66.101 / 57. 66.101
     libavformat    57. 57.100 / 57. 57.100
     libavdevice    57.  2.100 / 57.  2.100
     libavfilter     6. 66.100 /  6. 66.100
     libswscale      4.  3.100 /  4.  3.100
     libswresample   2.  4.100 /  2.  4.100
     libpostproc    54.  2.100 / 54.  2.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.mp4':
     Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.57.100
     Duration: 01:38:28.00, start: 0.000000, bitrate: 1 kb/s
    Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yu                                                                                                                                                                                               v420p, 352x240, 1 kb/s, 1.58 fps, 3 tbr, 12288 tbn, 24576 tbc (default)
    Metadata:
     handler_name    : VideoHandler
    At least one output file must be specified

    EDIT 2

    I uploaded two little samples if somebody wants to test :