Recherche avancée

Médias (91)

Autres articles (23)

  • (Dés)Activation de fonctionnalités (plugins)

    18 février 2011, par

    Pour gérer l’ajout et la suppression de fonctionnalités supplémentaires (ou plugins), MediaSPIP utilise à partir de la version 0.2 SVP.
    SVP permet l’activation facile de plugins depuis l’espace de configuration de MediaSPIP.
    Pour y accéder, il suffit de se rendre dans l’espace de configuration puis de se rendre sur la page "Gestion des plugins".
    MediaSPIP est fourni par défaut avec l’ensemble des plugins dits "compatibles", ils ont été testés et intégrés afin de fonctionner parfaitement avec chaque (...)

  • Le plugin : Podcasts.

    14 juillet 2010, par

    Le problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
    Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
    Types de fichiers supportés dans les flux
    Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...)

  • Other interesting software

    13 avril 2011, par

    We don’t claim to be the only ones doing what we do ... and especially not to assert claims to be the best either ... What we do, we just try to do it well and getting better ...
    The following list represents softwares that tend to be more or less as MediaSPIP or that MediaSPIP tries more or less to do the same, whatever ...
    We don’t know them, we didn’t try them, but you can take a peek.
    Videopress
    Website : http://videopress.com/
    License : GNU/GPL v2
    Source code : (...)

