0

I'm using a webcam on my Rpi to record audio video. I'm using ffmpeg and here is my command:

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

This generates a .avi file with video and audio however when I try to stream using ffserver using :

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

I get av_interleaved_write_frame(): Broken pip

How I can fix this? Any other suggestion to stream audio video (not with Motion please).

UPDATE

here is my ffserver config file

    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>

when I save the stream to a local file out.avi I can see video and audio but when I use ffserver vlc on my windows machine is not even able to display video (black screen with some sound glitches from time to time) Thanks.

1 Answers1

1

When pushing the source to ffserver you must use the ffm format. Either drop -f mpegts and make sure the URL ends in .ffm or replace it with -f ffm.

FFserver Wiki

aergistal
  • 29,947
  • 5
  • 70
  • 92