Newest 'ffmpeg' Questions - Stack Overflow

http://stackoverflow.com/questions/tagged/ffmpeg

Les articles publiés sur le site

  • How To Specify FFMPEG Input Volume For Multple Input Files

    30 septembre 2014, par gbd

    I have 6 similar/separate audio input files feeding into ffmpeg - no video. I'm mixing the 6 input channels down to a stereo output using amix and that works fine. But now I need to change the volume of each individual input channel before the mix down - or maybe as part of the mix down. I've looked at and tried aeval (which seems very slow) in the form

     'aeval=val(0)*volChg1:c=same|val(1)*volChg2:c=same|val(2)*volChg3:c=same|val(3)*volChg4:c=same|val(4)*volChg5:c=same|val(5)*volChg6:c=same'
    

    but that only seems to change the volume of the first channel.

    So the whole input part of my ffmpeg expression looks something like this right now:

    -i inFilePath1 -i inFilePath2 -i inFilePath3 -i inFilePath4 -i inFilePath5 -i inFilePath6 
    -filter_complex 'aeval=val(0)*$volChg1:c=same|val(1)*$volChg2:c=same|val(2)*$volChg3:c=same|val(3)*$volChg4:c=same|val(4)*$volChg5:c=same|val(5)*$volChg6:c=same','amix=inputs=6:duration=longest'
    

    $volChg1-6 are php variables containing the individual volume multipliers - 0.5 for example should halve the volume of that individual channel while 1.0 would leave it unaffected. How do I do this?

  • How to stream Audio/Video using Node.js express streaming with ffmpeg and flowplayer usage ??

    30 septembre 2014, par iknowv

    I want to create node server which streams media file to public using express module in chunks

    Server.js ( This is nodejs server which works for me but without chunks )

                var express = require('express');
                var app = express();
    
                var http = require('http');
                var fs = require('fs');
                var path = require('path');
                var ext = /[\w\d_-]+\.[\w\d]+$/;
    
                ffmpeg_path = "ffmpeg\\";
                app.get('/player', function(req, res){
                res.writeHead(200, {'Content-Type': 'text/html'});
                fs.createReadStream('video.html').pipe(res);
                });
    
                app.get('/audio', function(req, res){
    
                myParam = [];
                myParam.push("-i","","-f","mp3","pipe:1");
                myParam[1] = 'media\\example_aac.m4a';
                var child_process = require("child_process");
                ffmpeg = child_process.spawn(ffmpeg_path + 'ffmpeg.exe',myParam);   
                ffmpeg.stderr.on('data', function(data)
                {
                    console.log('ffmpeg .error=' + data.toString());
                });
                 res.writeHead(200, {
                   'Content-Type': 'audio/mp3'
                 });
                ffmpeg.stdout.pipe(res); 
                });
    
    
                app.get('/video', function(req, res){
    
                myParam = [];
                myParam.push("-i","","-f","flv","pipe:1");
                myParam[1] = 'media\\example_video.wmv';
                var child_process = require("child_process");
                ffmpeg = child_process.spawn(ffmpeg_path + 'ffmpeg.exe',myParam);   
                ffmpeg.stderr.on('data', function(data)
                {
                    console.log('ffmpeg .error=' + data.toString());
                });
                /*ffmpeg.stdout.on('data', function(data)
                {
                //var buff = new Buffer(data).toString();
                //res.send(buff);
                });*/
                res.writeHead(200, {
                   'Content-Type': 'video/flv'
                 });
                ffmpeg.stdout.pipe(res); 
                });
    
                app.listen(3000);
    

    =================================================

    video.html

                    <script src="http://releases.flowplayer.org/js/flowplayer-3.2.13.min.js"></script>
                
    Audio Player
    Video Player
    <script type="text/javascript">
    $f("player", "http://releases.flowplayer.org/swf/flowplayer-3.2.18.swf", {
    clip: {
    autoPlay: false,
    url: "http://localhost:3000/audio"
    },
    plugins: {
    controls: {
    fullscreen: false,
    height: 30,
    autoHide: false
    }
    }

    });
    </script>
    <script type="text/javascript">
    flowplayer("videoplayer", "http://localhost/flowplayer/flowplayer.commercial-3.2.2.swf", {
    clip: {
    autoPlay: false,
    autoBuffering: false,
    scaling: 'fit',
    url: 'http://localhost:3000/video',
    captionUrl: ''
    },
    plugins: {
    controls: {
    fullscreen: false,
    height: 30,
    autoHide: false
    }
    }
    }
    );
    </script>
  • Loading and unloading ffmpeg jni library based on when it's needed

    30 septembre 2014, par Alin

    I finally managed to compile ffmpeg for android and I've been able to use it in my app.

    Here is the scenario of my app:

    • I show the user a gridview with thumbnails of images and videos
    • the user can click on a cell and it is taken to image/video details where he can see the full image or play the video
    • the user can apply an image over an video and this is when ffmpeg is used

    So basically, the user might never actually use the watermarking option or he can do it very rare because the amount of available videos is way smaller than images.

    I am loading the ffmpeg library, first time it is needed by running:

    static {
         System.loadLibrary("ffmpeglib");
    }
    

    Now here are my questions:

    1. loading the library like this, uses app's memory and resources ?
    2. can I unload the library, or better said, is it needed to unload it ? I have not found any java code like System.unloadLibrary to take care of unloading
    3. Since the library might be used rarely, wouldn't a load => do encoding => unload be a better approach ? Or maybe having it loaded would allow easy reuse since no loading is necessary.
    4. If I use an IntentService to load the library and make the encoding, when the service completes the job, does the library gets unloaded ?
  • JavaCV in Android : FFmpegFrameGrabber Class not found exception

    30 septembre 2014, par Sunshinetpu

    I want to create a video from images. So I tried to import JavaCV into Android project with the following guide: http://javacv4android.blogspot.com/2014/02/how-to-import-javacv-libraries-to.html But I have got error FFmpegFrameGrabber Class not found exception I don't know how to fix the problem. Can any body help me? Thanks a lot for advices.

  • Convert video to FLV using FFMPEG

    30 septembre 2014, par Festus Tamakloe

    I come across this code in one php script that i bought last time to convert video. The script is running on Ubuntu 12.04

    -i $file_source -b 9600k -aspect 16:9 -acodec aac -strict experimental -ab 128k -ar 22050 $file_dest" 
    

    That is the full meaning of elements/attributes and what could be the alternative?

    Thanks for your help