forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Irritating frustrating problem

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
mental
Newbie


Joined: 26 Sep 2005
Posts: 10
Location: Somewhere near England

PostPosted: Sun Oct 16, 2005 7:25 pm    Post subject: Irritating frustrating problem Reply with quote

Apologies for a long post but I am completely stumped with an issue I have been unable to figure out.

I`m finding that VDS5 is not correctly finding text in strings. I am currently string matching with the external string.dll but had the exact same issue when I used a list and the @match command so it seems the problem is somewhere in VDS5 itself or I am making a major error that I just can`t find.

Basically the script runs a program, called movieid. The output from MovieID is piped to a variable called %p and it is inside this string I am trying to find certain text.

The only problem I have with it is the %p and finding the text I want as it always reports that the audio is "NOT AC3" despite it being AC3 - the info box is used to verify that the text being searched for is actually present so I can say for certain the text is there waiting to be found.

I included the full thing here just for completeness but the only area of problem is involving the matching process. It is not finding the string "Format ID: 0x2000" despite it being present.

I hope someone could see if there is an obvious reason I am missing as I have spent ages trying to suss this out. I may end up looking a tit but I`ll risk it Embarassed



Code:

external C:\automake\dlls\String.dll
#define function, string

external C:\automake\dlls\mt.dll
#define function, MT

Title AutoMake
DIALOG CREATE,AutoMake,-1,0,227,172
REM *** Modified by Dialog Designer on 19/09/2005 - 00:09 ***
DIALOG ADD,BUTTON,runwizard,40,16,192,24,Change preferences
DIALOG ADD,BUTTON,makedvd,96,16,192,24,Make a DVD
DIALOG SHOW
:Evloop
wait event
goto @event()
:runwizardBUTTON
info Run wizard will go here
goto evloop

:makedvdBUTTON


:start
REM pick a file

%b = @filedlg("Avi file (*.avi)|*.avi|Mpeg file (*.mpg)|*.mpg|DVD Video files (*.vob)|*.vob|All files |*.*", Open file)

REM if cancel was selected begin processing the video files
REM %b holds the name of the video file that is ready to be converted

REM run movieid to identify the video and audio data needed to convert
REM pipe results to %p which we can then skip through to check

run c:\automake\movieid\movieid.exe @shortname(%b),pipe
%p = @pipe()

%%video_width = 000
%%video_height = 00
%%video_format = "what video"
%%framerate = "null"
%%hours = 00
%%minutes = 00
%%seconds = 00
%%audio_format = "what audio"
%%length = 00
%%temp = 00
%%temp2 = 00
%%temptext = "what"

%%temp = @pos("Video Info: ",%p)

%%length = @fadd(%%temp,12)
%%temp2 = @fadd(%%length,4)

%%video_height = @substr(%p,%%length,%%temp2)

%%temp = @pos("Video Info: ",%p)

%%length = @fadd(%%temp,12)
%%length = @fadd(%%length,@len(%%video_height))
%%length = @fadd(%%length,2)

%%temp2 = @fadd(%%length,4)
%%video_width = @substr(%p,%%length,%%temp2)
%%frameratestarts = @fadd(%%temp2,2)

REM now we find the framerate
%%temp = @fadd(%%frameratestarts,7)
%%framerate = @substr(%p,%%frameratestarts,%%temp)

IF @string(HoldsWord, %p, "23.976 fps")
%%framerate = "ntsc film"
end

IF @string(HoldsWord, %p, "25 fps")
%%framerate = "pal"
end

IF @string(HoldsWord, %p, "29.9")
%%framerate = "ntsc"
end

IF @string(HoldsWord, %p, "DivX")
%%video_format = "avi"
end

IF @string(HoldsWord, %p, "MPEG-1 Program Stream")
%%video_format = "mpeg1"
end

IF @string(HoldsWord, %p, "MPEG-2 Program Stream")
%%video_format = "mpeg2"
end

IF @string(HoldsWord, %p, "Xvid")
%%video_format = "avi"
end

IF @string(HoldsWord, %p, "AC3")
%%audio_format = "AC3"
end

IF @string(HoldsWord, %p, "Format ID: 0x2000") > 0
%%audio_format = "AC3"
end

IF @string(HoldsWord, %p, "Format ID: 0x2000") = 0
%%audio_format = "NOT AC3"
end

info audio is %%audio_format find format id 0x2000 is @string(HoldsWord, %p, "Format ID: 0x2000") and is found in @cr() %p

REM if its a pal avi with no AC3 sound convert to pal dvd

if %%framerate = "pal" and %%video_format = "avi" and %%audio_format = "NOT AC3"

# copy video to C:\automake\video_data\
file copy, @shortname(%b), C:\automake\video_data\video.avi, showerrors

run "C:\automake\avs2wav.exe C:\automake\scripts\palavi.avs C:\automake\video_data\video_25fps.wav",wait

run "C:\automake\headac3he\headac3he C:\automake\video_data\video_25fps.wav",wait

run "C:\automake\freeenc\FreeEnc.exe -i C:\automake\scripts\palavi.avs -o C:\automake\video_data\video_25fps.m2v -mpeg2 -b 7000 -priority 2 -1 -hq -vbr -scene -gopsize 11 -aspectratio 1:1 -maxbitrate:7300 -auto -close",wait

run "C:\automake\muxman\muxman.exe C:\automake\muxman\paldvd.mxp C:\automake\dvdvolume -run",wait

run "C:\automake\cdrtools\mkisofs.exe -nobak -dvd-video -o C:\automake\DVDIMAGE.iso C:\automake\dvdvolume",wait

run @shortname("C:\Program Files\DVD Decrypter\dvddecrypter.exe") "/mode isowrite /src C:\automake\DVDIMAGE.iso /start /close /erase /speed max",wait

:tempskip
end

if @file(C:\automake\dvdvolume\vts_01_1.vob)
goto cont
end

REM if its a pal avi with AC3 sound convert to pal dvd
if %%framerate = "pal" and %%video_format = "avi" and %%audio_format = "AC3"

# copy video to C:\automake\video_data\

file copy, @shortname(%b), C:\automake\video_data\video.avi, showerrors

rem run "C:\automake\avs2wav.exe C:\automake\scripts\palavi.avs C:\automake\video_data\video_25fps.wav",wait

rem run "C:\automake\headac3he\headac3he C:\automake\video_data\video_25fps.wav",wait

rem run "C:\automake\freeenc\FreeEnc.exe -i C:\automake\scripts\palavi.avs -o C:\automake\video_data\video_25fps.m2v -mpeg2 -b 7000 -priority 2 -1 -hq -vbr -scene -gopsize 11 -aspectratio 1:1 -maxbitrate:7300 -auto -close",wait

rem run "C:\automake\muxman\muxman.exe C:\automake\muxman\paldvd.mxp C:\automake\dvdvolume -run",wait

rem run "C:\automake\cdrtools\mkisofs.exe -nobak -dvd-video -o C:\automake\DVDIMAGE.iso C:\automake\dvdvolume",wait

rem run @shortname("C:\Program Files\DVD Decrypter\dvddecrypter.exe") "/mode isowrite /src C:\automake\DVDIMAGE.iso /start /close /erase /speed max",wait

:tempskip2

rem info Pal avi with AC3

run "C:\automake\virtualdubmod\virtualdubmod.exe /sC:\automake\scripts\extractac3.vcf",wait

end
if @file(C:\automake\dvdvolume\vts_01_1.vob)
goto cont
end

:cont
%p = "null"
%b = "null"
REM increase counter and loop back to repeat start to convert next video
%%audio_format = "what audio"
file delete,C:\automake\dvdvolume\*.*,allowundo,showerrors
goto evloop
:Close
rem close program
exit

_________________
Dave
Back to top
View user's profile Send private message
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Sun Oct 16, 2005 10:18 pm    Post subject: Reply with quote

Since you stated that you are loading the text into a string list and are
having problems with the @match() function, can I suggest loading the text
into a single variable and then using the VDS native @strpos() function to
find the text that you require.

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Sun Oct 16, 2005 10:21 pm    Post subject: Reply with quote

As for you code I see and error with the following::
Code:

IF @string(HoldsWord, %p, "Format ID: 0x2000") > 0
%%audio_format = "AC3"
end

IF @string(HoldsWord, %p, "Format ID: 0x2000") = 0
%%audio_format = "NOT AC3"
end


should be

Code:

IF @greater(@string(HoldsWord, %p, "Format ID: 0x2000"),0 )
  %%audio_format = "AC3"
end

IF @equal(@string(HoldsWord, %p, "Format ID: 0x2000"),0)
  %%audio_format = "NOT AC3"
end

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
mental
Newbie


Joined: 26 Sep 2005
Posts: 10
Location: Somewhere near England

PostPosted: Mon Oct 17, 2005 11:45 pm    Post subject: Reply with quote

Thanks for the replies Smile

I was using a list, I have amended the program to use the @pos function but I`m still getting the same issue.

