View Full Version : StaxRip
burfadel
14th April 2017, 13:28
Yes, the CLI shutdown tool is pretty foolproof. The setting /f forces shutdown as some things may prevent the computer shutting down, and /t 0 will allow the shutdown to be instant instead of 1 minute.
The /t 0 could be useful, an additional option could be set to have an adjustable countdown that you can cancel a shutdown if the user changes their mind. This could be down through a Windows API etc, or simply with the function: timeout /t 30 (30 seconds for example), where the seconds can be adjusted through the Staxrip settings.
BTW, for me 1.4.1.4 works beautifully! The errant cpu usage when running more than one Staxrip process is completely gone.
stax76
14th April 2017, 14:09
@burfadel
Thanks for the help. I've added /f and because it's very simple to do a setting for the timeout found at Settings > System > Shutdown Timeout
Atlantis
14th April 2017, 18:44
@Atlantis
Here is a thread about the topic: https://forum.doom9.org/showthread.php?t=174389
Thank you. How about a simple HDR HDR compression? If I pass an HDR clip into staxrip and compress it a little, the output does not have the HDR info. When I run it through MadVR I see no HDR in the resulted encode.
lotnybartek
15th April 2017, 14:30
@lotnybartek
I remember having experienced qs performance drops same or similar, this looks more like a driver problem and can probably be reproduced without staxrip, maybe rigaya can help you with it.
Seem to work fine by just replacing the files, no breaking changes.
So yeah, you can fix the issue by changing energy settings in intels GPU panel, even while encoding, for ex. from high performance to default - back and forth. After that, performance is "normal".
Dope
17th April 2017, 10:58
@stax76
Can you please implement native Opus encoding instead of libopus
in ffmpeg by default?
https://hydrogenaud.io/index.php/topic,113806/
sneaker_ger
17th April 2017, 11:34
Don't you think we should give this new Opus encoder a bit of time to mature? At least wait for a public listening test. I'm also wondering about the multi-channel compression if it only support CBR at this point in time. This might be more relevant for the movie crowd using StaxRip than the music guys over at Hydrogen.
stax76
17th April 2017, 11:48
@Dope
ffmpeg requests are most of the time low priority because not often requested, on the other side usually they are easy to add so if you create a issue on the tracker there is a good chance that it will be added. For CLI tool requests please always post a command line example.
https://github.com/stax76/staxrip/issues
Dope
17th April 2017, 12:42
@Dope
ffmpeg requests are most of the time low priority because not often requested, on the other side usually they are easy to add so if you create a issue on the tracker there is a good chance that it will be added. For CLI tool requests please always post a command line example.
https://github.com/stax76/staxrip
I have absolutely no idea how to do that on that website. However, at hydrogen there is an example from a user.
"ffmpeg -i input.wav -strict -2 -c:a opus -b:a 64k output.opus"
@sneaker_ger
I partly agree.. however, there's this quote:
"Even though its a pretty basic encoder its already outperforming
any other native encoder FFmpeg has by a huge amount."
sneaker_ger
17th April 2017, 12:56
Yes, but ffmpeg's native audio encoders have never been known to be particularly good. Either way we should measure it against libopus.
I just did a short test with ffmpeg's native opus encoder and it seems to be limited to stereo.
I have absolutely no idea how to do that on that website.
"Sign up" on the top right. After signed up/logged in you go into the "issues" section on the page Stax linked to and click "New issue".
Dope
17th April 2017, 13:10
Yes, but ffmpeg's native audio encoders have never been known to be particularly good. Either way we should measure it against libopus.
I just did a short test with ffmpeg's native opus encoder and it seems to be limited to stereo.
Wow, that's too bad.
"Sign up" on the top right. After signed up/logged in you go into the "issues" section on the page Stax linked to and click "New issue".
Thanks for your help!
Yanak
17th April 2017, 13:28
Hello all and hello Stax, really glad to see this is still going on,
Updated to last 1.4.2.2 version ( had not updated since a while, really liking some fixes and the addition of icons possible for custom menus; don't like the new program icon and what it could mean to this program tho :p ) but something seems to have changed or i am doing something wrong.
I had a custom filter menu to add a logo into videos, it was this :
Logo = logo=ImageSource("F:\logo.png").Overlay(logo, x = 3, y=3, opacity=0.45, mode="luma")
It was working nicely on older versions, but now when I call it the program returns me an error message " I don't know what 'logo' means. "
Probably it have something to do with the 2 consecutive equal signs but i don't understand what have changed
I changed the filter line to this now and it works :
logo = Overlay(ImageSource("F:\logo.png"), x = 3, y=3, opacity=0.45, mode="luma")
But would like to know, if possible, why what was possible and working before is not working anymore in case i have to make some similar syntax custom filters in the future please.
Thanks a lot for continuing the great work.
PS : in the tools > settings > system to change the menu style we don't have anymore the .NET professional option, was using this one before and now it's missing, not sure if it is on purpose or not.
Thanks.
stax76
17th April 2017, 14:26
@Dope
In the audio options dialog is a text box for custom switches where you can enter '-c:a opus', it results in -c:a being written two times to the command line, I'm not sure if ffmpeg will use the first or last, next build will ensure it's only written once. Adding GUI controls for it is easy but I also think it's to early.
@Yanak
Regarding avisynth is the error from staxrip or from avisynth? In the menu you can use 'Preview Code' to show what code is used for avisynth. I created a filter profile as you posted and it was added to the script correctly:
Logo = logo=ImageSource("F:\logo.png").Overlay(logo, x = 3, y=3, opacity=0.45, mode="luma")
logo=ImageSource("F:\logo.png").Overlay(logo, x = 3, y=3, opacity=0.45, mode="luma")
PS : in the tools > settings > system to change the menu style we don't have anymore the .NET professional option, was using this one before and now it's missing, not sure if it is on purpose or not.
Professional is the default style of .NET, all other are owner drawed, the problem with Professional was after I increased the menu item height by adding a larger margin, the text wasn't vertically centered properly.
Yanak
17th April 2017, 14:51
The error message appeared when i tried to preview the video once the filter was applied on a video source loaded but good catch, seems to come from avisynth , i had no issues before using this :
Logo = logo=ImageSource("F:\logo.png").Overlay(logo, x = 3, y=3, opacity=0.45, mode="luma")
but seems like the dot before "Overlay" cause now some issues with avs+, just tried in AVSPmod and also got the same error.
Removed the dot in staxrip profile, just leaving a space between the 2 commands and it works now, like this :
Logo = logo=ImageSource("F:\logo.png") Overlay(logo, x = 3, y=3, opacity=0.45, mode="luma")
I have no clue of what have changed and why separating those two with a small dot worked before and not anymore. Sorry for having bothered you with this.
As for .Net, i understand, no need ot keep it if it's not working properly under all conditions, was giving a nice look to the program , i'll get used to something else i guess.
Thanks for the quick answers and sorry again for bothering you with an issue that was not coming from the program itself.
stax76
17th April 2017, 15:07
No problem, alternatively you can do multi line in the filter profiles editor like so:
MPEG2Source = MPEG2Source("%source_file%")
[Misc]
Logo =
logo=ImageSource("F:\logo.png")
Overlay(logo, x = 3, y=3, opacity=0.45, mode="luma")
AssumeFPS | AssumeFPS MediaInfo = AssumeFPS(%media_info_video:FrameRate%)
Yanak
17th April 2017, 15:28
Thanks,
will adjust my scripts when needed, multiples lines will help, had a heavy customized version of the program and still in the process of transposing the settings with the last version and testing them.
And now that i think at this, could you take a look here please : http://forum.doom9.org/showthread.php?p=1785596#post1785596
I don't know if we are supposed to be able to use all those macros in custom filters but will be really great, for now it doesn't seems to work correctly, for example :
Rotate = $select:<TurnLeft;TurnRight;Turn180>$
Mirror = $select:<FlipHorizontal;FlipVertical>$
FPS = ChangeFPS($select:<60;30;40;25>$)
All those end up in the result described in the link, like i said i'm not sure if we are supposed to use those, they will open some nice opportunities for lighter custom filters.
Thanks a lot :)
stax76
17th April 2017, 17:00
@Yanak
Good idea to make things lighter, I added support for it and modified the default profiles to use this for AssumeFPS.
Yanak
17th April 2017, 17:21
Great , can't wait to see this working, AssumeFPS but also QTGMC, Spline, KNLMeansCL with all the sub menus can profit of this to make it lighter, more clear and easier to use, plus many custom filters possible and easy to use in 2 clicks without cluttering the preferred filters list with too many options.
I will download it and start to try as soon as you publish it,
thanks a lot, you made my day with your reply.
stax76
17th April 2017, 18:02
I improved it by adding a optional message and optional titles for the items
$select:msg:please choose;caption1|value1;caption2|value2;item3$
https://github.com/stax76/staxrip/blob/master/md/test-build.md
Yanak
17th April 2017, 18:56
Fantastic,
Just tried quickly and seems to work .
Only 2 little things if it is possible without much efforts :
- Could it be possible to have the caption selected somehow displayed in the filter list itself.
For example i do this as filter :
[ChangeFPS]
ChangeFPS = ChangeFPS($select:msg:Change FPS;60|60;50|50;30|30;25|25$)
and then if i select 30FPS in the select menu get some feedback on what is select by displaying the caption entered for this option here instead of the ChangeFPS text itself :
https://s14.postimg.org/d99wtmha9/23795520170417193127.png
Just to get a feedback on what is selected, here it's next the text but my idea is to simply replace the whole text by the caption of the option selected (if there is one) so we know clearly what is going on.
- Other thing is the need to replace or remove and add again the filter each time we need this option changed.
For example i select 30 FPS and save this as template, the next time it will load it will keep the filter in the list with the 30fps value.
If i want to change the FPS option from 30 to 60, i need to either replace the filter or delete and add it again ( pretty much the same thing ) to be able to select another FPS option.
Could it be possible that after unticking the selected filter displayed in the list and ticking again the dialog box the selection menu comes back automatically so we can select another option ?
Tried to illustrate it with a gif :
https://s14.postimg.org/gu5sc9dxt/390199illustration.gif
Will make it way easier for switching options
But don't get me wrong, it's extremely nice already this is just icing on the cake, right now it will ease a lot of things for custom filters already.
It's a truly great change you made here, thanks a million for this, will go dinner and play a bit more with this later at night, but i already have a nice list of stuff to add using this new option :)
stax76
17th April 2017, 19:40
Both is difficult, I can change it to show the code instead of the name in case a macro was solved.
Yanak
17th April 2017, 20:24
I don't know, by showing the code itself you mean the raw code or more complete like in the preview code option for example ?
It's up to you, showing the code might help in some cases and get even more confuse on some others, and even worse depending it it's the raw code or not, hard to say without seeing and testing it tho.
For now i added those :
ChangeFPS = ChangeFPS($select:msg:Change FPS;60 FPS|60;50 FPS|50;40 FPS|40;30 FPS|30;25 FPS|25$)
Rotate = $select:msg:Rotate Video;Turn 90° Left|TurnLeft;Turn 90° Right|TurnRight;Turn 180°|Turn180$
Mirror = $select:msg:Mirror Video;Flip Horizontal|FlipHorizontal;Flip Vertical|FlipVertical$
Colors = $select:msg:Colors change;Grey scale|Greyscale;Show Alpha|ShowAlpha;Show Red|ShowRed;Show Green|ShowGreen;Show Blue|ShowBlue;Invert|Invert;Swap UV|SwapUV$
And got a problem with this one adding a small watermark using subtitle function on the top left or bottom left of the video:
Watermark = $select:msg:Add Watermark;Top Left Watermark|Subtitle("Test",3,1,font="Aparajita",size=18,text_color=$ffffff,halo_color=$000);Bottom Left Watermark|Subtitle("Test",3,(%target_height%-19),font="Aparajita",size=18,text_color=$ffffff,halo_color=$000)$
Returns me an error message unexpected character ";"
Was going to add top right and bottom right following the same logic but i'm stuck on this one for now.:sly:
For having to replace the filter each time it needs an option change i will deal with it, anyways the custom filters menu will be greatly reduced using this new option, here those 5 examples replace already 19 lines and 5 sub menus on my custom filters, so it will be easier to use and navigate quickly for a replacement of the filter when i need an option changed.
Like i said for showing the code it's up to you, hard to say for now, remains abstract for me.
And thanks a lot Stax for the great work, this is a game changer for me.
Yanak
17th April 2017, 21:41
Got the watermark solved by using a different approach :
Watermark = Subtitle("Test",$select:msg:Watermark Position;Top Left|3,1;Bottom Left|3,(%target_height%-19)$,font="Aparajita",size=18,text_color=$ffffff,halo_color=$000)
and it makes the code cleaner too :)
Will probably do other positions tomorrow as my braincells are starting to heat now :p
Yanak
18th April 2017, 10:17
Hello Stax, sorry if i post too much and spam a bit but i have one last question :o
I tried a few things for the Logo filter :
#browse to select a picture file that will be placed on the top left corner :
Logo = logo=ImageSource("$browse_file$") Overlay(logo, x=3,y=3, opacity=0.45, mode="luma")
#get a list of 3 different logos pictures to select, again placed at the top left corner :
Logo = logo=ImageSource($select:msg:Logo picture;First Logo|"F:\Logo1.png";Second Logo|"F:\Logo2.png";Third Logo|"F:\Logo3.png"$) Overlay(logo, x=3,y=3, opacity=0.45, mode="luma")
#Get a list of 3 logos to select followed by a list of 2 possible positions to place them, top left and bottom left ( the dialog boxes appear one after the other and it works ) :
Logo = logo=ImageSource($select:msg:Logo picture;Default Logo|"F:\frame.png";Second Logo|"F:\frame2.png";Third Logo|"F:\frame3.png"$) Overlay(logo,$select:msg:Position;Top Left|x=3,y=3;Bottom Left|x=3,y=(%target_height%-60)$, opacity=0.45, mode="luma")
And i tried to make a filter with first option being the default pre-defined logo , and second option being the Browse_File option, either select default logo or browse PC to pick another picture:
Logo = logo=ImageSource($select:msg:Logo picture;Default Logo|"F:\Logo.png";Browse File|"$browse_file$"$) Overlay(logo, x=3,y=3, opacity=0.45, mode="luma")
But this does not work correctly, I'm not sure if i make an error on the syntax or if it's something else but trying to combine the $select option with $Browse_file option does not give me the expected results and ends up in a kind of loop.
Also finished the watermark filter having all 4 corners of the videos for possible position.
Watermark = Subtitle("test",$select:msg:Watermark Position;Top Left|3,1;Bottom Left|1,(%target_height%-19);Top Right|(%target_width%-30),1;Bottom Right|(%target_width%-30),(%target_height%-19)$,font="Aparajita",size=18,text_color=$ffffff,halo_color=$000)
Edit : the following one seems to works now on version 1.4.2.5, wasn't working on previous .4
Then tried to combine it with the $enter_text option and again here it does not work :
Watermark = Subtitle("$enter_text:Add Watermark Text$",$select:msg:Watermark Position;Top Left|3,1;Bottom Left|1,(%target_height%-19);Top Right|(%target_width%-30),1;Bottom Right|(%target_width%-30),(%target_height%-19)$,font="Aparajita",size=18,text_color=$ffffff,halo_color=$000)
I have the enter_text box coming, i enter the text then the next one for position runs in loop after the selection of what position i want.
After many attempts i don't know what is wrong, using $enter_text macro alone works nicely, once combined with $select it cause some issues, maybe i am having a wrong syntax or something i am missing, i don't know, but I'm stuck on this for now.
The possibilities offered by this, assuming all macros like $select $enter_text or $browse_file can work together in a single filter opens a wide range of possibilities, plenty of things to play with as you can see :)
Thanks a lot.
Edit : one problem was fixed with version 1.4.2.5, remains only the $select option with $Browse_file not working together apparently like in the second code example i posted
Also seeing now the code displayed in the filter list wiht new version, it will help for some filters.
stax76
18th April 2017, 11:42
Nesting a macro inside another macro might work in some situations but generally isn't supported, I hope I can add support for it.
Yanak
18th April 2017, 12:38
It explains why it doesn't work then, thanks.
And yeah i pushed a bit the thing to see what was possible and some nested ones work :
Watermark = Subtitle("$enter_text:Add Watermark Text$",$select:msg:Watermark Position;Top Left|3,1;Bottom Left|1,(%target_height%-$enter_text:Bottom margin in px$)$,font="Aparajita",size=$enter_text:Font Size$,text_color=$select:msg:Text Color;White|color_white;Red|color_Red;Yellow|color_yellow;Khaki|color_darkkhaki$,halo_color=$select:msg:Halo Color;White|color_white;Red|color_Red;Yellow|color_yellow;Khaki|color_darkkhaki$)
It ask for text to put in watermark, bottom margin in px, font size, watermark position ( top left or bottom left only here ), text colors and halo colors ( just a few tested here), and can be pushed a bit more further with font used , left margin and so on.
With version 1.4.2.5 the best i could get is to have the file browser to always open when selecting this filter, then I browse for a picture and after this I have the option to select default one or the one i browsed, but this time with no strange loops like on previous .4 version.
Not sure how much you will push with this but possibilities for quick filters modifications are really great and open a lot of new possibilities.
Seeing the code in the last version is a plus for most filters i tried, for some it becomes even more confuse but it doesn't matter.
Will take a break and test this a bit more tomorrow.
Thank again for this great addition.
stax76
18th April 2017, 12:57
You're welcome.
AMED
19th April 2017, 07:28
Is anyone seeing really high memory usage with Staxrip 1.4.2.4?
When starting the first job it's at just under 200MB and then 30 jobs (about 12 - 18 hours) later Staxrip is using 3.5GB.
I'm using Vapoursynth R37 with Python 3.61 installed and using the following VS script.
import vapoursynth as vs
core = vs.get_core()
core.std.LoadPlugin(r"D:\StaxRip\Apps\Plugins\both\ffms2\ffms2.dll")
core.std.LoadPlugin(r"D:\StaxRip\Apps\Plugins\vs\fmtconv\fmtconv.dll")
core.std.LoadPlugin(r"D:\StaxRip\Apps\Plugins\both\KNLMeansCL\KNLMeansCL.dll")
import importlib.machinery
adjust = importlib.machinery.SourceFileLoader('adjust', r"D:\StaxRip\Apps\Plugins\vs\adjust\adjust.py").load_module()
mvsfunc = importlib.machinery.SourceFileLoader('mvsfunc', r"D:\StaxRip\Apps\Plugins\vs\mvsfunc\mvsfunc.py").load_module()
core.std.LoadPlugin(r"D:\StaxRip\Apps\Plugins\vs\mvtools\libmvtools.dll")
core.std.LoadPlugin(r"D:\StaxRip\Apps\Plugins\vs\nnedi3\libnnedi3.dll")
core.std.LoadPlugin(r"D:\StaxRip\Apps\Plugins\vs\scenechange\scenechange.dll")
core.std.LoadPlugin(r"D:\StaxRip\Apps\Plugins\vs\temporalsoften\temporalsoften.dll")
havsfunc = importlib.machinery.SourceFileLoader('havsfunc', r"D:\StaxRip\Apps\Plugins\vs\havsfunc\havsfunc.py").load_module()
clip = core.ffms2.Source(r"xxxxxx.mkv", cachefile = r"xxxxx.ffindex")
clip = havsfunc.SMDegrain(clip, tr=3, RefineMotion=True, thSAD=500)
clip = havsfunc.SMDegrain(clip, tr=3, RefineMotion=True, thSAD=500, contrasharp = True)
clip = core.f3kdb.Deband(clip, preset="low")
clip.set_output()
I have 3 separate machines (2 are W10 CU and 1 Win7 64Bit) that show the same problem.
stax76
19th April 2017, 10:01
Post a log file please.
AMED
19th April 2017, 10:22
Hi Stax,
You can download the logs for the 4 completed jobs here.
http://www.mediafire.com/file/nohlwef6f0np4i9/staxrip.zip
Staxrip is currently using 1052MB on that machine.
stax76
19th April 2017, 13:31
@AMED
I'll investigate it.
@Yanak
I changed it now to not display code but the name of the profile + the selected caption, so it would display 'AssumeFPS 25' for instance. I'll not add support for nested macros, I changed the order macros are solved, first normal macros are solved, then GUI/interactive macros in this order:
macros with params:
%app:%
%media_info_video:%
%media_info_audio:%
%filter:%
%eval:%
GUI/interactive macros:
$browse_file$
$enter_text$
$enter_text:$
$select:$
since select is last you can use any macro as parameter and will be solved but it will be solved of course before the select dialog is shown and not after a item is select.
so if nested macros work depends on the order thy are solved.
new macro I want to add is for evaluating powershell code:
%eval_ps%
I've ported the HDR script from C# to PowerShell because I want to remove C# scripting support end of the year because C# scripting requires crazy 47 nuget packages, it's difficult to heavy and difficult to maintain.
Yanak
19th April 2017, 15:53
Hi,
Was the new version published ? i see only the .7 and seems like code is still displayed for it, no sign of name + caption displayed, this ill make things a lot more clear and easier to use .
For the macros $*$, it seems that you use the alphabetical order for them to be executed , so yeah i won't be able to select if i want option A,B,C or $browse_file as last option, browse will always come first if used in a nested filter.
Thinking at something , not sure if it's logical as i'm not coder and not sure of how you do your thing but could it be possible to add a duplicate macro of $select function named $a_select$ ?
This duplicate keeping the same function as normal $select and just the name to call it changing, having this one possible combined with normal $select will allow to use this one and execute it first depending the needs, since select is probably ones of the macros that needs to come first in most cases for a filter it will make sense to have both options. Not sure if i explained correctly what i have in mind but since it seems to be prioritized by alphabetical order this could be a easy bypass.
Wish i knew how to code powershell, scripting in staxrip could bring many other possibilities to me, i use only a little of batch and tiny bit of php for specific needs and can have hard times with some of this stuff already, and i'm still under win7, win10 have easy access to this now i heard :)
Thanks a lot for the dedicated work on this, really great to be able to ask such things to the coder of the program himself and see them added when it makes sense, there is very few programs nowadays that let the user customize so much things according to his needs, more the contrary, programs tend to be simplified to the maximum for the end user and now we end up with even basic options missing :)
need4speed
19th April 2017, 18:46
Hi all again,
version in use is 1.4.2.7 on win10 pro 14393.1066.
Shutdown option is not working, am I doing anything wrong?
stax76
19th April 2017, 19:34
@need4speed
does this work with cmd: shutdown /f /s /t 0
Was the new version published ?
I think not yet.
For the macros $*$, it seems that you use the alphabetical order for them to be executed , so yeah i won't be able to select if i want option A,B,C or $browse_file as last option, browse will always come first if used in a nested filter.
You can't nest a gui macro as item in select and have it only expanded if that particular item was choosen, macros are expanded in one go in a particular order you can see here:
https://github.com/stax76/staxrip/blob/db1fc70bfb784960f235503349eb6e664ccc045e/General/Misc.vb#L2021
Thanks a lot for the dedicated work on this, really great to be able to ask such things to the coder of the program himself and see them added when it makes sense.
Many hundred changes are because users brought up the topic, these days I avoid changes that take too make time and energy.
Yanak
19th April 2017, 23:27
Hi,
looked quickly at the code and i'm lost there, i see the macros list and further also "if $browse_file$ ... if not ... if $enter_text$... if not... etc ) but this is above my knowledge.
Had in mind that adding a new macro $a_select$ with a duplicate function code as it is done for $select$ while keeping the already exiting $select$ function it could bypass the problem, if $a_select$ was present it had been executed first, keeping the rest as it is working right now if instead of $a_select$ it had been the normal $select$, but it's just some empiric thinking, like i said it's clearly above my knowledge.
Anyways if it ain't possible it ain't a problem, the option you added opens already a lot of new stuff to play with to make things way easier and more dynamic too with the possibility to enter some values on the fly for each project, a great addition already and i cannot thank you enough for that, plus i surely don't want you to spend too much time on this too, you already done more than enough on this and also in general with this amazing tool you provide to us.
Thank you.
VincAlastor
20th April 2017, 00:19
i'm using the last dev build and wanna try script "Convert Bluray (BT709) to 10bit 400nits (MaxFALL) HDR (rev6)"
but get following error:
Die Datei oder Assembly "System.IO.FileSystem, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" oder eine Abhängigkeit davon wurde nicht gefunden. Die gefundene Manifestdefinition der Assembly stimmt nicht mit dem Assemblyverweis überein. (Ausnahme von HRESULT: 0x80131040)
Could someone tell me what's the problem, please?
stax76
20th April 2017, 05:57
@Yanak
Post a example.
@VincAlastor
It seems the .NET IO namespace is implemented in the mscorlib.dll assembly, when staxrip starts and opens a source it does not load a System.IO.FileSystem assembly, when I run the HDR script which works fine on my system then it loads System.IO.FileSystem which staxrip contains along with 30 other assemblies only needed for C# scripting. The reason C# scripting needs 47 nuget packages is it was designed to be .NET Core compatible.
I don't like having 47 nuget packages, 30 assemblies and frequent bug reports that probably only .NET framework engineers do understand. I will definitely remove C# scripting at the end of the year. The next build has this script ported to powershell, powershell scripting will remain supported by staxrip, it needs only one nuget package.
Which OS are you using? I just tried it on my vmware Win 7 test system, works fine too.
VincAlastor
20th April 2017, 10:52
thank you very much for explanation :)
i'm very interested in this script in next release cause of "up to 50% bitrate saving effect"
Windows Version
Microsoft Windows 10 (10.0) Professional 64-bit
Windows Subver.
Build 15063
Yanak
20th April 2017, 11:08
@Yanak
Post a example.
Hi,
#bits of code at line 1869, adding a duplicate for $select$ named $a_select$ ( could be named $priority_select$ or whatever , and keeping the same functionality :
ret.Add(New Macro("$a_select:<param1;param2;...>$", "a_Select", GetType(String), "String selected from dropdown, to show a optional message the first parameter has to start with msg: and to give the items optional captions use caption|value." + BR2 + "Example: $a_select:msg:hello;cap1|val1;cap2|val2$"))
ret.Add(New Macro("$select:<param1;param2;...>$", "Select", GetType(String), "String selected from dropdown, to show a optional message the first parameter has to start with msg: and to give the items optional captions use caption|value." + BR2 + "Example: $select:msg:hello;cap1|val1;cap2|val2$"))
ret.Add(New Macro("$enter_text:<prompt>$", "Enter Text (Params)", GetType(String), "Text entered in a input box."))
ret.Add(New Macro("$browse_file$", "Browse For File", GetType(String), "Filepath returned from a file browser."))
ret.Add(New Macro("$enter_text$", "Enter Text", GetType(String), "Text entered in a input box."))
and bits of code starting at line 1948, adding the $a_select$ at the top of this code part to be executed first if the macro exist in the filter, code added at the top part is copied from the normal $select$ function that is at the bottom part.
Existing $select$ also stays so we can have the choice between those 2 ways of using select, one as it works now $select$ , and another that will always be prioritized and executed first $a_select$, leaving the possibility to the user to choose one or the other depending the needs :
If ret.value.Contains("$a_select:") Then
Dim matches = Regex.Matches(ret.value, "\$a_select:(.+?)\$")
For Each iMatch As Match In matches
Dim items = iMatch.Groups(1).Value.SplitNoEmpty(";").ToList
If items.Count > 0 Then
Dim sb As New SelectionBox(Of String)
sb.Title = "a_Select"
If items?(0)?.StartsWith("msg:") Then
sb.Text = items(0).Substring(4)
items.RemoveAt(0)
Else
sb.Text = "Please select a item."
End If
For Each iItem As String In items
If iItem.Contains("|") Then
sb.AddItem(iItem.Left("|"), iItem.Right("|"))
Else
sb.AddItem(iItem)
End If
Next
ret.cancel = sb.Show <> DialogResult.OK
If ret.cancel Then Return ret Else ret.value = ret.value.Replace(iMatch.Value, sb.SelectedItem)
End If
Next
End If
If Not ret.value.Contains("$") Then Return ret
If ret.value.Contains("$browse_file$") Then
Using d As New OpenFileDialog
ret.cancel = d.ShowDialog <> DialogResult.OK
If ret.cancel Then Return ret Else ret.value = ret.value.Replace("$browse_file$", d.FileName)
End Using
End If
If Not ret.value.Contains("$") Then Return ret
If ret.value.Contains("$enter_text$") Then
Dim inputText = InputBox.Show("Please enter some text.")
If inputText = "" Then
ret.cancel = True
Return ret
Else
ret.value = ret.value.Replace("$enter_text$", inputText)
End If
End If
If Not ret.value.Contains("$") Then Return ret
If ret.value.Contains("$enter_text:") Then
Dim matches = Regex.Matches(ret.value, "\$enter_text:(.+?)\$")
For Each iMatch As Match In matches
Dim inputText = InputBox.Show(iMatch.Groups(1).Value)
If inputText = "" Then
ret.cancel = True
Return ret
Else
ret.value = ret.value.Replace(iMatch.Value, inputText)
End If
Next
End If
If Not ret.value.Contains("$") Then Return ret
If ret.value.Contains("$select:") Then
Dim matches = Regex.Matches(ret.value, "\$select:(.+?)\$")
For Each iMatch As Match In matches
Dim items = iMatch.Groups(1).Value.SplitNoEmpty(";").ToList
If items.Count > 0 Then
Dim sb As New SelectionBox(Of String)
sb.Title = "Select"
If items?(0)?.StartsWith("msg:") Then
sb.Text = items(0).Substring(4)
items.RemoveAt(0)
Else
sb.Text = "Please select a item."
End If
For Each iItem As String In items
If iItem.Contains("|") Then
sb.AddItem(iItem.Left("|"), iItem.Right("|"))
Else
sb.AddItem(iItem)
End If
Next
ret.cancel = sb.Show <> DialogResult.OK
If ret.cancel Then Return ret Else ret.value = ret.value.Replace(iMatch.Value, sb.SelectedItem)
End If
Next
End If
Return ret
End Function
End Class
Again it's just empiric thinking from a noob plus adding bits of code and duplicating the $select$ into $a_select$, not even sure if this makes any sense for you as coder but that's what i had in mind, now to know if this can work or not, or even if it's partially correct ... it's another story.
If this can work then i can choose to have a select option that will be prioritized and always come first when used in a filter by selecting the $a_select$ macro,
if i don't need the select function to be executed first, like for example in my watermark filter where i first enter a text then select a position to place it using $select, for those cases i can simply use the already existing $select$ instead.
Not sure if it's more clear for you but i tried, and forgive me if my train of thoughts is completely silly and makes no sense from a coders point of view.
Thank you.
VincAlastor
20th April 2017, 11:14
how can get working cmd opus audio coding with eac3to?
the following line won't work:
eac3to stdout.wav -down6 -down16 | opusenc --ignorelength --bitrate %audio_bitrate" --framesize 60 - %file_name%.opus
opusenc.exe is in eac3to directory.
sneaker_ger
20th April 2017, 12:48
1. I don't see any input file specified for eac3to. (eac3to input.wav stdout.wav .....)
2. %audio_bitrate" ? Should be %audio_bitrate% (if you have that variable set!) or explicitly e.g. 128.
2. %file_name% ? Again: make sure that variable is actually set or set name explicitly e.g. output.opus
Are you trying to use via StaxRip or manually outside of it? If used via StaxRip post the log. I don't think StaxRip even uses opusenc so it would be better to open a new thread in the newbie section if you cannot get it to work even after my advice.
luigizaninoni
20th April 2017, 13:30
15856
this is with ffmpeg. don't know if you can with eac3to though inside staxrip
stax76
20th April 2017, 14:00
this works for me:
https://s16.postimg.org/dobz0zn8l/Unbenannt.png
VincAlastor
20th April 2017, 23:55
this works for me:
https://s16.postimg.org/dobz0zn8l/Unbenannt.png
:thanks:
With your helpful tip it works finally! Thanks
I had to change dtsma to dtshd or better let "supported input types" empty, but yes it works :))))
1. I don't see any input file specified for eac3to. (eac3to input.wav stdout.wav .....)
2. %audio_bitrate" ? Should be %audio_bitrate% (if you have that variable set!) or explicitly e.g. 128.
2. %file_name% ? Again: make sure that variable is actually set or set name explicitly e.g. output.opus
Are you trying to use via StaxRip or manually outside of it? If used via StaxRip post the log. I don't think StaxRip even uses opusenc so it would be better to open a new thread in the newbie section if you cannot get it to work even after my advice.
thank you too :)
IbrahimKh
21st April 2017, 07:01
Hi, can anyone help me please.
I'm failed to load script, I tried to reinstall Avisynth few times and rebooting multiple times still no luck. Also I tried to run stax as admin, still same.
The log is
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Script file failed to load
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Source File Path: D:\HDNLEN224\post\Ringsnew_Source.avs
LoadPlugin("C:\Users\HDNLEN224\Desktop\st\Apps\Plugins\both\ffms2\ffms2.dll")
FFVideoSource("D:\HDNLEN224\post\RingsGB\Rings.mkv", cachefile = "D:\HDNLEN224\post\Rings.2017.720\Rings.ffindex")
Plugins: ConvertStacked, DirectShowSource, ImageSeq, Shibatch, TimeStretch, VDubFilter
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Exception
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
System.Exception: AVIFileOpen failed to execute
Failed to open AviSynth script:
D:\HDNLEN224\post\RingsGB\Rings.2017Source.avs
You can try to open the script with VirtualDub x64, if it don't open it could be a problem with the script or the AviSynth+ x64 setup, if StaxRip don't report a script error and the script looks valid then reinstalling AviSynth+ x64 might fix the problem, the setup is located at:
C:\Users\HDNLEN224\Desktop\st\Apps\AviSynth+r2294.exe
at StaxRip.AVIFile..ctor(String path) in D:\Projekte\VS\VB\StaxRip\General\AVIFile.vb:line 53
at StaxRip.VideoScript.Synchronize(Boolean convertToRGB, Boolean comparePath) in D:\Projekte\VS\VB\StaxRip\General\VideoScript.vb:line 202
at StaxRip.VideoScript.GetFramerate() in D:\Projekte\VS\VB\StaxRip\General\VideoScript.vb:line 302
at StaxRip.MainForm.OpenVideoSourceFiles(IEnumerable`1 files, Boolean isNotEncoding) in D:\Projekte\VS\VB\StaxRip\Forms\MainForm.vb:line 1798
stax76
21st April 2017, 08:44
System.Exception: AVIFileOpen failed to execute
Failed to open AviSynth script:
D:\HDNLEN224\post\RingsGB\Rings.2017Source.avs
You can try to open the script with VirtualDub x64, if it don't open it could be a problem with the script or the AviSynth+ x64 setup, if StaxRip don't report a script error and the script looks valid then reinstalling AviSynth+ x64 might fix the problem, the setup is located at:
C:\Users\HDNLEN224\Desktop\st\Apps\AviSynth+r2294.exe
at StaxRip.AVIFile..ctor(String path) in D:\Projekte\VS\VB\StaxRip\General\AVIFile.vb:line 53
at StaxRip.VideoScript.Synchronize(Boolean convertToRGB, Boolean comparePath) in D:\Projekte\VS\VB\StaxRip\General\VideoScript.vb:line 202
at StaxRip.VideoScript.GetFramerate() in D:\Projekte\VS\VB\StaxRip\General\VideoScript.vb:line 302
at StaxRip.MainForm.OpenVideoSourceFiles(IEnumerable`1 files, Boolean isNotEncoding) in D:\Projekte\VS\VB\StaxRip\Forms\MainForm.vb:line 1798
Does VirtualDub x64 work?
@VincAlastor
Next build will have a greatly improved Batch Audio Options dialog with menu to execute, show and copy the command line and create a profile like the x265 dialog. Name can be entered and is auto generated like in the normal audio options dialog. The double quotes around %input% and %output% can be omitted because they are added automatically if needed.
It's better to define the input file types for two reasons:
automatic conversion to flac or wav if necessary
if the audio source file is the same as the video source file conversion to flac/wav will use the correct stream number
@Yanak
You cannot use conditions using macros because macros are expanded in one go, I'll improve powershell scripting and create a example script for your watermark task.
stax76
21st April 2017, 12:29
When starting the first job it's at just under 200MB and then 30 jobs (about 12 - 18 hours) later Staxrip is using 3.5GB.
I'll investigate it.
@Yanak
I wrote a powershell script example that works with the last test build, so far I didn't had any problem to use any internal staxrip code, it's a really lightweight and powerful way for making a .NET app extendable.
$activeProject = [ShortcutModule]::p
$text = [InputBox]::Show("Add Watermark Text")
if ([string]::IsNullOrEmpty($text)) {exit}
$td = new-object "TaskDialog[string]"
$td.MainInstruction = "Watermark Position"
$td.AddCommandLink("Top Left" , "top")
$td.AddCommandLink("Bottom Left" , "bottom")
$pos = $td.Show()
$td.Dispose()
if ($pos -eq "top") {
$x = 3
$y = 1
} elseif ($pos -eq "bottom") {
$x = 1
$y = $activeProject.TargetHeight - 19
} else {exit}
$filter = new-object "VideoFilter"
$filter.Category = "Misc"
$filter.Path = "Subtitle"
$filter.Script = 'Subtitle("{0}", {1}, {2})' -f $text, $x, $y
$activeProject.Script.AddFilter($filter)
Yanak
21st April 2017, 14:37
Hi,
Tested last version and i really love the new display of name + caption for the filters, really great change.
Noticed something wrong with the preview code display, it adds now a lateral scrollbar and only a small part for the code display window, here 1.4.2.7 :
https://s14.postimg.org/umk78dpf5/12062020170421135516.png
and here 1.4.2.8:
https://s14.postimg.org/h5n8pimtd/20411120170421135245.png
- I'm not surprised my thinking was wrong for the code and $a_select$, not surprised at all.
Tested the powershell script you published, thanks a lot for having take the time to do this, i really appreciate, sadly i end up with an error message " Failed to execute PowerShell script, on systems prior Windows 10 PowerShell 5 or higher must be installed. ". Same for the blu-ray one present in the script folder.
I'm on win7 so might be the problem, wasn't really planning to upgrade to win10 but might become a time i will need to, it seems like taking the time to start learning a bit with this can really bring a lot of possibilities, might take some time to learn the ropes but the outcome seems to be worth it.
For now i don't know if i can bypass this while staying on win7, will try to check a bit later on the net for some solutions, if they exist.
- Also nice change for the select options display, no more drop down menu but all listed now in the last version, makes it even easier to use, love it.
Speaking of this one, is it possible to add on the manual selection screen for source some custom made source filters or it is locked ? Speaking of this here :
https://s14.postimg.org/i7xf82dch/22557020170421141330.png
Is there a any way somehow to add our custom source filters to this list ?
-Got custom source filters using MP_pipeline so they allow me to use x86 stuff on StaxRip x64, one if for debugmode frameserver used in vegas, the output codec of debugframeserver is x86 and the frameserver output file cannot be opened by StaxRip without this little trick, code used as source filter :
Vegas Frameserver Import =
MP_Pipeline("""
### platform: win32
AVISource("%source_file%", audio=false).AssumeFPS(%media_info_video:FrameRate%)
### ###
""")
For now the easiest way i found is to add this to the filters list and save it as filter setup presets, when i need it i just load the filter preset.
I have the default template using "manual" for source, problem is when i try to load another video for source file clicking on "source" or right clicking on the source file box where the path is displayed and selecting "open", the program asks me if i want to save the current project or not, then loads default template and returns to "manual" as it's the default template and asks me to choose a preferred source filter from the list of the screenshot above.
And if i do select again a output from the frameserver i get the error message about the x86 codec, i need to close Staxrip and restart the process each time.
If i save the template with the custom source filter and do the same steps but this time i try to open a different video file not coming from the frameserver i get an error message and end up in another loop where the only possibility is to exit the program, so i'm wondering if there is a way i missed to add our custom source filters to this list or if it's locked for any modifications. Just a simple question not a request to add this, you done more than enough those last days, having to save settings and restart between 2 videos isn't a big deal especially now with the easy mode filters.
And lastly while i'm on the new way to add filters i have another custom source filter using MT_pipeline made for using a logo remover (http://forum.doom9.org/showthread.php?t=133682) that requires a x86 dll to work, i don't need this one on the manual list of filters as it's very specific one an not used often like previous one, anyways I made a custom source filter for this one using the new possibilities, posted code here to not break the forum layout :
https://pastebin.com/mfc897Ni
This works better than i could ever dream about:
Select it as source filter, it opens the file bowser to pick the mask file picture we created previously,
then it asks to type the coordinates of the logo zone to treat in px location ( probably will add later the easier way where you select only a region of the screen only ),
then we select the source type and what to use to open it (LWLibavVideoSource,FFVideoSource,avisource, etc ),
then we select the mode to use depending the logo type (opaque or transparent logos or both ),
and lastly select if we want to see final result or the process steps showing in details the treatment done ( to adjust settings, really great combined with the video preview mode and his zoom possibilites ).
Once this done remains only to pick and load the video file as usual in Staxrip to see the result.
Still little things to fine tune and modify for more options choices the but it's just great to have this working and being that efficient already.
I'm just amazed by how the changes you made to the program for this new way of making filters made this easy and quick to do now once the filter is created, thanks a lot for all this.
Still quite a few filters to transpose into the program then fine tune but i really love all this new stuff, thanks a million for all the great work you do man.
And sorry for the long post and I hope i don't bother you too much.
Edit : tested a simple example of a ps1 script i found on the net, when right clicking on the file i have the contextual menu "execute with powershell" and it seem to work when i launch it, strange ... Will continue to search on this.
Full error message of the watermark script here : https://pastebin.com/GZpPZwF8
And i do have powershell on win7, never looked into this before, my version :
https://s14.postimg.org/tka0putr5/58012020170421161335.png
stax76
21st April 2017, 15:49
Noticed something wrong with the preview code display, it adds now a lateral scrollbar and only a small part for the code display window
It's a bug in the .NET framework, I fixed it with a workaround.
Failed to execute PowerShell script, on systems prior Windows 10 PowerShell 5 or higher must be installed.
https://www.microsoft.com/en-us/download/details.aspx?id=54616
Speaking of this one, is it possible to add on the manual selection screen for source some custom made source filters or it is locked ? Speaking of this here :
This dialog cannot be changed, the dialog was added because megui users are used to a manual workflow, I changed my startup template to use automatic instead of manual source filter selection, automatic can be configured. Also I configured staxrip to demux all streams automatically instead of showing the demuxing dialog.
I have the default template using "manual" for source, problem is when i try to load another video for source file clicking on "source" or right clicking on the source file box where the path is displayed and selecting "open", the program asks me if i want to save the current project or not, then loads default template and returns to "manual" as it's the default template and asks me to choose a preferred source filter from the list of the screenshot above.
And if i do select again a output from the frameserver i get the error message about the x86 codec, i need to close Staxrip and restart the process each time.
I don't understand it, what if you load a template before opening a new source?
If i save the template with the custom source filter and do the same steps but this time i try to open a different video file not coming from the frameserver i get an error message and end up in another loop where the only possibility is to exit the program, so i'm wondering if there is a way i missed to add our custom source filters to this list or if it's locked for any modifications. Just a simple question not a request to add this, you done more than enough those last days, having to save settings and restart between 2 videos isn't a big deal especially now with the easy mode filters.
It's difficult to understand and too complex to reproduce, what if you
1. load a template
2. load the source filter you want via context menu
3. load the source file
Yanak
21st April 2017, 16:36
Was downloading the Windows Management Framework (WMF) 5.1 update before seeing your post, found it after searching and reading on the net, got the powershell script working now.
Now time to start learning a bit and customize this script for colors and some other options, then use this as example for some other scripts.
Looked a bit at the code itself and might take a bit and few trial and errors but doesn't seems impossible at first glance, just need time to do and test this, thank a lot for having done it.
Coming myself from Megui i understand this perfectly, used it for a long time but switched to Staxrip since a while and not touching megui much anymore beside using his muxer from times to times for specific needs, still having a bunch of filters inside this program folder than i need to move away for easier use tho. Was just wondering if it was possible or not in case i missed a way to do it, now i know.
The problem i had in the past was that loading a template between loading a different video used to not work too and give various error messages that i always thought were coming from my custom source filters themselves, not from the program.
But i have to apologize to you, i just tried on the last 3 recent builds i have on my possession and it seems to work fine now. I was so used to getting error messages in older versions that i never pushed more on this and had not tried this method since a long long time, it just came to my mind to ask about it while seeing the change of the $select options display screen.
I'm sorry for the stupid question and making you loose time with this, using different templates and loading them before switching videos inputs seems to work flawlessly on last versions :/
Thanks a lot for all the time spent on this and even answering silly stuff ( sorry again for this ), now i will finish to adapt my filters then start to explore the possibilities offered by the scripting to customize this even further.
Once i'll finish my filters in a few days, i'll post of list of all the " basic ones" so it could help some other users maybe.
All seems to work perfectly and with a lot of new stuff to play with, plenty of busy hours ahead to customize this wonderful tool to my last needs.
Thank you again, i will not bother you for a while and only focus on finishing what i started :)
PS : one very last question i forgot to ask:
How to remove an icon added on a custom menu entry without having to delete and do again the entry ?
https://s14.postimg.org/cwiinattt/18013320170421134337cr.png
Unless i am missing something it seems that i can only replace the icon by another one, not possible to remove it.
If not possible, maybe adding a third line on this add icon menu with simply " delete icon " function to restore it to blank icon ? But it's a minor thing.
stax76
21st April 2017, 17:31
You're welcome. Next build supports icon removal.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.