Recherche avancée

Médias (39)

Mot : - Tags -/audio

Autres articles (34)

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

  • Librairies et binaires spécifiques au traitement vidéo et sonore

    31 janvier 2010, par

    Les logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
    Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
    Binaires complémentaires et facultatifs flvtool2 : (...)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

Sur d’autres sites (3683)

  • avcodec/jpeglsenc : Move check out of loop

    3 septembre 2020, par Andreas Rheinhardt
    avcodec/jpeglsenc : Move check out of loop
    

    ls_encode_line() encodes a line of input, going from left to right. In
    order to calculate a predicted value it uses the left and upper-left
    value of the output picture (that is, it uses how a decoder would see
    the already encoded part of the picture), unless this is the very first
    pixel of this line in which case one uses the first pixel of the last
    (upper) line and the line before the last line. Therefore the loop
    contained a check for whether this is the beginning of a new line. This
    commit moves said check out of the loop by initializing these values
    before the loop and by updating these values at the end of the loop
    body ; already read/calculated values are reused for this (the prediction
    also needs the value of the upper pixel and this can be reused for the
    upper left value of the next iteration of the loop).

    Reviewed-by : Paul B Mahol <onemda@gmail.com>
    Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@gmail.com>

    • [DH] libavcodec/jpeglsenc.c
  • Equalizers, bassboost and reverb effect not working (using FFmpegMediaPlayer)

    9 février 2018, par Arren

    I’m currently using FFmpegMediaPlayer from github and the effects are not working in the phone but works perfectly in the emulator which of both are the same API 22.

    The strange thing is that when I switch the code from FFmpegMediaplayer to standard android media player the effects start working again in the real phone device. But when I switch back to ffpmeg the effect only works in the emulator and not in the real device. My code is as below,

    public void setupVisualizerFxAndUI() {

       try {
           mVisualizer = new Visualizer(mMediaPlayer.getAudioSessionId());
           mEqualizer = new Equalizer(0, mMediaPlayer.getAudioSessionId());
           mEqualizer.setEnabled(true);

           try {
               bassBoost = new BassBoost(0, mMediaPlayer.getAudioSessionId());
               bassBoost.setEnabled(false);
               BassBoost.Settings bassBoostSettingTemp = bassBoost.getProperties();
               BassBoost.Settings bassBoostSetting = new BassBoost.Settings(bassBoostSettingTemp.toString());
               bassBoostSetting.strength = (1000 / 19);
               bassBoost.setProperties(bassBoostSetting);
               mMediaPlayer.setAuxEffectSendLevel(1.0f);

               presetReverb = new PresetReverb(0, mMediaPlayer.getAudioSessionId());
               presetReverb.setPreset(PresetReverb.PRESET_NONE);
               presetReverb.setEnabled(false);
               mMediaPlayer.setAuxEffectSendLevel(1.0f);
           } catch (Exception e) {
               e.printStackTrace();
           }

       } catch (Exception e) {
           e.printStackTrace();
       }

       if (homeActivity.isEqualizerEnabled) {
           try {
               bassBoost.setEnabled(true);
               BassBoost.Settings bassBoostSettingTemp = bassBoost.getProperties();
               BassBoost.Settings bassBoostSetting = new BassBoost.Settings(bassBoostSettingTemp.toString());
               if (homeActivity.bassStrength == -1) {
                   bassBoostSetting.strength = (1000 / 19);
               } else {
                   bassBoostSetting.strength = homeActivity.bassStrength;
               }
               bassBoost.setProperties(bassBoostSetting);
               mMediaPlayer.setAuxEffectSendLevel(1.0f);


               if (homeActivity.reverbPreset == -1) {
                   presetReverb.setPreset(PresetReverb.PRESET_NONE);
               } else {
                   presetReverb.setPreset(homeActivity.reverbPreset);
               }
               presetReverb.setEnabled(true);
               mMediaPlayer.setAuxEffectSendLevel(1.0f);

           } catch (Exception e) {
               e.printStackTrace();
           }
       }
       if (homeActivity.isEqualizerEnabled &amp;&amp; homeActivity.isEqualizerReloaded) {
           try {
               homeActivity.isEqualizerEnabled = true;
               int pos = homeActivity.presetPos;
               if (pos != 0) {
                   mEqualizer.usePreset((short) (pos - 1));
               } else {
                   for (short i = 0; i &lt; 5; i++) {
                       mEqualizer.setBandLevel(i, (short) homeActivity.seekbarpos[i]);
                   }
               }
               if (homeActivity.bassStrength != -1 &amp;&amp; homeActivity.reverbPreset != -1) {
                   bassBoost.setEnabled(true);
                   bassBoost.setStrength(homeActivity.bassStrength);
                   presetReverb.setEnabled(true);
                   presetReverb.setPreset(homeActivity.reverbPreset);
               }
               mMediaPlayer.setAuxEffectSendLevel(1.0f);

           } catch (Exception e) {
               e.printStackTrace();
           }
       }

    where mMediaPlayer is ffmpeg...Other than that the library is working fine in regards to streaming. The only problem is that it doesn’t get any effect put in. I thought this might be a coding problem so I just switched ffmpeg with Android standard media player like I mentioned above and it works. FFmpeg - bass boost and equalizer only works in the emulator and not in real phone device.

    Another strange thing was that the effect initially worked at first in debug run mode and stopped working after I signed the apk. From which point on it stopped working both in the debug as well as any other run modes i.e - release also....I’m not using any pro guard rules also.

    Points to note :
    1. Replacing FFmpegmediaplayer with Standard Media player the effects works.
    2. Effects worked before signing the apk then stopped working in all run modes
    3. Using the same code above for FFMpegmediaplayer effects only work in the
    Emulator and not in real device.
    4. Other than the effects problem, FFmpegmediaplayer is functional regarding
    streaming and local playback - in real phone device as well as emulator.

  • Ytdl-Core / FFMPEG in NodeJs : Cannot find a matching stream for unlabeled input pad 0 on filter Parsed_split_0

    25 mars 2023, par VenoM

    So I'm using ytdl-core & ffmpeg to convert some videos from YouTube to MP4 and then manipulate them in a way or take screenshots. But the issue I'm facing is - some videos are downloaded and are completely playable, but others are corrupt.

    &#xA;

    This is the error I get when I try to take screenshot of the corrupted video :

    &#xA;

    &#xA;

    Error : ffmpeg exited with code 1 : Cannot find a matching stream for unlabeled input pad 0 on filter Parsed_split_0

    &#xA;

    &#xA;

    And obviously, error is there because the video is corrupted, but WHY is that the case ?

    &#xA;

    Here's my code (read TL ;DR below) :

    &#xA;

      router.post("/screenshot", async (req, res) => {&#xA;  const urlToScreenshot = req.body.url;&#xA;  const timestamp = parseInt(req.body.t, 10);&#xA;  const YouTubeURL = `https://youtube.com/watch?v=${urlToScreenshot}`;&#xA;  const filename = uuidv4();&#xA;&#xA;  const videoPath = `${filePath}/${filename}.mp4`;&#xA;&#xA;  const downloadStartTime = timestamp - 3;&#xA;  const downloadEndTime = timestamp &#x2B; 3;&#xA;&#xA;  const videoStream = ytdl(YouTubeURL, {&#xA;    quality: "highest",&#xA;  });&#xA;&#xA;  const ffmpegCommand = ffmpeg(videoStream)&#xA;    .setStartTime(downloadStartTime)&#xA;    .duration(downloadEndTime - downloadStartTime)&#xA;    .outputOptions("-c:v", "libx264")&#xA;    .outputOptions("-c:a", "copy")&#xA;    .outputOptions("-b:v", "10M")&#xA;    .outputOptions("-filter:v", "scale=1920:1080")&#xA;    .outputOptions("-q:v", "1")&#xA;    .outputOptions("-reconnect", "1") // enable reconnection attempts&#xA;    .outputOptions("-ignore_io_errors", "1") // ignore input/output errors&#xA;    .on("end", async () => {&#xA;      console.log("Video downloaded successfully: " &#x2B; videoPath);&#xA;&#xA;      const screenshotPath = `${filePath}/${filename}.png`;&#xA;      ffmpeg(videoPath)&#xA;        .screenshots({&#xA;          count: 1,&#xA;          timemarks: ["1"],&#xA;          folder: filePath,&#xA;          filename: `${filename}.png`,&#xA;        })&#xA;        .on("end", async () => {&#xA;          console.log(`Screenshot saved successfully: ${screenshotPath}`);&#xA;          try {&#xA;            const cloudinaryResult = await cloudinary.uploader.upload(&#xA;              screenshotPath&#xA;            );&#xA;            const screenshotUrl = cloudinaryResult.secure_url;&#xA;            console.log(`Screenshot uploaded to Cloudinary: ${screenshotUrl}`);&#xA;            // await unlink(videoPath);&#xA;            console.log(`Video file deleted: ${videoPath}`);&#xA;            // await unlink(screenshotPath);&#xA;            console.log(`Screenshot file deleted: ${screenshotPath}`);&#xA;            res.status(200).json({ screenshotUrl });&#xA;          } catch (err) {&#xA;            console.error(&#xA;              "An error occurred while uploading the screenshot to Cloudinary:",&#xA;              err&#xA;            );&#xA;            // await unlink(videoPath);&#xA;            // await unlink(screenshotPath);&#xA;            res.status(500).send("Internal Server Error");&#xA;          }&#xA;        })&#xA;        .on("error", async (err) => {&#xA;          console.error("An error occurred while taking the screenshot:", err);&#xA;          // await unlink(videoPath);&#xA;          // await unlink(screenshotPath);&#xA;          res.status(500).send("Internal Server Error");&#xA;        });&#xA;    })&#xA;    .on("error", async (err) => {&#xA;      console.error("An error occurred while downloading the video:", err);&#xA;      await unlink(videoPath); // delete the file on error&#xA;      res.status(500).send("Internal Server Error");&#xA;    })&#xA;    .save(videoPath);&#xA;&#xA;  // console.log(ffmpegCommand);&#xA;});&#xA;

    &#xA;

    Code Summary : Basically I'm passing the videoID and timestamp (because I want to download a certain section of the video, not the whole video), it downloads the video, then takes a screenshot of the video at a certain timestamp (i.e 1st second) and sends the screenshot to Cloudinary (a cloud file storage).

    &#xA;

    This works fine for 50% of the videos I've tried, but doesn't for other videos.

    &#xA;

    Here's a picture of a corrupt video and a working video.

    &#xA;

    enter image description here

    &#xA;

    Working Video

    &#xA;

    Corrupt Video

    &#xA;

    Some help would be greatly appreciated !

    &#xA;