h264_omx and non-existing PPS 0 referenced Trying to stream a webcam through rtp with a raspberry pi.

Cating the SDP file on my desktop, and launching ffplay:

ffplay sdp.out


then streaming out this way:

ffmpeg -i /dev/video0 -c:v h264_omx -f rtp rtp://192.168.0.101:1234


works perfectly. But If I launch ffmpeg first THEN ffplay, ffplay stutters some error message about missing PPS and never displays any frame:

[h264 @ 0x7fd97c0008c0] decode_slice_header error
[h264 @ 0x7fd97c0008c0] no frame!
[h264 @ 0x7fd97c0008c0] non-existing PPS 0 referenced


After looking for a while I understand some intermediary frame might be missing. However, using the -g option this way does not change anything:

ffmpeg -i /dev/video0 -c:v h264_omx -g 30 -f rtp rtp://192.168.0.101:1234


It is a problem for me because I am using the raspberry as a securiy camera. My desktop can be restarted from time to time and I need ffplay to be able to catch after the streaming is started.

Any help is appreciated.
It turns out it is impossible to live stream with the RPi hardware acceleration using ffmpeg.
For ffmpeg to configure the hardware acceleration to issue SPS/PPS frames during the stream and not only at the beginning of it, it needs to use a specific API of the raspberry firmware which it does not at the moment. 

Raspivid and gstreamer does that though. So turn to thoses solution and forget about ffmpeg.