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
Better option handling, add filter iterator, expose filter options #243
Conversation
Looks pretty great. I'm not keen on Dealing with which options exist can be a build-time check and defining macros for those which don't exist. That will nearly double the size of the checks. I wonder if there is a compile-time option, or if we can divine a smaller set of options to check the existence of (e.g. many of them which were added at once). To be frank, I barely care about supporting LibAV anymore. If we have a nice solution for FFmpeg that is good enough for me. I'll go look at editorconfig, because I am also getting tired of whitespace problems. |
@mikeboers I thought about conditional compiling for option types but it would be a lot of work for no apparent benefit if you don't care about supporting LibAV. And it doesn't seem like anyone else cares much :) But what would be the lowest supported version of ffmpeg in this case? Regarding |
I took a quick look at the Libav source code, and the option enum layout is identical. I propose the dumb idea of just copying the latest FFmpeg enum definition into PyAV. Then it isn't a worry for version * goes to look at older FFmpeg Seems like FFmpeg added Regarding the iter, making a generic one sound like a huge pain (unless I go ahead with switching all the source code to be run through a template engine first). I vote for generators. |
See 749c9d9. |
So a similar thing is in codec.codec called |
I don't want to say it should. I want to say they should all be the same, but I don't really feel too strongly one way or the other to be honest. I'd welcome an argument for one or the other or both. |
LOL at the typo. We can change that. ;) |
They should definitely be same in the way they work. Also 👍 on 749c9d9. |
Okay. My vote is just on the set of names then. I'll take care of it (unless you already are). |
I'll do it, no problem. I also have to cleanup option types. |
Cool, thanks. I fixed the typo and changed the name of the formats set to match, and added a very simple test that they simply exist in f2474ae (Hope I'm not stepping on your toes. I'll go do something else. 😉) |
So apparently, the newest option type is UINT64 (only since ffmpeg 3.3). But I haven't found where it's used in options so we can leave it disabled for now. |
@mikeboers Added Option.offset as well to be able to tell which options are aliases. That should be all for this PR (along with your changes in feature/options, of course). |
Done. Thanks a ton! |
Cool! Looking forward to go deeper into PyAV once I get my basic setup working. |
Sweet. At some point I want to get a better understanding of these descriptors, what classes to they apply to and when, and make sure they are being used everywhere they can be and to their fullest extent. I don't think we currently supply get/set methods on options. That would be cool. |
Heads up! I'm going to rewrite history for a moment. I'm going to roll back that merge, and change a few variable names to fit my personal idea of how to not stick to FFmpeg to be more Pythonic. I'm a jerk. I know. ;) |
@skirsdeda Per your suggestion at the very top of using editorconfig, I've added such a file, and I've written 🎉 |
@mikeboers terrific! |
As per discussion in PyAV-Org#243.
Options:
AV_OPT_TYPE_CONST
options toDescriptor.options
, instead implementOptionChoice
andOption.choices
(work just like print_options in ffmpegmin
,max
,default_val
toOption
Filters:
FiltersIter
to iterate through all registered filters usingavfilter_next
descriptor
and it'soptions
inFilter
Considerations: