Some questions about python scripting in avidemux

Started by phaolo, November 12, 2013, 12:33:55 PM

Previous topic - Next topic

phaolo

I'm starting a simple script to convert flv to mp4, using the copy method (thanks Anubioz for the template)
I'll write here questions, when I encounter some problem, if someone is willing to help me.

1- I'd like to use some hardcoded normal paths other than folder selecting, but double slashes are just annoying. Why isn't this working?
import os
custompath=os.path.normpath("C:\mypath\myfolder")


2- adm.audioCodec("Copy") gives an exception, whilst adm.videoCodec("Copy") works. Where is the mistake?
SOLUTION:
adm.audioCodec(0,"Copy")
..but.. the output files are cut at the end! (one gives "File too short")
It's like the script is generating the .mp4 bug that existed in 2.6.5, whilst the 2.6.6 GUI doesn't.


3- should I use "mp4" or "mp4v2" muxer? What's the difference?

p.s: the official useful library is here: http://docs.python.org/2/library/

mean

 \x means  means x is a special character
i.e. \n is ~ newline
"\\"  means  a regular "\"
you could try using / instead, might work or not

mean

audioCodec needs an additional parameter : the track number
audioCodec(0,"Copy")

mean


phaolo

#4
Quoteyou could try using / instead
I wanted to use "os.path.normpath" to just paste the paths without editing them each time.
Why isn't that working?

QuoteaudioCodec needs an additional parameter : the track number
Yes, I've already added that solution, but the output is wrong!
I'm getting the "File too short" error again, now even in the interface   :'(

Quotemp4 vs mp4v2 : Whichever works best for you
I'd like the most used\updated\compatible one (in 2.5.4)
Output files in hexedit contain this at start:
-mp4: .. ftypisom....isomiso2avc1mp41
-mp4v2: ....ftypmp42....mp42isom

Thanks


macduke

Hi.

I've checked with my phyton scripting (on PC with w7 64).
All the paths have slash (/) and not the backslash expected by DOS/Windows users.