Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Newbies

Reply
 
Thread Tools Search this Thread Display Modes
Old 30th March 2017, 03:12   #1  |  Link
Logan9778
Registered User
 
Join Date: Mar 2017
Posts: 118
Can't get TCPServer() and TCPSource() to work. Need help.

Thanks for all the advice in the other thread.

I've been trying to get TCPServer() and TCPSource() to work on two different computers, but have not been successful. I keep getting TCPServer: bind() failed. And of course, TCPSource tells me there is no server.

Here is my code so far.

#Server
LoadPlugin("c:\program files (x86)\avisynth\plugins\nnedi.dll")
loadplugin("F:\Encoding\DCDecNV2050\DGDecodeNV.dll")
SetMTMode(5,4)
DGsource("F:\DVD Workspace\Doctor Who - Season 01\An Unearthly Child\title01.dgi")
SetMTMode(2)
QTGMC(fpsdivisor=1, Preset="placebo", edithreads=4)
Crop(8, 2, -8, -2)
TCPServer(port=53270)

#Source
TCPSource("127.0.0.1", port=53270, compression="GZip")

I'm thinking I don't know what I'm doing. I've searched for more info, but there appears to be very little except for the AVS Wiki.

Could someone please write me a short script ( just a shell even ) that would take one computer being an avisynth frame server and link it to another computer on the same network that is going to take the output from the server ( film frame ) and input it into Simple X264 running on the second computer? So, I would have the first computer being the Avisynth frame server and the second computer being the X264 encoder running Simple X264.

Hopefully, I can learn from the code. It appears I have to have something running the server too, like MPC-HC? I'm not quite understanding that, either.

Thanks!

Last edited by Logan9778; 30th March 2017 at 04:22.
Logan9778 is offline   Reply With Quote
Old 30th March 2017, 07:08   #2  |  Link
Midzuki
Unavailable
 
Midzuki's Avatar
 
Join Date: Mar 2009
Location: offline
Posts: 1,480
"127.0.0.1" is the localhost, or "local loopback".
If you want to access a different computer on your intranet, you'll have to call the IP address that it received from the router.
Run ipconfig /all in a command prompt on the server machine, and look for the line that says something like this:

Code:
IPv4 Address. . . . . . . . . . . : 192.168.***.***(Preferred)
Then use that IP address in the TCPSource() script on the client machine.

Last edited by Midzuki; 30th March 2017 at 07:10. Reason: clarity
Midzuki is offline   Reply With Quote
Old 30th March 2017, 17:47   #3  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Or from any machine to find ip address on your intranet (Domain or WorkGroup) eg
Code:
Ping some-machine
where some-machine is remote machine Computer Name, might result in something like
Code:
Pinging some-machine [192.168.11.21] with 32 bytes of data:

Reply from 192.168.11.21: bytes=32 time<1ms TTL=128
Reply from 192.168.11.21: bytes=32 time<1ms TTL=128
Reply from 192.168.11.21: bytes=32 time<1ms TTL=128
Reply from 192.168.11.21: bytes=32 time<1ms TTL=128

Ping statistics for 192.168.11.21:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms
and IP Address result is as above, 192.168.11.21

EDIT:
Quote:
127.0.0.1" is the localhost, or "local loopback.
Clarification, localhost 127.0.0.1, is the machine you are sitting at. (pinging 127.0.0.1, would ping yourself)
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 30th March 2017 at 17:58.
StainlessS is offline   Reply With Quote
Old 30th March 2017, 18:55   #4  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Perhaps of use [req CallCmd() and RT_Stats()]

Code:
# ComputerName2IpAddress.avsi

