[Red5devs] Taking a snapshot from a live video feed

Walter Tak walter at waltertak.com
Wed Sep 3 06:00:33 PDT 2008


Np,

btw David uses ffmpeg on Red5 
:Process p =  Runtime.getRuntime().exec(this.FFMPEG+" -f 
flv -i - -vcodec png -vframes 1 -an -f rawvideo -s 160x120 
"+OUTPUTPATH+stream.getPublishedName()+".png");I've altered the class a bit a my app is calling a PHP-script ( using RemotingClient ) on another server which in order does the actual processing from FLV to JPG since I don't want to do the heavy ffmpeg processing on my expensive Red5 server.

After the 1-frame FLV is extracted to a directory that's accessable via http (the jetty http server on 5080 or you could use tomcat or Apache to expose the directory) the php-script 'downloads' (using curl or fopen) the 1-frame-FLV from the Red5 server to the webserver (different physical machine, could also be located in a different country/datacentre).

It isn't complicated and seperates the after-effects processing quite nicely.

I didn't want to have 200 ffmpeg processes every 30 seconds running on a live-streaming Red5 server you see ; the webserver however is a cheap node that could be load balanced by adding a few more physical servers to do the conversion job, if it would be too much to be handled by 1 server.

Walter




  Thanks for the hint, Walter. I haven't found that thread in my search before.
  http://osflash.org/pipermail/red5_osflash.org/2008-January/018263.html

  Valentin

  Walter Tak schrieb: 
Check the normal Red5 archives ; me and David Temes have discussed it and 
David made a 'snapshot' class which does exactly what you need ; it extracts 
a frame from the incoming FLV. You can convert that frame with ffmpeg 
(outside of Red5) to any fileformat like a JPG and use that 
snapshot/thumbnail to display on a frontpage for example to show ppl which 
livestreams are available and how they look like.

This does require some java-knowledge of (java/red5) schedulers , 
installation , compilation and execution of ffmpeg.

Subject "Re: [Red5] SnapshotListener" in January and February 2008.

Walter

  Hi everybody!

There are some topics about taking snapshots from a video stream on the
client using ActionScript 3, converting it into a ByteArray, encoding,
uploading, etc...

My question is about how to extract a jpeg image from a stream in the
Red5 server, better in the webapp itself.
The streams are published as "live", so there will be no file on the
disk I can operate with. Otherwise I would use ffmpeg to take a 
snapshot...

Is there a way to create a jpeg from the flv data in Red5? Where is the
point I have to start looking?

Thanks in advance,
Valentin
    

_______________________________________________
Red5devs mailing list
Red5devs at osflash.org
http://osflash.org/mailman/listinfo/red5devs_osflash.org

  



------------------------------------------------------------------------------


  _______________________________________________
  Red5devs mailing list
  Red5devs at osflash.org
  http://osflash.org/mailman/listinfo/red5devs_osflash.org



------------------------------------------------------------------------------


  No virus found in this incoming message.
  Checked by AVG. 
  Version: 7.5.524 / Virus Database: 270.6.15/1648 - Release Date: 02-09-08 17:29
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/red5devs_osflash.org/attachments/20080903/31c54d33/attachment.html 


More information about the Red5devs mailing list