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

Error passing brackets to the --x265-params option #119

Closed
martinpickett opened this issue Oct 4, 2021 · 3 comments
Closed

Error passing brackets to the --x265-params option #119

martinpickett opened this issue Oct 4, 2021 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@martinpickett
Copy link

If you pass a KEY:VALUE pair with --x265-params where the VALUE contains brackets, other-transcode throws an error "/usr/local/lib/ruby/gems/3.0.0/bin/other-transcode: invalid argument:".

Luckily the fix seems simple, inserting just four characters to line 846 solves my problem. The offending line checks the validity of KEY:VALUE pairs with a regular expression, changing the expression slightly to allow brackets is all that is required. What I did, with a bit of context, is as follows.

Current:

opts.on '--x265-params ARG' do |arg|
    arg.split ':' do |param|
        fail UsageError, "invalid argument: #{arg}" unless param =~ /^[\w\-]+=[\w\-\.,]+$/
    end

New:

opts.on '--x265-params ARG' do |arg|
    arg.split ':' do |param|
        fail UsageError, "invalid argument: #{arg}" unless param =~ /^[\w\-]+=[\w\-\(\)\.,]+$/
    end

The four magical characters are \(\) inserted into the second half of the regular expression.

I am sure there are other ways to fix this issue so please do what you like, but without brackets, no one can do HDR10 encoding with other-transcode.

@lisamelton lisamelton self-assigned this Oct 4, 2021
@lisamelton lisamelton added the bug Something isn't working label Oct 4, 2021
@lisamelton
Copy link
Owner

@martinpickett Thanks for opening this! And finding and fixing the bug. :)

@lisamelton
Copy link
Owner

The fix (slightly different) is checked in now.

@martinpickett
Copy link
Author

Thanks. I have checked out the change and it is working for me on my Mac.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants