PDA

View Full Version : Help with RTMP source?


djx18
2009-06-02, 10:49
i found the rtmp source for this video feed http://www.cnnturk.com/servisler/canli.yayin/ using replay media catcher

The source i got from wireshark is : rtmp://91.191.160.11:1935/livetv/_definst_/CNNTurk

The swf source is : http://www.cnnturk.com/App_Themes/swf/player_cnnturk.swf

EDIT **
I have no clue what the playpath is??
**
I am trying to write a script that will play this stream from CNN TURK

i saved the text below as cnn.py it starts then just quits on the xbox.. no luck.. I dont know what the playpath is??
-------------------------------------------

import xbmc, xbmcgui

playpath = "I dont know what to put here"
rtmp_url = "rtmp://91.191.160.11:1935/livetv/_definst_/CNNTurk"
item = xbmcgui.ListItem("CNN TURK")
item.setProperty("PlayPath", playpath)
xbmc.Player(xbmc.PLAYER_CORE_DVDPLAYER).play(rtmp_ url, item)

----------------------------------------------------
Thanks for the help!!

frosty
2009-06-02, 22:25
Using wireshark to sniff the connection, I got traffic from 83.170.80.33:80 (server and port are likely to change depending how they're streaming and if there's servers worldwide) with parameters :
connect app=cnnturk
play=CNNTurk

so I'd try :
rtmp_url="rtmp://83.170.80.33:80/cnnturk"
playpath="CNNTurk"

djx18
2009-06-02, 22:40
I used that rtmp_url given with this script below... it starts then quits.. i also posted the xbox.log with the error... any help? Thanks!!
-------------------------------------------------
import xbmc, xbmcgui

playpath = "CNNTurk"
rtmp_url = "rtmp://83.170.80.33:80/cnnturk"
item = xbmcgui.ListItem("CNNTURK")
item.setProperty("PlayPath", playpath)
xbmc.Player(xbmc.PLAYER_CORE_DVDPLAYER).play(rtmp_ url, item)
-----------------------------------------------------
Error Log
-----------------------------------------------------
14:02:29 M: 17825792 NOTICE: -->Python Initialized<--
14:02:29 M: 17825792 NOTICE:
14:02:29 M: 20234240 NOTICE: DVDPlayer: Opening: rtmp://83.170.80.33:80/cnnturk
14:02:29 M: 20234240 WARNING: CDVDMessageQueue(player)::Put MSGQ_NOT_INITIALIZED
14:02:29 M: 19709952 NOTICE: Creating InputStream
14:02:30 M: 19689472 NOTICE: Creating Demuxer
14:02:30 M: 12582912 ERROR: RTMP_LIB::CRTMP::HandleInvoke, rtmp server sent error
14:02:30 M: 12582912 ERROR: RTMP_LIB::CRTMP::HandleInvoke, rtmp server requested close
14:02:30 M: 12582912 NOTICE: Opening video stream: 0 source: 256
14:02:30 M: 12582912 NOTICE: Creating video codec with codec id: 0
14:02:30 M: 12582912 ERROR: Unsupported video codec
14:02:30 M: 12582912 WARNING: CDVDPlayer::OpenVideoStream - Unsupported stream 0. Stream disabled.
14:02:30 M: 12582912 NOTICE: Opening audio stream: 1 source: 256
14:02:30 M: 12582912 NOTICE: Finding audio codec for: 0
14:02:30 M: 12582912 ERROR: Unsupported audio codec
14:02:30 M: 12582912 WARNING: CDVDPlayer::OpenAudioStream - Unsupported stream 1. Stream disabled.
14:02:30 M: 12582912 NOTICE: CDVDPlayer::OnExit()
14:02:30 M: 14495744 NOTICE: DVDPlayer: eof, waiting for queues to empty
14:02:30 M: 14495744 NOTICE: CDVDPlayer::OnExit() deleting demuxer
14:02:30 M: 14532608 NOTICE: CDVDPlayer::OnExit() deleting input stream
14:02:30 M: 13152256 ERROR: Can't open the database MyVideos34.db as it is a NEWER version than what we were expecting!

