Recherche avancée

Médias (1)

Mot : - Tags -/sintel

Autres articles (62)

  • Gestion générale des documents

    13 mai 2011, par

    MédiaSPIP ne modifie jamais le document original mis en ligne.
    Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
    Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...)

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

  • Streaming ffmpeg from fifo file starts only when i close the fifo file

    23 juin 2022, par tamirg

    Im starting an ffmpeg process, where the input is a FIFO file i created.
Im writing some data in a loop to the FIFO file, but the ffmpeg process doesn't start streaming until one of the two happens :

    


      

    1. i'm closing the file
    2. 


    3. iv'e written a certain amount of data. after a while of writing, the ffmpeg process starts streaming. The more data i write, the faster it starts running. (im writing a chunk of data on each loop, if i just duplicate those chunks times 100, it starts much faster).
    4. 


    


    What can be the reason for that ? Is there a minimum of data required for the ffmpeg process to start streaming ? How can i "force" it to start, without closing the FIFO file after writing ?

    


  • store pcm data into file, but can not play that file

    25 mai 2016, par Peng Qu

    I am writing a simple program, which reads mp3 file and store its pcm data into another file. I could get that file now, but when I play that on windows, I failed. So is there any wrong in my code, or windows couldn’t play raw audio data ?

    #include
    #include
    #include <libavutil></libavutil>avutil.h>
    #include <libavformat></libavformat>avformat.h>
    #include <libavcodec></libavcodec>avcodec.h>

    int main()
    {
    int err;
    FILE *fout = fopen("test.wav", "wb");
    av_register_all();

    // step 1, open file and find audio stream
    AVFormatContext *fmtx = NULL;
    err = avformat_open_input(&amp;fmtx, "melodylove.mp3", NULL, NULL);
    assert(!err);

    err = avformat_find_stream_info(fmtx, NULL);
    assert(!err);

    int audio_stream_idx = -1;
    AVStream *st;
    AVCodecContext *decx;
    AVCodec *dec;

    for (int i = 0; i &lt; fmtx->nb_streams; ++i) {
       audio_stream_idx = i;
       if (fmtx->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
           st = fmtx->streams[i];
           decx = st->codec;
           dec = avcodec_find_decoder(decx->codec_id);
           decx->request_channel_layout = AV_CH_LAYOUT_STEREO_DOWNMIX;
           decx->request_sample_fmt = AV_SAMPLE_FMT_FLT;
           avcodec_open2(decx, dec, NULL);
           break;
       }
    }
    assert(audio_stream_idx != -1);

    int channels = decx->channels;
    int sample_rate = decx->sample_rate;
    int planar = av_sample_fmt_is_planar(decx->sample_fmt);
    int num_planes =  planar? decx->channels : 1;
    const char *sample_name = av_get_sample_fmt_name(decx->sample_fmt);
    printf("sample name: %s, channels: %d, sample rate: %d\n",
           sample_name, channels, sample_rate);
    printf("is planar: %d, planes: %d\n", planar, num_planes);

    /*
    * above I print some infomation about mp3 file, they are:
    * sample name: s16p, channels: 2, sample rate: 48000
    * is planar: 1, planes: 2
    */
    getchar();

    AVPacket pkt;
    av_init_packet(&amp;pkt);
    AVFrame *frame = av_frame_alloc();

    while (1) {
       err = av_read_frame(fmtx, &amp;pkt);
       if (err &lt; 0) {
           printf("read frame fail\n");
           fclose(fout);
           exit(-1);
       }
       if (pkt.stream_index != audio_stream_idx) {
           printf("we don't need this stream\n");
           continue;
       }
       printf("data size: %d\n", pkt.size);

       int got_frame = 0;
       int bytes = avcodec_decode_audio4(decx, frame, &amp;got_frame, &amp;pkt);
       if (bytes &lt; 0) {
           printf("decode audio fail\n");
           continue;
       }
       printf("frame size: %d, samples: %d\n", bytes, frame->nb_samples);

       if (got_frame) {
           int input_samples = frame->nb_samples * decx->channels;
           int sz = input_samples / num_planes;
           short buffer1[input_samples];

           for (int j = 0; j &lt; frame->nb_samples; ++j) {
               for (int i = 0; i &lt; num_planes; ++i) {
                   short *d = (short *)frame->data[i];
                   buffer1[j*2+i] = d[j];
               }
           }

           fwrite(buffer1, input_samples, 2, fout);
       } else {
           printf("why not get frame???");
       }
    }
    }
  • Streaming audio file conversion process

    11 janvier 2017, par YAL

    I am integrating IBM Speech to Text API to my Django project. The problem that I have right now is that we allow users to upload audio files and majority of them are in the format of MP3 or MP4. However, the API only takes FLAC or WAV format.

    I am currently using FFMPEG for file conversion. However, this audio conversion library loads the entire audio file in memory as opposed to doing it in chunks.

    I wonder what would be a good solution to this problem or other packages that I should use ?