News:

--

Main Menu

Need help with tinypy

Started by TidensBarn, May 16, 2013, 10:07:05 AM

Previous topic - Next topic

TidensBarn

I'm loosing my mind trying to figure out how to write a simple script with tinypy..

I have a folder full of MP4 files with a separate MP3 for each of them with the same name. All I want to do is take each "xyz.mp4" and add "xyz.mp3" as an audio track to it. But I'm already failing at getting the required string operations to work.. the usual Python methods like str.rfind(".") cause an error, as does basename(str). When using slicing like str[2:5] the second parameter always gets ignored.

I'm completely lost. There doesn't even seem to be any kind of proper documentation for this script engine..

(Avidemux 2.6.3 r8518)

Jan Gruuthuse

with a loop using present .mp4 and using then the filename with extention .mp3
for i in *.mp4
mean did post a script perhaps you find enough info in it to proceed with your script:
[2.6.4] Convert a whole folder

TidensBarn

Thanks for the reply!

I managed to write down a working script by now. Now that I've got 2.6.4, even the commands described in the wiki, like "basename" work. Still don't know of a convenient way to splice or find characters in a String, though.. 

Anyways, here's my script. Maybe someone will find it useful.

I12learn

You should have a look into Python docs.
Maybe at the bottom you'll find functions to split the file name to get name and extension as you trying to do on your own.
The only thing I did find is that you mention some function without any import statement, how could it work?