【发布时间】:2015-11-03 14:17:23
【问题描述】:
我在我的 Rpi 上使用网络摄像头来录制音频视频。我正在使用 ffmpeg 这是我的命令:
ffmpeg -y -ac 1 -f alsa -i hw:1,0 -i /dev/video1 -r 10 -s 120*120 -async 1 -strict -2 -c:a aac -pix_fmt yuv420p -threads 0 -ar 44100 -f mpegts out.avi
这会生成一个带有视频和音频的.avi 文件,但是当我尝试使用 ffserver 流式传输时:
ffmpeg -y -ac 1 -f alsa -i hw:1,0 -i /dev/video1 -r 10 -s 120*120 -async 1 -strict -2 -c:a aac -pix_fmt yuv420p -threads 0 -ar 44100 -f mpegts http\\some_ip:someport\webcam.ffm
我收到av_interleaved_write_frame(): Broken pip
我该如何解决这个问题?任何其他流式传输音频视频的建议(请不要使用 Motion)。
更新
这是我的 ffserver 配置文件
Port 8090
BindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 1000
CustomLog -
#NoDaemon
<Feed feed1.ffm>
File /tmp/feed1.ffm
FileMaxSize 200K
ACL allow 127.0.0.1
</Feed>
# if you want to use mpegts format instead of flv
# then change "live.flv" to "live.ts"
# and also change "Format flv" to "Format mpegts"
<Stream live.avi>
Format mpegts
Feed feed1.ffm
VideoCodec mjpeg
VideoFrameRate 30
VideoBitRate 512
VideoSize 320x240
AVOptionVideo crf 23
AVOptionVideo preset medium
# for more info on crf/preset options, type: x264 --help
AVOptionVideo flags +global_header
AudioCodec aac
Strict -2
AudioBitRate 128
AudioChannels 2
AudioSampleRate 44100
AVOptionAudio flags +global_header
</Stream>
当我将流保存到本地文件 out.avi 时,我可以看到视频和音频,但是当我在 Windows 机器上使用 ffserver vlc 时甚至无法显示视频(不时出现一些声音故障的黑屏) 谢谢。
【问题讨论】:
标签: video ffmpeg raspberry-pi broken-pipe