madebyhiro / codem-transcode

Offline video transcoder written in node.js
Other
153 stars 68 forks source link

Transcode via LAN #26

Closed vishnuprasad9633 closed 10 years ago

vishnuprasad9633 commented 10 years ago

Hi,

I have successfully compiled codem-transcode and it works fine in my PC. I have changed the local host to my local IP in the cofig.json file. And started the server. It works fine and i could successfully assign job to the server from my PC. When i try to assign a job to my server from another PC of my LAN i couldn't acces the server.

it shows the error : curl: (7) coudn't connect to host

Im providing my config file data below,

{ "port": 8081, "access_log": "/var/log/access_log", "database": "/var/db/jobs.db", "slots": 8, "interface": "10.10.12.102", "encoder": "/usr/local/bin/ffmpeg", "scratch_dir": "/tmp", "use_scratch_dir": true, "ffprobe": null }

It would be appreciated if anyone could help me on this.

hatsch commented 10 years ago

you can try to change the interface to "interface": "0.0.0.0",

vishnuprasad9633 commented 10 years ago

Hi hatsch,

Thanks for the reply.

if i change it to 0.0.0.0 what would be the host url that i have to use while assigning job from other PC's of my LAN??

hatsch commented 10 years ago

the host url would be still 10.10.12.102:8081,

can you ping the one host from the other?

the 0.0.0.0 just means that it listens on all interfaces

vishnuprasad9633 commented 10 years ago

I have changed the interface to 0.0.0.0 and the server reply is [root@Cinesoft Cinesoft]# codem-transcode -c /home/Cinesoft/config.json 15 May 13:23:21 - Started server on interface 0.0.0.0 port 8081 with pid 5156.

i can acces the server in my PC. by the IP 10.10.12.102

it gives the output

{"max_slots":8,"free_slots":8,"jobs":[]}

But i couldnt access it from another PC.

I can ping the IP 10.10.12.102 fro other LAN PC also.

vishnuprasad9633 commented 10 years ago

please help me on this

hatsch commented 10 years ago

do you have any firewall running that is blocking port 8081

vishnuprasad9633 commented 10 years ago

I have tried it with 8080,1935,8088 etc . it doesn't work. These ports are available in LAN while we using them for other servers. Im using Cent OS 6.5

Is there any problem with cent OS?

hatsch commented 10 years ago

can you post the output of iptables -L ( as root or with sudo )

vishnuprasad9633 commented 10 years ago

here it is,

[root@Cinesoft ~]# iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED ACCEPT icmp -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:http REJECT all -- anywhere anywhere reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT) target prot opt source destination
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT) target prot opt source destination

hatsch commented 10 years ago

allow incoming connections on port 8081 iptables -A INPUT -p tcp --dport 8081 -j ACCEPT

or disable the firewall completly service iptables stop

vishnuprasad9633 commented 10 years ago

It works fine brother. Thanks alot for your support

hatsch commented 10 years ago

no prob. so you can close the issue

vishnuprasad9633 commented 10 years ago

Hi hatsch,

Is that possible to encode a file from our NAS storage using codem-transcode?

hatsch commented 10 years ago

you need to mount the directory in the same path on all involved machines (scheduler, transcoder,..) nfs will be your friend

vishnuprasad9633 commented 10 years ago

Can you give me an example job URL?

hatsch commented 10 years ago

not really as i am using only the scheduler and not the transcoder directly but it's explained on the github page https://github.com/madebyhiro/codem-transcode

{ "source_file": "/PATH/TO/INPUT/FILE.wmv", "destination_file":"/PATH/TO/OUTPUT/FILE.mp4", "encoder_options": "-acodec libfaac -ab 96k -ar 44100 -vcodec libx264 -vb 416k -s 320x180 -y -threads 0", "thumbnail_options": { "percentages": [0.25, 0.5, 0.75], "size": "160x90", "format": "png" }, "callback_urls": ["http://example.com/notifications"] }

from now on you are on your own :)

vishnuprasad9633 commented 10 years ago

Okay. Thanks

tieleman commented 10 years ago

Thanks for sorting this out, I was on holiday so couldn't answer. If you want to share files between transcoders you indeed have to have a central network location where you can put them, using SMB, or NFS, or SAN, or any file sharing protocol.