Fluxo de vídeo da câmera usando o ffserver no Raspberry Pi?

0

Estou tentando transmitir vídeo do módulo da câmera usando o ffserver. A idéia é deixar o raspivid output h264, e deixar o ffmpeg / ffserver transmiti-lo sem re-codificar.

Minha configuração do servidor é

HTTPPort 8090
HTTPBindAddress 0.0.0.0
MaxHTTPConnections 8
MaxClients 4
MaxBandwidth 1000
CustomLog -
#NoDaemon

<Feed feed1.ffm>
    File /tmp/feed1.ffm
    FileMaxSize 5M
    ACL allow 127.0.0.1
</Feed>

<Stream live.flv>
    Feed feed1.ffm
    NoAudio
</Stream>

##################################################################
# Special streams
##################################################################
<Stream stat.html>
    Format status
    # Only allow local people to get the status
    ACL allow localhost
    ACL allow 192.168.0.0 192.168.255.255
</Stream>

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

eu corro

ffserver -f server.conf &

e depois

raspivid -t 0 -w 640 -h 480 -b 1024000 -fps 5 -ih -n -o - | \
  ffmpeg -i - -c:v copy -r 5 -an -f flv -override_ffserver \
  http://localhost:8090/feed1.ffm

No entanto, o ffmpeg reclama

[flv @ 0x215e520] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
Thu Mar  3 02:58:36 2016 127.0.0.1 - - [POST] "/feed1.ffm HTTP/1.1" 200 276
av_interleaved_write_frame(): Connection reset by peer
[flv @ 0x215e520] Failed to update header with correct duration.
[flv @ 0x215e520] Failed to update header with correct filesize.
Error writing trailer of http://localhost:8090/feed1.ffm: Connection reset by peer

e depois saia.

Como corrijo isso?

BTW, testei raspivid e ffmpeg com algo como

raspivid -t 0 -w 640 -h 480 -o - | ffmpeg -i - -c:v copy test.mkv

e funcionou normalmente.

    
por MetroWind 04.03.2016 / 17:08

1 resposta

1

Nos casos em que a saída do ffmpeg está sendo transmitida para o ffserver, a configuração do formato de saída causará esse erro.

Você especificou o formato de saída no arquivo de configuração ffserver, então remova o comando -f flv do seu comando ffmpeg:

raspivid -t 0 -w 640 -h 480 -b 1024000 -fps 5 -ih -n -o - | \
ffmpeg -i - -c:v copy -r 5 -an -override_ffserver \
http://localhost:8090/feed1.ffm
    
por 24.02.2018 / 19:41