Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • scale intensitiey levels of ffmpeg filter output

    30 septembre 2016, par jlarsch

    how does ffmpeg scale filter output intensities? I have a blend/divide filter that divides 8 bit frames by an 8 bit image and saves the output into an xvid avi.

    blend=all_mode='divide':repeatlast=1

    I would like to understand how exactly ffmpeg maps the filter output (presumably a float?) to the 8 bit video output levels.

    Does it depend on the intensity histogram of the frame? (i.e. if 99% of pixels are in the range 0 to 0.5 and 1% of pixels has a much larger intensity e.g. 1)

    Is there a way to specifically provide a lookup table for this mapping at this step?

  • FFMpegConverter. ConvertLiveMedia method doesn't work

    30 septembre 2016, par neustart47

    I need to convert files from AWS cloud, which mounted like a local drive by using TntDrive. I tried to use FFMpegConverter.ConvertMedia method, but it works slow. In another question someone explained to me next:

    "It looks like you need to use the FFMpegConverter.ConvertLiveMedia method instead of the FFMpegConverter.ConvertMedia method to achieve this. Overall you will still find that you will be probably I/O bound rather than CPU bound."

    But next code didn't work for me:

    static void Main(string[] args)
            {
                string input_path =
                    @"D:\WAV\ALBUM1\UNDER_ALBUM1\APOV01_10 POV 8_MAIN.WAV";
                string dest_path = @"D:\result.mp3";
                using (FileStream inputStream = new FileStream(input_path, FileMode.Open))
                {
    
                    var converter = new FFMpegConverter();
    
                    var result = converter.ConvertLiveMedia(
                        inputStream, "WAV",
                        dest_path, "MP3",
                        new ConvertSettings
                        {
                            AudioSampleRate = 44100,
                            CustomOutputArgs = " -b:a 192k "
                        }
                        );
                    Console.ReadLine();
                }
    
            }
    

    What's wrong with my code ?

  • ffmpeg override output file if exists

    30 septembre 2016, par Muhammad Omer Aslam

    i am creating a clip from a audio file (.FLAC) with a start and end time, here is my command.

    ffmpeg -i /audio/191079007530_1_01.flac -t 51 -ss 69 /clips/44z274v23303t264y2z2s2s2746454t234_clip.mp3 2>&1 >> /ffmpegLogs.log
    

    i use this command with my php code and my question is that when i run this command on the console it asks me to override the output file if the output file already exists in the destination, what switch or extra command should i use to automatically override if the file exists

  • ffprobe can not read a file generated by node JS createWriteStream() on AWS

    30 septembre 2016, par matthiasdv

    I have a setup running on AWS that triggers an AWS Lambda function when a video file is uploaded to an S3 bucket. The Lambda function is written in node and downloads the file, streams it to a temp working file and then executes ffprobe on it followed by an ffmpeg command.

    ffprobe throws the following error:

    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x4ea8e20] error reading header download: Invalid data found when processing input
    

    The bug is hard to reproduce and occurs only half the time, which I believe to be because of the async nature of the program.

    My main function is as follows

    downloadFile(library.getDownloadStream, logger, sourceLocation, localFilePath)
            .then(() => ffprobe(logger))
            .then(() => ffmpeg(logger, keyPrefix))
            .then(() => removeDownload(logger, localFilePath))
            .then(() => uploadFiles(library.uploadToBucket, logger, keyPrefix))
            .then(data => invocation.callback())
            .catch(error => invocation.callback(error));
    

    The ffprobe Function:

    function downloadFile(downloadFunc, logger, sourceLocation, download) {
        return new Promise((resolve, reject) => {
            logger.log(`Starting download: ${sourceLocation.bucket} / ${sourceLocation.key}`);
    
            var downloadFile = createWriteStream(download);
    
            downloadFunc(sourceLocation.bucket, sourceLocation.key)
                .on('end', () => {
                    logger.log("closing writing stream");
                    downloadFile.end();
    
                    logger.log('Download finished');
    
                    resolve();
                })
                .on('error', reject)
                .pipe(downloadFile);
        });
    }
    

    Each build/update uploads the latest ffmpeg version to AWS. I can not reproduce this error locally.

    Why is ffprobe throwing this error regarding the header?

    Update

    Logging the downloaded file's filesize prints exactly the same amount of bytes, regardless of wether ffprobe is successful or not.

    However, when I set a timeOut before resolving the promise, the bug no longer occurs and ffprobe runs successfully each time:

    downloadFunc(sourceLocation.bucket, sourceLocation.key)
            .on('end', () => {
    
                logger.log('Download finished');
    
                // Filesize
                var meta = fs.statSync(download);
                var fileSizeInBytes = meta["size"];
    
                logger.log(fileSizeInBytes);
    
                // resolve();
                setTimeout(resolve, 1000); 
            })
            .on('error', reject)
            .pipe(downloadFile);
    

    Why is this happening?

  • How do I compile a 64-bit version of ffmpeg on Windows ?

    30 septembre 2016, par lyxera

    i need to compile ffmpeg (64 bit shared dll) for windows. however I configure in mingw, it always produces 32 bit binary for me.

    tried this already

    ./configure --enable-shared --disable-static --enable-memalign-hack --arch=amd64
    ./configure --enable-shared --disable-static --enable-memalign-hack --arch=x86_64
    

    my guess is that a x86 to x86_64 cross compiler is missing.

    but just can find a way to make those 64bit dlls.