Jump to content


Photo

Capture And Retream A File


  • Please log in to reply
4 replies to this topic

#1 jazzman1

jazzman1

    Advanced Member

  • Gurus
  • 2,660 posts
  • LocationMississauga, Canada

Posted 24 December 2012 - 11:25 AM

Hi friends,
I know that the question is a quite specific, but maybe someone knows the answer of it.
I want to capture a stream file from one mms remote server and restream it without dumping it onto my server.
What tools I need to achieve that issue. Any ideas, links, etc.... could be help me.

OS's: Centos 6.3 / Red Hat 5 / Centos 5.3

Thanks in advance

#2 Christian F.

Christian F.

    Advanced Member

  • Staff Alumni
  • 3,106 posts
  • LocationNorway

Posted 24 December 2012 - 02:09 PM

Just use plain PHP to capture the binary data from the server, and dump it straight to the client without modification. Though, it's a very inefficient solution, and you should really cache the videos locally.

Edited by Christian F., 24 December 2012 - 02:10 PM.

Keeping it simple.

#3 jazzman1

jazzman1

    Advanced Member

  • Gurus
  • 2,660 posts
  • LocationMississauga, Canada

Posted 27 December 2012 - 10:22 PM

Hey Christian and thanks for reply :)

I've got it sorted out, here is my simple script:

Server' side:


#!/bin/bash

NAME='userName'
PASS='userPass'
HIDDEN=`date '+%s'`
TIME=`date '+%Y%m%d'`

curl --cookie-jar cjar --output /dev/null 'http://www.djtacho.com/member/plugins/protect/new_rewrite/login.php?v=-any&url=/members/'

curl --cookie cjar --cookie-jar cjar --data 'amember_login='${NAME} --data 'amember_pass='${PASS} --data 'login_attempt_id='${HIDDEN} --location \
'http://www.djtacho.com/member/plugins/protect/new_rewrite/login.php?v=-any&url=/members/'

curl --cookie cjar --output ~/televizia.html 'http://www.djtacho.com/members/televizia.php'

grep -o 'mms://video.djtacho.com/onlineBTV\-hq?token=[a-zA-Z0-9]*' televizia.html > tvFile.txt

while read line; do

cvlc -vvv $line --loop --sout '#transcode{vcodec=h264,vb=0,scale=0,acodec=mp4a,ab=128,channels=2,samplerate=44100}:rtp{mux=ts,dst=192.168.1.106,port=8081,sdp=sap://,name="TestStream"}'

done < tvFile.txt


Client' side code:


[jazzman@localhost ~]$ vlc rtp://@:8081


That script works perfectly, but...... there is only one problem!

H.264(codec standard) has a very good size/quality ratio but transcoding is much more cpu consuming.

What I want to do is, to create a multicast group in the same machine (server), which clients could be have specific permitions to this broadcasting without using transcoding at all.

Do you have any idea how to achieve that?

I will continue to search solutions and if I found it I'm going to post my solutions here.

PS: If someone wants to test the script, it could be run it into a linux terminal (it's a record from Wednesday)
Assuming that the ip address to a client machine in the local network is 192.168.1.106

Server:


cvlc -vvv 'mms://67.159.54.219/vod/onlineBTV/[BTV] 2012.12.27 -Thursday- (18-00).wmv?token=cc7c9858d94d3d5b119d6ffbd797e9ce' --sout '#transcode{vcodec=h264,vb=0,scale=0,acodec=mp4a,ab=128,channels=2,samplerate=44100}:rtp{mux=ts,dst=192.168.1.106,port=8081,sdp=sap://,name="TestStream"}'


Other machine:


vlc rtp://@:8081


Edited by jazzman1, 27 December 2012 - 10:30 PM.


#4 Christian F.

Christian F.

    Advanced Member

  • Staff Alumni
  • 3,106 posts
  • LocationNorway

Posted 28 December 2012 - 10:46 AM

What I want to do is, to create a multicast group in the same machine (server), which clients could be have specific permitions to this broadcasting without using transcoding at all.

Do you have any idea how to achieve that?

Not right off the bat, no. However, there are two problems to be solved in there:
  • How to set up a multicast server, serving from a third party stream.
  • How to set up access lists/control on said streaming server.

The first one should be pretty easy to get down, but will require some research into the software you want to use. It's the second that's going to be the challenge, especially if the software in question does not support access lists in the first place.
Keeping it simple.

#5 jazzman1

jazzman1

    Advanced Member

  • Gurus
  • 2,660 posts
  • LocationMississauga, Canada

Posted 05 January 2013 - 02:45 PM

Hey Christian!

I've made streaming into my local server in 4 different ways.

To obtain more information about it click here - http://www.videolan....to/en/ch04.html

If someone wants to test my streaming, I've started a song from Michael Jackson (mp3). It worked just fine with a video file too.

For windows users just copy/paste this part of code into IE browser - mms://216.58.61.35:8080

For UNIX one, they could be install a VLC and in Network Media Streaming's tab to paste that: mmsh://216.58.61.35:8080




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com