error when feed into rtmp

1,208 views
Skip to first unread message
Message has been deleted

karthick durai

unread,
Mar 4, 2011, 3:15:41 PM3/4/11
to C++ RTMP Server
hi,
i got error when feed flv file into rtmp server.anybody help this
error

ffmpeg -i sample.flv rtmp://ipaddress/flvplayback/

Cannot read RTMP handshake response
rtmp://ipaddress/flvplayback/: Operation not permitted

advance thanks

Manolo Raña

unread,
Mar 4, 2011, 3:21:20 PM3/4/11
to C++ RTMP Server
Hi,

Try setting validateHandshake to false in crtmpserver.lua config file

karthick durai

unread,
Mar 4, 2011, 4:03:54 PM3/4/11
to C++ RTMP Server

hi,
i change validateHandshake to false in crtmpserver.lua still i got
same error
my config file is
-- Start of the configuration. This is the only node in the config
file.
-- The rest of them are sub-nodes
configuration=
{
-- if true, the server will run as a daemon.
-- NOTE: all console appenders will be ignored if this is a daemon
daemon=false,
-- the OS's path separator. Used in composing paths
pathSeparator="/",
-- this is the async DNS resolver. This is a "clinet" connection
-- to the server.
dnsResolver=
{
-- the DNS resolver will connect to ip:port.
-- Whe a request of resolving a domain is made, instead of
-- using gethostbyname, we will pass that request to ip:port
-- This way, the request is async. Of course, it can be looped back
ip="ip address",
--port=9311,
port=1935,
acceptors =
{
{
ip="0.0.0.0",
--port=9311,
port=1935,
protocol="inboundDns"
},
}
},

-- this is the place where all the logging facilities are setted up
-- you can add/remove any number of locations
logAppenders=
{
{
-- name of the appender. Not too important, but is mandatory
name="console appender",
-- type of the appender. We can have the following values:
-- console, coloredConsole and file
-- NOTE: console appenders will be ignored if we run the server
-- as a daemon
type="coloredConsole",
-- the level of logging. 6 is the FINEST message, 0 is FATAL
message.
-- The appender will "catch" all the messages below or equal to
this level
-- bigger the level, more messages are recorded
level=6
},
{
name="file appender",
type="file",
level=6,
-- the file where the log messages are going to land
fileName="/tmp/crtmpserver.log"
}
},

-- this node holds all the RTMP applications
applications=
{
-- this is the root directory of all applications
-- usually this is relative to the binary execuable
rootDirectory="/usr/local/lib/crtmpserver/applications",


--this is where the applications array starts
{
-- The name of the application. It is mandatory and must be unique
name="appselector",
-- Short description of the application. Optional
description="Application for selecting the rest of the
applications",

-- The type of the application. Possible values are:
-- dynamiclinklibrary - the application is a shared library
protocol="dynamiclinklibrary",
-- the complete path to the library. This is optional. If not
provided,
-- the server will try to load the library from here
-- <rootDirectory>/<name>/lib<name>.{so|dll|dylib}
-- library="/some/path/to/some/shared/library.so"

-- Tells the server to validate the clien's handshake before going
further.
-- It is optional, defaulted to true
validateHandshake=false,
-- this is the folder from where the current application gets it's
content.
-- It is optional. If not specified, it will be defaulted to:
-- <rootDirectory>/<name>/mediaFolder
-- mediaFolder="/some/directory/where/media/files/are/stored"
-- the application will also be known by that names. It is optional
--aliases=
--{
-- "simpleLive",
-- "vod",
-- "live",
--},
-- This flag designates the default application. The default
application
-- is responsable of analyzing the "connect" request and
distribute
-- the future connection to the correct application.
default=true,
acceptors =
{
{
ip="0.0.0.0",
port=8092,
protocol="inboundRtmp"
},
{
ip="0.0.0.0",
port=8093,
protocol="inboundRtmps",
sslKey="server.key",
sslCert="server.crt"
},
{
ip="0.0.0.0",
port=8094,
protocol="inboundRtmpt"
},
}
},
{
description="FLV Playback Sample",
name="flvplayback",
protocol="dynamiclinklibrary",
--mediaFolder="/root/crtmpserver/media",
aliases=
{
"simpleLive",
"vod",
"live",
"WeeklyQuest",
"SOSample",
"oflaDemo",
},
acceptors =
{
{
ip="0.0.0.0",
port=8095,
protocol="inboundRtmfp"
},
{
ip="0.0.0.0",
port=8096,
protocol="inboundLiveFlv",
waitForMetadata=true,
},
{
ip="0.0.0.0",
port=8097,
protocol="inboundTcpTs"
},
--[[{
ip="0.0.0.0",
port=554,
protocol="inboundRtsp"
},]]--
},
externalStreams =
{
--[[{
uri="rtsp://0.0.0.0:2323/test.sdp",
localStreamName="stream-1-udp"
},
{
uri="rtsp://stream01.qt.slamtv.true.nl/slamtv.sdp",
localStreamName="stream0-udp"
},
{
uri="rtsp://stream01.qt.slamtv.true.nl/
slamtv.sdp",
localStreamName="stream0-tcp",
forceTcp=true
},
{
uri="rtmp://10.0.1.15/vod/mp4:test_mp4",
localStreamName="stream1"
},
{
uri="rtmp://10.0.1.15/vod/test_flv",
localStreamName="stream2"
},
{
uri="rtsp://media-us-2.soundreach.net/slcn_lifestyle.sdp",
localStreamName="stream3",
forceTcp=true
},
{
uri="rtsp://82.177.67.61/axis-media/media.amp",
localStreamName="stream4",
forceTcp=false
},
{
uri="http://v13.nonxt6.c.youtube.com/videoplayback?
ip=0.0.0.0&sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Calgorithm%2Cburst
%2Cfactor%2Coc%3AU0dXSlFSVl9FSkNNN19JTFpF&algorithm=throttle-
factor&itag=34&ipbits=0&burst=40&sver=3&expire=1285178400&key=yt1&signature=548764ECB414E3CA08BDD414F4B633853F9051AC.D8FFF913C9B3BF1C339BD1A60A77C5D1790775EE&factor=1.25&id=bcdad173a3ba8daa&redirect_counter=1",
localStreamName="stream5",
}
{
uri="rtmp://edge01.fms.dutchview.nl/botr/bunny",
localStreamName="stream6",
emulateUserAgent="MAC 10,1,82,76",
}
{
uri="rtmp://edge01.fms.dutchview.nl/botr/bunny",
localStreamName="stream6",
swfUrl="http://www.example.com/example.swf";
pageUrl="http://www.example.com/";
emulateUserAgent="MAC 10,1,82,76",
}]]--
},
validateHandshake=false,
keyframeSeek=true,
seekGranularity=1.5, --in seconds, between 0.1 and 600
clientSideBuffer=12, --in seconds, between 5 and 30
--generateMetaFiles=true, --this will generate seek/meta files on
application startup
--[[authentication=
{
type="adobe",
encoderAgents=
{
"FMLE/3.0 (compatible; FMSc/1.0)",
"my 3rd party encoder",
"some other encoder",
},
usersFile="users.lua",
}]]--
},
{
name="samplefactory",
description="asdsadasdsa",
protocol="dynamiclinklibrary",
aliases=
{
"httpOutboundTest"
},
acceptors =
{
{
ip="0.0.0.0",
port=8098,
protocol="inboundHTTPDBAccess"
}
}
--validateHandshake=true,
--default=true,
},
{
name="vptests",
description="Variant protocol tests",
protocol="dynamiclinklibrary",
aliases=
{
"vptests_alias1",
"vptests_alias2",
"vptests_alias3",
},
acceptors =
{
{
ip="0.0.0.0",
port=1111,
protocol="inboundHttpXmlVariant"
}
}
--validateHandshake=true,
--default=true,
},
{
name="admin",
description="Application for administering",
protocol="dynamiclinklibrary",
aliases=
{
"admin_alias1",
"admin_alias2",
"admin_alias3",
},
acceptors =
{
{
ip="0.0.0.0",
port=3741,
protocol="inboundJsonCli",
useLengthPadding=true
},
}
--validateHandshake=true,
--default=true,
},
{
name="proxypublish",
description="Application for forwarding streams to another RTMP
server",
protocol="dynamiclinklibrary",
acceptors =
{
{
ip="0.0.0.0",
port=3742,
protocol="inboundLiveFlv"
},
},
abortOnConnectError=true,
targetServers =
{
--[[{
targetUri="rtmp://x.xxxxxxx.fme.ustream.tv/ustreamVideo/xxxxxxx",
targetStreamName="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
localStreamName="gigi",
emulateUserAgent="FMLE/3.0 (compatible; FMSc/1.0 http://www.rtmpd.com)"
}]]--,
{
targetUri="rtmp://localhost/vod",
targetStreamType="record", -- (live, record or append)
emulateUserAgent="My user agent"
},
},
--[[externalStreams =
{
{
uri="rtsp://82.177.67.61/axis-media/media.amp",
localStreamName="stream4",
forceTcp=false
},
{
uri="rtmp://edge01.fms.dutchview.nl/botr/bunny",
localStreamName="stream1"
},
},]]--
--validateHandshake=true,
--default=true,
},
{
name="stresstest",
description="Application for stressing a streaming server",
protocol="dynamiclinklibrary",
targetServer="localhost",
targetApp="vod",
active=false,
--[[streams =
{
"lg00","lg01","lg02","lg03","lg04","lg05","lg06","lg07","lg08",
"lg09","lg10","lg11","lg12","lg13","lg14","lg15","lg16","lg17",
"lg18","lg19","lg20","lg21","lg22","lg23","lg24","lg25","lg26",
"lg27","lg28","lg29","lg30","lg31","lg32","lg33","lg34","lg35",
"lg36","lg37","lg38","lg39","lg40","lg41","lg42","lg43","lg44",
"lg45","lg46","lg47","lg48","lg49"
},]]--
streams =
{
"mp4:lg.mp4"
},
numberOfConnections=10,
randomAccessStreams=false
},
{
name="applestreamingclient",
description="Apple Streaming Client",
protocol="dynamiclinklibrary",
--[[acceptors =
{
{
ip="0.0.0.0",
port=5544,
protocol="inboundRtsp"
}
},]]--
aliases=
{
"asc",
},
--validateHandshake=true,
--default=true,
},
--#INSERTION_MARKER# DO NOT REMOVE THIS. USED BY appscaffold SCRIPT.

Rani

unread,
Mar 4, 2011, 4:37:05 PM3/4/11
to C++ RTMP Server
Hi, check this:

as your default flvplayback inboundLiveFlv port is 8096
/* brief from your config filee
{


ip="0.0.0.0",
port=8096,
protocol="inboundLiveFlv",
waitForMetadata=true,
},

*/

you should use ffmpeg in combination with tcp schema in order to get
your .flv published (validateHandshake does not matter anymore - as i
have been tested) like this:

ffmpeg -i "simpleFile.flv" -re -vcodec copy -acodec copy -b 500K -
metadata streamName="your_publishStream_name" -f flv tcp://<your_rtmp_server>:8096

streamName="your_publishStream_name" - represent how your stream will
known as published, i mean, if:

your_rtmp_server = rtmp.domain.com
streamName="test"
and default application will be flvplayback
then you would access this stream as: rtmp://rtmp.domain.com/flvplayback/test.flv

best regards

>                                         emulateUserAgent="FMLE/3.0 (compatible; FMSc/1.0http://www.rtmpd.com)"

>                 --#INSERTION_MARKER# DO...
>
> citiţi mai multe »

karthick durai

unread,
Mar 5, 2011, 5:52:36 AM3/5/11
to C++ RTMP Server
hi,
thanks for ur replay now no error get when feed into rtmp server but i
can't see in flow player.what is wrong with me can u help me
my flow player coding is
flowplayer("player", {
src : "../flowplayer/
flowplayer-3.1.1.swf",
wmode : "transparent"
}, {
play : {
opacity : 0
},
clip : {
provider : 'rtmp',
//live : true,
url : 'test.flv',
autoPlay : true,
autoBuffering : true,
bufferLength : 3,
//startingBufferLength : 1,
//combine : true,
type : 'flv',


},
plugins : {
rtmp : {
url : '../
flowplayer.rtmp-3.1.0.swf',
netConnectionUrl : 'rtmp://ipaddress/flvplayback/test.flv'
}
}
});
> ...
>
> read more »

Rani

unread,
Mar 5, 2011, 7:18:05 AM3/5/11
to C++ RTMP Server
it is wrong here:
netConnectionUrl : 'rtmp://ipaddress/flvplayback/test.flv'
and should be:
netConnectionUrl : 'rtmp://ipaddress/flvplayback'


or you can use embbed form like this :


<div style="margin-left: 15px; margin-top: 55px;">
<object width="690" height="410" data="PATH_FLW" type="application/
x-shockwave-flash">
<param name="movie" value="PATH_FLW" />
<param name="version" value="[9,115]" />
<param name="allowfullscreen" value="true" />
<param name="allowscriptaccess" value="sameDomain" />
<param name="quality" value="high" />
<param name="flashvars" value='config={"clip":
{"url":"CLIP_NAME","provider":"influxis", "autoPlay":0,
"autoBuffering":1, "accelerated":1},"plugins":{"influxis":
{"url":"PATH_FLW_RTMP","netConnectionUrl":"RTMP_SCH"},"controls":
{"url":"PATH_FLW_CTL","fullscreen":1}}}' />
</object>
</div>
assuming:

PATH_FLW = absolute path of flowplayer, in your example
http://<webserver>/flowplayer-3.1.1.swf
CLIP_NAME = your publish stream name
if test.flv = test
if test.mp4 = mp4:test.mp4
PATH_FLW_RTMP = absolute path of flowplayer rtmp plugin, in your
example http://<webserver>/flowplayer.rtmp-3.1.0.swf
RTMP_SCH = your connection schema, in your example would be
rtmp://ipaddress/flvplayback
PATH_FLW_CTL = absolute path of flowplayer controls plugin - this is
optional i do not know if you need it but it is same principle as
PATH_FLW or PATH_FLW_RTMP

best regards

> ...
>
> citiţi mai multe »

karthick durai

unread,
Mar 6, 2011, 1:20:54 AM3/6/11
to C++ RTMP Server
hi,
still i didn't get output in flow player.i check the crtmplog file
i get error "unable to signal data" and unable to read data.can u help
me please......
thanks


regards,
karthick duraisamy
> ...
>
> read more »

Rani

unread,
Mar 6, 2011, 3:19:14 AM3/6/11
to C++ RTMP Server
post your crtmpserver.log via pastebin.com to see if your steam get
published first
> ...
>
> citiţi mai multe >>
Message has been deleted

karthick durai

unread,
Mar 6, 2011, 2:20:11 PM3/6/11
to C++ RTMP Server
hi,
my crtmp server log file location is http://pastebin.com/0cWScaMa
.can u check it and replay me what is wrong with crtmpserver
advance thanks
Regards,
karthick duraisamy
> > citiþi mai multe >>
>
>

Rani

unread,
Mar 6, 2011, 3:08:28 PM3/6/11
to C++ RTMP Server
my friend......

I.
dnsResolver=
{
-- the DNS resolver will connect to ip:port.
-- Whe a request of resolving a domain is made,
instead of
-- using gethostbyname, we will pass that request to
ip:port
-- This way, the request is async. Of course, it can
be looped back
ip="ip address",
--port=9311,
port=1935,
acceptors =
{
{
ip="0.0.0.0",
--port=9311,
port=1935,
protocol="inboundDns"
},
}
},
DO NOT put 1935 to inboundDns acceptor! leave default port 9311 and
try again.....
that's way you get such an error:
1299417787:6:/root/crtmpserver/sources/thelib/src/protocols/dns/
inbounddnsresolverprotocol.cpp:67:SignalInputData:Not enough data
and also i do not see that you have published a thing!

II. DO NOT modify default rtmp port, 1935....
{
ip="0.0.0.0",
port=8095,
protocol="inboundRtmfp"
},
put 1935 instead 8095. your ISP is blocking default 1935 port that we
have modified it ? because in your config your calling schema is
rtmp://ipadress:8095/flvplayback!

and put validateHandshake=true again since ffmpeg does not affect
this.
On 6 mar., 21:20, karthick durai <durai.karthic...@gmail.com> wrote:
> hi,
>  my crtmp server log file location ishttp://pastebin.com/0cWScaMa
> ...
>
> citiţi mai multe »

Rani

unread,
Mar 6, 2011, 3:48:08 PM3/6/11
to C++ RTMP Server
rtmp://ipaddress:8092/flvplayback... sorry your config and log file
have dazed me

try a fresh install with default config file to see that it is
working.
after that if you need it i could help you to modify those ports in
order to your needs.

> ...
>
> citiţi mai multe »

Rani

unread,
Mar 6, 2011, 7:09:17 PM3/6/11
to C++ RTMP Server
In fact, here is a very simple/basic crtmpserver.lua config file:
http://pastebin.com/raw.php?i=732ejPTk

that uses only flvplayback application for streaming and for
static .flv files /usr/local/media as media folder; you can change
this directory within crtmpserver.lua :
...
mediaFolder="/usr/local/media",
....

also alias app are: vod, live and myapp so that your connect schema
would be: rtmp://ipaddress/{flvplayback,vod,live,myapp} (one o them)

1. now after starting up crtmpserver:

./crtmpserver/crtmpserver --uid=1001 ./crtmpserver/crtmpserver.lua

2. start feeding inboundLiveFlv with ffmpeg on port 6666 (like in
config file)
ffmpeg -i "simpleFile.flv" -re -vcodec copy -acodec copy -b 500K -
metadata streamName="testme" -f flv tcp://ipaddress:6666
in you log should see something like:
....
1299278371:6:/usr/local/rtmpd344/sources/thelib/src/protocols/liveflv/
inboundliveflvprotocol.cpp:235:InitializeStream:Stream name: testme
1299278371:3:/usr/local/rtmpd344/sources/thelib/src/application/
baseclientapplication.cpp:160:SignalStreamRegistered:Stream 1 of type
INLFLV with name `test` registered to application `flvplayback`
1299278371:6:/usr/local/rtmpd344/sources/thelib/src/streaming/
streamsmanager.cpp:91:GetWaitingSubscribers:short name: testme; long
name: testme
1299278371:6:/usr/local/rtmpd344/sources/thelib/src/streaming/
streamsmanager.cpp:99:GetWaitingSubscribers:short count: 0; long
count: 0
....

3. access this file via webpage with flowplayer

<div style="margin-left: 15px; margin-top: 55px;">
<object width="690" height="410" data="PATH_FLW"
type="application/
x-shockwave-flash">
<param name="movie" value="PATH_FLW" />
<param name="version" value="[9,115]" />
<param name="allowfullscreen" value="true" />
<param name="allowscriptaccess" value="sameDomain" />
<param name="quality" value="high" />
<param name="flashvars" value='config={"clip":
{"url":"testme","provider":"influxis", "autoPlay":0,
"autoBuffering":1, "accelerated":1},"plugins":{"influxis":
{"url":"PATH_FLW_RTMP","netConnectionUrl":"RTMP_SCH"},"controls":
{"url":"PATH_FLW_CTL","fullscreen":1}}}' />
</object>
</div>

PATH_FLW = absolute path of flowplayer, in your example
http://<webserver>/flowplayer-3.1.1.swf
PATH_FLW_RTMP = absolute path of flowplayer rtmp plugin, in your
example http://<webserver>/flowplayer.rtmp-3.1.0.swf
RTMP_SCH = your connection schema, in your example would be
rtmp://ipaddress/flvplayback
PATH_FLW_CTL = absolute path of flowplayer controls plugin - this is
optional i do not know if you need it but it is same principle as
PATH_FLW or PATH_FLW_RTMP

(above i have already put strem name into the code: "url":"testme", -
rest of variables we should complete the code with them)

this should be working for sure.

best regards
> ...
>
> citiţi mai multe »
Reply all
Reply to author
Forward
0 new messages