Any way to retain output settings after closing file in 2.6.11final Win7 x64?

Started by Kevin, February 14, 2016, 11:27:05 PM

Previous topic - Next topic

Kevin

I just noticed in 2.6.11 that as soon as I close a file, all my selections for Video Output and Audio Output revert to "Copy." They used to be retained so that I could apply them to each new file I opened, although I did notice that the filters were reset, with just the codec choice retained. Any way now to retain them from file to file? How about the filters, especially Normalize? Thanks.

Jan Gruuthuse

Load the video
Make your settings
try with File -> Tinypy Project -> Save As Project.
Give the save file a recognisable name, so in future you know what it does.
Edit this save file and remove references to loaded video and segments:
- delete lines similar to this ones:
Quoteadm.loadVideo("/media/jan/Werk/0xp1000/20160210 1815 - SBS6 HD - MasterChef USA.ts")
adm.clearSegments()
adm.addSegment(0, 0, 5400580000)
adm.markerA = 0
adm.markerB = 5400580000

and save that file.
now load a similar video into avidemux and from
File -> Tinypy Project -> Run Project -> select the newly saved tinypy project.
See if that works for you

AQUAR

I think the WIKI needs a PY section to replace the JS scripting section.
This would help a lot for those people wanting to save a preferential configuration.

When I try to use PY in this way I get exception errors.
Probably because I don't know enough of the syntax to make it work.

Maybe a simple sample PY script would help,
Eg one that sets the output video to Xvid, audio to AC3 and the container to MKV (everything else filters, codec settings etc at default).

Project flow: Load media file - run custom PY script from custom folder (if that is still the way it works?).


Jan Gruuthuse

works still like this in linux, returning jobs can be placed in
~/.avidemux6/jobs
http://www.avidemux.org/admWiki/doku.php?id=using:tinypy

Could be you need to use QtScript Project in windows?

mean


Kevin

Thanks all. I'll try these suggestions as soon as I can. I've never used scripting with Avidemux and had no idea what TinyPy even was.

AQUAR

Basic work flow for creating a PY script that will set up ADM with your preferred settings.

1) load a video and set up ADM for the preferred settings.

2) in the GUI do project script - save as project - sample.py

3) edit sample.py to suit setting up the GUI with preferred setting

4) place the edited sample.py in  the avidemux\settings\custom folder

5) sample.py script can now be seen in the toolbar under "custom" and run from there.

6) load another movie - run sample.py to set ADM to the preferred settings stored in sample.py.

Basic edit details by example:
Do step 1)
Load "some movie" and leaving everything at default except
Set Video Output = Mpeg4 ASP (Xvid)
Set Audio Output = AC3 (Aften) and
Set Output Format = MKV
Do step 2)
You get a project script containing


#PY  <- Needed to identify #
#--automatically built--

adm = Avidemux()
adm.loadVideo("K:/MOVIES FOR RECODING & COLLATION/Some Movie.mkv")
adm.clearSegments()
adm.addSegment(0, 0, 1286938000)
adm.markerA = 0
adm.markerB = 1286938000
adm.videoCodec("xvid4", "params=CQ=2", "profile=244", "rdMode=3", "motionEstimation=3", "cqmMode=0", "arMode=1", "maxBFrame=2", "maxKeyFrameInterval=200", "nbThreads=99", "qMin=2", "qMax=25", "rdOnBFrame=True", "hqAcPred=True"
, "optimizeChrome=True", "trellis=True", "useXvidFCC=False")
adm.audioClearTracks()
adm.setSourceTrackLanguage(0,"")
adm.audioAddTrack(0)
adm.audioCodec(0, "Aften");
adm.audioSetDrc(0, 0)
adm.audioSetShift(0, 0,0)
adm.setContainer("MKV", "forceDisplayWidth=False", "displayWidth=1280")


Do step 3
Add "ui=Gui()" to the script and delete all lines except those specific to the required settings in the GUI.


#PY  <- Needed to identify #
#--automatically built--

ui=Gui()
adm = Avidemux()

adm.videoCodec("xvid4", "params=CQ=2", "profile=244", "rdMode=3", "motionEstimation=3", "cqmMode=0", "arMode=1", "maxBFrame=2", "maxKeyFrameInterval=200", "nbThreads=99", "qMin=2", "qMax=25", "rdOnBFrame=True", "hqAcPred=True"
, "optimizeChrome=True", "trellis=True", "useXvidFCC=False")

adm.audioCodec(0, "Aften");

adm.setContainer("MKV", "forceDisplayWidth=False", "displayWidth=1280")


Do steps 4, 5 and 6

Note 1:
Its harder to describe than to perform these steps.
Note 2:
Not used this feature myself - this is just what worked after 5 mins of reading the info Mean and Jan pointed to above.
So take the process described as a rookie first attempt (anyone know better - just share!).

mean

On windows you can put it in the custom folder
User/xxxx/AppData/Roadming/Avidemux

(AppData is a hidden folder)

Kevin

Is there a preferred editor for these .py scripts? When I load them into Windows Notepad, they do not appear nicely formatted as in Acquar's example (i.e. no line breaks). May I insert linebreaks so that each line begins with "adm."? Or should I be using an internal editor somewhere in AVM? Thanks for all your help.

Kevin

Quote from: mean on February 15, 2016, 01:01:09 PM
There are plenty of small py samples in the autononreg/py folder

I don't find any such folder in my Win7 64-bit installation.

Kevin

Quote from: mean on February 16, 2016, 07:04:55 PM
On windows you can put it in the custom folder
User/xxxx/AppData/Roadming/Avidemux

(AppData is a hidden folder)

Tried this and got TinyPy:Exception

Exception:(tp_load) cant get filesize
BackTrack:
File:py2bc.py, line 50
File:py2bc.py, line 50

Note that py2bc.py describes a file I know nothing about. Note also that the .py file I created (in Windows Notepad) per Aquar's example had its name truncated to only the first 4 letters of its filename when it appeared under the Custom menu.

AQUAR

On windows you can use wordpad instead of notepad.
It will give the formatted text - as per the example.

I think mean is referring to the py scripts in the \plugins\autoScripts folder.
When I try, most of these py scripts give an exception error (only "check24fps" gives a result).
I think these scripts have been broken for some time (maybe the syntax for tinypy has changed?).
I also get this strange reference in backtrack to this non existent py2bc.py file. 


Kevin

Quote from: AQUAR on February 17, 2016, 12:59:05 AM
I also get this strange reference in backtrack to this non existent py2bc.py file.

I should clarify that I'm no longer getting that Exception Error when I run my default .py file, created and edited as per your instructions, for which I thank you again.

AQUAR

The very simple sample py script runs fine (ie no exception errors!).
I think the gui=Gui() statement in it seems redundant as we already have an instance of the GUI running.
And indeed the simple sample script works fine without that statement.

I do get the exception errors when running the much more complicated auto scripts.
Makes me think the TinyPY interpreter has "flawed" bindings to ADM.

Interesting observation with the simple sample script:
Load a video, run sample.py and all output parameters defined are set.
Close and don't load a video, run sample.py and all output parameters defined are set except the audio output.

 

Kevin

Quote from: AQUAR on February 17, 2016, 10:25:49 AM
The very simple sample py script runs fine (ie no exception errors!).
I think the gui=Gui() statement in it seems redundant as we already have an instance of the GUI running.

I think your original sample had that statement as "ui=Gui()"  In any event, I'll try removing that line entirely.