Recherche avancée

Médias (33)

Mot : - Tags -/creative commons

Autres articles (99)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

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

Sur d’autres sites (11648)

  • Trying to open file with PHP-FFMpeg after it was encoded once

    19 mai 2016, par Shillo Ben David

    in the same PHP process I’m trying to open a file that was manipulated and saved, and then I’m trying to open it with as a new FFMpeg\Video. For example, in the same process :

    Open -> original.MOV
     Manipulate & save to -> new.mp4
       Open -> new.mp4

    However when I’m trying to open the manipulated file I get this InvalidArgumentException exception :

    InvalidArgumentException: Unable to detect file format, only audio and video supported

    It’s thrown by the FFMpeg::open() after it could not detect that it’s a either Video or Audio stream.

    FFMpeg::open()

    public function open($pathfile)
    {
       if (null === $streams = $this->ffprobe->streams($pathfile)) {
           throw new RuntimeException(sprintf('Unable to probe "%s".', $pathfile));
       }

       if (0 < count($streams->videos())) {
           return new Video($pathfile, $this->driver, $this->ffprobe);
       } elseif (0 < count($streams->audios())) {
           return new Audio($pathfile, $this->driver, $this->ffprobe);
       }

       throw new InvalidArgumentException('Unable to detect file format, only audio and video supported');
    }

    The filters I applied to the video are audio mute and speedup (setpts).

    So I wonder, why FFMpeg doesn’t recognise it as video ?

  • C++ FFmpeg pitch issue

    24 janvier 2016, par David Andrei Norgren

    I’m using swr_convert to lower/raise the pitch of incoming audio and store it in a .mp3. To change the pitch, I’m dividing the out sample rate by a factor. However, the resulting audio is slightly distorted when this factor is anything other than 1. Here’s my conversion code :

    ...

    // Set up resample context
    swrContext = swr_alloc();
    if (!swrContext)
       throw -15;

    av_opt_set_int(swrContext, "in_channel_count", codecContext->channels, 0);
    av_opt_set_int(swrContext, "in_channel_layout", codecContext->channel_layout, 0);
    av_opt_set_int(swrContext, "in_sample_rate", codecContext->sample_rate, 0);
    av_opt_set_sample_fmt(swrContext, "in_sample_fmt", codecContext->sample_fmt, 0);

    av_opt_set_int(swrContext, "out_channel_count", STREAM_AUDIO_CHANNELS, 0);
    av_opt_set_int(swrContext, "out_channel_layout", STREAM_AUDIO_CHANNEL_LAYOUT, 0);
    av_opt_set_int(swrContext, "out_sample_rate", STREAM_AUDIO_SAMPLE_RATE / pitch, 0);
    av_opt_set_sample_fmt(swrContext, "out_sample_fmt", STREAM_AUDIO_SAMPLE_FORMAT_GM, 0);

    if (swr_init(swrContext))
       throw -16;

    // Allocate re-usable frame
    frameDecoded = av_frame_alloc();
    if (!frameDecoded)
       throw -17;

    frameDecoded->format = codecContext->sample_fmt;
    frameDecoded->channel_layout = codecContext->channel_layout;
    frameDecoded->channels = codecContext->channels;
    frameDecoded->sample_rate = codecContext->sample_rate;

    // Load frames
    inPacket.data = NULL;
    inPacket.size = 0;

    int gotFrame, samples = 0;

    while (av_read_frame(formatContext, &inPacket) >= 0) {

       if (inPacket.stream_index != streamId)
           continue;

       if (avcodec_decode_audio4(codecContext, frameDecoded, &gotFrame, &inPacket) < 0)
           throw -18;

       if (!gotFrame)
           continue;

       // Begin conversion
       if (swr_convert(swrContext, NULL, 0, (const uint8_t **)frameDecoded->data, frameDecoded->nb_samples) < 0)
           throw -19;

       while (swr_get_out_samples(swrContext, 0) >= RAW_AUDIO_FRAME_SIZE) {

           // Allocate data
           uint8_t **convertedData = NULL;
           if (av_samples_alloc_array_and_samples(&convertedData, NULL, STREAM_AUDIO_CHANNELS, RAW_AUDIO_FRAME_SIZE, STREAM_AUDIO_SAMPLE_FORMAT_GM, 0) < 0)
               throw -20;

           // Convert
           if (swr_convert(swrContext, convertedData, RAW_AUDIO_FRAME_SIZE, NULL, 0) < 0)
               throw -21;

           // Calculate buffer size
           size_t bufferSize = av_samples_get_buffer_size(NULL, STREAM_AUDIO_CHANNELS, RAW_AUDIO_FRAME_SIZE, STREAM_AUDIO_SAMPLE_FORMAT_GM, 0);
           if (bufferSize < 0)
               throw -22;

           fwrite(convertedData[0], 1, bufferSize, outStream);
           av_free(convertedData);
       }
    }

    ...

    STREAM_AUDIO_SAMPLE_RATE is defined as 44100.
    Here’s the entire program if it helps : http://pastebin.com/5akEwNg4

    The program generates a .mp3 with 25 notes that decrease in pitch.
    Here’s an example of the distortion : http://www.stuffbydavid.com/dl/30256478.mp3

    Can you spot anything incorrect about my conversion, or is my method of changing the pitch incorrect ? Is there another way ?

  • FFmpeg watermark duration

    4 mai 2016, par user2364292

    I am developing an Android app, which will work with FFmpeg library which only applies multiple watermarks on some test.mp4 video. For that case I am using the Android java library for FFmpeg binary from that source : [http://writingminds.github.io/ffmpeg-android-java/] which is working fine for some examples, but I just can not use commands like these :

    -i /storage/emulated/0/Download/test.mp4 -vf "movie=/storage/emulated/0/Download/test.mp4 [logo]; [in][logo] overlay=W-w-10:H-h-10, fade=in:0:20 [out]" /storage/emulated/0/Download/test.mp4

    Please note these quotes after -vf flag and these [in], [logo] flags. These just throw me an errors like

    [NULL @ 0xb5bf3200] Unable to find a suitable output format for '[logo];'
    [logo];: Invalid argument

    and so on. The quotes in the command are also the problem which throws me an error like :

    [AVFilterGraph @ 0xb5c092c0] No such filter: 'overlay=main_w-50:main_h-50,overlay=0:0'
    Error initializing complex filters.
    Invalid argument".

    Am I even using proper library for that case ? I also want to show the watermark in specific duration of the video. For example if video is 10 seconds long, I only want watermark to be shown starting from 3rd second of the video to 7th second. I can show the overlay images like this :

    -i /storage/emulated/0/Download/test.mp4 -i /storage/emulated/0/Download/test.jpg -i /storage/emulated/0/Download/test.jpg -filter_complex overlay=main_w-50:main_h-50,overlay=0:0 -codec:a copy /storage/emulated/0/Download/test_edited.mp4

    but they’re shown for the whole video duration. Where can I set the duration start/end for the specific overlay ?

    Thank you very much !