Playing a Live Stream while simultaneously saving it
Here's my solution for playing a live stream whilst rtmpdump is saving it to disk, or for playing an on-demand stream whilst rtmpdump is downloading it, using Windows 98.
Note - The following solution will work for ANY download of a radio or television show (even non-BBC shows), using ANY download method (not just rtmpdump). Even if you use an automated downloader such as get_iplayer or iplayer_dl the following procedure will play the file while it's still downloading - a godsend for live streams!)
This uses the program FFPLAY.EXE (which is included in standard distributions of ffmpeg). You run it in a seperate (i.e. second) DOS window at the same time that rtmpdump is downloading the rtmp stream in a DOS window.
(NB: A DOS window is called a "command window" in WinXP, as Micro$oft are pretending that MS-DOS is not included in the operating system.)
Here's a version of ffmpeg which will run under Windows 98 (SVN-r16573) (13 Jan 2009):
http://ffmpeg.arrozcru.org/.../ffmpeg-r16537-gpl-shared-win32.tar.bz2
(Note: The latest ffmpeg version which runs on Win9x is release r21874)
An important point is that the batch file
must be in the same folder (directory) into which rtmpdump is saving the rtmp stream.
Another important point is that
both RTMPDUMP and FFPLAY must be set to use .FLV as the file type, because the batch file (see below) sets FFPLAY to play any file with that file type in the current directory.
1. Playing a Radio show while downloading it
This is the content of my successful batch (.BAT) file for a radio show (using the option
-vn to specify
no video, as this is a radio stream) -
:: Syntax
:: ffplay [options] 'input_file'
:: Play radio stream while it's downloading
"C:\Program Files\ffmpeg\ffplay.exe" -vn *.flv
(Note: This works for both a Live stream and an On-demand stream)
Here's an alternative command line -
Play a Radio stream as it Downloads: With Buffer, No Display
"C:\Program Files\ffmpeg\ffplay.exe" -vn -nodisp -bufsize 4096 *.flv
2. Playing a TV show while downloading it
I then tried this procedure on a television stream, successfully. I was
astonished at how the crappy performance of Flash Player on Windows 98 was magically replaced by a perfect video stream. The TV stream (an on-demand tv show) played
perfectly, with no hesitating or dropped frames.
I used only one trick! I didn't start the show playing in FFPLAY until rtmpdump had been downloading the show for 15 seconds, thus building-in a 15 second buffer.
Note: I had set rtmpdump to save the TV show as a file with the extension .mp4 on this occasion. If you save a show as a .flv file, remember to alter the command line (below) from *.mp4 to *.flv instead.
It was a revelation, using the following command line in the above batch file instead of the radio command -
Play on-demand TV show with 4MB Buffer
"C:\Program Files\ffmpeg\ffplay.exe" -bufsize 4096 *.mp4