Recherche avancée

Médias (0)

Mot : - Tags -/organisation

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

Autres articles (100)

  • List of compatible distributions

    26 avril 2011, par

    The table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)

  • 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

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

Sur d’autres sites (7946)

  • Révision 104355 : - Ce n’est plus http://programmer.spip.org mais http://programmer.spip.net

    8 mai 2017, par spip.franck@lien-d-amis.net

    - programmer.spip est maintenant en https, donc, j’ajoute le"s"

  • Streaming mp3 using node http to Icecast server gives no output

    6 décembre 2024, par Roboroads

    I'm trying to stream a custom mp3 datastream to Icecast2. Icecast recognises there's a mountpoint, however the streamed data won't play and I have no idea why.

    


    import ffmpeg from 'fluent-ffmpeg';
import { request } from 'node:http';

const req = request(
  {
    host: 'localhost',
    port: 8000,
    path: '/radio',
    method: 'PUT',
    auth: 'source:password',
    headers: {
      'Content-Type': 'audio/mpeg',
      Expect: '100-continue',
      'Ice-Public': 0,
      'Ice-Name': 'Testing Stream!',
      'Ice-Description': 'Testing Stream!',
      'Ice-Genre': 'Various',
      'Icy-MetaData': 1
      //'Icy-MetaInt': metaInt
    }
  },
  (res) => {
    console.log('Server responded with status code:', res.statusCode);
    res.on('data', (chunk) => {
      console.log('Response chunk:', chunk.toString());
    });
  }
);

req.on('error', (err) => {
  console.error('Error streaming to Icecast server:', err);
});

req.on('close', () => {
  console.error('Icecast server closed connection');
  process.exit(1);
});

req.on('continue', () => {
  console.log('Continue event received');
  ffmpeg({ source: 'test.mp3' })
    .native()
    .outputOption(['-map 0:a'])
    .audioBitrate(320)
    .audioCodec('libmp3lame')
    .audioFrequency(44100)
    .audioChannels(2)
    .format('mp3')
    .on('progress', (progress) => {
      console.log('Is open:' + req.socket.writable + ' - ' + progress.timemark);
    })
    .on('start', function (commandLine) {
      console.log('Spawned Ffmpeg with command: ' + commandLine);
    })
    .on('end', () => {
      console.log('Processing finished !');
      req.end();
    })
    .on('error', (err) => {
      console.error('FFmpeg error:', err);
    })
    .pipe(req);
});


    


    Note that when I try to do this with ffmpeg using the icecast protocol, it works without issues : ffmpeg -re -i test.mp3 -b:a 320k -acodec libmp3lame -ar 44100 -ac 2 -map 0:a -f mp3 icecast://source:password@localhost:8000/radio. It looks like something is not right with request.

    


  • POST http://localhost:3000/api/video/thumbnail 500 (Internal Server Error) MongoDB and FFmpeg

    5 juillet 2022, par VoicedCreator

    I am trying to insert a thumbnail on my page using POST and im getting this error
I want to screenshot a video using FFmpeg

    


    const express = require('express');
const router = express.Router();
const multer = require('multer');
var ffmpeg = require('fluent-ffmpeg');
const { User } = require("../models/User");

const { auth } = require("../middleware/auth");
const storage = multer.diskStorage({
    destination: function (req, file, cb) {
      cb(null, 'uploads/')
    },
    filename: function (req, file, cb) {
      cb(null, `${Date.now()}_${file.originalname}`)
    },
    fileFilter: (req, file, cb) => {
        const ext = path.extname(file.originalname);
        if(ext !== '.mp4' || ext !== '.mov' || ext !== '.wmv'){
            return cb(res.status(400).end('Solo archivos mp4-mov-wmv son aceptados'), false);
        }
        cb(null, true)
    }
  })
  
  const upload = multer({ storage: storage }).single("file")


//=================================
//             User
//=================================

router.post("/uploadfiles", (req, res) => {

    upload(req, res, err => {
        if(err) {
            return res.json({ success: false, err })
        }
        return res.json({ success: true, filePath: res.req.file.path, fileName: res.req.file.filename })
    })

});

router.post("/thumbnail", (req, res) => {


    let filePath = ""
    let fileDuration = ""


    ffmpeg.ffprobe(req.body.url, function (err, metadata) {
        console.dir(metadata); // all metadata
        console.log(metadata.format.duration);
        console.log(metadata) 
        fileDuration = metadata.format.duration
    });


    ffmpeg(req.body.url)
        .on('filenames', function (filenames) {
            console.log('Will generate ' + filenames.join(', '))
            console.log(filenames)


            filePath = "uploads/thumbnails/" + filenames[0]
        })
        .on('end', function () {
            console.log('Screenshots taken');
            return res.json({ success: true, url: filePath, fileName: filenames, fileDuration: fileDuration });
        })
        .on('error', function (err) {
            console.error(err);
            return res.json({ success: false, err });
        })
        .screenshots({
            // Will take screenshots at 20%, 40%, 60% and 80% of the video
            count: 3,
            folder: 'uploads/thumbnails',
            size: '320x240',
            //'%b': input basename (filename w/o extension)
            filename: 'thumbnail-%b.png'
        })
});




router.post("/thumbnail", (req, res) => {


    let filePath = ""
    let fileDuration = ""


    ffmpeg(req.body.url)
        .on('filenames', function (filenames) {
            console.log('Will generate ' + filenames.join(', '))
            console.log(filenames)


            filePath = "uploads/thumbnails/" + filenames[0]
        })
        .on('end', function () {
            console.log('Screenshots taken');
            return res.json({ success: true, url: filePath, fileName: filenames, fileDuration: fileDuration });
        })
        .on('error', function (err) {
            console.error(err);
            return res.json({ success: false, err });
        })
        .screenshots({
            // Will take screenshots at 20%, 40%, 60% and 80% of the video
            count: 3,
            folder: 'uploads/thumbnails',
            size: '320x240',
            //'%b': input basename (filename w/o extension)
            filename: 'thumbnail-%b.png'
        })
});



module.exports = router;


    


    Error : POST http://localhost:3000/api/video/thumbnail 500 (Internal Server Error)
TypeError : Cannot read properties of undefined (reading 'format')

    


    I think is because ffmpeg is not connecting to mongodb