Recherche avancée

Médias (2)

Mot : - Tags -/map

Autres articles (111)

  • Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs

    12 avril 2011, par

    La manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
    Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras.

  • Script d’installation automatique de MediaSPIP

    25 avril 2011, par

    Afin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
    Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
    La documentation de l’utilisation du script d’installation (...)

  • Que fait exactement ce script ?

    18 janvier 2011, par

    Ce script est écrit en bash. Il est donc facilement utilisable sur n’importe quel serveur.
    Il n’est compatible qu’avec une liste de distributions précises (voir Liste des distributions compatibles).
    Installation de dépendances de MediaSPIP
    Son rôle principal est d’installer l’ensemble des dépendances logicielles nécessaires coté serveur à savoir :
    Les outils de base pour pouvoir installer le reste des dépendances Les outils de développements : build-essential (via APT depuis les dépôts officiels) ; (...)

Sur d’autres sites (6983)

  • avcodec/avcodec : Use dedicated pointer to access AVCodecInternal

    21 mars 2021, par Andreas Rheinhardt
    avcodec/avcodec : Use dedicated pointer to access AVCodecInternal
    

    Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@gmail.com>

    • [DH] libavcodec/avcodec.c
  • crossorigin header in php is not working after previous php exec ffmpeg command

    17 avril 2022, par ivyyeziyang

    I am using php exec function to execute a FFMPEG command, but I am also using Javascript to send the request and they are cross origin requests, but after the exec command, while I start to send next cross origin request, it shows&#xA;Access to XMLHttpRequest at 'https://www..com:550/api/adminapi' from origin 'https://www..com:8081' has been blocked by CORS policy : No 'Access-Control-Allow-Origin' header is present on the requested resource.&#xA;which means the cross origin header is not working in the next cross origin request after exec command,&#xA;below is the code :

    &#xA;

    if (isset($_POST[&#x27;crossorigin&#x27;])) {&#xA;$crossoriginallow = array();&#xA;$crossoriginallow = [&#xA;&#x27;https://www.***.com:8080&#x27;, &#xA;&#x27;https://www.***.com:8081&#x27;, &#xA;&#x27;https://www.***.com:8082&#x27;];&#xA;for ($i = 0; $i &lt; sizeof($crossoriginallow); $i&#x2B;&#x2B;) {&#xA;if ($crossoriginallow[$i] == $_POST[&#x27;crossorigin&#x27;]) {&#xA;  $crossorigin = $_POST[&#x27;crossorigin&#x27;];&#xA;  break;&#xA;  }&#xA;}&#xA;header("Access-Control-Allow-Origin:$crossorigin");&#xA;header("Access-Control-Allow-Methods:GET, POST, OPTIONS, DELETE");&#xA;header("Access-Control-Allow-Headers:DNT,X-Mx-ReqToken,Keep- &#xA;Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache- &#xA;Control,Content-Type, Accept-Language, Origin, Accept-Encoding");&#xA;}&#xA;&#xA;exec("ffmpeg -i " . $infilepath . " -c:v mpeg4 -preset veryslow - &#xA; c:a mp3 -q 0 " . $outfilepath /* . " 2>&amp;1" *//* , $out */);&#xA;&#xA; $infilepathsep = explode(&#x27;/&#x27;, $infilepath);&#xA; $folderpath = &#x27;&#x27;;&#xA; for ($i = 0; $i &lt; sizeof($infilepathsep) - 1; $i&#x2B;&#x2B;) {&#xA; $folderpath = $folderpath . $infilepathsep[$i];&#xA; $folderpath = $folderpath . &#x27;/&#x27;;&#xA;}&#xA;&#xA; $opendirhandle = opendir($folderpath);&#xA; closedir($opendirhandle);&#xA; $openfilehandle = fopen($infilepath, &#x27;r&#x27;);&#xA; fclose($openfilehandle);&#xA; unlink(iconv("utf-8", "gbk", $infilepath));&#xA; $result[&#x27;data&#x27;] = $outfilepath;&#xA; $result[&#x27;msg&#x27;] = &#x27;success&#x27;;&#xA; $jsonresult = json_encode($result);&#xA; echo $jsonresult;&#xA; ob_get_contents();&#xA; ob_end_flush();&#xA;

    &#xA;

    I does not encounter this problem before using the same code,but after I reinstall the computer it happens, May I please ask the reason if you know the problem ? Thank you very much for your help !

    &#xA;

  • How do I use FFMPEG/libav to access the data in individual audio samples ?

    15 octobre 2022, par Breadsnshreds

    The end result is I'm trying to visualise the audio waveform to use in a DAW-like software. So I want to get each sample's value and draw it. With that in mind, I'm currently stumped by trying to gain access to the values stored in each sample. For the time being, I'm just trying to access the value in the first sample - I'll build it into a loop once I have some working code.

    &#xA;

    I started off by following the code in this example. However, LibAV/FFMPEG has been updated since then, so a lot of the code is deprecated or straight up doesn't work the same anymore.

    &#xA;

    Based on the example above, I believe the logic is as follows :

    &#xA;

      &#xA;
    1. get the formatting info of the audio file
    2. &#xA;

    3. get audio stream info from the format
    4. &#xA;

    5. check that the codec required for the stream is an audio codec
    6. &#xA;

    7. get the codec context (I think this is info about the codec) - This is where it gets kinda confusing for me
    8. &#xA;

    9. create an empty packet and frame to use - packets are for holding compressed data and frames are for holding uncompressed data
    10. &#xA;

    11. the format reads the first frame from the audio file into our packet
    12. &#xA;

    13. pass that packet into the codec context to be decoded
    14. &#xA;

    15. pass our frame to the codec context to receive the uncompressed audio data of the first frame
    16. &#xA;

    17. create a buffer to hold the values and try allocating samples to it from our frame
    18. &#xA;

    &#xA;

    From debugging my code, I can see that step 7 succeeds and the packet that was empty receives some data. In step 8, the frame doesn't receive any data. This is what I need help with. I get that if I get the frame, assuming a stereo audio file, I should have two samples per frame, so really I just need your help to get uncompressed data into the frame.

    &#xA;

    I've scoured through the documentation for loads of different classes and I'm pretty sure I'm using the right classes and functions to achieve my goal, but evidently not (I'm also using Qt, so I'm using qDebug throughout, and QString to hold the URL for the audio file as path). So without further ado, here's my code :

    &#xA;

    // Step 1 - get the formatting info of the audio file&#xA;    AVFormatContext* format = avformat_alloc_context();&#xA;    if (avformat_open_input(&amp;format, path.toStdString().c_str(), NULL, NULL) != 0) {&#xA;        qDebug() &lt;&lt; "Could not open file " &lt;&lt; path;&#xA;        return -1;&#xA;    }&#xA;&#xA;// Step 2 - get audio stream info from the format&#xA;    if (avformat_find_stream_info(format, NULL) &lt; 0) {&#xA;        qDebug() &lt;&lt; "Could not retrieve stream info from file " &lt;&lt; path;&#xA;        return -1;&#xA;    }&#xA;&#xA;// Step 3 - check that the codec required for the stream is an audio codec&#xA;    int stream_index =- 1;&#xA;    for (unsigned int i=0; inb_streams; i&#x2B;&#x2B;) {&#xA;        if (format->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {&#xA;            stream_index = i;&#xA;            break;&#xA;        }&#xA;    }&#xA;&#xA;    if (stream_index == -1) {&#xA;        qDebug() &lt;&lt; "Could not retrieve audio stream from file " &lt;&lt; path;&#xA;        return -1;&#xA;    }&#xA;&#xA;// Step 4 -get the codec context&#xA;    const AVCodec *codec = avcodec_find_decoder(format->streams[stream_index]->codecpar->codec_id);&#xA;    AVCodecContext *codecContext = avcodec_alloc_context3(codec);&#xA;    avcodec_open2(codecContext, codec, NULL);&#xA;&#xA;// Step 5 - create an empty packet and frame to use&#xA;    AVPacket *packet = av_packet_alloc();&#xA;    AVFrame *frame = av_frame_alloc();&#xA;&#xA;// Step 6 - the format reads the first frame from the audio file into our packet&#xA;    av_read_frame(format, packet);&#xA;// Step 7 - pass that packet into the codec context to be decoded&#xA;    avcodec_send_packet(codecContext, packet);&#xA;//Step 8 - pass our frame to the codec context to receive the uncompressed audio data of the first frame&#xA;    avcodec_receive_frame(codecContext, frame);&#xA;&#xA;// Step 9 - create a buffer to hold the values and try allocating samples to it from our frame&#xA;    double *buffer;&#xA;    av_samples_alloc((uint8_t**) &amp;buffer, NULL, 1, frame->nb_samples, AV_SAMPLE_FMT_DBL, 0);&#xA;    qDebug () &lt;&lt; "packet: " &lt;&lt; &amp;packet;&#xA;    qDebug() &lt;&lt; "frame: " &lt;&lt;  frame;&#xA;    qDebug () &lt;&lt; "buffer: " &lt;&lt; buffer;&#xA;

    &#xA;

    For the time being, step 9 is incomplete as you can probably tell. But for now, I need help with step 8. Am I missing a step, using the wrong function, wrong class ? Cheers.

    &#xA;