On 22.04.2016 16:51, Adrian Popa wrote:
> Salutare,
> 
> Încerc să-mi transform webcam-ul uvc-compliant într-o cameră IP cu suport
> RTSP. Până acum am reușit să înregistrez conținutul expus de webcam (format
> nativ mjpeg) în format video (mp4), dar încă nu reușesc să transform
> ffmpeg-ul într-un server rtsp.
> 
> Spre exemplu, așa pot genera un fișier mp4 cu video și audio din cameră:
> ffmpeg -framerate 3 -f mjpeg -i /dev/video0 -f alsa -i
> plughw:CARD=Camera,DEV=0 -acodec libmp3lame -c:v libx264 -preset ultrafast
> -r 25 -pix_fmt yuv420p -b:v 1500k -f m4v /tmp/file.mp4
> 
> Din câte am căutat pe net ar trebui să folosesc ffserver pentru a se ocupa
> de semnalizarea de RTSP și am încercat să îi dau drumul cu următorul config:
> 
> HTTPPort 8099
> HTTPBindAddress 0.0.0.0
> MaxHTTPConnections 2000
> MaxClients 1000
> MaxBandwidth 1000
> CustomLog -
> <Feed mjpg-streamer.ffm>
> File /tmp/mjpg-streamer.ffm
> FileMaxSize 200K
> ACL allow 127.0.0.1
> </Feed>
> 
> <Stream live.h264>
> Format rtp
> Feed mjpg-streamer.ffm
> VideoCodec libx264
> </Stream>
> 
> ffserver pornește (dar nu ascultă pe 544/8544 - trebuie să mai sap), dar
> dacă îi spun lui ffmpeg să scrie în /tmp/mjpg-streamer.ffm îmi scrie
> streamul acolo ca fișier în loc să se pregătească de streaming. Probabil că
> îmi lipsesc ceva parametrii.
> 
> Aveți vreo idee? S-a jucat cineva cu setupul ăsta?
> 
> După ce o să meargă, mai trebuie să îi fac ceva - să pornească streamul
> ffmpeg după ce se conectează clientul - nu are sens să transcodeze non-stop
> pentru 5 minute de view time pe zi. Ideas?

M-am jucat cu ceva asemănător acum vreo trei ani, când avem un tuner
DVB-T.  Atașez un config ce mi-a rămas și știu că era funcțional cu
ffmpeg-ul de pe atunci…  Parametrii îs tunați pentru hardware-ul meu, nu
ducea mai mult de atât, în paralel cu decodarea stream-ului DVB-T de pe
canalul TVR HD (1080i parcă).  HTH

Port 34567                      # Port to bind the server to
BindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 10000             # Maximum bandwidth per client
                               # set this high enough to exceed stream bitrate
CustomLog -
#NoDaemon                       # Remove this if you want FFserver to daemonize 
after start

<Feed stream.ffm>         # This is the input feed where FFmpeg will send
   File /tmp/stream.ffm            # video stream.
   FileMaxSize 10MB              # Maximum file size for buffering video
   ACL deny 192.168.13.13
</Feed>

<Stream OnlineDVB-T.webm>       # Output stream URL definition
   Feed stream.ffm              # Feed from which to receive video
   Format webm

   # Audio settings
   AudioCodec vorbis
   AudioBitRate 64             # Audio bitrate
#   AudioCodec libvorbis
#   AudioBitRate 128
#   AudioChannels 2
#   AudioSampleRate 48000

   # Video settings
   VideoCodec libvpx
   VideoSize 512x384
#   VideoSize 640x480           # Video resolution
#   VideoSize 768x576           # Video resolution
#   VideoSize 512x288           # Video resolution
#   VideoSize 640x368           # Video resolution
#   VideoSize 768x432
#   VideoSize hd720
   VideoFrameRate 25           # Video FPS
   AVOptionVideo flags +global_header  # Parameters passed to encoder 
                                       # (same as ffmpeg command-line 
parameters)
   AVOptionVideo cpu-used 1
   AVOptionVideo qmin 10
   AVOptionVideo qmax 42
   AVOptionVideo quality good
   AVOptionAudio flags +global_header
   PreRoll 15
   StartSendOnKey
   VideoBitRate 800            # Video bitrate
</Stream>

<Stream status.html>     # Server status URL
   Format status
   # Only allow local people to get the status
   ACL allow 192.168.13.1 192.168.13.128
</Stream>

<Redirect index.html>    # Just an URL redirect for index
   # Redirect index.html to the appropriate site
   URL http://www.ffmpeg.org/
</Redirect>

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
RLUG mailing list
[email protected]
http://lists.lug.ro/mailman/listinfo/rlug

Raspunde prin e-mail lui