frosty
2009-06-03, 00:40
If you enable debug level logging you'll see the details for "rtmp server sent error". The exact error from the server should indicate what's not right eg. "stream not found" (wrong playpath and/or app name) or "not authorized" (server may be checking additional connect params) etc.

djx18
2009-06-03, 00:56
This is what i got with the full debug but i am still lost! I used the program orbit and this what it uses for its URL to record and it records just fine! Also see the orbit log below. And again thanks!!

rtmp://kanald.tbt.com.tr:80/cnnturk|cnnturk|CNNTurk|http://www.cnnturk.com/App_Themes/swf/player_cnnturk.swf|http://www.cnnturk.com/servisler/canli.yayin/


here is the debug log..
----------------------------------------------------------
14:02:29 M: 17825792 NOTICE: -->Python Initialized<--
14:02:29 M: 17825792 NOTICE:
14:02:29 M: 20234240 NOTICE: DVDPlayer: Opening: rtmp://83.170.80.33:80/cnnturk
14:02:29 M: 20234240 WARNING: CDVDMessageQueue(player)::Put MSGQ_NOT_INITIALIZED
14:02:29 M: 19709952 NOTICE: Creating InputStream
14:02:30 M: 19689472 NOTICE: Creating Demuxer
14:02:30 M: 12582912 ERROR: RTMP_LIB::CRTMP::HandleInvoke, rtmp server sent error
14:02:30 M: 12582912 ERROR: RTMP_LIB::CRTMP::HandleInvoke, rtmp server requested close
14:02:30 M: 12582912 NOTICE: Opening video stream: 0 source: 256
14:02:30 M: 12582912 NOTICE: Creating video codec with codec id: 0
14:02:30 M: 12582912 ERROR: Unsupported video codec
14:02:30 M: 12582912 WARNING: CDVDPlayer::OpenVideoStream - Unsupported stream 0. Stream disabled.
14:02:30 M: 12582912 NOTICE: Opening audio stream: 1 source: 256
14:02:30 M: 12582912 NOTICE: Finding audio codec for: 0
14:02:30 M: 12582912 ERROR: Unsupported audio codec
14:02:30 M: 12582912 WARNING: CDVDPlayer::OpenAudioStream - Unsupported stream 1. Stream disabled.
14:02:30 M: 12582912 NOTICE: CDVDPlayer::OnExit()
14:02:30 M: 14495744 NOTICE: DVDPlayer: eof, waiting for queues to empty
14:02:30 M: 14495744 NOTICE: CDVDPlayer::OnExit() deleting demuxer
14:02:30 M: 14532608 NOTICE: CDVDPlayer::OnExit() deleting input stream
14:02:30 M: 13152256 ERROR: Can't open the database MyVideos34.db as it is a NEWER version than what we were expecting!
---------------------------------------------------

here is ORBITS log that lets me record on the computer

