rtmpdump 2.0 for Android

Search This thread

highlandsun

Inactive Recognized Developer
Sep 15, 2009
949
272
Los Angeles
highlandsun.com
Just for grins I've compiled the latest rtmpdump source using the Android 1.5 SDK. I guess it's not much use yet since we still don't have good playback of FLV files, but maybe someone here will find a good use for it.

The source code is from http://rtmpdump.mplayerhq.hu/ This is from the 2.0 C code, not the 1.x C++ code, so it's smaller and faster...
 

Attachments

  • rtmpdump.zip
    77.1 KB · Views: 962
  • Like
Reactions: Dj_Fex

highlandsun

Inactive Recognized Developer
Sep 15, 2009
949
272
Los Angeles
highlandsun.com
I just tried the latest yxflash. I got nothing at all from an H264 video downloaded from Hulu, and I got audio only for a VP6 video. (I tried a Buck Rogers episode since the video is only 384x288. Current shows on Hulu in wide format are 512x288 which wouldn't display on the 480x320 screen anyway.)

So, do the 2.0 ROMs have more video codecs supported? I know that 1.x can playback H.264 baseline profile videos, but Hulu is using H.264 main profile, so it's no surprise that it didn't play on my 1.5 ROM.
 

highlandsun

Inactive Recognized Developer
Sep 15, 2009
949
272
Los Angeles
highlandsun.com
rtmpdump-2.1.zip

This is a fresh build of rtmpdump 2.1. Read the README for details. It contains 4 programs:

rtmpdump - the client
rtmpsrv - a stub server, used mainly for displaying what other clients are doing
rtmpsuck - a transparent proxy, used to intercept a client stream and save it to disk while relaying to the client
streams - an HTTP gateway, serves RTMP streams via HTTP
 

Attachments

  • rtmpdump-2.1.zip
    174.2 KB · Views: 764
Last edited:
  • Like
Reactions: Dj_Fex

highlandsun

Inactive Recognized Developer
Sep 15, 2009
949
272
Los Angeles
highlandsun.com
So it seems there's not much interest here. It would probably help if someone were to port some more codecs into the OpenCore source tree. I've started looking into building ffmpeg on Android, but just compiling the C code probably isn't going to be very useful either. Without GPU acceleration I suspect a lot of these codecs will perform too poorly to be watchable. Is anybody in here working on these codecs?
 

highlandsun

Inactive Recognized Developer
Sep 15, 2009
949
272
Los Angeles
highlandsun.com
Hmm. This Archos 5 media player is now running Android 1.5

http://www.theinquirer.net/inquirer/review/1568085/archos-internet-tablet

it seems to have a full complement of video codecs. I wonder where their code is. Of course, they're running on an 800MHz Cortex A8 so they've got a lot more horsepower to work with. Feels like it's time to retire the G1 and get something else. Maybe a GSM version of the Motorola Droid.
 

highlandsun

Inactive Recognized Developer
Sep 15, 2009
949
272
Los Angeles
highlandsun.com
I've taken a different tack now. Since Android has a built in RTSP client already, I'm using ffmpeg on a remote machine to transcode the FLV to an MP4 that Android can play. This is fed to a DarwinStreamingServer and I just use Meridian to play it.

Now that ffmpeg supports rtmpdump's library, ffmpeg can do all the work in one shot. I've attached the perl script I use to grab a H,u,l,u stream and republish it on the server. ffmpeg grabs the stream using rtmp and re-encodes it and pushes it to DSS. Once the encoding begins you can use Meridian to open the rtsp URL.

T-Mobile's 3G network seems to handle a 400-500kbit/sec stream here in Los Angeles, but it's not consistent. Sometimes it hits a glitch and doesn't recover, sometimes the audio continues but the video stream gets lost and doesn't come back. So probably it's safer to use a smaller bit rate.

Note that H,u,l,u uses 3 different CDNs - Akamai, Level3, and Limeworks. Currently this script doesn't support Limeworks. Basically what it does is grab the lowest bitrate H264 stream from H,u,l,u (usually a 400kbps 512x288 stream) and re-encode it to 480x270. To use it, just run "h,u,l,u,p,u,b <h,u,l,u URL>". You'll need a recent SVN version of ffmpeg built with --enable-librtmp to be able to use it. And of course you'll also need DarwinStreamingServer. I haven't been able to make ffserver work yet.

If you're connected on a decent network with wifi you should have no trouble playing the full 400-500kbit rates. On 3G you might want to stick to 200 or so.

I haven't figured out where to go next with this. Right now I'm thinking about modifying this script so it can be run as a CGI. Then you just use the web browser to navigate the h,u,l,u web site in one window; when you get to a program you want you copy its link and paste it into a form on another window that invokes this script and returns an rtsp link as the result. Then click on the rtsp link and the media player will open it.
 

Attachments

  • hulupub.txt
    12.5 KB · Views: 818
Last edited:

highlandsun

Inactive Recognized Developer
Sep 15, 2009
949
272
Los Angeles
highlandsun.com
Ah hah, after a lot of poking and prodding I managed to fix ffmpeg's ffserver, so now it can be used to stream live media over RTSP to Android phones too.
The required patches are here

https://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2010-May/088706.html

So no more need for Darwin Streaming Server to get this job done.

Note - as far as I can tell, streaming from files is still broken, and I haven't looked into it. All I've tested is to see that ffmpeg can stream an RTMPE session to ffserver, which can then stream it out over RTSP.
 

highlandsun

Inactive Recognized Developer
Sep 15, 2009
949
272
Los Angeles
highlandsun.com
An even better solution, running ffserver on the phone, so that the stream can be transferred using TCP instead of UDP. It may freeze during play due to network issues, but it will resume again instead of just losing packets.

See this message for the necessary config files...

https://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2010-May/089049.html
 

Attachments

  • ffserver.zip
    420.4 KB · Views: 278

mrono

Senior Member
Jun 4, 2009
1,573
4
Any chance of giving a walkthrough or a short guide on how to get this thing working?
 

highlandsun

Inactive Recognized Developer
Sep 15, 2009
949
272
Los Angeles
highlandsun.com
I've outlined a number of different things here, what in particular do you want a walkthru on?

Also, I've given links to email postings with example configs. Have you read those already?
 

highlandsun

Inactive Recognized Developer
Sep 15, 2009
949
272
Los Angeles
highlandsun.com
Grab the config files I posted here

https://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2010-May/089049.html

There are two - one for your server, and one to run on your phone. The way it works is you have the ffserver running on a server box with fast-enough CPU and network connectivity. You can send it any stream using any codecs that ffmpeg supports, and ffmpeg will transcode it to a dumbed-down H.264 that can play smoothly over a relatively slow network. This transcode can run at realtime or faster, it all depends on your server and what the input to ffmpeg is. This ffserver will make the data available over HTTP in FLV format.

Install the second ffserver.conf file on your phone, along with the ffserver binary I posted in this thread. You of course need to tailor the file to replace "my.server:8080" with the address and port that you're using for the ffserver on your server box. This ffserver on the phone is configured to grab the FLV over HTTP from your main server, and then re-stream over RTSP/RTP/UDP. You can play the video from your main server by opening rtsp://127.0.0.1/test.mp4 - the Meridian player makes this easy since it has an Open URL menu for this. The SeeJo player also lets you play URLs.

I don't think I can explain it any more simply than this. If you don't understand how to run ffmpeg, there's plenty of other docs on that.

If you specifically want to stream h,u,l,u videos, you'll need to grab the perl script I posted above and edit the ffmpeg command at the end of the script. The script I attached here was set up to publish a stream to the Darwin Streaming Server over rtsp. A simpler command is used to stream to ffserver.

When publishing to DSS, you have to provide all of the audio/video codec settings on the ffmpeg command line, and the stream gets pushed to rtsp://wherever/the/DSS/server/is/listening.

When publishing to ffserver, all of the audio/video codec settings are in the ffserver.conf file, so you only need to tell ffmpeg where to find its input, and send its output to http://wherever/the/ffserver/is/listening.
 

mrono

Senior Member
Jun 4, 2009
1,573
4
Grab the config files I posted here

https://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2010-May/089049.html

There are two - one for your server, and one to run on your phone. The way it works is you have the ffserver running on a server box with fast-enough CPU and network connectivity. You can send it any stream using any codecs that ffmpeg supports, and ffmpeg will transcode it to a dumbed-down H.264 that can play smoothly over a relatively slow network. This transcode can run at realtime or faster, it all depends on your server and what the input to ffmpeg is. This ffserver will make the data available over HTTP in FLV format.

Install the second ffserver.conf file on your phone, along with the ffserver binary I posted in this thread. You of course need to tailor the file to replace "my.server:8080" with the address and port that you're using for the ffserver on your server box. This ffserver on the phone is configured to grab the FLV over HTTP from your main server, and then re-stream over RTSP/RTP/UDP. You can play the video from your main server by opening rtsp://127.0.0.1/test.mp4 - the Meridian player makes this easy since it has an Open URL menu for this. The SeeJo player also lets you play URLs.

I don't think I can explain it any more simply than this. If you don't understand how to run ffmpeg, there's plenty of other docs on that.

If you specifically want to stream h,u,l,u videos, you'll need to grab the perl script I posted above and edit the ffmpeg command at the end of the script. The script I attached here was set up to publish a stream to the Darwin Streaming Server over rtsp. A simpler command is used to stream to ffserver.

When publishing to DSS, you have to provide all of the audio/video codec settings on the ffmpeg command line, and the stream gets pushed to rtsp://wherever/the/DSS/server/is/listening.

When publishing to ffserver, all of the audio/video codec settings are in the ffserver.conf file, so you only need to tell ffmpeg where to find its input, and send its output to http://wherever/the/ffserver/is/listening.

That's exactly what I was thinking of, thank you very much. I'll give it a shot tonight.
 

moose_nz

Member
Jul 17, 2005
15
0
Thanks!!!

Hi there, this post was extremely helpful and saved me the hassle of trying to compile ffmpeg myself (I'm having huge issues with this).

Are you able to post the ffmpeg compiled binary for Android also? the ffserver one was exactly what I needed!
 

highlandsun

Inactive Recognized Developer
Sep 15, 2009
949
272
Los Angeles
highlandsun.com
I didn't compile ffmpeg, I figured there's not much point in running it on a G1, the CPU is too slow to do transcoding in any reasonable amount of time.

What would you want to use it for?
 

moose_nz

Member
Jul 17, 2005
15
0
Not transcoding... Just streaming. I need to recieve and play an RTP (not RTSP stream). Unfortunately it's a bug that the current media player can _only_ recieve HTTP or RTSP streams and not straight RTP.

So my ingenious plan is:
RTP stream (pc) -> Phone FFMpeg recieve -> Sends via FFM file to localhost ffserver -> Streams via RTSP to localhost -> local mediaplayer plays RTSP stream.

No transcoding required, just straight restreaming. Unfortunately I'm having difficulties compiling ffmpeg. I think... simply as I'm not particularly skilled in this cross compiling for Android area. Other people say that ffmpeg runs fine however.

This is the only way thus far (unless you use FFMpeg to straight play the stream on Android but this is difficult and has issues I hear).
 

moose_nz

Member
Jul 17, 2005
15
0
This solution is necessary as mentioned above the inbuilt mediaplayer cannot play RTP streams (without some modifications to the opencore code which I'm not clever enough to do). Nor can I save the RTP stream to a file and play that as the mediaplayer will only play properly formed files with seek information ??? (go figure).
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Just for grins I've compiled the latest rtmpdump source using the Android 1.5 SDK. I guess it's not much use yet since we still don't have good playback of FLV files, but maybe someone here will find a good use for it.

    The source code is from http://rtmpdump.mplayerhq.hu/ This is from the 2.0 C code, not the 1.x C++ code, so it's smaller and faster...
    1
    rtmpdump-2.1.zip

    This is a fresh build of rtmpdump 2.1. Read the README for details. It contains 4 programs:

    rtmpdump - the client
    rtmpsrv - a stub server, used mainly for displaying what other clients are doing
    rtmpsuck - a transparent proxy, used to intercept a client stream and save it to disk while relaying to the client
    streams - an HTTP gateway, serves RTMP streams via HTTP