User Tools

Site Tools


informatica:linux:ffserver

This is an old revision of the document!


ffserver

ffserver ffmpeg rstp server servidor

ffserver es parte del paquete ffmpeg. En esta receta vamos a configurarlo para servir un archivo multimedia (un video) a través del protocolo rstp.

Instalación

1. Instalar el paquete ffmpeg

aptitude update && aptitude install ffmpeg

Servir un archivo local vía rstp

1. Mover el archivo de configuración original por si las moscas:

mv /etc/ffserver.conf /etc/ffserver.original

2. Crear un archivo nuevo:

nano /etc/ffserver.conf

Con el siguiente contenido:

# Port on which the server is listening. You must select a different
# port from your standard HTTP web server if it is running on the same
# computer.
Port 8090

# Anyadido
RTSPPort 554

# Address on which the server is bound. Only useful if you have
# several network interfaces.
BindAddress 0.0.0.0

# Number of simultaneous HTTP connections that can be handled. It has
# to be defined *before* the MaxClients parameter, since it defines the
# MaxClients maximum limit.
MaxHTTPConnections 2000

# Number of simultaneous requests that can be handled. Since FFServer
# is very fast, it is more likely that you will want to leave this high
# and use MaxBandwidth, below.
MaxClients 1000

# This the maximum amount of kbit/sec that you are prepared to
# consume when streaming to clients.
MaxBandwidth 10000

# Access log file (uses standard Apache log file format)
# '-' is the standard output.
CustomLog -

# Suppress that if you want to launch ffserver as a daemon.
#NoDaemon

##################################################################
# RTSP examples
#
# You can access this stream with the RTSP URL:
#   rtsp://localhost:554/prueba.mpeg
#
# A non-standard RTSP redirector is also created. Its URL is:
#   http://localhost:8090/prueba.mpeg

<Stream prueba.mpeg>
Format rtp
File "/ruta/a/mi_archivo.mpeg"
</Stream>

3. Grabar y salir

NOTA Se pueden almacenar más de un bloque <Stream> en el mismo archivo, pero tras cada cambio hay que matar/arrancar ffserver.

4. Arrancar ffserver como demonio:

ffserver

5. Desde la misma máquina (u otra cambiando lógicamente la ip) probar:

rtsp://localhost:554/prueba.mpg

Configuración de iptables

REVISAR En principio funciona, pero no debería, pues creo que el protocolo rstp envía algo por UDP

iptables -A INPUT -p tcp -m tcp --dport 5666 -j ACCEPT
informatica/linux/ffserver.1267213891.txt.gz · Last modified: 2015/04/13 20:19 (external edit)