-----------------------------------------------------
009-06-02 17:32:26 Connecting kanald.tbt.com.tr:80
2009-06-02 17:32:26 Connected
2009-06-02 17:32:26 _result:
2009-06-02 17:32:26 objectEncoding=0.000000
2009-06-02 17:32:26 clientid=1007828016.000000
2009-06-02 17:32:26 description=Connection succeeded.
2009-06-02 17:32:26 code=NetConnection.Connect.Success
2009-06-02 17:32:26 level=status
2009-06-02 17:32:26 capabilities=31.000000
2009-06-02 17:32:26 fmsVer=FMS/3,0,1,123
2009-06-02 17:32:26 onBWDone:
2009-06-02 17:32:26 _result:
2009-06-02 17:32:32 onStatus:
2009-06-02 17:32:32 clientid=1007828016.000000
2009-06-02 17:32:32 description=Playing and resetting rtmp://91.191.160.11:1935/livetv/_definst_/CNNTurk.
2009-06-02 17:32:32 code=NetStream.Play.Reset
2009-06-02 17:32:32 level=status
2009-06-02 17:32:32 onStatus:
2009-06-02 17:32:32 timecodeOffset=114520744L
2009-06-02 17:32:32 isFastPlay=0
2009-06-02 17:32:32 clientid=1007828016.000000
2009-06-02 17:32:32 description=Started playing rtmp://91.191.160.11:1935/livetv/_definst_/CNNTurk.
2009-06-02 17:32:32 code=NetStream.Play.Start
2009-06-02 17:32:32 level=status
2009-06-02 17:32:32 Can't resume!
2009-06-02 17:32:32 Start receiving data
2009-06-02 17:32:34 onMetaData:
2009-06-02 17:32:34 audiodatarate=16.000000
2009-06-02 17:32:34 audiocodecid=mp4a
2009-06-02 17:32:34 audioinputvolume=44.000000
2009-06-02 17:32:34 audiochannels=1.000000
2009-06-02 17:32:34 audiosamplerate=44100.000000
2009-06-02 17:32:34 audiodevice=CNNTurk BDA Analog Audio Captur
2009-06-02 17:32:34 videokeyframe_frequency=2.000000
2009-06-02 17:32:34 avcprofile=77.000000
2009-06-02 17:32:34 avclevel=31.000000
2009-06-02 17:32:34 videodatarate=110.000000
2009-06-02 17:32:34 videocodecid=avc1
2009-06-02 17:32:34 height=240.000000
2009-06-02 17:32:34 width=320.000000
2009-06-02 17:32:34 framerate=25.000000
2009-06-02 17:32:34 videodevice=CNNTurk BDA Analog Capture
2009-06-02 17:32:34 creationdate=Mon Jun 01 12:29:03 2009
2009-06-02 17:32:34 presetname=Custom
2009-06-02 17:32:34 title=
2009-06-02 17:32:34 rating=
2009-06-02 17:32:34 keywords=
2009-06-02 17:32:34 description=
2009-06-02 17:32:34 copyright=
2009-06-02 17:32:34 author=
2009-06-02 17:34:05 Stop downloading by user

frosty
2009-06-05, 01:02
here is the debug log
That's not a debug log, which would have more detail (ie. lines starting DEBUG). With the params I gave above, you get this:

22:48:28 T:5084 M:1073741823 DEBUG: START AMF Object Dump:
22:48:28 T:5084 M:1073741823 DEBUG: Property: <no-name. STRING: _error>
22:48:28 T:5084 M:1073741823 DEBUG: Property: <no-name. NUMBER: 1.00>
22:48:28 T:5084 M:1073741823 DEBUG: Property: NULL
22:48:28 T:5084 M:1073741823 DEBUG: Property: OBJECT ====>
22:48:28 T:5084 M:1073741823 DEBUG: START AMF Object Dump:
22:48:28 T:5084 M:1073741823 DEBUG: Property: <Name: level, STRING: error>
22:48:28 T:5084 M:1073741823 DEBUG: Property: <Name: code, STRING: NetConnection.Connect.Rejected>
22:48:28 T:5084 M:1073741823 DEBUG: Property: <Name: description, STRING: Connection failed: Application rejected connection.>
22:48:28 T:5084 M:1073741823 DEBUG: Property: <Name: clientid, NUMBER: 1827871452.00>
22:48:28 T:5084 M:1073741823 DEBUG: END AMF Object Dump:
22:48:28 T:5084 M:1073741823 DEBUG: END AMF Object Dump:


The server is explicitly rejecting the connection. Why? Well perhaps it's checking additional params that're sent in the connection. Trying the most obvious values from the connect packet sent by the flash player, we find it's checking the 'swfUrl' (URL of the swf file). It apparently needs to contain 'cnnturk.com'. We can set this parameter in our request like so:


import xbmc, xbmcgui

playpath = "CNNTurk"
rtmp_url = "rtmp://83.170.80.33:80/cnnturk"
swf_url = "http://cnnturk.com/App_Themes/swf/player_cnnturk.swf"
item = xbmcgui.ListItem("CNN TURK")
item.setProperty("PlayPath", playpath)
item.setProperty("SWFPlayer", swf_url)
xbmc.Player(xbmc.PLAYER_CORE_DVDPLAYER).play(rtmp_ url, item)

This plays fine for me on a Windows build of r20914. You may want to find out how the site selects a server - using a fixed IP address you're probably not going to get a nearby server.

djx18
2009-06-05, 06:11
wow!!! you are the man! thank you so much!!