Sur d’autres sites (6677)

  • Anomalie #3921 : verifier url site

    23 mars 2017, par jluc -

    Oui, super ! ça marche bien avec demo.spip.net

    ou bien au choix :

    Oui, désolé ! excusez le dérangement...

  • FFMPEG AAC encoding causes audio to be lower in pitch

    14 février 2017, par Paul Knopf

    I built a sample application that encodes AAC (from PortAudio) into a MP4 container (no video stream).

    The resulting audio is lower in pitch.

    #include "stdafx.h"
    #include "TestRecording.h"
    #include "libffmpeg.h"

    TestRecording::TestRecording()
    {
    }


    TestRecording::~TestRecording()
    {
    }

    struct RecordingContext
    {
       RecordingContext()
       {
           formatContext = NULL;
           audioStream = NULL;
           audioFrame = NULL;
           audioFrameframeNumber = 0;
       }

       libffmpeg::AVFormatContext* formatContext;
       libffmpeg::AVStream* audioStream;
       libffmpeg::AVFrame* audioFrame;
       int audioFrameframeNumber;
    };

    static int AudioRecordCallback(const void *inputBuffer, void *outputBuffer,
       unsigned long framesPerBuffer,
       const PaStreamCallbackTimeInfo* timeInfo,
       PaStreamCallbackFlags statusFlags,
       void *userData)
    {
       RecordingContext* recordingContext = (RecordingContext*)userData;

       libffmpeg::avcodec_fill_audio_frame(recordingContext->audioFrame,
           recordingContext->audioFrame->channels,
           recordingContext->audioStream->codec->sample_fmt,
           static_cast<const unsigned="unsigned">(inputBuffer),
           (framesPerBuffer * sizeof(float) * recordingContext->audioFrame->channels),
           0);

       libffmpeg::AVPacket pkt;
       libffmpeg::av_init_packet(&amp;pkt);
       pkt.data = NULL;
       pkt.size = 0;

       int gotpacket;
       int result = avcodec_encode_audio2(recordingContext->audioStream->codec, &amp;pkt, recordingContext->audioFrame, &amp;gotpacket);

       if (result &lt; 0)
       {
           LOGINT_WITH_MESSAGE(ERROR, result, "Couldn't encode the audio frame to acc");
           return paContinue;
       }

       if (gotpacket)
       {
           pkt.stream_index = recordingContext->audioStream->index;
           recordingContext->audioFrameframeNumber++;

           // this codec requires no bitstream filter, just send it to the muxer!
           result = libffmpeg::av_write_frame(recordingContext->formatContext, &amp;pkt);
           if (result &lt; 0)
           {
               LOG(ERROR) &lt;&lt; "Couldn't write the encoded audio frame";
               libffmpeg::av_free_packet(&amp;pkt);
               return paContinue;
           }

           libffmpeg::av_free_packet(&amp;pkt);
       }

       return paContinue;
    }

    static bool InitializeRecordingContext(RecordingContext* recordingContext)
    {
       int result = libffmpeg::avformat_alloc_output_context2(&amp;recordingContext->formatContext, NULL, NULL, "C:\\Users\\Paul\\Desktop\\test.mp4");
       if (result &lt; 0)
       {
           LOGINT_WITH_MESSAGE(ERROR, result, "Couldn't create output format context");
           return false;
       }

       libffmpeg::AVCodec *audioCodec;
       audioCodec = libffmpeg::avcodec_find_encoder(libffmpeg::AV_CODEC_ID_AAC);
       if (audioCodec == NULL)
       {
           LOG(ERROR) &lt;&lt; "Couldn't find the encoder for AAC";
       }

       recordingContext->audioStream = libffmpeg::avformat_new_stream(recordingContext->formatContext, audioCodec);
       if (!recordingContext->audioStream)
       {
           LOG(ERROR) &lt;&lt; "Couldn't create the audio stream";
           return false;
       }

       recordingContext->audioStream->codec->bit_rate = 64000;
       recordingContext->audioStream->codec->sample_fmt = libffmpeg::AV_SAMPLE_FMT_FLTP;
       recordingContext->audioStream->codec->sample_rate = 48000;
       recordingContext->audioStream->codec->channel_layout = AV_CH_LAYOUT_STEREO;
       recordingContext->audioStream->codec->channels = libffmpeg::av_get_channel_layout_nb_channels(recordingContext->audioStream->codec->channel_layout);

       recordingContext->audioStream->codecpar->bit_rate = recordingContext->audioStream->codec->bit_rate;
       recordingContext->audioStream->codecpar->format = recordingContext->audioStream->codec->sample_fmt;
       recordingContext->audioStream->codecpar->sample_rate = recordingContext->audioStream->codec->sample_rate;
       recordingContext->audioStream->codecpar->channel_layout = recordingContext->audioStream->codec->channel_layout;
       recordingContext->audioStream->codecpar->channels = recordingContext->audioStream->codec->channels;

       result = libffmpeg::avcodec_open2(recordingContext->audioStream->codec, audioCodec, NULL);
       if (result &lt; 0)
       {
           LOGINT_WITH_MESSAGE(ERROR, result, "Couldn't open the audio codec");
           return false;
       }

       // create a new frame to store the audio samples
       recordingContext->audioFrame = libffmpeg::av_frame_alloc();
       if (!recordingContext->audioFrame)
       {
           LOG(ERROR) &lt;&lt; "Couldn't alloce the output audio frame";
           return false;
       }

       recordingContext->audioFrame->nb_samples = recordingContext->audioStream->codec->frame_size;
       recordingContext->audioFrame->channel_layout = recordingContext->audioStream->codec->channel_layout;
       recordingContext->audioFrame->channels = recordingContext->audioStream->codec->channels;
       recordingContext->audioFrame->format = recordingContext->audioStream->codec->sample_fmt;
       recordingContext->audioFrame->sample_rate = recordingContext->audioStream->codec->sample_rate;

       result = libffmpeg::av_frame_get_buffer(recordingContext->audioFrame, 0);
       if (result &lt; 0)
       {
           LOG(ERROR) &lt;&lt; "Coudln't initialize the output audio frame buffer";
           return false;
       }

       // some formats want video_stream headers to be separate  
       if (!strcmp(recordingContext->formatContext->oformat->name, "mp4") || !strcmp(recordingContext->formatContext->oformat->name, "mov") || !strcmp(recordingContext->formatContext->oformat->name, "3gp"))
       {
           recordingContext->audioStream->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
       }

       // open the ouput file
       if (!(recordingContext->formatContext->oformat->flags &amp; AVFMT_NOFILE))
       {
           result = libffmpeg::avio_open(&amp;recordingContext->formatContext->pb, recordingContext->formatContext->filename, AVIO_FLAG_WRITE);
           if (result &lt; 0)
           {
               LOGINT_WITH_MESSAGE(ERROR, result, "Couldn't open the output file");
               return false;
           }
       }

       // write the stream headers
       result = libffmpeg::avformat_write_header(recordingContext->formatContext, NULL);
       if (result &lt; 0)
       {
           LOGINT_WITH_MESSAGE(ERROR, result, "Couldn't write the headers to the file");
           return false;
       }

       return true;
    }

    static bool FinalizeRecordingContext(RecordingContext* recordingContext)
    {
       int result = 0;

       // write the trailing information
       if (recordingContext->formatContext->pb)
       {
           result = libffmpeg::av_write_trailer(recordingContext->formatContext);
           if (result &lt; 0)
           {
               LOGINT_WITH_MESSAGE(ERROR, result, "Couldn't write the trailer information");
               return false;
           }
       }

       // close all the codes
       for (int i = 0; i &lt; (int)recordingContext->formatContext->nb_streams; i++)
       {
           result = libffmpeg::avcodec_close(recordingContext->formatContext->streams[i]->codec);
           if (result &lt; 0)
           {
               LOGINT_WITH_MESSAGE(ERROR, result, "Couldn't close the codec");
               return false;
           }
       }

       // close the output file
       if (recordingContext->formatContext->pb)
       {
           if (!(recordingContext->formatContext->oformat->flags &amp; AVFMT_NOFILE))
           {
               result = libffmpeg::avio_close(recordingContext->formatContext->pb);
               if (result &lt; 0)
               {
                   LOGINT_WITH_MESSAGE(ERROR, result, "Couldn't close the output file");
                   return false;
               }
           }
       }

       // free the format context and all of its data
       libffmpeg::avformat_free_context(recordingContext->formatContext);

       recordingContext->formatContext = NULL;
       recordingContext->audioStream = NULL;

       if (recordingContext->audioFrame)
       {
           libffmpeg::av_frame_free(&amp;recordingContext->audioFrame);
           recordingContext->audioFrame = NULL;
       }

       return true;
    }

    int TestRecording::Test()
    {
       PaError result = paNoError;

       result = Pa_Initialize();
       if (result != paNoError) LOGINT_WITH_MESSAGE(ERROR, result, "Error initializing audio device framework");

       RecordingContext recordingContext;
       if (!InitializeRecordingContext(&amp;recordingContext))
       {
           LOG(ERROR) &lt;&lt; "Couldn't start recording file";
           return 0;
       }

       auto defaultDevice = Pa_GetDefaultInputDevice();
       auto deviceInfo = Pa_GetDeviceInfo(defaultDevice);

       PaStreamParameters  inputParameters;
       inputParameters.device = defaultDevice;
       inputParameters.channelCount = 2;
       inputParameters.sampleFormat = paFloat32;
       inputParameters.suggestedLatency = deviceInfo->defaultLowInputLatency;
       inputParameters.hostApiSpecificStreamInfo = NULL;

       PaStream* stream = NULL;
       result = Pa_OpenStream(
           &amp;stream,
           &amp;inputParameters,
           NULL,
           48000,
           1024,
           paClipOff,
           AudioRecordCallback,
           &amp;recordingContext);
       if (result != paNoError)LOGINT_WITH_MESSAGE(ERROR, result, "Couldn't open the audio stream");

       result = Pa_StartStream(stream);
       if (result != paNoError)LOGINT_WITH_MESSAGE(ERROR, result, "Couldn't start the audio stream");

       Sleep(1000 * 5);

       result = Pa_StopStream(stream);
       if (result != paNoError)LOGINT_WITH_MESSAGE(ERROR, result, "Couldn't stop the audio stream");

       if (!FinalizeRecordingContext(&amp;recordingContext)) LOG(ERROR) &lt;&lt; "Couldn't stop recording file";

       result = Pa_CloseStream(stream);
       if (result != paNoError)LOGINT_WITH_MESSAGE(ERROR, result, "Couldn't stop the audio stream");

       return 0;
    }
    </const>

    Here is the stdout, in case it helps.

    https://gist.github.com/pauldotknopf/9f24a604ce1f8a081aa68da1bf169e98

    Why is the audio lower in pitch ? I assume I am overlooking a parameter that needs to be configured between PortAudio and FFMPEG. Is there something super obvious that I am missing ?

  • Documentation #3878 (Fermé) : generer_url_action() ne prend pas de tableau comme argument

    7 février 2017, par b b

    Super, merci, on ferme :)