Recherche avancée

Médias (0)

Mot : - Tags -/organisation

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

Autres articles (65)

Sur d’autres sites (13936)

  • lavu : remove comma at final enumeration items to fix pedantic warnings

    20 octobre 2016, par Michael Behrisch
    lavu : remove comma at final enumeration items to fix pedantic warnings
    
    • [DH] libavutil/log.h
    • [DH] libavutil/pixfmt.h
  • Version 1.3.1 final.

    27 novembre 2014, par Erik de Castro Lopo
    Version 1.3.1 final.
    
    • [DH] README
    • [DH] build/config.mk
    • [DH] configure.ac
    • [DH] doc/Doxyfile.in
    • [DH] doc/html/documentation_bugs.html
    • [DH] doc/html/index.html
    • [DH] src/libFLAC/libFLAC_dynamic.vcproj
    • [DH] src/libFLAC/libFLAC_dynamic.vcxproj
    • [DH] src/libFLAC/libFLAC_static.vcproj
    • [DH] src/libFLAC/libFLAC_static.vcxproj
    • [DH] test/metaflac-test-files/case07-expect.meta
  • How can I get the final size after transcripting a video to stream it with fluent-ffmpeg ?

    5 avril 2018, par G. Manukyan

    I am trying to stream a video using createReadStream and using pipe(res) in node.js and it works fine if the file doesn’t need transcoding (mp4, webm).

    With mkv files I am using fluent-ffmpeg to transcode it on the fly, but the problem is that I can’t go back and forward in the html video player.

    download = function(file, req, res) {  

       const range = req.headers.range
       const parts = range.replace(/bytes=/, "").split("-")

       const start = parseInt(parts[0], 10);
       const end = parts[1] ? parseInt(parts[1], 10) : file.length - 1

       res.setHeader('Content-Type', 'video/webm')
       res.setHeader('Accept-Ranges', 'bytes');
       res.setHeader('Content-Length', 1 + end - start);
       res.setHeader('Content-Range', `bytes ${start}-${end}/${file.length}`);
       res.statusCode = 206;

       var stream = file.createReadStream({start, end})

       ffmpeg(stream)
       .videoCodec('libvpx')
       .audioCodec('libvorbis')
       .videoBitrate('512k')
       .format('webm')
       .on('start', () => {
           console.log('transcoding...')
       })
       .on('error', (err, stdout, stderr) => {
           console.log(err.message, err, stderr);
       })
       .on('progress', function(progress) {
           console.log(progress);
       })
       .on('end', function(filenames) {
           console.log("Finished transcoding.");          
       })
       .pipe(res);

    }

    I think that comes from the fact that we don’t know in advance the size of the final transcoded file so the range we send in the headers is wrong and somehow make the video player "limited".

    What can be a workaround to this problem ?