[ Bug report ] - Script to define Settings crashes ADM when no video is loaded

Started by poutnik, January 22, 2015, 07:48:20 AM

Previous topic - Next topic

poutnik

I use the py script below to define Container and audio/video codec/filter settings.

If I launch ADM Win64 nightly 20150121, load video to be processed, and then I run the script, it works fine.
If I launch ADM Win64 nightly 20150121, and try to run this script without loaded video, it crashes immediately.

I attached ADMlog, crash.py was empty.

It does the same for several variants of script, varying slightly in what was omitted from script of saved project.

It is always possible, I asked in script ADM for something stupid or crazy, or omitted essential command
but it should rather tell me it will not do it and not to crash.

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

adm = Avidemux()
adm.videoCodec("x264", "useAdvancedConfiguration=False", "general.params=AQ=26", "general.threads=0", "general.preset=fast", "general.tuning=film", "general.profile=high", "general.fast_decode=False", "general.zero_latency=False"
, "general.fast_first_pass=True", "level=31", "vui.sar_height=1", "vui.sar_width=1", "MaxRefFrames=3", "MinIdr=25", "MaxIdr=250", "i_scenecut_threshold=40", "intra_refresh=False", "MaxBFrame=3", "i_bframe_adaptive=1"
, "i_bframe_bias=0", "i_bframe_pyramid=2", "b_deblocking_filter=True", "i_deblocking_filter_alphac0=0", "i_deblocking_filter_beta=0", "cabac=True", "interlaced=False", "constrained_intra=False", "tff=True"
, "fake_interlaced=False", "analyze.b_8x8=True", "analyze.b_i4x4=True", "analyze.b_i8x8=True", "analyze.b_p8x8=True", "analyze.b_p16x16=False", "analyze.b_b16x16=False", "analyze.weighted_pred=2", "analyze.weighted_bipred=True"
, "analyze.direct_mv_pred=1", "analyze.chroma_offset=0", "analyze.me_method=1", "analyze.me_range=16", "analyze.mv_range=-1", "analyze.mv_range_thread=-1", "analyze.subpel_refine=7", "analyze.chroma_me=True"
, "analyze.mixed_references=True", "analyze.trellis=1", "analyze.psy_rd=1.000000", "analyze.psy_trellis=0.000000", "analyze.fast_pskip=True", "analyze.dct_decimate=True", "analyze.noise_reduction=0", "analyze.psy=True"
, "analyze.intra_luma=11", "analyze.inter_luma=21", "ratecontrol.rc_method=0", "ratecontrol.qp_constant=0", "ratecontrol.qp_min=10", "ratecontrol.qp_max=51", "ratecontrol.qp_step=4", "ratecontrol.bitrate=0"
, "ratecontrol.rate_tolerance=1.000000", "ratecontrol.vbv_max_bitrate=0", "ratecontrol.vbv_buffer_size=0", "ratecontrol.vbv_buffer_init=0", "ratecontrol.ip_factor=1.400000", "ratecontrol.pb_factor=1.300000"
, "ratecontrol.aq_mode=1", "ratecontrol.aq_strength=1.000000", "ratecontrol.mb_tree=True", "ratecontrol.lookahead=40")
adm.addVideoFilter("yadif", "mode=0", "order=1")
adm.addVideoFilter("swscale", "width=854", "height=480", "algo=2", "sourceAR=1", "targetAR=1")
adm.addVideoFilter("MplayerDenoise3DHQ", "mode=4", "luma_spatial=4.000000", "chroma_spatial=3.000000", "luma_temporal=6.000000", "chroma_temporal=4.500000")
adm.audioCodec(0, "LavAAC", "bitrate=80");
adm.audioSetDrc(0, 0)
adm.audioSetShift(0, 0,0)
adm.setContainer("MP4V2", "optimize=0", "add_itunes_metadata=0")

Jan Gruuthuse

You don't have an additional window pop up saying something similar? :Assert failed :0
at line 16, file /home/jan/avidemux2/avidemux/qt4/common/ADM_editor/src/ADM_edPoolOfAudioTracks.cppADM_backTrack
PoolOfAudioTracks::at(int)
ADM_Composer::addAudioTrack(int)

Try shifting windows focus keep pressed down[Alt] and tap [Tab] (something similar should apply in windows, not certain if same key combination is used?)
This should/would explain most likely: you can't apply audio track settings to a audio track that is not there?
The script applies settings to a video, if you apply settings to video holding with one video track to set 3 audio tracks the same error would/could happen.
Hope it makes sense what I try to explain?

poutnik

I do not have my home machine handy....

But there is just some small error window that ADM has crashed or so, with OK to confirm, without providing reason.
No info with real information like you have mentioned appears.
Note that I launch it from Custom folder, if that matters.

With or without info, it is quite clear it probably cannot find what it is looking for.
But ADM should not crash, should it ?

Concerning script validity itself, perhaps I have misunderstood ADM internals how it works.

I have thought the settings in my script are just configuration to be used to process A/V streams, and this my script just automates otherwise manual configuration. By other way, I thought it is not applied to tracks until processing starts ( or replay with processing switched ON by GUI check mark )

AFAIK, as I cannot verify now,
I can set such settings manually without loaded video, but i may not remember that correctly.

Jan Gruuthuse

Normally  tinypy project holds the info to load video file to. By deleting that info and use the remaining info present, it is applied to a none existing audiotrack.
I abused/devised/documented/used this method for applying repetitive settings to similar videos on the 20 August 2012 see Custom Menu and Saved projects
Why window is not showing the full text (expand pop-up window) I don't know?

poutnik

I see. There is no problem for me to avoid such early script usage.

My idea just was that developers usually address circumstances leading to crash,
so I have tried to participate as an end user to report such circumstances.

Jan Gruuthuse

Can't speak for the developer(s). Mostly things we can live with have a much lower fixing priority. Avidemux was never for the faint of heart (figurative).
I'm just explaining where it comes from and why, as I'm partially responsible for what happens. Never crossed my mind it would be used in a reversed order.
I'm using this approx. 10 times a day. Saves my a lot of time and mouse clicks.

poutnik

I see.

As the forum is mentioned as the main place to put such reports - other applications usually use bug trackers,
I have targeted it primarily to developers.

That is what end users can do.  It is not a demand, just a report.  Developers will fix it, or let it. I did my part.







poutnik

Quote from: Jan Gruuthuse on January 22, 2015, 12:25:23 PM......
I'm just explaining where it comes from and why, as I'm partially responsible for what happens. Never crossed my mind it would be used in a reversed order.I'm using this approx. 10 times a day. Saves my a lot of time and mouse clicks.

That is fine. I think I was independent re-inventor, as I had similar idea in time I was using occasionally ADM 2.5.
I have just recently shook off dust from it , and switched to py syntax.

poutnik

Quote from: Jan Gruuthuse on January 22, 2015, 12:25:23 PM
I'm using this approx. 10 times a day. Saves my a lot of time and mouse clicks.

I use it a lot as well, I have triggered the crash just by chance.