This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Poll: Would you like to see these features implemented?
You do not have permission to vote in this poll.
Yes
33.33%
1 33.33%
Some
33.33%
1 33.33%
No
0%
0 0%
Don't care
33.33%
1 33.33%
Total 3 vote(s) 100%
* You voted for this item. [Show Results]

Feature Suggestions Regarding Automatic Filename Generation
#11
Quote:Hmm... It would also need a way of being pointed towards user's baseline reference for Encoding settings or it won't be able to shorten the output, as well as towards the correct '*_Report.txt' file for PSNR & SSIM parsing if/when implemented. Other than that this looks good.
That would both be some for some later version of the program.

To support only showing a portion of the 'Encoding settings' an additional parameter like:
--showEncodingSettings=[param1, param2,..]
would be needed.
The tool would then additionally need to:
a. grab the 'Encoding settings' in case they exist.
b. split them by " / " and check whether there is an entry for "paramX=" and then add those values to the new file name.

For PSNR, SSIM at least two additional parameters would be needed.
--reportFile="Path to report file"
and
--report1="regexp to capture the wanted"

Problem is:
a. something like
x264 [info]: SSIM Mean Y:0.9999810 (47.223db)
x264 [info]: PSNR Mean Y:73.727 U:72.391 V:72.120 Avg:73.127 Global:69.056 kb/s:87.37
Would need to be converted to something like:
SSIM Mean Y 0.9999810 (47.223db) PSNR Mean Y 73.727 U 72.391 V 72.120 Avg 73.127 Global 69.056 87.37 kBit per second
which is really length,... Note that ':' (colon) can't be used since it's a reserved character.
b. most folks won't be able to write RegExps which I can directly feed to Qt. So this wouldn't be that easy, especially if folks should be able to select what should be added and how it should be added.

=> Writing a small program which covers the
MediaInfoRenamer --Inform=<InformCall> --Separator=<used seperator> --Merger=<append> <File>
functionality is relatively simple and probably just an hour or two programming.

Adding the parts of the 'Encoding settings' and PSNR and/or SSIM values is a lot more work.

