Recherche avancée

Médias (1)

Mot : - Tags -/livre électronique

Autres articles (102)

  • Sélection de projets utilisant MediaSPIP

    29 avril 2011, par

    Les exemples cités ci-dessous sont des éléments représentatifs d’usages spécifiques de MediaSPIP pour certains projets.
    Vous pensez avoir un site "remarquable" réalisé avec MediaSPIP ? Faites le nous savoir ici.
    Ferme MediaSPIP @ Infini
    L’Association Infini développe des activités d’accueil, de point d’accès internet, de formation, de conduite de projets innovants dans le domaine des Technologies de l’Information et de la Communication, et l’hébergement de sites. Elle joue en la matière un rôle unique (...)

  • Automated installation script of MediaSPIP

    25 avril 2011, par

    To overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
    You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
    The documentation of the use of this installation script is available here.
    The code of this (...)

  • 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 (...)

Sur d’autres sites (10098)

  • When streaming response in Flask file unplayable

    21 décembre 2015, par nadermx

    I currently have a function that runs ffmpeg enconder on a flv stream from youtube.

    def console(cmd, add_newlines=False):
       p = Popen(cmd, shell=True, stdout=PIPE)
       while True:
           data = p.stdout.readline()
           if add_newlines:
               data += str('\n')
           yield data

           p.poll()
           if isinstance(p.returncode, int):
               if p.returncode > 0:
                   # return code was non zero, an error?
                   print 'error:', p.returncode
               break

    This works fine when I run the ffmpeg command and have it output to a file. The file is playable.

    mp3 = console('ffmpeg -i "%s" -acodec libmp3lame -ar 44100 -f mp3 test.mp3' % video_url, add_newlines=True)

    But when I have ffmpeg output to stdout via - instead of test.mp3, and stream that response. The file streams fine, is the correct size. But does not play correctly. Sounds chopy, and when I check the properties of the file it doesn’t show the data of it as it does with test.mp3

    @app.route('/test.mp3')
    def generate_large_mp3(path):
       mp3 = console('ffmpeg -i "%s" -acodec libmp3lame -ar 44100 -f mp3 -' % video_url, add_newlines=True)
       return Response(stream_with_context(mp3), mimetype="audio/mpeg3",
                      headers={"Content-Disposition":
                                   "attachment;filename=test.mp3"})

    Is there something I am missing ?

  • Unable to combine videos with ffmpeg on firebase functions

    24 septembre 2019, par 西田龍

    I tried to combine videos on firebase functions using FFmpeg. However, I was not able to do that because of encountering an error below.

    I expect that videos will be combined successfully.

    Firstly, as I did not have the directory made so I tried to make it using mkdirp-promise.
    But it did not make any changes ; I had the same error as before.

    Error: ENOENT: no such file or directory, stat '/tmp/combined.mp4'

    Here are the codes.

    const combineVideos = async (tempFilePath, firstFilePath, secondFilePath,targetTempFilePath) =>{
                   ffmpeg(tempFilePath)
                     .setFfmpegPath(ffmpeg_static.path)
                     .addInput(firstFilePath)
                     .addInput(secondFilePath)
                     .on('end', function() {
                       console.log('files have been merged succesfully');
                     })
                     .on('error', function(err) {
                       console.log('an error happened: ' + err.message);
                     })
                     .mergeToFile(targetTempFilePath)
    }
    exports.editVids = functions.storage.object().onFinalize(async (object) => {
       await (async () => {
           const fileBucket = object.bucket; // The Storage bucket that contains the file.
           const filePath = object.name; // File path in the bucket.

           // Get the file name.
           const fileName = path.basename(filePath);
           // Exit if the audio is already converted.
           if(fileName==='last.mp4'){
               // Download file from bucket.

               const bucket = gcs.bucket(fileBucket);
               const tempFilePath = path.join(os.tmpdir(), fileName);
               const firstFilePath = path.join(os.tmpdir(), 'first.mp4');
               const secondFilePath = path.join(os.tmpdir(), 'second.mp4');

               // We add a '_output.flac' suffix to target audio file name. That's where we'll upload the converted audio.
               const targetTempFileName = 'combined.mp4'
               const targetTempFilePath = path.join(os.tmpdir(), targetTempFileName);
               const targetStorageFilePath = path.join(path.dirname(filePath), targetTempFileName);

               await mkdirp(path.dirname(tempFilePath))

               await bucket.file(filePath).download({destination: tempFilePath});
               await bucket.file(filePath.replace('last.mp4','first.mp4')).download({destination: firstFilePath});
               await bucket.file(filePath.replace('last.mp4','second.mp4')).download({destination: secondFilePath});

               console.log('Video downloaded locally to', firstFilePath);
               console.log('Video downloaded locally to', secondFilePath);
               console.log('Video downloaded locally to', tempFilePath);
               // Convert the audio to mono channel using FFMPEG.
               await combineVideos(tempFilePath, firstFilePath, secondFilePath, targetTempFilePath)
               console.log('Output video created at', targetTempFilePath);

               // Uploading the audio.
               await bucket.upload(targetTempFilePath, {destination: targetStorageFilePath});
               console.log('Output video uploaded to', targetStorageFilePath);

               // Once the audio has been uploaded delete the local file to free up disk space.
               fs.unlinkSync(tempFilePath);
               fs.unlinkSync(firstFilePath);
               fs.unlinkSync(secondFilePath);
               fs.unlinkSync(targetTempFilePath);
               return console.log('Temporary files removed.', targetTempFilePath);
           }
       })();
    });
  • Faster Real Time A.R Drone Video Streaming

    5 septembre 2017, par mike

    I’ve attempted ffplay tcp://192.168.1.1:5555 to video stream from the AR Drone 2.0 ; however, the delay is way too high.

    My second attempt was with the following :

    var arDrone = require('ar-drone');
    var http    = require('http');

    console.log('Connecting png stream ...');

    var pngStream = arDrone.createClient().getPngStream();

    var lastPng;
    pngStream
     .on('error', console.log)
     .on('data', function(pngBuffer) {
       lastPng = pngBuffer;
     });

    var server = http.createServer(function(req, res) {
     if (!lastPng) {
       res.writeHead(503);
       res.end('Did not receive any png data yet.');
       return;
     }

     res.writeHead(200, {'Content-Type': 'image/png'});
     res.end(lastPng);
    });

    server.listen(8080, function() {
     console.log('Serving latest png on port 8080 ...');
    });

    This only streamed images. I had to refresh browser every second.

    My third option was using this option :

    var arDrone=require('ar-drone')
    var client= arDrone.createclient();
    require('ar-drone-png-stream')(client,{port:8000})

    It streamed a lot of images in a short amount of time. The delay is still significant and I’m looking for a video.

    Are there other approaches that will significantly lower the delay of the video stream ?