Я устанавливаю ffserver в Ubuntu 16.04 UPU.Я сделал несколько потоковых видеофайлов из .webm на сайт.Теперь я не могу начать потоковую передачу с веб-камеры моего ноутбука и показать ее на веб-сайте.Нужна помощь.
Техническая информация:
Клиент-сайт: Windows 10
Веб-камера: YUV 4: 2: 2 640x480 кадров в секунду 30,0
Сервер-сайт: VPS Server Ubuntu 16.04
ffserver.conf
HTTPPort 8090
HTTPBindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 500000
CustomLog -
NoDaemon
RTSPPort 7654
RTSPBindAddress 0.0.0.0
<Feed feed1.ffm> # This is the input feed where FFmpeg will send
File ./feed1.ffm # video stream.
FileMaxSize 1G # Maximum file size for buffering video
</Feed>
<Stream camera.mjpeg>
Feed feed1.ffm
Format webm
# Audio settings
AudioCodec vorbis
AudioBitRate 64 # Audio bitrate
# Video settings
VideoCodec libvpx
VideoSize 640x480 # Video resolution
VideoFrameRate 30 # Video FPS
AVOptionVideo flags +global_header # Parameters passed to encoder
# (same as ffmpeg command-line parameters)
AVOptionVideo cpu-used 0
AVOptionVideo qmin 10
AVOptionVideo qmax 42
AVOptionVideo quality good
AVOptionAudio flags +global_header
PreRoll 15
StartSendOnKey
VideoBitRate 400
</Stream>
<Stream status.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> # Just an URL redirect for index
# Redirect index.html to the appropriate site
URL http://XX.XXX.XXX.XXX
</Redirect>
Запуск кода в Windows:
ffmpeg -f dshow -i video="USB2.0 HD UVC WebCam" -video_size 640x480 -rtbufsize 702000k -framerate 30 -pixel_format yuyv422 -f mpegts http://XXX.XXX.XX.XX:8090/feed1.ffm
Сообщение об ошибке в Windows:
Input #0, dshow, from 'video=USB2.0 HD UVC WebCam':
Duration: N/A, start: 5326.566000, bitrate: N/A
Stream #0:0: Video: mjpeg (Baseline) (MJPG / 0x47504A4D), yuvj422p(pc, bt470bg/unknown/unknown), 1280x720, 30 fps, 30 tbr, 10000k tbn, 10000k tbc
Stream mapping:
Stream #0:0 -> #0:0 (mjpeg (native) -> mpeg2video (native))
Press [q] to stop, [?] for help
[swscaler @ 06e5a000] deprecated pixel format used, make sure you did set range correctly
Output #0, mpegts, to 'http://95.183.11.180:8090/feed1.ffm':
Metadata:
encoder : Lavf58.24.101
Stream #0:0: Video: mpeg2video (4:2:2), yuv422p, 1280x720, q=2-31, 200 kb/s, 30 fps, 90k tbn, 30 tbc
Metadata:
encoder : Lavc58.42.103 mpeg2video
Side data:
cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
av_interleaved_write_frame(): Unknown error
Error writing trailer of http://95.183.11.180:8090/feed1.ffm: Error number -10054 occurred
frame= 3 fps=0.0 q=1.6 Lsize= 46kB time=00:00:00.00 bitrate=34318545.5kbits/s speed=9.07e-05x
video:84kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[http @ 06dd5c00] URL read error: -10054
Conversion failed!
Журнал FFserver:
Fri Feb 8 03:14:58 2019 178.88.140.182 - - [POST] "/feed1.ffm HTTP/1.1" 200 4096