Recherche avancée

Médias (1)

Mot : - Tags -/école

Autres articles (74)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

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

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

Sur d’autres sites (14681)

  • ffmpeg encoded h.264 frame rate is slightly wrong

    26 juillet 2021, par Timmmm

    I have some code to encode video to an MP4/H.264 file. It's basically the same as this example but encoding to MP4/H.264 with no audio.

    


    I set the time_base/framerate like this :

    


        codecContext->time_base = AVRational{1, 30};
    codecContext->framerate = AVRational{30, 1};
...
    stream->time_base = codecContext->time_base;


    


    And it all works fine (the quality is terrible but that's another issue). However the weird thing is that the frame rate comes out at 30.303030, not 30. VLC and ffmpeg itself both confirmed this.

    


    30.303030 is 30 * 100/99 but I can't see why that would ever happen.

    


    I did find a few other people reporting this odd frame rate here, here and here but nobody seems to have worked out why.

    


    What's up with that frame rate ?

    


    Edit : One of those questions led me to MediaInfo, which actually does report the frame rate as 30.000 FPS, whereas FFMPEG reports 30.30, which is presumably rounded from VLC's value of 30.303030.

    


    Edit 2 : Aha ! I think it's because I encode exactly 100 frames. I wonder if VLC and ffmpeg calculate the frame rate by dividing the total number of frames by the difference between the presentation times of the first and last frames. That would definitely yield 30.303030 :

    


    100 / (99/30 - 0/30) = 30.303030

    


    I confirmed this by encoding 200 frames and the frame rate changes to 30.15. So this is possibly just a bug in the frame rate calculation of VLC and ffmpeg.

    


  • PHP $_FILE Temp Location open_basedir Conflict PHP-FPM/Nginx

    16 septembre 2017, par xendi

    I have a script for uploading files to my site. It works great but now I’m wanting to extract meta data from video files using the ffmpeg/ffprobe library. My code :

    if (!empty($_FILES)) {
               $requestAr = requestCheck(['title', 'description']);
               $assetName = randomString(11);
               $assetSalt = randomString(3);

               $bucket = "videos";
               $fileTmpPath = $_FILES['qqfile']['tmp_name'];
               $filenameOrig = $_FILES['qqfile']['name'];
               $fileExtension = pathinfo($filenameOrig, PATHINFO_EXTENSION);
               $assetFilename = $assetName . "_$assetSalt.$fileExtension";

               $trustedExtensions = ['webm', 'mp4', 'ogg'];
               if(array_search($fileExtension, $trustedExtensions) !== false) {
                   $ffprobe = FFMpeg\FFProbe::create([
                       'ffprobe.binaries' => '/usr/bin/ffprobe'
                   ]);
                   $fileInfo = $ffprobe
                       ->format($fileTmpPath) // extracts file informations
                       ->get('duration');             // returns the duration property
                   print_r($fileInfo);
               }
    }

    I wind up with this error :

    file_exists(): open_basedir restriction in effect. File(/usr/bin/ffprobe) is not within the allowed path(s): <lists all="all" the="the" directories="directories" in="in" variable="variable">
    </lists>

    I have passed the ffmpeg library the absolute path to ffprobe so it knows where it is. I was searching around and some people were saying this is because the lib can’t access the tmp directory with the uploaded file. In either case, I’ve been trying to disable open_basedir or at least add the paths I need to it to get this to work.

    I tried setting open_basedir to none in my php.ini but it didn’t work. When I view phpinfo(), it still lists a bunch of paths for that setting. I tried to grep where open_basedir exists on the server. Indeed, it’s the php.ini files and I shouldn’t need to modify any other than the one reported in phpinfo().

  • How to apply audio equalization using NAudio

    19 mai 2021, par Raheel Khan

    I have a WPF app that does the following :

    &#xA;

      &#xA;
    1. Imports video files.
    2. &#xA;

    3. Extracts audio from the using FFmpeg.
    4. &#xA;

    5. Resamples the audio using NAudio to conform to a Speech-to-Text engine (16kHz/16bit/Mono).
    6. &#xA;

    7. Plays back the video for users with overlayed subtitles.
    8. &#xA;

    9. Allows users to correct mistakes that the STT engine might have made.
    10. &#xA;

    &#xA;

    Simple resampling with NAudio :

    &#xA;

    using (var reader = new WaveFileReader(fileAudioTemp.FullName))&#xA;{&#xA;    var outFormat = new WaveFormat(16000, 16, 1);&#xA;    //var outFormat = WaveFormat.CreateIeeeFloatWaveFormat(16000, 1);&#xA;&#xA;    using (var resampler = new MediaFoundationResampler(reader, outFormat))&#xA;    {&#xA;        resampler.ResamplerQuality = 60; // Highest Quality in MF.&#xA;        WaveFileWriter.CreateWaveFile(fileAudio.FullName, resampler);&#xA;    }&#xA;}&#xA;

    &#xA;

    The problem is that these videos have extremely bad audio quality. The sound is muffled, bassy, and makes it very difficult to make out names of people, places, etc. This makes it difficult and time-consuming for users to proof the text. Please do note that the STT engine has no problem with this and is surprisingly accurate considering the quality.

    &#xA;

    What I would like to do is apply an equalization present to this audio. I found that the built-in SKA preset in VLC seems to make it 'slightly' easier for users to understand what is being said.

    &#xA;

    VLC Equalizer Settings

    &#xA;

    Is there a way to use either FFmpeg (Xabe) or preferably NAudio to apply such a filter ? Is so how ? I have seen many examples out there about manipulation of sound buffers but was looking for an easier way such as a preset file or parameters that could be passed into the resamplers.

    &#xA;

    Any pointers would be appreciated.

    &#xA;