ext="mp4"
inputFolder="c:\\tmp\\"
#
def convert(filein):
if(0 == adm.loadVideo(filein)):
ui.displayError("oops","cannot load "+filein)
raise
adm.videoCodec("Copy")
adm.audioClearTracks()
adm.setSourceTrackLanguage(0,"und")
if adm.audioTotalTracksCount() <= 0:
raise("Cannot add audio track 0, total tracks: " + str(adm.audioTotalTracksCount()))
adm.audioAddTrack(0)
adm.audioCodec(0, "Lame")
adm.audioSetDrc(0, 1)
adm.audioSetShift(0, 0, 0)
adm.audioSetNormalize2(0, 2, 150, -30)
adm.setContainer("MP4", "muxerType=0", "optimize=1", "forceAspectRatio=False", "aspectRatio=1", "displayWidth=1280", "rotation=0", "clockfreq=0")
adm.save(filein+".edit.mp4")
print("Done")
#
# Main
#
ui=Gui()
adm=Avidemux()
#
list=get_folder_content(inputFolder,ext)
if(list is None):
raise
for i in list:
convert(i)
print("Done")
. However, if possible, I would like to keep the thread open in case other slow conversion-related problems may arise.Quote from: sl1pkn07 on December 30, 2025, 12:39:55 AMneeds fix for use to "new" API v4
Quote{
"useAdvancedConfiguration" : true,
"general" : {
"params" : "CBR=2400",
"threads" : 0,
"preset" : "medium",
"tuning" : "none",
"profile" : "high",
"fast_decode" : false,
"zero_latency" : false,
"fast_first_pass" : true,
"blueray_compatibility" : false,
"fake_interlaced" : false
},
"level" : -1,
"vui" : {
"sar_height" : 1,
"sar_width" : 1,
"overscan" : 0,
"vidformat" : 5,
"fullrange" : false,
"colorprim" : 2,
"transfer" : 2,
"colmatrix" : 2,
"chroma_loc" : 0
},
"MaxRefFrames" : 3,
"MinIdr" : 25,
"MaxIdr" : 125,
"i_scenecut_threshold" : 40,
"intra_refresh" : false,
"MaxBFrame" : 3,
"i_bframe_adaptive" : 2,
"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,
"b_i4x4" : true,
"b_i8x8" : true,
"b_p8x8" : true,
"b_p16x16" : false,
"b_b16x16" : true,
"weighted_pred" : 2,
"weighted_bipred" : true,
"direct_mv_pred" : 1,
"chroma_offset" : 0,
"me_method" : 1,
"me_range" : 16,
"mv_range" : -1,
"mv_range_thread" : -1,
"subpel_refine" : 10,
"chroma_me" : true,
"mixed_references" : true,
"trellis" : 2,
"psy_rd" : 1,
"psy_trellis" : 0,
"fast_pskip" : true,
"dct_decimate" : true,
"noise_reduction" : 0,
"psy" : true,
"intra_luma" : 11,
"inter_luma" : 21
},
"ratecontrol" : {
"rc_method" : 0,
"qp_constant" : 0,
"qp_min" : 10,
"qp_max" : 51,
"qp_step" : 4,
"bitrate" : 0,
"rate_tolerance" : 1,
"vbv_max_bitrate" : 0,
"vbv_buffer_size" : 0,
"vbv_buffer_init" : 1,
"ip_factor" : 1.4,
"pb_factor" : 1.3,
"aq_mode" : 2,
"aq_strength" : 1,
"mb_tree" : true,
"lookahead" : 40
}
}