If I have a file where there is AC3 data (basically if the text "Format ID: 0x2000" is present) the script still only ever says "NOT AC3" which means it isn`t finding that text for some reason I think.

Maybe I`ll leave it a few days and go over it again, there must be something I`ve missed somehow.

Thanks Smile

_________________
Dave
Back to top
View user's profile Send private message
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Tue Oct 18, 2005 12:38 am    Post subject: Reply with quote

Try this:

Code:

  %%text = "This is some text. We're trying to find the string - Format ID: 0x2000 - within this string"
  %%pos = @pos("Format ID: 0x2000",%%text)
  if @not(@zero(%%pos))
    info Search string starts at position %%pos
  end

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Tue Oct 18, 2005 3:15 am    Post subject: Reply with quote

Bill mentioned it, but as you're new to VDS, I wanted to make sure that you know you can't use something like:
Code:

if (something > somethingelse)
..code here..
end

You need to use:
Code:

if @greater(something,somethingelse)
..code here..
end

Make sure you check the VDS help file for the functions:
@EQUAL()
@GREATER()
and @NOT()

_________________
-Sheep
My pockets hurt...
Back to top
View user's profile Send private message Send e-mail
mental
Newbie


Joined: 26 Sep 2005
Posts: 10
Location: Somewhere near England

PostPosted: Sat Oct 22, 2005 11:19 am    Post subject: Reply with quote

Thanks for that, I`ve made the neccessary changes Embarassed

