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

autocrop and vf-metadata improvements #752

Closed
wants to merge 4 commits into from

Conversation

kevmitch
Copy link
Member

The most important thing here is the bugfix to properly handle NULL metadata (libav). I've also enhanced autocrop.lua. It is now suitable to put in ~/.mpv/lua as it does nothing until asked. It also samples the whole file to determine appropriate crop parameters (the only bullet-proof method).
I'll understand though if you'd rather keep that commit out as it makes the script significantly more complex. On the other hand, it demos more of mpv's lua capabilities.

lavfi would segfault due to a NULL dereference if it was asked for its
metadata and none had been allocated (oops). This happens for libav
which has no concept of filter metadata.
It might have been nice not to do this so that metadata could
accumulate accross seeks, but it seems libavfilter looses its copy
anyway on recreate_graph.
It now inserts no filters and does nothing until the hot-key is pressed.
This makes it more suitable to be put in ~/.mpv/lua.

When they hot-key is pressed, it now removes any existing crop filter and
inserts the cropdetect filter. It then samples the whole file to determine
crop parameters and uses them to insert the new crop filter. The cropdetect
filter is then removed and the original file position restored.
@kevmitch kevmitch closed this Apr 29, 2014
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

Successfully merging this pull request may close these issues.

1 participant