Avidemux Forum

Participate => User interface and Usability => Topic started by: Chrisi on April 23, 2020, 07:36:04 AM

Title: Indexing of more files at once
Post by: Chrisi on April 23, 2020, 07:36:04 AM
First of all - thanks a lot for this brilliant and easy to use application...

Is there any way to select multiple files and index them in one go...
Would save a lot of time and clicking arround...
Title: Re: Indexing of more files at once
Post by: eumagga0x2a on April 23, 2020, 11:06:02 PM
What problem you are trying to solve?

If all .ts (or .mpg, we have to match by extension here) files you would like to index are in a single directory, you could use internal python scripting to open and close all ts files in a folder:

adm = Avidemux()
ui = Gui()
ext = "ts"
inputFolder = ui.dirSelect("Select a folder with "+ext+" files")
if inputFolder is None:
    return
list = get_folder_content(inputFolder,ext)
if list is None:
    gui.displayError("No "+ext+" files found in "+inputFolder+", nothing to do.")
    return
for i in list:
    adm.loadVideo(i)
gui.displayInfo("Everything done","")


To run this code, either paste it into the Avidemux scripting shell (and press "evaluate") or save it as a .py file and execute it via "File" --> "Project Script" --> "Run Project Script".

If some files might be identified based on their sequntial names and unified sizes as pieces of a single stream, this script might not work as expected.
Title: Re: Indexing of more files at once
Post by: Chrisi on April 25, 2020, 08:56:46 PM
Wow - thank you very much for that - it works - thats exactly what i was asking for...

Simple to use and clearly explained - even i could get it to work without running into troubles...
Only i get an Error-Message at the end but never mind - all the files are done by then...

So thanks again for that timesaver...

👍👍👍
Title: Re: Indexing of more files at once
Post by: eumagga0x2a on April 26, 2020, 12:05:04 AM
Quote from: Chrisi on April 25, 2020, 08:56:46 PM
Only i get an Error-Message at the end

What does the error message say?
Title: Re: Indexing of more files at once
Post by: Chrisi on April 26, 2020, 09:51:41 AM
Thats the error-message but all the .idx2 files have been succesfully created...
I am using OSX-Mojave - maybe this has something to do with that...

Quote
TinyPy:Exception

Exception :(_tp_dict_get) KeyError: gui
BackTrack:
File:py2bc.py, line 53
File:/Users/admin/Desktop/index.py, line 13
Title: Re: Indexing of more files at once
Post by: eumagga0x2a on April 26, 2020, 10:58:05 AM
Quote from: Chrisi on April 26, 2020, 09:51:41 AM
Thats the error-message but all the .idx2 files have been succesfully created...
I am using OSX-Mojave - maybe this has something to do with that...


TinyPy:Exception

Exception :(_tp_dict_get) KeyError: gui


Oops, please replace my typo

gui.displayInfo("Everything done","")

with the corrected version

ui.displayInfo("Everything done","")

Anyway, that last command is just for looks (to show a graphical message). The operating system doesn't matter here. However, on macOS you could alternatively use bash scripting to call the command-line version of Avidemux


cd /full/path/to/the/directory
for file in *.ts; do /Application/Avidemux_2.7.5.app/Contents/MacOS/avidemux_cli --load "${file}"; done


instead of using internal python scripting.
Title: Re: Indexing of more files at once
Post by: eumagga0x2a on April 26, 2020, 11:14:58 AM
Wait a bit, Mojave? Which version of Avidemux do you use then? I guess, recent nightlies don't run on Mojave anymore. (I am still not accustomed to macOS versioning, we should be compatible all the way back to High Sierra)
Title: Re: Indexing of more files at once
Post by: Chrisi on April 26, 2020, 11:23:58 AM
Changed it - works perfectly now - get the message "Everything done" at the end...

I rather use this internal python scripting instead of command line - feels like its part of the program and completely useable over the graphical user interface - brilliant...

Thank you very much...
Title: Re: Indexing of more files at once
Post by: Chrisi on April 26, 2020, 11:32:40 AM
Quote from: eumagga0x2a on April 26, 2020, 11:14:58 AM
Wait a bit, Mojave? Which version of Avidemux do you use then? I guess, recent nightlies don't run on Mojave anymore. (I am still not accustomed to macOS versioning, we should be compatible all the way back to High Sierra)

Running 2.7.4 - the latest official i guess - Mojave came after High Sierra so no problems with that...
Will stick to Mojave now because of the lack of 32-bit support on Catalina...
Title: Re: Indexing of more files at once
Post by: eumagga0x2a on April 26, 2020, 12:10:15 PM
I would strongly recommend updating to the latest and greatest, especially for macOS ("fade" filters were completely borked in the release, reported and fixed soon thereafter + plentiful fixes all around the place).
Title: Re: Indexing of more files at once
Post by: Chrisi on April 26, 2020, 12:41:36 PM
Up to date now 👍- didnt know there where newer releases...
Title: Re: Indexing of more files at once
Post by: eumagga0x2a on April 27, 2020, 07:18:44 PM
Strictly speaking, these builds are not releases but snapshots of the ongoing development. In this sense, they may introduce changes which are not backward-compatible or some new bugs or even crashes. However, at the moment the net balance should be strongly positive compared to the last release.