Recherche avancée

Médias (91)

Autres articles (88)

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

  • 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

  • Support de tous types de médias

    10 avril 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)

Sur d’autres sites (7424)

  • Libav and xaudio2 - audio not playing

    25 août 2013, par siz

    I am trying to get audio playing with libav using xaudio2. The xaudio2 code I am using works with an older ffmpeg using avcodec_decode_audio2, but that has been deprecated for avcodec_decode_audio4. I have tried following various libav examples, but can't seem to get the audio to play. Video plays fine (or rather it just plays right fast now, as I haven't coded any sync code yet).

    Firstly audio gets init, no errors, video gets init, then packet :

    while (1) {
       //is this packet from the video or audio stream?
       if (packet.stream_index == player.v_id) {
           add_video_to_queue(&packet);
       } else if (packet.stream_index == player.a_id) {
           add_sound_to_queue(&packet);
       } else {
           av_free_packet(&packet);
       }
    }

    Then in add_sound_to_queue :

    int add_sound_to_queue(AVPacket * packet) {
    AVFrame *decoded_frame = NULL;
    int done = AVCODEC_MAX_AUDIO_FRAME_SIZE;
    int got_frame = 0;

    if (!decoded_frame) {
       if (!(decoded_frame = avcodec_alloc_frame())) {
           printf("[ADD_SOUND_TO_QUEUE] Out of memory\n");
           return -1;
       }
    } else {
       avcodec_get_frame_defaults(decoded_frame);
    }

    if (avcodec_decode_audio4(player.av_acodecctx, decoded_frame, &got_frame, packet) < 0)  {
       printf("[ADD_SOUND_TO_QUEUE] Error in decoding audio\n");
       av_free_packet(packet);
       //continue;
       return -1;
    }
    if (got_frame) {
       int data_size;
       if (packet->size > done) {
           data_size = done;
       } else {
           data_size = packet->size;
       }
       BYTE * snd = (BYTE *)malloc( data_size * sizeof(BYTE));

       XMemCpy(snd,
           AudioBytes,
           data_size * sizeof(BYTE)
       );

       XMemSet(&g_SoundBuffer,0,sizeof(XAUDIO2_BUFFER));

       g_SoundBuffer.AudioBytes = data_size;
       g_SoundBuffer.pAudioData = snd;
       g_SoundBuffer.pContext = (VOID*)snd;

       XAUDIO2_VOICE_STATE state;
       while( g_pSourceVoice->GetState( &state ), state.BuffersQueued > 60 ) {
           WaitForSingleObject( XAudio2_Notifier.hBufferEndEvent, INFINITE );
       }

       g_pSourceVoice->SubmitSourceBuffer( &g_SoundBuffer );
    }
    return 0;
    }

    I can't seem to figure out the problem, I have added error messages in init, opening video, codec handling etc. As mentioned before the xaudio2 code is working with an older ffmpeg, so maybe I have missed something with the avcodec_decode_audio4 ?

    If this snappet of code isn't enough, I can post the whole code, these are just the places in the code I think the problem would be :(

  • How to copy audio stream using FFMpeg API ( not a command line tool )

    12 août 2013, par Jindong Jung

    I'm developing some Video Editing Apps on Android.

    the objective of the app is "Editing Videos on Android".

    and...

    I'm just completed making video file using some images.
    but.. I can't attach audio into the video.

    my method is same as follows.

    1.VideoStream, audio stream creation using AVFormatContext

    2.Movie encoding in video stream was successful

    3.Encode codec open in audio stream was successful

    4.Set sample format to AV_SAMPLE_FMT_FLTP

    5.Sample rate and channel was set same as source audio

    6.Choose appropriate Decoder and read packet

    7.Convert packets using swr_converter, setting same as sample format

    8.Encode converted data

    9.memory deallocation

    10.END !


    Problem is here :

    Video of finally created video file was normally played. but the Audio wasn't.

    It heared like weird. It have many noises and plays slowly.

    I've googled with many keywords but they only say about "FFmpeg command line usage".

    I wanna make with FFMpeg API. not a Command line tool.

    Please help.

  • Best way of playing mkv video that is being recorded with ffmpeg in web browser

    17 juin 2017, par martin49

    I’m looking for a way to play a video that is being recorded with ffmpeg in a web browser preferably using HTML5 video tag.

    I have this code in my page, the URL is pointing to a video file (example.mkv) that is being recorded by ffmpeg.

    <video class="video-player" controls="controls" loop="loop">          
               <source src="{{asset('example.mkv')}}" type="video/mp4">
               <p>Your browser does not support H.264/MP4.</p>
    </source></video>

    Google Chrome/Chromium can play mkv video in HTML5, but only plays the part that was loaded when page was loaded. Is it possible to continue to load the video while it is being recorded ?