fluent-ffmpeg / node-fluent-ffmpeg

A fluent API to FFMPEG (http://www.ffmpeg.org)
MIT License
7.92k stars 879 forks source link

ffmpeg -encoders #336

Open morgangiraud opened 9 years ago

morgangiraud commented 9 years ago

Hello people, First, the 2.0 release seems pretty nice, congratz.

I just encounter a problem recently on a ubuntu server . The ffmpeg command was missing the -encoders flag which would cause the whole package to fail on every call since he is checking each time for availableEncoders in capabilities.js.

It appends in two different install i've done. One from the official repo of my ubuntu server and one from Jon Severinsson's FFmpeg PPA repo. I had to rebuild a ffmpeg on my own from the source to ensure this flag was existing in the command.

I don't how to solve this issue, but maybe you shouldn't rely on this flag anymore.

njoyard commented 9 years ago

Hi, I cannot find any trace of this flag anywhere in both ffmpeg and avconv documentation. Could you please tell me more about it?

morgangiraud commented 9 years ago

If you use this flag on some ffmpeg bin, you get this output: ffmpeg -encoders ffmpeg version 2.4.2 Copyright (c) 2000-2014 the FFmpeg developers ...

Encoders: V..... = Video A..... = Audio S..... = Subtitle .F.... = Frame-level multithreading ..S... = Slice-level multithreading ...X.. = Codec is experimental ....B. = Supports draw_horiz_band .....D = Supports direct rendering method 1

V..... a64multi Multicolor charset for Commodore 64 (codec a64_multi) V..... a64multi5 Multicolor charset for Commodore 64, extended with 5th color (colram) (codec a64_multi5)

... etc ...

V..... alias_pix Alias/Wavefront PIX image V..... amv AMV Video V..... asv1 ASUS V1 V..... asv2 ASUS V2 V..... avrp Avid 1:1 10-bit RGB Packer S..... xsub DivX subtitles (XSUB)


When i follow the trace on you module i can see that: _run _prepare _checkCapabilities self.availableEncoders Anf finally: this._spawnFfmpeg(['-encoders'], { captureStdout: true }, function(err, stdout) { Which is where you use this flag, and this is used every time a command is run.

I can't tell you more about it though, just crossed it while debugging. And, i have no clue why this flag might be available sometimes and sometimes not. If you find out more about it, let me know.

njoyard commented 9 years ago

Oh, so you're talking about -encoders not -encounters.

What ffmpeg version are you using ?

morgangiraud commented 9 years ago

One from the official repo of my ubuntu server and one from Jon Severinsson's FFmpeg PPA repo. Both of them didn't have that flag. Don't know the version anymore, now i have rebuilt ffmpeg from the git repo. #master and everything works as expected.

Sorry for the typo, didn't see it in my previous post, fixed it.

njoyard commented 9 years ago

ffmpeg from ubuntu repos is actually avconv, however it should support -encoders unless it's a really old version. I'm quite surprised Jon's build does not support it, either; it should be quite recent a version.

Did you apply any specific config option when building ffmpeg to ensure -encoders is present, or did you just do the default build ?

morgangiraud commented 9 years ago

From the history, here is the set of commands i typed

apt-get -qq remove ffmpeg sudo add-apt-repository ppa:jon-severinsson/ffmpeg && sudo apt-get update -qq apt-get install ffmpeg ffmpeg -encoders <- this one didn't worked

Just did the default build.

njoyard commented 9 years ago

Oh btw which ubuntu version are you running ?

morgangiraud commented 9 years ago

I'm on Ubuntu 13.10

amincheloh commented 9 years ago

+1 for this issue.

I am using ffmpeg from ppa:jon-severinsson/ffmpeg on Ubuntu 12.04

njoyard commented 9 years ago

I may add an option for those old versions without -encoders to bypass checks. That's really weird, though, this option is as old as time itself AFAIK.

vogonistic commented 9 years ago

I have the same issue. There is an option called -codecs that provides the same information and more that could be used instead or as a fallback. The flags are slightly different though.

njoyard commented 9 years ago

@vogonistic can you tell me which version you're using, and on which OS ?

vogonistic commented 9 years ago

If I build ffmpeg myself, I have both -encoders and -codecs. The problematic Ubuntu version is what I get through circleci.org.

ubuntu@box87:~$ ffmpeg
ffmpeg version 0.8.17-4:0.8.17-0ubuntu0.12.04.1, Copyright (c) 2000-2014 the Libav developers
  built on Mar 16 2015 13:26:50 with gcc 4.6.3
The ffmpeg program is only provided for script compatibility and will be removed
in a future release. It has been deprecated in the Libav project to allow for
incompatible command line syntax improvements in its replacement called avconv
(see Changelog for details). Please use avconv instead.
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Without researching further, I'd say it's not ffmpeg at all, just a shim for avconv that parses most options like ffmpeg with obvious issues.

I think the main issue I have is that fluent-ffmpeg fails on the -encoders check, but if I run with a simple shim like this it runs just fine, even though that format is different:

#!/bin/bash

if [[ "$@" = "-encoders" ]]; then
  exec ffmpeg -codecs;
fi

exec ffmpeg "$@"
njoyard commented 9 years ago

Thanks.

For this specific issue I think you're better off filing a bug against avconv and their ffmpeg stub/wrapper.

I'm willing to introduce real avconv support in fluent-ffmpeg but it should be complete and run the actual avconv binary. And that's a lot of work...

vogonistic commented 9 years ago

I agree that they've failed in their coverage of ffmpeg options, but I don't think it's ok for fluent-ffmpeg to fail completely because -encoders returns exit code 1 when the actual work I want it to do works fine.

ahmed-sharief5 commented 6 years ago

s3 bucket signed url is not working its showing 'No such file or directory'