-
Notifications
You must be signed in to change notification settings - Fork 118
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
[FEATURE REQ] Variables/tokens in output file name #50
Comments
I've never used variable tokens with ffmpeg before, I'm not sure if it supports that, I will have to ask. What if I had an output naming section with checkboxes that let you select which settings you want displayed in the output filename? I would have C# variables generate the output filename automatically in the script, then you wouldn't need ffmpeg syntax.
outfilename.mp4 outfilename Intel-QSV x265 CRF25 yuvj420p 1080p AAC 320k.mp4 |
That's a great idea. It eliminates the work of parsing the output filename. I have one more thought, to avoid typing or copy/paste into the Output filename field altogether -- split the Output Naming Section in two, adding a section to copy parts of the input filename: Suffixes The final output filename would be a concatenation, in order, of:
Notes
ExamplesAll the examples below assume:
Notes:
|
I will go over this and try to add these features. The first release might be more simplified until it is complete. The Output File Namer in Axiom might already handle some of the path issues. It also has a File Renamer that appends (1) to the name if it already exists, to avoid accidental overwrite. The File Settings Namer will work similar to how the Subtitle menu works. You'll be able to position the settings in the order that you want if needed. Checked settings will be applied to the output filename. You can also Select All, Deselect All, and Load Defaults. It will take some time to complete, I have to make it work with the axiom.conf config file, so it saves the selected settings on exit. |
I've released an update here I have not uploaded the version file yet, so it will not notify users, and the update button in the program won't detect it. If you will test it for me first, then I will release the official update in 2 days. Example Output File NamingFormat Video Audio
Instructions
|
It's looking great! I like how you did the interface. I did a couple of quick tests, but unfortunately I won't be able to do more extensive testing for a few days. So far, I found:
But overall, this is a phenomenal first version! |
Thanks for testing, I will take a look at these issues and re-upload some improved versions over the next 2 days. I'll notify you when I release a fix.
|
I've updated the https://github.com/MattMcManis/Axiom/releases With the new version fixes:Output Name Edits Only edit the Output Filename in the Save File Dialog Window. When you click But if you edit the name in the Output TextBox while it already has Name Tokens The only way to fix this is to have some New Token Additions Video Codec Copy You'll see them in the Settings Tab Output Naming section, at the bottom of the list. They are separate settings from Press the Load Defaults ↺ button to automatically reorder the list. Doing this will uncheck them all, so you'll have to re-check the ones you want. I would find a way to make it insert newly added token imports in the correct order, but I don't plan on adding many more token types, so it shouldn't be an issue in the future. |
I've added the Regex Token Remover. https://github.com/MattMcManis/Axiom/releases When you edit the file name in the Output TextBox, the program can't see what part of the text you changed, so it doesn't understand there's a new file name. So now I have it backwards engineer the new name by stripping the tokens. You edit output name text: The Regex Token Remover: 1. Strips the tags, leaving only your new file name text. 2. Saves the name to a variable. 3. Re-applies the Tokens. It does this in a split second as you type. Here's an example of |
Thanks for testing. I'm making more improvements. I'm not sure I want to add another field for the naming, I'm trying to keep the program compact. I'll see if I can make some adjustments so you can edit the tokens. For Process Priority, I could add a Shell Title menu. What if I had a toggle with the options for User Custom, which leaves it blank |
I've attached an update I overhauled all the code behind the Output Button and I added the Shell Title Menu with options:
There were a few bugs in the I have not yet tested it all extensively. |
I was able to do a quick run, and found a bug:
Just fyi, I was about to report this bug on version 1.9.1.3, for which the filename became: Really like the options on the drop-down for window title, but I would change the word "Job" to "Filename". I almost didn't try it, thinking it would be "process number". I was going to write here that I didn't like the options, but figured I better try it first. And then I was surprised to see that it really is the filename. Now I love it, and the fact that you give options for filename only, tokens only, or both, is really useful! |
Minor issue: Same setup as above, but tried to change the extension in the Output field to ".mp4". |
On the prior bug, another case, same sequence, this time without a period in the filename: Then manually deleting "x264" in the Output text, then click "Script", results in : |
It's regex errors, catching the wrong sections of the text. The regex rules for file formats Here's the regex generated for your selected options: My new idea is to remove the Tokens Display from the Output TextBox and have them only appear in the Script. That way user can edit the original name in the Output TextBox without the Regex Remover messing it up. Then if you want to edit any Tokens, you can do so in the Script and the Regex Remover won't interfere. Then press Run and it will use your custom changes. Another thing is that I did not anticipate using Input Files that already have tokens in the name. Maybe I will extend the Token Remover to remove other Tokens that were applied by users or other programs, to prevent Tokens from doubling up. |
I've redesigned the Token system. Tags will be the term I use for Input Filename Settings. In the Settings Tab, I added an Input section, with a Tags Menu. This will try to strip all possible Tags out of the Input Filename, revealing the Original Filename.
Now the Output Filename can have new Tokens applied to the Original Filename.
|
Hmmm... I think this is confusing. First, removing the Output Tokens from the Output TextBox, and showing them only in the script, is definitely better, because the user now won't think the tokens are editable. On the other hand, I find the name of "Tags" for the input confusing, because it is a non-standard use of the word. "Tags" are used for many other purposes (i.e. tagging), and this makes it hard to think of that word in this context. But also, why is this even necessary? Now that you don't have tokens in the Output field, you don't need the Regex Token Remover at all. You have the "Input" field:
OR, perhaps a better idea, don't worry about auto-filling the Output field at all. Have a small button (an arrow pointing from the Input field to Output field) that "copies Input field to Output field", except substituting the extension given the "Container" selection. And that's it. Sequence for most use cases:
That's it! User can click "Script" or "Convert". Separate thought that may no longer be applicable since I'm suggesting you no longer need the Regex Token Remover. You regex expression is trying to filter out all possible tokens individually. That's partly why it's so hard to cover all the cases. But, in the simple case, you know the entire token string (all the tokens) to be generated. Why not search and replace that entire string, instead of on a token by token basis? |
Wow... I just found a trick you may be interested in. It's really cool I have to search for these new tricks because your improvements have made it so easy to kickstart a bunch of processes and let them run. If "Quick Edit" is turned on, simply selecting text in the cmd window will pause the process! Alternatively, could use resmon, the Resource Manager, which provides a GUI option to suspend a process. The standard Task Manager does not have that option. |
I can change Tags to Tokens. You will need the Regex Token Remover because if the Input Filename has existing Tokens, the Output Naming will add the new Tokens alongside the existing ones.
Doubled Up Removed with Regex If the Input Filename has custom Tokens by users or other programs:
Removed with Regex I'll see about having it clear the Output TextBox every time the Input TextBox is changed. |
I don't understand why the first example is a problem: The "conflicting" tokens (eg x264 vs VP8, CRF20 vs CRF25) are just a happenstance that the Input file name has tokens, and so it's up to the user to deal with it. The ability to edit the Script is a good way to do that. In return, you gain simplicity, for both the user and you. You remove the chance that a user could be confused by the original filename being "changed" by the auto-fill. And you don't need the Regex Token Remover anymore. And if you want to retain the ability to remove tokens from the input (I can definitely imagine times when it could be useful) , I would make that a separate button, perhaps using an icon of a broom or some other "cleaning" icon. |
Updates:
Output Filename Spacing This can convert all
It cannot yet however convert
|
Hi... 1:40am here. Just glanced at this. Won't have time to download it and try it till tomorrow, but quick thoughts:
Good night! |
Update: Someone has given me a regex code that allows converting between all For Windows Properties Comments, I had looked into it before, but I think it was too complicated because there were many different file types that had different metadata tables, and some that Windows can't recognize. I think that since it's C# and uses some built-in Windows features to make file changes, it wouldn't work without some external library, such as |
Downloaded the new version:
|
For the Windows Properties Comments, I agree with your decision that it's not worth that much effort. You are right, there's a lot of different permutations. I found out the hard way, for example, that I can edit the properties of mp4 files but not of Matroska (mkv) containers. |
I'll fix those issue. I only added the Output TextBox clear on Input Button Press, I forgot to add it to Drag and Drop. I'll have to add those Tokens, Example, regex rules for Dolby Tokens alone need to cover: https://regex101.com/r/ggH54O/1 I'll have to see why it's combining leftover tags with no spaces |
Added Input Drag and Drop clears Output TextBox https://github.com/MattMcManis/Axiom/releases/download/v1.9.2.0-alpha/Axiom.zip Input Token Remover
Output Token Appender
Here's the regex. Let me know if you find any tokens that don't work. |
It's working great! One more token: YIFY |
Try out this version I want to avoid adding names of piracy groups into the code and program. I've only added general tokens. But I've added a text field where the user can add their own custom tokens and it will save/load them from the I've also added Input and Output Clear TextBox Buttons. |
You are totally right -- adding a field for user tokens is a much better solution. I mean, WHAT A JOB YOU'VE DONE! Right now, this is such a good tool! My workflow is exponentially faster. THANK YOU! Right now, I can't think of any more improvement ideas for the one-file-at-a-time use case. Just for the sake of contributing ideas for the future -- the next improvements I can think of are for queuing multiple runs. I will create a new issue for that titled "Queues" |
Thanks for testing. We really took the program far. The Remove option will still try to remove all general Tokens on its own, even if the Custom TextBox is empty, but the Custom TextBox will remove any extra Tokens you want to add. I've done a little more work on it and released it There will probably always be hidden bugs, as the program is so big it's hard for me to test on my own, that's why it's still in |
Ok, I submitted two issues and you solved them within a couple of days. Blown away!
So I'm probably over-reaching now :-), but here's another enhancement idea.
When I'm trying different permutations to see what quality/space/time tradeoffs are best in different situations, I end up naming my output files with the encoding parameters, e.g.:
"outfilename 1080p x265 crf35 p-superfast opus.mp4"
"outfilename 1080p x265 crf30 p-superfast opus.mp4"
"outfilename 1080p x265 crf25 p-medium opus.mp4"
etc.
Variable/token placeholders in the output filename would remove the need to edit the output filename in the script manually. For example:
"outfilename <size> <vcodec> crf<crf> p-<preset> <audiocodec>.mp4"
I chose the "<>" signs as the delimiters because a) those two characters are not allowed in Windows filenames , b) makes it easy to read, and c) thought it would be easier for a parsing routine than using the same character before and after the token (e.g. :crf: :size:). But I don't know if that's the best choice, or there is a more "standard" syntax that should be used.
Alternatives:
Can't say this enough -- thank you for this wonderful piece of work! ffmpeg syntax is so overwhelming at first glance. Without Axiom, I never would have gotten started using it.
References:
https://docs.microsoft.com/en-us/windows/win32/msi/filename
https://ffmpeg.org/ffmpeg-all.html#Syntax
https://blog.frame.io/2017/11/22/9-premiere-pro-export-settings/
https://workflow.frame.io/guide/file-naming
The text was updated successfully, but these errors were encountered: