Recherche avancée

Médias (91)

Autres articles (106)

  • 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

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

  • Qu’est ce qu’un masque de formulaire

    13 juin 2013, par

    Un masque de formulaire consiste en la personnalisation du formulaire de mise en ligne des médias, rubriques, actualités, éditoriaux et liens vers des sites.
    Chaque formulaire de publication d’objet peut donc être personnalisé.
    Pour accéder à la personnalisation des champs de formulaires, il est nécessaire d’aller dans l’administration de votre MediaSPIP puis de sélectionner "Configuration des masques de formulaires".
    Sélectionnez ensuite le formulaire à modifier en cliquant sur sont type d’objet. (...)

Sur d’autres sites (11869)

  • ffmpeg audio decoding providing half the data from original audio in C++

    3 mai 2016, par hockeyislife

    I am trying to write a simple program in C++ that captures audio from a microphone on the computer and encodes it into mp2. Which I was successful in doing, I verified this by saving a mp2 audio file and playing it back in VLC.

    I then decided to see if I could take the encoded audio packets from ffmpeg and convert them back to raw PCM format, and this is where I am having trouble.

    So below is my decoder settings :

    AVCodecID audio_codec_id = AV_CODEC_ID_MP2;
    AVCodec * audio_decodec = avcodec_find_decoder(audio_codec_id);
    if (!audio_decodec)
    {
       return -1;
    }
    audio_decodec_ctx = avcodec_alloc_context3(audio_decodec);
    audio_decodec_ctx->bit_rate = 64000;
    audio_decodec_ctx->channels = 2;
    audio_decodec_ctx->channel_layout = AV_CH_LAYOUT_STEREO;
    audio_decodec_ctx->sample_rate = 44100;
    audio_decodec_ctx->sample_fmt = AV_SAMPLE_FMT_S16;

    int retval;
    if ((retval = avcodec_open2(audio_decodec_ctx, audio_decodec, NULL)) < 0)
    {
       return -1;
    }

    Here is my encoder settings, which I made identical :

    AVCodecID audio_codec_id = AV_CODEC_ID_MP2;
    AVCodec* audio_codec = avcodec_find_encoder(audio_codec_id);
    if (!audio_codec)
    {
       return -1;
    }

    // Initialize codec.
    AVCodecContext* audio_codec_ctx = avcodec_alloc_context3(audio_codec);
    audio_codec_ctx->bit_rate = 64000;
    audio_codec_ctx->channels = 2;
    audio_codec_ctx->channel_layout = AV_CH_LAYOUT_STEREO;
    audio_codec_ctx->sample_rate = 44100;
    audio_codec_ctx->sample_fmt = AV_SAMPLE_FMT_S16;

    int audio_retval;
    if ((audio_retval = avcodec_open2(audio_codec_ctx, audio_codec, NULL)) < 0)
    {
       return -1;
    }

    As stated previously, the encoding of the audio signal works perfectly, when I try to take the packets that are encoded and attempt to convert them back I am getting only half the data.

    avcodec_encode_audio2(audio_codec_ctx, &audio_pkt, pOutAudioFrame, &got_output);

    if (got_output)
    {
       fwrite(audio_pkt.data, 1, audio_pkt.size, f); // MP2 file write which, sounds very nice, which leads me to believe encoding is being done correctly
       AVFrame * audio_frame_decode = av_frame_alloc();
       avcodec_get_frame_defaults(audio_frame_decode);
       int frame_finished = 0;

       avcodec_decode_audio4(audio_decodec_ctx, audio_frame_decode, &frame_finished, &audio_pkt );
       if (frame_finished)
       {
           decoded_size += audio_frame_decode->linesize[0];  // only getting 2304 bytes
           av_free_packet(&audio_pkt);
       }
    }  

    The amount of PCM data being taken is 4608 but after decoding the encoder version I am getting only 2304 bytes. Seems like I have something incorrect but I can’t put my finger on it. Any help would be greatly appreciated.

    Thanks in advance.

  • Is it possible to have a live m3u8 stream play in phonegap applications ?

    24 mars 2014, par CR47

    I've built a Drupal back-end website for streaming live m3u8 streams, and when I play these streams over to an Android Java application it works, but I'm wondering if there is a way to do this in phonegap as well.

  • How to pack the pyav.packet and distribute to another computer

    31 juillet 2024, par lambertk

    I'm currently working on projects which needs to read frames from RTSP server on single entry of computer, do some preprocessing and distribute these frames with preprocessed metadata to different backend for different purpose.

    


    And after googling, I found that PyAV could be the solution which can retrieve the video from RTSP source and make it packets, which could possibly be sent to another computer.

    


    Considering the network bandwidth, transmit the packets instead of the decoded frames could be better choice.

    


    But now comes the problem, socket/MQ, usually only allows to send bytes or string.
    
Encode the PyAV.packet.Packet object into byte is easy by bytes(packet), but I couldn't find out the way to decode it back to PyAV.packet.Packet object.

    


    I've tried to use pickle to serialize the packet, but this method is not implemented in PyAV, and was rejected by the official team.

    


    I've also tried to use another package called msgpack, which also failed to serialize the packet.

    


    I've tried the following code after reading the source code of PyAV

    


    packet_bytes = bytes(packet)
pt = av.packet.Packet(len(packet_bytes))
pt.update(packet_bytes)


    


    the update function seems did not update anything

    


    Is there anyway to decode the bytes back to packet object ?

    


    Or, can someone give out a way to encode the frame packet and the preprocessed metadata (which is differ frame by frame) together (like H264 SEI Message, which I tried, but could not be inserted when using Python) then send to backend ?