Closed GoogleCodeExporter closed 9 years ago
It seems that ffmpeg doesn't send an expected value for objectEncoding. As a
work around, I set it to 0.0 as a default.
Line 625 of rtmp.py version 0.7.
if 'objectEncoding' in self.agent:
self.objectEncoding = self.agent['objectEncoding']
else:
self.objectEncoding = 0.0
Now ffmpeg connects OK but I am unable to see the video coming back with the
command...
rtmpdump -r rtmp://localhost/live/livestream -o - -v | ffplay
rtmpdump reports...
[h264 @ 0x1997a50]no frame!
[aac @ 0x1993ef0]channel element 1.0 is not allocated
Last message repeated 1 times
Original comment by sblandf...@gmail.com
on 6 Feb 2011 at 9:54
I've also had no luck with ffmpeg playing out an rtmp stream to rtmplite.
I did get the included rtmpclient.py to dump a local video to the server using:
{{{
python rtmpclient.py test.flv "rtmp://127.0.0.1/live?id=testStream"
}}}
I could then watch the video using the included testClient.swf from my browser.
However, I've not had any luck with ffmpeg playing from or streaming video to
the server... I've just updated to the latest ffmpeg version as described
below, which at least could 'connect' to the server and get it to print out
debugging messages for receiving data on the correct port...
Streaming to server from ffmpeg command:
{{{
ffmpeg -i test.flv -re -f flv rtmp://127.0.0.1/live?id=testStream
}}}
This hangs in the "Handshake" portion, perhaps
Playing video from the server command:
{{{
ffplay "rtmp://127.0.0.1/live?id=testStream live=1"
}}}
This gives me the error "Cannot read RTMP handshake response"
I've also tried the same experiment using a different piece of python rtmp
server software called "rtmpy" with even less success. Though it complains
about FCPublish? From ffmpeg code it says: "'FCPublish' call and send it to
the server. It should make the server preapare for receiving media streams."
I don't know too much about the rtmp protocol, but my gut feeling is that
ffmpeg needs some sort of ack from the server before it actually starts to
stream the data... I can tell that it never starts, because the server debug
spews data when it is working with the included demo programs, but it never
spews debug data from ffmpeg.
I'm not sure how to complete the 'handshake' to make ffmpeg happy, but perhaps
I'll look into it... Or just look into red5 or wowza...
-John
------------
FFmpeg version git-b466827, Copyright (c) 2000-2011 the FFmpeg developers
built on Feb 10 2011 11:25:21 with gcc 4.4.1
configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvorbis --enable-libx264 --enable-libxvid --enable-x11grab --enable-libmp3lame
libavutil 50. 37. 0 / 50. 37. 0
libavcore 0. 16. 1 / 0. 16. 1
libavcodec 52.112. 0 / 52.112. 0
libavformat 52. 98. 0 / 52. 98. 0
libavdevice 52. 2. 3 / 52. 2. 3
libavfilter 1. 75. 0 / 1. 75. 0
libswscale 0. 12. 0 / 0. 12. 0
libpostproc 51. 2. 0 / 51. 2. 0
-----------
Original comment by leimg...@gmail.com
on 10 Feb 2011 at 5:48
[deleted comment]
Hi,
I did a quick experiment to find that ffmpeg didn't accept the AMF0 encoded
packet for onStatus with code=NetStream.Publish.Start. Note that rtmplite only
supports AMF0.
I will keep this issue open, so that can keep track of progress on
transitioning to AMF3.
(Two changes I had to do for getting connect working with ffmpeg will be
checked in soon: send both handshake packets instead of waiting for reply from
client, and ignore missing "objectEncoding" in connect.)
Original comment by voiprese...@gmail.com
on 11 Feb 2011 at 1:50
Original comment by voiprese...@gmail.com
on 11 Feb 2011 at 1:53
As it turns out, the problem was not related to AMF3 but the following:
1. Handshake needs to send all the data from server before waiting for next
ping from ffmpeg.
2. Server should use Object instead dict (EcmaArray) for various notifications
such as NetStream.Publish.Start.
3. Treat a missing objectEncoding as value of 0.0 (for AMF0).
Original comment by voiprese...@gmail.com
on 14 Feb 2011 at 6:21
Fixed in rtmplite svn r45 and download version 7.1.
To test it try the following:
1. Run rtmplite on localhost.
$ python rtmp.py
2. Go to rtmplite's test client page at
http://myprojectguide.org/p/rtmplite/test/
Click on connect. Change NetStream from user1 to test. Click on play. Now web
client is playing stream "test".
3. Start ffmpeg to stream existing video file to localhost myapp with stream
name "test".
./ffmpeg -v 6 -loglevel debug -i
http://myprojectguide.org/p/flash-videoio/sample1.flv -f flv
rtmp://127.0.0.1/myapp/test
4. This should start publishing sample1.flv from ffmpeg to rtmplite, which
plays it to the web client.
Original comment by voiprese...@gmail.com
on 14 Feb 2011 at 6:27
Original issue reported on code.google.com by
sblandf...@gmail.com
on 4 Feb 2011 at 6:39