gmyth-stream/tests/client_ffmpeg.py
author renatofilho
Wed Mar 28 21:26:42 2007 +0100 (2007-03-28)
branchtrunk
changeset 468 f4c6061f6f39
child 470 57833200a415
permissions -rw-r--r--
[svn r473] memory leek fix
morphbr@466
     1
import os
morphbr@466
     2
import time
morphbr@466
     3
import socket
morphbr@466
     4
morphbr@466
     5
HOST='localhost'
morphbr@466
     6
PORT=5000
morphbr@466
     7
morphbr@466
     8
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
morphbr@466
     9
s.settimeout(10)
morphbr@466
    10
morphbr@466
    11
arq = open('/tmp/dvb.mpg','r')
morphbr@466
    12
morphbr@466
    13
mplayer = os.popen("which mplayer").read().strip()
morphbr@466
    14
mplayer += " -noidx -"
morphbr@466
    15
pin, pout = os.popen2(mplayer)
morphbr@466
    16
morphbr@466
    17
s.connect((HOST,PORT))
morphbr@466
    18
i = 0
morphbr@466
    19
morphbr@466
    20
data = s.recv(1024)
morphbr@466
    21
while (data != ""):
morphbr@466
    22
    pin.write(data)
morphbr@466
    23
    data = s.recv(1024)
morphbr@466
    24