[This is a cross post from the Gstreamer Gforge forums. I'm posting here mainly because mainly my issue is related to the TI H.264 encoder. Click here to jump directly to the PPS errors)
Hi all,
I'm using a DM6467 based design (repeatable on a DM6467EVM) using MVL 4.0, DVSDK 1.40, DMAI 1.16 and gstreamer_ti 1.00. When starting a simple RTP server pipeline, shown below, I run into problems based on the order of which was started first - the client or the server. Additionally, once the client successfully connects and plays back the RTP stream, if the gstreamer-based client is paused, the stream cannot be restarted on resume. Here's how to reproduce:
Server pipeline:
DM6467:
gst-launch -v v4l2src always-copy=false ! TIVidenc1 codecName=h264enc engineName=encode contiguousInputFrame=true ! rtph264pay ! udpsink port=5004 host=192.168.1.101
Test PC:
gst-launch -v videotestsrc is-live=1 ! x264enc ! rtph264pay ! udpsink host=192.168.1.101 port=5004
gst-launch -v v4l2src ! x264enc ! rtph264pay ! udpsink host=192.168.1.101 port=5004
Client pipeline/.sdp file:
[Fedora 11 machine w/gstreamer 0.10.23]
gst-launch -v udpsrc port=5004 caps="application/x-rtp, media=video, encoding-name=H264,clock-rate=90000" ! rtph264depay ! ffdec_h264 ! ffmpegcolorspace ! autovideosink
I am also using totem which is gstreamer based. The following .sdp is used:
v=0
o=- 1188340656180883 1 IN IP4 192.168.1.101
s=Session streamed by GStreamer
i=server.sh
t=0 0
a=tool:GStreamer
a=type:broadcast
m=video 5004 RTP/AVP 96
c=IN IP4 192.168.1.101
a=rtpmap:96 H264/90000
a=fmtp:96 sprop-parameter-sets=Z0KAH/QFoeiA
a=fmtp:96 profile-level-id=42801f
Totem is started from the command line with:
totem --gst-debug=ffmpeg:5 Recevier_video.sdp
| Order | Initial connection | After Pause/Resume |
| Server first, client second | No Video | No Video |
| Client first, serv | Video | No Video |
To sum of days/weeks of research and frustration, I believe there's an issue with TI H.264 encoder. Using similar server pipelines (shown above marked Test PC), all criteria from the above execution matrix yield video playback. The complaint from totem is:
0:00:13.914249694 23113 0xb501cb60 LOG ffmpeg gstffmpegdec.c:2231:gst_ffmpegdec_chain:<ffdec_h2641> Received new data of size 2333, ts:0:00:02.577663218, dur:99:99:99.999999999
0:00:13.914294672 23113 0xb501cb60 LOG ffmpeg gstffmpegdec.c:2270:gst_ffmpegdec_chain:<ffdec_h2641> Calling av_parser_parse with ts:0:00:02.577663218
0:00:13.914325961 23113 0xb501cb60 ERROR ffmpeg :0:: non-existing PPS referenced
0:00:13.914344119 23113 0xb501cb60 LOG ffmpeg gstffmpegdec.c:2279:gst_ffmpegdec_chain:<ffdec_h2641> parser returned res 0 and size 2309
0:00:13.914363116 23113 0xb501cb60 LOG ffmpeg gstffmpegdec.c:2285:gst_ffmpegdec_chain:<ffdec_h2641> consuming 2309 bytes. ts:0:00:02.544296551
0:00:13.914383510 23113 0xb501cb60 LOG ffmpeg gstffmpegdec.c:1917:gst_ffmpegdec_frame:<ffdec_h2641> data:0x868bcf0, size:2309, ts:0:00:02.577663218, dur:99:99:99.999999999
0:00:13.914408653 23113 0xb501cb60 ERROR ffmpeg :0:: non-existing PPS referenced
0:00:13.914426532 23113 0xb501cb60 ERROR ffmpeg :0:: decode_slice_header error
0:00:13.914477377 23113 0xb501cb60 ERROR ffmpeg :0:: no frame!
0:00:13.914501961 23113 0xb501cb60 DEBUG ffmpeg gstffmpegdec.c:1524:gst_ffmpegdec_video_frame:<ffdec_h2641> after decode: len -1, have_data 0
0:00:13.914520958 23113 0xb501cb60 DEBUG ffmpeg gstffmpegdec.c:1689:gst_ffmpegdec_video_frame:<ffdec_h2641> return flow 0, out (nil), len -1
0:00:13.914541910 23113 0xb501cb60 WARN ffmpeg gstffmpegdec.c:1955:gst_ffmpegdec_frame:<ffdec_h2641> ffdec_h264: decoding error (len: -1, have_data: 0)
0:00:13.914560907 23113 0xb501cb60 LOG ffmpeg gstffmpegdec.c:2368:gst_ffmpegdec_chain:<ffdec_h2641> Decoding error, trying next
0:00:13.914562304 23113 0xb501cb60 LOG ffmpeg gstffmpegdec.c:2382:gst_ffmpegdec_chain:<ffdec_h2641> Before (while bsize>0). bsize:2333 , bdata:0x8774000
0:00:13.914604209 23113 0xb501cb60 LOG ffmpeg gstffmpegdec.c:2270:gst_ffmpegdec_chain:<ffdec_h2641> Calling av_parser_parse with ts:0:00:02.577663218
0:00:13.914627396 23113 0xb501cb60 LOG ffmpeg gstffmpegdec.c:2279:gst_ffmpegdec_chain:<ffdec_h2641> parser returned res 2333 and size 0
0:00:13.914646113 23113 0xb501cb60 LOG ffmpeg gstffmpegdec.c:2285:gst_ffmpegdec_chain:<ffdec_h2641> consuming 0 bytes. ts:0:00:02.577663218
I initially thought there was an issue with the duration length of the frame but that was misguided. Instead it's the non-existing PPS error. This is what's leading me to believe there is an encoder issue. What I believe is that the encoder is not sending the PPS NAL unit more than once (when the stream is first started) so when a client attempts to connect after the server is started, that information isn't there. Unfortunately, I'm reaching the extent of my knowledge of H.264 so I'm hoping I'm on the right track.
Has anyone run into this same issue and resolved it? Can I force the encoder from hopefully the DMAI layer to resend the PPS NALU periodically? It's not clear in the H.264 users guide (SPRUFD9) on how to configure this.
And no, I can't use MVL 5.0 which probably limits me DVSDK < 2.00. It's a licensing issue.
Thanks in advance and Happy(?) New Year!
Emile Semmes