It still did the same thing so I changed the if...end for if...elsif....end elsif and it found the data fine. Still have the same problem regarding other search aspects but now I know it is something simple.

Thankyou (a lot!) for the help, definitely appreciated Very Happy

Edit:
It now correctly assigns the data but the conditional statements wont work.

Example. I want the computer to say...

"if %%framerate = "pal" and %%video_format = "avi" and %%audio_format <> "AC3" then goto begin1"

I`ve tried various ways but it never works even though framerate does hold PAL and video_format does hold "AVI" and audio_format is NOT "AC3"

I`ve tried using the @both command and all sorts of things but no joy, any suggestions?

_________________
Dave
Back to top
View user's profile Send private message
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Sun Oct 23, 2005 4:06 am    Post subject: Reply with quote

Do it the easy way:
Code:

if @equal(%%framerate,"pal")
  if @equal(%%video_format,"avi")
    if @not(@equal(%%audio_format,"AC3"))
      goto begin1
    end
  end
end

_________________
-Sheep
My pockets hurt...
Back to top
View user's profile Send private message Send e-mail
mental
Newbie


Joined: 26 Sep 2005
Posts: 10
Location: Somewhere near England

PostPosted: Sun Oct 23, 2005 10:10 am    Post subject: Reply with quote

Doh!

That worked perfectly doing as you said, thanks for that Very Happy

I thought it had to be a line of commands with AND between them or using the @both command but the way you do it is more effective, and unlike mine actually works Embarassed

Thanks again!

_________________
Dave
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group