[英]Error being thrown by ffmpeg and ffserver, not getting a stream
i am trying to stream a file that I have in my directory using ffmpeg and ffserver. 我正在尝试使用ffmpeg和ffserver流式传输我目录中的文件。 But an error occurs in both ffmpeg and ffserver.
但是,ffmpeg和ffserver都发生错误。 The following is my ffserver config file.
以下是我的ffserver配置文件。
HTTPPort 8092
HTTPBindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 2000
CustomLog -
#NoDaemon
NoDefaults
<Feed feed1.ffm>
File /tmp/feed1.ffm
FileMaxSize 20M
ACL allow 127.0.0.1
</Feed>
<Stream live.webm>
Feed feed1.ffm
Format webm
AudioCodec vorbis
AudioBitRate 64
VideoCodec libvpx
VideoSize 720x576
VideoFrameRate 25
AVOptionVideo flags +global_header
AVOptionVideo cpu-used 0
AVOptionVideo qmin 10
AVOptionVideo qmax 42
AVOptionVideo quality good
AVOptionAudio flags +global_header
PreRoll 15
StartSendOnKey
VideoBitRate 400
AudioSampleRate 44100
</Stream>
I am able to start ffserver properly with no problems but when i try to serve ffserver with a file using ffmpeg, this happens 我能够正常启动ffserver,没有问题,但是当我尝试使用ffmpeg为ffserver提供文件时,会发生这种情况
ffmpeg -i sam.webm http://127.0.0.1:8092/feed1.ffm -vcodec copy
ffmpeg version N-72738-g7630cce Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
configuration: --enable-libvpx --enable-libvorbis --enable-libx264 --enable-gpl --enable-nonfree
libavutil 54. 27.100 / 54. 27.100
libavcodec 56. 41.100 / 56. 41.100
libavformat 56. 36.100 / 56. 36.100
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 16.101 / 5. 16.101
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.100 / 1. 2.100
libpostproc 53. 3.100 / 53. 3.100
Trailing options were found on the commandline.
Input #0, matroska,webm, from 'sam.webm':
Metadata:
title : Sintel Trailer
encoder : Lavf56.25.101
Duration: 00:00:52.21, start: 0.000000, bitrate: 305 kb/s
Stream #0:0: Video: vp8, yuv420p, 854x480, SAR 1:1 DAR 427:240, 24 fps, 24 tbr, 1k tbn, 1k tbc (default)
Stream #0:1: Audio: vorbis, 48000 Hz, stereo, fltp (default)
[libvpx @ 0x367e180] v1.3.0
Output #0, ffm, to 'http://127.0.0.1:8092/feed1.ffm':
Metadata:
title : Sintel Trailer
creation_time : now
encoder : Lavf56.36.100
Stream #0:0: Audio: vorbis (libvorbis), 44100 Hz, stereo, fltp, 64 kb/s (default)
Metadata:
encoder : Lavc56.41.100 libvorbis
Stream #0:1: Video: vp8 (libvpx), yuv420p, 720x576 [SAR 427:300 DAR 427:240], q=10-42, 400 kb/s, 24 fps, 1000k tbn, 25 tbc (default)
Metadata:
encoder : Lavc56.41.100 libvpx
Stream mapping:
Stream #0:1 -> #0:0 (vorbis (native) -> vorbis (libvorbis))
Stream #0:0 -> #0:1 (vp8 (native) -> vp8 (libvpx))
Press [q] to stop, [?] for help
av_interleaved_write_frame(): Connection reset by peer
Last message repeated 2 times
frame= 14 fps=0.0 q=0.0 Lsize= 16kB time=00:00:00.56 bitrate= 234.1kbits/s dup=1 drop=0
video:1kB audio:2kB subtitle:0kB other streams:0kB global headers:4kB muxing overhead: 327.780670%
Conversion failed!
And this is the message i get in ffserver when this error happens in ffmpeg. 这是我在ffmpeg中发生此错误时在ffserver中收到的消息。
ffserver
ffserver version N-72738-g7630cce Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
configuration: --enable-libvpx --enable-libvorbis --enable-libx264 --enable-gpl --enable-nonfree
libavutil 54. 27.100 / 54. 27.100
libavcodec 56. 41.100 / 56. 41.100
libavformat 56. 36.100 / 56. 36.100
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 16.101 / 5. 16.101
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.100 / 1. 2.100
libpostproc 53. 3.100 / 53. 3.100
Mon Jun 8 18:38:28 2015 FFserver started.
Mon Jun 8 18:38:40 2015 127.0.0.1 - - [GET] "/feed1.ffm HTTP/1.1" 200 4175
Mon Jun 8 18:38:40 2015 [NULL @ 0x29878a0]Missing key or no key/value separator found after key 'pkt_timebase'
Mon Jun 8 18:38:40 2015 Feed '/tmp/feed1.ffm' stream number does not match registered feed
Mon Jun 8 18:38:40 2015 127.0.0.1 - - [POST] "/feed1.ffm HTTP/1.1" 200 4096
Can someone please help me? 有人可以帮帮我吗?
If you have the file in your directory you could try to skip the feed section. 如果您的目录中有该文件,则可以尝试跳过Feed部分。 This way,
ffserver
will make the file ready for streaming when the server gets started and you don't have to use the ffmpeg
-command. 这样,当服务器启动时,
ffserver
将使文件准备好流式传输,而您不必使用ffmpeg
-command。
Instead of : 代替 :
<Stream live.webm>
Feed feed1.ffm
...
Use: 采用:
<Stream live.webm>
Format webm #if needed
File "sam.webm"
...
You might want to go through the feed, if you want to manipulate the file first. 如果您要先处理文件,则可能要遍历提要。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.