Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avformat: vbr parameter should also accept integer values #982

Open
gsnoff opened this issue Apr 30, 2024 · 1 comment
Open

avformat: vbr parameter should also accept integer values #982

gsnoff opened this issue Apr 30, 2024 · 1 comment

Comments

@gsnoff
Copy link

gsnoff commented Apr 30, 2024

Currently when I specify vbr=4 while using the libfdk_aac encoder, something like this happens:

$ melt -consumer avformat:bar.mp4 vcodec=h264_vaapi vprofile_high vq=25 compression_level=1 acodec=libfdk_aac vbr=4 movflags=+faststart foo.mlt
...
[libfdk_aac @ 0x7f4118312c40] [Eval @ 0x7f411d412eb0] Undefined constant or missing '(' in 'on'
[libfdk_aac @ 0x7f4118312c40] Unable to parse option value "on"
[libfdk_aac @ 0x7f41183130c0] [Eval @ 0x7f411d412f20] Undefined constant or missing '(' in 'on'
[libfdk_aac @ 0x7f41183130c0] Unable to parse option value "on"
[libfdk_aac @ 0x7f4118312c40] VBR quality 472 out of range, should be 1-5
[libfdk_aac @ 0x7f4118312c40] Note, the VBR setting is unsupported and only works with some parameter combinations

Apparently MLT attempts to represent any non-false value for the vbr parameter as on boolean value, before passing to libavformat. This may be correct for codecs like libopus, which do expect a boolean value in this parameter. However the libfdk_aac codec actually expects an integer there (see https://trac.ffmpeg.org/wiki/Encode/AAC#fdk_vbr).

(MLT 7.22.0, Debian GNU/Linux testing 13 'trixie', with Deb Multimedia Packages, Linux 6.6.15)

@ddennedy
Copy link
Member

MLT (see src/modules/avformat/consumer_avformat.c) does not treat "vbr" as boolean. It handles it generically by supplying the value as a string using av_opt_set(). Many AVOptions take a numeric or string value. I do not know why FFmpeg has a problem converting a string to an integer, which is rather trivial compared to converting video! ;-) Search that code file, and there is no "vbr" or "on" string in it! So, maybe this is some bug internal to your FFmpeg version. (I do not use libfdk_aac anymore to test this myself.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants