jazzman1 Posted December 24, 2012 Share Posted December 24, 2012 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 Quote Link to comment https://forums.phpfreaks.com/topic/272336-capture-and-retream-a-file/ Share on other sites More sharing options...
Christian F. Posted December 24, 2012 Share Posted December 24, 2012 (edited) 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 December 24, 2012 by Christian F. Quote Link to comment https://forums.phpfreaks.com/topic/272336-capture-and-retream-a-file/#findComment-1401164 Share on other sites More sharing options...
jazzman1 Posted December 28, 2012 Author Share Posted December 28, 2012 (edited) 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 December 28, 2012 by jazzman1 Quote Link to comment https://forums.phpfreaks.com/topic/272336-capture-and-retream-a-file/#findComment-1401685 Share on other sites More sharing options...
Christian F. Posted December 28, 2012 Share Posted December 28, 2012 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. Quote Link to comment https://forums.phpfreaks.com/topic/272336-capture-and-retream-a-file/#findComment-1401828 Share on other sites More sharing options...
jazzman1 Posted January 5, 2013 Author Share Posted January 5, 2013 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.org/doc/streaming-howto/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 Quote Link to comment https://forums.phpfreaks.com/topic/272336-capture-and-retream-a-file/#findComment-1403465 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.