Recherche avancée

Médias (0)

Mot : - Tags -/diogene

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (69)

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Les images

    15 mai 2013

Sur d’autres sites (4133)

  • (Folderwide) Bulk conversion in ffmpeg to a H264 codec

    5 mars 2021, par Habboman

    So I was trying to get a hang of ffmpeg but I am not very good at it. I am trying to get all .mkv files converted to .m4v with a H264 codec. From another project I know that the h264_cuvid decoder worked perfectly well for my needs. I also checked via ffmpeg -decoders that I wrote it correctly. So the windows-batchfile (I frankenstein-ed together from other forums) looks like this :

    


    for %%a in ("*.mkv") do ffmpeg -i "%%a" -c:v h264_cuvid -preset fast -crf 20 -b:v 128k "newfiles\%%~na.m4v"
pause


    


    What I get is sadly only :

    


    


    unknown encoder 'h264_cuvid'

    


    


    How do I solve this ?

    


    If it is easier to start from scratch following is what I am trying to achieve

    


    I am pretty new to this whole conversion/coding thing. I got a raspberry pi as a homeserver for my video files. Sadly it can only direct stream correctly encoded files (H.264), otherwise the Pi is trying to encode the videos itself (what causes buffering). So I am trying to find a solution to throw my whole library into a folder and convert it to a usable format.

    


  • ffmpeg hangs when muxing longer videos

    11 août 2020, par 492357816

    I am using ffmpeg with Janus WebRTC server for muxing video conference recordings. For video conferences under approximaately 5 minutes duration, existing code works well. If the source files are longer than that the process appears to hang without returning either an error or a completed file.
Any advice/suggestions would be most welcome.

    


        var recordingsPath = exports.recordingsPath;
    var videoRecordingPath = `${recordingsPath}/${filename}-video.mjr`;
    var audioRecordingPath = `${recordingsPath}/${filename}-audio.mjr`;
    var videoOutputPath = `${recordingsPath}/${filename}-output1.mp4`;
    var audioOutputPath = `${recordingsPath}/${filename}-output1.wav`;
    var finalOutputPath = `${recordingsPath}/${filename}-final.mp4`;
    var rawConverterPath = "/opt/janus/bin/janus-pp-rec";
    var audioRecordingByteSize = exports.getFileSizeInBytes(audioRecordingPath);
    var audioIsValid = audioRecordingByteSize > 8;

    if (audioIsValid) {
        //turn audio and video mjr files into .wav and mp4 respectively
        exports.runBashSync([ rawConverterPath, videoRecordingPath, videoOutputPath]);
        exports.runBashSync([ rawConverterPath, audioRecordingPath, audioOutputPath]);
        return exports.mergeMp4AndWav(
            audioOutputPath, videoOutputPath, finalOutputPath
        ).then(function(result) {
            // remove source data for audio & video
            exports.runBashSync([ "rm", audioOutputPath]);
            exports.runBashSync([ "rm", videoOutputPath]);
            exports.runBashSync([ "rm", audioRecordingPath]);
            exports.runBashSync([ "rm", videoRecordingPath]);
        });
    } else {
        // handle cases where audio is not available
        feedback("no audio");
        return new Promise(function(resolve) {
            exports.runBashSync([ rawConverterPath, videoRecordingPath, finalOutputPath], true);
            if (Number.isInteger(audioRecordingByteSize)) {
                exports.runBashSync([ "rm", audioRecordingPath]);
            }
            exports.runBashSync([ "rm", videoRecordingPath]);
            resolve(true);
        });
    }
};

exports.joinMp4s = function(mp4Filenames, outputPath) {
    feedback("joining mp4s");
    if (mp4Filenames.length === 1) {
        feedback("single-stream case");
        exports.runBashSync(["mv", mp4Filenames[0], outputPath]);
        return new Promise(function(resolve) { resolve(true); });
    }
    feedback("multi-stream case");
    var joinCmd = ["ffmpeg"];
    mp4Filenames.forEach(function(filename) {
        joinCmd.push(`-i ${filename}`);
    });
    joinCmd.push("-strict -2");
    var totalHeight = 960;
    var totalWidth = 1280;

    joinCmd.push(`-filter_complex "color=size=${totalWidth}x${totalHeight}:c=Black [base];`);

    // var numStrms = mp4Filenames.length;
    var streamsPattern = exports.setStreamsPattern(mp4Filenames);
    var strmHeight = streamsPattern.height;
    var strmWidth = streamsPattern.width;
    var strmDmns = `${strmWidth}x${strmHeight}`;
    feedback("streamDimensions: " + strmDmns);

    var i;
    for (i = 0; i < mp4Filenames.length; i++) {
        joinCmd.push(`[${i}:v] setpts=PTS-STARTPTS, scale=${strmDmns} [temp${i}];`);
    }
    for (i = 0; i < mp4Filenames.length; i++) {
        var xCoord;
        var yCoord;
        if (i === 0) {
            xCoord = streamsPattern.coords[i].xCoord;
            yCoord = streamsPattern.coords[i].yCoord;
            joinCmd.push(`[base][temp${i}] overlay=shortest=1:x=${xCoord}:y=${yCoord} [tmp${i + 1}];`);
            // joinCmd.push(`[base][temp${i}] overlay=shortest=1 [tmp${i + 1}];`);
        } else {
            var cmd = `[tmp${i}][temp${i}] overlay=shortest=1`;
            xCoord = streamsPattern.coords[i].xCoord;
            yCoord = streamsPattern.coords[i].yCoord;

            if (xCoord) { cmd += ":x=" + xCoord; }
            if (yCoord) { cmd += ":y=" + yCoord; }

            if (i + 1 !== mp4Filenames.length) { cmd += ` [tmp${i + 1}];`; }
            joinCmd.push(cmd);
        }
    }

    joinCmd.push(`" ${outputPath}`);
    feedback("join command: " + joinCmd);
    return exports.runBashAsync(joinCmd).then(function(result) {

        mp4Filenames.forEach(function(filename) {
            feedback("removing: " + filename);
            exports.runBashSync(`rm ${filename}`);
        });
    });
};



    


  • node ffmpeg module stuck more than one file

    29 mai 2021, par Muhammad Hamza

    when I read more than one file it will be stuck and also hang my pc. I need to restart my pc

    


    on one file or 5 files it will work perfectly but not more than 5 files

    


    if anyone know this issue let me know

    


    const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path
const ffmpeg = require('fluent-ffmpeg')
ffmpeg.setFfmpegPath(ffmpegPath)


const testFolder = './videos/';
const fs = require('fs');

 


fs.readdir(testFolder, async(err, files) => {
  try {
    for(let i = 0; i < 10; i++){
      if(files[i] != '1 Surah Fatiha Dr Israr Ahmed Urdu - 81of81.mp4'){
        
        let converter = await ffmpeg(`./videos/${files[i]}`)
        await converter.setStartTime('00:00:00').setDuration('30').output(`./outputfolder/${files[i]}`).on('end', function(err) {
        if(err) { 
          console.log(`err durinng conversation \n ${err}`) 
        }
        else{
          console.log(`Done ${files[i]}`);
        }
        }).on('error', function(err){
          console.log(`error: ${files[i]}`, err)
        }).run()
      }
    }
  } catch (error) {
    console.log(error)
  }
});