[WINDOWS] HOW-TO use SopCast as external player

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
MaxMustermann Offline
Member
Posts: 94
Joined: Sep 2009
Reputation: 33
Post: #1
There are 3 different approaches for playing Sopcast streams (e.g. sop://broker.sopcast.com:3912/12345).
  • The only seamless integration known by now is using a DSPlayer version of XBMC and setup the SopFilter as Filter. (HowTo). There is also a pre-eden version of XBMC with DSPlayer (http://forum.xbmc.org/showthread.php?tid=106629).
  • Use an external player:
    Windows: As soon as you have installed SopFilter you can use these links in all DirectShow video players such as MPC-HC.
    Linux / Mac: see http://forum.xbmc.org/showpost.php?p=871519&postcount=2 and http://www.myp2p.eu/softwareitem.php?sof...t=software

    External Players can be defined in userdata\playercorefactory.xml.
    Example for MPC-HC (Windows):
    Code:
    <playercorefactory>
    <players>
       <player name="MPC-HC" type="ExternalPlayer" audio="false" video="true">
         <filename>C:\Programme\MPC HomeCinema\mpc-hc.exe</filename>
         <args>"{1}" /fullscreen /close</args>
         <hidexbmc>false</hidexbmc>
         <hideconsole>false</hideconsole>
         <warpcursor>none</warpcursor>
       </player>
    </players>
    <rules action="prepend">
       <rule protocols="sop" player="MPC-HC"/>
    </rules>
    </playercorefactory>
  • Start Sopcast hidden with commandline switches and let it stream back to xbmc (HowTo by membrane).
(This post was last modified: 2012-02-26 21:08 by MaxMustermann.)
find quote
MaxMustermann Offline
Member
Posts: 94
Joined: Sep 2009
Reputation: 33
Post: #2
Linux (thanks to deckoff)

how to use sopcast and vlc for external player

1. Install and configure vlc
2. Install command-line sopcast (download)
3. Add libstdcpp5 if needed.

4. Download the command-line file from official site and copy it to /usr/bin.

5. Create a new text file, and copy the following to it. Be sure to mark the file as executable. Copy the file to /usr/bin. The name should be sopcast (case-sensitive)

Code:
#!/bin/sh
# start streaming sopcast address $1 with sp-sc-auth, then start vlc and monitor both processes.
# author: Chickamade <anh.chick@gmail.com>

if ! Test $# -eq 1
then
    echo 'usage: Sopcast <sop://address>'
    exit 0
fi

if pgrep -f "sp-sc-auth $1"
then
    echo sopcast: Channel $1 already streaming, quitting >&2
    exit 0
fi

port=${1##*/}

#some modifications done by stoyan deckoff <deckoff@gmail.com>
#this edit ensures port number at which sopcast is streaming is between 10000-100000
#otherwise vlc will fire an error
while [ $port -gt 100000 ]
do
port=$(($port-100000))
done

if [ $port -lt 10000 ]
then
port=$(($port+10000))
fi


#echo $port
#end of stoyan deckoff modifications

echo sopcast: Starting stream $1 on port $port >&2
sp-sc-auth "$1" 3908 $port >/dev/null &
sp_sc=`pgrep -f "sp-sc-auth $1 3908 $port"`
if test -z $sp_sc
then
    echo sopcast: Stream $1 failed to start >&2
    exit 1
fi

sleep 20

vlc http://localhost:$port/tv.asf >/dev/null 2>&1 &
vlc=`pgrep -f "vlc http://localhost:$port/tv.asf"`
if test -z $vlc
then
    echo sopcast: Vlc failed to start >&2
    kill -9 $sp_sc
    exit 1
fi

while true
do
    if ! Ps $sp_sc > /dev/null
    then
        echo sopcast: Stream $1 died, killing vlc >&2
        kill $vlc
        exit 1
    fi
    if ! Ps $vlc > /dev/null
    then
        echo sopcast: Vlc not running, killing stream $1 >&2
        kill -9 $sp_sc
        exit 0
    fi
    sleep 10
done
exit 0
(this sh file is slightly modified version of sopcast.sh, found here)

6. in your ~/xbmc/userdata one should modify the playercorefactory.xml, or create a new one, with this contend added

Code:
<playercorefactory>
<players>
   <player name="sopcast" type="externalplayer" audio="false" video="true">
     <filename>/usr/bin/sopcast</filename>
    <args>"{1}"</args>
     <hidexbmc>false</hidexbmc>
     <hideconsole>true</hideconsole>
   </player>
</players>
<rules action="prepend">
   <rule protocols="sop" player="sopcast"/>
</rules>
</playercorefactory>

7. restart xbmc.

Successfully tested on xubuntu 11.04 and xbmc 10.1 stable

Notes:
Please wait for the stream to start. If the stream fails, vlc window will show for a fraction of a second. Wait for this to happen before trying with a new stream.
The stream will be re-directed to vlc, so the controls of vlc should be used.
The sopcast script was edited, so more than one stream is possible at the same time. Best thing about it is that if sopcast stream hangs and is not auto killed, this will not stop new streams for opening in vlc.
(This post was last modified: 2012-02-26 21:36 by MaxMustermann.)
find quote
pritect Offline
Junior Member
Posts: 19
Joined: Apr 2012
Reputation: 0
Post: #3
Hi

I have followed your guide, but how do i do to start a sopcast stream from xbmc? should i add the stream as a videofile? or how do i do?
find quote
Myrddraal Offline
Senior Member
Posts: 101
Joined: Apr 2012
Reputation: 1
Post: #4
(2012-04-08 16:48)pritect Wrote:  Hi

I have followed your guide, but how do i do to start a sopcast stream from xbmc? should i add the stream as a videofile? or how do i do?

You need to install the SportsDevil addon for instance.

http://forum.xbmc.org/showthread.php?tid=100031
find quote
iuliant Offline
Junior Member
Posts: 1
Joined: Sep 2011
Reputation: 0
Post: #5
Hi

Could you please post a guide for how to add sopcast as external player for a MAC?(The link for MAC in first post is dead.)

Thank you,
Julian
find quote
cfcsteve Offline
Junior Member
Posts: 2
Joined: Dec 2012
Reputation: 1
Post: #6
Could somebody please please help me?

I am trying to set up XBMC with DSPlayer and SportsDevil to watch SopCast streams 'seamlessly', mostly via the Wiziwig.tv catcher. I have tried this on 2 laptops, one a Windows 7 x86 machine and one WindowsXP.

My steps on both machines were as follows:

1. Install latest version of SopFilter (v3.0.3)
2. Use GraphStudioNext v0.5.0.1 to get GUID of SopFilter (registered as "SopCast ASF Splitter" / p2pfilter.dll).
3. Install XBMC DSPlayer. I have tried two different builds, both Eden, and both found in this thread:
http://forum.xbmc.org/showthread.php?tid=106629. I tried the build listed in the first post and also one called XBMCSetup-20120601-143a845-dx.exe. In both builds DSPlayer is the default player.
4. Install SportsDevil from MaxMustermann repo (found through fusion).
5. Create userdata\dsplayer\filterconfig.xml to register the SopFilter using its GUID:

<filtersconfig>
<filters>
<filter name="sopfilter" type="splitter">
<guid>{A895A82C-7335-4D6B-A811-82E9E3C4403E}</guid>
<osdname>SopFilter</osdname>
</filter>
</filters>
</filtersconfig>

6. Create userdata\dsplayer\mediasconfig.xml to point DSPlayer to the SopFilter when encountering a sop:// url:

<mediasconfig>
<rules>
<rule protocols="sop" filetypes=".*">
<source filter="sopfilter" />
<splitter filter="sopfilter" />
<video filter="mpcvideodec" />
<audio filter="lavaudiodec" /> </rule>
</rules>
</mediasconfig>

I get a couple different errors but mostly related to the SopFilter not loading as a source or generating an exception. When I use WMP to load the sop:// links, it works fine. Here are debug logs:

For the Win7 machine: http://pastebin.com/Nnnas9Sh
154.18:32:02 T:2124 NOTICE: Loading filter core factory settings from special://profile/dsplayer/filtersconfig.xml (filters configuration).
155.18:32:02 T:2124 NOTICE: Loading filter core factory settings from special://xbmc/system/players/dsplayer/filtersconfig.xml (filters configuration).
156.18:32:02 T:2124 NOTICE: Loading filter core factory settings from special://profile/dsplayer/mediasconfig.xml (medias configuration).
157.18:32:02 T:2124 NOTICE: Loading filter core factory settings from special://xbmc/system/players/dsplayer/mediasconfig.xml (medias configuration).
158.18:32:02 T:2124 NOTICE: Successfully loaded rules
159.18:32:02 T:2124 NOTICE: CFGLoader::InsertAudioRenderer Successfully added "Default DirectSound Device" to the graph
160.18:32:02 T:2124 NOTICE: CFGLoader::InsertFilter Successfully added "SopFilter" to the graph
161.18:32:02 T:2124 ERROR: CFGLoader::InsertSourceFilter An exception has been thrown by the codec...
162.18:32:02 T:2124 ERROR: CFGLoader::LoadFilterRules Failed to insert the source filter
163.18:32:02 T:2124 ERROR: CFGManager::RenderFileXbmc Failed to load filters rules


For the WinXP machine: http://pastebin.com/HLtHsema
859.16:38:14 T:1288 DEBUG: CFilterSelectionRule::GetFilters: adding filter: sopfilter for rule: un-named
860.16:38:14 T:1288 DEBUG: CFGFilterFile::Create Successfully loaded external filter (clsid:{A895A82C-7335-4D6B-A811-82E9E3C4403E} path:C:\Program Files\P2PFilter\p2pfilter.dll)
861.16:38:14 T:1288 NOTICE: CFGLoader::InsertFilter Successfully added "SopFilter" to the graph
862.16:38:14 T:1288 ERROR: CFGLoader::InsertSourceFilter Failed to load file in the splitter/source
863.16:38:14 T:1288 ERROR: CFGLoader::LoadFilterRules Failed to insert the source filter
864.16:38:14 T:1288 ERROR: CFGManager::RenderFileXbmc Failed to load filters rules

I strongly suspect that I've done something wrong in either or both of the xml config files, but I'm not experienced with XML so any help would be much appreciated.

Thanks,
Steve
find quote
sobeitjedi Offline
Junior Member
Posts: 18
Joined: Feb 2013
Reputation: 0
Post: #7
Can someone provide instructions (a dummies guide!) on how I do this for XBMC on a raspberry pi?
find quote
deckoff Offline
Member
Posts: 56
Joined: Apr 2011
Reputation: 0
Location: Sofia, BG
Post: #8
(2013-02-13 11:56)sobeitjedi Wrote:  Can someone provide instructions (a dummies guide!) on how I do this for XBMC on a raspberry pi?

I CANT MAKE IT WORK ON EDEN, so be warned. The reason is either the sportsdevil plugin, or my playercorefactory.xml file. If/when I get what I am doing wrong, I will post a fix. I can confirm that sopcasts can be played inside XBMC, without vlc as a middleman.

Here is an old page that can be used for reference
Unfortunately, since eden this no longer works. Part is, only the new json is supported in eden, part I dont know.


Code:
#!/bin/bash
# Script for utilize Sopcast with XBMC

sleep 3


# Close any sp-sc process, if there are someone already started.
if pgrep -f "sp-sc-auth"
then
      pkill -9 sp-sc-auth
fi

echo "$1"

sleep 2

sp-sc-auth "$1" 3908 31112 >/dev/null &


# startSop $1 &
sleep 5

curl --data-binary '{ "jsonrpc": "2.0", "method": "Player.Open", "params": { "item": { "file": "http://localhost:31112/tv.asf" } }, "id": "myScipt"}' -H 'content-type: application/json;' http://192.168.1.113:8080/jsonrpc


This simple script will manually play sopcasts inside XBMC, if feeded a working sop, but I cant make XBMC feed sops to it.

YOu should provide your OS, pi is hardware, not software. I will assume that this is a linux distro , so you have to follow the linux guide provided. Hopefully, your distro is debian based, so when you are asked to install software, search how to do it on debian (sudo apt-get install ... is the most common way). You will be asked for username, most probably work over ssh or tty, most distros explain how to login over ssh or tty, too, seach for this in your Rpi distro page. Given the info, this is all I can help.
(This post was last modified: 2013-08-28 08:18 by deckoff.)
find quote