Recherche avancée

Médias (91)

Autres articles (51)

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

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

Sur d’autres sites (4313)

  • c++ avformat_open_input returns empty codec, width and height

    27 février 2019, par Victor Akhlynin

    I haven’t ever used ffmpeg on my own laptop. All’s ok at work, but here I met an ugly problem : library works but helpless :)
    Ubuntu 18.04, ffmpeg 4.1 (downloaded sources, ./configure, make, sudo make install), it seems to be ok.

    Application returns :
    File /home/ahlininv/Desktop/video_example.mp4 is encodec with ’’ codec, w = 0, h = 0

    I ran it under debugger. If I set format to zero, pointer changes after calling avformat_open_input(&format, file, 0, &dict), so it works and maybe works correct.

    Maybe it plays any role that compiler says that av_register_all, avcodec_register_all are deprecated, but I thought it’s not significant problem.

    I tried to change version of ffmpeg (tried to install it with apt-get, version 3.somenumber is available), nothing changed.

    I tried to run another video file (.avi), nothing changed, too.

    Guys, help=) How to this file’s info correctly ?

    main.cpp :

    #include "filereader.h"

    int main(int argc, char** argv) {

       std::string filename = "/home/ahlininv/Desktop/video_example.mp4";

       std::string codec;
       int w, h;
       bool open_ok = get_file_info(filename.c_str(), codec, w, h);
       if (!open_ok) {
           std::cout << "Failed to open file" << "\n";
           return 1;
       }

       std::cout << "File " << filename << " is encoded with '" << codec << "' codec, w = " << w << ", h = " << h << "\n";

       return 0;
    }

    filereader.h :

    #ifndef FILEREADER_H
    #define FILEREADER_H

    #include <string>
    #include <iostream>

    extern "C" {
    #ifndef __STDC_CONSTANT_MACROS
    #define __STDC_CONSTANT_MACROS
    #endif
    #include "libavcodec/avcodec.h"
    #include <libavformat></libavformat>avformat.h>
    #include <libavutil></libavutil>avutil.h>
    }

    bool get_file_info(const char* file, std::string&amp; codec, int&amp; w, int&amp; h);

    #endif // FILEREADER_H
    </iostream></string>

    filereader.cpp

    #include "filereader.h"


    bool get_file_info(const char* file, std::string&amp; codec, int&amp; w, int&amp; h)
    {
       codec = "";
       w = h = 0;

       av_register_all();
       avcodec_register_all();

       AVDictionary* dict = 0;
       AVFormatContext* format = avformat_alloc_context();

       char errbuf[256];
       int r = avformat_open_input(&amp;format, file, 0, &amp;dict);
       if (r!=0){
           av_strerror(r, errbuf, sizeof(errbuf));
           std::cout &lt;&lt; "avformat_open_input error: " &lt;&lt; errbuf &lt;&lt; "\n";
       }

       if (r == AVERROR(EIO) || r == AVERROR(ENOEXEC) || !format)
           return false;

       for (size_t c = 0; c &lt; format->nb_streams; ++c)
       {
           if (format->streams[c]->codecpar &amp;&amp; format->streams[c]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO)
           {
               if (format->streams[c]->codecpar->codec_id != AV_CODEC_ID_NONE &amp;&amp;
                       format->streams[c]->codecpar->codec_id != AV_CODEC_ID_RAWVIDEO)
               {
                   w = format->streams[c]->codecpar->width;
                   h = format->streams[c]->codecpar->height;
                   codec = avcodec_get_name(format->streams[c]->codecpar->codec_id);
               }
           }
       }
       avformat_close_input(&amp;format);
       return true;
    }

    Compile :

    g++ -o filereader main.cpp filereader.cpp -lavutil -lavformat -lavcodec -lavdevice -lz -lm -pthread -lswresample -lm -lz -I /usr/local/include/ -Wl,-rpath /usr/lib/x86_64-linux-gnu/
  • Feed output of one filter to the input of one filter multiple times with ffmpeg

    27 août 2021, par kentcdodds

    I have the following ffmpeg commands to create a podcast episode :

    &#xA;

    # remove all silence at start and end of the audio files&#xA;ffmpeg -i call.mp3 -af silenceremove=1:0:-50dB call1.mp3&#xA;ffmpeg -i response.mp3 -af silenceremove=1:0:-50dB response1.mp3&#xA;&#xA;# remove silence longer than 1 second anywhere within the audio files&#xA;ffmpeg -i call1.mp3 -af silenceremove=stop_periods=-1:stop_duration=1:stop_threshold=-50dB call2.mp3&#xA;ffmpeg -i response1.mp3 -af silenceremove=stop_periods=-1:stop_duration=1:stop_threshold=-50dB response2.mp3&#xA;&#xA;# normalize audio files&#xA;ffmpeg -i call2.mp3 -af loudnorm=I=-16:LRA=11:TP=0.0 call3.mp3&#xA;ffmpeg -i response2.mp3 -af loudnorm=I=-16:LRA=11:TP=0.0 response3.mp3&#xA;&#xA;# cross fade audio files with intro/interstitial/outro&#xA;ffmpeg -i intro.mp3 -i call3.mp3 -i interstitial.mp3 -i response3.mp3 -i outro.mp3&#xA;  -filter_complex "[0][1]acrossfade=d=1:c2=nofade[a01];&#xA;                   [a01][2]acrossfade=d=1:c1=nofade[a02];&#xA;                   [a02][3]acrossfade=d=1:c2=nofade[a03];&#xA;                   [a03][4]acrossfade=d=1:c1=nofade"&#xA;  output.mp3&#xA;

    &#xA;

    While this "works" fine, I can't help but feel like it would be more efficient to do this all in one ffmpeg command. Based on what I found online this should be possible, but I don't understand the syntax well enough to know how to make it work. Here's what I tried :

    &#xA;

    ffmpeg -i intro.mp3 -i call.mp3 -i interstitial.mp3 -i response.mp3 -i outro.mp3&#xA;       -af [1]silenceremove=1:0:-50dB[trimmedCall]&#xA;       -af [3]silenceremove=1:0:-50dB[trimmedResponse]&#xA;       -af [trimmedCall]silenceremove=stop_periods=-1:stop_duration=1:stop_threshold=-50dB[noSilenceCall]&#xA;       -af [trimmedResponse]silenceremove=stop_periods=-1:stop_duration=1:stop_threshold=-50dB[noSilenceResponse]&#xA;       -af [noSilenceCall]loudnorm=I=-16:LRA=11:TP=0.0[call]&#xA;       -af [noSilenceResponse]loudnorm=I=-16:LRA=11:TP=0.0[response]&#xA;      -filter_complex "[0][call]acrossfade=d=1:c2=nofade[a01];&#xA;                       [a01][2]acrossfade=d=1:c1=nofade[a02];&#xA;                       [a02][response]acrossfade=d=1:c2=nofade[a03];&#xA;                       [a03][4]acrossfade=d=1:c1=nofade"&#xA;  output.mp3&#xA;

    &#xA;

    But I have a feeling I have a fundamental misunderstanding of this because I got this error which I don't understand :

    &#xA;

    Stream specifier &#x27;call&#x27; in filtergraph description &#xA;[0][call]acrossfade=d=1:c2=nofade[a01];&#xA;[a01][2]acrossfade=d=1:c1=nofade[a02];&#xA;[a02][response]acrossfade=d=1:c2=nofade[a03];&#xA;[a03][4]acrossfade=d=1:c1=nofade&#xA;       matches no streams.&#xA;

    &#xA;

    For added context, I'm running all these commands through @ffmpeg/ffmpeg so that last command actually looks like this (in JavaScript) :

    &#xA;

    await ffmpeg.run(&#xA;  &#x27;-i&#x27;, &#x27;intro.mp3&#x27;,&#xA;  &#x27;-i&#x27;, &#x27;call.mp3&#x27;,&#xA;  &#x27;-i&#x27;, &#x27;interstitial.mp3&#x27;,&#xA;  &#x27;-i&#x27;, &#x27;response.mp3&#x27;,&#xA;  &#x27;-i&#x27;, &#x27;outro.mp3&#x27;,&#xA;  &#x27;-af&#x27;, &#x27;[1]silenceremove=1:0:-50dB[trimmedCall]&#x27;,&#xA;  &#x27;-af&#x27;, &#x27;[3]silenceremove=1:0:-50dB[trimmedResponse]&#x27;,&#xA;  &#x27;-af&#x27;, &#x27;[trimmedCall]silenceremove=stop_periods=-1:stop_duration=1:stop_threshold=-50dB[noSilenceCall]&#x27;,&#xA;  &#x27;-af&#x27;, &#x27;[trimmedResponse]silenceremove=stop_periods=-1:stop_duration=1:stop_threshold=-50dB[noSilenceResponse]&#x27;,&#xA;  &#x27;-af&#x27;, &#x27;[noSilenceCall]loudnorm=I=-16:LRA=11:TP=0.0[call]&#x27;,&#xA;  &#x27;-af&#x27;, &#x27;[noSilenceResponse]loudnorm=I=-16:LRA=11:TP=0.0[response]&#x27;,&#xA;  &#x27;-filter_complex&#x27;, `&#xA;[0][call]acrossfade=d=1:c2=nofade[a01];&#xA;[a01][2]acrossfade=d=1:c1=nofade[a02];&#xA;[a02][response]acrossfade=d=1:c2=nofade[a03];&#xA;[a03][4]acrossfade=d=1:c1=nofade&#xA;  `,&#xA;  &#x27;output.mp3&#x27;,&#xA;)&#xA;

    &#xA;

  • oggdec : Support chained streams, support replacing streams in multistream files.

    16 janvier 2013, par Michael Niedermayer

    oggdec : Support chained streams, support replacing streams in multistream files.