[FFmpeg-user] Unable to stream H264 via multicast

Adam Nielsen a.nielsen at shikadi.net
Wed Oct 22 10:07:24 CEST 2014


Hi all,

I'm having so many problems trying to get this to work I'm desperately
hoping someone can give me some help!

I'm trying to capture video from the Raspberry Pi's internal camera,
which can natively supply hardware-encoded H264 video.  I'd like to
then multicast this over my LAN.  You'd think it would be simple, but
I've been going for five hours now with no luck yet!

I had ffmpeg successfully multicasting over RTP with this:

  ffmpeg -f v4l2 -video_size hd720 -framerate 30 -input_format h264
    -i /dev/video0 -vcodec copy -an -f rtp rtp://224.0.1.2:5001

But any player I tried didn't work except VLC which said it needed an
SDP file.  I tried copying one that apparently ffmpeg printed when it
was run, and VLC accepted it and said it was playing but there was no
video (just the VLC logo showing where the video should be.)

I thought this would be a bit of a hassle having to maintain an SDP
file, so I switched to ffserver instead.  However although ffserver
appears to have an option for broadcasting RTP it doesn't seem to
work?  I'm also not sure where to get the SDP file from, as apparently
you can add ".sdp" onto the end of the URL or something but I just get
a 404 Not Found error doing that.  But weirdly if I run ffserver in
debug mode, the logs it prints says it returns HTTP 200 OK to these
requests even though ffplay says I get 404 or even 503 Service
Unavailable.  So I'm really confused now!

Here is my ffserver config:

HTTPPort 80
RTSPPort 81
<Feed csi.ffm>
        File /tmp/csi.ffm
        FileMaxSize 200K
</Feed>

<Stream csi.h264>
        Feed csi.ffm
        Format rtp
        MulticastAddress 224.0.1.2
        MulticastPort 5001
        MulticastTTL 4
        NoAudio
        Metadata title "CSI Camera"
</Stream>

<Stream csi.asf>
        Feed csi.ffm
        Format asf
        NoAudio
        Metadata title "CSI Camera"
</Stream>

<Stream stat.html>
        Format status
        ACL allow 192.168.0.0 192.168.0.255
</Stream>

I'm running ffmpeg with this:

  ffmpeg -f v4l2 -video_size hd720 -framerate 30 -input_format h264
    -i /dev/video0 -vcodec copy -an http://localhost/csi.ffm

If I try to play rtp://224.0.1.2 I get no data, and I can verify that
no data is being transmitted over the LAN.  If I use mplayer to play
csi.asf I get these errors:

Error while decoding frame!
[h264 @ 0x7ffbde842400]non-existing PPS 0 referenced
[h264 @ 0x7ffbde842400]decode_slice_header error
[h264 @ 0x7ffbde842400]no frame!
Error while decoding frame!
[h264 @ 0x7ffbde842400]non-existing PPS 0 referenced
[h264 @ 0x7ffbde842400]decode_slice_header error
[h264 @ 0x7ffbde842400]no frame!

I'm not really sure what to do next!  Can anyone offer any suggestions?

Many thanks,
Adam.




More information about the ffmpeg-user mailing list