How to keep/generate idx2 files for videos.

Started by avidemuxtom, October 28, 2021, 06:42:54 AM

Previous topic - Next topic

avidemuxtom

Hello. Indexing files tooks for me to much time so i woudl like to generate idx2 files for all my videos at the night so i could work with them next day. How to do it ? Years ago when i work with avidemux it generate idx files and then i coud work instantly. now that file is not generated or deleted after closing video.

eumagga0x2a

Quote from: avidemuxtom on October 28, 2021, 06:42:54 AMnow that file is not generated or deleted after closing video.

Nothing changed about that. Index files (.idx2) are created for MPEG-TS and MPEG-PS video files only and are never deleted automatically except of when they were created by an older version of Avidemux and the file syntax has since changed. Avidemux asks user to let it re-index the video then.

If all streams which you would like to index are located in a single folder, you could use the following script to open all m2ts, mpg, ts, and vob files there:

#PY  <- Needed to identify #
#
ui = Gui()
adm = Avidemux()

# -------- select input directory --------
inputFolder = ui.dirSelect("Select folder")
if inputFolder is None:
    ui.displayError("Oops", "No folder selected")
    return

# -------- read content --------

total = 0
counter = 0
extensions = ["m2ts","mpg","ts","vob"]
for idx in range(len(extensions)):
    lst = get_folder_content(inputFolder, extensions[idx])
    if lst is None:
        continue
    for i in lst:
        total += 1
        counter += adm.loadVideo(i)

if not counter:
    ui.displayInfo("Warning", "No files indexed")
    return

if counter == 1:
    ui.displayInfo("Finished", "One file out of " + str(total) + " indexed")
    return

ui.displayInfo("Finished", str(counter) + " files out of " + str(total) + " indexed")