Function ComputerName2IpAddress(String ComputerName) { # https://forum.doom9.org/showthread.php?p=1802394#post1802394
    myName="ComputerName2IpAddress: "
    Assert(ComputerName!="",RT_String("%sComputerName cannot be ''",myName))
    FN="~ComputerName2IpAddress_"+RT_LocalTimeString(File=True)+".txt"
    RT_fileDelete(FN)   # paranoia.
    c=BlankClip(Width=16,height=16,length=1)
    HIDE=True DEBUG=True
    CMD=RT_string("cmd /c ping %s >%s",ComputerName,FN)
    c=c.CallCmd(Open=CMD,Hide=HIDE,debug=DEBUG)
    c=0 # Call clip Destructor
    Assert(Exist(FN),RT_string("%sError on Command '%s'",myName,CMD))
    BadUsage=RT_FileFindStr(FN,"Usage")
    Assert(BadUsage<0,RT_string("%sBad ComputerName '%s'",myName,ComputerName))
    LINE=RT_FileFindStr(FN,"[")
    Assert(LINE>=0,RT_string("%sRT_FileFindStr Cannot Find '[' enclosing IP Address",myName))
    S=RT_ReadTxtFromFile(FN,Lines=1,Start=LINE)
    RT_FileDelete(FN)
    i=RT_FindStr(S,"[")
    Assert(i>=1,RT_string("%sRT_FindStr Cannot Find '[' enclosing IP Address",myName))
    S=MidStr(S,i+1)
    i=RT_FindStr(S,"]")
    Assert(i>=1,RT_string("%sRT_FindStr Cannot Find ']' enclosing IP Address",myName))
    S=LeftStr(S,i-1)
    Return S
}
Client
Code:
COMPUTER_NAME="Ivan-XP1"             # Computer Name in WorkGroup / Domain local
#COMPUTER_NAME="www.doom9.org"       # 'www.' needed here for some reason (IIRC, www. is the dns server computer for the domain) [EDIT: www.doom9.org  NO LONGER ON-LINE]
#COMPUTER_NAME="forum.doom9.org"     # but not needed here (forum.doom9.org is a specific server computer)
#COMPUTER_NAME="www.bbc.co.uk"       # bbc dns server
#COMPUTER_NAME="bbc.co.uk"           # One of a cluster of bbc servers

S=ComputerName2IpAddress(COMPUTER_NAME)
Return MessageClip(COMPUTER_NAME + " = " + S)
EDIT: Modified.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 31st March 2020 at 01:16.
StainlessS is offline   Reply With Quote
Old 30th March 2017, 21:10   #5  |  Link
Logan9778
Registered User
 
Join Date: Mar 2017
Posts: 118
Wow, that's some programming there. I'll have to try it out. Thanks for the help. I actually got it working, but I have a new problem now. I found out my problem is that I'm using Avisynth 2.6 MT. The regular Avisynth 2.6 seems to work in AvsPmod, but when I switch over to the Avisynth 2.6 MT .dll in Windows/SysWoW, I get a "TCP Server: bind() failed" error.

Any of you guys know what's happening?
Logan9778 is offline   Reply With Quote
Old 30th March 2017, 21:45   #6  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
OK, just tried it out and
Code:
TCPSource(string hostname [, int port, string compression])
hostname can be a ComputerName OR an IP address, so above function not necessary (but maybe of use for something else).

I did though get an Access Violation when the hostname was not online (looks like v2.6 TCPSource bug).
EDIT: Ivan-XP1 is in a WorkGroup.

Above using TcpDeliver.dll as distributed by Standard Avisynth v2.6 (I think it used to be an internal filter).

Perhaps you could try using TcpDeliver() from v2.6 standard, see if it works (LoadPlugin, overrides built-in filter).

EDIT: Script 1 on Ivan-XP1 [EDIT: Start this one first]
Code:
Colorbars
ShowFrameNumber # Added
TCPServer()
Script 2 on local machine
Code:
TCPSource("Ivan-XP1")
EDIT: I just played in MPC-HC on both machines.
EDIT: Suggest NOT using AvsPMod on server machine, anything else eg MPC-HC.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 31st March 2017 at 15:25.
StainlessS is offline   Reply With Quote
Old 31st March 2017, 00:43   #7  |  Link
Logan9778
Registered User
 
Join Date: Mar 2017
Posts: 118
Thanks Stainless! Yeah, it looks like the problem may be AvsPmod. I will try doing it with MPC-HC, and also your suggestion of TCpDeliver().

Though in the end, I'm finding my other two old computers aren't NEAR as powerful as I thought they were.
Logan9778 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:37.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.