Recherche avancée

Médias (91)

Autres articles (107)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • 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 ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

Sur d’autres sites (13435)

  • FFMPEG - Extract sequence while recording

    26 février 2020, par Vincent Carretero

    I have a ffmpeg process to record a webcam, thats very classic...
    I would like to extract a sequence from the recording file before the end of the record.

    example :
    - my recording start at 10:00 am and finish at 11:00 am
    - at 10:15 am, an event append, and an operator need to watch it quickly,
    - i would like to extract the sequence, and than he can watch at 10:20 am (but the video still recording and the Mp4.file not ended).

    is that possible ?

    thanks !!

  • Any suggestion for a reliable video format for industrial applications ?

    2 juin 2017, par fstab

    I am currently using videos encoded in MPEG4 (h264). This makes the content of the frames rely on the content of other frames.

    In my case this is undesirable as I often need to quickly split video files without re-compressing or altering the content and seek many times trough the video.

    The video format that I need needs to be reliable and the frames need to be independent from each other.

    Any idea on which video format might be best for these requirements ?

    Maybe there is a sub-type of MPEG4 encoding that allows to reach this result ?

  • Hit noise when playing part of wave file with ALSA PCM interface

    11 décembre 2024, par wangt13

    I am working a WAVE file playing with ALSA PCM interface in Linux, and I heard noise when I played the file quickly and partially.

    


    Here is my playing function.

    


    static int playback_function(uint8_t *pcm_buf, int pcm_frames)
{
    int  rc;
    uint8_t *buf;
    int frame_size, sent;
    int periodsize;
    int left;

    frame_size = chan * av_get_bytes_per_sample(AV_SAMPLE_FMT_S16);
    periodsize = sys_periodsize; // 320 in my system
    buf = pcm_buf;
    left = pcm_frames;
    sent = 0;

    while (left > 0) {
        sent = (left > periodsize) ? periodsize : left;
        rc = snd_pcm_writei(pcm_handle, buf, sent);
        printf("rc: %d, sent: %d\n", rc, sent);
        if (rc == -EAGAIN || (rc >= 0 && (size_t)rc < sent)) {
            snd_pcm_wait(pcm_handle, 10);
        } else if (rc == -EPIPE) {
            snd_pcm_recover(pcm_handle, rc, 0);
        } else if (rc < 0) {
            break;
        }
        if (rc > 0) {
            left -= rc;
            buf += rc * frame_size;
        }
    }
    return rc;
}


    


    The pcm_buf and pcm_frames are got from swr_convert() in libswresample, in my case, the pcm_frames is 1187.

    


    By adding printf("rc: %d, sent: %d\n", rc, sent);, I got following logs.

    


    rc: 320, sent: 320
rc: 87, sent: 87
rc: 320, sent: 320
rc: 320, sent: 320
rc: 103, sent: 103
rc: 320, sent: 320
rc: 320, sent: 320
rc: 103, sent: 103
rc: 320, sent: 320
rc: 320, sent: 320
rc: 103, sent: 103
rc: 320, sent: 320
rc: 320, sent: 320
rc: 103, sent: 103
rc: 320, sent: 320
rc: 320, sent: 320
rc: 103, sent: 103
rc: 320, sent: 320
rc: 320, sent: 320
rc: 103, sent: 103
rc: 320, sent: 320
rc: 320, sent: 320
rc: 103, sent: 103
rc: 320, sent: 320
rc: 320, sent: 320
rc: 103, sent: 103
rc: 320, sent: 320
rc: 320, sent: 320
rc: 87, sent: 87
rc: 320, sent: 320
rc: 320, sent: 320
rc: 103, sent: 103


    


    With above function, sometimes I can hear noise when playing the WAVE file quickly and repeatly.
    
So, how can I improve the WAVE playing without the noise ??

    


    I changed the above function by using filling 0 to the end of data buffer (to enforce silence).

    


    static int playback_test(uint8_t *pcm_buf, int pcm_frames)
{
    uint8_t *buf;
    int trd;
    int rc;
    int left;
    int frame_size, sent;
    int periodsize;
    int aligned = 0;

    frame_size = chan * av_get_bytes_per_sample(AV_SAMPLE_FMT_S16);
    periodsize = sys_periodsize; // 320 in my system

    buf = pcm_buf;
    left = pcm_frames;
    aligned = (left/periodsize + 1) * periodsize;
    memset(buf + left * frame_size, 0, (aligned - left) * frame_size);
    sent = 0;
///left = periodsize; // <== This causes more noise!!

    while (left > 0) {
        sent = (left > periodsize) ? periodsize : left;
        rc = snd_pcm_writei(pcm_handle, buf, sent);
        printf("rc: %d, sent: %d\n", rc, sent);
        if (rc == -EAGAIN || (rc >= 0 && (size_t)rc < sent)) {
            snd_pcm_wait(pcm_handle, 10);
        } else if (rc == -EPIPE) {
            snd_pcm_recover(pcm_handle, rc, 0);
        } else if (rc < 0) {
            break;
        }
        if (rc > 0) {
            left -= rc;
            buf += rc * frame_size;
        }
    }
    return rc;
}


    


    There is NO improvement as of the noise.