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
CLI --quality option support for environment variables #778
Comments
Hi @michaelGregoire! Thanks for filing the issue. After some tinkering, I find that this is purely a behavior of the shell / npm scripts and not with Remotion - you cannot define env variables this way. For example: "scripts": {
"quality": "QUALITY=50 echo $QUALITY"
}
But what would work is Potentially interesting for you: You may also use the config file and script it with Typescript: https://www.remotion.dev/docs/config#setquality |
Thanks @JonnyBurger. It turns out I was doing what I wanted to do initially wrong. I had started with the following and it seemed to work for FRAMES, but when I added QUALITY, it failed: "build:frames": "remotion render --frames=${FRAMES:0-100} --image-format='jpeg' --quality=${QUALITY:50} src/index.jsx IDENTIFIER out/segment.mp4", …so I moved on to what I previously showed you, which as you already know doesn't work: "build:frames": "FRAMES=0-1000 QUALITY=50 remotion render --frames=$FRAMES --image-format='jpeg' --quality=$QUALITY src/index.jsx IDENTIFIER out/segment.mp4", So I was misremembering how to do the first method. What I needed to do was the following, which works: "build:frames": "remotion render --frames=${FRAMES:-0-100} --image-format='jpeg' --quality=${QUALITY:-50} src/index.jsx IDENTIFIER out/segment.mp4", Now, I can override with environment variables like so: FRAMES=0-1000 QUALITY=70 npm run build:frames |
Perfect, glad the problem is resolved! |
So, I'm adding a couple custom scripts to my package.json to make rendering a little more configurable via environment variables. One of the scripts I added is the following:
As you can see, I'm making the
--frames
and--quality
configurable via environment variables in the command line.--frames
works perfectly. However,--quality
complains that the value provided by the environment variable is a string and seems to end up with an empty string.It would be great if the option passed the value through to parseInt() and then only throw the error when the output from parseInt() is
NaN
.The text was updated successfully, but these errors were encountered: