Cannot open Muxer, windows 10, running batch calling tinypy script

Started by neilengineer, May 08, 2019, 03:13:45 PM

Previous topic - Next topic

neilengineer

Hi, All,

First time user of Avidemux, I think it's very awesome tool, and I can write python script to automatic things!!
I'm trying to add watermark in all mp4 videos in a folder, so I write some scripts below.
I copied both script into the video folder, and run the windows bat file.
Video loading is fine, but after that it hit an 'Info' popup window saying:  Muxer Cannot open.

I think running from script, there's some env path missing that avidemux.exe couldn't fine the output muxer.
My question is: is there any cmdline option or env variable to set? so that avidemux.exe knows where to look for the muxer?


logo-yinyetai.bat

set avidemux="C:\Program Files\Avidemux 2.7 VC++ 64bits\avidemux.exe"
for %%f in (*.mp4) do %avidemux% --load "%cd%\%%f" --run "logo-yinyetai.py" --save "%%~nF.mp4" --quit



My logo-yinyetai.py

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

adm = Avidemux()
adm.setPostProc(3, 3, 0)
adm.videoCodec("x264", "useAdvancedConfiguration=True", "general.params=AQ=20", "general.threads=99", "general.preset=", "general.tuning=", "general.profile=", "general.fast_decode=False", "general.zero_latency=False", "general.fast_first_pass=True"
, "general.blueray_compatibility=False", "general.fake_interlaced=False", "level=-1", "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=1", "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("black", "startBlack=0", "endBlack=0")
adm.addVideoFilter("addLogo", "x=550", "y=10", "alpha=255", "logoImageFile=E:/neil/2-projects/AntimatMusic/images/logo-solid-white-400x100px.png", "fade=0")
adm.audioClearTracks()
adm.setSourceTrackLanguage(0,"und")
adm.audioAddTrack(0)
adm.audioCodec(0, "copy");
adm.audioSetDrc(0, 0)
adm.audioSetShift(0, 0, 0)
adm.setContainer("MP4", "muxerType=0", "useAlternateMp3Tag=True", "forceAspectRatio=False", "aspectRatio=1", "rotation=0")

eumagga0x2a

The wording of the error is quite developer-centric :-) The error means that the muxer-specific implementation of the virtual method open() has returned false. To do so, the muxer must have been already successfully created.

The failure might be attributable to audio codec (e.g. LPCM) the MP4 muxer in Avidemux doesn't support. If you would have attached the log file (%localappdata%\avidemux\admlog.txt), it would have been actually possible to identify the cause.

The script seems to be okay, the "Black" filter however seems to be redundant as it is configured with start time = end time.

neilengineer

I can open Avidemux from start menu and use it, no problem.
For the log, how to get it, for me, the log is not found


>dir %APPDATA%\avidemux\admlog.txt
Volume in drive C is Windows
Volume Serial Number is 7858-B480

Directory of C:\Users\Neil\AppData\Roaming\avidemux

File Not Found

eumagga0x2a


neilengineer

hi,All,

I checked the log myself, and found the output file can't be opened, because the path has some non-English characters.
Now it's working! Thanks.