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

Full list of options that can be set on FFmpegFrameGrabber/FFmpegFrameRecorder #2300

Open
enwi opened this issue Nov 21, 2024 · 2 comments
Open

Comments

@enwi
Copy link
Contributor

enwi commented Nov 21, 2024

In a previous issue the following options where given as working with FFmpegFrameRecorder and I am assuming the same goes for FFmpegFrameGrabber. Though it would be great to have a full list of options that work. For my part I would like to know whether the loglevel option can be set or not? (I tried setting the option, but it did not change anything)

setOption() is for at least the following options:
https://ffmpeg.org/ffmpeg-formats.html
https://ffmpeg.org/ffmpeg-protocols.html
https://ffmpeg.org/ffmpeg-devices.html
but maybe others too.

setAudioOption() and setVideoOption() are for the options here:
https://ffmpeg.org/ffmpeg-codecs.html

That should be better documented probably in the API docs with Javadoc,
so please send a pull request to that effect! Thanks

Originally posted by @saudet in #1356 (comment)

@enwi
Copy link
Contributor Author

enwi commented Nov 21, 2024

I did some more debugging and found that both pixel_format and loglevel options are rejected by FFmpegFrameGrabber. I figured this out using a debugger and dumping the options after calling avformat_open_input, which should then include any rejected options.

AVDictionaryEntry e = null;
while ((e = av_dict_iterate(options, e)) != null)
{
    System.out.println("Key: " + e.key().getString() + ", value: " + e.value().getString());
}
Key: pixel_format, value: bgr24
Key: loglevel, value: +level+verbose

Maybe these rejected options should be dumped to the console if there are any?

if (av_log_get_level() >= AV_LOG_INFO && av_dict_count(options) > 0)
{
    AVDictionaryEntry e = null;
    System.out.println("Rejected options:");
    while ((e = av_dict_iterate(options, e)) != null)
    {
        System.out.println("\tOption: " + e.key().getString() + ", value: " + e.value().getString());
    }
}

@saudet
Copy link
Member

saudet commented Nov 21, 2024

Sure, contributions are welcome!

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

No branches or pull requests

2 participants