Cu Selur
Reply
#12
I wrote the basic version of MediaInfoRenamer (see: https://github.com/Selur/MediaInfoRenamer) and attached a 64bit Windows binary here. Smile
(copying it into you Hybrid folder should make it usable)

Cu Selur

---
Edit: binary is now in a later post
Reply
#13
About the encoding settings.

I could add an additional option like:
--EncodingSettings=<encoding>
Quote:Parameter:
--EncodingSettings: string which specified what parameters should be represented how

So for example:
--Separator="#" --Merger="_" --EncodingSettings="CRF %crf=%#Fast-Intra %fast-intra%"
would take a "Encoding settings" string like:
cpuid=1173503 / frame-threads=4 / numa-pools=16 / wpp / no-pmode / no-pme / no-psnr / no-ssim / log-level=2 / input-csp=1 / input-res=640x480 / interlace=0 / total-frames=0 / level-idc=0 / high-tier=1 / uhd-bd=0 / ref=3 / no-allow-non-conformance / no-repeat-headers / annexb / no-aud / no-hrd / info / hash=0 / no-temporal-layers / no-open-gop / min-keyint=25 / keyint=250 / bframes=4 / b-adapt=2 / b-pyramid / bframe-bias=0 / rc-lookahead=20 / lookahead-slices=0 / scenecut=40 / no-intra-refresh / ctu=64 / min-cu-size=8 / no-rect / no-amp / max-tu-size=32 / tu-inter-depth=1 / tu-intra-depth=1 / limit-tu=0 / rdoq-level=2 / dynamic-rd=0.00 / no-ssim-rd / signhide / no-tskip / nr-intra=0 / nr-inter=0 / no-constrained-intra / strong-intra-smoothing / max-merge=2 / limit-refs=3 / limit-modes / me=1 / subme=2 / merange=57 / temporal-mvp / weightp / no-weightb / no-analyze-src-pics / deblock=-1:-1 / sao / no-sao-non-deblock / rd=3 / no-early-skip / rskip / no-fast-intra / no-tskip-fast / no-cu-lossless / no-b-intra / no-splitrd-skip / rdpenalty=0 / psy-rd=2.50 / psy-rdoq=10.00 / no-rd-refine / analysis-reuse-mode=0 / no-lossless / cbqpoffs=-2 / crqpoffs=-2 / rc=crf / crf=18.0 / qcomp=0.60 / qpstep=4 / stats-write=0 / stats-read=0 / ipratio=1.40 / pbratio=1.30 / aq-mode=1 / aq-strength=0.00 / cutree / zone-count=0 / no-strict-cbr / qg-size=32 / no-rc-grain / qpmax=69 / qpmin=0 / no-const-vbv / sar=1 / overscan=0 / videoformat=5 / range=0 / colorprim=2 / transfer=2 / colormatrix=5 / chromaloc=0 / display-window=0 / max-cll=0,0 / min-luma=0 / max-luma=255 / log2-max-poc-lsb=8 / vui-timing-info / vui-hrd-info / slices=1 / no-opt-qp-pps / no-opt-ref-list-length-pps / no-multi-pass-opt-rps / scenecut-bias=0.05 / no-opt-cu-delta-qp / no-aq-motion / no-hdr / no-hdr-opt / no-dhdr10-opt / analysis-reuse-level=5 / scale-factor=0 / refine-intra=0 / refine-inter=0 / refine-mv=0 / limit-sao / ctu-info=0 / no-lowpass-dct / refine-mv-type=0 / copy-pic=1
and look for 'crf=' and 'fast-intra'.
It would then detect: 'crf=18.0' and 'no-fast-intra' and convert those to:
"CRF 18.0_Fast-Intra false"

This would allow to add 'Encoding settings'-part to the file name.

About adding both 'Inform' and 'Encoding settings':
To allow mixing of 'Inform' and 'Encoding settings' multiple instances of both parameters would be accepted and their order would determine the order in which they are added.
Options like:
--Separator="#" --Merger="_" --Inform="Video#Width %Width%%" --EncodingSettings="CRF %crf=%" -Inform="Video;Height %Height%%"
could result in a name addition like:
Width 660_CRF 18.0_Height 480

=> Should I add this? Any thoughts about it?

Cu Selur
Reply
#14
(19.11.2017, 05:54)Selur Wrote: About adding both 'Inform' and 'Encoding settings':
To allow mixing of 'Inform' and 'Encoding settings' multiple instances of both parameters would be accepted and their order would determine the order in which they are added.
Options like:
--Separator="#" --Merger="_" --Inform="Video#Width %Width%%" --EncodingSettings="CRF %crf=%" -Inform="Video;Height %Height%%"
could result in a name addition like:
Width 660_CRF 18.0_Height 480

=> Should I add this? Any thoughts about it?
Sure, it would have it's uses, however it wouldn't be quite as useful by itself as with a blacklist for baseline settings.

I've been trying to identify and categorize potential problems and solutions relating to special characters for couple of hours now. Looks like MediaTab output differs in some ways from what MediaInfoRenamer produces, so the list below might not be completely accurate, but here goes:

I'd use a RegEx based output filter for replacing any unusable characters, the main ones i keep seeing used in MediaInfo output being: '/' & ':'
  1. RegEx Replace: all instances of "kb/s" with "Kbps".
  2. As exceptions to oncoming stages: RegEx Replace ':' with '÷' for 'Display aspect ratio' & '/' with '÷' for 'frame rate'.
  3. RegEx Replace ':' with either '¦' or ' - As these would be very readable in the context of timecodes, which seem to be the main usage case here (aside from 'Display aspect ratio'), unlike '.' or ';' which already seem to have a specific uses in the context of timecodes and would require further replace actions for the sake of clarity.
  4. RegEx Replace '/' with ';' - As the former seems to be mostly used in listing stuff like 'Channel positions' & 'Encoding settings' (aside from 'Frame rate'), while the latter is previously unused in those contexts while also having a similar meaning in everyday use.
  5. RegEx Replace " with ' - I'm not sure if this is even used anywhere as i didn't encounter any examples, however it's the closest match.
  6. RegEx Replace any of these: '/\|?*' with '' (as in nothing) or perhaps '_'
Reply
#15
Letting users specify RegExs is a bad since most users can't use them. So this would only be an additional option for advanced users.
What you specified there are just replacement so an additional option could be added:
--Separator="#" --Replacements="kb/s%Kbps#:%¦"
this would tell the Renamer to replace "kb/s" with "Kbps" and ":" with "¦" inside part of the additions string.
So
640 pixels_352 pixels_722 kb/s_25.000 FPS
from before, would end up ad:
640 pixels_352 pixels_722 Kbps/s_25.000 FPS
As a side note: Replacing "kb/s" with "Kbps" is a bad thing since the first implies k = 1000 and the second K = 1024. (see: https://en.wikipedia.org/wiki/Kilobit)

Cu Selur
Reply
#16
(19.11.2017, 06:51)Selur Wrote: Letting users specify RegExs is a bad since most users can't use them. So this would only be an additional option for advanced users.
Actually i was just looking at the problem from the perspective of execution order and one possible method used, not from end-user's perspective, as in what to show them.

(19.11.2017, 06:51)Selur Wrote: What you specified there are just replacement so an additional option could be added:
--Separator="#" --Replacements="kb/s%Kbps#:%¦"
this would tell the Renamer to replace "kb/s" with "Kbps" and ":" with "¦" inside part of the additions string.
So
640 pixels_352 pixels_722 kb/s_25.000 FPS
from before, would end up ad:
640 pixels_352 pixels_722 Kbps/s_25.000 FPS
Looks good. PS. Just realized that the exceptions from second step of my RegEx example would give the simple replacement approach trouble when those symbols are also required in another context. (e.g. %AspectRatio/String% & %Duration/String4% both use ':')

(19.11.2017, 06:51)Selur Wrote: As a side note: Replacing "kb/s" with "Kbps" is a bad thing since the first implies k = 1000 and the second K = 1024. (see: https://en.wikipedia.org/wiki/Kilobit)
Indeed, i was copy-pasting lines from MediaTab while comparing them to MediaInfoRenamer outputs and failed to catch that.

PS. I kept seeing multiple output format choices in MediaTab and after some testing found out that there is an undocumented feature in MediaInfoRenamer: Replacing '/String' with '/String1', etc. will give different output formats when available. Order equivalence to MediaTab is: '%StreamSize%', '%StreamSize/String%', '%StreamSize/String1%', '%StreamSize/String2%', etc.
Reply
#17
Here's a MediaInfoRenamer build which also supports:
  • '--EncodingSettings':  analog zu den 'Inform'-parameter once specified
    that some of the encoding setting should be added to the output name.
  • '--Replacements': List of replacements separated by 'Sepearator'
    Note now multiple instances of '--Inform' and '--EncodingSettings' can
    be used

Cu Selur
Reply
#18
(19.11.2017, 10:02)Selur Wrote: Here's a MediaInfoRenamer build which also supports:
  • '--EncodingSettings': analog zu den 'Inform'-parameter once specified
    that some of the encoding setting should be added to the output name.
  • '--Replacements': List of replacements separated by 'Sepearator'
    Note now multiple instances of '--Inform' and '--EncodingSettings' can
    be used

Cu Selur
Got around to properly testing this build today and found that while '--Replacements=' works as specified above, '--Encoding settings' doesn't alter the filename at all, unless '=' is removed. As an example:
"MediaInfoRenamer.exe" --EncodingSettings="crf %crf=%#ipratio#pbratio=#qcomp%qcomp%" --Separator="#" --Merger="_" test.mkv
Results in a file named 'test_0.80%0.80%.mkv' (when qcomp = 0.8)

PS. Being able to use wildcards to select multiple files for input and/or removing parts of an already long filename(s) would make this tool easier to integrate into one's workflow.
For example: test*.mkv for renaming both 'test1.mkv' & 'test2.mkv' or 'MediaFile_*.mkv' for renaming previously renamed 'MediaFile_1001kbps.mkv' & 'MediaFile_23.976fps.mkv'.
Reply
#19
LOL, I see my mistake. Smile
+
your call should be:
"MediaInfoRenamer.exe" --EncodingSettings="crf %crf%#%ip_ratio%#%pb_ratio%#qcomp%qcomp%" --Separator="#" --Merger="_" test.mkv
Reply
#20
(23.11.2017, 20:56)Selur Wrote: LOL, I see my mistake. Smile
+
your call should be:
"MediaInfoRenamer.exe" --EncodingSettings="crf %crf%#%ip_ratio%#%pb_ratio%#qcomp%qcomp%" --Separator="#" --Merger="_" test.mkv
I realize above isn't proper usage; systematically running through variations while removing stuff was just my method for narrowing the problem down to '=', so i decided to retain the variations in my example to better showcase the way this feature is broken.

"MediaInfoRenamer.exe" --EncodingSettings="crf %crf%#%ip_ratio%#%pb_ratio%#qcomp%qcomp%" --Separator="#" --Merger="_" test.mkv
Filename resulting from the corrected example you posted is: 'test_28.0 %28.0%_0.80%0.80%.mkv'
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)