18.11.2017, 04:11
(17.11.2017, 23:27)Selur Wrote: Btw. if overwriting is a real problem enable 'noOverwriting' through the misc.ini.Ok, ran some tests and this is somewhat better in that regard, but on the downside it results in very long filenames quite quickly. I'll leave this enabled for now, though.
see: [INFO] *hidden* Hybrid options,...
This way Hybrid should never overwrite an output file.
(18.11.2017, 01:01)Selur Wrote: Adding another folder which would be used instead of the temp folder seems wrong. That is what the temp folder is for.It would only need to be created when 'Keep intermediate files' is set.
(18.11.2017, 01:01)Selur Wrote: -> Adding an option which allows to name a folder that should be used as temp relative to the output folder might solve the problem, but in case the relatively specified temp folder wouldn't exist Hybrid would abort the job creation.This would in itself be acceptable for this type of usage scenario, automatically checking for and creating that folder on fly would be even better.
There are however other usage scenarios where setting dynamic paths would also be useful. For example if user were to run Hybrid in portable mode from an USB-stick (as i do) and then move it to another computer... Without dynamic paths you'll need to set these paths manually each time and remember to make sure each directory you set has enough free space available, rather than just checking the free space on the source file's drive.
(18.11.2017, 01:01)Selur Wrote: About adding data to the output name, it's the same problem as using tags.I guess this will be more of a problem for PSNR & SSIM readouts? In my experience MediaInfo at least seems fairly consistent in it's readouts.
The data has to come from somewhere, meaning the output would have to be parsed and then the tags or the last rename call would need to be adjusted accordingly.
Writing the parser is a pain since:
once the encoder changes the output just a little the option would be broken
each encoder would need a separate parser (since the outputs differ and not all encoders output all values);
Either way, personally i'd probably implement this using regular expression text searches, like this:
Cache MediaInfo output and search for metadata text readout matching: '[linebreak]File size: ' & copy contents from there on until next [linebreak] is found and remove any spaces. If no matches are found output nothing, if multiple matches are found output longest string by default, if multiple same length strings are found use the first one by default. This way you wouldn't need to separately add support for each possible tag.
It might also be useful to allow user to select one of the other matches and specify a limiter for string length. You could thereby let users specify custom searches using some RegEx like syntax such as:'filename_size=[File size: ]_rate=[{2}Bit rate: (3)]'
With '{2}' being one possible implementation for selecting the second match and '(3)' being one possible implementation of a custom limiter for cutting off excess text where necessary.
Example output in this case would be something like: 'filename_size=12345bytes_rate=123'+.extension
Since this would be a feature for advanced users, when something breaks, normally they'd be able to find out why and correct it for themselves.
PS. Adding PSNR & SSIM to custom tags and/or filename would certainly be a nice feature, but even MediaInfo readouts can be very useful by themselves.
Copying recent changes to 'Encoding settings:' over to filename could be somewhat tricky as well, but probably also the most useful.
Personally i would solve the Encoding settings parsing problem with something like this:
- On MediaInfo readout, RegEx Replace with nothing: '[linebreak]Encoding settings :' & copy rest of the line.
- Add extra [linebreak] at the very end & Replace every '/' with '[linebreak]' to use as separator for searching subsequent matches.
- RegEx Search for matches from user input using '[space]' as starting and ending character +'[linebreak]', in order to avoid false matches from parameters starting with 'no-' and ending with a multi-digit number.
- When it matches user input RegEx Replace it with nothing.
- RegEx Replace remaining '[linebreak]' characters with ';' and remove the last one.
- RegEx replace every '[space]' with nothing.
- Append the target filename with whatever is left.