Recherche avancée

Médias (1)

Mot : - Tags -/Christian Nold

Autres articles (84)

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

Sur d’autres sites (4688)

  • Which is most suitable ffmpeg build for centOS ? [closed]

    2 mai 2013, par Wildan Muhlis

    I didn't found ffmpeg build for CentOS from it's download site. Which is most suitable ffmpeg build for centOS ?

  • Unable to use FFMPEG for speed change for video file

    23 décembre 2019, par Sachin Harne

    I am working with a video file where I need to change the speed of the video, slow-motion as well as fast-motion the video. I tried using the commands below but none of those are helping me out.

    String cmd = "-i " + inputFilePath + " " + "-filter:v" + " " + "setpts=0.5*PTS" + " " + outputPath;

    String cmd = String.format("-i " + filepath + " -filter:v "+ "\"setpts=2.0*PTS\"" +  outputPath);

    String cmd =  "-i " + filepath + " -vf " + "\"setpts=(1/60)*PTS\" " + outputPath;

    String cmd = String.format("ffmpeg -i " + filepath + " -filter:v " + "\"setpts=PTS/60\" " + outputPath);

    Getting the error message as below :

    Unrecognized option ’i /storage/emulated/0/Movies/video/video_20191223184836613013111.mp4 -vf "setpts=(1/60)*PTS" /storage/emulated/0/Movies/video/finalVideo_724.mp4’.

    Error splitting the argument list : Option not found

  • ffmpeg exit code 429496724 when opening file with {} in name

    16 février, par Holly Wilson

    I'm trying to write a program that will read the names of files in a directory, and parse them for info which it will then write into that file's metadata (seems pointless, I know, but it's more of a trial run for a larger project. If I can figure this out, then I'll be ready to move on to what I actually want to do).
All of my filenames are formatted :

    


    Title, Article* - Subtitle* Cut* [Year]
*if present

    


    The four test videos I'm using are titled :

    


    Test Video 1 [2000]

    


    Test Video 2, A [2000]

    


    Test Video 3 Test Cut [2000]

    


    Test Video 4 - The Testening [2000]

    


    The code seems to be working fine on videos 1, 2, & 4 ; but video 3 is causing me a lot of headache.

    


    //node C:\Users\User\Documents\Coding\Tools\testMDG.js
const fs = require('fs');
const path = require('path');
const ffmpeg = require('fluent-ffmpeg');
const async = require('async');
const directory = path.normalize('F:\\Movies & TV\\Movies\\testDir');
let x = 0;
const fileArray = [];
const succArray = [];
const failArray = [];
// Set the path to the ffmpeg executable
ffmpeg.setFfmpegPath(path.normalize('C:\\ffmpeg\\bin\\ffmpeg.exe'));

// Add this near the start of your script
const tempDir = path.join(directory, 'temp');
if (!fs.existsSync(tempDir)) {
    fs.mkdirSync(tempDir, { recursive: true });
}

const progresscsv = path.normalize('C:\\Users\\User\\Documents\\Coding\\Tools\\progress.csv');
if (fs.existsSync(progresscsv)) {
    fs.unlinkSync(progresscsv);
};

const csvStream = fs.createWriteStream(progresscsv);
csvStream.write('File Name,Status\n');

const CONCURRENCY_LIMIT = 3; // Adjust based on your system capabilities

// Add at the start of your script
const processedFiles = new Set();

function sanitizeFilePath(filePath) {
    return filePath.replace(/([{}])/g, '\\$1');
}

// Create a queue
const queue = async.queue(async (task, callback) => {
    const { file, filePath, tempFilePath, movieMetadata } = task;
    try {
        await new Promise((resolve, reject) => {
            console.log(`ffmpeg reading: ${sanitizeFilePath(filePath)}`);
            ffmpeg(sanitizeFilePath(filePath))
                .outputOptions([
                    '-y',
                    '-c', 'copy',
                    '-map', '0',
                    '-metadata', `title=${movieMetadata.title}`,
                    '-metadata', `subtitle=${movieMetadata.subtitle || ''}`,
                    '-metadata', `comment=${movieMetadata.cut || ''}`,
                    '-metadata', `year=${movieMetadata.year}`
                ])
                .on('error', (err) => reject(err))
                .on('end', () => resolve())
                .saveToFile(tempFilePath);
        });
        
        // Handle success
        console.log(`Successfully processed: ${file}`);
        succArray.push(file);
        // Only call callback once
        if (callback && typeof callback === 'function') {
            callback();
        }
    } catch (err) {
        // Handle error
        console.error(`Error processing ${file}: ${err.message}`);
        failArray.push(file);
        // Only call callback once with error
        if (callback && typeof callback === 'function') {
            callback(err);
        }
    }
}, CONCURRENCY_LIMIT);

fs.readdir(directory, (err, files) => {
    if (err) {
        console.error(`Error reading directory: ${err.message}`);
        return;
    }
    console.log(directory);

    // Filter for files only
    files = files.filter(file => fs.statSync(path.join(directory, file)).isFile());
    console.log(files);

    for (const file of files) {
        x++;
        const filePath = path.join(directory, file);
        let desort = file.replace(/(.*),\s(the\s|an\s|a\s)/i, '$2'+'$1 ') || file;
        
        // Create task object for queue
        const task = {
            file,
            filePath: filePath,
            tempFilePath: path.join(directory, 'temp', `temp_${x}_${path.parse(file).name
                .replace(/[^a-zA-Z0-9]/g, '_')}${path.extname(file)}`),
            movieMetadata: {
                title: desort.replace(/(\s[\-\{\[].*)/gi, ``),
                subtitle: desort.includes('-') ? desort.replace(/(.*)\-\s(.*?)[\{\[].*/gi, '$2') : null,
                cut: desort.includes('{') ? desort.replace(/.*\{(.*)\}.*/gi, '$1') : null,
                year: desort.replace(/.*\[(.*)\].*/gi, '$1')
            }
        };
        
        // Add to processing queue
        queue.push(task, (err) => {
            if (!processedFiles.has(task.file)) {
                processedFiles.add(task.file);
                if (err) {
                    csvStream.write(`${task.file},Failed\n`);
                } else {
                    csvStream.write(`${task.file},Processed\n`);
                }
            }
        });
    }
});

// Add queue completion handler
queue.drain(() => {
    console.log('All files have been processed');
    console.log(`Success: ${succArray.length} files: ${succArray}`);
    console.log(`Failed: ${failArray.length} files: ${failArray}`);
});

//node C:\Users\User\Documents\Coding\Tools\testMDG.js


    


    And the console is logging :

    


    PS C:\Users\User> node C:\Users\User\Documents\Coding\Tools\testMDG.js
F:\Movies & TV\Movies\testDir
[
  'Test Video 1 [2020].mp4',
  'Test Video 2, A [2020].mp4',
  'Test Video 3 {Test Cut} [2020].mp4',
  'Test Video 4 - The Testening [2020].mp4'
]
ffmpeg reading: F:\Movies & TV\Movies\testDir\Test Video 1 [2020].mp4
ffmpeg reading: F:\Movies & TV\Movies\testDir\Test Video 2, A [2020].mp4
ffmpeg reading: F:\Movies & TV\Movies\testDir\Test Video 3 \{Test Cut\} [2020].mp4
Error processing Test Video 3 {Test Cut} [2020].mp4: ffmpeg exited with code 4294967294: Error opening input file F:\Movies & TV\Movies\testDir\Test Video 3 \{Test Cut\} [2020].mp4.
Error opening input files: No such file or directory

ffmpeg reading: F:\Movies & TV\Movies\testDir\Test Video 4 - The Testening [2020].mp4
Successfully processed: Test Video 1 [2020].mp4
Successfully processed: Test Video 2, A [2020].mp4
Successfully processed: Test Video 4 - The Testening [2020].mp4
All files have been processed
Success: 3 files: Test Video 1 [2020].mp4,Test Video 2, A [2020].mp4,Test Video 4 - The Testening [2020].mp4
Failed: 1 files: Test Video 3 {Test Cut} [2020].mp4


    


    I've tried so many different solutions in the sanitizeFilePath function. Escaping the {} characters (as included below), escaping all non-alphanumeric characters, putting the filepath in quotes, etc. VSCode's CoPilot is just pulling me round in circles, suggesting solutions I've already tried.