Log in

View Full Version : MPASource use in my script: what i wrong? :(


Matrixbob
21st June 2007, 21:32
Error:
http://img515.imageshack.us/img515/7/69ly3.gif

Files:
http://img108.imageshack.us/img108/5183/mp3eq9.gif

Script:

########## ITEM 0! ##########

########## TOP, BOTTOM E SIDE GENERATI DINAMICAMENTE ##########
top = ImageReader(file="top_parser.png", start=0, end=215, fps=25).ConvertToYV12()
bottom = ImageReader(file="bottom_parser.png", start=0, end=215, fps=25).ConvertToYV12()
side = ImageReader(file="side_parser.png", start=0, end=215, fps=25).ConvertToYV12()
########## ALLEGATO DEL ITEM ##########
V = ImageReader(file="no_input.png", start=0, end=25, fps=25).ConvertToYV12()
A = MPASource(".\canale1\iTourist_presentazione.mp3")
e0 = AudioDub(V, A).ConvertToMono()
########## TITOLO DEL ITEM ##########
top_subs0 = Subtitle(top, """iTourist - Con iTourist la emozione della conoscenza è tua, dove vuoi e quando vuoi.\niTourist - Treviso - Presentazione""", x=5, y=5, first_frame=0, last_frame=215, font="Arial", size=30, text_color=$ff9854, lsp=10)
########## DESCRIZIONE DEL ITEM ##########
side_subs0 = Subtitle(side, """Benvenuti nel sistema di\naudio informazione turistica""", x=5, y=5, first_frame=0, last_frame=215, font="Arial", size=25, text_color=$e0e0e0, lsp=10)


########## ITEM 1! ##########

########## TOP, BOTTOM E SIDE GENERATI DINAMICAMENTE ##########
top = ImageReader(file="top_parser.png", start=0, end=199, fps=25).ConvertToYV12()
bottom = ImageReader(file="bottom_parser.png", start=0, end=199, fps=25).ConvertToYV12()
side = ImageReader(file="side_parser.png", start=0, end=199, fps=25).ConvertToYV12()
########## ALLEGATO DEL ITEM ##########
V = ImageReader(file="no_input.png", start=0, end=25, fps=25).ConvertToYV12()
A = MPASource(".\canale1\00_iTourist_Treviso_Introduzione.mp3")
e1 = AudioDub(V, A).ConvertToMono()
########## TITOLO DEL ITEM ##########
top_subs1 = Subtitle(top, """iTourist - Con iTourist la emozione della conoscenza è tua, dove vuoi e quando vuoi.\niTourist Treviso - 00 Introduzione""", x=5, y=5, first_frame=0, last_frame=199, font="Arial", size=30, text_color=$ff9854, lsp=10)
########## DESCRIZIONE DEL ITEM ##########
side_subs1 = Subtitle(side, """Inrtoduzione alla visita\ndi Treviso""", x=5, y=5, first_frame=0, last_frame=199, font="Arial", size=25, text_color=$e0e0e0, lsp=10)


########## ITEM 2! ##########

########## TOP, BOTTOM E SIDE GENERATI DINAMICAMENTE ##########
top = ImageReader(file="top_parser.png", start=0, end=171, fps=25).ConvertToYV12()
bottom = ImageReader(file="bottom_parser.png", start=0, end=171, fps=25).ConvertToYV12()
side = ImageReader(file="side_parser.png", start=0, end=171, fps=25).ConvertToYV12()
########## ALLEGATO DEL ITEM ##########
V = ImageReader(file="no_input.png", start=0, end=25, fps=25).ConvertToYV12()
A = MPASource(".\canale1\01_iTourist_Storia.mp3")
e2 = AudioDub(V, A).ConvertToMono()
########## TITOLO DEL ITEM ##########
top_subs2 = Subtitle(top, """iTourist - Con iTourist la emozione della conoscenza è tua, dove vuoi e quando vuoi.\niTourist Treviso - 01 Storia""", x=5, y=5, first_frame=0, last_frame=171, font="Arial", size=30, text_color=$ff9854, lsp=10)
########## DESCRIZIONE DEL ITEM ##########
side_subs2 = Subtitle(side, """La Storia di Treviso""", x=5, y=5, first_frame=0, last_frame=171, font="Arial", size=25, text_color=$e0e0e0, lsp=10)


########## ITEM 3! ##########

########## TOP, BOTTOM E SIDE GENERATI DINAMICAMENTE ##########
top = ImageReader(file="top_parser.png", start=0, end=215, fps=25).ConvertToYV12()
bottom = ImageReader(file="bottom_parser.png", start=0, end=215, fps=25).ConvertToYV12()
side = ImageReader(file="side_parser.png", start=0, end=215, fps=25).ConvertToYV12()
########## ALLEGATO DEL ITEM ##########
V = ImageReader(file="no_input.png", start=0, end=25, fps=25).ConvertToYV12()
A = MPASource(".\canale1\02_iTourist_Treviso_San_Nicolo.mp3")
e3 = AudioDub(V, A).ConvertToMono()
########## TITOLO DEL ITEM ##########
top_subs3 = Subtitle(top, """iTourist - Con iTourist la emozione della conoscenza è tua, dove vuoi e quando vuoi.\niTourist Treviso - 02 San Nicolo'""", x=5, y=5, first_frame=0, last_frame=215, font="Arial", size=30, text_color=$ff9854, lsp=10)
########## DESCRIZIONE DEL ITEM ##########
side_subs3 = Subtitle(side, """Treviso: San Nicolò""", x=5, y=5, first_frame=0, last_frame=215, font="Arial", size=25, text_color=$e0e0e0, lsp=10)

e_tot = e0 + e1 + e2 + e3

top_subs_tot = top_subs0 + top_subs1 + top_subs2 + top_subs3

side_subs_tot = side_subs0 + side_subs1 + side_subs2 + side_subs3

horizontal = StackHorizontal(e_tot, side_subs_tot)
vertical = StackVertical(top_subs_tot, horizontal, bottom)

return vertical

gzarkadas
21st June 2007, 22:39
put this line
return BlankClip()
before the line:

"horizontal = StackHorizontal(e_tot, side_subs_tot)"

Does it show a blank clip, without errors?

Matrixbob
21st June 2007, 22:55
put this line
return BlankClip()
before the line:

"horizontal = StackHorizontal(e_tot, side_subs_tot)"

Does it show a blank clip, without errors?

Always "Access Violation" i see, nothing is changed... :o

[EDIT]
In Italy is 00.15 my eyes are bleeding now, i go to spleep with the hope that someone try to help me.
Hi boys, good n8.

gzarkadas
22nd June 2007, 00:23
May be then the zero filesize (as I see from the posted folder contents) of "01_iTourist_Storia.mp3" ?

If this does not solve the issue, try putting the above line (return...) higher and higher in your script until you stop getting an exception. The first line below will probably be the offending one.

Matrixbob
22nd June 2007, 09:40
May be then the zero filesize (as I see from the posted folder contents) of "01_iTourist_Storia.mp3" ?

If this does not solve the issue, try putting the above line (return...) higher and higher in your script until you stop getting an exception. The first line below will probably be the offending one.
Good morning boys (and girls)!

The blankclip return correct on the row
A = MPASource(".\canale1\02_iTourist_Treviso_San_Nicolo.mp3")
, over il crash like the other POST. :eek:

Is strange because the file is not 0 Bytes ... preceding files is 0 Bytes.

gzarkadas
22nd June 2007, 11:46
Try to load the mp3 file with a simple script such as:

V = ImageReader(file="no_input.png", start=0, end=25, fps=25).ConvertToYV12()
A = MPASource(".\canale1\02_iTourist_Treviso_San_Nicolo.mp3")
AudioDub(V, A)

If it loads correctly, then the error is most probably due to the zero filesize mp3 before.

Note (from MPASource docs) that the plugin decodes part of the file during script load to return the exact sample number. If the routines are not so robust to detect an invalid file (I don't know; never used it before) then they eventually crash.

Matrixbob
22nd June 2007, 15:22
Again error:
http://img187.imageshack.us/img187/4149/againerrorab3.gif

Script:


V = ImageReader(file="no_input.png", start=0, end=25, fps=25).ConvertToYV12()
A = MPASource("02_iTourist_Treviso_San_Nicolo.mp3")
e0 = AudioDub(V, A).ConvertToMono()

return e0

Matrixbob
22nd June 2007, 15:33
I put the MP3 file:
) HERE ( (http://matrixbob.netsons.org/02_iTourist_Treviso_San_Nicolo.mp3)

:( :( :(

What have of special this file?! :confused:

gzarkadas
22nd June 2007, 16:33
Well, I don't know; maybe is it VBR? Audacity opens it fine. I think it is better to try DirectShowSource or NicMPASource as alternatives for this file.

Matrixbob
22nd June 2007, 19:04
I think it is better to try DirectShowSource or NicMPASource as alternatives for this file.

In DirectShowSource what syntax i must get for open MP3 files? :p
This night i try it!

NicMPASource i didn't know untill now. :D

Wilbert
22nd June 2007, 21:59
I guess we need to bug the authors of MPASource :)

I advice you to try NicAudio.

Matrixbob
22nd June 2007, 23:27
I advice you to try NicAudio.

What other plugin or filter i must use to load the MP3 files in AVISynth?!
NicAudio or NicMPASource or DirectShowSource?

[EDIT]
I saw now >here< (http://avisynth.org/warpenterprises/) that NicMPASource not exist, ma Nic is the author of EvilMPASource.
You refer to this, correct?!

gzarkadas
22nd June 2007, 23:41
I saw now >here< (http://avisynth.org/warpenterprises/) that NicMPASource not exist, ma Nic is the author of EvilMPASource.
You refer to this, correct?!

Go a few lines below to NicAudio (.dll) at the same web page (this was an :devil: coincidence :)).
Edit:
NicMPASource is a function inside NicAudio.dll plugin. Do a LoadPlugin("NicAudio.dll") and then use NicMPASource.

Matrixbob
22nd June 2007, 23:50
Go a few lines below to NicAudio (.dll) at the same web page (this was an :devil: coincidence :)).
Edit:
NicMPASource is a function inside NicAudio.dll plugin. Do a LoadPlugin("NicAudio.dll") and then use NicMPASource.

OOOOOK i get it, tomorrow i try.
TNX to all for follow me in this 3D.

N8.

Matrixbob
23rd June 2007, 13:36
Again error:
http://img264.imageshack.us/img264/3298/againerroruv5.gif

Script:

SetMemoryMax(256)
LoadPlugin("NicAudio.dll")


########## ITEM 0! ##########

########## TOP, BOTTOM E SIDE GENERATI DINAMICAMENTE ##########
top = ImageReader(file="top_parser.png", start=0, end=215, fps=25).ConvertToYV12()
bottom = ImageReader(file="bottom_parser.png", start=0, end=215, fps=25).ConvertToYV12()
side = ImageReader(file="side_parser.png", start=0, end=215, fps=25).ConvertToYV12()
########## ALLEGATO DEL ITEM ##########
V = ImageReader(file="no_input.png", start=0, end=25, fps=25).ConvertToYV12()
A = NicMPASource(".\canale1\iTourist_presentazione.mp3")
e0 = AudioDub(V, A).ConvertToMono()
########## TITOLO DEL ITEM ##########
V = Subtitle(top, """iTourist - Con iTourist la emozione della conoscenza è tua, dove vuoi e quando vuoi.\niTourist - Treviso - Presentazione""", x=5, y=5, first_frame=0, last_frame=215, font="Arial", size=30, text_color=$ff9854, lsp=10)
A = WavSource(".\tts\tts0.wav")
top_subs0 = AudioDub(V, A)
########## DESCRIZIONE DEL ITEM ##########
side_subs0 = Subtitle(side, """Benvenuti nel sistema di\naudio informazione turistica""", x=5, y=5, first_frame=0, last_frame=215, font="Arial", size=25, text_color=$e0e0e0, lsp=10)


########## ITEM 1! ##########

########## TOP, BOTTOM E SIDE GENERATI DINAMICAMENTE ##########
top = ImageReader(file="top_parser.png", start=0, end=199, fps=25).ConvertToYV12()
bottom = ImageReader(file="bottom_parser.png", start=0, end=199, fps=25).ConvertToYV12()
side = ImageReader(file="side_parser.png", start=0, end=199, fps=25).ConvertToYV12()
########## ALLEGATO DEL ITEM ##########
V = ImageReader(file="no_input.png", start=0, end=25, fps=25).ConvertToYV12()
A = NicMPASource("canale1\00_iTourist_Treviso_Introduzione.mp3", 1)
e1 = AudioDub(V, A).ConvertToMono()
########## TITOLO DEL ITEM ##########
V = Subtitle(top, """iTourist - Con iTourist la emozione della conoscenza è tua, dove vuoi e quando vuoi.\niTourist Treviso - 00 Introduzione""", x=5, y=5, first_frame=0, last_frame=199, font="Arial", size=30, text_color=$ff9854, lsp=10)
A = WavSource(".\tts\tts1.wav")
top_subs1 = AudioDub(V, A)
########## DESCRIZIONE DEL ITEM ##########
side_subs1 = Subtitle(side, """Inrtoduzione alla visita\ndi Treviso""", x=5, y=5, first_frame=0, last_frame=199, font="Arial", size=25, text_color=$e0e0e0, lsp=10)


e_tot = e0 + e1
top_subs_tot = top_subs0 + top_subs1
side_subs_tot = side_subs0 + side_subs1

horizontal = StackHorizontal(e_tot, side_subs_tot)
vertical = StackVertical(top_subs_tot, horizontal, bottom)

return vertical

gzarkadas
23rd June 2007, 15:24
And in a different file than the original with trouble; new source function, new troubles :p!

I have tried the first file (02_iTourist_Treviso_San_Nicolo.mp3) with DirectShowSource and got a filter graph timeout error. So, I can only guess that maybe the cause of errors is that your mp3 encoder does produce incompatible in some way mp3 files.

I think the best solution is to open the offending .mp3 file(s) in audacity, export them as .wav files and use WavSource. It is a quick, just-a-few-clicks process that will immediately solve your issue :).

Matrixbob
23rd June 2007, 20:41
And in a different file than the original with trouble; new source function, new troubles :p!


For the moment DirectShowSource(VARS) is working:

V = ImageReader(file="no_input.png", start=0, end=25, fps=25).ConvertToYV12()
A = DirectShowSource("canale1\iTourist_presentazione.mp3")
e0 = AudioDub(V, A).ConvertToMono()


Instead apparently both the plugins are not mature.


I have tried the first file (02_iTourist_Treviso_San_Nicolo.mp3) with DirectShowSource and got a filter graph timeout error. So, I can only guess that maybe the cause of errors is that your mp3 encoder does produce incompatible in some way mp3 files.

I think the best solution is to open the offending .mp3 file(s) in audacity, export them as .wav files and use WavSource. It is a quick, just-a-few-clicks process that will immediately solve your issue :).

I write e C program that write the AVS script & i don't want rewrite more lines of the C code for insert another routine. :(

Audacity accept command line?

gzarkadas
23rd June 2007, 22:42
I write e C program that write the AVS script & i don't want rewrite more lines of the C code for insert another routine. :(

Audacity accept command line?

No, but ffmpeg does. Get a windows build from here (http://arrozcru.no-ip.org/ffmpeg_builds/). It can be as easy as "ffmpeg -i your.mp3 your.wav".

Matrixbob
25th June 2007, 10:14
No, but ffmpeg does. Get a windows build from here (http://arrozcru.no-ip.org/ffmpeg_builds/). It can be as easy as "ffmpeg -i your.mp3 your.wav".

There is a way for understand if the MP3 files al bad formed?!
:helpful:

gzarkadas
25th June 2007, 10:35
There is a way for understand if the MP3 files al bad formed?!
:helpful:

I don't know whether your mp3 files are bad-formed. The fact they can't be read by (Nic)MPASource does not imply that they are bad-formed; they are just not-compatible with the specific plugins (which is a different thing).

In any case, if ffmpeg cannot convert the file it will give an indication (an error message) in the screen output. BTW, the line in the previous post does convert your test .mp3 in a usable .wav file.

foxyshadis
25th June 2007, 12:12
An error occurred reading embedded summary information in D:\02_iTourist_Treviso_San_Nicolo.mp3. The information will be ignored.
An error occurred reading embedded marker/region information in D:\02_iTourist_Treviso_San_Nicolo.mp3. The information will be ignored.
But it opens and decodes it fine.

Opened in a hex editor and HEY I know why this isn't working. NicAudio will only look for the startcode up to 1k past the start of the file, but the album cover uses quite a bit more than that. In fact, the start code doesn't occur until 51k down the file. Rebuilt with a 100k buffer and it works great. Cheap hacks a-go.

Build (http://foxyshadis.slightlydark.com/random/NicAudio.zip), you'll need the VC8SP1 runtime (http://www.microsoft.com/downloads/details.aspx?FamilyID=200B2FD9-AE1A-4A14-984D-389C36F85647&displaylang=en) if you don't already have it. Only includes modified file from the source, the rest is in the original package (will be sent to warp).

gzarkadas
25th June 2007, 12:25
...Opened in a hex editor and HEY I know why this isn't working...

At last, someone sheds the light of reason to our crude empirical thread :D. I am content now; thanks foxyshadis :).

Matrixbob
25th June 2007, 16:27
Sorry to all, but i undersand only simple english i don't know all the vocabolary and the mean of all the sentences. :(

NicAudio will only look for the startcode up to 1k past the start of the file, but the album cover uses quite a bit more than that. In fact, the start code doesn't occur until 51k down the file. Rebuilt with a 100k buffer and it works great. Cheap hacks a-go.

Rebuild the MP3 files? I can't, the MP3 files change always because are part of a iPODfeed XML.

Rebuild how? On air with AVISynth is possible?
What script, if is possible, i can use?
---

I use DirectShowSource at the moment, is a bad this solution? :(

foxyshadis
25th June 2007, 16:49
No, rebuild NicAudio from source, nothing to do with the mp3s. That's what my download points to. Replace the original with my compile and it'll work.

Matrixbob
25th June 2007, 17:25
No, rebuild NicAudio from source, nothing to do with the mp3s. That's what my download points to. Replace the original with my compile and it'll work.

OK, ma if i use DirectShowSource is a bad solution?
There is side effect? What kind of side effect?
What change?
What involves?

Matrixbob
25th June 2007, 17:40
Maybe we must report this thread (with 1 link) to the authors of the 2 plugins (MPASource - NicAudio) that present this problem?
I don't know how ...

foxyshadis
26th June 2007, 04:31
DirectShow is fine, if it works. It doesn't always, though, because it can be so damn finicky sometimes, plus it's not self-contained in case you need to push scripts out to other systems. But if it works it works.

ernstblaauw
11th February 2008, 23:51
I'm sorry to reply to this old thread, but I'm having the same problems. Trying to load a MP3 file, MPASource gives me a
Evaluate: System exception - Access Violation.
NicMPASource pops up with:
Runtime error!
Program:
F:\Progra...
R6025
- pure function call
or says:

m2AudioMPASource: error in file "<file>"

Does someone know a solution to those problems, or knows how to load a mp3 file without using DirectShow?

Adub
12th February 2008, 03:21
1) Why don't you want to use Directshow?
2) Post your script.
3) Post your mp3 file.

ernstblaauw
12th February 2008, 10:13
1) Why don't you want to use Directshow?
2) Post your script.
3) Post your mp3 file.
I don't want to use DirectShow, because you're dependent of other software. Also, you don;t know what software is installed on other PC's if you want to use you're script somewhere else.

However, after e-mailing with the author of MPASource, he suggested that the mp3 file is maybe 'slightly corrupt'. Loading the file in mp3directcut (http://mpesch3.de1.cc/mp3dc.html) and doing 'save all' solved the problem!

Do you want more information?
Thanks for your help :)!

Adub
12th February 2008, 18:45
I suspected that was the case, but I couldn't be sure without having the file.

Congrats on fixing the problem yourself!

WarpEnterprises
20th February 2008, 22:41
(1) I think some of the crashes come from ID3v2 headers at the start of the files. They look like mpeg1 Layer1, so I made a version without support for Layer1.

(2) My programming was not good enough at the time I made the previous version to see that MPASource has some global variables which prohibits to use it more than once in a script reliably. I changed this too.

The new version should be much more resistant to slight file problems.
www.avisynth.org/warpenterprises/#mpasource

Thanks ernstblaauw for kicking me to look at this at last!