Die Flexperten Herrlich & Ramuschkat

FFmpeg mit RTMP Anbindung

FFmeg ist eine Opensource Video Konvertierungsengine, über die man Kommandozeilen basiert Video Dateien von einem Format in ein anderen konvertieren kann. http://www.ffmpeg.org/

Relativ neu ist, dass man mittels einer externen Library LibRTMP Video-Dateien beliebiger Formate auch direkt als LiveStream an den Flash Media Server einspeisen kann.

Um an die LibRTMP Datei zu gelangen, muss man zunächst das RTMPDump Projekt herunterladen. http://rtmpdump.mplayerhq.hu/download/ Am besten dort die neueste Version für z.B. Windows (rtmpdump-2.3-windows.zip) nehmen. Aus dem ZIP die Datei librtmp.dll herauskopieren und in das FFmpeg Bin Verzeichnis kopieren.

Record a live stream from a RTMP server

These instructions assume you have a Adobe FMS server running on the machine “localhost”, and have an application named “live”. The live application is installed by default on FMS.

  1. First, connect your current encoding tool to rtmp://localhost/live.
  2. Then, publish a stream named “testStream” with your favorite parameters.
  3. Finally execute the following command to record a FLV file to disk of that stream:
 ffmpeg -i rtmp://localhost/live/testStream -acodec copy -vcodec copy -y test.flv

Publish a H264 MP4 file as a live stream to a RTMP server

These instructions assume you have a Adobe FMS server running on the machine “localhost”, and have an application named “live”. The live application is installed by default on FMS.

The file we are going to publish is named “testfile.mp4″

  1. First, connect your current video playback tool to rtmp://localhost/live.
  2. Then, start playing a stream named “testStream” with your favorite parameters (it will be smoother if you buffer 2-3 seconds).
  3. Finally, execute this FFmpeg command to ‘stream’ the file to the RTMP server:
 ffmpeg -i testfile.mp4 -re -acodec copy -vcodec copy -f flv rtmp://localhost/live/testStream

Mehr Beispiele findet man hier:  http://wiki.xuggle.com/Live_Encoding_Tutorial

No comments yet

Einen Kommentar schreiben