Author Topic: Batch Processing Exception :error: tokenize  (Read 103 times)

elmex

  • Newbie
  • *
  • Posts: 6
Batch Processing Exception :error: tokenize
« on: November 21, 2017, 11:00:52 PM »
I tried the "Batch Processing Script 2". But the script doens't work at all. The problem ist the "adm" part. Without the "adm" part it works but that is not the idea of a batch.

The Error
Quote
TinyPy:Exception
Exception :error: tokenize
12: adm = Avidemux()
^

BackTrack:
File:py2bc.py, line 51
File:py2bc.py, line 9
File:tokenize.py, line 42
File:tokenize.py, line 13


Quote
#
# Load all the files in c:\tmp with .mp4 extension.
# That's it.
#
ext="mp4"
inputFolder="C:/Folder/"
#
def convert(filein):   
    if(0 == adm.loadVideo(filein)):
        ui.displayError("oops","cannot load "+filein)
        raise
      adm = Avidemux()
    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")

elmex

  • Newbie
  • *
  • Posts: 6
Re: Batch Processing Exception :error: tokenize
« Reply #1 on: November 24, 2017, 09:13:59 AM »
I found a Solution for me with Windows 10 and avidemux 2.7.0

Batch File
Quote
set avidemux="C:\Program Files\Avidemux 2.7 - 64 bits\avidemux.exe"
for %%f in (*.m4v) do %avidemux% --load "%%f" --run "C:\Folder\Copy.py" --save "%%~nf.mp4" --quit

tinypy File
Quote
adm = Avidemux()
adm.videoCodec("Copy")
adm.audioClearTracks()
adm.setSourceTrackLanguage(0,"unknown")
adm.audioAddTrack(0)
adm.audioCodec(0, "LavAAC", "bitrate=64");
adm.audioSetDrc(0, 0)
adm.audioSetShift(0, 0,0)
adm.setContainer("MP4", "muxerType=0", "useAlternateMp3Tag=True")

eumagga0x2a

  • Hero Member
  • *****
  • Posts: 1544
Re: Batch Processing Exception :error: tokenize
« Reply #2 on: November 24, 2017, 05:12:58 PM »
Works for me on Windows 7 with the latest Windows nightly (should work also with 2.7.0 and below) without the batch using the tinypy script posted in http://avidemux.org/smif/index.php/topic,18101.msg82660.html#msg82660 and the path adjusted for the particular Windows environment. Slash instead of backslash must be used as path separator.