There have been lots of topics on this subject..
We've implemented a solution for dumping here.

mplayer to dump any stream to a file,
then use ffmpeg to encode to flv


afterwards you can easily stream the flv file.



#!/bin/bash
# © Camillo Bruni 2007
# [EMAIL PROTECTED]
# first param

if [[ $# -lt 2  || $# -gt 4 ]]
then
  echo "usage:";
echo " streamDump.sh \$stream \$outputfile [\$recordtime] [\ $evalEndScript]";
  exit 0;
fi

TMP_DIR=/tmp/record;
RECORD_TIME=30;


if [ -n "$3" ]
then
        RECORD_TIME=$3;
fi

PID=0;
mkdir -p $TMP_DIR;
dumpfile=`mktemp /tmp/record/tmprecord.XXXXXX` || exit 1;

# if the stream ends with .mjpg attach that name to the tmpname
# because ffmpeg has some troubles to recognize the right filetype
filend=`expr //$1 : '.*\.\(.*\)'`;

/usr/local/bin/mplayer -dumpstream $1 -dumpfile $dumpfile &

PID=$!;
sleep 1; #startup time for the mplayer
sleep $RECORD_TIME;
kill $PID;

#append the filending otherwise ffmpeg doesnt recognize the filetype
mv $dumpfile $dumpfile.$filend;
dumpfile=$dumpfile.$filend
# convert to destination
/usr/local/bin/ffmpeg -i $dumpfile $2;

rm $dumpfile;

# evaluate the last argument as a command line script;
if [ -n "$4" ]
then
        eval $4;
fi





Am 27.05.2007 um 23:25 schrieb Tom Krcha:

Men,

the solution is really simple and works also for live streams, just use BitmapData and draw method in Flex. There is a limitation connected with this issue. You can't draw BitmapData from RTMP stream, but ... ... you have to dettach NetStream from Video instance. Use this trick on client (Flex):

video.attachNetStream(null);
// HERE DRAW BITMAPDATA - find some tutorial for this on net, be sure, you are drawing "video" instance.
//
video.attachNetStream(yourStream);

and your stream will also flow on.

Good Luck.

Tom

2007/5/26, Daniel Gwerzman <[EMAIL PROTECTED] >:
The ffmpeg is working perfect when you have a flv file saved in the server.
But when I do a live stream I have no file on the server.


>From: nomIad <[EMAIL PROTECTED]>
>Reply-To: [email protected]
>To: [email protected]
>Subject: Re: [Red5] Capture image from video broadcasting
>Date: Fri, 25 May 2007 16:39:31 +0200
>
>Just an idea. You can capture jpgs out of a stream with ffmpeg.
>You could possible save the stream to disk (iv seen such a method, but dont
>know what happens with the live stream), execute ffmpeg, to capture a
>frame, save
>the frame for the client.
>
>mfg nomIad
>
>Daniel Gwerzman schrieb:
>>Hi all,
>>I need you help.
>>I build application with few video broadcasting (each one in a different
>>Scope).
>>I want to show a purview images of the each broadcast. I will capture the >>images every few minutes and save it on the web-server, from the client
>>side the flash will load the images.
>>I donâ??t know how to do the capture the images of the broadcasting from
>>the server side.
>>
>>Any ideas?
>>
>>_________________________________________________________________
>>PC Magazine?s 2007 editors? choice for best Web mail?award- winning Windows
>>Live Hotmail.
>>http://imagine-windowslive.com/hotmail/?locale=en- us&ocid=TXT_TAGHM_migration_HM_mini_pcmag_0507
>>
>>
>>
>>-------------------------------------------------------------------- ----
>>
>>_______________________________________________
>>Red5 mailing list
>>[email protected]
>>http://osflash.org/mailman/listinfo/red5_osflash.org
>>
>


>_______________________________________________
>Red5 mailing list
>[email protected]
>http://osflash.org/mailman/listinfo/red5_osflash.org

_________________________________________________________________
Make every IM count. Download Messenger and join the i'm Initiative now.
It's free. http://im.live.com/messenger/im/home/?source=TAGHM_MAY07



_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org


_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org

_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org

Reply via email to