Closed doubutunomorai closed 6 years ago
Inside the options
table? As this is evaluated when the script launches (which is probably before any video is loaded), mp.get_property("filename/no-ext")
might be empty - checking the logs for the actual command line used to encode should confirm that. Also, no, that's not what additional_flags is intended for. You should probably add this to the encode
function directly.
Only using a text string as an argument for "--oset-metadata=title=" doesn't actually influence the metadata either.
That's weird. I might look at this later, but AFAIK --ocopy-metadata
(which is enabled by default) works, so there's no reason for --oset-metadata
to not work as well.
Are you sure your mpv version is updated? --oset-metadata
is a quite recent feature, merged only 5 days ago.
Thank you for your response, it's working now. Adding the "--oset-metadata=title=" .. mp.get_property("filename/no-ext")
flag to command
did the trick.
Is there any reason that this isn't the default behavior ? It seems to me that this would be useful to many people and an issue for nobody.
@bveuille
At the time that the issue was opened, --oset-metadata
was a pretty recent command, and adding it to the script would most certainly break for most users.
Now, I still think this is a pretty specific usecase, and, well, I don't think it's that useful. It embeds the filename on the metadata, but the filename of the original file is in the resulting encode. Also, it might override existing metadata (notice that metadata is copied by default by mpv).
I'm trying to have the script add the filename of the source video to the metadata of the created webm as a "Title", so people don't have to ask for sources as often. I added an
"--oset-metadata=title="
flag into the additional_flags line so that it readsadditional_flags = "--oset-metadata=title=" .. mp.get_property("filename/no-ext"),
but it doesn't seem to affect anything. Only using a text string as an argument for"--oset-metadata=title="
doesn't actually influence the metadata either. Is this not what the additional_flags line is for, or am I doing it incorrectly?