Avidemux Forum

Avidemux => Main version 2.6 => Topic started by: phaolo on November 12, 2013, 12:33:55 PM

Title: Some questions about python scripting in avidemux
Post by: phaolo on November 12, 2013, 12:33:55 PM
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/
Title: Re: Some questions about python scripting in avidemux
Post by: mean on November 13, 2013, 06:56:38 PM
 \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
Title: Re: Some questions about python scripting in avidemux
Post by: mean on November 13, 2013, 06:58:09 PM
audioCodec needs an additional parameter : the track number
audioCodec(0,"Copy")
Title: Re: Some questions about python scripting in avidemux
Post by: mean on November 13, 2013, 06:58:33 PM
mp4 vs mp4v2 : Whichever works best for you
Title: Re: Some questions about python scripting in avidemux
Post by: phaolo on November 13, 2013, 11:36:58 PM
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
Title: Re: Some questions about python scripting in avidemux
Post by: phaolo on November 25, 2013, 09:51:33 AM
((BuMp!))
Title: Re: Some questions about python scripting in avidemux
Post by: macduke on November 25, 2013, 04:01:11 PM
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.